The vehicles move in neutral when accelerating

I have initiated a car in neutral and when I accelerate it begins to move.

Could you please provide some more details to help diagnose the problem? Any information you can provide will be most helpful.

Useful information might be:

1 which version of physx are you using?
2. what type of car do you have (PxVehicleDrive4W etc)?
3. does this affect just one type of car or all car types?
4. is the car on a flat plane?
5. does the car move even when not accelerating?
6. does the amount of acceleration affect the amount of motion you see?
7. do you have a fixed timestep or a variable timestep?
8. if you have variable timestpes are they almost constant or extremely variable?
8. do you have very large timesteps?

A few things to check:

  1. were any error messages issued?
  2. does the sum of the sprung masses match the rigid body mass?
  3. does the problem reduce as the timestep decreases (you can do this by passing in a smaller timestep or by using substepping with PxVehicleWheelsSimData::setSubStepCount)

Thanks,

Gordon

1 which version of physx are you using?
I’m using PhysX 3.3.1 but it happens also using PhysX 3.2.5 (I haven’t tested it in other versions)

  1. what type of car do you have (PxVehicleDrive4W etc)?
    I’m using a PxVehicleDrive4W

  2. does this affect just one type of car or all car types?
    I only have implemented this kind of vehicle.

  3. is the car on a flat plane?
    Yes is in a flat plane (without inclination).

  4. does the car move even when not accelerating?
    No, it doesn’t in 3.3.1 but in 3.2.5 it moves

  5. does the amount of acceleration affect the amount of motion you see?
    It seems that no. You have the same motion with a 0.1 acceleration that whith 1.0

  6. do you have a fixed timestep or a variable timestep?
    I have a variable timeste.

  7. if you have variable timestpes are they almost constant or extremely variable?
    No, they are more of less iquals.

  8. do you have very large timesteps?
    My time step is about 1/120

And

  1. were any error messages issued?
    There aren’t errors showed.

  2. does the sum of the sprung masses match the rigid body mass?
    It’s correct.

  3. does the problem reduce as the timestep decreases (you can do this by passing in a smaller timestep or by using substepping with PxVehicleWheelsSimData::setSubStepCount)
    It has the same result with 1/60, 1/120 and 1/240

Tanks,

EDIT:
I have experimented other behavior with this: If later of this movement with neutral, you put a gear, the, vehicle moves with the last acceleration.

There is a bug that occurs with multiple cars, which we’ve fixed ready for 3.3.2 Do you have multiple cars in your scene?

No, I only have one car in my scene.

Could you try implementing a small fix?

In PxVehicleUpdate.cpp in the function PxVehicleUpdate::updateDrive4W please replace

isIntentionToAccelerate = (accel>0.0f && 0.0f==brake && 0.0f==handbrake);

with

isIntentionToAccelerate = (accel>0.0f && 0.0f==brake && 0.0f==handbrake && PxVehicleGearsData::eNEUTRAL != currentGear);

Thanks,

Gordon

Thank you very much!

You have solved my problem. I replaced this line with:

isIntentionToAccelerate = (accel>0.0f && PxVehicleGearsData::eNEUTRAL!=currentGear);

I have remove de breake’s restictions. In a real car you can accelerate with the handbreak. But it has not effect…

Thanks again.

Glad that fixed your problem.

The fix should hopefully ship with 3.3.3 and 3.4.0.