Physics Rotation/Torque Limiting

Hi Guys,



Trying to implement a first person environment here. I have set everything up and it works fine, apart from when it comes to rotation. I add torque and the rotation works fine, but if i want to rotate at a steady rate. Constantly adding torque just means that the rotation gets faster and faster, which is not what i want.



Is there any way to something rotate at a steady rate using physics?



Thanks!

You could set the angularVelocity by physicsNode.setAngularVelocity(Vector3f);



Hope that helps!

Tim

Thats great! Much easier than the way I was doing it!



However, when I rotate the box (my player) and apply the movement (forward/backward and strafe) forces to it, the box just moves in the same direction as before, ignoring the rotation. Is there a way around this?



Thanks for your help!

Do you want to move into the direction where your physicsNode looks at?



You could use physicsNode.getWorldRotation().getRotationColumn(2).mult($yourFaktor$); to compute the right linear velocity you should add to your Nodeā€¦