SIMatrix4.Invert

Description

Inverts the matrix m and stores the result in this matrix: this = m^-1

C# Syntax

Int32 SIMatrix4.Invert( SIMatrix4 in_pMatrix );

Scripting Syntax

oBoolean = SIMatrix4.Invert( m );

Return Value

Boolean True if the matrix m has been inverted (m is not singular); otherwise False.

Parameters

Parameter Type Description
m SIMatrix4 Matrix operand

Examples

VBScript Example

'
' This example demonstrates how to set up a 4x4 matrix, 
' invert it and then trap whether the inversion was
' successful
'
' Create 4x4 matrices
dim m1 : set m1 = XSIMath.CreateMatrix4(_
	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)
dim m2 : set m2 = XSIMath.CreateMatrix4
' Make the second matrix the inversion of the first
if m2.Invert(m1) then
	Application.LogMessage "Success :-D"
else
	Application.LogMessage "Failure :-("
end if
' Expected result:
' INFO : Success :-D

See Also

SIMatrix4.InvertInPlace SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion