ModelAnimationClip.cs 1.6 KB

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