mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
fix for missing jurisdiction listener in Agent
This commit is contained in:
parent
b968911fcc
commit
5df7ce7424
7 changed files with 17 additions and 12 deletions
|
@ -191,8 +191,14 @@ void Agent::run() {
|
|||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||
|
||||
_scriptEngine->registerGlobalObject("EntityViewer", &_entityViewer);
|
||||
|
||||
// we need to make sure that init has been called for our EntityScriptingInterface
|
||||
// so that it actually has a jurisdiction listener when we ask it for it next
|
||||
entityScriptingInterface->init();
|
||||
_entityViewer.setJurisdictionListener(entityScriptingInterface->getJurisdictionListener());
|
||||
|
||||
_entityViewer.init();
|
||||
|
||||
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
||||
|
||||
// wire up our additional agent related processing to the update signal
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// EntityScriptingInterface.h
|
||||
// libraries/models/src
|
||||
// libraries/entities/src
|
||||
//
|
||||
// Created by Brad Hefta-Gaub on 12/6/13.
|
||||
// Copyright 2013 High Fidelity, Inc.
|
||||
|
|
|
@ -23,9 +23,6 @@ OctreeHeadlessViewer::OctreeHeadlessViewer() :
|
|||
_viewFrustum.setProjection(glm::perspective(glm::radians(DEFAULT_FIELD_OF_VIEW_DEGREES), DEFAULT_ASPECT_RATIO, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
|
||||
}
|
||||
|
||||
OctreeHeadlessViewer::~OctreeHeadlessViewer() {
|
||||
}
|
||||
|
||||
void OctreeHeadlessViewer::init() {
|
||||
OctreeRenderer::init();
|
||||
setViewFrustum(&_viewFrustum);
|
||||
|
@ -34,8 +31,9 @@ void OctreeHeadlessViewer::init() {
|
|||
void OctreeHeadlessViewer::queryOctree() {
|
||||
char serverType = getMyNodeType();
|
||||
PacketType packetType = getMyQueryMessageType();
|
||||
|
||||
NodeToJurisdictionMap& jurisdictions = *_jurisdictionListener->getJurisdictions();
|
||||
|
||||
|
||||
bool wantExtraDebugging = false;
|
||||
|
||||
if (wantExtraDebugging) {
|
||||
|
|
|
@ -29,7 +29,7 @@ class OctreeHeadlessViewer : public OctreeRenderer {
|
|||
Q_OBJECT
|
||||
public:
|
||||
OctreeHeadlessViewer();
|
||||
virtual ~OctreeHeadlessViewer();
|
||||
virtual ~OctreeHeadlessViewer() {};
|
||||
virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { /* swallow these */ }
|
||||
|
||||
virtual void init();
|
||||
|
@ -65,7 +65,7 @@ public slots:
|
|||
|
||||
private:
|
||||
ViewFrustum _viewFrustum;
|
||||
JurisdictionListener* _jurisdictionListener;
|
||||
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||
OctreeQuery _octreeQuery;
|
||||
float _voxelSizeScale;
|
||||
int _boundaryLevelAdjust;
|
||||
|
|
|
@ -54,6 +54,7 @@ void OctreeScriptingInterface::init() {
|
|||
if (_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_jurisdictionListener) {
|
||||
_managedJurisdictionListener = false;
|
||||
} else {
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
class OctreeScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
OctreeScriptingInterface(OctreeEditPacketSender* packetSender = NULL,
|
||||
JurisdictionListener* jurisdictionListener = NULL);
|
||||
OctreeScriptingInterface(OctreeEditPacketSender* packetSender = NULL, JurisdictionListener* jurisdictionListener = NULL);
|
||||
|
||||
~OctreeScriptingInterface();
|
||||
|
||||
|
@ -86,8 +85,8 @@ public slots:
|
|||
|
||||
protected:
|
||||
/// attached OctreeEditPacketSender that handles queuing and sending of packets to VS
|
||||
OctreeEditPacketSender* _packetSender;
|
||||
JurisdictionListener* _jurisdictionListener;
|
||||
OctreeEditPacketSender* _packetSender = nullptr;
|
||||
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||
bool _managedPacketSender;
|
||||
bool _managedJurisdictionListener;
|
||||
bool _initialized;
|
||||
|
|
|
@ -263,7 +263,7 @@ void ScriptEngine::init() {
|
|||
}
|
||||
|
||||
_isInitialized = true;
|
||||
|
||||
|
||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||
entityScriptingInterface->init();
|
||||
|
||||
|
@ -559,6 +559,7 @@ void ScriptEngine::run() {
|
|||
if (!_isInitialized) {
|
||||
init();
|
||||
}
|
||||
|
||||
_isRunning = true;
|
||||
_isFinished = false;
|
||||
if (_wantSignals) {
|
||||
|
|
Loading…
Reference in a new issue