remove 'fromBind' argument to getJointRotation()

This commit is contained in:
Andrew Meadows 2014-06-02 14:20:13 -07:00
parent a62a270004
commit 9b3773fa3b
3 changed files with 14 additions and 14 deletions

View file

@ -147,7 +147,7 @@ void SkeletonModel::applyHandPosition(int jointIndex, const glm::vec3& position)
return;
}
JointState& state = _jointStates[jointIndex];
glm::quat handRotation = state.getJointRotation(true);
glm::quat handRotation = state.getJointRotation();
// align hand with forearm
float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;
@ -170,10 +170,10 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) {
if (!Menu::getInstance()->isOptionChecked(MenuOption::AlternateIK) &&
Menu::getInstance()->isOptionChecked(MenuOption::AlignForearmsWithWrists)) {
JointState parentState = _jointStates[parentJointIndex];
palmRotation = parentState.getJointRotation(true);
palmRotation = parentState.getJointRotation();
} else {
JointState state = _jointStates[jointIndex];
palmRotation = state.getJointRotation(true);
palmRotation = state.getJointRotation();
}
palmRotation = rotationBetween(palmRotation * geometry.palmDirection, palm.getNormal()) * palmRotation;

View file

@ -756,11 +756,11 @@ bool Model::getJointPosition(int jointIndex, glm::vec3& position) const {
return true;
}
bool Model::getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation, bool fromBind) const {
bool Model::getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const {
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
return false;
}
rotation = _jointStates[jointIndex].getJointRotation(fromBind);
rotation = _jointStates[jointIndex].getJointRotation();
return true;
}
@ -768,7 +768,7 @@ bool Model::getJointCombinedRotation(int jointIndex, glm::quat& rotation) const
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
return false;
}
rotation = _jointStates[jointIndex].getRotationInWorldFrame();
rotation = _jointStates[jointIndex].getRotationInWorldFrame(_rotation);
return true;
}
@ -1306,9 +1306,9 @@ bool Model::setJointPosition(int jointIndex, const glm::vec3& translation, const
JointState& state = _jointStates[jointIndex];
// TODO: figure out what this is trying to do and combine it into one JointState method
endRotation = state.getJointRotation(true);
endRotation = state.getJointRotation();
state.applyRotationDelta(rotation * glm::inverse(endRotation), true, priority);
endRotation = state.getJointRotation(true);
endRotation = state.getJointRotation();
}
// then, we go from the joint upwards, rotating the end as close as possible to the target
@ -2067,10 +2067,10 @@ void JointState::computeTransforms(const glm::mat4& parentTransform, const glm::
_combinedRotation = baseRotation * modifiedRotation;
}
glm::quat JointState::getJointRotation(bool fromBind) const {
glm::quat JointState::getJointRotation() const {
assert(_fbxJoint != NULL);
return _combinedRotation * (fromBind ? _fbxJoint->inverseBindRotation : _fbxJoint->inverseDefaultRotation);
//return _rotationInModelFrame * (fromBind ? _fbxJoint->inverseBindRotation : _fbxJoint->inverseDefaultRotation);
return _combinedRotation * _fbxJoint->inverseBindRotation;
//return _rotationInModelFrame * _fbxJoint->inverseBindRotation;
}
void JointState::restoreRotation(float fraction, float priority) {

View file

@ -53,7 +53,7 @@ public:
void computeTransforms(const glm::mat4& baseTransform, const glm::quat& baseRotation);
/// \return rotation from the joint's default (or bind) frame to world frame
glm::quat getJointRotation(bool fromBind = false) const;
glm::quat getJointRotation() const;
void applyRotationDelta(const glm::quat& delta, bool constrain = true, float priority = 1.0f);
@ -67,7 +67,7 @@ public:
void setRotation(const glm::quat& rotation, float priority);
const glm::mat4& getHybridTransform() const { return _transform; }
const glm::quat& getRotationInWorldFrame() const { return _combinedRotation; }
//const glm::quat& getRotationInWorldFrame() const { return _combinedRotation; }
void clearTransformTranslation();
glm::quat _rotation; // rotation relative to parent
@ -173,7 +173,7 @@ public:
int getLastFreeJointIndex(int jointIndex) const;
bool getJointPosition(int jointIndex, glm::vec3& position) const;
bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation, bool fromBind = false) const;
bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const;
bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const;
QStringList getJointNames() const;