Axiom.Math.Matrix4.Decompose C# (CSharp) Метод

Decompose() публичный Метод

Decompose the matrix.
public Decompose ( Vector3 &translation, Vector3 &scale, Quaternion &orientation ) : void
translation Vector3
scale Vector3
orientation Quaternion
Результат void
		public void Decompose( out Vector3 translation, out Vector3 scale, out Quaternion orientation )
		{
			scale = Vector3.UnitScale;
			Matrix3 rotation = Matrix3.Identity;
			Vector3 axis = Vector3.Zero;

			axis.x = this.m00;
			axis.y = this.m10;
			axis.z = this.m20;
			scale.x = axis.Normalize(); // Normalize() returns the vector's length before it was normalized
			rotation.m00 = axis.x;
			rotation.m10 = axis.y;
			rotation.m20 = axis.z;

			axis.x = this.m01;
			axis.y = this.m11;
			axis.z = this.m21;
			scale.y = axis.Normalize();
			rotation.m01 = axis.x;
			rotation.m11 = axis.y;
			rotation.m21 = axis.z;

			axis.x = this.m02;
			axis.y = this.m12;
			axis.z = this.m22;
			scale.z = axis.Normalize();
			rotation.m02 = axis.x;
			rotation.m12 = axis.y;
			rotation.m22 = axis.z;

			orientation = Quaternion.FromRotationMatrix( rotation );
			translation = this.Translation;
		}