A 'track' in an animation sequence, ie a sequence of keyframes which affect a certain type of object that can be animated.
This class is intended as a base for more complete classes which will actually animate specific types of object, e.g. a bone in a skeleton to affect skeletal animation. An animation will likely include multiple tracks each of which can be made up of many KeyFrame instances. Note that the use of tracks allows each animable object to have it's own number of keyframes, i.e. you do not have to have the maximum number of keyframes for all animable objects just to cope with the most animated one.

Since the most common animable object is a Node, there are options in this class for associating the track with a Node which will receive keyframe updates automatically when the 'apply' method is called.

コード例 #1
0
ファイル: KeyFrame.cs プロジェクト: axiom3d/axiom
 /// <summary>
 ///		Creates a new keyframe with the specified time.
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public TransformKeyFrame(AnimationTrack parent, float time)
     : base(parent, time)
 {
     this.translate = new Vector3();
     this.scale     = Vector3.UnitScale;
     this.rotation  = Quaternion.Identity;
 }
コード例 #2
0
 /// <summary>
 ///		Creates a new keyframe with the specified time.
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public TransformKeyFrame(AnimationTrack parent, float time) : base(parent, time)
 {
     translate.x = 0f;
     translate.y = 0f;
     translate.z = 0f;
     scale.x     = 1f;
     scale.y     = 1f;
     scale.z     = 1f;
     rotation.w  = 1f;
     rotation.x  = 1f;
     rotation.y  = 1f;
     rotation.z  = 1f;
 }
コード例 #3
0
ファイル: KeyFrame.cs プロジェクト: WolfgangSt/axiom
		/// <summary>
		///		Creates a new keyframe with the specified time.  
		///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
		/// </summary>
		/// <param name="parent">Animation track that this keyframe belongs to.</param>
		/// <param name="time">Time at which this keyframe begins.</param>
		public KeyFrame( AnimationTrack parent, float time )
		{
			this.parentTrack = parent;
			this.time = time;
		}
コード例 #4
0
ファイル: KeyFrame.cs プロジェクト: WolfgangSt/axiom
		/// <summary>
		///		Creates a new keyframe with the specified time.  
		///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
		/// </summary>
		/// <param name="parent">Animation track that this keyframe belongs to.</param>
		/// <param name="time">Time at which this keyframe begins.</param>
		public VertexPoseKeyFrame( AnimationTrack parent, float time )
			: base( parent, time )
		{
		}
コード例 #5
0
ファイル: KeyFrame.cs プロジェクト: WolfgangSt/axiom
		/// <summary>
		///		Creates a new keyframe with the specified time.  
		///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
		/// </summary>
		/// <param name="parent">Animation track that this keyframe belongs to.</param>
		/// <param name="time">Time at which this keyframe begins.</param>
		public TransformKeyFrame( AnimationTrack parent, float time )
			: base( parent, time )
		{
			translate = new Vector3();
			scale = Vector3.UnitScale;
			rotation = Quaternion.Identity;
		}
コード例 #6
0
ファイル: KeyFrame.cs プロジェクト: WolfgangSt/axiom
		/// <summary>
		///		Creates a new keyframe with the specified time.  
		///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
		/// </summary>
		/// <param name="parent">Animation track that this keyframe belongs to.</param>
		/// <param name="time">Time at which this keyframe begins.</param>
		public NumericKeyFrame( AnimationTrack parent, float time )
			: base( parent, time )
		{
		}
コード例 #7
0
ファイル: KeyFrame.cs プロジェクト: axiom3d/axiom
 /// <summary>
 ///		Creates a new keyframe with the specified time.
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public KeyFrame(AnimationTrack parent, float time)
 {
     this.parentTrack = parent;
     this.time        = time;
 }
コード例 #8
0
ファイル: KeyFrame.cs プロジェクト: axiom3d/axiom
 /// <summary>
 ///		Creates a new keyframe with the specified time.
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public VertexPoseKeyFrame(AnimationTrack parent, float time)
     : base(parent, time)
 {
 }
コード例 #9
0
ファイル: KeyFrame.cs プロジェクト: axiom3d/axiom
 /// <summary>
 ///		Creates a new keyframe with the specified time.
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public NumericKeyFrame(AnimationTrack parent, float time)
     : base(parent, time)
 {
 }
コード例 #10
0
 /// <summary>
 ///		Creates a new keyframe with the specified time.  
 ///		Should really be created by <see cref="AnimationTrack.CreateKeyFrame"/> instead.
 /// </summary>
 /// <param name="parent">Animation track that this keyframe belongs to.</param>
 /// <param name="time">Time at which this keyframe begins.</param>
 public TransformKeyFrame(AnimationTrack parent, float time)
     : base(parent, time)
 {
     translate.x = 0f;
     translate.y = 0f;
     translate.z = 0f;
     scale.x = 1f;
     scale.y = 1f;
     scale.z = 1f;
     rotation.w = 1f;
     rotation.x = 1f;
     rotation.y = 1f;
     rotation.z = 1f;
 }
コード例 #11
0
 protected void ReadKeyFrames(XmlNode node, AnimationTrack track)
 {
     foreach (XmlNode childNode in node.ChildNodes) {
         switch (childNode.Name) {
             case "keyframe":
                 ReadKeyFrame(childNode, track);
                 break;
             default:
                 DebugMessage(childNode);
                 break;
         }
     }
 }
コード例 #12
0
        protected void ReadKeyFrame(XmlNode node, AnimationTrack track)
        {
            float time = float.Parse(node.Attributes["time"].Value);
            // create a new keyframe with the specified length
            TransformKeyFrame keyFrame = (TransformKeyFrame)track.CreateKeyFrame(time);

            foreach (XmlNode childNode in node.ChildNodes) {
                switch (childNode.Name) {
                    case "translate":
                        keyFrame.Translate = ReadVector3(childNode);
                        break;
                    case "rotate":
                        ReadRotate(childNode, keyFrame);
                        break;
                    default:
                        DebugMessage(childNode);
                        break;
                }
            }
        }
コード例 #13
0
 protected void AddKey(AnimationTrack track, float time, Vector3 translate)
 {
     TransformKeyFrame key = (TransformKeyFrame)track.CreateKeyFrame(time);
     key.Translate = translate;
 }