Can anyone help a physics newbie make sense of the b2Vec2 arguments? Through trial & error (and some dumb luck) I've managed to make my objects move though the world in a uniform fashion. :) But I don't fully understand the values that I'm putting into the b2Vec2 when I use it in body->ApplyForce(). I have no gravity (it's a top-down game) and I am trying to figure out how to set a body in motion given its angle. Something like this:
|-----|
| ------------>
|-----|
where the arrow is equivalent to the 0 angle if I use body->GetAngle(). (Is that in radians?)
How do I figure out what b2Vect to use to make the body move in the direction of its angle? If anyone has any plain english explanations (or links to the same) of the values that make up a b2Vec2 (with relation to the ApplyForce() method), I think I can figure things out from there. :)
Ultimately, what I'd like to do is use that value to set my object in motion along that angle, then as the angle changes each step, the body's path will randomly "curve". In plain english, I want to do something like:
Get the body's angle
Put the body in motion in that direction.
Get a random float between -0.4 and 0.4.
Add that number to the current angle.
Set the body's new angle. (using body->SetTransform(currentPos, newAngle))
Repeat.