/// <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); } }
/// <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); } }
/// <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 ); } } }
/// <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 ); } }
/// <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); } }