Given a physics body – think a space ship – which I rotate based on player left/ right stick input, how can I set the velocity? I.e. how do I get the needed x/ y speed values for the setLinearVelocity(x, y) call, and make sure it’s always at a constant defined speed?
For what it’s worth, I found this bit in relation to another language:
ball.velocity = new Vector2(
(float)Math.Cos(cannon.rotation),
(float)Math.Sin(cannon.rotation)) \* 5.0f;
Thanks! [import]uid: 10284 topic_id: 4500 reply_id: 304500[/import]