Game Development Community

Viewing Paths

by Erik Madison · in Torque Game Engine Advanced · 11/16/2005 (12:05 pm) · 0 replies

While I'm on the viewing kick, here's another one. I'm still stuck in primbuilder mode, but since it's editor only, it's not a big deal.
simpath.cpp
void wireWedge(F32 size, Point3F pos)
{
	GFX->pushWorldMatrix();

	GFX->setCullMode( GFXCullNone );
	GFX->setTexture(0, NULL); 
	GFX->setTextureStageColorOp( 0, GFXTOPDisable );
	GFX->setZEnable( true );
	PrimBuild::color3f( 0, 1.0, 0 );

	for(U32 j = 0; j < 4; j++)
	{
		PrimBuild::begin( GFXTriangleFan, 4 );
		for(U32 k = 0; k < 3; k++) {
			int idx = wedgeFaces[j][k];
			PrimBuild::vertex3f( wedgePoints[idx].x * size + pos.x, wedgePoints[idx].y * size + pos.y, wedgePoints[idx].z * size + pos.z );
		}
		PrimBuild::end();
	}
	GFX->setZEnable( true );

	GFX->popWorldMatrix();
}