I searched into the web, but I didn't found an explanation of the use of matrix bindpose , matrix inverse bind pose and the relation between them.
EDIT : I found this explanation http://www.gamedev.net/topic/571044-skeletal-animation-bonespace/ . It is wrong ?But remain this doubts :
final Matrix jointInverseBindPose = pose.getSkeleton().getJoint(jointIndex).getInverseBindPose();
final Matrix jointBindPose = jointInverseBindPose.invert();
jointInverseBindPose ok, now , maybe I understand whats is it.
But why do we do this :
jointBindPose = jointBindPose = jointInverseBindPose.invert();
?
in the precedent link this thing there isn't ..
Other parts of code that I don't really understand are :
// Get a vector representing forward direction in neck space, use inverse to take from world -> neck space.
SimpleVector forwardDirection = new SimpleVector(bindPoseDirection);
forwardDirection.rotate(jointInverseBindPose);
// Get a vector representing a direction to target point in neck space.
SimpleVector targetDirection = targetPos.calcSub(pose.getGlobal(jointIndex).getTranslation()).normalize();
targetDirection.rotate(jointInverseBindPose);
in particular why do we use jointinversebindpose to rotate the forwarDirection and the targetdirection ? to take from world to neck space don't we need to multiply vector to jointinversebindpose ?
And I don't understand this :
pose.getGlobal(jointIndex).getTranslation()
Can you give me a hand ?