Axiom.Core.Entity.BuildSubEntities C# (CSharp) Method

BuildSubEntities() protected method

Used to build a list of sub-entities from the meshes located in the mesh.
protected BuildSubEntities ( ) : void
return void
		protected void BuildSubEntities()
		{
			// loop through the models meshes and create sub entities from them
			for ( int i = 0; i < this.mesh.SubMeshCount; i++ )
			{
				SubMesh subMesh = this.mesh.GetSubMesh( i );
				SubEntity sub = new SubEntity();
				sub.Parent = this;
				sub.SubMesh = subMesh;

				if ( subMesh.IsMaterialInitialized )
				{
					sub.MaterialName = subMesh.MaterialName;
				}

				this.subEntityList.Add( sub );
			}
		}