MTXPush

Syntax

#include <revolution/mtx.h>

MtxPtr MTXPush ( MtxStack* sPtr, const Mtx m );

Arguments

sPtr Pointer to a MtxStack structure containing the matrix stack.
m Matrix to be copied to (stack pointer + MTX_PTR_OFFSET). m is unaltered by the push. m can be an Mtx or an MtxPtr.

Return Values

Returns a pointer to the newly pushed copy of m on the matrix stack.

Description

Copies a matrix m to the next free element of the sPtr's matrix stack.

On an empty stack, the push copies m to sPtr->stackBase and sets sPtr->stackPtr equal to sPtr->stackBase. On an active stack, the push copies m 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.

If a push causes stack overflow, ASSERTMSG is triggered.

See Also

Mtx, MtxPtr, MtxStack, MtxStackPtr, MTXPop, MTXPushFwd, MTXPushInv, MTXPushInvXpose

Revision History

2006/03/01 Initial version.


CONFIDENTIAL