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

Method buildExportPolyList

Engine/source/T3D/tsStatic.cpp:1285–1373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1283}
1284
1285bool TSStatic::buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F& box, const SphereF&)
1286{
1287 if (!mShapeInstance)
1288 return false;
1289
1290 if (mCollisionType == Bounds)
1291 {
1292 ColladaUtils::ExportData::colMesh* colMesh;
1293 exportData->colMeshes.increment();
1294 colMesh = &exportData->colMeshes.last();
1295
1296 colMesh->mesh.setTransform(&mObjToWorld, mObjScale);
1297 colMesh->mesh.setObject(this);
1298
1299 colMesh->mesh.addBox(mObjBox);
1300
1301 colMesh->colMeshName = String::ToString("ColBox%d-1", exportData->colMeshes.size());
1302 }
1303 else if (mCollisionType == VisibleMesh)
1304 {
1305 ColladaUtils::ExportData::colMesh* colMesh;
1306 exportData->colMeshes.increment();
1307 colMesh = &exportData->colMeshes.last();
1308
1309 colMesh->mesh.setTransform(&mObjToWorld, mObjScale);
1310 colMesh->mesh.setObject(this);
1311
1312 mShapeInstance->buildPolyList(&colMesh->mesh, 0);
1313
1314 colMesh->colMeshName = String::ToString("ColMesh%d-1", exportData->colMeshes.size());
1315 }
1316 else if (mCollisionType == CollisionMesh)
1317 {
1318 // Everything else is done from the collision meshes
1319 // which may be built from either the visual mesh or
1320 // special collision geometry.
1321 for (U32 i = 0; i < mCollisionDetails.size(); i++)
1322 {
1323 ColladaUtils::ExportData::colMesh* colMesh;
1324 exportData->colMeshes.increment();
1325 colMesh = &exportData->colMeshes.last();
1326
1327 colMesh->mesh.setTransform(&mObjToWorld, mObjScale);
1328 colMesh->mesh.setObject(this);
1329
1330 mShapeInstance->buildPolyListOpcode(mCollisionDetails[i], &colMesh->mesh, box);
1331
1332 colMesh->colMeshName = String::ToString("ColMesh%d-1", exportData->colMeshes.size());
1333 }
1334 }
1335
1336 //Next, process the LOD levels and materials.
1337 if (isServerObject() && getClientObject())
1338 {
1339 TSStatic* clientShape = dynamic_cast<TSStatic*>(getClientObject());
1340
1341 exportData->meshData.increment();
1342

Callers

nothing calls this directly

Calls 15

getNextPow2Function · 0.85
incrementMethod · 0.80
buildPolyListOpcodeMethod · 0.80
startsWithMethod · 0.80
getClientObjectFunction · 0.50
ToLowerFunction · 0.50
lastMethod · 0.45
setTransformMethod · 0.45
setObjectMethod · 0.45
addBoxMethod · 0.45
sizeMethod · 0.45
buildPolyListMethod · 0.45

Tested by

no test coverage detected