Physx Vehicle Model

Started by
5 comments, last by JoeJ 1 year, 8 months ago

Hi, I have a few stange issues with the vehicle physx object. It is a convex mesh and I used the physx 4 documentation and the physx sample project to get it in working.

The first issue is that the wheels spin but the vehicle does not move. The solution I found to get it to move is by changing the origin of the wheels above the centre which obviously doesn't give the correct rotatation but the vehicle moves. The documentation has a few things listed a few things to troubleshoot the issue, however in the physx debugger, in the first option, I'm not sure where to long and for the rest where it says to use functions, those functions do not exist or at least I can't find them, but I don't think that's the cause anyway since the vehicle does move if the origin is changed. Any idea's on what the issue could be or what I can do to try to fix this.

My second issue can be seen in the images, below. A point gets created at the bottom of the mesh, which is not found in the 3D models. I have tested two different chassis models and it still occurs. I thought this maybe getting stuck on the ground cause the above issue, however, I have found a solution that still creates the point but it is not as bad. I have changed the origin point of the vehicle chassis and offset the vehicle in code, but it is still there, it just no longer hits the floor. Any ideas?

Both issues have something to do with the origin. I have tested to see if this issue occurs with physx triangle meshes and it does not. I can change it from convex meshes to the triangle mesh, but if nvidia uses convex meshes then it should work.

None

Advertisement

I have tried changing the convex mesh to a triangle mesh, but that causes a nullptr exception

None

It looks like the wheels have been included in the calculation of the convex hull, with their positions all at the origin rather than at the correct wheel locations.

You need to set a non-zero friction coefficient on the wheel for rotation to cause forward vehicle motion, if you haven't done that already.

@Aressera Hi I have now seperated the chassis and wheels into seperate models, and the same issue occurs. I have all the frictions set, the tires friction can be changed too. The wheels rotate correct for moving forwards, for moving backwards and steering but the vehicle does not move unless I have the orgin of each wheel above the centre.

None

You may want to check the wheel moment of inertia to make sure they are not too low. The PhysX SDK docs wrt to vehicles leaves a lot to be desired, but it does have ‘TroubleShooting’ section that covers this case irrc.

Beside the things mentioned, the model of the wheels looks bad too. The tessellation seems twisted, causing triangles where planar quads could be used. Is this a convex hull of a mesh, or a proper round primitive shape and just the visualization is bad?
I ask because a round primitive should be cheaper and also generate robust contacts, while a mesh might jump on it's edges.

This image shows a ‘chamfered cylinder' primitive with a nonuniform scale, which works well. Idk what options PhysX has for this, though.

This topic is closed to new replies.

Advertisement