mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 23:35:45 +00:00
Adds handling for the proper updated exporting of mesh for convexShapes
This commit is contained in:
parent
f309b736ca
commit
501a322435
4 changed files with 80 additions and 3 deletions
|
|
@ -26,6 +26,9 @@
|
|||
#include "ts/collada/colladaUtils.h"
|
||||
#include "materials/matInstance.h"
|
||||
|
||||
//special handling for export classes
|
||||
#include "T3D/convexShape.h"
|
||||
|
||||
using namespace ColladaUtils;
|
||||
|
||||
#define MAX_PATH_LENGTH 256
|
||||
|
|
@ -2994,10 +2997,27 @@ void ColladaUtils::ExportData::processData()
|
|||
curDetail->mesh.setTransform(&meshData[m].meshTransform, meshData[m].scale);
|
||||
curDetail->mesh.setObject(meshData[m].originatingObject);
|
||||
|
||||
if (!meshData[m].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx))
|
||||
if (meshData[m].shapeInst != nullptr)
|
||||
{
|
||||
Con::errorf("TSStatic::buildExportPolyList - failed to build polylist for LOD %i", i);
|
||||
continue;
|
||||
|
||||
if (!meshData[m].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx))
|
||||
{
|
||||
Con::errorf("TSStatic::buildExportPolyList - failed to build polylist for LOD %i", i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//special handling classes
|
||||
ConvexShape* convexShp = dynamic_cast<ConvexShape*>(meshData[m].originatingObject);
|
||||
if (convexShp != nullptr)
|
||||
{
|
||||
if (!convexShp->buildPolyList(PLC_Export, &curDetail->mesh, meshData[m].originatingObject->getWorldBox(), meshData[m].originatingObject->getWorldSphere()))
|
||||
{
|
||||
Con::errorf("TSStatic::buildExportPolyList - failed to build ConvexShape polylist for LOD %i", i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//lastly, get material
|
||||
|
|
|
|||
|
|
@ -140,6 +140,8 @@ namespace ColladaUtils
|
|||
|
||||
Point3F scale;
|
||||
|
||||
bool fillWithSingleDetail;
|
||||
|
||||
S32 hasDetailLevel(S32 size)
|
||||
{
|
||||
for (U32 i = 0; i < meshDetailLevels.size(); ++i)
|
||||
|
|
@ -152,6 +154,9 @@ namespace ColladaUtils
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
meshLODData() : shapeInst(nullptr), meshTransform(true), originatingObject(nullptr), scale(0), fillWithSingleDetail(false)
|
||||
{}
|
||||
};
|
||||
|
||||
struct colMesh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue