AnimationClip.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // AnimationClip.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using Microsoft.Xna.Framework.Content;
  13. #endregion
  14. namespace SkinnedModel
  15. {
  16. /// <summary>
  17. /// An animation clip is the runtime equivalent of the
  18. /// Microsoft.Xna.Framework.Content.Pipeline.Graphics.AnimationContent type.
  19. /// It holds all the keyframes needed to describe a single animation.
  20. /// </summary>
  21. public class AnimationClip
  22. {
  23. /// <summary>
  24. /// Constructs a new animation clip object.
  25. /// </summary>
  26. public AnimationClip(TimeSpan duration, List<Keyframe> keyframes)
  27. {
  28. Duration = duration;
  29. Keyframes = keyframes;
  30. }
  31. /// <summary>
  32. /// Private constructor for use by the XNB deserializer.
  33. /// </summary>
  34. private AnimationClip()
  35. {
  36. }
  37. /// <summary>
  38. /// Gets the total length of the animation.
  39. /// </summary>
  40. [ContentSerializer]
  41. public TimeSpan Duration { get; private set; }
  42. /// <summary>
  43. /// Gets a combined list containing all the keyframes for all bones,
  44. /// sorted by time.
  45. /// </summary>
  46. [ContentSerializer]
  47. public List<Keyframe> Keyframes { get; private set; }
  48. }
  49. }