Axiom.Core.Node.MakeTransform C# (CSharp) Method

MakeTransform() protected method

Internal method for building a Matrix4 from orientation / scale / position.
Transform is performed in the order scale, rotate, translation, i.e. translation is independent of orientation axes, scale does not affect size of translation, rotation and scaling are always centered on the origin.
protected MakeTransform ( Vector3 position, Vector3 scale, Axiom.MathLib.Quaternion orientation, Axiom.MathLib.Matrix4 &destMatrix ) : void
position Vector3
scale Vector3
orientation Axiom.MathLib.Quaternion
destMatrix Axiom.MathLib.Matrix4
return void
		protected void MakeTransform( Vector3 position, Vector3 scale, Quaternion orientation, ref Matrix4 destMatrix )
		{
			// Ordering:
			//    1. Scale
			//    2. Rotate
			//    3. Translate

			// Parent scaling is already applied to derived position
			// Own scale is applied before rotation
			Matrix3 rot3x3;
			Matrix3 scale3x3;
			rot3x3 = orientation.ToRotationMatrix();
			scale3x3 = Matrix3.Zero;
			scale3x3.m00 = scale.x;
			scale3x3.m11 = scale.y;
			scale3x3.m22 = scale.z;

			destMatrix = rot3x3 * scale3x3;
			destMatrix.Translation = position;
		}