getPositionInModelFrame -> getPosition

This commit is contained in:
Andrew Meadows 2014-06-04 13:36:54 -07:00
parent 4a3fbfcdee
commit d8f5e10947
3 changed files with 6 additions and 6 deletions

View file

@ -263,7 +263,7 @@ void SkeletonModel::renderJointConstraints(int jointIndex) {
do {
const FBXJoint& joint = geometry.joints.at(jointIndex);
const JointState& jointState = _jointStates.at(jointIndex);
glm::vec3 position = _rotation * jointState.getPositionInModelFrame() + _translation;
glm::vec3 position = _rotation * jointState.getPosition() + _translation;
glPushMatrix();
glTranslatef(position.x, position.y, position.z);

View file

@ -718,7 +718,7 @@ bool Model::getJointPositionInWorldFrame(int jointIndex, glm::vec3& position) co
if (jointIndex == -1 || jointIndex >= _jointStates.size()) {
return false;
}
position = _translation + _rotation * _jointStates[jointIndex].getPositionInModelFrame();
position = _translation + _rotation * _jointStates[jointIndex].getPosition();
return true;
}
@ -960,7 +960,7 @@ void Model::updateShapePositions() {
// shape position and rotation need to be in world-frame
glm::quat stateRotation = state.getRotation();
glm::vec3 shapeOffset = uniformScale * (stateRotation * joint.shapePosition);
glm::vec3 worldPosition = _translation + _rotation * (state.getPositionInModelFrame() + shapeOffset);
glm::vec3 worldPosition = _translation + _rotation * (state.getPosition() + shapeOffset);
Shape* shape = _jointShapes[i];
shape->setPosition(worldPosition);
shape->setRotation(_rotation * stateRotation * joint.shapeRotation);
@ -985,12 +985,12 @@ bool Model::findRayIntersection(const glm::vec3& origin, const glm::vec3& direct
float radiusScale = extractUniformScale(_scale);
for (int i = 0; i < _jointStates.size(); i++) {
const FBXJoint& joint = geometry.joints[i];
glm::vec3 end = _translation + _rotation * _jointStates[i].getPositionInModelFrame();
glm::vec3 end = _translation + _rotation * _jointStates[i].getPosition();
float endRadius = joint.boneRadius * radiusScale;
glm::vec3 start = end;
float startRadius = joint.boneRadius * radiusScale;
if (joint.parentIndex != -1) {
start = _translation + _rotation * _jointStates[joint.parentIndex].getPositionInModelFrame();
start = _translation + _rotation * _jointStates[joint.parentIndex].getPosition();
startRadius = geometry.joints[joint.parentIndex].boneRadius * radiusScale;
}
// for now, use average of start and end radii

View file

@ -44,7 +44,7 @@ public:
const glm::mat4& getTransform() const { return _transform; }
glm::quat getRotation() const { return _rotation; }
glm::vec3 getPositionInModelFrame() const { return extractTranslation(_transform); }
glm::vec3 getPosition() const { return extractTranslation(_transform); }
/// \return rotation from bind to model frame
glm::quat getRotationFromBindToModelFrame() const;