Wheel Constraint Soft Springy Suspension

Wheel Constraint Soft Springy Suspension

robbob's picture

Hi, I'm having a bit of an issue working with the wheel constraint. I'm developing a trials bike type game where the bike is locked onto a 2D plane and allows rotation only around the normal of the plane, which is fine, I have that working no problem. My issues comes with the springiness of the suspension. I have created 3 rigid bodies, 2 cylinders for each wheel and a chassis box. Each cylinder is constrained to the chassis by a wheel constraint, this works fine, I can drive the vehicle by rotating the rear wheel and all is very stable. The problem is the suspension seems to compress to the min limit as soon as its on the ground, I have tried messing with the spring strength, damping and masses to find an ideal balance but have been unable to achieve this, it is always compressed. Driving into a slope results in a very harsh judder. What I want to achieve is where the spring maintains a balance of being half way between the min and max limits on flat ground and hitting the slope would result in a compression, and when the vehicle is airborn full expansion (or atleast some degree of visible expansion over the rest position). Effectively requiring a very bouncy spring supension which is a primary feature of trials bikes, can this even be achieved by the wheel constraint (with more fiddling of properties, masses and possibly scaling?) or would I need to explore further with the constraint construction kit? If it is the latter option how would I go about this, as examples and documentation for the kit are pretty sparse. I have limited motion to the xy plane with only rotation around the z-axis (in world space). Any help would be greatly appreciated.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
robbob's picture

Nevermind, after a bit of messing around I found that the vehicle api already provides everything I require, and have been able to implement something much closer to my desired result.

havokTyler's picture

Good to hear. This is exactly what I would recommend. The wheel constraint is really only applicable for basic use cases. The vehicle api is going to give you a lot more flexibility and options (for the record the vehicle kit does not use wheel constraints).

-Tyler

Login to leave a comment.