History

added twisting of torso to follow head, fixed bug with body rotation not factored out of head rotation, removed credits from title bar

Philip Rosedale committed 11 years ago

Commit f4f43d61 parent ca355205 files · +22 −14Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 5 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+3−1
@@ -296,11 +296,13 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, Joint · 295 unmodified lines
296296 }
297297 // get the rotation axes in joint space and use them to adjust the rotation
298298 glm::vec3 xAxis(1.0f, 0.0f, 0.0f);
299+ glm::vec3 yAxis(0.0f, 1.0f, 0.0f);
299300 glm::vec3 zAxis(0.0f, 0.0f, 1.0f);
300301 glm::quat inverse = glm::inverse(parentState.getRotation() * state.getDefaultRotationInParentFrame());
301302 state.setRotationInConstrainedFrame(
302303 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)
304306 * state.getFBXJoint().rotation, LEAN_PRIORITY);
305307 }
306308

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t