I'm currently implementing a game that allows the player to design their own vehicles.
Currently I'm using my own simple physics engine, but I think I may have to invest time in integrating with a proper physics library such as Bullet physics. However before I do this I just want to check what exactly Bullet physics can simulate and what I'd have to do myself.
The documentation has answered many of my questions, but I still have the following questions that hopefully someone can answer:
1. Can Bullet easily simulate realistic vehicle dynamics, such as per wheel suspension, centre of gravity, body roll, pitch and dive, etc.
2. Can Bullet physics be used to work out the Drag Coefficient of a players vehicle design. This only has to be calculated once and not necessarily in realtime (i.e. upto a couple of seconds would be fine).
3. Can Bullet physics be used to calculate stress loadings on a design. For example, if a user made a crane and the arm of the crane was too long then eventually the arm would snap. Ideally I'd like to show a stress map showing the unstressed areas in green through to areas close to breaking stress in red.
4. Can Bullet physics simulate articulated vehicles?
Thanks in advance
Ben
Can Bullet simulate vehicle dynamics
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Can Bullet simulate vehicle dynamics
It depends what you mean by 'realistic', but it should be good enough for many arcade-style games.BenS1 wrote:I'm currently implementing a game that allows the player to design their own vehicles.
Currently I'm using my own simple physics engine, but I think I may have to invest time in integrating with a proper physics library such as Bullet physics. However before I do this I just want to check what exactly Bullet physics can simulate and what I'd have to do myself.
The documentation has answered many of my questions, but I still have the following questions that hopefully someone can answer:
1. Can Bullet easily simulate realistic vehicle dynamics, such as per wheel suspension, centre of gravity, body roll, pitch and dive, etc.
Note sure what you mean by drag coefficient, but you probably have to compute it yourself.2. Can Bullet physics be used to work out the Drag Coefficient of a players vehicle design. This only has to be calculated once and not necessarily in realtime (i.e. upto a couple of seconds would be fine).
Yes, you can use the applied impulses as a measure for stress.3. Can Bullet physics be used to calculate stress loadings on a design. For example, if a user made a crane and the arm of the crane was too long then eventually the arm would snap. Ideally I'd like to show a stress map showing the unstressed areas in green through to areas close to breaking stress in red.
Yes, you can use constraints to connect various vehicle parts into articulated vehicles.4. Can Bullet physics simulate articulated vehicles?
Thanks,
Erwin
-
- Posts: 2
- Joined: Mon Dec 13, 2010 1:21 pm
Re: Can Bullet simulate vehicle dynamics
Thanks for your reply Erwin
This link explains it quite well:
http://en.wikipedia.org/wiki/Drag_coefficient
And this link shows some good examples:
http://en.wikipedia.org/wiki/Automobile ... oefficient
(A truck typically has a drag coefficient of at least 0.6, whereas a Ferrari is around 0.36)
As you know, without drag (Or wind resistance if you prefer) a vehicle would be able to accelerate linearly and to an infinite top speed (Ignoring rev limits and power vs rev curves).
In my game I want to calculate how aerodynamic each player created vehicle is so that I can work out the acceleration and top speed characteristics.
I suspect that Bullet wont really help in calculating the drag coefficient, but I have some ideas on how to do it.
One very simple idea would be to calculate the normals at regular intervals over the surface of the vehicle. Then ignore any back facing normals (Technically these shouldn't be ignored as they indicate low pressure areas, which do cause resistance but for a simple modle we can ignore this).
Next Sum all the remaining normals together and then take just the forward facing component (i.e. we're not interested in lift or downforce for now). That should give a very rough idea of how aerodynamic a vehicle is, which we can use in our acceleration calculations.
Thanks
Ben
What I mean is that different vehicles will have different aerodynamics. For example, a truck will be have much more drag through the air than a Ferrari.Erwin Coumans wrote:Note sure what you mean by drag coefficient, but you probably have to compute it yourself.2. Can Bullet physics be used to work out the Drag Coefficient of a players vehicle design. This only has to be calculated once and not necessarily in realtime (i.e. upto a couple of seconds would be fine).
This link explains it quite well:
http://en.wikipedia.org/wiki/Drag_coefficient
And this link shows some good examples:
http://en.wikipedia.org/wiki/Automobile ... oefficient
(A truck typically has a drag coefficient of at least 0.6, whereas a Ferrari is around 0.36)
As you know, without drag (Or wind resistance if you prefer) a vehicle would be able to accelerate linearly and to an infinite top speed (Ignoring rev limits and power vs rev curves).
In my game I want to calculate how aerodynamic each player created vehicle is so that I can work out the acceleration and top speed characteristics.
I suspect that Bullet wont really help in calculating the drag coefficient, but I have some ideas on how to do it.
One very simple idea would be to calculate the normals at regular intervals over the surface of the vehicle. Then ignore any back facing normals (Technically these shouldn't be ignored as they indicate low pressure areas, which do cause resistance but for a simple modle we can ignore this).
Next Sum all the remaining normals together and then take just the forward facing component (i.e. we're not interested in lift or downforce for now). That should give a very rough idea of how aerodynamic a vehicle is, which we can use in our acceleration calculations.
Thanks
Ben
-
- Posts: 7
- Joined: Fri Jul 18, 2008 4:32 pm
Re: Can Bullet simulate vehicle dynamics
You can apply drag force outside of Bullet. Get vehicle's linear velocity, damp it progressively, set it back to vehicle.
-
- Posts: 1
- Joined: Sat Jan 01, 2011 3:45 am
Re: Can Bullet simulate vehicle dynamics
I didn't get a thing because I'm not from physic stream??? and the irony is I'm interested in this thread for the exhaust system lol, Looks like I'll have to go to Wikipedia first 

Last edited by entitledg on Mon Jan 10, 2011 4:53 pm, edited 1 time in total.
-
- Posts: 35
- Joined: Mon Dec 27, 2010 10:46 pm
Re: Can Bullet simulate vehicle dynamics
AFAIK, calculating the drag of a vehicle isn't something that can be done properly 60 times per second. Hopefully for you, there's are shortcut.
As far as I understand, all you want to be able to do is to know the reverse force you need to apply to the car depending on it's drag shape. Obviously, this drag shape might depend in which direction the car is going (straigh, reverse, slight sliding on the side at 230 kph on an icy road, that's what I'm talking about mate).
If so, than I suggest you one considerably easy solution. Try to find an apps out of there and calculate the aerodynamics of the cars in 2 directions : front & side (I'm pretty sure there's a few free aerodynamic apps on the web for having seen some). From these computations you'll surely be able to determinate one single "aerodynamic" value for the front and one for the side of each car. With these values you can just find a realtime aerodynamic value depending on the rotation of the car relative to the orientation of it's velocity simply by interloping between the front and side aerodynamic values.
...than once you have that value you just set a corresponding backward force depending on the amplitude of the velocity of the car.
To get you started, here is 2 free apps for that :
http://www.easyfreeware.com/airfoilanal ... eware.html
http://www.vizimag.com/viziflow.htm
...there's also a commercial apps I found, you can alway enjoy the 30 days free trial :
http://www.symscape.com/product/caedium
As far as I understand, all you want to be able to do is to know the reverse force you need to apply to the car depending on it's drag shape. Obviously, this drag shape might depend in which direction the car is going (straigh, reverse, slight sliding on the side at 230 kph on an icy road, that's what I'm talking about mate).
If so, than I suggest you one considerably easy solution. Try to find an apps out of there and calculate the aerodynamics of the cars in 2 directions : front & side (I'm pretty sure there's a few free aerodynamic apps on the web for having seen some). From these computations you'll surely be able to determinate one single "aerodynamic" value for the front and one for the side of each car. With these values you can just find a realtime aerodynamic value depending on the rotation of the car relative to the orientation of it's velocity simply by interloping between the front and side aerodynamic values.
...than once you have that value you just set a corresponding backward force depending on the amplitude of the velocity of the car.
To get you started, here is 2 free apps for that :
http://www.easyfreeware.com/airfoilanal ... eware.html
http://www.vizimag.com/viziflow.htm
...there's also a commercial apps I found, you can alway enjoy the 30 days free trial :
http://www.symscape.com/product/caedium