Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 2 files). Show all
Unified · Split
| @@ -301,10 +301,17 @@ void EntityScriptServer::run() { · 300 unmodified lines | ||
| 301 | 301 | |
| 302 | 302 | entityScriptingInterface->setEntityTree(_entityViewer.getTree()); |
| 303 | 303 | |
| 304 | − DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree()); | |
| 305 | − | |
| 304 | + auto treePtr = _entityViewer.getTree(); | |
| 305 | + DependencyManager::set<AssignmentParentFinder>(treePtr); | |
| 306 | + | |
| 307 | + if (!_entitySimulation) { | |
| 308 | + SimpleEntitySimulationPointer simpleSimulation { new SimpleEntitySimulation() }; | |
| 309 | + simpleSimulation->setEntityTree(treePtr); | |
| 310 | + treePtr->setSimulation(simpleSimulation); | |
| 311 | + _entitySimulation = simpleSimulation; | |
| 312 | + } | |
| 306 | 313 | |
| 307 | − auto tree = _entityViewer.getTree().get(); | |
| 314 | + auto tree = treePtr.get(); | |
| 308 | 315 | connect(tree, &EntityTree::deletingEntity, this, &EntityScriptServer::deletingEntity, Qt::QueuedConnection); |
| 309 | 316 | connect(tree, &EntityTree::addingEntity, this, &EntityScriptServer::addingEntity, Qt::QueuedConnection); |
| 310 | 317 | connect(tree, &EntityTree::entityServerScriptChanging, this, &EntityScriptServer::entityServerScriptChanging, Qt::QueuedConnection); |
| @@ -451,6 +458,7 @@ void EntityScriptServer::resetEntitiesScriptEngine() { · 140 unmodified lines | ||
| 451 | 458 | |
| 452 | 459 | connect(newEngine.data(), &ScriptEngine::update, this, [this] { |
| 453 | 460 | _entityViewer.queryOctree(); |
| 461 | + _entityViewer.getTree()->preUpdate(); | |
| 454 | 462 | _entityViewer.getTree()->update(); |
| 455 | 463 | }); |
| 456 | 464 | |