Car simulation slide when he have contact with the floor

urosidoki

26-02-2011 20:04:00

Hi!

I dont know if this is the correct forum to post this, because I am not using NxOgre, I am using PhysX, but I open NxOgre library to see how works the car simulation.

So, I replicated in my code the wheels behaviours and all looks work well, when the car is on the air without gravity, the wheels turn correctly and looks like he is accelerating.

The problem is when I apply gravity the wheels turn out of the limit I set, and sometimes turn completly 360degrees, is really weird. And other issue is when the car touch the floor, he can not accelerate anymore, I mean the wheels doesnt roll, only make the pitch and not so good, so the car start to slide like over ice.
Only when the car is on the air again, the wheels start to roll correctly again.

Any ideas about what can I do?

Kind Regards

proof

27-02-2011 01:38:34

The fact that the car does not move on the ground suggest that there isn't enough friction between the tires and the ground. You should try playing with the tire values:

mLateralTireFunction.mAsymptoteSlip = 0.04f;
mLateralTireFunction.mAsymptoteValue = 0.6f;
mLateralTireFunction.mExtremumSlip = 0.01f;
mLateralTireFunction.mExtremumValue = 1f;
mLateralTireFunction.mStiffnessFactor = 5000f;

mLongitudalTireFunction.mAsymptoteSlip = 0.04f;
mLongitudalTireFunction.mAsymptoteValue = 0.6f;
mLongitudalTireFunction.mExtremumSlip = 0.01f;
mLongitudalTireFunction.mExtremumValue = 1f;
mLongitudalTireFunction.mStiffnessFactor = 6000f;


The default values work too but the turns are kind annoying. This setup feels better.

The problem is when I apply gravity the wheels turn out of the limit I set, and sometimes turn completly 360degrees, is really weird

No idea what you meant with this.

urosidoki

27-02-2011 02:25:17

Hi!

Thanks for your response. But I still have the problem including with that configuration :( is really weird and I dont understand why is happening.

Redarding to the wheels turn 360 degrees, I mean that the limitation of the turning in the front wheels work fine if there is no gravity, but with gravity, or with the car sliding, the wheels doesnt turn correctly sometimes, is like the wheels slide laterally and turn completly, is crazy effect!

I am using PhysX 2.7.1. Any ideas?

Kind Regards

proof

27-02-2011 02:48:38

I read on nvidia's forums that some people had troubles with different physx versions because of a lot of changes. I'm using 2.8.3 (well, not anymore because I switched to bullet).

Have you checked your code versus the sample that's in the physx SDK?

You should see this post and look at the code to see what you were doing wrong. It's basically a rip-off of nvidia's vehicle code, although I guess it wouldn't help you much because its for NxOgre and not pure physx.

urosidoki

27-02-2011 12:49:20

Hi again.

Thanks for all, I discover the mistake finally and now works fine, I only need to tweak some materials parameters:)
The mistake was my code.

Kind Regards and thanks!