Vehicle wheel friction

inzombiak
Posts: 16
Joined: Wed Nov 25, 2015 3:34 pm

Vehicle wheel friction

Post by inzombiak »

Hi, I'm fairly new to Bullet SDK and I'm testing the Raycast Vehicle. Right now I'm trying to stop a vehicle from rolling down a hill. I've set the friction and rolling fiction of my Box Shape (my slope) to 1 and done the same for my wheels, but the vehicle still roles down the slope. I used this approach by mimicking the code form the Rolling Friction Demo. Am I doing something wrong? Do I need to calculate the force myself and apply it as brakes?
gdlk
Posts: 62
Joined: Fri Oct 24, 2014 7:01 pm

Re: Vehicle wheel friction

Post by gdlk »

Hi!

Yes, you must calculate the force yourself and applied it. Setting the rolling friction on the chassis will don't work because it never touch the floor. In the other hand, the wheels actually are not physics, so it haven't that param (maybe you are confuse with roll influence param)

Regards!
inzombiak
Posts: 16
Joined: Wed Nov 25, 2015 3:34 pm

Re: Vehicle wheel friction

Post by inzombiak »

Thanks for your reply

How can I get the Rigid body a specific wheel is touching? Also what is the friction slip parameter used for? Is this the value I used along with the ground friction to calculate the brake force?

EDIT:

I read the Vehicle Sim Document, and I can see how to do what I just asked. I just have to get the m_groundObject from the wheel info.

I do have a few other questions. I'm doing a naive cast of the groundObject(which is void*) to a btRigidBody*. Is it possible for it to be something else? Is there anything I should be careful of?

I do get the jittering mentioned in the document, but I don't fully understand what the constraint model is. I assume its just a method of calculating max and min friction force.
gdlk
Posts: 62
Joined: Fri Oct 24, 2014 7:01 pm

Re: Vehicle wheel friction

Post by gdlk »

The groundObject is a btCollisionObject type ( this is true while you raycast result inherit from RayResultCallback, for example the ClosestRayResultCallback), and that type can be safety upcast to a btRigidBody (the same btRigidBody class have a method to upcast =P )

Respect the friction model, I don't full understand the doc code (mainly because I still don't learn how implement my custom constraint yet =( (any tip/advice about it is welcome =D )), but the idea is let the solver solve it (when is calculated manually you got a individual solution for every wheel, when feed the solver with the constraints you got a global solution for all the wheels )