Vehicle demo: 4x4, steering, trans, suspension. No python.

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Sphere
Posts: 4
Joined: Sun Apr 22, 2007 4:18 pm

Vehicle demo: 4x4, steering, trans, suspension. No python.

Post by Sphere »

Sorry if you notice that this is a dupe. I posted this in the showcase a while back, but no responses. This is a hinge constraint based vehicle with suspension.
Thought it might be helpful to those who are trying to build vehicles that can navigate rough terrain using powered wheels. This is a newer version with the grav set back to 9.8.
Setting the grav to normal and increasing all of the component masses results in a much better simulation.

Runs best for now with "Enable all frames". 60 FPS is a bit slow for this type of sim, and makes everything "floaty".

Keys:
NumPad 1,2,3 for Gears (vehicle is in neutral when game starts.)
NumPad + - for 2 wheel drive or 4 wheel drive (vehicle is in 2 wheel drive when game starts.)
Key "H" for high range, and key "L" for low range. (vehicle is in low range when game starts.)
Up arrow for forward.
Down arrow for reverse. Reverse isn't treated as a gear for now and is always available. Reverse is, however, affected by high and low range selection.
Left and right arrows for steering. Release the gas for a second when steering. I'm not sure if blender isn't parsing keys or if the rotational mass is messing with the steering.
Spacebar for brakes (0.01 wheel angV) Useful for easing down slopes etc.

-Texturing is a work in progress as is the steering damping and accuracy.

-Suspension is accomplished with 4 constraints per axle acting as springs. The suspension can be changed radically by moving the pivot points around. "Slamming" the vehicle to the ground and making a new body would probably make a fairly nice race car. I may post one of those too...

-Steering is coordinated with a tie rod between the steering knuckles. It's still a bit sloppy, but I think I may be on the right track now to fixing that.
Heavier masses and normal grav make the steering much more responsive with less tendency to move the vehicle around.
There is still a bounding box collision with the body because of the large tires. WIP...

-Power is handled individually by each wheel. With High and Low range, there is a total of 6 gears for now.
Eventually the redundant transmission logic bricks will be relocated to a "transmission" mesh with messaging controlling the wheels.


C&c, and suggestions welcome. Copying will be considered flattery. There is also a thread about it on the blenderartists site.
The .blend is here: http://wcpenney.googlepages.com/4x4Jamb ... blic.blend
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Sorry if you notice that this is a dupe. I posted this in the showcase a while back, but no responses
This forum is mostly about physics simulation, and Bullet. Not so many Blender users are visiting, so it is best to post .blend files on the Blender Game Engine forums at Blender Artists/Elysiun.

However, thanks for the cool demo!
Erwin