Best way to constrain rotation of one wheel to another?

zbethel
Posts: 6
Joined: Sun Jul 01, 2012 5:15 am

Best way to constrain rotation of one wheel to another?

Post by zbethel »

I'm trying to simulate tank treads, and I'd like just simulate the wheels and then just render the treads. The problem is, I can't figure out how to lock the rotation between all of the tank wheels. I've tried using a hinge constraint, but all that does is free up a rotation axis between two bodies, from what I can tell it doesn't constrain the wheel rotation between the two bodies (as if they have treads on them). I hope I'm making sense. What is the preferred way to deal with this problem?

Thanks!
zbethel
Posts: 6
Joined: Sun Jul 01, 2012 5:15 am

Re: Best way to constrain rotation of one wheel to another?

Post by zbethel »

After looking around, I guess what I'm looking for is a gear joint. Does Bullet have anything like that?
zbethel
Posts: 6
Joined: Sun Jul 01, 2012 5:15 am

Re: Best way to constrain rotation of one wheel to another?

Post by zbethel »

After looking around, I found the code for a distance constraint. I tried applying two distance constraints on each pair of wheels (posed at 90 degrees from each other to avoid the wheels from locking up). It feels like a hack though... Does anyone here have experience with anything like a gear constraint, where rotation is constrained between two bodies as if they're on a track?

Thanks