Code: Select all
Transform worldTr = new Transform();
worldTr = body.getWorldTransform(worldTr);
Quat4f quatr = new Quat4f();
quatr = worldTr.getRotation(quatr);
QuaternionUtil.setEuler(quatr, 0, 0, rotation);
worldTr.setRotation(quatr);
body.setWorldTransform(worldTr);
Code: Select all
setRotation()
Code: Select all
setEuler()
I'm using JBullet, by the way.
The RigidBody simply does not rotate. It always stays at a rotation of 0, and it never changes.
What is wrong and how can I fix it?