#include <revolution/gx.h>
void GXLoadPosMtxIndx(
u16 mtxIndx,
u32 id );
| mtxIndx | Specifies the index to the matrix data in the main memory. |
|---|---|
| id | Specifies the matrix name. Can specify a value enumerated by GXPosNrmMtx. |
None.
This function loads the 3x4 matrix model view matrix indicated by the index mtxIndx from the array in main memory set by the function described next into the matrix memory location id.
GXSetArray(GX_POS_MTX_ARRAY, ...);
The applicable id memory location is described by the GXPosNrmMtx enumeration. This modelview matrix is either made the current matrix (see the GXSetCurrentMtx function), or used to transform vertex coordinates in model space to view space by setting a matrix ID for each vertex (see the GXSetVtxDesc function). The matrix will be loaded through the vertex cache.
You can also load a normal matrix (the GXLoadNrmMtxImm or GXLoadNrmMtxIndx3x3 function) to the same id. Usually the normal matrix will be the inverse transpose of the modelview matrix. The normal matrix is used for vertex lighting. In cases where the inverse transpose of the modelview and the modelview matrix are the same (excluding translation), you can load the same matrix for both the normal and the position matrix. Since indexed matrix loads are through the vertex cache, you will only incur the main memory bandwidth of one matrix load.
Be aware that the matrix is loaded directly from main memory into the matrix memory through the vertex cache, so it will not match the CPU's cache. It Is the responsibility of the application to flush any matrix data from the CPU cache (see the DCStoreRange function) before calling this function.
GXSetCurrentMtx, GXLoadNrmMtxImm, GXLoadNrmMtxIndx3x3, GXLoadPosMtxImm
2006/03/01 Initial version.
CONFIDENTIAL