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

Method _captureVerts

Engine/source/environment/decalRoad.cpp:1291–1604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289}
1290
1291void DecalRoad::_captureVerts()
1292{
1293 PROFILE_SCOPE( DecalRoad_captureVerts );
1294
1295 //Con::warnf( "%s - captureVerts", isServerObject() ? "server" : "client" );
1296
1297 if ( isServerObject() )
1298 {
1299 //Con::errorf( "DecalRoad::_captureVerts - called on the server side!" );
1300 return;
1301 }
1302
1303 if ( mEdges.size() == 0 )
1304 return;
1305
1306 //
1307 // Construct ClippedPolyList objects for each pair
1308 // of roadEdges.
1309 // Use them to capture Terrain verts.
1310 //
1311 SphereF sphere;
1312 RoadEdge *edge = NULL;
1313 RoadEdge *nextEdge = NULL;
1314
1315 mTriangleCount = 0;
1316 mVertCount = 0;
1317
1318 Vector<ClippedPolyList> clipperList;
1319
1320 for ( U32 i = 0; i < mEdges.size() - 1; i++ )
1321 {
1322 Box3F box;
1323 edge = &mEdges[i];
1324 nextEdge = &mEdges[i+1];
1325
1326 box.minExtents = edge->p1;
1327 box.maxExtents = edge->p1;
1328 box.extend( edge->p0 );
1329 box.extend( edge->p2 );
1330 box.extend( nextEdge->p0 );
1331 box.extend( nextEdge->p1 );
1332 box.extend( nextEdge->p2 );
1333 box.minExtents.z -= 5.0f;
1334 box.maxExtents.z += 5.0f;
1335
1336 sphere.center = ( nextEdge->p1 + edge->p1 ) * 0.5f;
1337 sphere.radius = 100.0f; // NOTE: no idea how to calculate this
1338
1339 ClippedPolyList clipper;
1340 clipper.mNormal.set(0.0f, 0.0f, 0.0f);
1341 VectorF n;
1342 PlaneF plane0, plane1;
1343
1344 // Construct Back Plane
1345 n = edge->p2 - edge->p0;
1346 n.normalize();
1347 n = mCross( n, edge->uvec );
1348 plane0.set( edge->p0, n );

Callers 1

processMethod · 0.80

Calls 15

extendMethod · 0.80
cullUnusedVertsMethod · 0.80
incrementMethod · 0.80
notifyObjectDirtyMethod · 0.80
mCrossFunction · 0.50
mDotFunction · 0.50
PlaneFClass · 0.50
getContainerFunction · 0.50
Point2FClass · 0.50
sizeMethod · 0.45
setMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected