Revolute joint between two particles

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
c0der
Posts: 74
Joined: Sun Jul 08, 2012 11:32 am

Revolute joint between two particles

Post by c0der »

Hi,

I am having trouble with implementing a revolute joint between two particles. I am representing the particle as having a position, velocity and acceleration and no angular dynamic components.

So the constraint derivation is as follows:

C = xa + ra - xb - rb
CDot = va - vb

CDot = [ 1 -1] [va vb]T

So the Jacobian is [1 -1]

I initially store the anchor in local coords of each particle

localA = worldAnchor - particleA.position
localB = worldAnchor - particleB.position

Since the particles do not rotate, they have an identity matrix at all times with translation components on their last row

[ 1 0 0 0 ]
[ 0 1 0 0 ]
[ 0 0 1 0 ]
[ tx ty tz 1 ]

So transferring the anchor points to world coords, I do the following:

worldAnchor1 = localA + m_pParticleA->position
worldAnchor2 = localB + m_pParticleB->position

Then the radii between the anchors and the bodies becomes:

ra = worldAnchor1 - m_pParticleA->position
rb = worldAnchor2 - m_pParticleB->position

This undoes the previous addition and returns world anchors to local anchors. How do I go about doing this properly?
Post Reply