mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 21:30:33 +02:00
leverage OctreeQuery enhancements in EntityScriptServer/OHV
This commit is contained in:
parent
ed68d5a7a2
commit
6e6f2c50b8
4 changed files with 16 additions and 0 deletions
|
@ -89,6 +89,14 @@ void EntityScriptServer::run() {
|
|||
|
||||
_entityViewer.init();
|
||||
|
||||
// setup the JSON filter that asks for entities with a non-default serverScripts property
|
||||
QJsonObject queryJSONParameters;
|
||||
queryJSONParameters["serverScripts"] = OctreeQuery::NON_DEFAULT_FILTER;
|
||||
|
||||
// setup the JSON parameters so that OctreeQuery does not use a frustum and uses our JSON filter
|
||||
_entityViewer.setQueryUsesFrustum(false);
|
||||
_entityViewer.setQueryJSONParameters(queryJSONParameters);
|
||||
|
||||
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
||||
|
||||
DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree());
|
||||
|
|
|
@ -65,6 +65,10 @@ public slots:
|
|||
|
||||
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
||||
|
||||
// octree query adjustments
|
||||
void setQueryUsesFrustum(bool queryUsesFrustum) { _octreeQuery.setUsesFrustum(queryUsesFrustum); }
|
||||
void setQueryJSONParameters(QJsonObject queryJSONParameters) { _octreeQuery.setJSONParameters(queryJSONParameters); }
|
||||
|
||||
private:
|
||||
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||
OctreeQuery _octreeQuery;
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include "OctreeConstants.h"
|
||||
#include "OctreeQuery.h"
|
||||
|
||||
const QString OctreeQuery::NON_DEFAULT_FILTER = "+";
|
||||
|
||||
|
||||
OctreeQuery::OctreeQuery() {
|
||||
_maxQueryPPS = DEFAULT_MAX_OCTREE_PPS;
|
||||
|
|
|
@ -43,6 +43,8 @@ public:
|
|||
OctreeQuery();
|
||||
virtual ~OctreeQuery() {}
|
||||
|
||||
static const QString NON_DEFAULT_FILTER;
|
||||
|
||||
int getBroadcastData(unsigned char* destinationBuffer);
|
||||
int parseData(ReceivedMessage& message) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue