/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
- using Delta.Utilities.Datatypes;
-
- namespace Delta.Rendering.Models
- {
- /// <summary>
- /// Bone class for skinned mesh animations.
- /// </summary>
- public class Bone
- {
- #region Name (Public)
- /// <summary>
- /// The name of the bone as loaded from the model file. This info is
- /// useful to relate the bone with the naming that artists give.
- /// </summary>
- public string Name
- {
- get;
- private set;
- }
- #endregion
-
- #region Parent (Public)
- /// <summary>
- /// Parent bone, very important to get all parent matrices when
- /// building the finalMatrix for rendering.
- /// </summary>
- public Bone Parent
- {
- get;
- private set;
- }
- #endregion
-
- #region InitialMatrix (Public)
- /// <summary>
- /// Initial matrix we get from loading the model, it contains
- /// the start position and is used for the calculation to get the
- /// absolute and final matrices (see below).
- /// </summary>
- public Matrix InitialMatrix
- {
- get;
- private set;
- }
- #endregion
-
- #region Constructors
- /// <summary>
- /// Create bone
- /// </summary>
- /// <param name="setParentBone">The set parent bone.</param>
- /// <param name="setMatrix">The set matrix.</param>
- /// <param name="setName">Name of the set.</param>
- public Bone(Bone setParentBone, Matrix setMatrix, string setName)
- {
- InitialMatrix = setMatrix;
- Parent = setParentBone;
- Name = setName;
- }
- #endregion
-
- #region ToString (Public)
- /// <summary>
- /// To string, useful for debugging and testing.
- /// </summary>
- /// <returns>
- /// A <see cref="System.String"/> that represents this instance.
- /// </returns>
- public override string ToString()
- {
- return "Bone: Name=" + Name;
- }
- #endregion
- }
- }
-