mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:38:02 +02:00
restore rendering of avatar receive stats
This commit is contained in:
parent
442080dec7
commit
75b563d598
6 changed files with 20 additions and 20 deletions
|
@ -5119,6 +5119,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
||||||
QMutexLocker viewLocker(&_viewMutex);
|
QMutexLocker viewLocker(&_viewMutex);
|
||||||
renderArgs->setViewFrustum(_displayViewFrustum);
|
renderArgs->setViewFrustum(_displayViewFrustum);
|
||||||
}
|
}
|
||||||
|
renderArgs->_cameraMode = (int8_t)theCamera.getMode(); // HACK
|
||||||
renderArgs->_scene = getMain3DScene();
|
renderArgs->_scene = getMain3DScene();
|
||||||
_renderEngine->getRenderContext()->args = renderArgs;
|
_renderEngine->getRenderContext()->args = renderArgs;
|
||||||
|
|
||||||
|
|
|
@ -653,20 +653,19 @@ void Avatar::render(RenderArgs* renderArgs) {
|
||||||
_skeletonModel->renderBoundingCollisionShapes(*renderArgs->_batch, getUniformScale(), BOUNDING_SHAPE_ALPHA);
|
_skeletonModel->renderBoundingCollisionShapes(*renderArgs->_batch, getUniformScale(), BOUNDING_SHAPE_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /// -------------- REMOVED FOR NOW --------------
|
if (showReceiveStats || showNamesAboveHeads) {
|
||||||
// removed CPU calculations as per removal of menu option
|
glm::vec3 toTarget = frustum.getPosition() - getPosition();
|
||||||
glm::vec3 toTarget = frustum.getPosition() - getPosition();
|
float distanceToTarget = glm::length(toTarget);
|
||||||
float distanceToTarget = glm::length(toTarget);
|
const float DISPLAYNAME_DISTANCE = 20.0f;
|
||||||
const float DISPLAYNAME_DISTANCE = 20.0f;
|
updateDisplayNameAlpha(distanceToTarget < DISPLAYNAME_DISTANCE);
|
||||||
setShowDisplayName(distanceToTarget < DISPLAYNAME_DISTANCE);
|
if (!isMyAvatar() || renderArgs->_cameraMode != (int8_t)CAMERA_MODE_FIRST_PERSON) {
|
||||||
if (!isMyAvatar() || renderArgs->_cameraMode != (int8_t)CAMERA_MODE_FIRST_PERSON) {
|
auto& frustum = renderArgs->getViewFrustum();
|
||||||
auto& frustum = renderArgs->getViewFrustum();
|
auto textPosition = getDisplayNamePosition();
|
||||||
auto textPosition = getDisplayNamePosition();
|
if (frustum.pointIntersectsFrustum(textPosition)) {
|
||||||
if (frustum.pointIntersectsFrustum(textPosition)) {
|
renderDisplayName(batch, frustum, textPosition);
|
||||||
renderDisplayName(batch, frustum, textPosition);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::quat Avatar::computeRotationFromBodyToWorldUp(float proportion) const {
|
glm::quat Avatar::computeRotationFromBodyToWorldUp(float proportion) const {
|
||||||
|
@ -1275,8 +1274,8 @@ float Avatar::getPelvisFloatingHeight() const {
|
||||||
return -_skeletonModel->getBindExtents().minimum.y;
|
return -_skeletonModel->getBindExtents().minimum.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::setShowDisplayName(bool showDisplayName) {
|
void Avatar::updateDisplayNameAlpha(bool showDisplayName) {
|
||||||
if (!showNamesAboveHeads) {
|
if (!(showNamesAboveHeads || showReceiveStats)) {
|
||||||
_displayNameAlpha = 0.0f;
|
_displayNameAlpha = 0.0f;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
||||||
virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData) override;
|
virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData) override;
|
||||||
|
|
||||||
void setShowDisplayName(bool showDisplayName);
|
void updateDisplayNameAlpha(bool showDisplayName);
|
||||||
virtual void setSessionDisplayName(const QString& sessionDisplayName) override { }; // no-op
|
virtual void setSessionDisplayName(const QString& sessionDisplayName) override { }; // no-op
|
||||||
|
|
||||||
virtual int parseDataFromBuffer(const QByteArray& buffer) override;
|
virtual int parseDataFromBuffer(const QByteArray& buffer) override;
|
||||||
|
@ -368,6 +368,10 @@ private:
|
||||||
int _voiceSphereID;
|
int _voiceSphereID;
|
||||||
|
|
||||||
AvatarPhysicsCallback _physicsCallback { nullptr };
|
AvatarPhysicsCallback _physicsCallback { nullptr };
|
||||||
|
|
||||||
|
float _displayNameTargetAlpha { 1.0f };
|
||||||
|
float _displayNameAlpha { 1.0f };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Avatar_h
|
#endif // hifi_Avatar_h
|
||||||
|
|
|
@ -63,8 +63,6 @@ AvatarData::AvatarData() :
|
||||||
_keyState(NO_KEY_DOWN),
|
_keyState(NO_KEY_DOWN),
|
||||||
_forceFaceTrackerConnected(false),
|
_forceFaceTrackerConnected(false),
|
||||||
_headData(NULL),
|
_headData(NULL),
|
||||||
_displayNameTargetAlpha(1.0f),
|
|
||||||
_displayNameAlpha(1.0f),
|
|
||||||
_errorLogExpiry(0),
|
_errorLogExpiry(0),
|
||||||
_owningAvatarMixer(),
|
_owningAvatarMixer(),
|
||||||
_targetVelocity(0.0f)
|
_targetVelocity(0.0f)
|
||||||
|
|
|
@ -692,9 +692,6 @@ protected:
|
||||||
QString _sessionDisplayName { };
|
QString _sessionDisplayName { };
|
||||||
QUrl cannonicalSkeletonModelURL(const QUrl& empty) const;
|
QUrl cannonicalSkeletonModelURL(const QUrl& empty) const;
|
||||||
|
|
||||||
float _displayNameTargetAlpha;
|
|
||||||
float _displayNameAlpha;
|
|
||||||
|
|
||||||
QHash<QString, int> _jointIndices; ///< 1-based, since zero is returned for missing keys
|
QHash<QString, int> _jointIndices; ///< 1-based, since zero is returned for missing keys
|
||||||
QStringList _jointNames; ///< in order of depth-first traversal
|
QStringList _jointNames; ///< in order of depth-first traversal
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ public:
|
||||||
|
|
||||||
RenderDetails _details;
|
RenderDetails _details;
|
||||||
render::ScenePointer _scene;
|
render::ScenePointer _scene;
|
||||||
|
int8_t _cameraMode { -1 };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_RenderArgs_h
|
#endif // hifi_RenderArgs_h
|
||||||
|
|
Loading…
Reference in a new issue