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

GetAllAnimationStates() public method

For entities based on animated meshes, gets the AnimationState object for a single animation.
You animate an entity by updating the animation state objects. Each of these represents the current state of each animation available to the entity. The AnimationState objects are initialized from the Mesh object.
public GetAllAnimationStates ( ) : Axiom.Animating.AnimationStateSet
return Axiom.Animating.AnimationStateSet
		public AnimationStateSet GetAllAnimationStates()
		{
			return this.animationState;
		}

Usage Example

		///<summary>
		///  Adds an Entity to the static geometry.
		///  <remarks>
		///    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 InstancedGeometry if you like. The Entity passed in is simply Must be called before 'Build'.
		///  </remarks>
		///</summary>
		///<param name="ent"> The Entity to use as a definition (the Mesh and Materials referenced will be recorded for the build call). </param>
		///<param name="position"> The world position at which to add this Entity </param>
		///<param name="orientation"> The world orientation at which to add this Entity </param>
		///<param name="scale"> </param>
		public virtual void AddEntity( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale )
		{
			Mesh msh = ent.Mesh;

			// Validate
			if ( msh.IsLodManual )
			{
				LogManager.Instance.Write(
					"(InstancedGeometry): Manual LOD is not supported. Using only highest LOD level for mesh " + msh.Name );
			}

			//get the skeleton of the entity, if that's not already done
			if ( ent.Mesh.Skeleton != null && mBaseSkeleton == null )
			{
				mBaseSkeleton = ent.Mesh.Skeleton;
				mSkeletonInstance = new SkeletonInstance( mBaseSkeleton );
				mSkeletonInstance.Load();
				mAnimationState = ent.GetAllAnimationStates();
			}

			BoundingBox sharedWorldBounds;
			// queue this entities submeshes and choice of material
			// also build the lists of geometry to be used for the source of lods


			for ( int i = 0; i < ent.SubEntityCount; ++i )
			{
				SubEntity se = ent.GetSubEntity( i );
				var 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;
				q.ID = mObjectCount;
			}

			mObjectCount++;
		}