Advanced Vehicle Simulation

frik
Posts: 2
Joined: Tue Dec 30, 2008 8:35 pm

Advanced Vehicle Simulation

Post by frik »

Hi,

I tried out the bullet VehicleDemo and the similar ForkLiftDemo examples. The driving experience of both demos are very acrade alike.
As it seems from a quick look in the code both use the raycast method for the vehicle physics.

There are two methodes to simulate a vehicle as Erwin Coumans explained in 2006 (http://www.bulletphysics.com/Bullet/php ... 2284#p2284):
  • raycast wheeled vehicles
  • constraint hinge wheeled vehicles
He mentioned that he would implement the second variant in a Fork Lift demo. Although, constraints are only used for the lift-part, as it seems, and the rest of the code is based on the vehicle demo (raycast method).

In the source code of both demos, I found following comments:

Code: Select all

///September 2006: VehicleDemo is work in progress, this file is mostly just a placeholder
///This VehicleDemo file is very early in development, please check it later
///@todo is a basic engine model:
///A function that maps user input (throttle) into torque/force applied on the wheels
///with gears etc.
Now my questions:
  • Is it possible with the current Vehicle support to achieve a more real-life (non arcarde; e.g. off-road) vehicle simulation (incl. suspension, tire, etc.) ?
  • How would one add a visible suspension to the vehicle (like in the screenshots below) ?
  • What are the plans for the (near) future, related to the bullet vehicle support?
  • Are there are plans to update/improve the vehicle demo(s)?
Screenshot of a visible suspension (physics engine competitors vehicle demo):
Image

Screenshots from a decent game with a good (vehicle) physics engine (especially the visible suspensions are interesting):
Image

Image

Image

Image


Sadly, I found only bullet based vehicle implementations for Blender, no OpenGL or DirectX sample apps from third party developers. Unlike other physics engines, were there are dozens of such examples.
Although, I would like to use Bullet as it supports soft bodies, CUDA, etc., is more active and has a huge community.

Maybe someone who has used bullet for vehicle simulation can post some sample code or give me some pointers/hints were to look.


Best regards,
Klemens


Ressources:
http://www.carbibles.com/suspension_bible.html
http://en.wikipedia.org/wiki/Suspension_(vehicle)
http://www.bulletphysics.com/Bullet/php ... 2284#p2284
http://www.tutorialsforblender3d.com/Ga ... elRun.html
mandor
Posts: 6
Joined: Sat Jan 17, 2009 6:46 pm

Re: Advanced Vehicle Simulation

Post by mandor »

Hi,

I second this request as I'd like to have a better idea about how to get a complex vehicle simulation....

--
Mandor
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Advanced Vehicle Simulation

Post by sparkprime »

You can use convex cast instead of ray cast to make the wheels behave more naturally. Aside from that the rest is just graphics as far as I can see. You know where the wheel is, so draw everything else to meet it.
frik
Posts: 2
Joined: Tue Dec 30, 2008 8:35 pm

Re: Advanced Vehicle Simulation

Post by frik »

I found some answers related to advanced vehicle simulation in an one year old thread:
"advanced "raycast" vehicle wheel model using a cylinder"

It seems like using a convex torus as wheel and convex cast is a better method than the default sphere wheel and ray cast, to simulate an vehicle.
If an AAA title (like the one from the screenshots above) uses something similar, it should be good enough.

It would be interesting to know, how to implement a more realistic suspension.
I came up with the idea of using four bullet-vehicle (with one wheel per vehicle, like this) and clue them with some constraints like springs to the car-body frame, to get a better suspension.

Has someone tried something like that? If so, what's your experience with it? Any better ideas or some insider tips?


Resources:
http://www.bulletphysics.com/Bullet/php ... php?t=1817
http://www.bulletphysics.com/Bullet/php ... php?t=3088