History

rolling back previous change for IK instability

Andrew Meadows committed 12 years ago

Commit f99489c1 parent d7be5fa3 files · +16 −15Browse files

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

Unified · Split

interface/src/avatar/SkeletonModel.cpp+5−5
@@ -147,7 +147,7 @@ void SkeletonModel::applyHandPosition(int jointIndex, const glm::vec3& position) · 146 unmodified lines
147 return;147 return;
148 }148 }
149 JointState& state = _jointStates[jointIndex];149 JointState& state = _jointStates[jointIndex];
150 glm::quat handRotation = state.getRotationFromBindToModelFrame();150 glm::quat handRotation = state.getJointRotation();
151 151
152 // align hand with forearm152 // align hand with forearm
153 float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;153 float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;
@@ -170,10 +170,10 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) { · 16 unmodified lines
170 if (!Menu::getInstance()->isOptionChecked(MenuOption::AlternateIK) &&170 if (!Menu::getInstance()->isOptionChecked(MenuOption::AlternateIK) &&
171 Menu::getInstance()->isOptionChecked(MenuOption::AlignForearmsWithWrists)) {171 Menu::getInstance()->isOptionChecked(MenuOption::AlignForearmsWithWrists)) {
172 JointState parentState = _jointStates[parentJointIndex];172 JointState parentState = _jointStates[parentJointIndex];
173 palmRotation = parentState.getRotationFromBindToModelFrame();173 palmRotation = parentState.getJointRotation();
174 } else {174 } else {
175 JointState state = _jointStates[jointIndex];175 JointState state = _jointStates[jointIndex];
176 palmRotation = state.getRotationFromBindToModelFrame();176 palmRotation = state.getJointRotation();
177 }177 }
178 palmRotation = rotationBetween(palmRotation * geometry.palmDirection, palm.getNormal()) * palmRotation;178 palmRotation = rotationBetween(palmRotation * geometry.palmDirection, palm.getNormal()) * palmRotation;
179 179
@@ -414,7 +414,7 @@ bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const { · 234 unmodified lines
414 if (geometry.neckJointIndex == -1) {414 if (geometry.neckJointIndex == -1) {
415 return false;415 return false;
416 }416 }
417 return getJointRotationFromBindToWorldFrame(geometry.joints.at(geometry.neckJointIndex).parentIndex, neckParentRotation);417 return getJointRotationInWorldFrame(geometry.joints.at(geometry.neckJointIndex).parentIndex, neckParentRotation);
418}418}
419 419
420bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const {420bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const {
@@ -433,7 +433,7 @@ bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& seco · 12 unmodified lines
433 const float EYE_PROPORTION = 0.6f;433 const float EYE_PROPORTION = 0.6f;
434 glm::vec3 baseEyePosition = glm::mix(neckPosition, headPosition, EYE_PROPORTION);434 glm::vec3 baseEyePosition = glm::mix(neckPosition, headPosition, EYE_PROPORTION);
435 glm::quat headRotation;435 glm::quat headRotation;
436 getJointRotationFromBindToWorldFrame(geometry.headJointIndex, headRotation);436 getJointRotationInWorldFrame(geometry.headJointIndex, headRotation);
437 const float EYES_FORWARD = 0.25f;437 const float EYES_FORWARD = 0.25f;
438 const float EYE_SEPARATION = 0.1f;438 const float EYE_SEPARATION = 0.1f;
439 float headHeight = glm::distance(neckPosition, headPosition);439 float headHeight = glm::distance(neckPosition, headPosition);

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