/// <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; }
/// <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; }
/// <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; }
/// <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 ) { }
/// <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; }
/// <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 ) { }
/// <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; }
/// <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) { }
/// <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) { }
/// <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; }
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; } } }
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; } } }
protected void AddKey(AnimationTrack track, float time, Vector3 translate) { TransformKeyFrame key = (TransformKeyFrame)track.CreateKeyFrame(time); key.Translate = translate; }