applyRotationDeltaInModelFrame -> applyRotationDelta

This commit is contained in:
Andrew Meadows 2014-06-04 13:43:15 -07:00
parent d8f5e10947
commit b3cabb8156
3 changed files with 7 additions and 5 deletions

View file

@ -152,7 +152,7 @@ void SkeletonModel::applyHandPositionInModelFrame(int jointIndex, const glm::vec
// align hand with forearm
float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;
state.applyRotationDeltaInModelFrame(rotationBetween(handRotation * glm::vec3(-sign, 0.0f, 0.0f), forearmVector), true, PALM_PRIORITY);
state.applyRotationDelta(rotationBetween(handRotation * glm::vec3(-sign, 0.0f, 0.0f), forearmVector), true, PALM_PRIORITY);
}
void SkeletonModel::applyPalmDataInModelFrame(int jointIndex, PalmData& palm) {

View file

@ -1270,7 +1270,7 @@ bool Model::setJointPositionInModelFrame(int jointIndex, const glm::vec3& positi
// TODO: figure out what this is trying to do and combine it into one JointState method
endRotation = state.getRotation();
state.applyRotationDeltaInModelFrame(rotation * glm::inverse(endRotation), true, priority);
state.applyRotationDelta(rotation * glm::inverse(endRotation), true, priority);
endRotation = state.getRotation();
}
@ -1314,7 +1314,7 @@ bool Model::setJointPositionInModelFrame(int jointIndex, const glm::vec3& positi
1.0f / (combinedWeight + 1.0f));
}
}
state.applyRotationDeltaInModelFrame(combinedDelta, true, priority);
state.applyRotationDelta(combinedDelta, true, priority);
glm::quat actualDelta = state.getRotation() * glm::inverse(oldCombinedRotation);
endPosition = actualDelta * jointVector + jointPosition;
if (useRotation) {
@ -2031,7 +2031,8 @@ void JointState::clearTransformTranslation() {
_transform[3][2] = 0.0f;
}
void JointState::applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain, float priority) {
void JointState::applyRotationDelta(const glm::quat& delta, bool constrain, float priority) {
// NOTE: delta is in jointParent-frame
assert(_fbxJoint != NULL);
if (priority < _animationPriority) {
return;

View file

@ -49,7 +49,8 @@ public:
/// \return rotation from bind to model frame
glm::quat getRotationFromBindToModelFrame() const;
void applyRotationDeltaInModelFrame(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
/// \param delta is in the jointParent-frame
void applyRotationDelta(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
const glm::vec3& getDefaultTranslationInParentFrame() const;