Game Development Community

RayInfo::face. The usage.

by Flashback · in Torque Game Engine · 08/04/2006 (6:33 am) · 1 replies

...and I thought that won't need to learn much collision stuff for my project... payback time!

Let's imagine that gClientContainer.castRay returned me some info (ri). I see that there is a "face" field there, which should contain the ID or the number (not sure exactly) of a ploygon, which collided with my ray. How can I determine what mesh does this polygon belong to? To be exact, I need to get a name of that mesh.

That's how I see it:
- I need to loop through all the meshes in a shape;
- test each mesh - does it contain my polygon (ri.face);
- extract a name of this mesh.

Now can someone give me a tip how to implement this? Am I wrong, and another algorithm should be applied here?

#1
08/05/2006 (5:43 am)
I hate pumping up this topic, but... I can't believe that people around have absolutely no idea on the subject :)
Also I'm afraid that I'd have too look for some weird and hacky workarounds - if TGE forums can't help me, nothing else can.