Problems mimicing real vehicle behavior

Bilal
Posts: 8
Joined: Tue Nov 13, 2007 2:30 pm

Problems mimicing real vehicle behavior

Post by Bilal »

I am working on a vehicle simulator. Bullet seemed to be an excellent option as it includes a vehicle demo and special class for it.
But I have seen that it does not work as a real car, as it is applyEngineForce() which is responsible for movement of the vehicle and not the torque of wheels. As a result, the wheels can never slip, instead they just follow the motion of the car.
So I decided to build my own vehicle using dynamic bodies and constraints. But I am facing problems. In Bullet's documentation, I read that applyTorque() cannot be used on dynamic bodies which implies that I cannot use wheels' torque to move the car.
That seems to be a dead end :( . If there is any other way of mimicing real car behavior, please tell.
Thanx in advance.
Bilal
Posts: 8
Joined: Tue Nov 13, 2007 2:30 pm

Re: Problems mimicing real vehicle behavior

Post by Bilal »

Well.....
I think I have sorted that problem out. I applied 2 impulses simultaneously, to cancel out each other's linear force and leave behind impulse torque only.

But now I am facing a new problem. I want to connect wheels to the axle. The joint should allow the turning of wheels (for steering) along with rotation. But I want to keep the degree of freedom of steering in user control. So the constraint should be there but it should be variable. I am confused what type of joint shoud I make?

Please reply.....I need help.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Problems mimicing real vehicle behavior

Post by Erwin Coumans »

For most game usage, the btRaycastVehicle is the recommended way, instead of using rigid bodies and constraints for the wheels. It is more difficult to model wheels with rigid bodies, real wheels are not rigid bodies and the friction model is very complicated. The btRaycastVehicle has custom friction model, but as you already noticed, it has some limitations.
In Bullet's documentation, I read that applyTorque() cannot be used on dynamic bodies which implies that I cannot use wheels' torque to move the car.
Really? Can you point out which document/page includes that comment? applyTorque should be fine for dynamic objects.
So the constraint should be there but it should be variable.
The current constraints use fixed constraint axis, we need to look into making this configurable.

Thanks for the feedback,
Erwin
Bilal
Posts: 8
Joined: Tue Nov 13, 2007 2:30 pm

Re: Problems mimicing real vehicle behavior

Post by Bilal »

Well..... I am using the ray cast vehicle right now....

But the project that I am doing will most probably go on for the next few years and we may try to build our own vehicle.......Is that possible using simple joints and rigid bodies using bullet....or will we have to do something extra?? if yes, what will be the best way of making this vehicle realistic?