From bad47bd527b99b89e54f8a3358d2c3bc6a892c62 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 20 Dec 2013 15:33:56 -0800 Subject: [PATCH 1/2] Fixed chat height --- interface/src/avatar/Avatar.cpp | 8 ++++---- interface/src/avatar/Avatar.h | 4 ++-- interface/src/avatar/Hand.cpp | 2 +- interface/src/avatar/MyAvatar.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 7762f5afbc..ec0c19cb7a 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -59,8 +59,8 @@ const float HEAD_RATE_MAX = 50.f; const float SKIN_COLOR[] = {1.0, 0.84, 0.66}; const float DARK_SKIN_COLOR[] = {0.9, 0.78, 0.63}; const int NUM_BODY_CONE_SIDES = 9; -const float chatMessageScale = 0.0015; -const float chatMessageHeight = 0.4f; +const float CHAT_MESSAGE_SCALE = 0.0015; +const float CHAT_MESSAGE_HEIGHT = 0.1f; void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL) { QByteArray message; @@ -303,7 +303,7 @@ void Avatar::render(bool forceRenderHead) { } glPushMatrix(); - glm::vec3 chatPosition = getPosition() + getBodyUpDirection() * chatMessageHeight * _scale; + glm::vec3 chatPosition = getHead().getEyePosition() + getBodyUpDirection() * CHAT_MESSAGE_HEIGHT * _scale; glTranslatef(chatPosition.x, chatPosition.y, chatPosition.z); glm::quat chatRotation = Application::getInstance()->getCamera()->getRotation(); glm::vec3 chatAxis = glm::axis(chatRotation); @@ -313,7 +313,7 @@ void Avatar::render(bool forceRenderHead) { glColor3f(0, 0.8, 0); glRotatef(180, 0, 1, 0); glRotatef(180, 0, 0, 1); - glScalef(_scale * chatMessageScale, _scale * chatMessageScale, 1.0f); + glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f); glDisable(GL_LIGHTING); glDepthMask(false); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index c435191a18..c23e30f60b 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -58,8 +58,8 @@ const float BODY_BALL_RADIUS_RIGHT_TOES = 0.025; extern const bool usingBigSphereCollisionTest; -extern const float chatMessageScale; -extern const float chatMessageHeight; +extern const float CHAT_MESSAGE_SCALE; +extern const float CHAT_MESSAGE_HEIGHT; enum AvatarBodyBallID { BODY_BALL_NULL = -1, diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index 136d59bc37..50bbe541f2 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -208,7 +208,7 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f TOY_BALL_UPDATE_SCRIPT); // after releasing the ball, we free our ParticleEditHandle so we can't edit it further - // note: deleting the edit handle doesn't effect the actual particle + // note: deleting the edit handle doesn't effect the act ual particle delete _ballParticleEditHandles[handID]; _ballParticleEditHandles[handID] = NULL; diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index c668eb5956..6c2bc78090 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -474,7 +474,7 @@ void MyAvatar::render(bool forceRenderHead) { } glPushMatrix(); - glm::vec3 chatPosition = getPosition() + getBodyUpDirection() * chatMessageHeight * _scale; + glm::vec3 chatPosition = getHead().getEyePosition() + getBodyUpDirection() * CHAT_MESSAGE_HEIGHT * _scale; glTranslatef(chatPosition.x, chatPosition.y, chatPosition.z); glm::quat chatRotation = Application::getInstance()->getCamera()->getRotation(); glm::vec3 chatAxis = glm::axis(chatRotation); @@ -484,7 +484,7 @@ void MyAvatar::render(bool forceRenderHead) { glColor3f(0, 0.8, 0); glRotatef(180, 0, 1, 0); glRotatef(180, 0, 0, 1); - glScalef(_scale * chatMessageScale, _scale * chatMessageScale, 1.0f); + glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f); glDisable(GL_LIGHTING); glDepthMask(false); From 03d192574d09ec803a30009a0a2446b8f2981f92 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Fri, 20 Dec 2013 22:57:35 -0800 Subject: [PATCH 2/2] typo --- interface/src/avatar/Hand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index 50bbe541f2..136d59bc37 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -208,7 +208,7 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f TOY_BALL_UPDATE_SCRIPT); // after releasing the ball, we free our ParticleEditHandle so we can't edit it further - // note: deleting the edit handle doesn't effect the act ual particle + // note: deleting the edit handle doesn't effect the actual particle delete _ballParticleEditHandles[handID]; _ballParticleEditHandles[handID] = NULL;