- #1
g9icy
- 5
- 0
Greets all, I'm attempting to build a small physics engine that manages linear and angular forces. Please bear with me while I explain the problem I'm having.
Linear forces so far have not been an issue at all, however rotational forces are rather confusing.
I'm using Chris Hecker's rigid body dynamics articles (http://chrishecker.com/Rigid_Body_Dynamics) for my rotational dynamics, and its within his equations I've come across something I don't understand.
For his equation to work out the torque being applied to the center of mass of an object, he uses a "perpendicularised-vector", and this is what I fail to understand.
He uses the equation (to work out the angular momentum):
The superscript A and B means the position of object A (its center of mass) and object B (or the point a force is being applied to). The brackets mean the dot (product) symbol, and p is linear momentum.
Now here's what I'm trying to do: I have an object in 2d space, that has "engines" at specific points. When an engine fires at a point directly behind the object (for example, the back of a space ship) there should be no rotational force because the force is applied in the same direction as the distance vector from the object.
Now, in the above equation, how is the perpendicularised vector r actually calculated? It appears it needs to generate another vector and then retrieve a dot product of that vector and p, but I don't know how to generate a new vector from what I have. In a following equation the equation above is used but uses a force vector instead of p, which makes more sense but still leaves me with the same problem.
Thanks for taking the time to read this, I know it was probably a bit long winded just to ask a simple question. :)
Linear forces so far have not been an issue at all, however rotational forces are rather confusing.
I'm using Chris Hecker's rigid body dynamics articles (http://chrishecker.com/Rigid_Body_Dynamics) for my rotational dynamics, and its within his equations I've come across something I don't understand.
For his equation to work out the torque being applied to the center of mass of an object, he uses a "perpendicularised-vector", and this is what I fail to understand.
He uses the equation (to work out the angular momentum):
The superscript A and B means the position of object A (its center of mass) and object B (or the point a force is being applied to). The brackets mean the dot (product) symbol, and p is linear momentum.
Now here's what I'm trying to do: I have an object in 2d space, that has "engines" at specific points. When an engine fires at a point directly behind the object (for example, the back of a space ship) there should be no rotational force because the force is applied in the same direction as the distance vector from the object.
Now, in the above equation, how is the perpendicularised vector r actually calculated? It appears it needs to generate another vector and then retrieve a dot product of that vector and p, but I don't know how to generate a new vector from what I have. In a following equation the equation above is used but uses a force vector instead of p, which makes more sense but still leaves me with the same problem.
Thanks for taking the time to read this, I know it was probably a bit long winded just to ask a simple question. :)