Hi all,
I 'm testing bullet for a project and I like what I see so far .
I got a couple of questions regarding vehicles though.
1) Any estimate on when braking will be implemented?
2) I have built a test app for testing vehicles. I started out by duplicating code from the vehicle demo. Now, everything goes well except one thing: my vehicle rolls over pretty easily if I slightly turn the wheels (not at max speed).
In other physics engines, I usually adjusted this by lowering the center of mass to be even below the vehicle (in some cases).
Is there a solution to this problem?
I should note that I 'm not after an ultra-realistic vehicle here. A simple, more "arcade" vehicle will suffice for my needs.
Regards.
[SOLVED]: Two questions about vehicle
-
- Posts: 3
- Joined: Fri Apr 20, 2007 12:52 pm
[SOLVED]: Two questions about vehicle
Last edited by yiannis on Thu Apr 26, 2007 6:29 pm, edited 1 time in total.
-
- Posts: 231
- Joined: Tue Feb 20, 2007 4:56 pm
Re: Two questions about vehicle
That's usually the first attempted solution. Or you could put your physical wheels further out than the graphical wheels, an effective increase in track width. Or you could reduce grip (but I'm guessing you have the grip level where it is for a reason).yiannis wrote:2) I have built a test app for testing vehicles. I started out by duplicating code from the vehicle demo. Now, everything goes well except one thing: my vehicle rolls over pretty easily if I slightly turn the wheels (not at max speed).
In other physics engines, I usually adjusted this by lowering the center of mass to be even below the vehicle (in some cases).
Is there a solution to this problem?
In real cars, gyroscopic precession of the wheels also causes a slight increase in the roll of the vehicle, so reducing the rotational inertia of the wheels can help. But I think the gyro effect is off by default in Bullet (I know it was in ODE), so that probably won't do you any good.
The fact is, good grip, insufficient track width, and high heavy centers of mass is why SUVs are always rolling when they get in an accident, even though everybody thinks they bought one because they're "safe".
-
- Posts: 4
- Joined: Sun Apr 22, 2007 4:18 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Basic braking is now implemented, and will be available in Bullet 2.50.
You can get the subversion version, or download this early build here:
http://www.bulletphysics.com/bullet-2.50a.zip
With respect to turning over, you can lower the center of gravity by using a btCompoundShape and adding the chassis as childshape with a transform. Some sample code should be added to the vehicle demo to make this easier.
Another way of reducing this unwanted effect is setting the 'rollInfluence' for each wheel. Tune the rollInfluenceValue between 0 and 1, try 0.1 for example:
Hope this helps,
Erwin
You can get the subversion version, or download this early build here:
http://www.bulletphysics.com/bullet-2.50a.zip
With respect to turning over, you can lower the center of gravity by using a btCompoundShape and adding the chassis as childshape with a transform. Some sample code should be added to the vehicle demo to make this easier.
Another way of reducing this unwanted effect is setting the 'rollInfluence' for each wheel. Tune the rollInfluenceValue between 0 and 1, try 0.1 for example:
Code: Select all
float rollInfluence=0.1f;
for (int wheelIndex=0;wheelIndex<vehicle->getNumWheels();wheelIndex++)
{
btWheelInfo& info = m_vehicle->getWheelInfo(wheelIndex);
info.m_rollInfluence = rollInfluence;
}
Hope this helps,
Erwin
-
- Posts: 3
- Joined: Fri Apr 20, 2007 12:52 pm
Thank you for thisErwin Coumans wrote:Basic braking is now implemented, and will be available in Bullet 2.50.
Is this what you 're already doing in the vehicle demo?Erwin Coumans wrote:With respect to turning over, you can lower the center of gravity by using a btCompoundShape and adding the chassis as childshape with a transform. Some sample code should be added to the vehicle demo to make this easier.
Code: Select all
btCollisionShape* chassisShape = new btBoxShape(btVector3(1.f,0.5f,2.f));
btCompoundShape* compound = new btCompoundShape();
btTransform localTrans;
localTrans.setIdentity();
//localTrans effectively shifts the center of mass with respect to the chassis
localTrans.setOrigin(btVector3(0,1,0));
Should I be changing any settings of the wheels/suspension too?
Thanks for bearing with me.
-
- Posts: 3
- Joined: Fri Apr 20, 2007 12:52 pm