History

first cut at renaming Models to Entities

ZappoMan committed 12 years ago

Commit ccc9eab1 parent f7820ce42 files · +1426 −1424Browse files

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

Unified · Split

interface/src/Application.cpp+32−32
@@ -54,7 +54,7 @@ · 53 unmodified lines
54#include <AccountManager.h>54#include <AccountManager.h>
55#include <AudioInjector.h>55#include <AudioInjector.h>
56#include <Logging.h>56#include <Logging.h>
57#include <ModelsScriptingInterface.h>57#include <EntityScriptingInterface.h>
58#include <OctalCode.h>58#include <OctalCode.h>
59#include <PacketHeaders.h>59#include <PacketHeaders.h>
60#include <ParticlesScriptingInterface.h>60#include <ParticlesScriptingInterface.h>
@@ -284,13 +284,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 223 unmodified lines
284 284
285 // tell the NodeList instance who to tell the domain server we care about285 // tell the NodeList instance who to tell the domain server we care about
286 nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer286 nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer
287 << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer287 << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer
288 << NodeType::MetavoxelServer);288 << NodeType::MetavoxelServer);
289 289
290 // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender290 // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender
291 connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent);291 connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent);
292 connect(&_particleEditSender, &ParticleEditPacketSender::packetSent, this, &Application::packetSent);292 connect(&_particleEditSender, &ParticleEditPacketSender::packetSent, this, &Application::packetSent);
293 connect(&_modelEditSender, &ModelEditPacketSender::packetSent, this, &Application::packetSent);293 connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);
294 294
295 // move the silentNodeTimer to the _nodeThread295 // move the silentNodeTimer to the _nodeThread
296 QTimer* silentNodeTimer = new QTimer();296 QTimer* silentNodeTimer = new QTimer();
@@ -334,7 +334,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 37 unmodified lines
334 // Tell our voxel edit sender about our known jurisdictions334 // Tell our voxel edit sender about our known jurisdictions
335 _voxelEditSender.setVoxelServerJurisdictions(&_voxelServerJurisdictions);335 _voxelEditSender.setVoxelServerJurisdictions(&_voxelServerJurisdictions);
336 _particleEditSender.setServerJurisdictions(&_particleServerJurisdictions);336 _particleEditSender.setServerJurisdictions(&_particleServerJurisdictions);
337 _modelEditSender.setServerJurisdictions(&_modelServerJurisdictions);337 _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions);
338 338
339 Particle::setVoxelEditPacketSender(&_voxelEditSender);339 Particle::setVoxelEditPacketSender(&_voxelEditSender);
340 Particle::setParticleEditPacketSender(&_particleEditSender);340 Particle::setParticleEditPacketSender(&_particleEditSender);
@@ -346,7 +346,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 5 unmodified lines
346 // probably not the right long term solution. But for now, we're going to do this to346 // probably not the right long term solution. But for now, we're going to do this to
347 // allow you to move a particle around in your hand347 // allow you to move a particle around in your hand
348 _particleEditSender.setPacketsPerSecond(3000); // super high!!348 _particleEditSender.setPacketsPerSecond(3000); // super high!!
349 _modelEditSender.setPacketsPerSecond(3000); // super high!!349 _entityEditSender.setPacketsPerSecond(3000); // super high!!
350 350
351 // Set the sixense filtering351 // Set the sixense filtering
352 _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));352 _sixenseManager.setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
@@ -424,7 +424,7 @@ Application::~Application() { · 71 unmodified lines
424 _voxelHideShowThread.terminate();424 _voxelHideShowThread.terminate();
425 _voxelEditSender.terminate();425 _voxelEditSender.terminate();
426 _particleEditSender.terminate();426 _particleEditSender.terminate();
427 _modelEditSender.terminate();427 _entityEditSender.terminate();
428 428
429 storeSizeAndPosition();429 storeSizeAndPosition();
430 saveScripts();430 saveScripts();
@@ -523,7 +523,7 @@ void Application::initializeGL() { · 92 unmodified lines
523 _voxelEditSender.initialize(_enableProcessVoxelsThread);523 _voxelEditSender.initialize(_enableProcessVoxelsThread);
524 _voxelHideShowThread.initialize(_enableProcessVoxelsThread);524 _voxelHideShowThread.initialize(_enableProcessVoxelsThread);
525 _particleEditSender.initialize(_enableProcessVoxelsThread);525 _particleEditSender.initialize(_enableProcessVoxelsThread);
526 _modelEditSender.initialize(_enableProcessVoxelsThread);526 _entityEditSender.initialize(_enableProcessVoxelsThread);
527 527
528 if (_enableProcessVoxelsThread) {528 if (_enableProcessVoxelsThread) {
529 qDebug("Voxel parsing thread created.");529 qDebug("Voxel parsing thread created.");
@@ -749,7 +749,7 @@ void Application::controlledBroadcastToNodes(const QByteArray& packet, const Nod · 219 unmodified lines
749 break;749 break;
750 case NodeType::VoxelServer:750 case NodeType::VoxelServer:
751 case NodeType::ParticleServer:751 case NodeType::ParticleServer:
752 case NodeType::ModelServer:752 case NodeType::EntityServer:
753 channel = BandwidthMeter::VOXELS;753 channel = BandwidthMeter::VOXELS;
754 break;754 break;
755 default:755 default:
@@ -1285,7 +1285,7 @@ void Application::dropEvent(QDropEvent *event) { · 529 unmodified lines
1285void Application::sendPingPackets() {1285void Application::sendPingPackets() {
1286 QByteArray pingPacket = NodeList::getInstance()->constructPingPacket();1286 QByteArray pingPacket = NodeList::getInstance()->constructPingPacket();
1287 controlledBroadcastToNodes(pingPacket, NodeSet()1287 controlledBroadcastToNodes(pingPacket, NodeSet()
1288 << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::ModelServer1288 << NodeType::VoxelServer << NodeType::ParticleServer << NodeType::EntityServer
1289 << NodeType::AudioMixer << NodeType::AvatarMixer1289 << NodeType::AudioMixer << NodeType::AvatarMixer
1290 << NodeType::MetavoxelServer);1290 << NodeType::MetavoxelServer);
1291}1291}
@@ -1687,8 +1687,8 @@ void Application::init() { · 395 unmodified lines
1687 _particles.init();1687 _particles.init();
1688 _particles.setViewFrustum(getViewFrustum());1688 _particles.setViewFrustum(getViewFrustum());
1689 1689
1690 _models.init();1690 _entities.init();
1691 _models.setViewFrustum(getViewFrustum());1691 _entities.setViewFrustum(getViewFrustum());
1692 1692
1693 _metavoxels.init();1693 _metavoxels.init();
1694 1694
@@ -1909,7 +1909,7 @@ void Application::updateThreads(float deltaTime) { · 214 unmodified lines
1909 _voxelHideShowThread.threadRoutine();1909 _voxelHideShowThread.threadRoutine();
1910 _voxelEditSender.threadRoutine();1910 _voxelEditSender.threadRoutine();
1911 _particleEditSender.threadRoutine();1911 _particleEditSender.threadRoutine();
1912 _modelEditSender.threadRoutine();1912 _entityEditSender.threadRoutine();
1913 }1913 }
1914}1914}
1915 1915
@@ -2052,8 +2052,8 @@ void Application::update(float deltaTime) { · 136 unmodified lines
2052 }2052 }
2053 2053
2054 {2054 {
2055 PerformanceTimer perfTimer("idle/update/_models");2055 PerformanceTimer perfTimer("idle/update/_entities");
2056 _models.update(); // update the models...2056 _entities.update(); // update the models...
2057 }2057 }
2058 2058
2059 {2059 {
@@ -2111,7 +2111,7 @@ void Application::updateMyAvatar(float deltaTime) { · 51 unmodified lines
2111 _lastQueriedTime = now;2111 _lastQueriedTime = now;
2112 queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions);2112 queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions);
2113 queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions);2113 queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions);
2114 queryOctree(NodeType::ModelServer, PacketTypeModelQuery, _modelServerJurisdictions);2114 queryOctree(NodeType::EntityServer, PacketTypeEntityQuery, _entityServerJurisdictions);
2115 _lastQueriedViewFrustum = _viewFrustum;2115 _lastQueriedViewFrustum = _viewFrustum;
2116 }2116 }
2117 }2117 }
@@ -2143,7 +2143,7 @@ int Application::sendNackPackets() { · 25 unmodified lines
2143 if (node->getActiveSocket() &&2143 if (node->getActiveSocket() &&
2144 ( node->getType() == NodeType::VoxelServer2144 ( node->getType() == NodeType::VoxelServer
2145 || node->getType() == NodeType::ParticleServer2145 || node->getType() == NodeType::ParticleServer
2146 || node->getType() == NodeType::ModelServer)2146 || node->getType() == NodeType::EntityServer)
2147 ) {2147 ) {
2148 2148
2149 QUuid nodeUUID = node->getUUID();2149 QUuid nodeUUID = node->getUUID();
@@ -2535,7 +2535,7 @@ void Application::updateShadowMap() { · 385 unmodified lines
2535 2535
2536 _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE);2536 _avatarManager.renderAvatars(Avatar::SHADOW_RENDER_MODE);
2537 _particles.render(OctreeRenderer::SHADOW_RENDER_MODE);2537 _particles.render(OctreeRenderer::SHADOW_RENDER_MODE);
2538 _models.render(OctreeRenderer::SHADOW_RENDER_MODE);2538 _entities.render(OctreeRenderer::SHADOW_RENDER_MODE);
2539 2539
2540 glDisable(GL_POLYGON_OFFSET_FILL);2540 glDisable(GL_POLYGON_OFFSET_FILL);
2541 2541
@@ -2736,7 +2736,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 194 unmodified lines
2736 PerformanceTimer perfTimer("paintGL/displaySide/models");2736 PerformanceTimer perfTimer("paintGL/displaySide/models");
2737 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),2737 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
2738 "Application::displaySide() ... models...");2738 "Application::displaySide() ... models...");
2739 _models.render();2739 _entities.render();
2740 }2740 }
2741 2741
2742 // render the ambient occlusion effect if enabled2742 // render the ambient occlusion effect if enabled
@@ -3247,7 +3247,7 @@ void Application::domainChanged(const QString& domainHostname) { · 504 unmodified lines
3247 _particles.clear();3247 _particles.clear();
3248 3248
3249 // reset the model renderer3249 // reset the model renderer
3250 _models.clear();3250 _entities.clear();
3251 3251
3252 // reset the voxels renderer3252 // reset the voxels renderer
3253 _voxels.killLocalVoxels();3253 _voxels.killLocalVoxels();
@@ -3286,7 +3286,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 32 unmodified lines
3286 3286
3287 _voxelEditSender.nodeKilled(node);3287 _voxelEditSender.nodeKilled(node);
3288 _particleEditSender.nodeKilled(node);3288 _particleEditSender.nodeKilled(node);
3289 _modelEditSender.nodeKilled(node);3289 _entityEditSender.nodeKilled(node);
3290 3290
3291 if (node->getType() == NodeType::VoxelServer) {3291 if (node->getType() == NodeType::VoxelServer) {
3292 QUuid nodeUUID = node->getUUID();3292 QUuid nodeUUID = node->getUUID();
@@ -3362,16 +3362,16 @@ void Application::nodeKilled(SharedNodePointer node) { · 69 unmodified lines
3362 }3362 }
3363 _octreeSceneStatsLock.unlock();3363 _octreeSceneStatsLock.unlock();
3364 3364
3365 } else if (node->getType() == NodeType::ModelServer) {3365 } else if (node->getType() == NodeType::EntityServer) {
3366 3366
3367 QUuid nodeUUID = node->getUUID();3367 QUuid nodeUUID = node->getUUID();
3368 // see if this is the first we've heard of this node...3368 // see if this is the first we've heard of this node...
3369 _modelServerJurisdictions.lockForRead();3369 _entityServerJurisdictions.lockForRead();
3370 if (_modelServerJurisdictions.find(nodeUUID) != _modelServerJurisdictions.end()) {3370 if (_entityServerJurisdictions.find(nodeUUID) != _entityServerJurisdictions.end()) {
3371 unsigned char* rootCode = _modelServerJurisdictions[nodeUUID].getRootOctalCode();3371 unsigned char* rootCode = _entityServerJurisdictions[nodeUUID].getRootOctalCode();
3372 VoxelPositionSize rootDetails;3372 VoxelPositionSize rootDetails;
3373 voxelDetailsForCode(rootCode, rootDetails);3373 voxelDetailsForCode(rootCode, rootDetails);
3374 _modelServerJurisdictions.unlock();3374 _entityServerJurisdictions.unlock();
3375 3375
3376 qDebug("model server going away...... v[%f, %f, %f, %f]",3376 qDebug("model server going away...... v[%f, %f, %f, %f]",
3377 rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);3377 rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s);
@@ -3388,10 +3388,10 @@ void Application::nodeKilled(SharedNodePointer node) { · 10 unmodified lines
3388 }3388 }
3389 3389
3390 // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server3390 // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
3391 _modelServerJurisdictions.lockForWrite();3391 _entityServerJurisdictions.lockForWrite();
3392 _modelServerJurisdictions.erase(_modelServerJurisdictions.find(nodeUUID));3392 _entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID));
3393 }3393 }
3394 _modelServerJurisdictions.unlock();3394 _entityServerJurisdictions.unlock();
3395 3395
3396 // also clean up scene stats for that server3396 // also clean up scene stats for that server
3397 _octreeSceneStatsLock.lockForWrite();3397 _octreeSceneStatsLock.lockForWrite();
@@ -3457,8 +3457,8 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 59 unmodified lines
3457 jurisdiction = &_particleServerJurisdictions;3457 jurisdiction = &_particleServerJurisdictions;
3458 serverType = "Particle";3458 serverType = "Particle";
3459 } else {3459 } else {
3460 jurisdiction = &_modelServerJurisdictions;3460 jurisdiction = &_entityServerJurisdictions;
3461 serverType = "Model";3461 serverType = "Entity";
3462 }3462 }
3463 3463
3464 jurisdiction->lockForRead();3464 jurisdiction->lockForRead();
@@ -3563,8 +3563,8 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 98 unmodified lines
3563 scriptEngine->getParticlesScriptingInterface()->setPacketSender(&_particleEditSender);3563 scriptEngine->getParticlesScriptingInterface()->setPacketSender(&_particleEditSender);
3564 scriptEngine->getParticlesScriptingInterface()->setParticleTree(_particles.getTree());3564 scriptEngine->getParticlesScriptingInterface()->setParticleTree(_particles.getTree());
3565 3565
3566 scriptEngine->getModelsScriptingInterface()->setPacketSender(&_modelEditSender);3566 scriptEngine->getEntityScriptingInterface()->setPacketSender(&_entityEditSender);
3567 scriptEngine->getModelsScriptingInterface()->setModelTree(_models.getTree());3567 scriptEngine->getEntityScriptingInterface()->setEntityTree(_entities.getTree());
3568 3568
3569 // hook our avatar object into this script engine3569 // hook our avatar object into this script engine
3570 scriptEngine->setAvatarData(_myAvatar, "MyAvatar"); // leave it as a MyAvatar class to expose thrust features3570 scriptEngine->setAvatarData(_myAvatar, "MyAvatar"); // leave it as a MyAvatar class to expose thrust features

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