Speed = the distance from zero to the x/y point. Or, as a result, the number of pixels traveled in a single frame/step.
Setting the speed of a Vector straight down is simple; ie: Gravity (0,10). (Gravity doesn't use the Vector for speed, but rather, force or acceleration, but, it's still easy to conceptualize the amount)
We know the speed is ten; zero pixels along the horizontal, 10 pixels down. And I think a Vector of (7.14,7.14) is about a speed of ten (if I remember my sin/cos math correctly). But how do I calculate the speed of (5,5) or (9,1) or (315,43).
How do you find the speed of a Vector? Some sort of inversed atan2 math?
Or maybe this is all way to complicated and there's some sort of b2Body.speed/b2Vec2.amplitude property that I haven't found?
Setting the speed of a Vector straight down is simple; ie: Gravity (0,10). (Gravity doesn't use the Vector for speed, but rather, force or acceleration, but, it's still easy to conceptualize the amount)
We know the speed is ten; zero pixels along the horizontal, 10 pixels down. And I think a Vector of (7.14,7.14) is about a speed of ten (if I remember my sin/cos math correctly). But how do I calculate the speed of (5,5) or (9,1) or (315,43).
How do you find the speed of a Vector? Some sort of inversed atan2 math?
Or maybe this is all way to complicated and there's some sort of b2Body.speed/b2Vec2.amplitude property that I haven't found?