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

Method buildExportPolyList

Engine/source/T3D/convexShape.cpp:863–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863bool ConvexShape::buildExportPolyList(ColladaUtils::ExportData* exportData, const Box3F &box, const SphereF &)
864{
865 if (mGeometry.points.empty())
866 return false;
867
868 //Get the collision mesh geometry
869 {
870 ColladaUtils::ExportData::colMesh* colMesh;
871 exportData->colMeshes.increment();
872 colMesh = &exportData->colMeshes.last();
873
874 colMesh->mesh.setTransform(&mObjToWorld, mObjScale);
875 colMesh->mesh.setObject(this);
876
877 //Just get the visible
878 buildPolyList(PLC_Export, &colMesh->mesh, getWorldBox(), getWorldSphere());
879
880 colMesh->colMeshName = String::ToString("ColMesh%d-1", exportData->colMeshes.size());
881 }
882
883 //Next, process the geometry and materials.
884 //Convex shapes only have the one 'level', so we'll just rely on the export post-process to back-fill
885 if (isServerObject() && getClientObject())
886 {
887 exportData->meshData.increment();
888
889 //Prep a meshData for this shape in particular
890 ColladaUtils::ExportData::meshLODData* meshData = &exportData->meshData.last();
891
892 //Fill out the info we'll need later to actually append our mesh data for the detail levels during the processing phase
893 meshData->shapeInst = nullptr;
894 meshData->originatingObject = this;
895 meshData->meshTransform = mObjToWorld;
896 meshData->scale = mObjScale;
897
898 meshData->meshDetailLevels.increment();
899
900 ColladaUtils::ExportData::detailLevel* curDetail = &meshData->meshDetailLevels.last();
901
902 //Make sure we denote the size this detail level has
903 curDetail->size = getNextPow2(getObjBox().len());
904
905 }
906
907 return true;
908}
909
910void ConvexShape::_export( OptimizedPolyList *plist, const Box3F &box, const SphereF &sphere )
911{

Callers

nothing calls this directly

Calls 9

getNextPow2Function · 0.85
incrementMethod · 0.80
getClientObjectFunction · 0.50
emptyMethod · 0.45
lastMethod · 0.45
setTransformMethod · 0.45
setObjectMethod · 0.45
sizeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected