public void AddEntity( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale )
{
Mesh msh = ent.Mesh;
// Validate
if ( msh.IsLodManual )
LogManager.Instance.Write(
"WARNING (StaticGeometry): Manual LOD is not supported. " +
"Using only highest LOD level for mesh " + msh.Name );
// queue this entities submeshes and choice of material
// also build the lists of geometry to be used for the source of lods
foreach ( SubEntity se in ent.SubEntities )
{
QueuedSubMesh q = new QueuedSubMesh();
// Get the geometry for this SubMesh
q.submesh = se.SubMesh;
q.geometryLodList = DetermineGeometry( q.submesh );
q.materialName = se.MaterialName;
q.orientation = orientation;
q.position = position;
q.scale = scale;
// Determine the bounds based on the highest LOD
q.worldBounds = CalculateBounds( q.geometryLodList[ 0 ].vertexData, position, orientation, scale );
queuedSubMeshes.Add( q );
}
}