1
\$\begingroup\$

We have been facing a strange issue with physx vehicles. The game behaves correctly in almost every situation: jumps, impacts, etc.

Gravity is applied correctly downward.

But when the vehicle is put upside down in a track, in a loop or twist, somehow it's stuck to the track as if SpiderCar was playing.

Find a video of it here. And an image below:

enter image description here

We are using PxVehicleUpdate::updateDrive4W as coming in the framework version 3.2.2 So the call is just

void VehicleManager::updateVehicle(const PxF32 timestep, const PxVec3& gravity,PxVehicleDrivableSurfaceToTireFrictionPairs * mSurfaceTirePairs) { PxVehicleUpdates(timestep,gravity,*mSurfaceTirePairs,mNumVehicles,mVehicles); } 

Gravity is a vector (0.0,-9.8,0) being Y the vertical coordinates. Inside it calls updateDrive4W for all the vehicles, which is about 400 lines

\$\endgroup\$
7
  • \$\begingroup\$ I'm guessing if you were to flip the car upside-down it would float up into the air? It seems as though you're applying the gravity to the cars local down, instead of the world down. Nice improvements on the question. \$\endgroup\$ Commented Jun 5, 2013 at 14:55
  • \$\begingroup\$ Actually, when the car is in air or somehow it breaks connection to the track, it works fine. For example, if you collide with the borders or other car with enough force the "spell" breaks and it falls down. So gravity is applied globally. \$\endgroup\$ Commented Jun 5, 2013 at 15:15
  • \$\begingroup\$ You don't have any other forces being applied to the vehicle? Something to keep it on the road in the first place? Can you post a snippet of code showing how you've created the car and how you're updating it. Smallest amount of code possible. \$\endgroup\$ Commented Jun 5, 2013 at 15:19
  • \$\begingroup\$ No extra forces added, we tried to investigate if physx applies itself a force that, consistently with forces in real world, would apply a force towards the track incremented exponentially by the velocity. But we found nothing \$\endgroup\$ Commented Jun 5, 2013 at 15:38
  • \$\begingroup\$ Actually, I'm betting that PxVehicleDrivableSurfaceToTireFrictionPairs is adding forces to keep the car on the road. You may want to look into the documentation for that. \$\endgroup\$ Commented Jun 5, 2013 at 15:40

1 Answer 1

2
\$\begingroup\$

The answer is quite easy: it's a bug, confirmed by physx team. https://devtalk.nvidia.com/default/topic/546019/vehicle-not-falling-from-track/

\$\endgroup\$
1
  • \$\begingroup\$ Glad you're on the right track to getting this solved ;) \$\endgroup\$ Commented Jun 10, 2013 at 15:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.