mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
void ColladaUtils::ExportData::processData() var clarifications
This commit is contained in:
parent
cbce2ee805
commit
9fbeb3e2d0
1 changed files with 14 additions and 14 deletions
|
|
@ -2948,7 +2948,7 @@ void ColladaUtils::ExportData::processData()
|
||||||
detailLevels.clear();
|
detailLevels.clear();
|
||||||
detailLevels.setSize(numDetailLevels);
|
detailLevels.setSize(numDetailLevels);
|
||||||
|
|
||||||
for (U32 m = 0; m < meshData.size(); ++m)
|
for (U32 meshNum = 0; meshNum < meshData.size(); ++meshNum)
|
||||||
{
|
{
|
||||||
for (U32 i = 0; i < numDetailLevels; ++i)
|
for (U32 i = 0; i < numDetailLevels; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -2967,7 +2967,7 @@ void ColladaUtils::ExportData::processData()
|
||||||
{
|
{
|
||||||
//walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
|
//walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
|
||||||
S32 testDetailLevelSize = getDetailLevelSize(mdl);
|
S32 testDetailLevelSize = getDetailLevelSize(mdl);
|
||||||
detailLevelIdx = meshData[m].hasDetailLevel(testDetailLevelSize);
|
detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize);
|
||||||
|
|
||||||
if (detailLevelIdx != -1)
|
if (detailLevelIdx != -1)
|
||||||
break;
|
break;
|
||||||
|
|
@ -2983,7 +2983,7 @@ void ColladaUtils::ExportData::processData()
|
||||||
{
|
{
|
||||||
//walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
|
//walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on
|
||||||
S32 testDetailLevelSize = getDetailLevelSize(mdl);
|
S32 testDetailLevelSize = getDetailLevelSize(mdl);
|
||||||
detailLevelIdx = meshData[m].hasDetailLevel(testDetailLevelSize);
|
detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize);
|
||||||
|
|
||||||
if (detailLevelIdx != -1)
|
if (detailLevelIdx != -1)
|
||||||
break;
|
break;
|
||||||
|
|
@ -2994,13 +2994,13 @@ void ColladaUtils::ExportData::processData()
|
||||||
//If we found the detail level index, go ahead and build out the data for it
|
//If we found the detail level index, go ahead and build out the data for it
|
||||||
if (detailLevelIdx != -1)
|
if (detailLevelIdx != -1)
|
||||||
{
|
{
|
||||||
curDetail->mesh.setTransform(&meshData[m].meshTransform, meshData[m].scale);
|
curDetail->mesh.setTransform(&meshData[meshNum].meshTransform, meshData[meshNum].scale);
|
||||||
curDetail->mesh.setObject(meshData[m].originatingObject);
|
curDetail->mesh.setObject(meshData[meshNum].originatingObject);
|
||||||
|
|
||||||
if (meshData[m].shapeInst != nullptr)
|
if (meshData[meshNum].shapeInst != nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!meshData[m].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx))
|
if (!meshData[meshNum].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx))
|
||||||
{
|
{
|
||||||
Con::errorf("TSStatic::buildExportPolyList - failed to build polylist for LOD %i", i);
|
Con::errorf("TSStatic::buildExportPolyList - failed to build polylist for LOD %i", i);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -3009,10 +3009,10 @@ void ColladaUtils::ExportData::processData()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//special handling classes
|
//special handling classes
|
||||||
ConvexShape* convexShp = dynamic_cast<ConvexShape*>(meshData[m].originatingObject);
|
ConvexShape* convexShp = dynamic_cast<ConvexShape*>(meshData[meshNum].originatingObject);
|
||||||
if (convexShp != nullptr)
|
if (convexShp != nullptr)
|
||||||
{
|
{
|
||||||
if (!convexShp->buildPolyList(PLC_Export, &curDetail->mesh, meshData[m].originatingObject->getWorldBox(), meshData[m].originatingObject->getWorldSphere()))
|
if (!convexShp->buildPolyList(PLC_Export, &curDetail->mesh, meshData[meshNum].originatingObject->getWorldBox(), meshData[meshNum].originatingObject->getWorldSphere()))
|
||||||
{
|
{
|
||||||
Con::errorf("TSStatic::buildExportPolyList - failed to build ConvexShape polylist for LOD %i", i);
|
Con::errorf("TSStatic::buildExportPolyList - failed to build ConvexShape polylist for LOD %i", i);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -3021,19 +3021,19 @@ void ColladaUtils::ExportData::processData()
|
||||||
}
|
}
|
||||||
|
|
||||||
//lastly, get material
|
//lastly, get material
|
||||||
for (U32 m = 0; m < curDetail->mesh.mMaterialList.size(); m++)
|
for (U32 matNum = 0; matNum < curDetail->mesh.mMaterialList.size(); matNum++)
|
||||||
{
|
{
|
||||||
S32 matIdx = hasMaterialInstance(curDetail->mesh.mMaterialList[m]);
|
S32 matIdx = hasMaterialInstance(curDetail->mesh.mMaterialList[matNum]);
|
||||||
|
|
||||||
if (matIdx == -1)
|
if (matIdx == -1)
|
||||||
{
|
{
|
||||||
//cool, haven't already got this material, so lets store it out
|
//cool, haven't already got this material, so lets store it out
|
||||||
materials.push_back(curDetail->mesh.mMaterialList[m]);
|
materials.push_back(curDetail->mesh.mMaterialList[matNum]);
|
||||||
curDetail->materialRefList.insert(m, materials.size() - 1);
|
curDetail->materialRefList.insert(matNum, materials.size() - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
curDetail->materialRefList.insert(m, matIdx);
|
curDetail->materialRefList.insert(matNum, matIdx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue