SIMatrix4.InvertInPlace

Description

Inverts this matrix (if not singular): this = this^-1

C# Syntax

Int32 SIMatrix4.InvertInPlace();

Scripting Syntax

oBoolean = SIMatrix4.InvertInPlace();

Return Value

Boolean True if this matrix has been inverted (not singular); otherwise False.

Examples

JScript Example

/*

	This example demonstrates how to set up a 4x4 matrix, 

	invert it and then trap whether the inversion was

	successful

*/

// Create 4x4 matrices

var aValues = new Array(

	2.0, 3.0, 0.0, 0.0, 

	1.0, 4.0, 0.0, 0.0,

	0.0, 0.0, 1.0, 0.0,

	0.0, 0.0, 0.0, 1.0

);

var m1 = XSIMath.CreateMatrix4(aValues);

var m2 = XSIMath.CreateMatrix4();

// Make the second matrix the inversion of the first

if ( m2.InvertInPlace() ) {

	Application.LogMessage( "Success :-D" );

} else {

	Application.LogMessage( "Failure :-(" );

}

// Expected result:

// INFO : Success :-D

See Also

SIMatrix4.Invert SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion