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

Method processData

Engine/source/ts/collada/colladaUtils.cpp:2961–3064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2959}
2960
2961void ColladaUtils::ExportData::processData()
2962{
2963 //This pref dictates if we 'backfill' lower LODs with higher ones if any given mesh being exported lacks that level.
2964 //For example, if there are 2 meshes, and one has 500, 200, 100 and the other has 500 and 200 - if this setting is on, the second mesh
2965 //will backfill the 200 to the 100 so it has all levels filled. If it's off, the second mesh will not render at the 100 level
2966 bool fillLowDetailLevels = dAtob(Con::getVariable("$exportMesh::fillLowDetailLevels", "1"));
2967
2968 S32 numDetailLevels = numberOfDetailLevels();
2969
2970 detailLevels.clear();
2971 detailLevels.setSize(numDetailLevels);
2972
2973 for (U32 meshNum = 0; meshNum < meshData.size(); ++meshNum)
2974 {
2975 for (U32 i = 0; i < numDetailLevels; ++i)
2976 {
2977 //Get our target size
2978 S32 targetDetailLevelSize = getDetailLevelSize(i);
2979
2980 //alright, step through each meshdata and propagate the polyList info 'up' to fill
2981 detailLevel* curDetail = &detailLevels[i];
2982
2983 curDetail->size = targetDetailLevelSize;
2984
2985 //Do we have a detail level for this?
2986 S32 detailLevelIdx = -1;
2987
2988 for (S32 mdl = i; mdl >= 0; mdl--)
2989 {
2990 //walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
2991 S32 testDetailLevelSize = getDetailLevelSize(mdl);
2992 detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize);
2993
2994 if (detailLevelIdx != -1)
2995 break;
2996 }
2997
2998 if (detailLevelIdx == -1)
2999 {
3000 //found nothing backwards, so lets check if we're configured to back-fill the first detail levels
3001 if (fillLowDetailLevels)
3002 {
3003 //if so, search forward, find the first valid detail and fill it in
3004 for (S32 mdl = 0; mdl < numDetailLevels; mdl++)
3005 {
3006 //walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
3007 S32 testDetailLevelSize = getDetailLevelSize(mdl);
3008 detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize);
3009
3010 if (detailLevelIdx != -1)
3011 break;
3012 }
3013 }
3014 }
3015
3016 //If we found the detail level index, go ahead and build out the data for it
3017 if (detailLevelIdx != -1)
3018 {

Callers

nothing calls this directly

Calls 13

dAtobFunction · 0.85
getVariableFunction · 0.85
errorfFunction · 0.50
clearMethod · 0.45
setSizeMethod · 0.45
sizeMethod · 0.45
hasDetailLevelMethod · 0.45
setTransformMethod · 0.45
setObjectMethod · 0.45
buildPolyListMethod · 0.45
getWorldBoxMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected