mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:58:35 +02:00
more hacking
This commit is contained in:
parent
a7750501c6
commit
7189f766a2
4 changed files with 17 additions and 6 deletions
|
@ -281,9 +281,12 @@ void AvatarMixer::broadcastAvatarData() {
|
||||||
// Also check to see if the other node is in our view
|
// Also check to see if the other node is in our view
|
||||||
glm::vec3 otherNodeBoxScale = (otherData->getPosition() - otherData->getGlobalBoundingBoxCorner()) * 2.0f;
|
glm::vec3 otherNodeBoxScale = (otherData->getPosition() - otherData->getGlobalBoundingBoxCorner()) * 2.0f;
|
||||||
AABox otherNodeBox(otherData->getGlobalBoundingBoxCorner(), otherNodeBoxScale);
|
AABox otherNodeBox(otherData->getGlobalBoundingBoxCorner(), otherNodeBoxScale);
|
||||||
|
|
||||||
if (!nodeData->otherAvatarInView(otherNodeBox)) {
|
if (!nodeData->otherAvatarInView(otherNodeBox)) {
|
||||||
qDebug() << "Avatar out of view!";
|
//qDebug() << "Avatar out of view!";
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
//qDebug() << "Avatar in view!";
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -60,10 +60,17 @@ void AvatarMixerClientData::ignoreOther(SharedNodePointer self, SharedNodePointe
|
||||||
void AvatarMixerClientData::readViewFrustumPacket(const QByteArray& message) {
|
void AvatarMixerClientData::readViewFrustumPacket(const QByteArray& message) {
|
||||||
_currentViewFrustumIsValid = true;
|
_currentViewFrustumIsValid = true;
|
||||||
_currentViewFrustum.fromByteArray(message);
|
_currentViewFrustum.fromByteArray(message);
|
||||||
qDebug() << __FUNCTION__;
|
|
||||||
_currentViewFrustum.printDebugDetails();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AvatarMixerClientData::otherAvatarInView(const glm::vec3& otherAvatar) {
|
||||||
|
return !_currentViewFrustumIsValid || _currentViewFrustum.pointIntersectsFrustum(otherAvatar);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AvatarMixerClientData::otherAvatarInView(const AABox& otherAvatarBox) {
|
||||||
|
return !_currentViewFrustumIsValid || _currentViewFrustum.boxIntersectsKeyhole(otherAvatarBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AvatarMixerClientData::loadJSONStats(QJsonObject& jsonObject) const {
|
void AvatarMixerClientData::loadJSONStats(QJsonObject& jsonObject) const {
|
||||||
jsonObject["display_name"] = _avatar->getDisplayName();
|
jsonObject["display_name"] = _avatar->getDisplayName();
|
||||||
jsonObject["full_rate_distance"] = _fullRateDistance;
|
jsonObject["full_rate_distance"] = _fullRateDistance;
|
||||||
|
|
|
@ -90,9 +90,8 @@ public:
|
||||||
|
|
||||||
void readViewFrustumPacket(const QByteArray& message);
|
void readViewFrustumPacket(const QByteArray& message);
|
||||||
|
|
||||||
bool otherAvatarInView(const AABox& otherAvatarBox) {
|
bool otherAvatarInView(const AABox& otherAvatarBox);
|
||||||
return !_currentViewFrustumIsValid || _currentViewFrustum.boxIntersectsKeyhole(otherAvatarBox);
|
bool otherAvatarInView(const glm::vec3& otherAvatar);
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AvatarSharedPointer _avatar { new AvatarData() };
|
AvatarSharedPointer _avatar { new AvatarData() };
|
||||||
|
|
|
@ -173,6 +173,8 @@ void ViewFrustum::fromByteArray(const QByteArray& input) {
|
||||||
cameraAspectRatio,
|
cameraAspectRatio,
|
||||||
cameraNearClip,
|
cameraNearClip,
|
||||||
cameraFarClip));
|
cameraFarClip));
|
||||||
|
|
||||||
|
calculate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue