How to make a Physx TriangleMesh into a simulation dynamic

Started by
3 comments, last by Dirk Gregorius 8 years, 6 months ago

In physx, PxTriangleMeshGeometry that are attached to a simulated PxRigidDynamic must not be SIMULATION_SHAPE.

In other word, you can't set the a simulated PxRigidDynamic with a SIMULATION_SHAPE TriangleMesh.

That is very annoying! If i want a TriangleMesh to be SIMULATION_SHAPE, that the PxRigidDynamic is attached to must be KINEMATIC, and the Physx would not simulate the RigidActor for me.

I want the PxRigidDynamic with TriangleMesh to be SIMULATE, NOT KINEMATIC, and TriangleMesh is also being used into collision.

HOW TO SOLVE IT.

Advertisement

There's a good reason for those restrictions... triangle meshes are really computationally expensive for collision detection! It's only feasible to use them if you can assume that they're static and/or assume that there will never be tri-mesh vs tri-mesh collisions.

For dynamic objects, you're supposed to use convex decomposition to convert the triangle meshes into an array of convex hulls (polytopes).

There's a good reason for those restrictions... triangle meshes are really computationally expensive for collision detection! It's only feasible to use them if you can assume that they're static and/or assume that there will never be tri-mesh vs tri-mesh collisions.

For dynamic objects, you're supposed to use convex decomposition to convert the triangle meshes into an array of convex hulls (polytopes).

Does the Havok Engine or Bullet Engine also have that restriction?

In PhysX, I am pretty sure you can use something like "ComputeConvexDynamicShape" from arbitrary triangle cooked mesh to have a fully dynamic actor defined by triangle shape. It will do the decomposition for you.

Collision between triangle meshes is not well defined and slow. I think Havok does not have that restriction and in Bullet you can use the GImpact shape. How well that will work is a totally different story though.

This topic is closed to new replies.

Advertisement