History

Merge pull request #4796 from sethalves/fix-octree-max-pps

Fix octree max pps

Clément Brisset committed 11 years ago

Commit 55bcb992 parents cc4ec8e 20f13892 files · +12 −5Browse files

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

Unified · Split

interface/src/Application.cpp+11−4
@@ -2647,7 +2647,10 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 2646 unmodified lines
26472647 if (rootCode) {
26482648 VoxelPositionSize rootDetails;
26492649 voxelDetailsForCode(rootCode, rootDetails);
2650− AACube serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s);
2650+ AACube serverBounds(glm::vec3(rootDetails.x * TREE_SCALE,
2651+ rootDetails.y * TREE_SCALE,
2652+ rootDetails.z * TREE_SCALE),
2653+ rootDetails.s * TREE_SCALE);
26512654
26522655 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
26532656
@@ -2688,7 +2691,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 34 unmodified lines
26882691 // only send to the NodeTypes that are serverType
26892692 if (node->getActiveSocket() && node->getType() == serverType) {
26902693
2691−
26922694 // get the server bounds for this server
26932695 QUuid nodeUUID = node->getUUID();
26942696
@@ -2710,7 +2712,12 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 15 unmodified lines
27102712 if (rootCode) {
27112713 VoxelPositionSize rootDetails;
27122714 voxelDetailsForCode(rootCode, rootDetails);
2713− AACube serverBounds(glm::vec3(rootDetails.x, rootDetails.y, rootDetails.z), rootDetails.s);
2715+ AACube serverBounds(glm::vec3(rootDetails.x * TREE_SCALE,
2716+ rootDetails.y * TREE_SCALE,
2717+ rootDetails.z * TREE_SCALE),
2718+ rootDetails.s * TREE_SCALE);
2719+
2720+
27142721
27152722 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
27162723 if (serverFrustumLocation != ViewFrustum::OUTSIDE) {
@@ -2756,7 +2763,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 39 unmodified lines
27562763 }
27572764 // set up the packet for sending...
27582765 unsigned char* endOfQueryPacket = queryPacket;
2759−
2766+
27602767 // insert packet type/version and node UUID
27612768 endOfQueryPacket += populatePacketHeader(reinterpret_cast<char*>(endOfQueryPacket), packetType);
27622769