Triangle Mesh as Trigger Volume

spakowski

20-05-2009 19:12:30

Problem Desc:

Convex object inside a Triangle Mesh as trigger is not getting detected where as any other shape like box/sphere inside is giving perfect output for all the registered callback event (Enter, Stay, Exit)

Issues with Box/Sphere shape inside inside Triangle Mesh
Even though any shape is detecting all primitive shapes are getting detected on the callbacks, when an object enters inside the triangle mesh i.e. Object is not colliding with the surface on the Triangle Mesh Triggers (inside the mesh) reports on the callbacks as Exit

Can someone tell me if i have to detect proper collision on these scenarios what should i be doing, and moreover is it a problem of NxOGRE or PhysX itself.

NxOgre Version : Bleeding
Ogre Version : Shoggoth 1.6.2
PhysX SDK Version : 2.8.1

betajaen

20-05-2009 19:15:16

I'm afraid it's a PhysX issue;

Triggers can be created from any type of shape except wheel shapes. Triangle mesh triggers count as hollow surfaces for collision detection, not volumes. Note that convex vs. triangle mesh and mesh vs. mesh triggers are not implemented. Triggers are created and attached to actors just like any other shape.

If your mesh is "convexy" enough, perhaps a convex version of the mesh may work better.

spakowski

20-05-2009 19:18:44

Thanks for such a quick reply

My problem is that any updates regarding these issues to be solved in the future or we will have come up with a solution for this problem.

Guys you make this world rock (awesome with the responses)

May be a post to take up with the PhysX forums

Thanks for all the support you have provided with NxOGRE

spakowski

20-05-2009 19:27:38

If your mesh is "convexy" enough, perhaps a convex version of the mesh may work better

I am afraid my mesh is not "convexy" enough as of now, so i will have to work on coming up with some intermediate solution to this problem.

hoping that the next versions of the PhysX SDK solves this somehow

betajaen

20-05-2009 19:32:00

Unfortunately. that paragraph has been in the documentation as long as I've been working with PhysX.

Can you break up your triangle mesh into several convex/cube/sphere meshes? That way you can have a multi-shape trigger.

spakowski

20-05-2009 19:36:56

Multi Shape as in you mean by one body or multiple sets of bodies having individual shapes

Multiple Sets of Shapes is something we are already using for other issues and did not solve the solution for the problem of a race line/track

We are using a lot of sphere & cube shapes to understand the cornering in our application and not for the entire track

betajaen

20-05-2009 19:56:24

One Actor/Body with more than one shape (GroupShape, CompoundShape, etc.), making sure the NX_TRIGGER_ENABLED flag is on for each shape.

spakowski

20-05-2009 19:58:21

Have to try that approach and check whether it solves the problem

Will update as soon as it is tested

Thanks for all the replies

betajaen

20-05-2009 20:38:11

Ideally, you could use one trigger with multiple-shapes, per function for your entire race track. But let's hope it fixes your problem first.

kaneyxt

21-05-2009 01:53:54

I've been working with PhysX since 2.0, 3 years ago. The mesh vs. mesh collision is always a big issue!
At the early time, we support dynamic triangle mesh, so we have to support mesh vs. mesh collision detection. But then we find it always massive and "bugy". So maybe from 2.3 or 2.5, we do not support dynamic triangle mesh any more. Now triangle mesh is most likely to be used as terrain (sometimes you will use height field instead).
From technical point of view, the biggest problem for triangle mesh is that: in most time, it is not close-manifold, so we can not define its inside/outside. Even if it is close-manifold, triangle mesh can be not "convexy", and it has too many triangles. In the low level of PhysX engine, triangle mesh can not use the same solver with convex mesh. But the primary shapes (box, sphere, capsule) can run in same solver with convex. That's why the collision detection/trigger among primary shapes and convex can work well, but for triangle mesh, things become different.

Therefore, in the near future, I do not see a hope that PhysX team will solve the mesh vs. mesh collision problem. They will not even take a look at this problem except there is a strong request from PhysX's important partner, such as Epic, Emergent, EA, etc.

spakowski

22-05-2009 12:12:00

One Actor/Body with more than one shape (GroupShape, CompoundShape, etc.), making sure the NX_TRIGGER_ENABLED flag is on for each shape.

Sorry for a delayed response I was looking at other alternative solution to the problem.

I was able to solve my problem using multi shapes even though i did not get the accuracy i was expecting it solved the problem. I did find a different solution to this problem which is a custom implementation using the Race line Curve and the width of the track at every interpolation point.
I still need to test the computational aspects of both the methods and i will update which is faster and quicker.

Thanks for all the replies

NxOGRE is a great wrapper