MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / buildPolyList

Method buildPolyList

Engine/source/T3D/groundPlane.cpp:291–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291bool GroundPlane::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& )
292{
293 polyList->setObject( this );
294 polyList->setTransform( &MatrixF::Identity, Point3F( 1.0f, 1.0f, 1.0f ) );
295
296 if(context == PLC_Navigation)
297 {
298 F32 z = getPosition().z;
299 Point3F
300 p0(box.minExtents.x, box.maxExtents.y, z),
301 p1(box.maxExtents.x, box.maxExtents.y, z),
302 p2(box.maxExtents.x, box.minExtents.y, z),
303 p3(box.minExtents.x, box.minExtents.y, z);
304
305 // Add vertices to poly list.
306 U32 v0 = polyList->addPoint(p0);
307 polyList->addPoint(p1);
308 polyList->addPoint(p2);
309 polyList->addPoint(p3);
310
311 // Add plane between first three vertices.
312 polyList->begin(0, 0);
313 polyList->vertex(v0);
314 polyList->vertex(v0+1);
315 polyList->vertex(v0+2);
316 polyList->plane(v0, v0+1, v0+2);
317 polyList->end();
318
319 // Add plane between last three vertices.
320 polyList->begin(0, 1);
321 polyList->vertex(v0+2);
322 polyList->vertex(v0+3);
323 polyList->vertex(v0);
324 polyList->plane(v0+2, v0+3, v0);
325 polyList->end();
326
327 return true;
328 }
329
330 Box3F planeBox = getPlaneBox();
331 polyList->addBox( planeBox, mMaterial );
332
333 return true;
334}
335
336void GroundPlane::prepRenderImage( SceneRenderState* state )
337{

Callers

nothing calls this directly

Calls 9

Point3FClass · 0.50
setObjectMethod · 0.45
setTransformMethod · 0.45
addPointMethod · 0.45
beginMethod · 0.45
vertexMethod · 0.45
planeMethod · 0.45
endMethod · 0.45
addBoxMethod · 0.45

Tested by

no test coverage detected