NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.21k stars 809 forks source link

Double sided collision of static triangular meshes #289

Open kkdb8dm opened 4 years ago

kkdb8dm commented 4 years ago

I am working on version 3.4 and trying to diagnose an issue in collisions being missed between static triangular meshes and dynamic objects. Here is the unit test I set up.

A static PxTrangleMesh constructed using a single triangle with planar points ([0,0, 0], [0, 0, 10], [10, 0, 10]). And then I drop a dynamic actor with a box type collision model from height. I expect the box to collide with this triangle and rest on it. But my observation is this.

My questions.

  1. Should I then conclude that the default collision between static Triangular meshes and dynamic actors are one-sided with the triangle normals being determined by the order in which I specify the vetrs?
  2. If answer to 1 is yes, how do I make the collision double sided so that the order in which I specify the verts does not matter?

Or is there some other obvious explanation which I have missed here or there could be bugs elsewhere in my code?

MrMechanical commented 4 years ago

Out of curiosity what happens if you put 2 triangles facing each other? Does it then detect collisions double-sided?

kkdb8dm commented 4 years ago

Yes. That works.