From 963434f78407a2b56ccde3c24fc39a6694780bf1 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 2 May 2014 11:04:52 -0700 Subject: [PATCH] Try using the head neck/eye rotation updates on the skeleton. --- interface/src/avatar/FaceModel.h | 2 -- interface/src/avatar/SkeletonModel.cpp | 8 ++++++++ interface/src/avatar/SkeletonModel.h | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/FaceModel.h b/interface/src/avatar/FaceModel.h index fdf8ab1fd2..0b7fea8ec4 100644 --- a/interface/src/avatar/FaceModel.h +++ b/interface/src/avatar/FaceModel.h @@ -26,8 +26,6 @@ public: virtual void simulate(float deltaTime, bool fullUpdate = true); -protected: - virtual void maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state); virtual void maybeUpdateEyeRotation(const JointState& parentState, const FBXJoint& joint, JointState& state); diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index f8ebba676f..e4c796d3ce 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -221,6 +221,14 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const glm::normalize(inverse * axes[0])) * joint.rotation; } +void SkeletonModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { + _owningAvatar->getHead()->getFaceModel().maybeUpdateNeckRotation(parentState, joint, state); +} + +void SkeletonModel::maybeUpdateEyeRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { + _owningAvatar->getHead()->getFaceModel().maybeUpdateEyeRotation(parentState, joint, state); +} + void SkeletonModel::renderJointConstraints(int jointIndex) { if (jointIndex == -1) { return; diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index 0a87fcf89d..ee6b3b9de3 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -46,6 +46,8 @@ protected: virtual void updateJointState(int index); virtual void maybeUpdateLeanRotation(const JointState& parentState, const FBXJoint& joint, JointState& state); + virtual void maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state); + virtual void maybeUpdateEyeRotation(const JointState& parentState, const FBXJoint& joint, JointState& state); private: