mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 17:59: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();
|
_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());
|
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
||||||
|
|
||||||
DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree());
|
DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree());
|
||||||
|
|
|
@ -65,6 +65,10 @@ public slots:
|
||||||
|
|
||||||
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
||||||
|
|
||||||
|
// octree query adjustments
|
||||||
|
void setQueryUsesFrustum(bool queryUsesFrustum) { _octreeQuery.setUsesFrustum(queryUsesFrustum); }
|
||||||
|
void setQueryJSONParameters(QJsonObject queryJSONParameters) { _octreeQuery.setJSONParameters(queryJSONParameters); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
JurisdictionListener* _jurisdictionListener = nullptr;
|
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||||
OctreeQuery _octreeQuery;
|
OctreeQuery _octreeQuery;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include "OctreeConstants.h"
|
#include "OctreeConstants.h"
|
||||||
#include "OctreeQuery.h"
|
#include "OctreeQuery.h"
|
||||||
|
|
||||||
|
const QString OctreeQuery::NON_DEFAULT_FILTER = "+";
|
||||||
|
|
||||||
|
|
||||||
OctreeQuery::OctreeQuery() {
|
OctreeQuery::OctreeQuery() {
|
||||||
_maxQueryPPS = DEFAULT_MAX_OCTREE_PPS;
|
_maxQueryPPS = DEFAULT_MAX_OCTREE_PPS;
|
||||||
|
|
|
@ -43,6 +43,8 @@ public:
|
||||||
OctreeQuery();
|
OctreeQuery();
|
||||||
virtual ~OctreeQuery() {}
|
virtual ~OctreeQuery() {}
|
||||||
|
|
||||||
|
static const QString NON_DEFAULT_FILTER;
|
||||||
|
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
int parseData(ReceivedMessage& message) override;
|
int parseData(ReceivedMessage& message) override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue