implement RenderableModelEntityItem::setAbsoluteJointRotationInObjectFrame and RenderableModelEntityItem::setAbsoluteJointTranslationInObjectFrame

This commit is contained in:
Seth Alves 2016-11-04 11:44:42 -07:00
parent e41fa94958
commit 689fdfb35f

View file

@ -1037,6 +1037,9 @@ bool RenderableModelEntityItem::setAbsoluteJointRotationInObjectFrame(int index,
} }
int jointParentIndex = rig->getJointParentIndex(index); int jointParentIndex = rig->getJointParentIndex(index);
if (jointParentIndex == -1) {
return setLocalJointRotation(index, rotation);
}
bool success; bool success;
AnimPose jointParentPose; AnimPose jointParentPose;
@ -1067,6 +1070,9 @@ bool RenderableModelEntityItem::setAbsoluteJointTranslationInObjectFrame(int ind
} }
int jointParentIndex = rig->getJointParentIndex(index); int jointParentIndex = rig->getJointParentIndex(index);
if (jointParentIndex == -1) {
return setLocalJointTranslation(index, translation);
}
bool success; bool success;
AnimPose jointParentPose; AnimPose jointParentPose;
@ -1084,7 +1090,7 @@ bool RenderableModelEntityItem::setAbsoluteJointTranslationInObjectFrame(int ind
jointAbsolutePose.trans = translation; jointAbsolutePose.trans = translation;
AnimPose jointRelativePose = jointParentInversePose * jointAbsolutePose; AnimPose jointRelativePose = jointParentInversePose * jointAbsolutePose;
return setLocalJointRotation(index, jointRelativePose.trans); return setLocalJointTranslation(index, jointRelativePose.trans);
} }
glm::quat RenderableModelEntityItem::getLocalJointRotation(int index) const { glm::quat RenderableModelEntityItem::getLocalJointRotation(int index) const {