Axiom.Math.Matrix4.operator C# (CSharp) Method

operator() public static method

Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.

This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

public static operator ( ) : Vector3
return Vector3
		public static Vector3 operator *( Matrix4 matrix, Vector3 vector )
		{
			Vector3 result = new Vector3();

			Real inverseW = 1.0f / ( matrix.m30 * vector.x + matrix.m31 * vector.y + matrix.m32 * vector.z + matrix.m33 );

			result.x = ( ( matrix.m00 * vector.x ) + ( matrix.m01 * vector.y ) + ( matrix.m02 * vector.z ) + matrix.m03 ) * inverseW;
			result.y = ( ( matrix.m10 * vector.x ) + ( matrix.m11 * vector.y ) + ( matrix.m12 * vector.z ) + matrix.m13 ) * inverseW;
			result.z = ( ( matrix.m20 * vector.x ) + ( matrix.m21 * vector.y ) + ( matrix.m22 * vector.z ) + matrix.m23 ) * inverseW;

			return result;
		}

Same methods

Matrix4::operator ( ) : Matrix4
Matrix4::operator ( ) : Plane
Matrix4::operator ( ) : bool