#include <revolution/mtx.h>
MtxPtr MTXPushFwd( MtxStack* sPtr, const Mtx m );
sPtr |
Pointer to a MtxStack structure containing the matrix stack. |
m |
Matrix to post-concatenate with the current top of stack. m may be either an Mtx or an MtxPtr. |
Returns the stack pointer after the push operation.
Creates a forward composite transformation matrix on the stack.
On an empty stack, the function copies m to sPtr->stackBase and sets sPtr->stackPtr equal to sPtr->stackBase. On an active stack, the push multiplies sPtr->stackPtr x m and places the result to sPtr->stackPtr + MTX_PTR_OFFSET. Matrices below this location are unaffected. After the push, the stack pointer is incremented by MTX_PTR_OFFSET to point to the newly pushed copy of m.
This operation is equivalent to the following:
MTXConcat( sPtr->stackPtr, m, ( sPtr->stackPtr + MTX_PTR_OFFSET) );
Concatenation is post-order to facilitate the creation of forward transformation matrices on the stack. This means that matrices should be pushed in the opposite order of the desired transformation.
When the result of MTXPushFwd causes a stack overflow, ASSERTMSG is executed.
ASSERTMSG, Mtx, MtxPtr, MtxStack, MtxStackPtr, MTXConcat, MTXPop, MTXPush, MTXPushInv, MTXPushInvXpose
03/01/2006 Initial version.