Hey everyone,
Ive got a new rotation problem (jme3)
in my update method, Im moving and rotating my object to its "moveposition"
It works fine for all directions except them moving only in -z direction then my object looks in the wrong direction.
can someone tell me what Im doing wrong? I tried to find a topic for this problem but I didnt find one.
if (movepositon != null)
{
final Vector3f subtract = movepositon.subtract(position);
direction.set(subtract.normalize());
position.addLocal(direction.mult(tpf * 3));
mesh.setLocalTranslation(position);
final Vector3f left = mesh.getLocalRotation().getRotationColumn(0);
final Vector3f up = mesh.getLocalRotation().getRotationColumn(1);
Quaternion fromAxes = mesh.getLocalRotation().fromAxes(left, up, direction); // <- here is the error
mesh.setLocalRotation(fromAxes);
}
edit:
In this video you can see the bug in action sec 21-24 (the two imps on the right side)
http://www.youtube.com/watch?v=1Bl5TzjBlRA