Пример #1
0
static void AAS_ShowFacePolygon( int facenum, int color, int flip ) {
	//check if face number is in range
	if ( facenum >= aasworld->numfaces ) {
		BotImport_Print( PRT_ERROR, "facenum %d out of range\n", facenum );
	}
	aas_face_t* face = &aasworld->faces[ facenum ];
	//walk through the edges of the face
	vec3_t points[ 128 ];
	int numpoints = 0;
	if ( flip ) {
		for ( int i = face->numedges - 1; i >= 0; i-- ) {
			//edge number
			int edgenum = aasworld->edgeindex[ face->firstedge + i ];
			aas_edge_t* edge = &aasworld->edges[ abs( edgenum ) ];
			VectorCopy( aasworld->vertexes[ edge->v[ edgenum < 0 ] ], points[ numpoints ] );
			numpoints++;
		}
	} else {
		for ( int i = 0; i < face->numedges; i++ ) {
			//edge number
			int edgenum = aasworld->edgeindex[ face->firstedge + i ];
			aas_edge_t* edge = &aasworld->edges[ abs( edgenum ) ];
			VectorCopy( aasworld->vertexes[ edge->v[ edgenum < 0 ] ], points[ numpoints ] );
			numpoints++;
		}
	}
	AAS_ShowPolygon( color, numpoints, points );
}
Пример #2
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
void AAS_ShowFacePolygon(int facenum, int color, int flip)
{
    int i, edgenum, numpoints;
    vec3_t points[128];
    aas_edge_t *edge;
    aas_face_t *face;

    //check if face number is in range
    if (facenum >= aasworld.numfaces)
    {
        botimport.Print(PRT_ERROR, "facenum %d out of range\n", facenum);
    } //end if
    face = &aasworld.faces[facenum];
    //walk through the edges of the face
    numpoints = 0;
    if (flip)
    {
        for (i = face->numedges-1; i >= 0; i--)
        {
            //edge number
            edgenum = aasworld.edgeindex[face->firstedge + i];
            edge = &aasworld.edges[abs(edgenum)];
            VectorCopy(aasworld.vertexes[edge->v[edgenum < 0]], points[numpoints]);
            numpoints++;
        } //end for
    } //end if
    else
    {
        for (i = 0; i < face->numedges; i++)
        {
            //edge number
            edgenum = aasworld.edgeindex[face->firstedge + i];
            edge = &aasworld.edges[abs(edgenum)];
            VectorCopy(aasworld.vertexes[edge->v[edgenum < 0]], points[numpoints]);
            numpoints++;
        } //end for
    } //end else
    AAS_ShowPolygon(color, numpoints, points);
} //end of the function AAS_ShowFacePolygon