August 28, 2007

Rigid body dynamics simulation

I'm using a rigid body dynamics simulation to get the pawl to react properly when the ratchet rotates clockwise.

Here's what I did:
  • I turned the ratchet into a passive rigid body, meaning it collides with active rigid bodies, but it is unaffected by external forces.
  • I turned the pawl into an active rigid body, so that it reacts to forces (such as gravity) and collisions (the ratchet bumping into it). This would normally send it flying off into space, like a baseball being hit by a bat, so on to the next step.
  • I added a hinge constraint to the pawl rigid body. I moved this constraint to the center of the pawl's rod end. This prevents the pawl from moving, and forces it to rotate about a single axis. I also created a gravity field to pull the pawl back down once it's bounced up a bit.


Silvia said...
This comment has been removed by the author.
Silvia said...

I had a typo--let's try again! Be forewarned--I've entered this post into a couple blog carnivals. You may see a bunch of visitors around Sept 4th or so. :)

Jim said...

The pawl bounce looks really cool, pawls in real life do that, or do they have enough spring tension to seat solidly the first time?

JohnPark said...

You're absolutely right, Jim. It's all default settings, which are very bouncy. I'll need to tune those.