(probably a question for Erin Catto)
I've looked around on the board to try to find the answer to this, as it has to do with the 2D cross product, but I can't find quite what I'm looking for.
Let me first say I'm implementing the white paper Iterative Dynamics with Temporal Coherence in my own framework, outside of Box2D, but still in 2D (and in C++).
When I make the Jacobian for a body with the ground (right now, all bodies are just squares of equal mass), I follow the white paper's convention that Jmap(i,0) for that constraint i is the ground (in this case, -1 instead of 0) (formed similarly for two interacting bodies, with the normal going the right way and what have you). Instead of 6-vectors for the Jacobians, I use 3-vectors, two spots for x and y, and one for rotation. The first two components of that Jacobian are the normalized x and y of the normal of the ground, and the rotation component is what I'm really iffy on. I represent rotation completely as a single scalar, and the white paper assumes 3D for the cross products and getting a vector to rotate around. I thought that taking the arc-sine of the "cross product" of the two vectors would work (for r cross n, it would be r.x*n.y - n.x-r.y) for the normalized vectors.
Help?
I've looked around on the board to try to find the answer to this, as it has to do with the 2D cross product, but I can't find quite what I'm looking for.
Let me first say I'm implementing the white paper Iterative Dynamics with Temporal Coherence in my own framework, outside of Box2D, but still in 2D (and in C++).
When I make the Jacobian for a body with the ground (right now, all bodies are just squares of equal mass), I follow the white paper's convention that Jmap(i,0) for that constraint i is the ground (in this case, -1 instead of 0) (formed similarly for two interacting bodies, with the normal going the right way and what have you). Instead of 6-vectors for the Jacobians, I use 3-vectors, two spots for x and y, and one for rotation. The first two components of that Jacobian are the normalized x and y of the normal of the ground, and the rotation component is what I'm really iffy on. I represent rotation completely as a single scalar, and the white paper assumes 3D for the cross products and getting a vector to rotate around. I thought that taking the arc-sine of the "cross product" of the two vectors would work (for r cross n, it would be r.x*n.y - n.x-r.y) for the normalized vectors.
Help?