namechange FromBindFrame ==> InBindFrame

This commit is contained in:
Andrew Meadows 2014-07-14 15:33:05 -07:00
parent 00544aa975
commit b8fb5e0298
4 changed files with 12 additions and 12 deletions

View file

@ -69,7 +69,7 @@ void SkeletonModel::simulate(float deltaTime, bool fullUpdate) {
int jointIndex = geometry.humanIKJointIndices.at(humanIKJointIndex);
if (jointIndex != -1) {
JointState& state = _jointStates[jointIndex];
state.setRotationFromBindFrame(prioVR->getJointRotations().at(i), PALM_PRIORITY);
state.setRotationInBindFrame(prioVR->getJointRotations().at(i), PALM_PRIORITY);
}
}
return;
@ -217,7 +217,7 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) {
setJointPosition(parentJointIndex, palmPosition + forearm,
glm::quat(), false, -1, false, glm::vec3(0.0f, -1.0f, 0.0f), PALM_PRIORITY);
JointState& parentState = _jointStates[parentJointIndex];
parentState.setRotationFromBindFrame(palmRotation, PALM_PRIORITY);
parentState.setRotationInBindFrame(palmRotation, PALM_PRIORITY);
// lock hand to forearm by slamming its rotation (in parent-frame) to identity
_jointStates[jointIndex].setRotationInConstrainedFrame(glm::quat());
} else {
@ -381,13 +381,13 @@ void SkeletonModel::setHandPosition(int jointIndex, const glm::vec3& position, c
glm::quat shoulderRotation = rotationBetween(forwardVector, elbowPosition - shoulderPosition);
JointState& shoulderState = _jointStates[shoulderJointIndex];
shoulderState.setRotationFromBindFrame(shoulderRotation, PALM_PRIORITY);
shoulderState.setRotationInBindFrame(shoulderRotation, PALM_PRIORITY);
JointState& elbowState = _jointStates[elbowJointIndex];
elbowState.setRotationFromBindFrame(rotationBetween(shoulderRotation * forwardVector, wristPosition - elbowPosition) * shoulderRotation, PALM_PRIORITY);
elbowState.setRotationInBindFrame(rotationBetween(shoulderRotation * forwardVector, wristPosition - elbowPosition) * shoulderRotation, PALM_PRIORITY);
JointState& handState = _jointStates[jointIndex];
handState.setRotationFromBindFrame(rotation, PALM_PRIORITY);
handState.setRotationInBindFrame(rotation, PALM_PRIORITY);
}
bool SkeletonModel::getLeftHandPosition(glm::vec3& position) const {

View file

@ -95,7 +95,7 @@ void JointState::computeVisibleTransform(const glm::mat4& parentTransform) {
_visibleRotation = extractRotation(_visibleTransform);
}
glm::quat JointState::getRotationFromBindToModelFrame() const {
glm::quat JointState::getRotationInBindFrame() const {
return _rotation * _fbxJoint->inverseBindRotation;
}
@ -107,7 +107,7 @@ void JointState::restoreRotation(float fraction, float priority) {
}
}
void JointState::setRotationFromBindFrame(const glm::quat& rotation, float priority, bool constrain) {
void JointState::setRotationInBindFrame(const glm::quat& rotation, float priority, bool constrain) {
// rotation is from bind- to model-frame
assert(_fbxJoint != NULL);
if (priority >= _animationPriority) {

View file

@ -46,7 +46,7 @@ public:
glm::vec3 getPosition() const { return extractTranslation(_transform); }
/// \return rotation from bind to model frame
glm::quat getRotationFromBindToModelFrame() const;
glm::quat getRotationInBindFrame() const;
int getParentIndex() const { return _fbxJoint->parentIndex; }
@ -72,7 +72,7 @@ public:
/// \param rotation is from bind- to model-frame
/// computes and sets new _rotationInConstrainedFrame
/// NOTE: the JointState's model-frame transform/rotation are NOT updated!
void setRotationFromBindFrame(const glm::quat& rotation, float priority, bool constrain = false);
void setRotationInBindFrame(const glm::quat& rotation, float priority, bool constrain = false);
void setRotationInConstrainedFrame(const glm::quat& targetRotation);
void setVisibleRotationInConstrainedFrame(const glm::quat& targetRotation);

View file

@ -1041,8 +1041,8 @@ bool Model::setJointPosition(int jointIndex, const glm::vec3& position, const gl
if (useRotation) {
JointState& state = _jointStates[jointIndex];
state.setRotationFromBindFrame(rotation, priority);
endRotation = state.getRotationFromBindToModelFrame();
state.setRotationInBindFrame(rotation, priority);
endRotation = state.getRotationInBindFrame();
}
// then, we go from the joint upwards, rotating the end as close as possible to the target
@ -1213,7 +1213,7 @@ void Model::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm:
} while (numIterations < MAX_ITERATION_COUNT && distanceToGo < ACCEPTABLE_IK_ERROR);
// set final rotation of the end joint
endState.setRotationFromBindFrame(targetRotation, priority, true);
endState.setRotationInBindFrame(targetRotation, priority, true);
_shapesAreDirty = !_shapes.isEmpty();
}