I have a variable called velocity
which I get from a dynamic body in Box2D. It is the velocity of a pirate ship and when I add torque to the ship I want that to be proportional to the speed (m/s – 10px = 1m). My problem is that I can’t divide/multiply a float (proportionalTorque
) by the Vector2 quantity of the velocity so what I need is a way of getting the speed (m/s) from the velocity or if there’s any other way of multiplying a float by a vector that’d be useful too.
↧
How to convert velocity (Vector) to m/s (Scalar)
↧