How to set the tire and suspension force AppCMOffsets?

External Media


//Lets assume that the suspension travel directions are absolutely vertical.
	//Also assume that we apply the tire and suspension forces 30cm below the center of mass.
	PxVec3 suspTravelDirections[4] = { PxVec3(0,-1,0),PxVec3(0,-1,0),PxVec3(0,-1,0),PxVec3(0,-1,0) };
	PxVec3 wheelCentreCMOffsets[4];
	PxVec3 suspForceAppCMOffsets[4];
	PxVec3 tireForceAppCMOffsets[4];
	for (PxU32 i = 0;i<4;i++)
		wheelCentreCMOffsets[i] = wheelCentreOffsets[i] - chassisCMOffset;
		suspForceAppCMOffsets[i] = PxVec3(wheelCentreCMOffsets[i].x, -0.3f, wheelCentreCMOffsets[i].z);
		tireForceAppCMOffsets[i] = PxVec3(wheelCentreCMOffsets[i].x, -0.3f, wheelCentreCMOffsets[i].z);

in UE4 The Up Vector is (0,0,1)
Now I have the Vehicle CMOffset Vec3(0,0,0)
The BMW Car’s wheelCentreCMOffset Vec3(1.33,0.8,-0.25)
So I can’t apply the tire and suspension forces 30cm below the center of mass,
How to set the Y value of wheelCentreCMOffset in my case?


I don’t quite understand the question.

All you need to do is specify a point to apply the force relative to the rigid body centre of mass. There needs to be a PxVec3 offset for each wheel. Actually, we need an offset from the centre of mass for the tire force and a separate offset for the suspension force. Typically, developers have set these two offsets to be identical.

The offsets can be set with the functions:




These offsets are actually a bit of a shortcut to avoid having to model the physics of the suspension geometry. As a consequence, they are a bit of guess.

I strongly recommend you read the Tuning Guide section in the Guide. It contains a description of the role of the functions setSuspForceAppPointOffset and setTireForceAppPointOffset.

I don’t know whether the image could show in your network.
In the VehicleSample,the Vehicle’s suspForceAppCMOffsets is set at 30cm below the center of mass
But in my case,the BMW’s center of mass is very low,and the wheelCentreCMOffset is 25cm below the center of mass
Obviously I can’t set the suspForceAppCMOffset at 30 cm below the center of mass,
So How to decide the value of susForceAppCMOffset in my case


Did you read the Tuning Guide? It has a section on these offset parameters and a quick outline to help users arrive at a good working estimate.



Thanks !
I have read that section !

I still don’t fully understand the problem. It is really just a question of experimentation and reasoning about the value. A good guess will likely be below the centre of mass and above the wheel centre. That limits your choices to the range (0cm, -25cm). Maybe start at -12.5cm?

In my case,
The radius of wheel is 32cm
The wheelCenterCMOffset is 25cm below the centre of mass
I’m not sure whether it’s really valid,maybe the centre of mass is too low…

I still don’t see the problem, I’m afraid.

The wheel centre and force application points are all specified relative to the rigid body centre of mass.
The wheel radius doesn’t really play a role here.

The only key principle is that the forces are applied somewhere above the wheel centre and below the centre of mass. There’s a 25cm range in your configuration.

Now,All the values above are relative to the rigid body centre of mass.
I have already configure the apply point in this [0,25cm] range.


Is there still a problem that I can help with?

It’s clear now.
Thank you very much.

I’ll create new topic if I encouter new problem in my project.
I’m developing a Vehicle Plugin in UE4 based on the VehicleSample.

Have you seen the vehicle integration already in ue4? It doesn’t expose all the parameters but it might act as a template and reference for your project.

I have seen it and it acts as a reference,But it’s hard to understand every implementation detail.
So I think it’s still necessary to implement myself