Constraints for wheels
Posted: Sat Jul 21, 2012 10:12 pm
I'm pretty new to bullet and I'm trying to set up a little demo with a racing car. It's proving a lot more difficult than I expected. Using bullet-2.80-rev2531
I tried the hinge constraint first, since I figured it'd be the most straight forward to get working. I'm using two cylinders and a box at the moment to represent some kind of vehicle. It'll be four wheels eventually, but I can't even get two working.. If I add one wheel, the constraint works and falls into the right place. When I add the second wheel to the body however, it gets all wonky and the placement gets all wrong. And apart from that, the box's weight doesn't seem to affect the wheels at all, making for quite impressive acts of balance.
Trying the hinge constraint for some hours I finally gave up and went on to try out the Generic6DofConstraint. Surely again, the first constraint added works fine, but the second makes the system freak out. This time it even started moving making weird rotations so that it "walked" away.. and I'm pretty sure I didn't tell it to do that.
I tried adding only the second wheel and it behaves as it should on its own.. except for the balancing.
Is it just me that can't get this working or is the constraints just wonky? If what I've said here makes no sense I'd greatly appreciate if someone could whip up an example of some constraints that works for a car model.
On another matter, I've tried using applyTorque on a few bodies too, with no affect. I've disabled deactivation on the bodies (spheres) in question, but still wont budge by applying torque. Setting the angular velocity works as expected though and applying force from the center works too.
I tried the hinge constraint first, since I figured it'd be the most straight forward to get working. I'm using two cylinders and a box at the moment to represent some kind of vehicle. It'll be four wheels eventually, but I can't even get two working.. If I add one wheel, the constraint works and falls into the right place. When I add the second wheel to the body however, it gets all wonky and the placement gets all wrong. And apart from that, the box's weight doesn't seem to affect the wheels at all, making for quite impressive acts of balance.
Trying the hinge constraint for some hours I finally gave up and went on to try out the Generic6DofConstraint. Surely again, the first constraint added works fine, but the second makes the system freak out. This time it even started moving making weird rotations so that it "walked" away.. and I'm pretty sure I didn't tell it to do that.
I tried adding only the second wheel and it behaves as it should on its own.. except for the balancing.
Is it just me that can't get this working or is the constraints just wonky? If what I've said here makes no sense I'd greatly appreciate if someone could whip up an example of some constraints that works for a car model.
On another matter, I've tried using applyTorque on a few bodies too, with no affect. I've disabled deactivation on the bodies (spheres) in question, but still wont budge by applying torque. Setting the angular velocity works as expected though and applying force from the center works too.