MTXPushFwd

Syntax

#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 can be 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 to sPtr->stackBase. For an active stack, the push multiplies sPtr->stackPtr and m, and places the result in 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.

If the result of MTXPushFwd causes stack overflow, ASSERTMSG is triggered.

See Also

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

Revision History

2006/03/01 Initial version.


CONFIDENTIAL