MTXPushFwd

C Specification

#include <revolution/mtx.h>
MtxPtr MTXPushFwd( MtxStack* sPtr, const Mtx m );

Arguments

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.

Return Values

Returns the stack pointer after the push operation.

Description

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.

See Also

ASSERTMSG, Mtx, MtxPtr, MtxStack, MtxStackPtr, MTXConcat, MTXPop, MTXPush, MTXPushInv, MTXPushInvXpose

Revision History

03/01/2006 Initial version.