Game Development Community

Determining the Face of a collision

by Owen Ortmayer · in Torque Game Engine · 05/28/2004 (11:23 am) · 3 replies

Is there anyway to determine the face/polygon where an object has registered a collision. My class derives from shapebase. I need the vertices of the face so I can determine the plane it lies within.

I need to do something like:
for each collision point
  determine the face on the object where this collision point lies

Im using mConvex.getCollisionInfo(); to get the collision info.
This sets mCollsionList so I can access each registered collision by mCollsionList.collision[i];

The Collision structure has a field for the face, but as stated in the declaration:

// Face and Face dot are currently only set by the extrudedPolyList
// clipper.  Values are otherwise undefined.
U32 face;     // Which face was hit
F32 faceDot;  // -Dot of face with poly normal

So does anyone know of a way to determine the face on the object corresponding to each collision point. Or does it look like I'm going to have to code this in myself.

#1
05/28/2004 (12:13 pm)
Take a look at the player collision code in Player::updatePos()...that shows an example of how to generate a collision list with extrudedPolyList (thus setting face).
#2
05/28/2004 (12:50 pm)
I'll take a look. Thanks Matt.
#3
11/30/2007 (1:55 am)
Even i'm facing the same problem, and looking at player::updatepos() hast helped...