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

Method buildPolyList

Engine/source/T3D/groundPlane.cpp:308–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308bool GroundPlane::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& )
309{
310 polyList->setObject( this );
311 polyList->setTransform( &MatrixF::Identity, Point3F( 1.0f, 1.0f, 1.0f ) );
312
313 if(context == PLC_Navigation)
314 {
315 F32 z = getPosition().z;
316 Point3F
317 p0(box.minExtents.x, box.maxExtents.y, z),
318 p1(box.maxExtents.x, box.maxExtents.y, z),
319 p2(box.maxExtents.x, box.minExtents.y, z),
320 p3(box.minExtents.x, box.minExtents.y, z);
321
322 // Add vertices to poly list.
323 U32 v0 = polyList->addPoint(p0);
324 polyList->addPoint(p1);
325 polyList->addPoint(p2);
326 polyList->addPoint(p3);
327
328 // Add plane between first three vertices.
329 polyList->begin(0, 0);
330 polyList->vertex(v0);
331 polyList->vertex(v0+1);
332 polyList->vertex(v0+2);
333 polyList->plane(v0, v0+1, v0+2);
334 polyList->end();
335
336 // Add plane between last three vertices.
337 polyList->begin(0, 1);
338 polyList->vertex(v0+2);
339 polyList->vertex(v0+3);
340 polyList->vertex(v0);
341 polyList->plane(v0+2, v0+3, v0);
342 polyList->end();
343
344 return true;
345 }
346
347 Box3F planeBox = getPlaneBox();
348 polyList->addBox( planeBox, mMaterialInst );
349
350 return true;
351}
352
353void GroundPlane::prepRenderImage( SceneRenderState* state )
354{

Callers

nothing calls this directly

Calls 10

getPositionFunction · 0.85
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