Showing the changes to interface/src/Application.cpp (1 of 245 files). Show all
Unified · Split
| @@ -52,9 +52,9 @@ · 51 unmodified lines | ||
| 52 | 52 | |
| 53 | 53 | #include <AccountManager.h> |
| 54 | 54 | #include <AudioInjector.h> |
| 55 | +#include <EntityScriptingInterface.h> | |
| 55 | 56 | #include <LocalVoxelsList.h> |
| 56 | 57 | #include <Logging.h> |
| 57 | −#include <ModelsScriptingInterface.h> | |
| 58 | 58 | #include <NetworkAccessManager.h> |
| 59 | 59 | #include <OctalCode.h> |
| 60 | 60 | #include <OctreeSceneStats.h> |
| @@ -141,8 +141,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 80 unmodified lines | ||
| 141 | 141 | _voxelImporter(), |
| 142 | 142 | _importSucceded(false), |
| 143 | 143 | _sharedVoxelSystem(TREE_SCALE, DEFAULT_MAX_VOXELS_PER_SYSTEM, &_clipboard), |
| 144 | − _modelClipboardRenderer(), | |
| 145 | − _modelClipboard(), | |
| 144 | + _entityClipboardRenderer(), | |
| 145 | + _entityClipboard(), | |
| 146 | 146 | _wantToKillLocalVoxels(false), |
| 147 | 147 | _viewFrustum(), |
| 148 | 148 | _lastQueriedViewFrustum(), |
| @@ -246,7 +246,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 97 unmodified lines | ||
| 246 | 246 | connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle())); |
| 247 | 247 | connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle())); |
| 248 | 248 | connect(&domainHandler, &DomainHandler::settingsReceived, this, &Application::domainSettingsReceived); |
| 249 | − | |
| 249 | + connect(&domainHandler, &DomainHandler::hostnameChanged, Menu::getInstance(), &Menu::clearLoginDialogDisplayedFlag); | |
| 250 | + | |
| 250 | 251 | // hookup VoxelEditSender to PaymentManager so we can pay for octree edits |
| 251 | 252 | const PaymentManager& paymentManager = PaymentManager::getInstance(); |
| 252 | 253 | connect(&_voxelEditSender, &VoxelEditPacketSender::octreePaymentRequired, |
| @@ -302,13 +303,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 49 unmodified lines | ||
| 302 | 303 | |
| 303 | 304 | // tell the NodeList instance who to tell the domain server we care about |
| 304 | 305 | nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer |
| 305 | − << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer | |
| 306 | + << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer | |
| 306 | 307 | << NodeType::MetavoxelServer); |
| 307 | 308 | |
| 308 | 309 | // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender |
| 309 | 310 | connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent); |
| 310 | 311 | connect(&_particleEditSender, &ParticleEditPacketSender::packetSent, this, &Application::packetSent); |
| 311 | − connect(&_modelEditSender, &ModelEditPacketSender::packetSent, this, &Application::packetSent); | |
| 312 | + connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent); | |
| 312 | 313 | |
| 313 | 314 | // move the silentNodeTimer to the _nodeThread |
| 314 | 315 | QTimer* silentNodeTimer = new QTimer(); |
| @@ -351,7 +352,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 36 unmodified lines | ||
| 351 | 352 | // Tell our voxel edit sender about our known jurisdictions |
| 352 | 353 | _voxelEditSender.setVoxelServerJurisdictions(&_voxelServerJurisdictions); |
| 353 | 354 | _particleEditSender.setServerJurisdictions(&_particleServerJurisdictions); |
| 354 | − _modelEditSender.setServerJurisdictions(&_modelServerJurisdictions); | |
| 355 | + _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions); | |
| 355 | 356 | |
| 356 | 357 | Particle::setVoxelEditPacketSender(&_voxelEditSender); |
| 357 | 358 | Particle::setParticleEditPacketSender(&_particleEditSender); |
| @@ -363,7 +364,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 5 unmodified lines | ||
| 363 | 364 | // probably not the right long term solution. But for now, we're going to do this to |
| 364 | 365 | // allow you to move a particle around in your hand |
| 365 | 366 | _particleEditSender.setPacketsPerSecond(3000); // super high!! |
| 366 | − _modelEditSender.setPacketsPerSecond(3000); // super high!! | |
| 367 | + _entityEditSender.setPacketsPerSecond(3000); // super high!! | |
| 367 | 368 | |
| 368 | 369 | // Set the sixense filtering |
| 369 | 370 | _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense)); |
| @@ -453,7 +454,7 @@ Application::~Application() { · 83 unmodified lines | ||
| 453 | 454 | _voxelHideShowThread.terminate(); |
| 454 | 455 | _voxelEditSender.terminate(); |
| 455 | 456 | _particleEditSender.terminate(); |
| 456 | − _modelEditSender.terminate(); | |
| 457 | + _entityEditSender.terminate(); | |
| 457 | 458 | |
| 458 | 459 | |
| 459 | 460 | VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown |
| @@ -548,7 +549,7 @@ void Application::initializeGL() { · 88 unmodified lines | ||
| 548 | 549 | _voxelEditSender.initialize(_enableProcessVoxelsThread); |
| 549 | 550 | _voxelHideShowThread.initialize(_enableProcessVoxelsThread); |
| 550 | 551 | _particleEditSender.initialize(_enableProcessVoxelsThread); |
| 551 | − _modelEditSender.initialize(_enableProcessVoxelsThread); | |
| 552 | + _entityEditSender.initialize(_enableProcessVoxelsThread); | |
| 552 | 553 | |
| 553 | 554 | if (_enableProcessVoxelsThread) { |
| 554 | 555 | qDebug("Voxel parsing thread created."); |
| @@ -800,7 +801,7 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, const Nod · 245 unmodified lines | ||
| 800 | 801 | break; |
| 801 | 802 | case NodeType::VoxelServer: |
| 802 | 803 | case NodeType::ParticleServer: |
| 803 | − case NodeType::ModelServer: | |
| 804 | + case NodeType::EntityServer: | |
| 804 | 805 | channel = BandwidthMeter::VOXELS; |
| 805 | 806 | break; |
| 806 | 807 | default: |
| @@ -1314,7 +1315,7 @@ void Application::dropEvent(QDropEvent *event) { · 507 unmodified lines | ||
| 1314 | 1315 | const QMimeData *mimeData = event->mimeData(); |
| 1315 | 1316 | foreach (QUrl url, mimeData->urls()) { |
| 1316 | 1317 | if (url.url().toLower().endsWith(SNAPSHOT_EXTENSION)) { |
| 1317 | − snapshotPath = url.url().remove("file://"); | |
| 1318 | + snapshotPath = url.toLocalFile(); | |
| 1318 | 1319 | break; |
| 1319 | 1320 | } |
| 1320 | 1321 | } |
| @@ -1338,7 +1339,7 @@ void Application::dropEvent(QDropEvent *event) { · 17 unmodified lines | ||
| 1338 | 1339 | void Application::sendPingPackets() { |
| 1339 | 1340 | QByteArray pingPacket = NodeList::getInstance()->constructPingPacket(); |
| 1340 | 1341 | controlledBroadcastToNodes(pingPacket, NodeSet() |
| 1341 | − << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer | |
| 1342 | + << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer | |
| 1342 | 1343 | << NodeType::AudioMixer << NodeType::AvatarMixer |
| 1343 | 1344 | << NodeType::MetavoxelServer); |
| 1344 | 1345 | } |
| @@ -1522,22 +1523,21 @@ struct SendVoxelsOperationArgs { · 177 unmodified lines | ||
| 1522 | 1523 | const unsigned char* newBaseOctCode; |
| 1523 | 1524 | }; |
| 1524 | 1525 | |
| 1525 | −bool Application::exportModels(const QString& filename, float x, float y, float z, float scale) { | |
| 1526 | − QVector<ModelItem*> models; | |
| 1527 | − _models.getTree()->findModelsInCube(AACube(glm::vec3(x / (float)TREE_SCALE, y / (float)TREE_SCALE, z / (float)TREE_SCALE), scale / (float)TREE_SCALE), models); | |
| 1528 | − if (models.size() > 0) { | |
| 1526 | +bool Application::exportEntities(const QString& filename, float x, float y, float z, float scale) { | |
| 1527 | + QVector<EntityItem*> entities; | |
| 1528 | + _entities.getTree()->findEntities(AACube(glm::vec3(x / (float)TREE_SCALE, | |
| 1529 | + y / (float)TREE_SCALE, z / (float)TREE_SCALE), scale / (float)TREE_SCALE), entities); | |
| 1530 | + | |
| 1531 | + if (entities.size() > 0) { | |
| 1529 | 1532 | glm::vec3 root(x, y, z); |
| 1530 | − ModelTree exportTree; | |
| 1533 | + EntityTree exportTree; | |
| 1531 | 1534 | |
| 1532 | − for (int i = 0; i < models.size(); i++) { | |
| 1533 | − ModelItemProperties properties; | |
| 1534 | − ModelItemID id = models.at(i)->getModelItemID(); | |
| 1535 | − id.isKnownID = false; | |
| 1536 | − properties.copyFromNewModelItem(*models.at(i)); | |
| 1535 | + for (int i = 0; i < entities.size(); i++) { | |
| 1536 | + EntityItemProperties properties = entities.at(i)->getProperties(); | |
| 1537 | + EntityItemID id = entities.at(i)->getEntityItemID(); | |
| 1537 | 1538 | properties.setPosition(properties.getPosition() - root); |
| 1538 | − exportTree.addModel(id, properties); | |
| 1539 | + exportTree.addEntity(id, properties); | |
| 1539 | 1540 | } |
| 1540 | − | |
| 1541 | 1541 | exportTree.writeToSVOFile(filename.toLocal8Bit().constData()); |
| 1542 | 1542 | } else { |
| 1543 | 1543 | qDebug() << "No models were selected"; |
| @@ -1630,17 +1630,17 @@ void Application::importVoxels() { · 86 unmodified lines | ||
| 1630 | 1630 | emit importDone(); |
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | −bool Application::importModels(const QString& filename) { | |
| 1634 | − _modelClipboard.eraseAllOctreeElements(); | |
| 1635 | − bool success = _modelClipboard.readFromSVOFile(filename.toLocal8Bit().constData()); | |
| 1633 | +bool Application::importEntities(const QString& filename) { | |
| 1634 | + _entityClipboard.eraseAllOctreeElements(); | |
| 1635 | + bool success = _entityClipboard.readFromSVOFile(filename.toLocal8Bit().constData()); | |
| 1636 | 1636 | if (success) { |
| 1637 | − _modelClipboard.reaverageOctreeElements(); | |
| 1637 | + _entityClipboard.reaverageOctreeElements(); | |
| 1638 | 1638 | } |
| 1639 | 1639 | return success; |
| 1640 | 1640 | } |
| 1641 | 1641 | |
| 1642 | −void Application::pasteModels(float x, float y, float z) { | |
| 1643 | − _modelClipboard.sendModels(&_modelEditSender, x, y, z); | |
| 1642 | +void Application::pasteEntities(float x, float y, float z) { | |
| 1643 | + _entityClipboard.sendEntities(&_entityEditSender, _entities.getTree(), x, y, z); | |
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | 1646 | void Application::cutVoxels(const VoxelDetail& sourceVoxel) { |
| @@ -1772,14 +1772,7 @@ void Application::init() { · 125 unmodified lines | ||
| 1772 | 1772 | _lastTimeUpdated.start(); |
| 1773 | 1773 | |
| 1774 | 1774 | Menu::getInstance()->loadSettings(); |
| 1775 | − if (Menu::getInstance()->getAudioJitterBufferFrames() != 0) { | |
| 1776 | − _audio.setDynamicJitterBuffers(false); | |
| 1777 | − _audio.setStaticDesiredJitterBufferFrames(Menu::getInstance()->getAudioJitterBufferFrames()); | |
| 1778 | − } else { | |
| 1779 | − _audio.setDynamicJitterBuffers(true); | |
| 1780 | − } | |
| 1781 | − | |
| 1782 | − _audio.setMaxFramesOverDesired(Menu::getInstance()->getMaxFramesOverDesired()); | |
| 1775 | + _audio.setReceivedAudioStreamSettings(Menu::getInstance()->getReceivedAudioStreamSettings()); | |
| 1783 | 1776 | |
| 1784 | 1777 | qDebug("Loaded settings"); |
| 1785 | 1778 | |
| @@ -1803,12 +1796,12 @@ void Application::init() { · 17 unmodified lines | ||
| 1803 | 1796 | _particles.init(); |
| 1804 | 1797 | _particles.setViewFrustum(getViewFrustum()); |
| 1805 | 1798 | |
| 1806 | − _models.init(); | |
| 1807 | − _models.setViewFrustum(getViewFrustum()); | |
| 1799 | + _entities.init(); | |
| 1800 | + _entities.setViewFrustum(getViewFrustum()); | |
| 1808 | 1801 | |
| 1809 | − _modelClipboardRenderer.init(); | |
| 1810 | − _modelClipboardRenderer.setViewFrustum(getViewFrustum()); | |
| 1811 | − _modelClipboardRenderer.setTree(&_modelClipboard); | |
| 1802 | + _entityClipboardRenderer.init(); | |
| 1803 | + _entityClipboardRenderer.setViewFrustum(getViewFrustum()); | |
| 1804 | + _entityClipboardRenderer.setTree(&_entityClipboard); | |
| 1812 | 1805 | |
| 1813 | 1806 | _metavoxels.init(); |
| 1814 | 1807 | |
| @@ -2038,7 +2031,7 @@ void Application::updateThreads(float deltaTime) { · 223 unmodified lines | ||
| 2038 | 2031 | _voxelHideShowThread.threadRoutine(); |
| 2039 | 2032 | _voxelEditSender.threadRoutine(); |
| 2040 | 2033 | _particleEditSender.threadRoutine(); |
| 2041 | − _modelEditSender.threadRoutine(); | |
| 2034 | + _entityEditSender.threadRoutine(); | |
| 2042 | 2035 | } |
| 2043 | 2036 | } |
| 2044 | 2037 | |
| @@ -2171,8 +2164,8 @@ void Application::update(float deltaTime) { · 126 unmodified lines | ||
| 2171 | 2164 | } |
| 2172 | 2165 | |
| 2173 | 2166 | { |
| 2174 | − PerformanceTimer perfTimer("models"); | |
| 2175 | − _models.update(); // update the models... | |
| 2167 | + PerformanceTimer perfTimer("entities"); | |
| 2168 | + _entities.update(); // update the models... | |
| 2176 | 2169 | } |
| 2177 | 2170 | |
| 2178 | 2171 | { |
| @@ -2216,9 +2209,16 @@ void Application::update(float deltaTime) { · 37 unmodified lines | ||
| 2216 | 2209 | // if it's been a while since our last query or the view has significantly changed then send a query, otherwise suppress it |
| 2217 | 2210 | if (queryIsDue || viewIsDifferentEnough) { |
| 2218 | 2211 | _lastQueriedTime = now; |
| 2219 | − queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions); | |
| 2220 | − queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions); | |
| 2221 | − queryOctree(NodeType::ModelServer, PacketTypeModelQuery, _modelServerJurisdictions); | |
| 2212 | + | |
| 2213 | + if (Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 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 | + } | |
| 2222 | 2222 | _lastQueriedViewFrustum = _viewFrustum; |
| 2223 | 2223 | } |
| 2224 | 2224 | } |
| @@ -2274,7 +2274,7 @@ int Application::sendNackPackets() { · 49 unmodified lines | ||
| 2274 | 2274 | if (node->getActiveSocket() && |
| 2275 | 2275 | ( node->getType() == NodeType::VoxelServer |
| 2276 | 2276 | || node->getType() == NodeType::ParticleServer |
| 2277 | − || node->getType() == NodeType::ModelServer) | |
| 2277 | + || node->getType() == NodeType::EntityServer) | |
| 2278 | 2278 | ) { |
| 2279 | 2279 | |
| 2280 | 2280 | QUuid nodeUUID = node->getUUID(); |
| @@ -2341,13 +2341,7 @@ int Application::sendNackPackets() { · 60 unmodified lines | ||
| 2341 | 2341 | |
| 2342 | 2342 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { |
| 2343 | 2343 | |
| 2344 | − // if voxels are disabled, then don't send this at all... | |
| 2345 | − if (!Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 2346 | − return; | |
| 2347 | − } | |
| 2348 | − | |
| 2349 | 2344 | //qDebug() << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView(); |
| 2350 | − | |
| 2351 | 2345 | bool wantExtraDebugging = getLogger()->extraDebugging(); |
| 2352 | 2346 | |
| 2353 | 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. |
| @@ -2665,9 +2659,20 @@ void Application::updateShadowMap() { · 311 unmodified lines | ||
| 2665 | 2659 | glEnable(GL_POLYGON_OFFSET_FILL); |
| 2666 | 2660 | glPolygonOffset(1.1f, 4.0f); // magic numbers courtesy http://www.eecs.berkeley.edu/~ravir/6160/papers/shadowmaps.ppt |
| 2667 | 2661 | |
| 2668 | − _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE); | |
| 2669 | − _particles.render(OctreeRenderer::SHADOW_RENDER_MODE); | |
| 2670 | − _models.render(OctreeRenderer::SHADOW_RENDER_MODE); | |
| 2662 | + { | |
| 2663 | + PerformanceTimer perfTimer("avatarManager"); | |
| 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 | + } | |
| 2671 | 2676 | |
| 2672 | 2677 | glDisable(GL_POLYGON_OFFSET_FILL); |
| 2673 | 2678 | |
| @@ -2864,10 +2869,10 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 190 unmodified lines | ||
| 2864 | 2869 | |
| 2865 | 2870 | // render models... |
| 2866 | 2871 | if (Menu::getInstance()->isOptionChecked(MenuOption::Models)) { |
| 2867 | − PerformanceTimer perfTimer("models"); | |
| 2872 | + PerformanceTimer perfTimer("entities"); | |
| 2868 | 2873 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 2869 | − "Application::displaySide() ... models..."); | |
| 2870 | − _models.render(); | |
| 2874 | + "Application::displaySide() ... entities..."); | |
| 2875 | + _entities.render(); | |
| 2871 | 2876 | } |
| 2872 | 2877 | |
| 2873 | 2878 | // render the ambient occlusion effect if enabled |
| @@ -3355,8 +3360,6 @@ void Application::updateLocationInServer() { · 481 unmodified lines | ||
| 3355 | 3360 | |
| 3356 | 3361 | if (accountManager.isLoggedIn()) { |
| 3357 | 3362 | |
| 3358 | − static QJsonObject lastLocationObject; | |
| 3359 | − | |
| 3360 | 3363 | // construct a QJsonObject given the user's current address information |
| 3361 | 3364 | QJsonObject updatedLocationObject; |
| 3362 | 3365 | |
| @@ -3367,14 +3370,9 @@ void Application::updateLocationInServer() { · 4 unmodified lines | ||
| 3367 | 3370 | |
| 3368 | 3371 | updatedLocationObject.insert("address", addressObject); |
| 3369 | 3372 | |
| 3370 | − if (updatedLocationObject != lastLocationObject) { | |
| 3371 | − | |
| 3372 | − accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation, | |
| 3373 | − JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson()); | |
| 3374 | − | |
| 3375 | − lastLocationObject = updatedLocationObject; | |
| 3376 | − } | |
| 3377 | − } | |
| 3373 | + accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation, | |
| 3374 | + JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson()); | |
| 3375 | + } | |
| 3378 | 3376 | } |
| 3379 | 3377 | |
| 3380 | 3378 | void Application::domainChanged(const QString& domainHostname) { |
| @@ -3398,7 +3396,7 @@ void Application::domainChanged(const QString& domainHostname) { · 17 unmodified lines | ||
| 3398 | 3396 | _particles.clear(); |
| 3399 | 3397 | |
| 3400 | 3398 | // reset the model renderer |
| 3401 | − _models.clear(); | |
| 3399 | + _entities.clear(); | |
| 3402 | 3400 | |
| 3403 | 3401 | // reset the voxels renderer |
| 3404 | 3402 | _voxels.killLocalVoxels(); |
| @@ -3437,7 +3435,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 32 unmodified lines | ||
| 3437 | 3435 | |
| 3438 | 3436 | _voxelEditSender.nodeKilled(node); |
| 3439 | 3437 | _particleEditSender.nodeKilled(node); |
| 3440 | − _modelEditSender.nodeKilled(node); | |
| 3438 | + _entityEditSender.nodeKilled(node); | |
| 3441 | 3439 | |
| 3442 | 3440 | if (node->getType() == NodeType::AudioMixer) { |
| 3443 | 3441 | QMetaObject::invokeMethod(&_audio, "audioMixerKilled"); |
| @@ -3517,16 +3515,16 @@ void Application::nodeKilled(SharedNodePointer node) { · 73 unmodified lines | ||
| 3517 | 3515 | } |
| 3518 | 3516 | _octreeSceneStatsLock.unlock(); |
| 3519 | 3517 | |
| 3520 | − } else if (node->getType() == NodeType::ModelServer) { | |
| 3518 | + } else if (node->getType() == NodeType::EntityServer) { | |
| 3521 | 3519 | |
| 3522 | 3520 | QUuid nodeUUID = node->getUUID(); |
| 3523 | 3521 | // see if this is the first we've heard of this node... |
| 3524 | − _modelServerJurisdictions.lockForRead(); | |
| 3525 | − if (_modelServerJurisdictions.find(nodeUUID) != _modelServerJurisdictions.end()) { | |
| 3526 | − unsigned char* rootCode = _modelServerJurisdictions[nodeUUID].getRootOctalCode(); | |
| 3522 | + _entityServerJurisdictions.lockForRead(); | |
| 3523 | + if (_entityServerJurisdictions.find(nodeUUID) != _entityServerJurisdictions.end()) { | |
| 3524 | + unsigned char* rootCode = _entityServerJurisdictions[nodeUUID].getRootOctalCode(); | |
| 3527 | 3525 | VoxelPositionSize rootDetails; |
| 3528 | 3526 | voxelDetailsForCode(rootCode, rootDetails); |
| 3529 | − _modelServerJurisdictions.unlock(); | |
| 3527 | + _entityServerJurisdictions.unlock(); | |
| 3530 | 3528 | |
| 3531 | 3529 | qDebug("model server going away...... v[%f, %f, %f, %f]", |
| 3532 | 3530 | rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s); |
| @@ -3543,10 +3541,10 @@ void Application::nodeKilled(SharedNodePointer node) { · 10 unmodified lines | ||
| 3543 | 3541 | } |
| 3544 | 3542 | |
| 3545 | 3543 | // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server |
| 3546 | − _modelServerJurisdictions.lockForWrite(); | |
| 3547 | − _modelServerJurisdictions.erase(_modelServerJurisdictions.find(nodeUUID)); | |
| 3544 | + _entityServerJurisdictions.lockForWrite(); | |
| 3545 | + _entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID)); | |
| 3548 | 3546 | } |
| 3549 | − _modelServerJurisdictions.unlock(); | |
| 3547 | + _entityServerJurisdictions.unlock(); | |
| 3550 | 3548 | |
| 3551 | 3549 | // also clean up scene stats for that server |
| 3552 | 3550 | _octreeSceneStatsLock.lockForWrite(); |
| @@ -3612,8 +3610,8 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 59 unmodified lines | ||
| 3612 | 3610 | jurisdiction = &_particleServerJurisdictions; |
| 3613 | 3611 | serverType = "Particle"; |
| 3614 | 3612 | } else { |
| 3615 | − jurisdiction = &_modelServerJurisdictions; | |
| 3616 | − serverType = "Model"; | |
| 3613 | + jurisdiction = &_entityServerJurisdictions; | |
| 3614 | + serverType = "Entity"; | |
| 3617 | 3615 | } |
| 3618 | 3616 | |
| 3619 | 3617 | jurisdiction->lockForRead(); |
| @@ -3722,8 +3720,8 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 102 unmodified lines | ||
| 3722 | 3720 | scriptEngine->getParticlesScriptingInterface()->setPacketSender(&_particleEditSender); |
| 3723 | 3721 | scriptEngine->getParticlesScriptingInterface()->setParticleTree(_particles.getTree()); |
| 3724 | 3722 | |
| 3725 | − scriptEngine->getModelsScriptingInterface()->setPacketSender(&_modelEditSender); | |
| 3726 | − scriptEngine->getModelsScriptingInterface()->setModelTree(_models.getTree()); | |
| 3723 | + scriptEngine->getEntityScriptingInterface()->setPacketSender(&_entityEditSender); | |
| 3724 | + scriptEngine->getEntityScriptingInterface()->setEntityTree(_entities.getTree()); | |
| 3727 | 3725 | |
| 3728 | 3726 | // model has some custom types |
| 3729 | 3727 | Model::registerMetaTypes(scriptEngine); |
| @@ -3858,14 +3856,17 @@ void Application::manageRunningScriptsWidgetVisibility(bool shown) { · 128 unmodified lines | ||
| 3858 | 3856 | } |
| 3859 | 3857 | |
| 3860 | 3858 | void Application::toggleRunningScriptsWidget() { |
| 3861 | − if (_runningScriptsWidgetWasVisible) { | |
| 3862 | − _runningScriptsWidget->hide(); | |
| 3863 | − _runningScriptsWidgetWasVisible = false; | |
| 3859 | + if (_runningScriptsWidget->isVisible()) { | |
| 3860 | + if (_runningScriptsWidget->hasFocus()) { | |
| 3861 | + _runningScriptsWidget->hide(); | |
| 3862 | + } else { | |
| 3863 | + _runningScriptsWidget->raise(); | |
| 3864 | + setActiveWindow(_runningScriptsWidget); | |
| 3865 | + _runningScriptsWidget->setFocus(); | |
| 3866 | + } | |
| 3864 | 3867 | } else { |
| 3865 | − _runningScriptsWidget->setBoundary(QRect(_window->geometry().topLeft(), | |
| 3866 | − _window->size())); | |
| 3867 | 3868 | _runningScriptsWidget->show(); |
| 3868 | − _runningScriptsWidgetWasVisible = true; | |
| 3869 | + _runningScriptsWidget->setFocus(); | |
| 3869 | 3870 | } |
| 3870 | 3871 | } |
| 3871 | 3872 | |