History

Merge branch 'master' of github.com:highfidelity/hifi into 19935

Ryan Huffman committed 12 years ago

Commit d54dc5f2 parents e38d8f7 e6ba730245 files · +16913 −7768Browse files

Showing the changes to interface/src/Application.cpp (1 of 245 files). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t