PageRenderTime 29ms CodeModel.GetById 24ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Rendering/Models/Bone.cs

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