You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BMaxParser p(myFile.getBuffer(), myFile.getSize());
-- calling the ParseParaXModel the first time does not process LOD
lod.m_pParaXMesh = p.ParseParaXModel();
if( lod.m_pParaXMesh.GetVerticeCount() > XXXX) then
-- add a new lod : only process LOD related info, when it is queried the first time.
lod1.m_pParaXMesh = p.ParseLODParaXModel(nMaxTriangleCount);
---
lod2.m_pParaXMesh = p.ParseLODParaXModel(nMaxTriangleCount);
end
// block max model.
BMaxParser p(myFile.getBuffer(), myFile.getSize());
lod.m_pParaXMesh = p.ParseParaXModel();
auto pParaXMesh = lod.m_pParaXMesh;
if (m_MeshLODs.size() == 1)
{
// each LOD at least cut triangle count in half and no bigger than a given count. constint nLodsMaxTriangleCounts[] = { 2000, 500, 100};
for (int i = 0; pParaXMesh && i < sizeof(nLodsMaxTriangleCounts)/sizeof(int); i++)
{
if ((int)pParaXMesh->GetPolyCount() >= nLodsMaxTriangleCounts[i])
{
MeshLOD lod;
lod.m_pParaXMesh = p.ParseParaXModel(std::min(nLodsMaxTriangleCounts[i], (int)(pParaXMesh->GetObjectNum().nVertices / 2)));
lod.m_fromDepthSquared = (float)(((30+i)*30) ^ 2);
if (lod.m_pParaXMesh)
{
pParaXMesh = lod.m_pParaXMesh;
pMeshLODs.push_back(lod);
}
}
}
}
放到这里, 默认开启。
注意不需要转ParaX文件了, 直接变成1-3个内存对象即可。
The text was updated successfully, but these errors were encountered: