diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index 10d30ad1ae..ede6dee5e3 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -158,10 +158,11 @@ bool OctreeQueryNode::shouldSuppressDuplicatePacket() { void OctreeQueryNode::init() { _myPacketType = getMyPacketType(); - resetOctreePacket(true); // don't bump sequence + resetOctreePacket(); // don't bump sequence } -void OctreeQueryNode::resetOctreePacket(bool lastWasSurpressed) { + +void OctreeQueryNode::resetOctreePacket() { // if shutting down, return immediately if (_isShuttingDown) { return; @@ -196,15 +197,12 @@ void OctreeQueryNode::resetOctreePacket(bool lastWasSurpressed) { *flagsAt = flags; _octreePacketAt += sizeof(OCTREE_PACKET_FLAGS); _octreePacketAvailableBytes -= sizeof(OCTREE_PACKET_FLAGS); - + // pack in sequence number OCTREE_PACKET_SEQUENCE* sequenceAt = (OCTREE_PACKET_SEQUENCE*)_octreePacketAt; *sequenceAt = _sequenceNumber; _octreePacketAt += sizeof(OCTREE_PACKET_SEQUENCE); _octreePacketAvailableBytes -= sizeof(OCTREE_PACKET_SEQUENCE); - if (!(lastWasSurpressed || _lastOctreePacketLength == (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE))) { - _sequenceNumber++; - } // pack in timestamp OCTREE_PACKET_SENT_TIME now = usecTimestampNow(); @@ -365,3 +363,6 @@ void OctreeQueryNode::dumpOutOfView() { } } +void OctreeQueryNode::incrementSequenceNumber() { + _sequenceNumber++; +} \ No newline at end of file diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 7b42208f16..1bb3a72a0c 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -35,7 +35,7 @@ public: void init(); // called after creation to set up some virtual items virtual PacketType getMyPacketType() const = 0; - void resetOctreePacket(bool lastWasSurpressed = false); // resets octree packet to after "V" header + void resetOctreePacket(); // resets octree packet to after "V" header void writeToPacket(const unsigned char* buffer, unsigned int bytes); // writes to end of packet @@ -99,6 +99,8 @@ public: void nodeKilled(); void forceNodeShutdown(); bool isShuttingDown() const { return _isShuttingDown; } + + void incrementSequenceNumber(); private slots: void sendThreadFinished(); @@ -135,8 +137,9 @@ private: float _lastClientOctreeSizeScale; bool _lodChanged; bool _lodInitialized; - + OCTREE_PACKET_SEQUENCE _sequenceNumber; + quint64 _lastRootTimestamp; PacketType _myPacketType; diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index d8a9f3d1ea..8d6803adac 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -9,8 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include - #include #include #include @@ -139,7 +137,7 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes // obscure the packet and not send it. This allows the callers and upper level logic to not need to know about // this rate control savings. if (nodeData->shouldSuppressDuplicatePacket()) { - nodeData->resetOctreePacket(true); // we still need to reset it though! + nodeData->resetOctreePacket(); // we still need to reset it though! return packetsSent; // without sending... } @@ -244,6 +242,7 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes trueBytesSent += nodeData->getPacketLength(); truePacketsSent++; packetsSent++; + nodeData->incrementSequenceNumber(); nodeData->resetOctreePacket(); } diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index 256a3ea67c..2fe12cce24 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -11,7 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var alwaysLook = true; // if you want the mouse look to happen only when you click, change this to false +var alwaysLook = false; // if you want the mouse look to happen only when you click, change this to false var isMouseDown = false; var lastX = 0; var lastY = 0;