Hi, I'm confused about this method in Bone:
public void revertToBind() {
worldTranslation.set(bindMatrix.toTranslationVector());
bindMatrix.toRotationQuat(worldRotation);
worldRotation.normalize();
Matrix3f rotMat = bindMatrix.toRotationMatrix();
worldScale.set(rotMat.getRow(0).length(), rotMat.getRow(1).length(), rotMat.getRow(2).length());
if (rotMat.determinant() < 0) worldScale.x = -worldScale.x;
if (children != null)
for (Spatial child : children) {
if (child instanceof Bone)
((Bone) child).revertToBind();
}
}
I'm assuming this is supposed to be called to revert the state of the skeleton back to it original loaded state. But this seems to only restore the "world" vectors back. So then the "local" vectors are still set to their animated values, and thus when you update and render the scene, the model is still in an animated pose.
(Sometimes)
I say this, because actually, one out of every 5 or so times I "revert" the model, it will in fact be in the original pose, BUT the entire model will be offset from it's original position and orientation. Same code. Same updateGeometricState() called.
The whole update system in jMonkey is beginning to get on my nerves. If there were a simple and standard way of updating everything that needs to be updated every frame, why is this not documented?
I have several posts (none of which answered) about various hitches in the update mechanism, regarding camera targets and flickering, etc.
Could the framework of JME be made a bit more stable as far as scene graphs staying up to date? I would hope so.
Anyways, if you have some info on the "reverting" of skeletons back to their original (un-animated) state, please reply.
Thanks