mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
Merge pull request #4796 from sethalves/fix-octree-max-pps
Fix octree max pps
This commit is contained in:
commit
55bcb992d9
2 changed files with 12 additions and 5 deletions
|
@ -2647,7 +2647,10 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
|
||||||
if (rootCode) {
|
if (rootCode) {
|
||||||
VoxelPositionSize rootDetails;
|
VoxelPositionSize rootDetails;
|
||||||
voxelDetailsForCode(rootCode, 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);
|
ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
|
||||||
|
|
||||||
|
@ -2688,7 +2691,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
|
||||||
// only send to the NodeTypes that are serverType
|
// only send to the NodeTypes that are serverType
|
||||||
if (node->getActiveSocket() && node->getType() == serverType) {
|
if (node->getActiveSocket() && node->getType() == serverType) {
|
||||||
|
|
||||||
|
|
||||||
// get the server bounds for this server
|
// get the server bounds for this server
|
||||||
QUuid nodeUUID = node->getUUID();
|
QUuid nodeUUID = node->getUUID();
|
||||||
|
|
||||||
|
@ -2710,7 +2712,12 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
|
||||||
if (rootCode) {
|
if (rootCode) {
|
||||||
VoxelPositionSize rootDetails;
|
VoxelPositionSize rootDetails;
|
||||||
voxelDetailsForCode(rootCode, 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);
|
ViewFrustum::location serverFrustumLocation = _viewFrustum.cubeInFrustum(serverBounds);
|
||||||
if (serverFrustumLocation != ViewFrustum::OUTSIDE) {
|
if (serverFrustumLocation != ViewFrustum::OUTSIDE) {
|
||||||
|
@ -2756,7 +2763,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
|
||||||
}
|
}
|
||||||
// set up the packet for sending...
|
// set up the packet for sending...
|
||||||
unsigned char* endOfQueryPacket = queryPacket;
|
unsigned char* endOfQueryPacket = queryPacket;
|
||||||
|
|
||||||
// insert packet type/version and node UUID
|
// insert packet type/version and node UUID
|
||||||
endOfQueryPacket += populatePacketHeader(reinterpret_cast<char*>(endOfQueryPacket), packetType);
|
endOfQueryPacket += populatePacketHeader(reinterpret_cast<char*>(endOfQueryPacket), packetType);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "OctreeConstants.h"
|
#include "OctreeConstants.h"
|
||||||
#include "OctreeQuery.h"
|
#include "OctreeQuery.h"
|
||||||
|
|
||||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPSSpin", DEFAULT_MAX_OCTREE_PPS);
|
||||||
|
|
||||||
OctreeQuery::OctreeQuery() {
|
OctreeQuery::OctreeQuery() {
|
||||||
_maxOctreePPS = maxOctreePacketsPerSecond.get();
|
_maxOctreePPS = maxOctreePacketsPerSecond.get();
|
||||||
|
|
Loading…
Reference in a new issue