// MonoGame - Copyright (C) The MonoGame Team // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Microsoft.Xna.Framework.Content.Pipeline.Graphics { /// /// Provides methods and properties for managing a keyframe. A keyframe describes the position of an animation channel at a single point in time. /// public sealed class AnimationKeyframe : IComparable { TimeSpan time; Matrix transform; /// /// Gets the time offset from the start of the animation to the position described by this keyframe. /// public TimeSpan Time { get { return time; } } /// /// Gets or sets the position described by this keyframe. /// public Matrix Transform { get { return transform; } set { transform = value; } } /// /// Initializes a new instance of AnimationKeyframe with the specified time offsetand transform. /// /// Time offset of the keyframe. /// Position of the keyframe. public AnimationKeyframe(TimeSpan time, Matrix transform) { this.time = time; this.transform = transform; } /// /// Compares this instance of a keyframe to another. /// /// Keyframe being compared to. /// Indication of their relative values. public int CompareTo(AnimationKeyframe other) { // No sense in comparing the transform, so compare the time. // This would be used for sorting keyframes in time order. return time.CompareTo(other.time); } } }