Physx is very bad simulating centrifugal force. Any other workaround?

Hello there.

I’m doing a simple experiment in which spheres simulates wheels that are attached by a configurablejoint to a cube that rolls. The joints are configured to behave like suspensions, like this:

fw = gameObject.AddComponent(ConfigurableJoint);
fw.connectedBody = frontwheel.rigidbody;
fw.xMotion = ConfigurableJointMotion.Locked;
fw.yMotion = ConfigurableJointMotion.Limited;
fw.zMotion = ConfigurableJointMotion.Locked;
fw.angularYMotion = ConfigurableJointMotion.Locked;
fw.angularZMotion = ConfigurableJointMotion.Locked;
var lim : SoftJointLimit;
lim.limit = 0;
lim.spring = 100;
lim.damper = 3;
fw.linearLimit = lim;

It seems pretty okay to me, and it behaves exactly as expected for a simple suspension, the problems begin with centrifugal forces. The wheels simply doesn’t stay attached when the cube rolls…

I did exactly the same experiment using Bullet, because i thought maybe it was a normal behavior, but it behaved as expected.

I’ve tried to increase the “Solver Iteration Count” but didn’t help, also, i’ve tried to set the max angular velocity globally (instead of using different values for each object).

The workaround that i’m doing now is to simply check the wheels distance and move them back to their maximum plausible position. It works, but affects the physics simulation:

if (Vector3.Distance(transform.position, frontwh.transform.position) > 1.9){
	frontwheel.transform.position = transform.position + transform.right + (-transform.up * 1.5);
}

So, i wonder if there’s a way to apply a less-ugly workaround. Or even a better way to simulate a suspension without using wheels colliders.

Thank you.

Something worth checking before giving up on the configurable joint… have you got the Configured In World Space option enabled on the component? If so then the the joint’s motion is restricted to the world Y axis (and so it would move out of sync with the car when it rolls). There could be other reasons why the joint fails but this is the most obvious.

Thanks, but it isn’t configured in world space, otherwise not even the suspension would work properly. I’m gonna use that ugly fix for this.

Physx isn’t as good as i thought… it is extremely inaccurate calculating heavy things supported by light ones (a car for example), unless you tune the timestep to values that will require much processing power. It doesn’t allow collidermesh-collidermesh interactions. It doesn’t have concave nor convex mesh-based colliders. Also, it seems to only work properly for conventional uses.

It’s blazing fast, but the speed seems to be the only pro, along with dozens of severe cons. Also, the GPU acceleration isn’t “that” good, and too little people has acessibility due the requirements. Other physics engines aren’t much slower (using CPU) and respects a lot more the physics laws. Physx imho is more like a physics “representation” than a real physics simulation. Of course no (realtime) physics engine is going to be 100% accurate, but c’mon, centrifugal force is simply “basic”…

Thank you.

It does have convex mesh colliders, which will interact with other mesh colliders (convex or not).

–Eric

Really? Never noticed… those simplified mesh colliders are one of the most powerful and helpful features in other physics engines.

Just click on the “convex” box on a mesh collider.

–Eric