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
2647 if (rootCode) {2647 if (rootCode) {
2648 VoxelPositionSize rootDetails;2648 VoxelPositionSize rootDetails;
2649 voxelDetailsForCode(rootCode, rootDetails);2649 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);
2651 2654
2652 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);2655 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
2653 2656
@@ -2688,7 +2691,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 34 unmodified lines
2688 // only send to the NodeTypes that are serverType2691 // only send to the NodeTypes that are serverType
2689 if (node->getActiveSocket() && node->getType() == serverType) {2692 if (node->getActiveSocket() && node->getType() == serverType) {
2690 2693
2691
2692 // get the server bounds for this server2694 // get the server bounds for this server
2693 QUuid nodeUUID = node->getUUID();2695 QUuid nodeUUID = node->getUUID();
2694 2696
@@ -2710,7 +2712,12 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 15 unmodified lines
2710 if (rootCode) {2712 if (rootCode) {
2711 VoxelPositionSize rootDetails;2713 VoxelPositionSize rootDetails;
2712 voxelDetailsForCode(rootCode, rootDetails);2714 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
2714 2721
2715 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);2722 ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
2716 if (serverFrustumLocation != ViewFrustum::OUTSIDE) {2723 if (serverFrustumLocation != ViewFrustum::OUTSIDE) {
@@ -2756,7 +2763,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 39 unmodified lines
2756 }2763 }
2757 // set up the packet for sending...2764 // set up the packet for sending...
2758 unsigned char* endOfQueryPacket = queryPacket;2765 unsigned char* endOfQueryPacket = queryPacket;
2759 2766
2760 // insert packet type/version and node UUID2767 // insert packet type/version and node UUID
2761 endOfQueryPacket += populatePacketHeader(reinterpret_cast<char*>(endOfQueryPacket), packetType);2768 endOfQueryPacket += populatePacketHeader(reinterpret_cast<char*>(endOfQueryPacket), packetType);
2762 2769