PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Rendering/Models/Bone.cs

#
C# | 76 lines | 42 code | 6 blank | 28 comment | 0 complexity | d147a02d7e1f16a3151a1f584349d7f3 MD5 | raw file
Possible License(s): Apache-2.0
  1. using Delta.Utilities.Datatypes;
  2. namespace Delta.Rendering.Models
  3. {
  4. /// <summary>
  5. /// Bone class for skinned mesh animations.
  6. /// </summary>
  7. public class Bone
  8. {
  9. #region Name (Public)
  10. /// <summary>
  11. /// The name of the bone as loaded from the model file. This info is
  12. /// useful to relate the bone with the naming that artists give.
  13. /// </summary>
  14. public string Name
  15. {
  16. get;
  17. private set;
  18. }
  19. #endregion
  20. #region Parent (Public)
  21. /// <summary>
  22. /// Parent bone, very important to get all parent matrices when
  23. /// building the finalMatrix for rendering.
  24. /// </summary>
  25. public Bone Parent
  26. {
  27. get;
  28. private set;
  29. }
  30. #endregion
  31. #region InitialMatrix (Public)
  32. /// <summary>
  33. /// Initial matrix we get from loading the model, it contains
  34. /// the start position and is used for the calculation to get the
  35. /// absolute and final matrices (see below).
  36. /// </summary>
  37. public Matrix InitialMatrix
  38. {
  39. get;
  40. private set;
  41. }
  42. #endregion
  43. #region Constructors
  44. /// <summary>
  45. /// Create bone
  46. /// </summary>
  47. /// <param name="setParentBone">The set parent bone.</param>
  48. /// <param name="setMatrix">The set matrix.</param>
  49. /// <param name="setName">Name of the set.</param>
  50. public Bone(Bone setParentBone, Matrix setMatrix, string setName)
  51. {
  52. InitialMatrix = setMatrix;
  53. Parent = setParentBone;
  54. Name = setName;
  55. }
  56. #endregion
  57. #region ToString (Public)
  58. /// <summary>
  59. /// To string, useful for debugging and testing.
  60. /// </summary>
  61. /// <returns>
  62. /// A <see cref="System.String"/> that represents this instance.
  63. /// </returns>
  64. public override string ToString()
  65. {
  66. return "Bone: Name=" + Name;
  67. }
  68. #endregion
  69. }
  70. }