예제 #1
0
 /// <summary>
 ///    Initialize an animation set suitable for use with this mesh.
 /// </summary>
 /// <remarks>
 ///    Only recommended for use inside the engine, not by applications.
 /// </remarks>
 /// <param name="animSet"></param>
 public virtual void InitAnimationState(AnimationStateSet animSet)
 {
     animSet.RemoveAllAnimationStates();
     foreach (var anim in this.animationList.Values)
     {
         animSet.CreateAnimationState(anim.Name, 0, anim.Length);
     }
 }
예제 #2
0
        /// <summary>
        ///    Initialise an animation set suitable for use with this mesh.
        /// </summary>
        /// <remarks>
        ///    Only recommended for use inside the engine, not by applications.
        /// </remarks>
        /// <param name="animSet"></param>
        public virtual void InitAnimationState(AnimationStateSet animSet)
        {
            animSet.RemoveAllAnimationStates();

            // loop through all the internal animations and add new animation states to the passed in
            // collection
            for (int i = 0; i < animationList.Count; i++)
            {
                Animation anim = animationList[i];

                animSet.CreateAnimationState(anim.Name, 0, anim.Length);
            }
        }
예제 #3
0
파일: Mesh.cs 프로젝트: ryan-bunker/axiom3d
		/// <summary>
		///    Initialize an animation set suitable for use with this mesh.
		/// </summary>
		/// <remarks>
		///    Only recommended for use inside the engine, not by applications.
		/// </remarks>
		/// <param name="animSet"></param>
		public void InitAnimationState( AnimationStateSet animSet )
		{
			//             Debug.Assert(skeleton != null, "Skeleton not present.");

			if ( HasSkeleton )
			{
				// delegate the animation set to the skeleton
				this._skeleton.InitAnimationState( animSet );

				// Take the opportunity to update the compiled bone assignments
				if ( this.boneAssignmentsOutOfDate )
				{
					CompileBoneAssignments();
				}

				// compile bone assignments for each sub mesh
				for ( var i = 0; i < this._subMeshList.Count; i++ )
				{
					var subMesh = this._subMeshList[ i ];

					if ( subMesh.boneAssignmentsOutOfDate )
					{
						subMesh.CompileBoneAssignments();
					}
				} // for
			}

			// Animation states for vertex animation
			foreach ( var animation in this._animationsList.Values )
			{
				// Only create a new animation state if it doesn't exist
				// We can have the same named animation in both skeletal and vertex
				// with a shared animation state affecting both, for combined effects
				// The animations should be the same length if this feature is used!
				if ( !HasAnimationState( animSet, animation.Name ) )
				{
					animSet.CreateAnimationState( animation.Name, 0.0f, animation.Length );
				}
			}
		}
예제 #4
0
		/// <summary>
		///    Initialize an animation set suitable for use with this mesh.
		/// </summary>
		/// <remarks>
		///    Only recommended for use inside the engine, not by applications.
		/// </remarks>
		/// <param name="animSet"></param>
		public virtual void InitAnimationState( AnimationStateSet animSet )
		{
			animSet.RemoveAllAnimationStates();
			foreach ( var anim in this.animationList.Values )
			{
				animSet.CreateAnimationState( anim.Name, 0, anim.Length );
			}
		}
예제 #5
0
        /// <summary>
        ///    Initialise an animation set suitable for use with this mesh. 
        /// </summary>
        /// <remarks>
        ///    Only recommended for use inside the engine, not by applications.
        /// </remarks>
        /// <param name="animSet"></param>
        public virtual void InitAnimationState(AnimationStateSet animSet)
        {
            animSet.RemoveAllAnimationStates();

            // loop through all the internal animations and add new animation states to the passed in
            // collection
            for(int i = 0; i < animationList.Count; i++) {
                Animation anim = animationList[i];

                animSet.CreateAnimationState(anim.Name, 0, anim.Length);
            }
        }