Problem with vibrating bodies (alt. Character riding a bike)
Posted: Fri Aug 22, 2014 10:26 pm
Hi, I've been trying out Bullet for some time now trying to make an BMX game but struggle with an annoying problem; The rider's limbs are vibrating.
You can try it out and see what I mean here (WebGL): http://j0nas.se/bmx
Basically, I have a character based off the ragdoll example and a bike made up of five ridgid bodies (frame, wheels and handlebar).
The rider's forearms/hands are constrained to the handlebar and the shins/feets to the frame/pedals via btPoint2PointConstraint's. Then I use a btGeneric6DofConstraint to force the rider's body above the bike (with some amount of freedom to move and rotate).
For the riders joints I use the constraint's motors to set target rotations for each joint (e.g. shoulder, elbow, knee, etc) to make the rider keep his riding position.
I feel that the vibrations might be caused by constrains fighting with each other, but I'm not sure how I could avoid that?
I'm not sure if I'm simply using too many constraints here, if my approach of using constraints to "strap" the rider onto the bike is particularly good, maybe there's a better way?
If anyone has some tips or general advice I'd be grateful
Cheers,
Jonas
You can try it out and see what I mean here (WebGL): http://j0nas.se/bmx
Basically, I have a character based off the ragdoll example and a bike made up of five ridgid bodies (frame, wheels and handlebar).
The rider's forearms/hands are constrained to the handlebar and the shins/feets to the frame/pedals via btPoint2PointConstraint's. Then I use a btGeneric6DofConstraint to force the rider's body above the bike (with some amount of freedom to move and rotate).
For the riders joints I use the constraint's motors to set target rotations for each joint (e.g. shoulder, elbow, knee, etc) to make the rider keep his riding position.
I feel that the vibrations might be caused by constrains fighting with each other, but I'm not sure how I could avoid that?
I'm not sure if I'm simply using too many constraints here, if my approach of using constraints to "strap" the rider onto the bike is particularly good, maybe there's a better way?
If anyone has some tips or general advice I'd be grateful
Cheers,
Jonas