Vehicle handbreak

Dirso

25-06-2007 18:31:19

Hi,

When I stop adding torque to my wheels car stops then it start moving again due to terrain elevation - and it is right. But how do I fully stop the car like a handbreak effect?

Thanks,
Dirso.

walaber

25-06-2007 18:40:47


Ogre::Real MaxBrake = tire->calculateMaxBrakeAcceleration();

tire->setBrakeAcceleration( MaxBrake, MaxBrake );


this is an emergency brake, that will stop the tires instantly.
for normal brakes, you would have a fixed value (the max strength of the brakes) that you pass as the second parameter to setBrakeAcceleration().

Dirso

25-06-2007 21:15:45

Should I call this function every frame I want the car not to move?

walaber

25-06-2007 22:14:25

yes.

Dirso

25-06-2007 22:28:47

Thank you very much!!! Will the car slide if it be in too high speed, like a normal car would?

Dirso

25-06-2007 23:37:27


Ogre::Real MaxBrake = tire->calculateMaxBrakeAcceleration();

tire->setBrakeAcceleration( MaxBrake, MaxBrake );


this is an emergency brake, that will stop the tires instantly.
for normal brakes, you would have a fixed value (the max strength of the brakes) that you pass as the second parameter to setBrakeAcceleration().

It didn't work :( The car still moves if I don't use any torque and the terrain is not totally plane.

Dirso

25-06-2007 23:39:52

The car doesn't slide either. Is there any kind of contact I should define to make the car slide?

walaber

26-06-2007 00:07:46

please look at the Stunt Playground source code...

http://walaber.com/stunt_source/StuntPlayground_2_0_source.rar

Dirso

26-06-2007 02:26:58

please look at the Stunt Playground source code...

http://walaber.com/stunt_source/StuntPlayground_2_0_source.rar


OK, Thank you very much!!
Dirso

Dirso

29-06-2007 17:37:18

It's much better now. I still had a small, really small acceleration. Is there a way to freeze the car?