Open ghost opened 7 years ago
What is the point about Jacobian Entry, why it has to be six-element array?
I know that 4 elements are for bodyA velocity, and bodyB velocity 2 elements are for bodyA angularVelocity and bodyB angularVelocity
but why it has to be G[6] instead of:
G[6]
G = { av: vec2.create(), bv: vec2.create(), aav: 0, bav: 0 };
As far as I can see p2 use some temporary vec2 to assign G[0] and G[1] etc. for calculations. But it would be cleaner with G as object shown above.
vec2
G[0]
G[1]
It doesn't really have to be an array... It just happened to become like that when I first wrote it. In another project I worked on, we used a JacobianEntry class. I think bullet has such class too.
What is the point about Jacobian Entry, why it has to be six-element array?
I know that 4 elements are for bodyA velocity, and bodyB velocity 2 elements are for bodyA angularVelocity and bodyB angularVelocity
but why it has to be
G[6]
instead of:As far as I can see p2 use some temporary
vec2
to assignG[0]
andG[1]
etc. for calculations. But it would be cleaner with G as object shown above.