ModelKeyframe.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // ModelKeyframe.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. using System;
  10. using Microsoft.Xna.Framework;
  11. using Microsoft.Xna.Framework.Content;
  12. namespace CustomModelAnimation
  13. {
  14. /// <summary>
  15. /// Describes the position of a single bone at a single point in time.
  16. /// </summary>
  17. public class ModelKeyframe
  18. {
  19. /// <summary>
  20. /// Gets the index of the target bone that is animated by this keyframe.
  21. /// </summary>
  22. [ContentSerializer]
  23. public int Bone { get; private set; }
  24. /// <summary>
  25. /// Gets the time offset from the start of the animation to this keyframe.
  26. /// </summary>
  27. [ContentSerializer]
  28. public TimeSpan Time { get; private set; }
  29. /// <summary>
  30. /// Gets the bone transform for this keyframe.
  31. /// </summary>
  32. [ContentSerializer]
  33. public Matrix Transform { get; private set; }
  34. /// <summary>
  35. /// Constructs a new ModelKeyframe object.
  36. /// </summary>
  37. public ModelKeyframe(int bone, TimeSpan time, Matrix transform)
  38. {
  39. Bone = bone;
  40. Time = time;
  41. Transform = transform;
  42. }
  43. /// <summary>
  44. /// Private constructor for use by the XNB deserializer.
  45. /// </summary>
  46. private ModelKeyframe()
  47. {
  48. }
  49. }
  50. }