Mtx44 Extension

Syntax

#include <revolution/mtx/mtx44ext.h>

void MTX44Identity  ( Mtx44 m );
void MTX44Copy      ( const Mtx44 src, Mtx44 dst );

void MTX44Concat    ( const Mtx44 a, const Mtx44 b, Mtx44 ab );
void MTX44Transpose ( const Mtx44 src, Mtx44 xPose );
void MTX44Inverse   ( const Mtx44 src, Mtx44 inv );

void MTX44Trans      ( Mtx44 m, f32 xT, f32 yT, f32 zT );
void MTX44TransApply ( const Mtx44 src, Mtx44 dst, f32 xT, f32 yT, f32 zT );

void MTX44Scale      ( Mtx44 m, f32 xS, f32 yS, f32 zS );
void MTX44ScaleApply ( const Mtx44 src, Mtx44 dst, f32 xS, f32 yS, f32 zS );

void MTX44RotRad     ( Mtx44 m, char axis, f32 rad );
void MTX44RotTrig    ( Mtx44 m, char axis, f32 sinA, f32 cosA );

void MTX44RotAxisRad ( Mtx44 m, const Vec* axis, f32 rad );

void MTX44MultVec        ( const Mtx44 m, const Vec* src, Vec* dst );

void MTX44MultVecArray   ( const Mtx44 m, const Vec* srcBase, Vec* dstBase, u32 count );
void MTX44MultVecSR      ( const Mtx44 m, const Vec* src, Vec* dst );

void MTX44MultVecArraySR ( const Mtx44 m, const Vec* srcBase, Vec* dstBase, u32 count );

Description

These are extended functions for true 4x4 matrix computations that you can access by placing the additional header file, revolution/mtx/mtx44ext.h, in an include statement. We have provided the 4x4 extension functions for special-purpose uses (such as real-time patch tessellation on the CPU). If you simply want to create a transform matrix for the Broadway graphics processor, we strongly recommend that you keep using the standard 3x4 matrix functions unless you have a special reason for using the 4x4 matrix functions. This recommendation is due to the fact that there is less processing overhead than with 4x4 matrix functions.

As with standard MTX library functions, each of these extended functions has both C language and paired-single assembler versions. Non-prefixed functions (those beginning with neither C_ nor PS) are actually defined as macros for either C language or paired-single assembler functions, where the definition rules are the same as those of regular functions.

Features and arguments of each extended function are almost the same as the standard 3x4 matrix version, except for the fact that these functions use Mtx44 as the input/output matrix type instead of Mtx

Details are described below:

MTX44Identity:
Gets a 4x4 unit matrix.

MTX44Copy:
Copies all 4x4 matrix components.

MTX44Concat:
Performs true concatenation of two 4x4 matrices.

MTX44Transpose:
Performs true 4x4 matrix transposition.

MTX44Inverse:
Performs true 4x4 matrix inversion.
Note: Depending on the input values, the calculation results may not be stable. We recommend that you use the standard 3x4 matrix functions unless you have a particular reason to use the 4x4 matrix functions.

MTX44Trans:
MTX44TransApply:
MTX44Scale:
MTX44ScaleApply:
MTX44RotRad:
MTX44RotTrig:
MTX44RotAxisRad:

These functions have the same behavior as the standard 3x4 matrix functions, but set the fourth row to (0, 0, 0, 1).

MTX44MultVec:
MTX44MultVecArray:

These functions perform 4x4 matrix vs. 4D vector multiplication by assuming the implicit fourth component of the input vector as 1. After multiplication, the resulting 4D vector (x, y, z, w) is embedded into an output 3D vector by calculating (x/w, y/w, z/w).

MTX44MultVecSR:
MTX44MultVecArraySR:

These functions use only the 3x3 submatrix components for the computation so that it becomes a standard multiplication between a 3x3 matrix and 3D vector.

See Also

Mtx44
Mtx44Ptr

Revision History

2006/03/01 Initial version.


CONFIDENTIAL