From 240f65b7c513c15e20a01b2b46fff9dd9f9436fc Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 23 Oct 2013 16:15:03 -0700 Subject: [PATCH] Scale fixes. --- interface/src/avatar/SkeletonModel.cpp | 3 ++- interface/src/renderer/Model.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 9ccc63d587..c76100b316 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -66,7 +66,8 @@ bool SkeletonModel::render(float alpha) { glm::vec3 parentPosition; getJointPosition(parentIndex, parentPosition); const float STICK_RADIUS = BALL_RADIUS * 0.5f; - Avatar::renderJointConnectingCone(parentPosition, position, STICK_RADIUS, STICK_RADIUS); + Avatar::renderJointConnectingCone(parentPosition, position, STICK_RADIUS * _owningAvatar->getScale(), + STICK_RADIUS * _owningAvatar->getScale()); } Model::render(alpha); diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index ba43a0b214..c1222a8796 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -90,7 +90,6 @@ void Model::simulate(float deltaTime) { Model* model = new Model(this); model->init(); model->setURL(attachment.url); - model->setScale(attachment.scale); _attachments.append(model); } _resetStates = true; @@ -111,8 +110,9 @@ void Model::simulate(float deltaTime) { getJointPosition(attachment.jointIndex, jointTranslation); getJointRotation(attachment.jointIndex, jointRotation); - model->setTranslation(jointTranslation + jointRotation * attachment.translation); + model->setTranslation(jointTranslation + jointRotation * attachment.translation * _scale); model->setRotation(jointRotation * attachment.rotation); + model->setScale(_scale * attachment.scale); model->simulate(deltaTime); }