Keyframe.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Keyframe.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 Microsoft.Xna.Framework;
  12. using Microsoft.Xna.Framework.Content;
  13. #endregion
  14. namespace SkinnedModel
  15. {
  16. /// <summary>
  17. /// Describes the position of a single bone at a single point in time.
  18. /// </summary>
  19. public class Keyframe
  20. {
  21. /// <summary>
  22. /// Constructs a new keyframe object.
  23. /// </summary>
  24. public Keyframe(int bone, TimeSpan time, Matrix transform)
  25. {
  26. Bone = bone;
  27. Time = time;
  28. Transform = transform;
  29. }
  30. /// <summary>
  31. /// Private constructor for use by the XNB deserializer.
  32. /// </summary>
  33. private Keyframe()
  34. {
  35. }
  36. /// <summary>
  37. /// Gets the index of the target bone that is animated by this keyframe.
  38. /// </summary>
  39. [ContentSerializer]
  40. public int Bone { get; private set; }
  41. /// <summary>
  42. /// Gets the time offset from the start of the animation to this keyframe.
  43. /// </summary>
  44. [ContentSerializer]
  45. public TimeSpan Time { get; private set; }
  46. /// <summary>
  47. /// Gets the bone transform for this keyframe.
  48. /// </summary>
  49. [ContentSerializer]
  50. public Matrix Transform { get; private set; }
  51. }
  52. }