Some Debug Problems of VehicleSample Project?

Every Case test In VehicleSample Project of PhysXSDK.
There are several important problems I need to make them clear!!!
I will post a problem each day after I debug in VehicleSample

case 1: I test the suspension spring to see if the chassis is stable without 4 wheels
I just create the chassis shape and suspLimitConstraint ,without 4 wheels shape
I comment some source code in PhysXVehicle and recompile

MaxDroop = 0.1 ,MaxCompression = 0.3
timestep = 0.001667 (60FPS)
numSubsteps = 3

Frame
LinearVelcity: 0.00000000 -13.73398781 0.00000000
jounces[4]: -0.10000000 -0.10000000 -0.10000000 -0.10000000 - k = 0
jounces[4]: -0.10000000 -0.10000000 -0.10000000 -0.10000000 - k = 1
jounces[4]: -0.10000000 -0.10000000 -0.10000000 -0.10000000 - k = 2
Frame
LinearVelcity: 0.00000000 -13.89748764 0.00000000
jounces[4]: -0.08089995 -0.08089519 -0.08438277 -0.08437800 - k = 0
jounces[4]: -0.00488627 -0.00488150 -0.00843489 -0.00843108 - k = 1
jounces[4]: 0.06651866 0.06652248 0.06112754 0.06113136     - k = 2
Frame
LinearVelcity: 0.00000000 -11.94479752 0.00000000
jounces[4]: 0.12246037 0.12246323 0.10870254 0.10870636 - k = 0
jounces[4]: 0.18645555 0.18645746 0.16856432 0.16856813 - k = 1
jounces[4]: 0.24604809 0.24605000 0.22271764 0.22272050 - k = 2
Frame
LinearVelcity: 0.00000000 -9.62462711 0.00000000
jounces[4]: 0.29106534 0.29106915 0.25759310 0.25759691 - k = 0
jounces[4]: 0.30000001 0.30000001 0.30000001 0.30000001 - k = 1
jounces[4]: 0.30000001 0.30000001 0.30000001 0.30000001 - k = 2
Frame
LinearVelcity: -0.02012550 0.83895111 -0.03388877
jounces[4]: 0.27573764 0.27581012 0.24538928 0.24546081 - k = 1

Obviously ,in Line19
when k = 1,the susp spring reach MaxCompression and should active the SuspLimitConstraint
But the SuspLimitConstraint Shader Data is updated only when k = 0

if(0 == k)
{
    wheels4DynData.mVehicleConstraints->mData=outputData.vehConstraintData;
}

So the SuspLimitConstraint is not active
I have trace the vehicleSuspLimitConstraintSolverPrep

//Susp limit constraints.
for (PxU32 i = 0;i<4;i++)
{
	if (data->mSuspLimitData.mActiveFlags[i])
	{
		Px1DConstraint& p = constraints[numActive];
        }
}

I think the VehicleConstraints->mData should update when k == numSubsteps - 1 ,
in this way the SuspLimitConstraint will be active and Generate Constraint Force,
Currently ,just the Chassis Shape Collide with the Ground Shape and change the Linear Velocity

mark

It’s hard to know which sub-step to sample. Sometimes the suspension limit will be broken when k==0, sometimes when k==1 etc.

I opted for k==0 becase I reasoned that would be conservative. The sub-steps should give the spring a chance to reduce the difference between the jounce and the suspension limit. I would expect that difference to be greatest at k==0 and to reduce as we progress towards numSubSteps-1. I’m trying to keep the wheels at a legal transform that doesn’t intersect scene geometry and vehicle geometry. There might be cases where the spring can handle the suspension limit without adding the constraint but I’d rather be conservative and make sure that the wheel is always visually in the correct place. That might come at the expense of vehicle handling but that should only happen when the wheel is somewhere near the suspension limit. In those circumstances the player might believe that they have hit the limit anyway.

Today I visit a Car Company ,I find there is no market in Simulate Vehilce Drive…
They need develop CAE Car Collision SoftBody and CAD Model software like 3dsMax !!!
Could PhysX use in Car CAE ?

Sorry, I’m not exactly sure what you’re asking.

There are PhysX plug-ins for 3ds max.

http://www.nvidia.com/object/physx_dcc_plugins.html

I mean if I want to develop a CAE Software to Simulate Car Collision,Could I use PhysX develop the Software?

Yes, you could but it wouldn’t be enough on its own.

PhysX simulates rigid bodies. Car collision requires some means to compute the deformation of the car’s chassis. There are many ways to do this but none of them are available in the sdk itself. If we model the deforming geometry of the car as a triangle mesh then physx can be used to compute contact points between the triangle mesh and external geometry eg a wall. PhysX doesn’t support tri mesh-tri mesh collision but it is possible to decompose scene geometry into convex components. Simple geometry such as a wall is convex anyway so this might not be such a problem.

I can imagine a simulate loop that runs as follows:

a. physx runs 1 simulation step and returns all contact points
b. some other software updates the triangle mesh using the contact points.

I did something like this to model a vehicle driving on a deforming landscape. I updated the heightfield underneath the wheels based on data such as jounce, load etc.

There are many ways to deform the mesh. There is a lot of literature on this topic. Each algorithm has its own pros and cons.

There are a lot of video games that model deforming vehicles using physics engines designed for games. Some of will use physx.

I’m not sure this is the best way to go, though. If accuracy is an issue it sounds more like a job for finite element modelling. It can be computationally expensive and might not be real-time but that might not be a problem. I don’t know the requirements, I’m afraid.

I’ll show you the video which the boss of the car company show me today several days later.
A human’s legs hit a soft board in the car and deform!

They need accuracy and deforming ,I think it’s finite element modelling

If accuracy and deformation are requirements then FEM is the way to go here.