mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:48:44 +02:00
Various tweaks; fix clang warning
This commit is contained in:
parent
7b7f369c39
commit
c2ac2b9ab0
4 changed files with 12 additions and 14 deletions
|
@ -239,7 +239,7 @@ void AvatarMixerClientData::ignoreOther(const Node* self, const Node* other) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarMixerClientData::removeFromRadiusIgnoringSet(SharedNodePointer self, const QUuid& other) {
|
void AvatarMixerClientData::removeFromRadiusIgnoringSet(const QUuid& other) {
|
||||||
_radiusIgnoredOthers.erase(other);
|
_radiusIgnoredOthers.erase(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
glm::vec3 getGlobalBoundingBoxCorner() const { return _avatar ? _avatar->getGlobalBoundingBoxCorner() : glm::vec3(0); }
|
glm::vec3 getGlobalBoundingBoxCorner() const { return _avatar ? _avatar->getGlobalBoundingBoxCorner() : glm::vec3(0); }
|
||||||
bool isRadiusIgnoring(const QUuid& other) const { return _radiusIgnoredOthers.find(other) != _radiusIgnoredOthers.end(); }
|
bool isRadiusIgnoring(const QUuid& other) const { return _radiusIgnoredOthers.find(other) != _radiusIgnoredOthers.end(); }
|
||||||
void addToRadiusIgnoringSet(const QUuid& other) { _radiusIgnoredOthers.insert(other); }
|
void addToRadiusIgnoringSet(const QUuid& other) { _radiusIgnoredOthers.insert(other); }
|
||||||
void removeFromRadiusIgnoringSet(SharedNodePointer self, const QUuid& other);
|
void removeFromRadiusIgnoringSet(const QUuid& other);
|
||||||
void ignoreOther(SharedNodePointer self, SharedNodePointer other);
|
void ignoreOther(SharedNodePointer self, SharedNodePointer other);
|
||||||
void ignoreOther(const Node* self, const Node* other);
|
void ignoreOther(const Node* self, const Node* other);
|
||||||
|
|
||||||
|
|
|
@ -276,16 +276,16 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
auto avatarPacketList = NLPacketList::create(PacketType::BulkAvatarData);
|
auto avatarPacketList = NLPacketList::create(PacketType::BulkAvatarData);
|
||||||
|
|
||||||
// Define the minimum bubble size
|
// Define the minimum bubble size
|
||||||
static const glm::vec3 minBubbleSize = avatar.getSensorToWorldScale() * glm::vec3(0.3f, 1.3f, 0.3f);
|
const glm::vec3 minBubbleSize = avatar.getSensorToWorldScale() * glm::vec3(0.3f, 1.3f, 0.3f);
|
||||||
// Define the scale of the box for the current node
|
// Define the scale of the box for the current node
|
||||||
glm::vec3 nodeBoxScale = (nodeData->getPosition() - nodeData->getGlobalBoundingBoxCorner()) * 2.0f * avatar.getSensorToWorldScale();
|
glm::vec3 nodeBoxScale = (avatar.getClientGlobalPosition() - avatar.getGlobalBoundingBoxCorner()) * 2.0f * avatar.getSensorToWorldScale();
|
||||||
// Set up the bounding box for the current node
|
// Set up the bounding box for the current node
|
||||||
AABox nodeBox(nodeData->getGlobalBoundingBoxCorner(), nodeBoxScale);
|
AABox nodeBox(avatar.getGlobalBoundingBoxCorner(), nodeBoxScale);
|
||||||
// Clamp the size of the bounding box to a minimum scale
|
// Clamp the size of the bounding box to a minimum scale
|
||||||
if (glm::any(glm::lessThan(nodeBoxScale, minBubbleSize))) {
|
if (glm::any(glm::lessThan(nodeBoxScale, minBubbleSize))) {
|
||||||
nodeBox.setScaleStayCentered(minBubbleSize);
|
nodeBox.setScaleStayCentered(minBubbleSize);
|
||||||
}
|
}
|
||||||
// Quadruple the scale of both bounding boxes
|
// Quadruple the scale of first bounding box
|
||||||
nodeBox.embiggen(4.0f);
|
nodeBox.embiggen(4.0f);
|
||||||
|
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
if (glm::any(glm::lessThan(otherNodeBoxScale, minBubbleSize))) {
|
if (glm::any(glm::lessThan(otherNodeBoxScale, minBubbleSize))) {
|
||||||
otherNodeBox.setScaleStayCentered(minBubbleSize);
|
otherNodeBox.setScaleStayCentered(minBubbleSize);
|
||||||
}
|
}
|
||||||
// Change the scale of both bounding boxes
|
// Change the scale of other bounding box
|
||||||
// (This is an arbitrary number determined empirically)
|
// (This is an arbitrary number determined empirically)
|
||||||
otherNodeBox.embiggen(2.4f);
|
otherNodeBox.embiggen(2.4f);
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
}
|
}
|
||||||
// Not close enough to ignore
|
// Not close enough to ignore
|
||||||
if (!shouldIgnore) {
|
if (!shouldIgnore) {
|
||||||
nodeData->removeFromRadiusIgnoringSet(node, avatarNode->getUUID());
|
nodeData->removeFromRadiusIgnoringSet(avatarNode->getUUID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,6 +439,7 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
auto traitsPacketList = NLPacketList::create(PacketType::BulkAvatarTraits, QByteArray(), true, true);
|
auto traitsPacketList = NLPacketList::create(PacketType::BulkAvatarTraits, QByteArray(), true, true);
|
||||||
while (!sortedAvatars.empty()) {
|
while (!sortedAvatars.empty()) {
|
||||||
const Node* otherNode = sortedAvatars.top().getNode();
|
const Node* otherNode = sortedAvatars.top().getNode();
|
||||||
|
auto lastEncodeForOther = sortedAvatars.top().getTimestamp();
|
||||||
sortedAvatars.pop();
|
sortedAvatars.pop();
|
||||||
remainingAvatars--;
|
remainingAvatars--;
|
||||||
|
|
||||||
|
@ -490,7 +491,6 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool includeThisAvatar = true;
|
bool includeThisAvatar = true;
|
||||||
auto lastEncodeForOther = nodeData->getLastOtherAvatarEncodeTime(otherNode->getUUID());
|
|
||||||
QVector<JointData>& lastSentJointsForOther = nodeData->getLastOtherAvatarSentJoints(otherNode->getUUID());
|
QVector<JointData>& lastSentJointsForOther = nodeData->getLastOtherAvatarSentJoints(otherNode->getUUID());
|
||||||
|
|
||||||
lastSentJointsForOther.resize(otherAvatar->getJointCount());
|
lastSentJointsForOther.resize(otherAvatar->getJointCount());
|
||||||
|
@ -561,8 +561,6 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
|
|
||||||
// use helper to add any changed traits to our packet list
|
// use helper to add any changed traits to our packet list
|
||||||
traitBytesSent += addChangedTraitsToBulkPacket(nodeData, otherNodeData, *traitsPacketList);
|
traitBytesSent += addChangedTraitsToBulkPacket(nodeData, otherNodeData, *traitsPacketList);
|
||||||
|
|
||||||
traitsPacketList->getDataSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 startPacketSending = usecTimestampNow();
|
quint64 startPacketSending = usecTimestampNow();
|
||||||
|
|
|
@ -128,9 +128,9 @@ void usecTimestampNowForceClockSkew(qint64 clockSkew) {
|
||||||
::usecTimestampNowAdjust = clockSkew;
|
::usecTimestampNowAdjust = clockSkew;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::atomic<qint64> TIME_REFERENCE { 0 }; // in usec
|
//static std::atomic<qint64> TIME_REFERENCE { 0 }; // in usec
|
||||||
static std::once_flag usecTimestampNowIsInitialized;
|
//static std::once_flag usecTimestampNowIsInitialized;
|
||||||
static QElapsedTimer timestampTimer;
|
//static QElapsedTimer timestampTimer;
|
||||||
|
|
||||||
quint64 usecTimestampNow(bool wantDebug) {
|
quint64 usecTimestampNow(bool wantDebug) {
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
Loading…
Reference in a new issue