Keyframe.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #endregion
  13. namespace SkinnedModel
  14. {
  15. /// <summary>
  16. /// Describes the position of a single bone at a single point in time.
  17. /// </summary>
  18. public class Keyframe
  19. {
  20. #region Fields
  21. int boneValue;
  22. TimeSpan timeValue;
  23. Matrix transformValue;
  24. #endregion
  25. /// <summary>
  26. /// Constructs a new keyframe object.
  27. /// </summary>
  28. public Keyframe(int bone, TimeSpan time, Matrix transform)
  29. {
  30. boneValue = bone;
  31. timeValue = time;
  32. transformValue = transform;
  33. }
  34. /// <summary>
  35. /// Gets the index of the target bone that is animated by this keyframe.
  36. /// </summary>
  37. public int Bone
  38. {
  39. get { return boneValue; }
  40. }
  41. /// <summary>
  42. /// Gets the time offset from the start of the animation to this keyframe.
  43. /// </summary>
  44. public TimeSpan Time
  45. {
  46. get { return timeValue; }
  47. }
  48. /// <summary>
  49. /// Gets the bone transform for this keyframe.
  50. /// </summary>
  51. public Matrix Transform
  52. {
  53. get { return transformValue; }
  54. }
  55. }
  56. }