Repository navigation
Transform.cs
This class holds all the data required to create a world transform (matrix) used to define an objects position, scale and rotation in world space.
The idea for this came from my use of Unity3D, I dare say, other engines utilize a similar mechanic when dealing with object to world transforms. The idea with this is that it makes it easy to set object as parent transforms for a given object, that is to say, using this mechanic it is easy to stick mesh's (models) together linked via a hierarchy of transforms.
For example, you may want to attach a light to the end of a shot gun, simply set the lights parent transform to that of the shotgun and give it a local position to situate it at the end of the weapon.
Properties that have been denoted as public scope.
This is the global scale of the object.
This is the scale of the object in relation to the parent objects transform.
The 2D representation of Scale
The 2D representation of LocalScale
This is the global position of the object.
The 2D representation of Position
The 2D representation of LocalPosition
This is the position of the object in relation to the parent objects transform.
This is the global rotation of the object.
This is the rotation of the object in relation to the parent objects transform/
This is the objects world matrix.
This is the parent object that has a Transform class.
This is the default constructor for the class, when called scale is set to Vector3.One, position set to Vector3.Zero, rotation set to Quaternion.Identity and parent set to null.
The World Matrix is not calculated until this method is called, this should be called within the IHasTransform's Update(GameTime gameTime) method.
This returns a newly constructed instance of the Transform class.