Showing the changes to interface/src/Application.cpp (1 of 63 files). Show all
Unified · Split
| @@ -60,7 +60,7 @@ · 59 unmodified lines | |||
| 60 | #include <PerfStat.h> | 60 | #include <PerfStat.h> |
| 61 | #include <ResourceCache.h> | 61 | #include <ResourceCache.h> |
| 62 | #include <UUID.h> | 62 | #include <UUID.h> |
| 63 | #include <VoxelSceneStats.h> | 63 | #include <OctreeSceneStats.h> |
| 64 | #include <LocalVoxelsList.h> | 64 | #include <LocalVoxelsList.h> |
| 65 | 65 | ||
| 66 | #include "Application.h" | 66 | #include "Application.h" |
| @@ -1138,7 +1138,6 @@ void Application::touchEndEvent(QTouchEvent* event) { · 1071 unmodified lines | |||
| 1138 | 1138 | ||
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| 1141 | const bool USE_MOUSEWHEEL = false; | ||
| 1142 | void Application::wheelEvent(QWheelEvent* event) { | 1141 | void Application::wheelEvent(QWheelEvent* event) { |
| 1143 | 1142 | ||
| 1144 | _controllerScriptingInterface.emitWheelEvent(event); // send events to any registered scripts | 1143 | _controllerScriptingInterface.emitWheelEvent(event); // send events to any registered scripts |
| @@ -1327,7 +1326,6 @@ glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVox · 182 unmodified lines | |||
| 1327 | (mouseVoxel.z + mouseVoxel.s / 2.f) * TREE_SCALE); | 1326 | (mouseVoxel.z + mouseVoxel.s / 2.f) * TREE_SCALE); |
| 1328 | } | 1327 | } |
| 1329 | 1328 | ||
| 1330 | const int MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE = 1500; | ||
| 1331 | struct SendVoxelsOperationArgs { | 1329 | struct SendVoxelsOperationArgs { |
| 1332 | const unsigned char* newBaseOctCode; | 1330 | const unsigned char* newBaseOctCode; |
| 1333 | }; | 1331 | }; |
| @@ -1607,8 +1605,6 @@ void Application::shrinkMirrorView() { · 273 unmodified lines | |||
| 1607 | } | 1605 | } |
| 1608 | } | 1606 | } |
| 1609 | 1607 | ||
| 1610 | const float MAX_AVATAR_EDIT_VELOCITY = 1.0f; | ||
| 1611 | const float MAX_VOXEL_EDIT_DISTANCE = 50.0f; | ||
| 1612 | const float HEAD_SPHERE_RADIUS = 0.07f; | 1608 | const float HEAD_SPHERE_RADIUS = 0.07f; |
| 1613 | 1609 | ||
| 1614 | bool Application::isLookingAtMyAvatar(Avatar* avatar) { | 1610 | bool Application::isLookingAtMyAvatar(Avatar* avatar) { |
| @@ -1825,9 +1821,9 @@ void Application::updateDialogs(float deltaTime) { · 210 unmodified lines | |||
| 1825 | bandwidthDialog->update(); | 1821 | bandwidthDialog->update(); |
| 1826 | } | 1822 | } |
| 1827 | 1823 | ||
| 1828 | VoxelStatsDialog* voxelStatsDialog = Menu::getInstance()->getVoxelStatsDialog(); | 1824 | OctreeStatsDialog* octreeStatsDialog = Menu::getInstance()->getOctreeStatsDialog(); |
| 1829 | if (voxelStatsDialog) { | 1825 | if (octreeStatsDialog) { |
| 1830 | voxelStatsDialog->update(); | 1826 | octreeStatsDialog->update(); |
| 1831 | } | 1827 | } |
| 1832 | } | 1828 | } |
| 1833 | 1829 | ||
| @@ -2733,9 +2729,9 @@ void Application::displayStats() { · 899 unmodified lines | |||
| 2733 | unsigned long totalNodes = 0; | 2729 | unsigned long totalNodes = 0; |
| 2734 | unsigned long totalInternal = 0; | 2730 | unsigned long totalInternal = 0; |
| 2735 | unsigned long totalLeaves = 0; | 2731 | unsigned long totalLeaves = 0; |
| 2736 | for(NodeToVoxelSceneStatsIterator i = _octreeServerSceneStats.begin(); i != _octreeServerSceneStats.end(); i++) { | 2732 | for(NodeToOctreeSceneStatsIterator i = _octreeServerSceneStats.begin(); i != _octreeServerSceneStats.end(); i++) { |
| 2737 | //const QUuid& uuid = i->first; | 2733 | //const QUuid& uuid = i->first; |
| 2738 | VoxelSceneStats& stats = i->second; | 2734 | OctreeSceneStats& stats = i->second; |
| 2739 | serverCount++; | 2735 | serverCount++; |
| 2740 | if (_statsExpanded) { | 2736 | if (_statsExpanded) { |
| 2741 | if (serverCount > 1) { | 2737 | if (serverCount > 1) { |
| @@ -3288,11 +3284,11 @@ void Application::nodeKilled(SharedNodePointer node) { · 546 unmodified lines | |||
| 3288 | } | 3284 | } |
| 3289 | 3285 | ||
| 3290 | // also clean up scene stats for that server | 3286 | // also clean up scene stats for that server |
| 3291 | _voxelSceneStatsLock.lockForWrite(); | 3287 | _octreeSceneStatsLock.lockForWrite(); |
| 3292 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { | 3288 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { |
| 3293 | _octreeServerSceneStats.erase(nodeUUID); | 3289 | _octreeServerSceneStats.erase(nodeUUID); |
| 3294 | } | 3290 | } |
| 3295 | _voxelSceneStatsLock.unlock(); | 3291 | _octreeSceneStatsLock.unlock(); |
| 3296 | 3292 | ||
| 3297 | } else if (node->getType() == NodeType::ParticleServer) { | 3293 | } else if (node->getType() == NodeType::ParticleServer) { |
| 3298 | QUuid nodeUUID = node->getUUID(); | 3294 | QUuid nodeUUID = node->getUUID(); |
| @@ -3319,11 +3315,11 @@ void Application::nodeKilled(SharedNodePointer node) { · 20 unmodified lines | |||
| 3319 | } | 3315 | } |
| 3320 | 3316 | ||
| 3321 | // also clean up scene stats for that server | 3317 | // also clean up scene stats for that server |
| 3322 | _voxelSceneStatsLock.lockForWrite(); | 3318 | _octreeSceneStatsLock.lockForWrite(); |
| 3323 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { | 3319 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { |
| 3324 | _octreeServerSceneStats.erase(nodeUUID); | 3320 | _octreeServerSceneStats.erase(nodeUUID); |
| 3325 | } | 3321 | } |
| 3326 | _voxelSceneStatsLock.unlock(); | 3322 | _octreeSceneStatsLock.unlock(); |
| 3327 | 3323 | ||
| 3328 | } else if (node->getType() == NodeType::AvatarMixer) { | 3324 | } else if (node->getType() == NodeType::AvatarMixer) { |
| 3329 | // our avatar mixer has gone away - clear the hash of avatars | 3325 | // our avatar mixer has gone away - clear the hash of avatars |
| @@ -3338,12 +3334,12 @@ void Application::trackIncomingVoxelPacket(const QByteArray& packet, const Share · 8 unmodified lines | |||
| 3338 | QUuid nodeUUID = sendingNode->getUUID(); | 3334 | QUuid nodeUUID = sendingNode->getUUID(); |
| 3339 | 3335 | ||
| 3340 | // now that we know the node ID, let's add these stats to the stats for that node... | 3336 | // now that we know the node ID, let's add these stats to the stats for that node... |
| 3341 | _voxelSceneStatsLock.lockForWrite(); | 3337 | _octreeSceneStatsLock.lockForWrite(); |
| 3342 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { | 3338 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { |
| 3343 | VoxelSceneStats& stats = _octreeServerSceneStats[nodeUUID]; | 3339 | OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID]; |
| 3344 | stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec()); | 3340 | stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec()); |
| 3345 | } | 3341 | } |
| 3346 | _voxelSceneStatsLock.unlock(); | 3342 | _octreeSceneStatsLock.unlock(); |
| 3347 | } | 3343 | } |
| 3348 | } | 3344 | } |
| 3349 | 3345 | ||
| @@ -3353,7 +3349,7 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 3 unmodified lines | |||
| 3353 | 3349 | ||
| 3354 | // parse the incoming stats datas stick it in a temporary object for now, while we | 3350 | // parse the incoming stats datas stick it in a temporary object for now, while we |
| 3355 | // determine which server it belongs to | 3351 | // determine which server it belongs to |
| 3356 | VoxelSceneStats temp; | 3352 | OctreeSceneStats temp; |
| 3357 | int statsMessageLength = temp.unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), packet.size()); | 3353 | int statsMessageLength = temp.unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), packet.size()); |
| 3358 | 3354 | ||
| 3359 | // quick fix for crash... why would voxelServer be NULL? | 3355 | // quick fix for crash... why would voxelServer be NULL? |
| @@ -3361,14 +3357,14 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 1 unmodified line | |||
| 3361 | QUuid nodeUUID = sendingNode->getUUID(); | 3357 | QUuid nodeUUID = sendingNode->getUUID(); |
| 3362 | 3358 | ||
| 3363 | // now that we know the node ID, let's add these stats to the stats for that node... | 3359 | // now that we know the node ID, let's add these stats to the stats for that node... |
| 3364 | _voxelSceneStatsLock.lockForWrite(); | 3360 | _octreeSceneStatsLock.lockForWrite(); |
| 3365 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { | 3361 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { |
| 3366 | _octreeServerSceneStats[nodeUUID].unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), | 3362 | _octreeServerSceneStats[nodeUUID].unpackFromMessage(reinterpret_cast<const unsigned char*>(packet.data()), |
| 3367 | packet.size()); | 3363 | packet.size()); |
| 3368 | } else { | 3364 | } else { |
| 3369 | _octreeServerSceneStats[nodeUUID] = temp; | 3365 | _octreeServerSceneStats[nodeUUID] = temp; |
| 3370 | } | 3366 | } |
| 3371 | _voxelSceneStatsLock.unlock(); | 3367 | _octreeSceneStatsLock.unlock(); |
| 3372 | 3368 | ||
| 3373 | VoxelPositionSize rootDetails; | 3369 | VoxelPositionSize rootDetails; |
| 3374 | voxelDetailsForCode(temp.getJurisdictionRoot(), rootDetails); | 3370 | voxelDetailsForCode(temp.getJurisdictionRoot(), rootDetails); |
| @@ -3397,8 +3393,8 @@ int Application::parseOctreeStats(const QByteArray& packet, const SharedNodePoin · 22 unmodified lines | |||
| 3397 | } | 3393 | } |
| 3398 | // store jurisdiction details for later use | 3394 | // store jurisdiction details for later use |
| 3399 | // This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it | 3395 | // This is bit of fiddling is because JurisdictionMap assumes it is the owner of the values used to construct it |
| 3400 | // but VoxelSceneStats thinks it's just returning a reference to it's contents. So we need to make a copy of the | 3396 | // but OctreeSceneStats thinks it's just returning a reference to it's contents. So we need to make a copy of the |
| 3401 | // details from the VoxelSceneStats to construct the JurisdictionMap | 3397 | // details from the OctreeSceneStats to construct the JurisdictionMap |
| 3402 | JurisdictionMap jurisdictionMap; | 3398 | JurisdictionMap jurisdictionMap; |
| 3403 | jurisdictionMap.copyContents(temp.getJurisdictionRoot(), temp.getJurisdictionEndNodes()); | 3399 | jurisdictionMap.copyContents(temp.getJurisdictionRoot(), temp.getJurisdictionEndNodes()); |
| 3404 | (*jurisdiction)[nodeUUID] = jurisdictionMap; | 3400 | (*jurisdiction)[nodeUUID] = jurisdictionMap; |