mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 05:44:12 +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
assignment-client/src/scripts
libraries/octree/src
|
@ -88,6 +88,14 @@ void EntityScriptServer::run() {
|
|||
_entityViewer.setJurisdictionListener(entityScriptingInterface->getJurisdictionListener());
|
||||
|
||||
_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());
|
||||
|
||||
|
|
|
@ -64,6 +64,10 @@ public slots:
|
|||
int getMaxPacketsPerSecond() const { return _maxPacketsPerSecond; }
|
||||
|
||||
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;
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include "OctreeConstants.h"
|
||||
#include "OctreeQuery.h"
|
||||
|
||||
const QString OctreeQuery::NON_DEFAULT_FILTER = "+";
|
||||
|
||||
|
||||
OctreeQuery::OctreeQuery() {
|
||||
_maxQueryPPS = DEFAULT_MAX_OCTREE_PPS;
|
||||
|
|
|
@ -42,6 +42,8 @@ class OctreeQuery : public NodeData {
|
|||
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