History

Clear the brush, clear the cobwebs, and set the other orientations now that we're clear on what coordinate system we're in.

Howard Stearns committed 11 years ago

Commit 2ed69001 parent 476ca361 file · +5 −6Browse files

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

Unified · Split

interface/src/avatar/SkeletonModel.cpp+5−6
@@ -137,15 +137,14 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { · 136 unmodified lines
137 // If the head is not positioned, updateEyeJoints won't get the math right137 // If the head is not positioned, updateEyeJoints won't get the math right
138 glm::quat headOrientation;138 glm::quat headOrientation;
139 _rig->getJointRotation(geometry.headJointIndex, headOrientation);139 _rig->getJointRotation(geometry.headJointIndex, headOrientation);
140 glm::quat modelOrientation = getRotation();140 glm::vec3 eulers = safeEulerAngles(headOrientation);
141 glm::quat adjust = modelOrientation;
142 glm::quat headOrientationInAvatar = adjust * headOrientation;
143 glm::vec3 eulers = safeEulerAngles(headOrientationInAvatar);
144 head->setBasePitch(glm::degrees(-eulers.x));141 head->setBasePitch(glm::degrees(-eulers.x));
142 head->setBaseYaw(glm::degrees(eulers.y));
143 head->setBaseRoll(glm::degrees(-eulers.z));
145 _rig->updateEyeJoints(geometry.leftEyeJointIndex, geometry.rightEyeJointIndex,144 _rig->updateEyeJoints(geometry.leftEyeJointIndex, geometry.rightEyeJointIndex,
146 getTranslation(), modelOrientation,145 getTranslation(), getRotation(),
147 head->getFinalOrientationInWorldFrame(), head->getCorrectedLookAtPosition());146 head->getFinalOrientationInWorldFrame(), head->getCorrectedLookAtPosition());
148 }147 }
149}148}
150 149
151// Called by Avatar::simulate after it has set the joint states (fullUpdate true if changed),150// Called by Avatar::simulate after it has set the joint states (fullUpdate true if changed),

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