mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 21:02:17 +02:00
fixed div by zero
This commit is contained in:
parent
6f1136c417
commit
2832c33482
3 changed files with 5 additions and 12 deletions
|
@ -703,12 +703,3 @@ void OctreeServer::run() {
|
|||
silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000);
|
||||
}
|
||||
|
||||
|
||||
int OctreeServer::getPacketsPerClientPerInterval() const {
|
||||
int totalEvenly = getPacketsTotalPerInterval() / getCurrentClientCount();
|
||||
if (totalEvenly < 1) {
|
||||
totalEvenly = 1;
|
||||
}
|
||||
int packetsPerClientPerInterval = std::min(_packetsPerClientPerInterval, totalEvenly);
|
||||
return packetsPerClientPerInterval;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ public:
|
|||
Octree* getOctree() { return _tree; }
|
||||
JurisdictionMap* getJurisdiction() { return _jurisdiction; }
|
||||
|
||||
int getPacketsPerClientPerInterval() const;
|
||||
int getPacketsPerClientPerInterval() const { return std::min(_packetsPerClientPerInterval,
|
||||
std::max(1, getPacketsTotalPerInterval() / std::max(1, getCurrentClientCount()))); }
|
||||
|
||||
int getPacketsPerClientPerSecond() const { return getPacketsPerClientPerInterval() * INTERVALS_PER_SECOND; }
|
||||
int getPacketsTotalPerInterval() const { return _packetsTotalPerInterval; }
|
||||
int getPacketsTotalPerSecond() const { return getPacketsTotalPerInterval() * INTERVALS_PER_SECOND; }
|
||||
|
|
|
@ -21,10 +21,10 @@ var orientation = Quat.fromPitchYawRoll(0, yaw, 0);
|
|||
|
||||
function init() {
|
||||
if (isLocal) {
|
||||
MyAvatar.position = {x: 10, y: 0, z: 10};
|
||||
MyAvatar.position = {x: 5000, y: 500, z: 5000};
|
||||
MyAvatar.orientation = orientation;
|
||||
} else {
|
||||
VoxelViewer.setPosition({x: 10, y: 0, z: 10});
|
||||
VoxelViewer.setPosition({x: 5000, y: 500, z: 5000});
|
||||
VoxelViewer.setOrientation(orientation);
|
||||
VoxelViewer.queryOctree();
|
||||
Agent.isAvatar = true;
|
||||
|
|
Loading…
Reference in a new issue