Model Server to Entity Server Refactoring
Showing the changes to interface/src/Application.cpp (1 of 158 files). Show all
Unified · Split
| @@ -52,9 +52,9 @@ · 51 unmodified lines | |||
| 52 | 52 | ||
| 53 | #include <AccountManager.h> | 53 | #include <AccountManager.h> |
| 54 | #include <AudioInjector.h> | 54 | #include <AudioInjector.h> |
| 55 | #include <EntityScriptingInterface.h> | ||
| 55 | #include <LocalVoxelsList.h> | 56 | #include <LocalVoxelsList.h> |
| 56 | #include <Logging.h> | 57 | #include <Logging.h> |
| 57 | #include <ModelsScriptingInterface.h> | ||
| 58 | #include <NetworkAccessManager.h> | 58 | #include <NetworkAccessManager.h> |
| 59 | #include <OctalCode.h> | 59 | #include <OctalCode.h> |
| 60 | #include <OctreeSceneStats.h> | 60 | #include <OctreeSceneStats.h> |
| @@ -141,8 +141,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 80 unmodified lines | |||
| 141 | _voxelImporter(), | 141 | _voxelImporter(), |
| 142 | _importSucceded(false), | 142 | _importSucceded(false), |
| 143 | _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard), | 143 | _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard), |
| 144 | _modelClipboardRenderer(), | 144 | _entityClipboardRenderer(), |
| 145 | _modelClipboard(), | 145 | _entityClipboard(), |
| 146 | _wantToKillLocalVoxels(false), | 146 | _wantToKillLocalVoxels(false), |
| 147 | _viewFrustum(), | 147 | _viewFrustum(), |
| 148 | _lastQueriedViewFrustum(), | 148 | _lastQueriedViewFrustum(), |
| @@ -303,13 +303,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 154 unmodified lines | |||
| 303 | 303 | ||
| 304 | // tell the NodeList instance who to tell the domain server we care about | 304 | // tell the NodeList instance who to tell the domain server we care about |
| 305 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer | 305 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer |
| 306 | << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer | 306 | << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer |
| 307 | << NodeType::MetavoxelServer); | 307 | << NodeType::MetavoxelServer); |
| 308 | 308 | ||
| 309 | // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender | 309 | // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender |
| 310 | connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent); | 310 | connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent); |
| 311 | connect(&_particleEditSender, &ParticleEditPacketSender::packetSent, this, &Application::packetSent); | 311 | connect(&_particleEditSender, &ParticleEditPacketSender::packetSent, this, &Application::packetSent); |
| 312 | connect(&_modelEditSender, &ModelEditPacketSender::packetSent, this, &Application::packetSent); | 312 | connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent); |
| 313 | 313 | ||
| 314 | // move the silentNodeTimer to the _nodeThread | 314 | // move the silentNodeTimer to the _nodeThread |
| 315 | QTimer* silentNodeTimer = new QTimer(); | 315 | QTimer* silentNodeTimer = new QTimer(); |
| @@ -352,7 +352,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 36 unmodified lines | |||
| 352 | // Tell our voxel edit sender about our known jurisdictions | 352 | // Tell our voxel edit sender about our known jurisdictions |
| 353 | _voxelEditSender.setVoxelServerJurisdictions(&_voxelServerJurisdictions); | 353 | _voxelEditSender.setVoxelServerJurisdictions(&_voxelServerJurisdictions); |
| 354 | _particleEditSender.setServerJurisdictions(&_particleServerJurisdictions); | 354 | _particleEditSender.setServerJurisdictions(&_particleServerJurisdictions); |
| 355 | _modelEditSender.setServerJurisdictions(&_modelServerJurisdictions); | 355 | _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions); |
| 356 | 356 | ||
| 357 | Particle::setVoxelEditPacketSender(&_voxelEditSender); | 357 | Particle::setVoxelEditPacketSender(&_voxelEditSender); |
| 358 | Particle::setParticleEditPacketSender(&_particleEditSender); | 358 | Particle::setParticleEditPacketSender(&_particleEditSender); |
| @@ -364,7 +364,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 5 unmodified lines | |||
| 364 | // probably not the right long term solution. But for now, we're going to do this to | 364 | // probably not the right long term solution. But for now, we're going to do this to |
| 365 | // allow you to move a particle around in your hand | 365 | // allow you to move a particle around in your hand |
| 366 | _particleEditSender.setPacketsPerSecond(3000); // super high!! | 366 | _particleEditSender.setPacketsPerSecond(3000); // super high!! |
| 367 | _modelEditSender.setPacketsPerSecond(3000); // super high!! | 367 | _entityEditSender.setPacketsPerSecond(3000); // super high!! |
| 368 | 368 | ||
| 369 | // Set the sixense filtering | 369 | // Set the sixense filtering |
| 370 | _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense)); | 370 | _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense)); |
| @@ -454,7 +454,7 @@ Application::~Application() { · 83 unmodified lines | |||
| 454 | _voxelHideShowThread.terminate(); | 454 | _voxelHideShowThread.terminate(); |
| 455 | _voxelEditSender.terminate(); | 455 | _voxelEditSender.terminate(); |
| 456 | _particleEditSender.terminate(); | 456 | _particleEditSender.terminate(); |
| 457 | _modelEditSender.terminate(); | 457 | _entityEditSender.terminate(); |
| 458 | 458 | ||
| 459 | 459 | ||
| 460 | VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown | 460 | VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown |
| @@ -549,7 +549,7 @@ void Application::initializeGL() { · 88 unmodified lines | |||
| 549 | _voxelEditSender.initialize(_enableProcessVoxelsThread); | 549 | _voxelEditSender.initialize(_enableProcessVoxelsThread); |
| 550 | _voxelHideShowThread.initialize(_enableProcessVoxelsThread); | 550 | _voxelHideShowThread.initialize(_enableProcessVoxelsThread); |
| 551 | _particleEditSender.initialize(_enableProcessVoxelsThread); | 551 | _particleEditSender.initialize(_enableProcessVoxelsThread); |
| 552 | _modelEditSender.initialize(_enableProcessVoxelsThread); | 552 | _entityEditSender.initialize(_enableProcessVoxelsThread); |
| 553 | 553 | ||
| 554 | if (_enableProcessVoxelsThread) { | 554 | if (_enableProcessVoxelsThread) { |
| 555 | qDebug("Voxel parsing thread created."); | 555 | qDebug("Voxel parsing thread created."); |
| @@ -801,7 +801,7 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, const Nod · 245 unmodified lines | |||
| 801 | break; | 801 | break; |
| 802 | case NodeType::VoxelServer: | 802 | case NodeType::VoxelServer: |
| 803 | case NodeType::ParticleServer: | 803 | case NodeType::ParticleServer: |
| 804 | case NodeType::ModelServer: | 804 | case NodeType::EntityServer: |
| 805 | channel = BandwidthMeter::VOXELS; | 805 | channel = BandwidthMeter::VOXELS; |
| 806 | break; | 806 | break; |
| 807 | default: | 807 | default: |
| @@ -1339,7 +1339,7 @@ void Application::dropEvent(QDropEvent *event) { · 531 unmodified lines | |||
| 1339 | void Application::sendPingPackets() { | 1339 | void Application::sendPingPackets() { |
| 1340 | QByteArray pingPacket = NodeList::getInstance()->constructPingPacket(); | 1340 | QByteArray pingPacket = NodeList::getInstance()->constructPingPacket(); |
| 1341 | controlledBroadcastToNodes(pingPacket, NodeSet() | 1341 | controlledBroadcastToNodes(pingPacket, NodeSet() |
| 1342 | << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer | 1342 | << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer |
| 1343 | << NodeType::AudioMixer << NodeType::AvatarMixer | 1343 | << NodeType::AudioMixer << NodeType::AvatarMixer |
| 1344 | << NodeType::MetavoxelServer); | 1344 | << NodeType::MetavoxelServer); |
| 1345 | } | 1345 | } |
| @@ -1523,22 +1523,21 @@ struct SendVoxelsOperationArgs { · 177 unmodified lines | |||
| 1523 | const unsigned char* newBaseOctCode; | 1523 | const unsigned char* newBaseOctCode; |
| 1524 | }; | 1524 | }; |
| 1525 | 1525 | ||
| 1526 | bool Application::exportModels(const QString& filename, float x, float y, float z, float scale) { | 1526 | bool Application::exportEntities(const QString& filename, float x, float y, float z, float scale) { |
| 1527 | QVector<ModelItem*> models; | 1527 | QVector<EntityItem*> entities; |
| 1528 | _models.getTree()->findModelsInCube(AACube(glm::vec3(x / (float)TREE_SCALE, y / (float)TREE_SCALE, z / (float)TREE_SCALE), scale / (float)TREE_SCALE), models); | 1528 | _entities.getTree()->findEntities(AACube(glm::vec3(x / (float)TREE_SCALE, |
| 1529 | if (models.size() > 0) { | 1529 | y / (float)TREE_SCALE, z / (float)TREE_SCALE), scale / (float)TREE_SCALE), entities); |
| 1530 | |||
| 1531 | if (entities.size() > 0) { | ||
| 1530 | glm::vec3 root(x, y, z); | 1532 | glm::vec3 root(x, y, z); |
| 1531 | ModelTree exportTree; | 1533 | EntityTree exportTree; |
| 1532 | 1534 | ||
| 1533 | for (int i = 0; i < models.size(); i++) { | 1535 | for (int i = 0; i < entities.size(); i++) { |
| 1534 | ModelItemProperties properties; | 1536 | EntityItemProperties properties = entities.at(i)->getProperties(); |
| 1535 | ModelItemID id = models.at(i)->getModelItemID(); | 1537 | EntityItemID id = entities.at(i)->getEntityItemID(); |
| 1536 | id.isKnownID = false; | ||
| 1537 | properties.copyFromNewModelItem(*models.at(i)); | ||
| 1538 | properties.setPosition(properties.getPosition() - root); | 1538 | properties.setPosition(properties.getPosition() - root); |
| 1539 | exportTree.addModel(id, properties); | 1539 | exportTree.addEntity(id, properties); |
| 1540 | } | 1540 | } |
| 1541 | |||
| 1542 | exportTree.writeToSVOFile(filename.toLocal8Bit().constData()); | 1541 | exportTree.writeToSVOFile(filename.toLocal8Bit().constData()); |
| 1543 | } else { | 1542 | } else { |
| 1544 | qDebug() << "No models were selected"; | 1543 | qDebug() << "No models were selected"; |
| @@ -1631,17 +1630,17 @@ void Application::importVoxels() { · 86 unmodified lines | |||
| 1631 | emit importDone(); | 1630 | emit importDone(); |
| 1632 | } | 1631 | } |
| 1633 | 1632 | ||
| 1634 | bool Application::importModels(const QString& filename) { | 1633 | bool Application::importEntities(const QString& filename) { |
| 1635 | _modelClipboard.eraseAllOctreeElements(); | 1634 | _entityClipboard.eraseAllOctreeElements(); |
| 1636 | bool success = _modelClipboard.readFromSVOFile(filename.toLocal8Bit().constData()); | 1635 | bool success = _entityClipboard.readFromSVOFile(filename.toLocal8Bit().constData()); |
| 1637 | if (success) { | 1636 | if (success) { |
| 1638 | _modelClipboard.reaverageOctreeElements(); | 1637 | _entityClipboard.reaverageOctreeElements(); |
| 1639 | } | 1638 | } |
| 1640 | return success; | 1639 | return success; |
| 1641 | } | 1640 | } |
| 1642 | 1641 | ||
| 1643 | void Application::pasteModels(float x, float y, float z) { | 1642 | void Application::pasteEntities(float x, float y, float z) { |
| 1644 | _modelClipboard.sendModels(&_modelEditSender, x, y, z); | 1643 | _entityClipboard.sendEntities(&_entityEditSender, _entities.getTree(), x, y, z); |
| 1645 | } | 1644 | } |
| 1646 | 1645 | ||
| 1647 | void Application::cutVoxels(const VoxelDetail& sourceVoxel) { | 1646 | void Application::cutVoxels(const VoxelDetail& sourceVoxel) { |
| @@ -1797,12 +1796,12 @@ void Application::init() { · 149 unmodified lines | |||
| 1797 | _particles.init(); | 1796 | _particles.init(); |
| 1798 | _particles.setViewFrustum(getViewFrustum()); | 1797 | _particles.setViewFrustum(getViewFrustum()); |
| 1799 | 1798 | ||
| 1800 | _models.init(); | 1799 | _entities.init(); |
| 1801 | _models.setViewFrustum(getViewFrustum()); | 1800 | _entities.setViewFrustum(getViewFrustum()); |
| 1802 | 1801 | ||
| 1803 | _modelClipboardRenderer.init(); | 1802 | _entityClipboardRenderer.init(); |
| 1804 | _modelClipboardRenderer.setViewFrustum(getViewFrustum()); | 1803 | _entityClipboardRenderer.setViewFrustum(getViewFrustum()); |
| 1805 | _modelClipboardRenderer.setTree(&_modelClipboard); | 1804 | _entityClipboardRenderer.setTree(&_entityClipboard); |
| 1806 | 1805 | ||
| 1807 | _metavoxels.init(); | 1806 | _metavoxels.init(); |
| 1808 | 1807 | ||
| @@ -2032,7 +2031,7 @@ void Application::updateThreads(float deltaTime) { · 223 unmodified lines | |||
| 2032 | _voxelHideShowThread.threadRoutine(); | 2031 | _voxelHideShowThread.threadRoutine(); |
| 2033 | _voxelEditSender.threadRoutine(); | 2032 | _voxelEditSender.threadRoutine(); |
| 2034 | _particleEditSender.threadRoutine(); | 2033 | _particleEditSender.threadRoutine(); |
| 2035 | _modelEditSender.threadRoutine(); | 2034 | _entityEditSender.threadRoutine(); |
| 2036 | } | 2035 | } |
| 2037 | } | 2036 | } |
| 2038 | 2037 | ||
| @@ -2165,8 +2164,8 @@ void Application::update(float deltaTime) { · 126 unmodified lines | |||
| 2165 | } | 2164 | } |
| 2166 | 2165 | ||
| 2167 | { | 2166 | { |
| 2168 | PerformanceTimer perfTimer("models"); | 2167 | PerformanceTimer perfTimer("entities"); |
| 2169 | _models.update(); // update the models... | 2168 | _entities.update(); // update the models... |
| 2170 | } | 2169 | } |
| 2171 | 2170 | ||
| 2172 | { | 2171 | { |
| @@ -2210,9 +2209,16 @@ void Application::update(float deltaTime) { · 37 unmodified lines | |||
| 2210 | // if it's been a while since our last query or the view has significantly changed then send a query, otherwise suppress it | 2209 | // if it's been a while since our last query or the view has significantly changed then send a query, otherwise suppress it |
| 2211 | if (queryIsDue || viewIsDifferentEnough) { | 2210 | if (queryIsDue || viewIsDifferentEnough) { |
| 2212 | _lastQueriedTime = now; | 2211 | _lastQueriedTime = now; |
| 2213 | queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions); | 2212 | |
| 2214 | queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions); | 2213 | if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { |
| 2215 | queryOctree(NodeType::ModelServer, PacketTypeModelQuery, _modelServerJurisdictions); | 2214 | queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions); |
| 2215 | } | ||
| 2216 | if (Menu::getInstance()->isOptionChecked(MenuOption::Particles)) { | ||
| 2217 | queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions); | ||
| 2218 | } | ||
| 2219 | if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) { | ||
| 2220 | queryOctree(NodeType::EntityServer, PacketTypeEntityQuery, _entityServerJurisdictions); | ||
| 2221 | } | ||
| 2216 | _lastQueriedViewFrustum = _viewFrustum; | 2222 | _lastQueriedViewFrustum = _viewFrustum; |
| 2217 | } | 2223 | } |
| 2218 | } | 2224 | } |
| @@ -2268,7 +2274,7 @@ int Application::sendNackPackets() { · 49 unmodified lines | |||
| 2268 | if (node->getActiveSocket() && | 2274 | if (node->getActiveSocket() && |
| 2269 | ( node->getType() == NodeType::VoxelServer | 2275 | ( node->getType() == NodeType::VoxelServer |
| 2270 | || node->getType() == NodeType::ParticleServer | 2276 | || node->getType() == NodeType::ParticleServer |
| 2271 | || node->getType() == NodeType::ModelServer) | 2277 | || node->getType() == NodeType::EntityServer) |
| 2272 | ) { | 2278 | ) { |
| 2273 | 2279 | ||
| 2274 | QUuid nodeUUID = node->getUUID(); | 2280 | QUuid nodeUUID = node->getUUID(); |
| @@ -2335,13 +2341,7 @@ int Application::sendNackPackets() { · 60 unmodified lines | |||
| 2335 | 2341 | ||
| 2336 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { | 2342 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { |
| 2337 | 2343 | ||
| 2338 | // if voxels are disabled, then don't send this at all... | ||
| 2339 | if (!Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | ||
| 2340 | return; | ||
| 2341 | } | ||
| 2342 | |||
| 2343 | //qDebug() << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView(); | 2344 | //qDebug() << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView(); |
| 2344 | |||
| 2345 | bool wantExtraDebugging = getLogger()->extraDebugging(); | 2345 | bool wantExtraDebugging = getLogger()->extraDebugging(); |
| 2346 | 2346 | ||
| 2347 | // These will be the same for all servers, so we can set them up once and then reuse for each server we send to. | 2347 | // These will be the same for all servers, so we can set them up once and then reuse for each server we send to. |
| @@ -2659,9 +2659,20 @@ void Application::updateShadowMap() { · 311 unmodified lines | |||
| 2659 | glEnable(GL_POLYGON_OFFSET_FILL); | 2659 | glEnable(GL_POLYGON_OFFSET_FILL); |
| 2660 | glPolygonOffset(1.1f, 4.0f); // magic numbers courtesy http://www.eecs.berkeley.edu/~ravir/6160/papers/shadowmaps.ppt | 2660 | glPolygonOffset(1.1f, 4.0f); // magic numbers courtesy http://www.eecs.berkeley.edu/~ravir/6160/papers/shadowmaps.ppt |
| 2661 | 2661 | ||
| 2662 | _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE); | 2662 | { |
| 2663 | _particles.render(OctreeRenderer::SHADOW_RENDER_MODE); | 2663 | PerformanceTimer perfTimer("avatarManager"); |
| 2664 | _models.render(OctreeRenderer::SHADOW_RENDER_MODE); | 2664 | _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE); |
| 2665 | } | ||
| 2666 | |||
| 2667 | { | ||
| 2668 | PerformanceTimer perfTimer("particles"); | ||
| 2669 | _particles.render(OctreeRenderer::SHADOW_RENDER_MODE); | ||
| 2670 | } | ||
| 2671 | |||
| 2672 | { | ||
| 2673 | PerformanceTimer perfTimer("entities"); | ||
| 2674 | _entities.render(OctreeRenderer::SHADOW_RENDER_MODE); | ||
| 2675 | } | ||
| 2665 | 2676 | ||
| 2666 | glDisable(GL_POLYGON_OFFSET_FILL); | 2677 | glDisable(GL_POLYGON_OFFSET_FILL); |
| 2667 | 2678 | ||
| @@ -2858,10 +2869,10 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 190 unmodified lines | |||
| 2858 | 2869 | ||
| 2859 | // render models... | 2870 | // render models... |
| 2860 | if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) { | 2871 | if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) { |
| 2861 | PerformanceTimer perfTimer("models"); | 2872 | PerformanceTimer perfTimer("entities"); |
| 2862 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | 2873 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 2863 | "Application::displaySide() ... models..."); | 2874 | "Application::displaySide() ... entities..."); |
| 2864 | _models.render(); | 2875 | _entities.render(); |
| 2865 | } | 2876 | } |
| 2866 | 2877 | ||
| 2867 | // render the ambient occlusion effect if enabled | 2878 | // render the ambient occlusion effect if enabled |
| @@ -3385,7 +3396,7 @@ void Application::domainChanged(const QString& domainHostname) { · 517 unmodified lines | |||
| 3385 | _particles.clear(); | 3396 | _particles.clear(); |
| 3386 | 3397 | ||
| 3387 | // reset the model renderer | 3398 | // reset the model renderer |
| 3388 | _models.clear(); | 3399 | _entities.clear(); |
| 3389 | 3400 | ||
| 3390 | // reset the voxels renderer | 3401 | // reset the voxels renderer |
| 3391 | _voxels.killLocalVoxels(); | 3402 | _voxels.killLocalVoxels(); |
| @@ -3424,7 +3435,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 32 unmodified lines | |||
| 3424 | 3435 | ||
| 3425 | _voxelEditSender.nodeKilled(node); | 3436 | _voxelEditSender.nodeKilled(node); |
| 3426 | _particleEditSender.nodeKilled(node); | 3437 | _particleEditSender.nodeKilled(node); |
| 3427 | _modelEditSender.nodeKilled(node); | 3438 | _entityEditSender.nodeKilled(node); |
| 3428 | 3439 | ||
| 3429 | if (node->getType() == NodeType::AudioMixer) { | 3440 | if (node->getType() == NodeType::AudioMixer) { |
| 3430 | QMetaObject::invokeMethod(&_audio, "audioMixerKilled"); | 3441 | QMetaObject::invokeMethod(&_audio, "audioMixerKilled"); |
| @@ -3504,16 +3515,16 @@ void Application::nodeKilled(SharedNodePointer node) { · 73 unmodified lines | |||
| 3504 | } | 3515 | } |
| 3505 | _octreeSceneStatsLock.unlock(); | 3516 | _octreeSceneStatsLock.unlock(); |
| 3506 | 3517 | ||
| 3507 | } else if (node->getType() == NodeType::ModelServer) { | 3518 | } else if (node->getType() == NodeType::EntityServer) { |
| 3508 | 3519 | ||
| 3509 | QUuid nodeUUID = node->getUUID(); | 3520 | QUuid nodeUUID = node->getUUID(); |
| 3510 | // see if this is the first we've heard of this node... | 3521 | // see if this is the first we've heard of this node... |
| 3511 | _modelServerJurisdictions.lockForRead(); | 3522 | _entityServerJurisdictions.lockForRead(); |
| 3512 | if (_modelServerJurisdictions.find(nodeUUID) != _modelServerJurisdictions.end()) { | 3523 | if (_entityServerJurisdictions.find(nodeUUID) != _entityServerJurisdictions.end()) { |
| 3513 | unsigned char* rootCode = _modelServerJurisdictions[nodeUUID].getRootOctalCode(); | 3524 | unsigned char* rootCode = _entityServerJurisdictions[nodeUUID].getRootOctalCode(); |
| 3514 | VoxelPositionSize rootDetails; | 3525 | VoxelPositionSize rootDetails; |
| 3515 | voxelDetailsForCode(rootCode, rootDetails); | 3526 | voxelDetailsForCode(rootCode, rootDetails); |
| 3516 | _modelServerJurisdictions.unlock(); | 3527 | _entityServerJurisdictions.unlock(); |
| 3517 | 3528 | ||
| 3518 | qDebug("model server going away...... v[%f, %f, %f, %f]", | 3529 | qDebug("model server going away...... v[%f, %f, %f, %f]", |
| 3519 | rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s); | 3530 | rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s); |
| @@ -3530,10 +3541,10 @@ void Application::nodeKilled(SharedNodePointer node) { · 10 unmodified lines | |||
| 3530 | } | 3541 | } |
| 3531 | 3542 | ||
| 3532 | // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server | 3543 | // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server |
| 3533 | _modelServerJurisdictions.lockForWrite(); | 3544 | _entityServerJurisdictions.lockForWrite(); |
| 3534 | _modelServerJurisdictions.erase(_modelServerJurisdictions.find(nodeUUID)); | 3545 | _entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID)); |
| 3535 | } | 3546 | } |
| 3536 | _modelServerJurisdictions.unlock(); | 3547 | _entityServerJurisdictions.unlock(); |
| 3537 | 3548 | ||
| 3538 | // also clean up scene stats for that server | 3549 | // also clean up scene stats for that server |
| 3539 | _octreeSceneStatsLock.lockForWrite(); | 3550 | _octreeSceneStatsLock.lockForWrite(); |
| @@ -3599,8 +3610,8 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 59 unmodified lines | |||
| 3599 | jurisdiction = &_particleServerJurisdictions; | 3610 | jurisdiction = &_particleServerJurisdictions; |
| 3600 | serverType = "Particle"; | 3611 | serverType = "Particle"; |
| 3601 | } else { | 3612 | } else { |
| 3602 | jurisdiction = &_modelServerJurisdictions; | 3613 | jurisdiction = &_entityServerJurisdictions; |
| 3603 | serverType = "Model"; | 3614 | serverType = "Entity"; |
| 3604 | } | 3615 | } |
| 3605 | 3616 | ||
| 3606 | jurisdiction->lockForRead(); | 3617 | jurisdiction->lockForRead(); |
| @@ -3709,8 +3720,8 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 102 unmodified lines | |||
| 3709 | scriptEngine->getParticlesScriptingInterface()->setPacketSender(&_particleEditSender); | 3720 | scriptEngine->getParticlesScriptingInterface()->setPacketSender(&_particleEditSender); |
| 3710 | scriptEngine->getParticlesScriptingInterface()->setParticleTree(_particles.getTree()); | 3721 | scriptEngine->getParticlesScriptingInterface()->setParticleTree(_particles.getTree()); |
| 3711 | 3722 | ||
| 3712 | scriptEngine->getModelsScriptingInterface()->setPacketSender(&_modelEditSender); | 3723 | scriptEngine->getEntityScriptingInterface()->setPacketSender(&_entityEditSender); |
| 3713 | scriptEngine->getModelsScriptingInterface()->setModelTree(_models.getTree()); | 3724 | scriptEngine->getEntityScriptingInterface()->setEntityTree(_entities.getTree()); |
| 3714 | 3725 | ||
| 3715 | // model has some custom types | 3726 | // model has some custom types |
| 3716 | Model::registerMetaTypes(scriptEngine); | 3727 | Model::registerMetaTypes(scriptEngine); |