1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<TITLE>MTXPushInv</TITLE>
9</HEAD>
10<BODY>
11<H1>MTXPushInv</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/mtx.h&gt;
16
17MtxPtr MTXPushInv ( MtxStack* sPtr, const Mtx m );
18</pre></dd></dl>
19
20<H2>Arguments</H2>
21<TABLE class="arguments" border="1" >
22  <TBODY>
23    <TR>
24<TH>sPtr</TH>
25<TD>The <A href="../structures/MtxStack_MtxStackPtr.html"><CODE>MtxStack</CODE></A> structure including the inverse matrix stack.</TD>
26    </TR>
27    <TR>
28<TH>m</TH>
29<TD>Source matrix used to calculate the inverse matrix and join from the beginning of the matrix stack. <code><em><strong>m</strong></em></code> is not altered by this processing. <SPAN class="argument">m</SPAN> can be an <A href="../structures/Mtx_MtxPtr.html"><CODE>Mtx</CODE></a> or an <A href="../structures/Mtx_MtxPtr.html"><CODE>MtxPtr</CODE></a>.</TD>
30    </TR>
31  </TBODY>
32</TABLE>
33
34<H2>Return Values</H2>
35<P>Returns a pointer to the matrix generated as a result of pushing in the reverse direction.</P>
36
37<H2>Description</H2>
38<P>Computes the inverse of <SPAN class="argument">m</SPAN>, pre-concatenates the result with <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackPtr</STRONG></CODE>, and then pushes the result to (<SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackPtr</STRONG> + MTX_PTR_OFFSET</CODE>). <code><em><strong>m</strong></em></code> is not altered by this function; the inverse of <code><em><strong>m</strong></em></code> is computed as a temporary local variable.</P>
39<P>For an empty stack, this function simply copies the inverse of <SPAN class="argument">m</SPAN> to <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackBase</STRONG></CODE> and sets <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackPtr</STRONG></CODE> equal to <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackBase</STRONG></CODE>. For an active stack, the inverse of <SPAN class="argument">m</SPAN> is multiplied by <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackPtr</STRONG></CODE> and the result is copied to <SPAN class="argument">sPtr</SPAN><CODE><STRONG>-&gt;stackPtr</STRONG> + MTX_PTR_OFFSET</CODE>.</P>
40<P>This operation is equivalent to the following:</P>
41<dl><dd><pre class="construction">
42<A href="../general/MTXCopy.html">MTXCopy</A>( m, mTmp );
43<A href="../general/MTXInverse.html">MTXInverse</A>( mTmp, mTmp );
44<A href="../general/MTXConcat.html">MTXConcat</A>( mTmp, sPtr-&gt;stackPtr, ( sPtr-&gt;stackPtr + MTX_PTR_OFFSET );
45</pre></dd></dl>
46<P><code>MTXPushInv</code> is intended to create an inverse transformation stack in parallel with a forward transformation stack.&nbsp;This is why the order of multiplication is pre-order, that is, the opposite of <a href="MTXPushFwd.html"><code>MTXPushFwd</code></a>'s.&nbsp;</P>
47<P>Using this function allows composite transform matrices in both the forward and reverse direction to be generated by simply copying each transform matrix. These can be used to efficiently detect collisions by having objects go back and forth in the local space.</P>
48<P>If the result of <code>MTXPushInv</code> causes stack overflow, <a href="../../os/Error/ASSERTMSG.html"><code>ASSERTMSG</code></a> is triggered.</P>
49
50<H2>See Also</H2>
51<P class="reference">
52<A href="../../os/Error/ASSERTMSG.html">ASSERTMSG</A>,
53<A href="../structures/Mtx_MtxPtr.html">Mtx, MtxPtr</A>,
54<A href="../structures/MtxStack_MtxStackPtr.html">MtxStack, MtxStackPtr</A>,
55<A href="../general/MTXConcat.html">MTXConcat</A>,
56<A href="../general/MTXInverse.html">MTXInverse</A>,
57<A href="MTXPop.html">MTXPop</A>,
58<A href="MTXPush.html">MTXPush</A>,
59<A href="MTXPushFwd.html">MTXPushFwd</A>,
60<A href="MTXPushInvXpose.html">MTXPushInvXpose</A>
61</P>
62
63<H2>Revision History</H2>
64<P>
652006/03/01 Initial version.<br>
66</P>
67
68<hr><p>CONFIDENTIAL</p></body>
69</HTML>