mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 20:35:04 +02:00
Merge pull request #11832 from highfidelity/RC59
Merge RC59 into master
This commit is contained in:
commit
2b39cb4500
4 changed files with 19 additions and 3 deletions
|
@ -82,8 +82,12 @@ bool OctreeSendThread::process() {
|
||||||
if (auto node = _node.lock()) {
|
if (auto node = _node.lock()) {
|
||||||
OctreeQueryNode* nodeData = static_cast<OctreeQueryNode*>(node->getLinkedData());
|
OctreeQueryNode* nodeData = static_cast<OctreeQueryNode*>(node->getLinkedData());
|
||||||
|
|
||||||
// Sometimes the node data has not yet been linked, in which case we can't really do anything
|
// If we don't have the OctreeQueryNode at all
|
||||||
if (nodeData && !nodeData->isShuttingDown()) {
|
// or it's uninitialized because we haven't received a query yet from the client
|
||||||
|
// or we don't know where we should send packets for this node
|
||||||
|
// or we're shutting down
|
||||||
|
// then we can't send an entity data packet
|
||||||
|
if (nodeData && nodeData->hasReceivedFirstQuery() && node->getActiveSocket() && !nodeData->isShuttingDown()) {
|
||||||
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
||||||
packetDistributor(node, nodeData, viewFrustumChanged);
|
packetDistributor(node, nodeData, viewFrustumChanged);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
virtual ~OctreeQuery() {}
|
virtual ~OctreeQuery() {}
|
||||||
|
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
int parseData(ReceivedMessage& message) override;
|
virtual int parseData(ReceivedMessage& message) override;
|
||||||
|
|
||||||
// getters for camera details
|
// getters for camera details
|
||||||
const glm::vec3& getCameraPosition() const { return _cameraPosition; }
|
const glm::vec3& getCameraPosition() const { return _cameraPosition; }
|
||||||
|
|
|
@ -18,6 +18,12 @@
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
|
|
||||||
|
int OctreeQueryNode::parseData(ReceivedMessage& message) {
|
||||||
|
// set our flag to indicate that we've parsed for this query at least once
|
||||||
|
_hasReceivedFirstQuery = true;
|
||||||
|
|
||||||
|
return OctreeQuery::parseData(message);
|
||||||
|
}
|
||||||
|
|
||||||
void OctreeQueryNode::nodeKilled() {
|
void OctreeQueryNode::nodeKilled() {
|
||||||
_isShuttingDown = true;
|
_isShuttingDown = true;
|
||||||
|
|
|
@ -35,6 +35,8 @@ public:
|
||||||
void init(); // called after creation to set up some virtual items
|
void init(); // called after creation to set up some virtual items
|
||||||
virtual PacketType getMyPacketType() const = 0;
|
virtual PacketType getMyPacketType() const = 0;
|
||||||
|
|
||||||
|
virtual int parseData(ReceivedMessage& message) override;
|
||||||
|
|
||||||
void resetOctreePacket(); // 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
|
void writeToPacket(const unsigned char* buffer, unsigned int bytes); // writes to end of packet
|
||||||
|
@ -106,6 +108,8 @@ public:
|
||||||
bool shouldForceFullScene() const { return _shouldForceFullScene; }
|
bool shouldForceFullScene() const { return _shouldForceFullScene; }
|
||||||
void setShouldForceFullScene(bool shouldForceFullScene) { _shouldForceFullScene = shouldForceFullScene; }
|
void setShouldForceFullScene(bool shouldForceFullScene) { _shouldForceFullScene = shouldForceFullScene; }
|
||||||
|
|
||||||
|
bool hasReceivedFirstQuery() const { return _hasReceivedFirstQuery; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OctreeQueryNode(const OctreeQueryNode &);
|
OctreeQueryNode(const OctreeQueryNode &);
|
||||||
OctreeQueryNode& operator= (const OctreeQueryNode&);
|
OctreeQueryNode& operator= (const OctreeQueryNode&);
|
||||||
|
@ -153,6 +157,8 @@ private:
|
||||||
QJsonObject _lastCheckJSONParameters;
|
QJsonObject _lastCheckJSONParameters;
|
||||||
|
|
||||||
bool _shouldForceFullScene { false };
|
bool _shouldForceFullScene { false };
|
||||||
|
|
||||||
|
bool _hasReceivedFirstQuery { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_OctreeQueryNode_h
|
#endif // hifi_OctreeQueryNode_h
|
||||||
|
|
Loading…
Reference in a new issue