From 8c3a57566bb83ed64aed6257618dd28797392e22 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 7 May 2015 16:00:30 -0700 Subject: [PATCH 1/2] fix name of settings key for max octree pps --- libraries/octree/src/OctreeQuery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/octree/src/OctreeQuery.cpp b/libraries/octree/src/OctreeQuery.cpp index 6ca55fc4cc..5f62318338 100644 --- a/libraries/octree/src/OctreeQuery.cpp +++ b/libraries/octree/src/OctreeQuery.cpp @@ -16,7 +16,7 @@ #include "OctreeConstants.h" #include "OctreeQuery.h" -Setting::Handle maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS); +Setting::Handle maxOctreePacketsPerSecond("maxOctreePPSSpin", DEFAULT_MAX_OCTREE_PPS); OctreeQuery::OctreeQuery() { _maxOctreePPS = maxOctreePacketsPerSecond.get(); From c1e3500f3ccd5d6165b53b1cdabf8b83261d52bb Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Thu, 7 May 2015 16:01:08 -0700 Subject: [PATCH 2/2] voxelDetailsForCode returns a ratio, cubeinfrustrum takes meters --- interface/src/Application.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8d660848f2..61ba836d4a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2644,7 +2644,10 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node if (rootCode) { VoxelPositionSize rootDetails; voxelDetailsForCode(rootCode, rootDetails); - AACube serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s); + AACube serverBounds(glm::vec3(rootDetails.x * TREE_SCALE, + rootDetails.y * TREE_SCALE, + rootDetails.z * TREE_SCALE), + rootDetails.s * TREE_SCALE); ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds); @@ -2685,7 +2688,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node // only send to the NodeTypes that are serverType if (node->getActiveSocket() && node->getType() == serverType) { - // get the server bounds for this server QUuid nodeUUID = node->getUUID(); @@ -2707,7 +2709,12 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node if (rootCode) { VoxelPositionSize rootDetails; voxelDetailsForCode(rootCode, rootDetails); - AACube serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s); + AACube serverBounds(glm::vec3(rootDetails.x * TREE_SCALE, + rootDetails.y * TREE_SCALE, + rootDetails.z * TREE_SCALE), + rootDetails.s * TREE_SCALE); + + ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds); if (serverFrustumLocation != ViewFrustum::OUTSIDE) { @@ -2753,7 +2760,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node } // set up the packet for sending... unsigned char* endOfQueryPacket = queryPacket; - + // insert packet type/version and node UUID endOfQueryPacket += populatePacketHeader(reinterpret_cast(endOfQueryPacket), packetType);