Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 5 files). Show all
Unified · Split
| @@ -296,11 +296,13 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, Joint · 295 unmodified lines | ||
| 296 | 296 | } |
| 297 | 297 | // get the rotation axes in joint space and use them to adjust the rotation |
| 298 | 298 | glm::vec3 xAxis(1.0f, 0.0f, 0.0f); |
| 299 | + glm::vec3 yAxis(0.0f, 1.0f, 0.0f); | |
| 299 | 300 | glm::vec3 zAxis(0.0f, 0.0f, 1.0f); |
| 300 | 301 | glm::quat inverse = glm::inverse(parentState.getRotation() * state.getDefaultRotationInParentFrame()); |
| 301 | 302 | state.setRotationInConstrainedFrame( |
| 302 | 303 | glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), inverse * zAxis) |
| 303 | − * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), inverse * xAxis) | |
| 304 | + * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), inverse * xAxis) | |
| 305 | + * glm::angleAxis(RADIANS_PER_DEGREE * _owningAvatar->getHead()->getTorsoTwist(), inverse * yAxis) | |
| 304 | 306 | * state.getFBXJoint().rotation, LEAN_PRIORITY); |
| 305 | 307 | } |
| 306 | 308 | |