mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +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
|
||||
glm::vec3 otherNodeBoxScale = (otherData->getPosition() - otherData->getGlobalBoundingBoxCorner()) * 2.0f;
|
||||
AABox otherNodeBox(otherData->getGlobalBoundingBoxCorner(), otherNodeBoxScale);
|
||||
|
||||
if (!nodeData->otherAvatarInView(otherNodeBox)) {
|
||||
qDebug() << "Avatar out of view!";
|
||||
//qDebug() << "Avatar out of view!";
|
||||
return false;
|
||||
} else {
|
||||
//qDebug() << "Avatar in view!";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -60,10 +60,17 @@ void AvatarMixerClientData::ignoreOther(SharedNodePointer self, SharedNodePointe
|
|||
void AvatarMixerClientData::readViewFrustumPacket(const QByteArray& message) {
|
||||
_currentViewFrustumIsValid = true;
|
||||
_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 {
|
||||
jsonObject["display_name"] = _avatar->getDisplayName();
|
||||
jsonObject["full_rate_distance"] = _fullRateDistance;
|
||||
|
|
|
@ -90,9 +90,8 @@ public:
|
|||
|
||||
void readViewFrustumPacket(const QByteArray& message);
|
||||
|
||||
bool otherAvatarInView(const AABox& otherAvatarBox) {
|
||||
return !_currentViewFrustumIsValid || _currentViewFrustum.boxIntersectsKeyhole(otherAvatarBox);
|
||||
}
|
||||
bool otherAvatarInView(const AABox& otherAvatarBox);
|
||||
bool otherAvatarInView(const glm::vec3& otherAvatar);
|
||||
|
||||
private:
|
||||
AvatarSharedPointer _avatar { new AvatarData() };
|
||||
|
|
|
@ -173,6 +173,8 @@ void ViewFrustum::fromByteArray(const QByteArray& input) {
|
|||
cameraAspectRatio,
|
||||
cameraNearClip,
|
||||
cameraFarClip));
|
||||
|
||||
calculate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue