class
Matrix4x4
Matrix4x4 is used to represent and manipulate 4x4 transformation matrices, which can be either standard matrices, or homogeneous 4x4 matrices used to transform 3D homogeneous coordinates [x y z w]. The transformations are defined in row-major order.
See also: ReMath
Properties
Property | Description |
Name | The name of the Matrix4x4 object. (Inherited from Object) |
Methods
Method | Description |
AddObserver | Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object) |
DeepCopy | Copies the contents of an input matrix to the current matrix. |
Determinant3x3 | Returns the top 3x3 determinant. |
Direction3ArrayMultiply | Multiply in-place an array with 3D direction vectors [x y z 0]. |
GetClass | Get the name of the Matrix4x4 class. (Inherited from Object) |
GetElement | Get a matrix element. |
GetElements | The elements of the matrix. |
Identity | Set the matrix to the identity matrix. |
Invert | Invert the current matrix. |
IsA | Returns true if Matrix4x4 is a or is a descendant of the class named as the type parameter. (Inherited from Object) |
IsNull | Returns true if the Matrix4x4 object is invalid. (Inherited from Object) |
IsSameObjectAs | Returns true if the Matrix4x4 object is valid. (Inherited from Object) |
NonNull | Returns true if the Matrix4x4 object is valid. (Inherited from Object) |
Point3ArrayMultiply | Multiply in-place an array with 3D points [x y z 1]. |
PrintInfo | Prints the content/info of the Matrix4x4 object to the log. (Inherited from Object) |
RemoveObserver | Removes a previously added observer object. (Inherited from Object) |
SetElement | Set a matrix element. |
SetToInvert | The matrix to the invert of the input matrix. |
SetToRotationTransform | Creates a 3D rotation in a homogeneous transformation 4x4 matrix around the specified axis. |
SetToScalingTransform | Creates a 3D scaling in a homogeneous transformation 4x4 matrix. |
SetToTranslationTransform | Creates a 3D translation in a homogeneous 4x4 matrix. |
SetToTranspose | The matrix to the transpose of the input matrix. |
Transpose | Transpose the current matrix. |
Vector4ArrayMultiply | Multiply in-place an array with full 4D vectors [x y z w]. |
Zero | Set the matrix to the zero matrix (all zeros). |
Static methods
Method | Description |
IsClassA | Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object) |
SafeCast | SafeCast makes sure the input object is of a class that can be cast into spMatrix4x4, and if this is the case, returns the object cast into spMatrix4x4. (Inherited from Object) |
Properties details
Name
The name of the Matrix4x4 object. (Inherited from Object)
Syntax
SetName parameters
Type | Name | Min | Max | Description |
const char * | name | | | New name of the object. |
GetName return value
Type: spString
Syntax
SetName parameters
Type | Name | Min | Max | Description |
string | name | | | New name of the object. |
GetName return value
Type: string
Syntax
SetName parameters
Name | Type | Min | Max | Description |
name | str | | | New name of the object. |
GetName return value
Type: str
Methods details
AddObserver
Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Observer | observer | | | Observer is the object that will receive events. |
Return value
Type: rid
Syntax
Parameters
Type | Name | Min | Max | Description |
Observer | observer | | | Observer is the object that will receive events. |
Return value
Type: int
Syntax
Parameters
Name | Type | Min | Max | Description |
observer | Observer | | | Observer is the object that will receive events. |
Return value
Type: int
DeepCopy
Copies the contents of an input matrix to the current matrix.
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The source matrix. |
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The source matrix. |
Syntax
Parameters
Name | Type | Min | Max | Description |
mtxin | Matrix4x4 | | | The source matrix. |
Determinant3x3
Returns the top 3x3 determinant.
Syntax
Parameters
Determinant3x3 takes no parameters.
Return value
Type: real
Syntax
Parameters
Determinant3x3 takes no parameters.
Return value
Type: float
Syntax
Parameters
Determinant3x3 takes no parameters.
Return value
Type: float
Direction3ArrayMultiply
Multiply in-place an array with 3D direction vectors [x y z 0].
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Name | Type | Min | Max | Description |
vecarray | RealArray | | | The vectors to be multiplied and written to. |
GetClass
Get the name of the Matrix4x4 class. (Inherited from Object)
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: spString
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: string
Syntax
Parameters
GetClass takes no parameters.
Return value
Type: str
GetElement
Get a matrix element.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | column | | | The column index. |
unsigned int | row | | | The row index. |
Return value
Type: real
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | column | | | The column index. |
uint | row | | | The row index. |
Return value
Type: float
Syntax
Parameters
Name | Type | Min | Max | Description |
column | int | | | The column index. |
row | int | | | The row index. |
Return value
Type: float
GetElements
The elements of the matrix.
Syntax
Parameters
GetElements takes no parameters.
Return value
Type: spRealData
Syntax
Parameters
GetElements takes no parameters.
Return value
Type: spRealData
Syntax
Parameters
GetElements takes no parameters.
Return value
Type: list[float]
Identity
Set the matrix to the identity matrix.
Syntax
Parameters
Identity takes no parameters.
Syntax
Parameters
Identity takes no parameters.
Syntax
Parameters
Identity takes no parameters.
Invert
Invert the current matrix.
Syntax
Parameters
Invert takes no parameters.
Syntax
Parameters
Invert takes no parameters.
Syntax
Parameters
Invert takes no parameters.
IsA
Returns true if Matrix4x4 is a or is a descendant of the class named as the type parameter. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if Matrix4x4 is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if Matrix4x4 is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if Matrix4x4 is, or is a descendant of. |
Return value
Type: bool
IsNull
Returns true if the Matrix4x4 object is invalid. (Inherited from Object)
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
IsNull takes no parameters.
Return value
Type: bool
IsSameObjectAs
Returns true if the Matrix4x4 object is valid. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to compare with. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to compare with. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to compare with. |
Return value
Type: bool
NonNull
Returns true if the Matrix4x4 object is valid. (Inherited from Object)
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
Syntax
Parameters
NonNull takes no parameters.
Return value
Type: bool
Point3ArrayMultiply
Multiply in-place an array with 3D points [x y z 1].
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Name | Type | Min | Max | Description |
vecarray | RealArray | | | The vectors to be multiplied and written to. |
PrintInfo
Prints the content/info of the Matrix4x4 object to the log. (Inherited from Object)
Syntax
Parameters
PrintInfo takes no parameters.
Syntax
Parameters
PrintInfo takes no parameters.
Syntax
Parameters
PrintInfo takes no parameters.
RemoveObserver
Removes a previously added observer object. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
rid | observerId | | | ObserverId is the id returned by AddObserver when the observer was added. |
Syntax
Parameters
Type | Name | Min | Max | Description |
int | observerId | | | ObserverId is the id returned by AddObserver when the observer was added. |
Syntax
Parameters
Name | Type | Min | Max | Description |
observerId | int | | | ObserverId is the id returned by AddObserver when the observer was added. |
SetElement
Set a matrix element.
Syntax
Parameters
Type | Name | Min | Max | Description |
unsigned int | column | | | The column index. |
unsigned int | row | | | The row index. |
real | value | | | The value to which the element will be set. |
Syntax
Parameters
Type | Name | Min | Max | Description |
uint | column | | | The column index. |
uint | row | | | The row index. |
float | value | | | The value to which the element will be set. |
Syntax
Parameters
Name | Type | Min | Max | Description |
column | int | | | The column index. |
row | int | | | The row index. |
value | float | | | The value to which the element will be set. |
SetToInvert
The matrix to the invert of the input matrix.
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The input matrix. |
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The input matrix. |
Syntax
Parameters
Name | Type | Min | Max | Description |
mtxin | Matrix4x4 | | | The input matrix. |
Creates a 3D rotation in a homogeneous transformation 4x4 matrix around the specified axis.
Syntax
Parameters
Type | Name | Min | Max | Description |
real | angle | | | The angle. |
real | ax | | | The x component of the rotation axis. |
real | ay | | | The y component of the rotation axis. |
real | az | | | The z component of the rotation axis. |
Syntax
Parameters
Type | Name | Min | Max | Description |
float | angle | | | The angle. |
float | ax | | | The x component of the rotation axis. |
float | ay | | | The y component of the rotation axis. |
float | az | | | The z component of the rotation axis. |
Syntax
Parameters
Name | Type | Min | Max | Description |
angle | float | | | The angle. |
ax | float | | | The x component of the rotation axis. |
ay | float | | | The y component of the rotation axis. |
az | float | | | The z component of the rotation axis. |
Creates a 3D scaling in a homogeneous transformation 4x4 matrix.
Syntax
Parameters
Type | Name | Min | Max | Description |
real | sx | | | The x component of the scaling. |
real | sy | | | The y component of the scaling. |
real | sz | | | The z component of the scaling. |
Syntax
Parameters
Type | Name | Min | Max | Description |
float | sx | | | The x component of the scaling. |
float | sy | | | The y component of the scaling. |
float | sz | | | The z component of the scaling. |
Syntax
Parameters
Name | Type | Min | Max | Description |
sx | float | | | The x component of the scaling. |
sy | float | | | The y component of the scaling. |
sz | float | | | The z component of the scaling. |
Creates a 3D translation in a homogeneous 4x4 matrix.
Syntax
Parameters
Type | Name | Min | Max | Description |
real | tx | | | The x component of the scaling. |
real | ty | | | The y component of the scaling. |
real | tz | | | The z component of the scaling. |
Syntax
Parameters
Type | Name | Min | Max | Description |
float | tx | | | The x component of the scaling. |
float | ty | | | The y component of the scaling. |
float | tz | | | The z component of the scaling. |
Syntax
Parameters
Name | Type | Min | Max | Description |
tx | float | | | The x component of the scaling. |
ty | float | | | The y component of the scaling. |
tz | float | | | The z component of the scaling. |
SetToTranspose
The matrix to the transpose of the input matrix.
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The input matrix. |
Syntax
Parameters
Type | Name | Min | Max | Description |
Matrix4x4 | mtxin | | | The input matrix. |
Syntax
Parameters
Name | Type | Min | Max | Description |
mtxin | Matrix4x4 | | | The input matrix. |
Transpose
Transpose the current matrix.
Syntax
Parameters
Transpose takes no parameters.
Syntax
Parameters
Transpose takes no parameters.
Syntax
Parameters
Transpose takes no parameters.
Vector4ArrayMultiply
Multiply in-place an array with full 4D vectors [x y z w].
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Type | Name | Min | Max | Description |
RealArray | vecarray | | | The vectors to be multiplied and written to. |
Syntax
Parameters
Name | Type | Min | Max | Description |
vecarray | RealArray | | | The vectors to be multiplied and written to. |
Zero
Set the matrix to the zero matrix (all zeros).
Syntax
Parameters
Zero takes no parameters.
Syntax
Parameters
Zero takes no parameters.
Syntax
Parameters
Zero takes no parameters.
Static methods details
IsClassA
Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
const char * | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Type | Name | Min | Max | Description |
string | type | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
Syntax
Parameters
Name | Type | Min | Max | Description |
type | str | | | Name of the class to check if the class is, or is a descendant of. |
Return value
Type: bool
SafeCast
SafeCast makes sure the input object is of a class that can be cast into spMatrix4x4, and if this is the case, returns the object cast into spMatrix4x4. (Inherited from Object)
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Matrix4x4
Syntax
Parameters
Type | Name | Min | Max | Description |
Object | object | | | Object to cast. |
Return value
Type: Matrix4x4
Syntax
Parameters
Name | Type | Min | Max | Description |
object | Object | | | Object to cast. |
Return value
Type: Matrix4x4