mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 00:03:16 +02:00
EntityServer gets a simuation
This commit is contained in:
parent
dd3a7b9b9d
commit
cb6d9a4312
2 changed files with 10 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <QTimer>
|
||||
#include <EntityTree.h>
|
||||
#include <SimpleEntitySimulation.h>
|
||||
|
||||
#include "EntityServer.h"
|
||||
#include "EntityServerConsts.h"
|
||||
|
@ -20,7 +21,8 @@ const char* MODEL_SERVER_NAME = "Entity";
|
|||
const char* MODEL_SERVER_LOGGING_TARGET_NAME = "entity-server";
|
||||
const char* LOCAL_MODELS_PERSIST_FILE = "resources/models.svo";
|
||||
|
||||
EntityServer::EntityServer(const QByteArray& packet) : OctreeServer(packet) {
|
||||
EntityServer::EntityServer(const QByteArray& packet)
|
||||
: OctreeServer(packet), _entitySimulation(NULL) {
|
||||
// nothing special to do here...
|
||||
}
|
||||
|
||||
|
@ -36,6 +38,12 @@ OctreeQueryNode* EntityServer::createOctreeQueryNode() {
|
|||
Octree* EntityServer::createTree() {
|
||||
EntityTree* tree = new EntityTree(true);
|
||||
tree->addNewlyCreatedHook(this);
|
||||
if (!_entitySimulation) {
|
||||
SimpleEntitySimulation* simpleSimulation = new SimpleEntitySimulation();
|
||||
simpleSimulation->setEntityTree(tree);
|
||||
tree->setSimulation(simpleSimulation);
|
||||
_entitySimulation = simpleSimulation;
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public slots:
|
|||
void pruneDeletedEntities();
|
||||
|
||||
private:
|
||||
EntitySimulation* _entitySimulation;
|
||||
};
|
||||
|
||||
#endif // hifi_EntityServer_h
|
||||
|
|
Loading…
Reference in a new issue