mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +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>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
|
|
||||||
_scriptEngine->registerGlobalObject("EntityViewer", &_entityViewer);
|
_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.setJurisdictionListener(entityScriptingInterface->getJurisdictionListener());
|
||||||
|
|
||||||
_entityViewer.init();
|
_entityViewer.init();
|
||||||
|
|
||||||
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
||||||
|
|
||||||
// wire up our additional agent related processing to the update signal
|
// wire up our additional agent related processing to the update signal
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//
|
//
|
||||||
// EntityScriptingInterface.h
|
// EntityScriptingInterface.h
|
||||||
// libraries/models/src
|
// libraries/entities/src
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 12/6/13.
|
// Created by Brad Hefta-Gaub on 12/6/13.
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// 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));
|
_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() {
|
void OctreeHeadlessViewer::init() {
|
||||||
OctreeRenderer::init();
|
OctreeRenderer::init();
|
||||||
setViewFrustum(&_viewFrustum);
|
setViewFrustum(&_viewFrustum);
|
||||||
|
@ -34,6 +31,7 @@ void OctreeHeadlessViewer::init() {
|
||||||
void OctreeHeadlessViewer::queryOctree() {
|
void OctreeHeadlessViewer::queryOctree() {
|
||||||
char serverType = getMyNodeType();
|
char serverType = getMyNodeType();
|
||||||
PacketType packetType = getMyQueryMessageType();
|
PacketType packetType = getMyQueryMessageType();
|
||||||
|
|
||||||
NodeToJurisdictionMap& jurisdictions = *_jurisdictionListener->getJurisdictions();
|
NodeToJurisdictionMap& jurisdictions = *_jurisdictionListener->getJurisdictions();
|
||||||
|
|
||||||
bool wantExtraDebugging = false;
|
bool wantExtraDebugging = false;
|
||||||
|
|
|
@ -29,7 +29,7 @@ class OctreeHeadlessViewer : public OctreeRenderer {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
OctreeHeadlessViewer();
|
OctreeHeadlessViewer();
|
||||||
virtual ~OctreeHeadlessViewer();
|
virtual ~OctreeHeadlessViewer() {};
|
||||||
virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { /* swallow these */ }
|
virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { /* swallow these */ }
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
@ -65,7 +65,7 @@ public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ViewFrustum _viewFrustum;
|
ViewFrustum _viewFrustum;
|
||||||
JurisdictionListener* _jurisdictionListener;
|
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||||
OctreeQuery _octreeQuery;
|
OctreeQuery _octreeQuery;
|
||||||
float _voxelSizeScale;
|
float _voxelSizeScale;
|
||||||
int _boundaryLevelAdjust;
|
int _boundaryLevelAdjust;
|
||||||
|
|
|
@ -54,6 +54,7 @@ void OctreeScriptingInterface::init() {
|
||||||
if (_initialized) {
|
if (_initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_jurisdictionListener) {
|
if (_jurisdictionListener) {
|
||||||
_managedJurisdictionListener = false;
|
_managedJurisdictionListener = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
class OctreeScriptingInterface : public QObject {
|
class OctreeScriptingInterface : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
OctreeScriptingInterface(OctreeEditPacketSender* packetSender = NULL,
|
OctreeScriptingInterface(OctreeEditPacketSender* packetSender = NULL, JurisdictionListener* jurisdictionListener = NULL);
|
||||||
JurisdictionListener* jurisdictionListener = NULL);
|
|
||||||
|
|
||||||
~OctreeScriptingInterface();
|
~OctreeScriptingInterface();
|
||||||
|
|
||||||
|
@ -86,8 +85,8 @@ public slots:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// attached OctreeEditPacketSender that handles queuing and sending of packets to VS
|
/// attached OctreeEditPacketSender that handles queuing and sending of packets to VS
|
||||||
OctreeEditPacketSender* _packetSender;
|
OctreeEditPacketSender* _packetSender = nullptr;
|
||||||
JurisdictionListener* _jurisdictionListener;
|
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||||
bool _managedPacketSender;
|
bool _managedPacketSender;
|
||||||
bool _managedJurisdictionListener;
|
bool _managedJurisdictionListener;
|
||||||
bool _initialized;
|
bool _initialized;
|
||||||
|
|
|
@ -559,6 +559,7 @@ void ScriptEngine::run() {
|
||||||
if (!_isInitialized) {
|
if (!_isInitialized) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
_isRunning = true;
|
_isRunning = true;
|
||||||
_isFinished = false;
|
_isFinished = false;
|
||||||
if (_wantSignals) {
|
if (_wantSignals) {
|
||||||
|
|
Loading…
Reference in a new issue