Axiom.Core.StaticGeometry.AddEntity C# (CSharp) Method

AddEntity() public method

Adds an Entity to the static geometry.
This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this StaticGeometry if you like. The Entity passed in is simply used as a definition. Note: Must be called before 'build'.
public AddEntity ( Entity ent, Vector3 position, Axiom.MathLib.Quaternion orientation, Vector3 scale ) : void
ent Entity The Entity to use as a definition (the Mesh and Materials
position Vector3 The world position at which to add this Entity
orientation Axiom.MathLib.Quaternion The world orientation at which to add this Entity
scale Vector3 The scale at which to add this entity
return void
		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 );
			}
		}