Game Development Community

buildPolyList bug for Interiors

by Keith Johnston · in Torque Game Engine · 02/03/2003 (4:31 pm) · 0 replies

If you want buildPolyList to return all the polygons for an interior, you will need to make this change in interiorCollision.cc, in Interior::buildPolyList. Otherwise you only get some of the triangles.

Change this part of the function:

list->begin(0, rSurface.planeIndex);
for (U32 k = 0; k < numVerts; k++)
{
  array[k] = list->addPoint(mPoints[fanVerts[k]].point);
  list->vertex(array[k]);
}
list->plane(array[0], array[1], array[2]);
list->end();

to this:

for (U32 k=0; k<numVerts; k++)
 array[k] = list->addPoint(mPoints[fanVerts[k]].point);
			
for (U32 k = 0; k < numVerts-2; k++)
{
 list->begin(0,rSurface.planeIndex);
 list->vertex(array[0]);
 list->vertex(array[k+1]);
 list->vertex(array[k+2]);
 list->plane(array[0], array[k+1], array[k+2]);
 list->end();
}