diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02851.html | 4409 |
1 files changed, 4409 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02851.html b/docs/doxygen/nel/a02851.html new file mode 100644 index 00000000..9e438d39 --- /dev/null +++ b/docs/doxygen/nel/a02851.html @@ -0,0 +1,4409 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLMISC::CMatrix class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CMatrix Class Reference</h1><code>#include <<a class="el" href="a05973.html">matrix.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A 4*4 Homogenous Matrix. This is a column matrix, so operations like: <code>v1=A*B*C*v0</code>; applies C first , then B, then A to vector v0. <br> + Since it is a column matrix, the first column is the I vector of the base, 2nd is J, 3th is K. <br> + 4th column vector is T, the translation vector.<p> +Angle orientation are: Xaxis: YtoZ. Yaxis: ZtoX. Zaxis: XtoY.<p> +This matrix keep a matrix state to improve Matrix, vector and plane computing (matrix inversion, vector multiplication...). The internal matrix know if:<ul> +<li>matrix is identity</li><li>matrix has a translation component</li><li>matrix has a rotation component</li><li>matrix has a uniform scale component (scale which is the same along the 3 axis)</li><li>matrix has a non-uniform scale component</li><li>matrix has a projection component (4th line of the matrix is not 0 0 0 1).</li></ul> +<p> +An example of improvement is that CMatrix::operator*(const CVector &v) return v if the matrix is identity.<p> +By default, a matrix is identity. But for a performance view, this is just a StateBit=0... <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00066">66</a> of file <a class="el" href="a05973.html">matrix.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> { <br> + <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>, +<a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>, +<a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>, +<a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>, +<br> + <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>, +<a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a> +<br> + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Rotation Order. <a href="#NLMISC_1_1CMatrixw0">More...</a><br><br></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td colspan="2"><div class="groupHeader">Object</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1959_0">CMatrix</a> (const <a class="el" href="a02851.html">CMatrix</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy Constructor. <a href="#NLMISC_1_1CMatrixz1959_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1959_1">CMatrix</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor which init to <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity()</a>. <a href="#NLMISC_1_1CMatrixz1959_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1959_2">operator=</a> (const <a class="el" href="a02851.html">CMatrix</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">operator=. <a href="#NLMISC_1_1CMatrixz1959_2"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Gets.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const float * </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_0">get</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_1">get</a> (float m44[16]) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_2">getI</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the I vector of the Rotation/Scale matrix (base). <a href="#NLMISC_1_1CMatrixz1963_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_3">getJ</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the J vector of the Rotation/Scale matrix (base). <a href="#NLMISC_1_1CMatrixz1963_3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_4">getK</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the K vector of the Rotation/Scale matrix (base). <a href="#NLMISC_1_1CMatrixz1963_4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03128.html">CVector</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_5">getPos</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_6">getPos</a> (<a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_7">getProj</a> (float proj[4]) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03296.html">CQuat</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_8">getRot</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_9">getRot</a> (<a class="el" href="a03296.html">CQuat</a> &quat) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_10">getRot</a> (float m33[9]) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1963_11">getRot</a> (<a class="el" href="a03128.html">CVector</a> &i, <a class="el" href="a03128.html">CVector</a> &j, <a class="el" href="a03128.html">CVector</a> &k) const </td></tr> + +<tr><td colspan="2"><div class="groupHeader">Misc</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_0">getScaleUniform</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true the uniform scale. valid only if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform()</a> is true, else 1 is returned. <a href="#NLMISC_1_1CMatrixz1970_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_1">hasProjectionPart</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true if the matrix has a projection part (by <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_5">setProj()</a>, by multiplication etc...) <a href="#NLMISC_1_1CMatrixz1970_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_2">hasScalePart</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true if the matrix has a scale part (by <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_6">scale()</a>, by multiplication etc...) <a href="#NLMISC_1_1CMatrixz1970_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_2">hasScalePart()</a> and if if this scale is uniform. <a href="#NLMISC_1_1CMatrixz1970_3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_4">serial</a> (<a class="el" href="a02270.html">IStream</a> &f)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true the uniform scale. valid only if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform()</a> is true, else 1 is returned. <a href="#NLMISC_1_1CMatrixz1970_4"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Sets</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Reset the matrix to identity. <a href="#NLMISC_1_1CMatrixz1961_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_1">movePos</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_2">resetProj</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_3">set</a> (const float m44[16])</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_4">setPos</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_5">setProj</a> (const float proj[4])</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_6">setRot</a> (const <a class="el" href="a02851.html">CMatrix</a> &<a class="el" href="a04223.html#a578">matrix</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_7">setRot</a> (const <a class="el" href="a03296.html">CQuat</a> &quat)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_8">setRot</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> ro)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_9">setRot</a> (const float m33[9], bool hintNoScale=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_10">setRot</a> (const <a class="el" href="a03128.html">CVector</a> &i, const <a class="el" href="a03128.html">CVector</a> &j, const <a class="el" href="a03128.html">CVector</a> &k, bool hintNoScale=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_11">setScale</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_12">setScale</a> (float scale)</td></tr> + +<tr><td colspan="2"><div class="groupHeader">Matrix Operations.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_0">invert</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_1">inverted</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_2">normalize</a> (<a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> pref)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_3">operator *</a> (const <a class="el" href="a02851.html">CMatrix</a> &<a class="el" href="a04223.html#a647">in</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Matrix multiplication. <a href="#NLMISC_1_1CMatrixz1967_3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02851.html">CMatrix</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_4">operator *=</a> (const <a class="el" href="a02851.html">CMatrix</a> &<a class="el" href="a04223.html#a647">in</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">equivalent to M=M*in <a href="#NLMISC_1_1CMatrixz1967_4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_5">setMulMatrix</a> (const <a class="el" href="a02851.html">CMatrix</a> &m1, const <a class="el" href="a02851.html">CMatrix</a> &m2)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_6">setMulMatrixNoProj</a> (const <a class="el" href="a02851.html">CMatrix</a> &m1, const <a class="el" href="a02851.html">CMatrix</a> &m2)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_7">transpose</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_8">transpose3x3</a> ()</td></tr> + +<tr><td colspan="2"><div class="groupHeader"></div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1968_0">mulPoint</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply a point. ie <a class="el" href="a04223.html#a575">v.w</a>=1 so the Translation component do affect result. Projection doesn't affect result. <a href="#NLMISC_1_1CMatrixz1968_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1968_1">mulVector</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply a normal. ie <a class="el" href="a04223.html#a575">v.w</a>=0 so the Translation component doesn't affect result. Projection doesn't affect result. <a href="#NLMISC_1_1CMatrixz1968_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03668.html">CVectorH</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1968_2">operator *</a> (const <a class="el" href="a03668.html">CVectorH</a> &<a class="el" href="a04223.html#a576">v</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply with an homogenous vector. <a href="#NLMISC_1_1CMatrixz1968_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1968_3">operator *</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Multiply a point. mulPoint. <a href="#NLMISC_1_1CMatrixz1968_3"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">3D Operations.</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_0">rotate</a> (const <a class="el" href="a03296.html">CQuat</a> &quat)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_1">rotate</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> ro)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a> (float a)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a> (float a)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a> (float a)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_5">scale</a> (const <a class="el" href="a03128.html">CVector</a> &scale)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply a non-uniform scale to the matrix. <a href="#NLMISC_1_1CMatrixz1965_5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_6">scale</a> (float f)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply a uniform scale to the matrix. <a href="#NLMISC_1_1CMatrixz1965_6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_7">translate</a> (const <a class="el" href="a03128.html">CVector</a> &<a class="el" href="a04223.html#a576">v</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Apply a translation to the matrix. same as M=M*T. <a href="#NLMISC_1_1CMatrixz1965_7"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02851.html">CMatrix</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixs0">Identity</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The identity matrix. Same as <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1959_1">CMatrix()</a>. <a href="#NLMISC_1_1CMatrixs0"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd0">fastInvert33</a> (<a class="el" href="a02851.html">CMatrix</a> &ret) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd1">getCofactIndex</a> (<a class="el" href="a04558.html#a14">sint</a> i, <a class="el" href="a04558.html#a14">sint</a> &l1, <a class="el" href="a04558.html#a14">sint</a> &l2, <a class="el" href="a04558.html#a14">sint</a> &l3) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd2">hasAll</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const float & </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd6">mat</a> (<a class="el" href="a04558.html#a14">sint</a> i, <a class="el" href="a04558.html#a14">sint</a> j) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float & </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a> (<a class="el" href="a04558.html#a14">sint</a> i, <a class="el" href="a04558.html#a14">sint</a> j)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd8">setScaleUni</a> (float scale)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd9">slowInvert33</a> (<a class="el" href="a02851.html">CMatrix</a> &ret) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd10">slowInvert44</a> (<a class="el" href="a02851.html">CMatrix</a> &ret) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a> () const </td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixr0">M</a> [16]</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a></td></tr> + +<tr><td colspan=2><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03082.html">CPlane</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02851.html#NLMISC_1_1CMatrixn0">operator *</a> (const <a class="el" href="a03082.html">CPlane</a> &p, const <a class="el" href="a02851.html">CMatrix</a> &m)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Plane (line vector) multiplication. <a href="#NLMISC_1_1CMatrixn0"></a><br><br></td></tr> +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NLMISC_1_1CMatrixw0" doxytag="NLMISC::CMatrix::TRotOrder" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> enum <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">NLMISC::CMatrix::TRotOrder</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Rotation Order. +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1" doxytag="XYZ" ></a>XYZ</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2" doxytag="XZY" ></a>XZY</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3" doxytag="YXZ" ></a>YXZ</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4" doxytag="YZX" ></a>YZX</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5" doxytag="ZXY" ></a>ZXY</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6" doxytag="ZYX" ></a>ZYX</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a05973.html#l00070">70</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +<div class="fragment"><pre>00071 { +00072 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>, +00073 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>, +00074 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>, +00075 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>, +00076 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>, +00077 <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a> +00078 }; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CMatrixz1959_1" doxytag="NLMISC::CMatrix::CMatrix" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CMatrix::CMatrix </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor which init to <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity()</a>. +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00088">88</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00089 { +00090 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= 0; +00091 <span class="comment">// Init just Pos because must always be valid for faster getPos()</span> +00092 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[12]= <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[13]= M[14]= 0; +00093 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1959_0" doxytag="NLMISC::CMatrix::CMatrix" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CMatrix::CMatrix </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Copy Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00163">163</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +<div class="fragment"><pre>00164 { +00165 (*this)= m; +00166 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CMatrixd0" doxytag="NLMISC::CMatrix::fastInvert33" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::fastInvert33 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>ret</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00969">969</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01090">inverted()</a>. +<p> +<div class="fragment"><pre>00970 { +00971 <span class="comment">// Fast invert of 3x3 rot matrix.</span> +00972 <span class="comment">// Work if no scale and if MAT_SCALEUNI. doesn't work if MAT_SCALEANY.</span> +00973 +00974 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>) +00975 { +00976 <span class="keywordtype">double</span> <a class="code" href="a04223.html#a626">s</a>,S; <span class="comment">// important for precision.</span> +00977 <span class="comment">// Must divide the matrix by 1/Scale 2 times, to set unit, and to have a Scale=1/Scale.</span> +00978 S=1.0/<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00979 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= (<span class="keywordtype">float</span>)S; +00980 <a class="code" href="a04223.html#a626">s</a>=S*S; +00981 <span class="comment">// The matrix is a base, so just transpose it.</span> +00982 ret.a11= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a6">a11</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a12= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a7">a21</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a13= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a8">a31</a>*<a class="code" href="a04223.html#a626">s</a>); +00983 ret.a21= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a11">a12</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a22= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a12">a22</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a23= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a13">a32</a>*<a class="code" href="a04223.html#a626">s</a>); +00984 ret.a31= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a16">a13</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a32= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a17">a23</a>*<a class="code" href="a04223.html#a626">s</a>); ret.a33= (<span class="keywordtype">float</span>)(<a class="code" href="a04734.html#a18">a33</a>*<a class="code" href="a04223.html#a626">s</a>); +00985 } +00986 <span class="keywordflow">else</span> +00987 { +00988 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>=1; +00989 <span class="comment">// The matrix is a base, so just transpose it.</span> +00990 ret.a11= <a class="code" href="a04734.html#a6">a11</a>; ret.a12= <a class="code" href="a04734.html#a7">a21</a>; ret.a13=<a class="code" href="a04734.html#a8">a31</a>; +00991 ret.a21= <a class="code" href="a04734.html#a11">a12</a>; ret.a22= <a class="code" href="a04734.html#a12">a22</a>; ret.a23=<a class="code" href="a04734.html#a13">a32</a>; +00992 ret.a31= <a class="code" href="a04734.html#a16">a13</a>; ret.a32= <a class="code" href="a04734.html#a17">a23</a>; ret.a33=<a class="code" href="a04734.html#a18">a33</a>; +00993 } +00994 +00995 <span class="comment">// 15 cycles if no scale.</span> +00996 <span class="comment">// 35 cycles if scale.</span> +00997 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_0" doxytag="NLMISC::CMatrix::get" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const float * NLMISC::CMatrix::get </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get 4*4 matrix. <dl compact><dt><b>Returns:</b></dt><dd>the matrix's 4*4 column matrix (4x4 matrix stored in column-major order as 16 consecutive values)</dd></dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00451">451</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00149">testExpandProj()</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +<div class="fragment"><pre>00452 { +00453 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00454 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +00455 <span class="keywordflow">return</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>; +00456 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_1" doxytag="NLMISC::CMatrix::get" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::get </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>m44</em>[16] </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get 4*4 matrix. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>m44</em> </td><td>the matrix's 4*4 column matrix (4x4 matrix stored in column-major order as 16 consecutive values)</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00443">443</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00149">testExpandProj()</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a05935.html#l00359">NL3D::CLodCharacterManager::addRenderCharacterKey()</a>, <a class="el" href="a05647.html#l00179">NL3D::CDriverGL::cleanLightSetup()</a>, <a class="el" href="a05649.html#l00156">NL3D::CDriverGL::doRefreshRenderSetup()</a>, <a class="el" href="a05975.html#l00059">NL3D::CMatrix3x4::set()</a>, <a class="el" href="a05656.html#l01366">NL3D::CDriverGL::setConstantMatrix()</a>, <a class="el" href="a05648.html#l00985">NL3D::CDriverGL::setupSpecularBegin()</a>, and <a class="el" href="a05648.html#l00160">NL3D::CDriverGL::setupUserTextureMatrix()</a>. +<p> +<div class="fragment"><pre>00444 { +00445 <span class="comment">// \todo yoyo: TODO_OPTIMIZE_it.</span> +00446 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00447 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +00448 memcpy(m44, M, 16*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00449 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd1" doxytag="NLMISC::CMatrix::getCofactIndex" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getCofactIndex </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>i</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td> + <td class="mdname" nowrap> <em>l1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td> + <td class="mdname" nowrap> <em>l2</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td> + <td class="mdname" nowrap> <em>l3</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00372">372</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05981.html#l00104">sint</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01032">slowInvert44()</a>. +<p> +<div class="fragment"><pre>00373 { +00374 <span class="keywordflow">switch</span>(i) +00375 { +00376 <span class="keywordflow">case</span> 0: l1=1; l2=2; l3=3; <span class="keywordflow">break</span>; +00377 <span class="keywordflow">case</span> 1: l1=0; l2=2; l3=3; <span class="keywordflow">break</span>; +00378 <span class="keywordflow">case</span> 2: l1=0; l2=1; l3=3; <span class="keywordflow">break</span>; +00379 <span class="keywordflow">case</span> 3: l1=0; l2=1; l3=2; <span class="keywordflow">break</span>; +00380 } +00381 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_2" doxytag="NLMISC::CMatrix::getI" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::getI </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the I vector of the Rotation/Scale matrix (base). +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00419">419</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01428">a31</a>, and <a class="el" href="a05972.html#l00117">hasRot()</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06370.html#l00098">NL3D::CShadowMap::buildClipInfoFromMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a06246.html#l00612">NL3D::CPSLocated::computeI()</a>, <a class="el" href="a06259.html#l00057">NL3D::CPlaneBasis::CPlaneBasis()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a06285.html#l00212">NL3D::CPSUtil::displayBasis()</a>, <a class="el" href="a06285.html#l00351">NL3D::CPSUtil::displayCylinder()</a>, <a class="el" href="a06285.html#l00332">NL3D::CPSUtil::displayDisc()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a06768.html#l00920">NL3D::CZoneLighter::light()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>, <a class="el" href="a06287.html#l01409">NL3D::CPSZoneRectangle::setMatrix()</a>, <a class="el" href="a06287.html#l01198">NL3D::CPSZoneCylinder::setMatrix()</a>, <a class="el" href="a06229.html#l02321">NL3D::CPSEmitterRectangle::setMatrix()</a>, <a class="el" href="a06287.html#l00140">NL3D::CPSZonePlane::show()</a>, <a class="el" href="a05972.html#l00999">slowInvert33()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, <a class="el" href="a05712.html#l00063">NL3D::CFlareModel::traverseRender()</a>, <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>, and <a class="el" href="a06260.html#l00331">NL3D::CSpinnerFunctor::updateSamples()</a>. +<p> +<div class="fragment"><pre>00420 { +00421 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00422 <span class="keywordflow">return</span> CVector(a11, a21, a31); +00423 <span class="keywordflow">else</span> +00424 <span class="keywordflow">return</span> CVector(1, 0, 0); +00425 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_3" doxytag="NLMISC::CMatrix::getJ" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::getJ </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the J vector of the Rotation/Scale matrix (base). +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00427">427</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01434">a32</a>, and <a class="el" href="a05972.html#l00117">hasRot()</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06370.html#l00098">NL3D::CShadowMap::buildClipInfoFromMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a06246.html#l00643">NL3D::CPSLocated::computeJ()</a>, <a class="el" href="a06259.html#l00057">NL3D::CPlaneBasis::CPlaneBasis()</a>, <a class="el" href="a06700.html#l00041">NL3D::CVegetableQuadrant::CVegetableQuadrant()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a06285.html#l00212">NL3D::CPSUtil::displayBasis()</a>, <a class="el" href="a06285.html#l00351">NL3D::CPSUtil::displayCylinder()</a>, <a class="el" href="a06285.html#l00332">NL3D::CPSUtil::displayDisc()</a>, <a class="el" href="a06142.html#l01073">NL3D::CParticleSystem::getLOD()</a>, <a class="el" href="a06142.html#l01040">NL3D::CParticleSystem::getLODVect()</a>, <a class="el" href="a06493.html#l00150">NL3D::CTessFacePriorityList::init()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a06768.html#l00920">NL3D::CZoneLighter::light()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06306.html#l00817">NL3D::CQuadTree< T >::selectRay()</a>, <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>, <a class="el" href="a06287.html#l01409">NL3D::CPSZoneRectangle::setMatrix()</a>, <a class="el" href="a06287.html#l01198">NL3D::CPSZoneCylinder::setMatrix()</a>, <a class="el" href="a06229.html#l02321">NL3D::CPSEmitterRectangle::setMatrix()</a>, <a class="el" href="a06287.html#l00140">NL3D::CPSZonePlane::show()</a>, <a class="el" href="a05972.html#l00999">slowInvert33()</a>, <a class="el" href="a06182.html#l00084">NL3D::CPointLightModel::traverseLight()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, <a class="el" href="a05712.html#l00063">NL3D::CFlareModel::traverseRender()</a>, <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>, and <a class="el" href="a06260.html#l00331">NL3D::CSpinnerFunctor::updateSamples()</a>. +<p> +<div class="fragment"><pre>00428 { +00429 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00430 <span class="keywordflow">return</span> CVector(a12, a22, a32); +00431 <span class="keywordflow">else</span> +00432 <span class="keywordflow">return</span> CVector(0, 1, 0); +00433 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_4" doxytag="NLMISC::CMatrix::getK" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::getK </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the K vector of the Rotation/Scale matrix (base). +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00435">435</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01440">a33</a>, and <a class="el" href="a05972.html#l00117">hasRot()</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06370.html#l00098">NL3D::CShadowMap::buildClipInfoFromMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a06246.html#l00674">NL3D::CPSLocated::computeK()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a06285.html#l00212">NL3D::CPSUtil::displayBasis()</a>, <a class="el" href="a06285.html#l00351">NL3D::CPSUtil::displayCylinder()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06306.html#l00817">NL3D::CQuadTree< T >::selectRay()</a>, <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>, <a class="el" href="a06287.html#l00659">NL3D::CPSZoneDisc::setMatrix()</a>, <a class="el" href="a06287.html#l00288">NL3D::CPSZonePlane::setMatrix()</a>, <a class="el" href="a06239.html#l00926">NL3D::CPSCylindricVortex::setMatrix()</a>, <a class="el" href="a05972.html#l00999">slowInvert33()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, <a class="el" href="a05712.html#l00063">NL3D::CFlareModel::traverseRender()</a>, and <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>. +<p> +<div class="fragment"><pre>00436 { +00437 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00438 <span class="keywordflow">return</span> CVector(a13, a23, a33); +00439 <span class="keywordflow">else</span> +00440 <span class="keywordflow">return</span> CVector(0, 0, 1); +00441 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_5" doxytag="NLMISC::CMatrix::getPos" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a03128.html">CVector</a>& NLMISC::CMatrix::getPos </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Translation component. NB: a const & works because it is a column vector <dl compact><dt><b>Returns:</b></dt><dd>the matrix's translation vector.</dd></dl> + +<p> +Definition at line <a class="el" href="a05973.html#l00203">203</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +<div class="fragment"><pre>00203 {<span class="keywordflow">return</span> *(CVector*)(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>+12);} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_6" doxytag="NLMISC::CMatrix::getPos" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getPos </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Translation component. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>v</em> </td><td>the matrix's translation vector.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05973.html#l00198">198</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05646.html#l00237">v</a>. +<p> +Referenced by <a class="el" href="a05901.html#l00151">NL3D::CLightingManager::addDynamicLight()</a>, <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a05935.html#l00359">NL3D::CLodCharacterManager::addRenderCharacterKey()</a>, <a class="el" href="a06370.html#l00098">NL3D::CShadowMap::buildClipInfoFromMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a06741.html#l00695">NL3D::CWaveMakerShape::clip()</a>, <a class="el" href="a06570.html#l00141">NL3D::CTransformShape::clip()</a>, <a class="el" href="a05714.html#l00120">NL3D::CFlareShape::clip()</a>, <a class="el" href="a05555.html#l00532">NL3D::CClipTrav::clipSkeletonShadowMaps()</a>, <a class="el" href="a05491.html#l00155">NL3D::CBone::compute()</a>, <a class="el" href="a06393.html#l00972">NL3D::CSkeletonModel::computeDisplayLodCharacterPriority()</a>, <a class="el" href="a06372.html#l00595">NL3D::CShadowMapManager::computeShadowDirection()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a06285.html#l00212">NL3D::CPSUtil::displayBasis()</a>, <a class="el" href="a06737.html#l01170">NL3D::CWaterModel::doSimpleRender()</a>, <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>, <a class="el" href="a06393.html#l01781">NL3D::CSkeletonModel::generateShadowMap()</a>, <a class="el" href="a06737.html#l00127">NL3D::CWaterModel::getAttenuatedHeight()</a>, <a class="el" href="a06570.html#l00316">NL3D::CTransformShape::getLightHotSpotInWorld()</a>, <a class="el" href="a06393.html#l01722">NL3D::CSkeletonModel::getLightHotSpotInWorld()</a>, <a class="el" href="a06142.html#l01073">NL3D::CParticleSystem::getLOD()</a>, <a class="el" href="a06142.html#l01040">NL3D::CParticleSystem::getLODVect()</a>, <a class="el" href="a06722.html#l00081">NL3D::CViewport::getRayWithPoint()</a>, <a class="el" href="a05686.html#l00341">NL3D::CEvent3dMouseListener::getViewMatrix()</a>, <a class="el" href="a06047.html#l00043">H_AUTO_DECL()</a>, <a class="el" href="a05901.html#l00231">NL3D::CLightingManager::insertStaticLightedModel()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a06142.html#l01337">NL3D::CParticleSystem::interpolateFXPosDelta()</a>, <a class="el" href="a06142.html#l01344">NL3D::CParticleSystem::interpolateUserPosDelta()</a>, <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06287.html#l00329">NL3D::CPSZoneSphere::performMotion()</a>, <a class="el" href="a06148.html#l00328">NL3D::CParticleSystemModel::refreshRscDeletion()</a>, <a class="el" href="a06393.html#l01295">NL3D::CSkeletonModel::renderCLod()</a>, <a class="el" href="a06393.html#l02062">NL3D::CSkeletonModel::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a06001.html#l00367">NL3D::CMeshInstance::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a06372.html#l00445">NL3D::CShadowMapManager::renderProject()</a>, <a class="el" href="a06372.html#l00880">NL3D::CShadowMapManager::selectShadowMapsToGenerate()</a>, <a class="el" href="a06287.html#l01409">NL3D::CPSZoneRectangle::setMatrix()</a>, <a class="el" href="a06287.html#l01198">NL3D::CPSZoneCylinder::setMatrix()</a>, <a class="el" href="a06287.html#l00659">NL3D::CPSZoneDisc::setMatrix()</a>, <a class="el" href="a06287.html#l00467">NL3D::CPSZoneSphere::setMatrix()</a>, <a class="el" href="a06287.html#l00288">NL3D::CPSZonePlane::setMatrix()</a>, <a class="el" href="a06239.html#l00926">NL3D::CPSCylindricVortex::setMatrix()</a>, <a class="el" href="a06229.html#l02511">NL3D::CPSSphericalEmitter::setMatrix()</a>, <a class="el" href="a06229.html#l02321">NL3D::CPSEmitterRectangle::setMatrix()</a>, <a class="el" href="a06142.html#l00225">NL3D::CParticleSystem::setNumTris()</a>, <a class="el" href="a06142.html#l00942">NL3D::CParticleSystem::setSysMat()</a>, <a class="el" href="a05649.html#l00124">NL3D::CDriverGL::setupModelMatrix()</a>, <a class="el" href="a06142.html#l00954">NL3D::CParticleSystem::setUserMatrix()</a>, <a class="el" href="a06142.html#l00362">NL3D::CParticleSystem::step()</a>, <a class="el" href="a06329.html#l00089">NL3D::CRenderTrav::traverse()</a>, <a class="el" href="a06737.html#l00998">NL3D::CWaveMakerModel::traverseAnimDetail()</a>, <a class="el" href="a06393.html#l00658">NL3D::CSkeletonModel::traverseAnimDetail()</a>, <a class="el" href="a06148.html#l00726">NL3D::CParticleSystemModel::traverseClip()</a>, <a class="el" href="a06570.html#l00274">NL3D::CTransformShape::traverseLoadBalancingPass0()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, <a class="el" href="a05712.html#l00063">NL3D::CFlareModel::traverseRender()</a>, <a class="el" href="a06583.html#l00122">NL3D::CTravCameraScene::update()</a>, <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>, and <a class="el" href="a06142.html#l00324">NL3D::CParticleSystem::updateLODRatio()</a>. +<p> +<div class="fragment"><pre>00198 {<a class="code" href="a04223.html#a576">v</a>.x= <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[12]; <a class="code" href="a04223.html#a576">v</a>.y= <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[13]; <a class="code" href="a04223.html#a576">v</a>.z= <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[14];} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_7" doxytag="NLMISC::CMatrix::getProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getProj </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>proj</em>[4] </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Projection component. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>proj</em> </td><td>the matrix's projection vector.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00401">401</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, and <a class="el" href="a05972.html#l00125">hasProj()</a>. +<p> +<div class="fragment"><pre>00402 { +00403 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00404 { +00405 proj[0]= <a class="code" href="a04734.html#a9">a41</a>; +00406 proj[1]= <a class="code" href="a04734.html#a14">a42</a>; +00407 proj[2]= <a class="code" href="a04734.html#a19">a43</a>; +00408 proj[3]= <a class="code" href="a04734.html#a24">a44</a>; +00409 } +00410 <span class="keywordflow">else</span> +00411 { +00412 proj[0]= 0; +00413 proj[1]= 0; +00414 proj[2]= 0; +00415 proj[3]= 1; +00416 } +00417 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_8" doxytag="NLMISC::CMatrix::getRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03296.html">CQuat</a> NLMISC::CMatrix::getRot </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Rotation matrix (base). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>quat</em> </td><td>the return quaternion.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05973.html#l00194">194</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +<div class="fragment"><pre>00194 {CQuat ret; <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_8">getRot</a>(ret); <span class="keywordflow">return</span> ret;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_9" doxytag="NLMISC::CMatrix::getRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03296.html">CQuat</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>quat</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Rotation matrix (base). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>quat</em> </td><td>the return quaternion.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l01386">1386</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05973.html#l00362">mat()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05646.html#l01001">q</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::w</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::x</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::y</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::z</a>, and <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a>. +<p> +<div class="fragment"><pre>01387 { +01388 <span class="keyword">const</span> <a class="code" href="a02851.html">CMatrix</a> *pmat= <span class="keyword">this</span>; +01389 <a class="code" href="a02851.html">CMatrix</a> MatNormed; +01390 +01391 +01392 <span class="comment">// Rot Indentity?</span> +01393 <span class="keywordflow">if</span>(! (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a1">MAT_ROT</a>)) +01394 { +01395 quat= CQuat::Identity; +01396 <span class="keywordflow">return</span>; +01397 } +01398 +01399 <span class="comment">// Must normalize the matrix??</span> +01400 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & (<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) ) +01401 { +01402 MatNormed= *<span class="keyword">this</span>; +01403 MatNormed.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_2">normalize</a>(ZYX); +01404 pmat= &MatNormed; +01405 } +01406 +01407 <span class="comment">// Compute quaternion.</span> +01408 <span class="keywordtype">float</span> tr, <a class="code" href="a04223.html#a626">s</a>, <a class="code" href="a04223.html#a629">q</a>[4]; +01409 +01410 tr = pmat->a11 + pmat->a22 + pmat->a33; +01411 +01412 <span class="comment">// check the diagonal</span> +01413 <span class="keywordflow">if</span> (tr > 0.0) +01414 { +01415 <a class="code" href="a04223.html#a626">s</a> = (<span class="keywordtype">float</span>)sqrt (tr + 1.0f); +01416 quat.w = <a class="code" href="a04223.html#a626">s</a> / 2.0f; +01417 <a class="code" href="a04223.html#a626">s</a> = 0.5f / <a class="code" href="a04223.html#a626">s</a>; +01418 quat.x = (pmat->a32 - pmat->a23) * <a class="code" href="a04223.html#a626">s</a>; +01419 quat.y = (pmat->a13 - pmat->a31) * <a class="code" href="a04223.html#a626">s</a>; +01420 quat.z = (pmat->a21 - pmat->a12) * <a class="code" href="a04223.html#a626">s</a>; +01421 } +01422 <span class="keywordflow">else</span> +01423 { +01424 <a class="code" href="a04558.html#a14">sint</a> i, j, k; +01425 <a class="code" href="a04558.html#a14">sint</a> nxt[3] = {1, 2, 0}; +01426 +01427 <span class="comment">// diagonal is negative</span> +01428 i = 0; +01429 <span class="keywordflow">if</span> (pmat->a22 > pmat->a11) i = 1; +01430 <span class="keywordflow">if</span> (pmat->a33 > pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,i) ) i = 2; +01431 j = nxt[i]; +01432 k = nxt[j]; +01433 +01434 <a class="code" href="a04223.html#a626">s</a> = (<span class="keywordtype">float</span>) sqrt ( (pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,i) - (pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(j,j) + pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(k,k)) ) + 1.0); +01435 +01436 <a class="code" href="a04223.html#a629">q</a>[i] = <a class="code" href="a04223.html#a626">s</a> * 0.5f; +01437 +01438 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a626">s</a> != 0.0f) <a class="code" href="a04223.html#a626">s</a> = 0.5f / <a class="code" href="a04223.html#a626">s</a>; +01439 +01440 <a class="code" href="a04223.html#a629">q</a>[j] = (pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(j,i) + pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)) * <a class="code" href="a04223.html#a626">s</a>; +01441 <a class="code" href="a04223.html#a629">q</a>[k] = (pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(k,i) + pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,k)) * <a class="code" href="a04223.html#a626">s</a>; +01442 <a class="code" href="a04223.html#a629">q</a>[3] = (pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(k,j) - pmat-><a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(j,k)) * <a class="code" href="a04223.html#a626">s</a>; +01443 +01444 quat.x = <a class="code" href="a04223.html#a629">q</a>[0]; +01445 quat.y = <a class="code" href="a04223.html#a629">q</a>[1]; +01446 quat.z = <a class="code" href="a04223.html#a629">q</a>[2]; +01447 quat.w = <a class="code" href="a04223.html#a629">q</a>[3]; +01448 } +01449 +01450 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_10" doxytag="NLMISC::CMatrix::getRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>m33</em>[9] </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Rotation/Scale matrix (base). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>m33</em> </td><td>the matrix's 3*3 column rotation matrix. (3x3 matrix stored in column-major order as 9 consecutive values)</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00369">369</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, and <a class="el" href="a05972.html#l00117">hasRot()</a>. +<p> +<div class="fragment"><pre>00370 { +00371 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00372 { +00373 m33[0]= <a class="code" href="a04734.html#a6">a11</a>; +00374 m33[1]= <a class="code" href="a04734.html#a7">a21</a>; +00375 m33[2]= <a class="code" href="a04734.html#a8">a31</a>; +00376 +00377 m33[3]= <a class="code" href="a04734.html#a11">a12</a>; +00378 m33[4]= <a class="code" href="a04734.html#a12">a22</a>; +00379 m33[5]= <a class="code" href="a04734.html#a13">a32</a>; +00380 +00381 m33[6]= <a class="code" href="a04734.html#a16">a13</a>; +00382 m33[7]= <a class="code" href="a04734.html#a17">a23</a>; +00383 m33[8]= <a class="code" href="a04734.html#a18">a33</a>; +00384 } +00385 <span class="keywordflow">else</span> +00386 { +00387 m33[0]= 1; +00388 m33[1]= 0; +00389 m33[2]= 0; +00390 +00391 m33[3]= 0; +00392 m33[4]= 1; +00393 m33[5]= 0; +00394 +00395 m33[6]= 0; +00396 m33[7]= 0; +00397 m33[8]= 1; +00398 } +00399 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1963_11" doxytag="NLMISC::CMatrix::getRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::getRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>i</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>j</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>k</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the Rotation/Scale matrix (base). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>i</em> </td><td>The matrix's I vector of the cartesian base. </td></tr> + <tr><td valign=top><em>j</em> </td><td>The matrix's J vector of the cartesian base. </td></tr> + <tr><td valign=top><em>k</em> </td><td>The matrix's K vector of the cartesian base.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00353">353</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, and <a class="el" href="a06682.html#l00136">NLMISC::CVector::set()</a>. +<p> +Referenced by <a class="el" href="a06737.html#l00344">NL3D::ComputeUpMatrix()</a>, <a class="el" href="a06483.html#l00062">NL3D::CTargetAnimCtrl::execute()</a>, <a class="el" href="a06483.html#l00219">NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone()</a>, <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, and <a class="el" href="a05972.html#l00231">setRot()</a>. +<p> +<div class="fragment"><pre>00354 { +00355 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00356 { +00357 i.set(a11, a21, a31); +00358 j.set(a12, a22, a32); +00359 k.set(a13, a23, a33); +00360 } +00361 <span class="keywordflow">else</span> +00362 { +00363 i.set(1, 0, 0); +00364 j.set(0, 1, 0); +00365 k.set(0, 0, 1); +00366 } +00367 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1970_0" doxytag="NLMISC::CMatrix::getScaleUniform" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float NLMISC::CMatrix::getScaleUniform </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return true the uniform scale. valid only if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform()</a> is true, else 1 is returned. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00106">106</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00102">hasScaleUniform()</a>, and <a class="el" href="a05973.html#l00354">Scale33</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>. +<p> +<div class="fragment"><pre>00107 { +00108 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform</a>()) +00109 <span class="keywordflow">return</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00110 <span class="keywordflow">else</span> +00111 <span class="keywordflow">return</span> 1; +00112 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd2" doxytag="NLMISC::CMatrix::hasAll" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasAll </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00129">129</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, and <a class="el" href="a05972.html#l00121">hasTrans()</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00168">operator=()</a>. +<p> +<div class="fragment"><pre>00130 { +00131 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() && <a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() && <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()); +00132 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd3" doxytag="NLMISC::CMatrix::hasProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasProj </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00125">125</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00401">getProj()</a>, <a class="el" href="a05972.html#l00129">hasAll()</a>, <a class="el" href="a05972.html#l00168">operator=()</a>, <a class="el" href="a05972.html#l00498">rotateX()</a>, <a class="el" href="a05972.html#l00538">rotateY()</a>, <a class="el" href="a05972.html#l00578">rotateZ()</a>, <a class="el" href="a05972.html#l00644">scale()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, <a class="el" href="a05972.html#l00470">translate()</a>, and <a class="el" href="a05972.html#l00935">transpose()</a>. +<p> +<div class="fragment"><pre>00126 { +00127 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&<a class="code" href="a04549.html#a4">MAT_PROJ</a>)!=0; +00128 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1970_1" doxytag="NLMISC::CMatrix::hasProjectionPart" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasProjectionPart </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return true if the matrix has a projection part (by <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1961_5">setProj()</a>, by multiplication etc...) +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00096">96</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00097 { +00098 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&<a class="code" href="a04549.html#a4">MAT_PROJ</a>)!=0; +00099 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd4" doxytag="NLMISC::CMatrix::hasRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasRot </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00117">117</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00419">getI()</a>, <a class="el" href="a05972.html#l00427">getJ()</a>, <a class="el" href="a05972.html#l00435">getK()</a>, <a class="el" href="a05972.html#l00353">getRot()</a>, <a class="el" href="a05972.html#l00129">hasAll()</a>, <a class="el" href="a05972.html#l01261">mulPoint()</a>, <a class="el" href="a05972.html#l01244">mulVector()</a>, <a class="el" href="a05972.html#l00168">operator=()</a>, <a class="el" href="a05972.html#l00498">rotateX()</a>, <a class="el" href="a05972.html#l00538">rotateY()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, <a class="el" href="a05972.html#l00243">setRot()</a>, <a class="el" href="a05972.html#l00135">testExpandRot()</a>, <a class="el" href="a05972.html#l00470">translate()</a>, and <a class="el" href="a05972.html#l00922">transpose3x3()</a>. +<p> +<div class="fragment"><pre>00118 { +00119 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&(<a class="code" href="a04549.html#a1">MAT_ROT</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>))!=0; +00120 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1970_2" doxytag="NLMISC::CMatrix::hasScalePart" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasScalePart </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return true if the matrix has a scale part (by <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_6">scale()</a>, by multiplication etc...) +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00092">92</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, and <a class="el" href="a05649.html#l00156">NL3D::CDriverGL::doRefreshRenderSetup()</a>. +<p> +<div class="fragment"><pre>00093 { +00094 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&(<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>))!=0; +00095 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1970_3" doxytag="NLMISC::CMatrix::hasScaleUniform" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasScaleUniform </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return true if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_2">hasScalePart()</a> and if if this scale is uniform. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00102">102</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, <a class="el" href="a05972.html#l00106">getScaleUniform()</a>, <a class="el" href="a05972.html#l00702">setMulMatrixNoProj()</a>, and <a class="el" href="a05972.html#l00243">setRot()</a>. +<p> +<div class="fragment"><pre>00103 { +00104 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & (<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>))== <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>; +00105 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd5" doxytag="NLMISC::CMatrix::hasTrans" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::hasTrans </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00121">121</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00129">hasAll()</a>, <a class="el" href="a05972.html#l01261">mulPoint()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, and <a class="el" href="a05972.html#l00935">transpose()</a>. +<p> +<div class="fragment"><pre>00122 { +00123 <span class="keywordflow">return</span> (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&<a class="code" href="a04549.html#a0">MAT_TRANS</a>)!=0; +00124 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_0" doxytag="NLMISC::CMatrix::identity" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::identity </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Reset the matrix to identity. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00200">200</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00061">MAT_IDENTITY</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a06766.html#l00212">NLLIGO::CZoneEdge::buildMatrix()</a>, <a class="el" href="a05557.html#l00437">NL3D::CCloud::calcBill()</a>, <a class="el" href="a05618.html#l00109">NL3D::CCubeGrid< TCell >::CCubeGrid()</a>, <a class="el" href="a05686.html#l00040">NL3D::CEvent3dMouseListener::CEvent3dMouseListener()</a>, <a class="el" href="a06436.html#l00164">NL3D::CStaticQuadGrid< T >::clear()</a>, <a class="el" href="a05870.html#l00143">NL3D::CLandscapeModel::clipAndRenderLandscape()</a>, <a class="el" href="a06301.html#l00345">NLPACS::CQuadGrid< T >::CQuadGrid()</a>, <a class="el" href="a06300.html#l00412">NL3D::CQuadGrid< T >::CQuadGrid()</a>, <a class="el" href="a06306.html#l00658">NL3D::CQuadTree< T >::CQuadTree()</a>, <a class="el" href="a06436.html#l00146">NL3D::CStaticQuadGrid< T >::CStaticQuadGrid()</a>, <a class="el" href="a06568.html#l00052">NL3D::CTransform::CTransform()</a>, <a class="el" href="a06583.html#l00109">NL3D::CTravCameraScene::CTravCameraScene()</a>, <a class="el" href="a05557.html#l00328">NL3D::CCloud::disp()</a>, <a class="el" href="a05660.html#l00136">NL3D::CDRU::drawBitmap()</a>, <a class="el" href="a05660.html#l00173">NL3D::CDRU::drawLine()</a>, <a class="el" href="a06250.html#l00521">NL3D::CPSConstraintMeshHelper::drawMeshs()</a>, <a class="el" href="a05660.html#l00241">NL3D::CDRU::drawQuad()</a>, <a class="el" href="a05660.html#l00206">NL3D::CDRU::drawTriangle()</a>, <a class="el" href="a05557.html#l00509">NL3D::CCloud::genBill()</a>, <a class="el" href="a06350.html#l00205">NL3D::CInstanceGroup::getInstanceMatrix()</a>, <a class="el" href="a06287.html#l00477">NL3D::CPSZoneSphere::getMatrix()</a>, <a class="el" href="a06229.html#l02520">NL3D::CPSSphericalEmitter::getMatrix()</a>, <a class="el" href="a06741.html#l00609">NL3D::CWaterShape::getShapeInWorldSpace()</a>, <a class="el" href="a06768.html#l00741">InitZBuffer()</a>, <a class="el" href="a05972.html#l01090">inverted()</a>, <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, <a class="el" href="a06250.html#l01531">NL3D::CPSConstraintMesh::makePrerotatedVb()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06698.html#l01713">NL3D::CVegetableManager::render()</a>, <a class="el" href="a05972.html#l00618">rotate()</a>, <a class="el" href="a06306.html#l00817">NL3D::CQuadTree< T >::selectRay()</a>, <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05657.html#l00464">NL3D::CDriverUser::setMatrixMode2D()</a>, <a class="el" href="a05557.html#l00751">NL3D::CCloud::setMode2D()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, <a class="el" href="a05972.html#l00231">setRot()</a>, <a class="el" href="a05649.html#l00086">NL3D::CDriverGL::setupViewMatrix()</a>, <a class="el" href="a05649.html#l00053">NL3D::CDriverGL::setupViewMatrixEx()</a>, <a class="el" href="a06239.html#l00413">NL3D::CPSGravity::show()</a>, <a class="el" href="a06574.html#l00141">NL3D::ITransformable::updateMatrix()</a>, and <a class="el" href="a06250.html#l00295">NL3D::CPSMesh::updatePos()</a>. +<p> +<div class="fragment"><pre>00201 { +00202 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= <a class="code" href="a04549.html#a8">MAT_IDENTITY</a>; +00203 <span class="comment">// Reset just Pos because must always be valid for faster getPos()</span> +00204 <a class="code" href="a04734.html#a21">a14</a>= <a class="code" href="a04734.html#a22">a24</a>= <a class="code" href="a04734.html#a23">a34</a>= 0; +00205 <span class="comment">// For optimisation it would be usefull to keep MAT_VALID states.</span> +00206 <span class="comment">// But this slows identity(), and this may not be interesting...</span> +00207 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_0" doxytag="NLMISC::CMatrix::invert" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::invert </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Invert the matrix. if the matrix can't be inverted, it is set to identity. +<p> +Definition at line <a class="el" href="a05972.html#l00914">914</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l01090">inverted()</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a05563.html#l00477">NL3D::CCluster::applyMatrix()</a>, <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05557.html#l00437">NL3D::CCloud::calcBill()</a>, <a class="el" href="a05935.html#l00068">NL3D::CLodCharacterManager::CLodCharacterManager()</a>, <a class="el" href="a06566.html#l00430">CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a05557.html#l00509">NL3D::CCloud::genBill()</a>, <a class="el" href="a06768.html#l00741">InitZBuffer()</a>, <a class="el" href="a06768.html#l00920">NL3D::CZoneLighter::light()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a06372.html#l00445">NL3D::CShadowMapManager::renderProject()</a>, <a class="el" href="a05656.html#l01366">NL3D::CDriverGL::setConstantMatrix()</a>, <a class="el" href="a05657.html#l00482">NL3D::CDriverUser::setMatrixMode3D()</a>, <a class="el" href="a05935.html#l00776">NL3D::CLodCharacterManager::setupNormalCorrectionMatrix()</a>, <a class="el" href="a06024.html#l00228">NL3D::CMeshVPWindTree::setupPerInstanceConstants()</a>, <a class="el" href="a05649.html#l00086">NL3D::CDriverGL::setupViewMatrix()</a>, <a class="el" href="a05649.html#l00053">NL3D::CDriverGL::setupViewMatrixEx()</a>, <a class="el" href="a05563.html#l00311">NL3D::CCluster::setWorldMatrix()</a>, and <a class="el" href="a06190.html#l00392">NLMISC::CPolygon::toConvexPolygonsLocalAndBSP()</a>. +<p> +<div class="fragment"><pre>00915 { +00916 +00917 *<span class="keyword">this</span>= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_1">inverted</a>(); +00918 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_1" doxytag="NLMISC::CMatrix::inverted" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a> NLMISC::CMatrix::inverted </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return the matrix inverted. if the matrix can't be inverted, identity is returned. +<p> +Definition at line <a class="el" href="a05972.html#l01090">1090</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00969">fastInvert33()</a>, <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05972.html#l00999">slowInvert33()</a>, <a class="el" href="a05972.html#l01032">slowInvert44()</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02058">NL3D::CMeshGeom::activeInstance()</a>, <a class="el" href="a06436.html#l00181">NL3D::CStaticQuadGrid< T >::build()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a05824.html#l00633">NL3D::CInstanceLighter::computeSunContribution()</a>, <a class="el" href="a06350.html#l01224">NL3D::CInstanceGroup::displayDebugClusters()</a>, <a class="el" href="a06393.html#l01781">NL3D::CSkeletonModel::generateShadowMap()</a>, <a class="el" href="a06001.html#l00166">NL3D::CMeshInstance::generateShadowMap()</a>, <a class="el" href="a05972.html#l00914">invert()</a>, <a class="el" href="a06768.html#l02927">NL3D::CZoneLighter::lightWater()</a>, <a class="el" href="a05783.html#l00051">NL3D::CHeatHaze::performHeatHaze()</a>, <a class="el" href="a06005.html#l00927">NL3D::CMeshMRMGeom::render()</a>, <a class="el" href="a05989.html#l00598">NL3D::CMeshGeom::render()</a>, <a class="el" href="a06005.html#l01146">NL3D::CMeshMRMGeom::renderSkin()</a>, <a class="el" href="a05989.html#l00788">NL3D::CMeshGeom::renderSkin()</a>, <a class="el" href="a06142.html#l00942">NL3D::CParticleSystem::setSysMat()</a>, <a class="el" href="a06142.html#l00954">NL3D::CParticleSystem::setUserMatrix()</a>, <a class="el" href="a06142.html#l00273">NL3D::CParticleSystem::setViewMat()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, <a class="el" href="a06583.html#l00122">NL3D::CTravCameraScene::update()</a>, and <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>. +<p> +<div class="fragment"><pre>01091 { +01092 +01093 <a class="code" href="a02851.html">CMatrix</a> ret; +01094 +01095 <span class="comment">// \todo yoyo: TODO_OPTIMIZE it...</span> +01096 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +01097 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +01098 +01099 <span class="comment">// Do a conventionnal 44 inversion.</span> +01100 <span class="comment">//=================================</span> +01101 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a4">MAT_PROJ</a>) +01102 { +01103 <span class="keywordflow">if</span>(!<a class="code" href="a02851.html#NLMISC_1_1CMatrixd10">slowInvert44</a>(ret)) +01104 { +01105 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +01106 <span class="keywordflow">return</span> ret; +01107 } +01108 +01109 <span class="comment">// Well, don't know what happens to matrix, so set all StateBit :).</span> +01110 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= <a class="code" href="a04549.html#a0">MAT_TRANS</a>|<a class="code" href="a04549.html#a1">MAT_ROT</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>|<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +01111 +01112 <span class="comment">// Check Trans state.</span> +01113 <span class="keywordflow">if</span>(ret.a14!=0 || ret.a24!=0 || ret.a34!=0) +01114 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +01115 <span class="keywordflow">else</span> +01116 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +01117 +01118 <span class="comment">// Check Proj state.</span> +01119 <span class="keywordflow">if</span>(ret.a41!=0 || ret.a42!=0 || ret.a43!=0 || ret.a44!=1) +01120 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a4">MAT_PROJ</a>; +01121 <span class="keywordflow">else</span> +01122 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +01123 } +01124 +01125 <span class="comment">// Do a speed 34 inversion.</span> +01126 <span class="comment">//=========================</span> +01127 <span class="keywordflow">else</span> +01128 { +01129 <span class="comment">// Invert the rotation part.</span> +01130 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) +01131 { +01132 <span class="keywordflow">if</span>(!<a class="code" href="a02851.html#NLMISC_1_1CMatrixd9">slowInvert33</a>(ret)) +01133 { +01134 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +01135 <span class="keywordflow">return</span> ret; +01136 } +01137 } +01138 <span class="keywordflow">else</span> +01139 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd0">fastInvert33</a>(ret); +01140 <span class="comment">// Scale33 is updated in fastInvert33().</span> +01141 +01142 <span class="comment">// Invert the translation part.</span> +01143 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a0">MAT_TRANS</a>) +01144 { +01145 <span class="comment">// Invert the translation part.</span> +01146 <span class="comment">// This can only work if 4th line is 0 0 0 1.</span> +01147 <span class="comment">// formula: InvVp= InvVi*(-Vp.x) + InvVj*(-Vp.y) + InvVk*(-Vp.z)</span> +01148 ret.a14= ret.a11*(-<a class="code" href="a04734.html#a21">a14</a>) + ret.a12*(-<a class="code" href="a04734.html#a22">a24</a>) + ret.a13*(-<a class="code" href="a04734.html#a23">a34</a>); +01149 ret.a24= ret.a21*(-<a class="code" href="a04734.html#a21">a14</a>) + ret.a22*(-<a class="code" href="a04734.html#a22">a24</a>) + ret.a23*(-<a class="code" href="a04734.html#a23">a34</a>); +01150 ret.a34= ret.a31*(-<a class="code" href="a04734.html#a21">a14</a>) + ret.a32*(-<a class="code" href="a04734.html#a22">a24</a>) + ret.a33*(-<a class="code" href="a04734.html#a23">a34</a>); +01151 } +01152 <span class="keywordflow">else</span> +01153 { +01154 ret.a14= 0; +01155 ret.a24= 0; +01156 ret.a34= 0; +01157 } +01158 +01159 <span class="comment">// The projection part is unmodified.</span> +01160 ret.a41= 0; ret.a42= 0; ret.a43= 0; ret.a44= 1; +01161 +01162 <span class="comment">// The matrix inverted keep the same state bits.</span> +01163 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>; +01164 } +01165 +01166 +01167 <span class="keywordflow">return</span> ret; +01168 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd6" doxytag="NLMISC::CMatrix::mat" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const float& NLMISC::CMatrix::mat </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>i</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>j</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00367">367</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05981.html#l00104">sint</a>. +<p> +<div class="fragment"><pre>00368 { +00369 <span class="keywordflow">return</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[ (j<<2) + i]; +00370 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd7" doxytag="NLMISC::CMatrix::mat" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float& NLMISC::CMatrix::mat </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>i</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> </td> + <td class="mdname" nowrap> <em>j</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00362">362</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05981.html#l00104">sint</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01386">getRot()</a>, and <a class="el" href="a05972.html#l01032">slowInvert44()</a>. +<p> +<div class="fragment"><pre>00363 { +00364 <span class="keywordflow">return</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>[ (j<<2) + i]; +00365 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_1" doxytag="NLMISC::CMatrix::movePos" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::movePos </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit move the Translation component. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>v</em> </td><td>a vector to move the translation vector.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00279">279</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +Referenced by <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>. +<p> +<div class="fragment"><pre>00280 { +00281 <a class="code" href="a04734.html#a21">a14</a>+= <a class="code" href="a04223.html#a576">v</a>.x; +00282 <a class="code" href="a04734.html#a22">a24</a>+= <a class="code" href="a04223.html#a576">v</a>.y; +00283 <a class="code" href="a04734.html#a23">a34</a>+= <a class="code" href="a04223.html#a576">v</a>.z; +00284 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a21">a14</a>!=0 || <a class="code" href="a04734.html#a22">a24</a>!=0 || <a class="code" href="a04734.html#a23">a34</a>!=0) +00285 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00286 <span class="keywordflow">else</span> +00287 <span class="comment">// The trans is identity</span> +00288 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00289 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1968_0" doxytag="NLMISC::CMatrix::mulPoint" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::mulPoint </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Multiply a point. ie <a class="el" href="a04223.html#a575">v.w</a>=1 so the Translation component do affect result. Projection doesn't affect result. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01261">1261</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00121">hasTrans()</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a05557.html#l00437">NL3D::CCloud::calcBill()</a>, <a class="el" href="a05973.html#l00325">operator *()</a>, and <a class="el" href="a06193.html#l00255">NL3D::CPortal::setWorldMatrix()</a>. +<p> +<div class="fragment"><pre>01262 { +01263 +01264 CVector ret; +01265 +01266 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +01267 { +01268 ret.x= <a class="code" href="a04734.html#a6">a11</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a11">a12</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a16">a13</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01269 ret.y= <a class="code" href="a04734.html#a7">a21</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a12">a22</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a17">a23</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01270 ret.z= <a class="code" href="a04734.html#a8">a31</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a13">a32</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a18">a33</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01271 } +01272 <span class="keywordflow">else</span> +01273 { +01274 ret= <a class="code" href="a04223.html#a576">v</a>; +01275 } +01276 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() ) +01277 { +01278 ret.x+= <a class="code" href="a04734.html#a21">a14</a>; +01279 ret.y+= <a class="code" href="a04734.html#a22">a24</a>; +01280 ret.z+= <a class="code" href="a04734.html#a23">a34</a>; +01281 } +01282 +01283 <span class="keywordflow">return</span> ret; +01284 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1968_1" doxytag="NLMISC::CMatrix::mulVector" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::mulVector </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Multiply a normal. ie <a class="el" href="a04223.html#a575">v.w</a>=0 so the Translation component doesn't affect result. Projection doesn't affect result. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01244">1244</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a05935.html#l00359">NL3D::CLodCharacterManager::addRenderCharacterKey()</a>, <a class="el" href="a06022.html#l00433">NL3D::CMeshVPPerPixelLight::begin()</a>, <a class="el" href="a06329.html#l00557">NL3D::CRenderTrav::beginVPLightSetup()</a>, <a class="el" href="a06246.html#l00612">NL3D::CPSLocated::computeI()</a>, <a class="el" href="a06246.html#l00643">NL3D::CPSLocated::computeJ()</a>, <a class="el" href="a06246.html#l00674">NL3D::CPSLocated::computeK()</a>, <a class="el" href="a06142.html#l01040">NL3D::CParticleSystem::getLODVect()</a>, <a class="el" href="a05686.html#l00341">NL3D::CEvent3dMouseListener::getViewMatrix()</a>, <a class="el" href="a06047.html#l00043">H_AUTO_DECL()</a>, <a class="el" href="a06250.html#l01531">NL3D::CPSConstraintMesh::makePrerotatedVb()</a>, <a class="el" href="a06246.html#l00852">NL3D::CPSLocated::newElement()</a>, <a class="el" href="a06239.html#l00824">NL3D::CPSCylindricVortex::performDynamic()</a>, <a class="el" href="a06287.html#l01275">NL3D::CPSZoneRectangle::performMotion()</a>, <a class="el" href="a06287.html#l00946">NL3D::CPSZoneCylinder::performMotion()</a>, <a class="el" href="a06287.html#l00533">NL3D::CPSZoneDisc::performMotion()</a>, <a class="el" href="a06287.html#l00215">NL3D::CPSZonePlane::performMotion()</a>, <a class="el" href="a06024.html#l00228">NL3D::CMeshVPWindTree::setupPerInstanceConstants()</a>, <a class="el" href="a06281.html#l00109">NL3D::CPSSound::step()</a>, <a class="el" href="a06583.html#l00122">NL3D::CTravCameraScene::update()</a>, <a class="el" href="a05437.html#l00197">NL3D::CAnimatedMaterial::update()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>. +<p> +<div class="fragment"><pre>01245 { +01246 +01247 CVector ret; +01248 +01249 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +01250 { +01251 ret.x= <a class="code" href="a04734.html#a6">a11</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a11">a12</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a16">a13</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01252 ret.y= <a class="code" href="a04734.html#a7">a21</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a12">a22</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a17">a23</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01253 ret.z= <a class="code" href="a04734.html#a8">a31</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a13">a32</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a18">a33</a>*<a class="code" href="a04223.html#a576">v</a>.z; +01254 <span class="keywordflow">return</span> ret; +01255 } +01256 <span class="keywordflow">else</span> +01257 <span class="keywordflow">return</span> <a class="code" href="a04223.html#a576">v</a>; +01258 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_2" doxytag="NLMISC::CMatrix::normalize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::normalize </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> </td> + <td class="mdname1" valign="top" nowrap> <em>pref</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Normalize the matrix so that the rotation part is now an orthonormal basis, ie a rotation with no scale. NB: projection part and translation part are not modified. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>pref</em> </td><td>the preference axis order to normalize. ZYX means that K direction will be kept, and the plane JK will be used to lead the I vector. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>false if One of the vector basis is null. true otherwise.</dd></dl> + +<p> +Definition at line <a class="el" href="a05972.html#l01170">1170</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00419">getI()</a>, <a class="el" href="a05972.html#l00427">getJ()</a>, <a class="el" href="a05972.html#l00435">getK()</a>, <a class="el" href="a06682.html#l00148">NLMISC::CVector::isNull()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a06682.html#l00119">NLMISC::CVector::normalize()</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a05972.html#l00135">testExpandRot()</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>, and <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a>. +<p> +Referenced by <a class="el" href="a05532.html#l00048">NL3D::CCameraCol::build()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06566.html#l00430">CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile()</a>, <a class="el" href="a06350.html#l01224">NL3D::CInstanceGroup::displayDebugClusters()</a>, <a class="el" href="a06483.html#l00062">NL3D::CTargetAnimCtrl::execute()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, <a class="el" href="a05972.html#l01386">getRot()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06306.html#l00817">NL3D::CQuadTree< T >::selectRay()</a>, and <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>. +<p> +<div class="fragment"><pre>01171 { +01172 +01173 CVector ti,tj,tk; +01174 ti= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_2">getI</a>(); +01175 tj= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_3">getJ</a>(); +01176 tk= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_4">getK</a>(); +01177 +01178 <span class="comment">// \todo yoyo: TODO_OPTIMIZE it...</span> +01179 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +01180 +01181 <span class="comment">// Normalize with help of ro</span> +01182 <span class="keywordflow">switch</span>(ro) +01183 { +01184 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>: +01185 ti.normalize(); +01186 tk= ti^tj; +01187 tk.normalize(); +01188 tj= tk^ti; +01189 <span class="keywordflow">break</span>; +01190 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>: +01191 ti.normalize(); +01192 tj= tk^ti; +01193 tj.normalize(); +01194 tk= ti^tj; +01195 <span class="keywordflow">break</span>; +01196 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>: +01197 tj.normalize(); +01198 tk= ti^tj; +01199 tk.normalize(); +01200 ti= tj^tk; +01201 <span class="keywordflow">break</span>; +01202 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>: +01203 tj.normalize(); +01204 ti= tj^tk; +01205 ti.normalize(); +01206 tk= ti^tj; +01207 <span class="keywordflow">break</span>; +01208 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>: +01209 tk.normalize(); +01210 tj= tk^ti; +01211 tj.normalize(); +01212 ti= tj^tk; +01213 <span class="keywordflow">break</span>; +01214 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a>: +01215 tk.normalize(); +01216 ti= tj^tk; +01217 ti.normalize(); +01218 tj= tk^ti; +01219 <span class="keywordflow">break</span>; +01220 } +01221 +01222 <span class="comment">// Check, and set result.</span> +01223 <span class="keywordflow">if</span>( ti.isNull() || tj.isNull() || tk.isNull() ) +01224 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01225 <a class="code" href="a04734.html#a6">a11</a>= ti.x; <a class="code" href="a04734.html#a11">a12</a>= tj.x; <a class="code" href="a04734.html#a16">a13</a>= tk.x; +01226 <a class="code" href="a04734.html#a7">a21</a>= ti.y; <a class="code" href="a04734.html#a12">a22</a>= tj.y; <a class="code" href="a04734.html#a17">a23</a>= tk.y; +01227 <a class="code" href="a04734.html#a8">a31</a>= ti.z; <a class="code" href="a04734.html#a13">a32</a>= tj.z; <a class="code" href="a04734.html#a18">a33</a>= tk.z; +01228 <span class="comment">// Scale is reseted.</span> +01229 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>); +01230 <span class="comment">// Rot is setup...</span> +01231 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>; +01232 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>=1; +01233 +01234 <span class="keywordflow">return</span> <span class="keyword">true</span>; +01235 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1968_2" doxytag="NLMISC::CMatrix::operator *" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03668.html">CVectorH</a> NLMISC::CMatrix::operator * </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03668.html">CVectorH</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Multiply with an homogenous vector. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01290">1290</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, <a class="el" href="a05972.html#l00135">testExpandRot()</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a06681.html#l00048">NLMISC::CVectorH::w</a>, <a class="el" href="a06681.html#l00048">NLMISC::CVectorH::x</a>, <a class="el" href="a06681.html#l00048">NLMISC::CVectorH::y</a>, and <a class="el" href="a06681.html#l00048">NLMISC::CVectorH::z</a>. +<p> +<div class="fragment"><pre>01291 { +01292 +01293 CVectorH ret; +01294 +01295 <span class="comment">// \todo yoyo: TODO_OPTIMIZE it...</span> +01296 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +01297 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +01298 +01299 ret.x= <a class="code" href="a04734.html#a6">a11</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a11">a12</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a16">a13</a>*<a class="code" href="a04223.html#a576">v</a>.z + <a class="code" href="a04734.html#a21">a14</a>*<a class="code" href="a04223.html#a576">v</a>.w; +01300 ret.y= <a class="code" href="a04734.html#a7">a21</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a12">a22</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a17">a23</a>*<a class="code" href="a04223.html#a576">v</a>.z + <a class="code" href="a04734.html#a22">a24</a>*<a class="code" href="a04223.html#a576">v</a>.w; +01301 ret.z= <a class="code" href="a04734.html#a8">a31</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a13">a32</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a18">a33</a>*<a class="code" href="a04223.html#a576">v</a>.z + <a class="code" href="a04734.html#a23">a34</a>*<a class="code" href="a04223.html#a576">v</a>.w; +01302 ret.w= <a class="code" href="a04734.html#a9">a41</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a14">a42</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a19">a43</a>*<a class="code" href="a04223.html#a576">v</a>.z + <a class="code" href="a04734.html#a24">a44</a>*<a class="code" href="a04223.html#a576">v</a>.w; +01303 <span class="keywordflow">return</span> ret; +01304 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1968_3" doxytag="NLMISC::CMatrix::operator *" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> NLMISC::CMatrix::operator * </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Multiply a point. mulPoint. +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00325">325</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05972.html#l01261">mulPoint()</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +<div class="fragment"><pre>00326 { +00327 <span class="keywordflow">return</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1968_0">mulPoint</a>(v); +00328 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_3" doxytag="NLMISC::CMatrix::operator *" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a> NLMISC::CMatrix::operator * </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>in</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Matrix multiplication. +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00272">272</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05646.html#l01122">in</a>, and <a class="el" href="a05972.html#l00744">setMulMatrix()</a>. +<p> +<div class="fragment"><pre>00273 { +00274 <a class="code" href="a02851.html">CMatrix</a> ret; +00275 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_5">setMulMatrix</a>(*<span class="keyword">this</span>, in); +00276 <span class="keywordflow">return</span> ret; +00277 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_4" doxytag="NLMISC::CMatrix::operator *=" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a>& NLMISC::CMatrix::operator *= </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>in</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +equivalent to M=M*in +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00279">279</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +References <a class="el" href="a05646.html#l01122">in</a>, and <a class="el" href="a05972.html#l00744">setMulMatrix()</a>. +<p> +<div class="fragment"><pre>00280 { +00281 <a class="code" href="a02851.html">CMatrix</a> ret; +00282 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_5">setMulMatrix</a>(*<span class="keyword">this</span>, in); +00283 *<span class="keyword">this</span>= ret; +00284 <span class="keywordflow">return</span> *<span class="keyword">this</span>; +00285 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1959_2" doxytag="NLMISC::CMatrix::operator=" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02851.html">CMatrix</a> & NLMISC::CMatrix::operator= </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +operator=. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00168">168</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00129">hasAll()</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05973.html#l00353">M</a>, <a class="el" href="a05972.html#l00059">MAT_VALIDALL</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00169 { +00170 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & ~<a class="code" href="a04549.html#a7">MAT_VALIDALL</a>; +00171 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd2">hasAll</a>()) +00172 { +00173 memcpy(M, m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr0">M</a>, 16*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00174 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00175 } +00176 <span class="keywordflow">else</span> +00177 { +00178 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00179 { +00180 memcpy(&a11, &m.a11, 3*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00181 memcpy(&a12, &m.a12, 3*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00182 memcpy(&a13, &m.a13, 3*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00183 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00184 } +00185 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00186 { +00187 <a class="code" href="a04734.html#a9">a41</a>= m.a41; +00188 <a class="code" href="a04734.html#a14">a42</a>= m.a42; +00189 <a class="code" href="a04734.html#a19">a43</a>= m.a43; +00190 <a class="code" href="a04734.html#a24">a44</a>= m.a44; +00191 } +00192 <span class="comment">// Must always copy Trans part.</span> +00193 memcpy(&a14, &m.a14, 3*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00194 } +00195 <span class="keywordflow">return</span> *<span class="keyword">this</span>; +00196 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_2" doxytag="NLMISC::CMatrix::resetProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::resetProj </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Reset the Projection component to 0 0 0 1. +<p> +Definition at line <a class="el" href="a05972.html#l00309">309</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00310 { +00311 <a class="code" href="a04734.html#a9">a41</a>= 0; +00312 <a class="code" href="a04734.html#a14">a42</a>= 0; +00313 <a class="code" href="a04734.html#a19">a43</a>= 0; +00314 <a class="code" href="a04734.html#a24">a44</a>= 1; +00315 <span class="comment">// The proj is identity, and is correcly setup!</span> +00316 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00317 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>; +00318 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_0" doxytag="NLMISC::CMatrix::rotate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::rotate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03296.html">CQuat</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>quat</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a quaternion rotation. +<p> +Definition at line <a class="el" href="a05972.html#l00636">636</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00209">setRot()</a>. +<p> +<div class="fragment"><pre>00637 { +00638 <a class="code" href="a02851.html">CMatrix</a> rot; +00639 rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_10">setRot</a>(quat); +00640 (*this)*= rot; +00641 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_1" doxytag="NLMISC::CMatrix::rotate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::rotate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>v</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> </td> + <td class="mdname" nowrap> <em>ro</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a euler rotation. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>v</em> </td><td>a vector of 3 angle (in radian), giving rotation around each axis (x,y,z) </td></tr> + <tr><td valign=top><em>ro</em> </td><td>the order of transformation applied. if ro==XYZ, then the transform is M=M*Rx*Ry*Rz</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00618">618</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a05972.html#l00498">rotateX()</a>, <a class="el" href="a05972.html#l00538">rotateY()</a>, <a class="el" href="a05972.html#l00578">rotateZ()</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>, <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>, and <a class="el" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a>. +<p> +Referenced by <a class="el" href="a06350.html#l00205">NL3D::CInstanceGroup::getInstanceMatrix()</a>, <a class="el" href="a06741.html#l00609">NL3D::CWaterShape::getShapeInWorldSpace()</a>, <a class="el" href="a06250.html#l01531">NL3D::CPSConstraintMesh::makePrerotatedVb()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a05972.html#l00231">setRot()</a>, <a class="el" href="a06231.html#l00212">NL3D::CPSFace::step()</a>, and <a class="el" href="a06574.html#l00141">NL3D::ITransformable::updateMatrix()</a>. +<p> +<div class="fragment"><pre>00619 { +00620 <a class="code" href="a02851.html">CMatrix</a> rot; +00621 rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +00622 <span class="keywordflow">switch</span>(ro) +00623 { +00624 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw1">XYZ</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); <span class="keywordflow">break</span>; +00625 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw2">XZY</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); <span class="keywordflow">break</span>; +00626 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw3">YXZ</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); <span class="keywordflow">break</span>; +00627 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw4">YZX</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); <span class="keywordflow">break</span>; +00628 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw5">ZXY</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); <span class="keywordflow">break</span>; +00629 <span class="keywordflow">case</span> <a class="code" href="a02851.html#NLMISC_1_1CMatrixw0NLMISC_1_1CMatrixw6">ZYX</a>: rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_4">rotateZ</a>(<a class="code" href="a04223.html#a576">v</a>.z); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_3">rotateY</a>(<a class="code" href="a04223.html#a576">v</a>.y); rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_2">rotateX</a>(<a class="code" href="a04223.html#a576">v</a>.x); <span class="keywordflow">break</span>; +00630 } +00631 +00632 (*this)*= rot; +00633 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_2" doxytag="NLMISC::CMatrix::rotateX" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::rotateX </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>a</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a rotation on axis X to the matrix. same as M=M*Rx <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>a</em> </td><td>angle (in radian).</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00498">498</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, and <a class="el" href="a05972.html#l00618">rotate()</a>. +<p> +<div class="fragment"><pre>00499 { +00500 +00501 <span class="keywordflow">if</span>(a==0) +00502 <span class="keywordflow">return</span>; +00503 <span class="keywordtype">double</span> ca,sa; +00504 ca=cos(a); +00505 sa=sin(a); +00506 +00507 <span class="comment">// SetRot.</span> +00508 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +00509 { +00510 <span class="keywordtype">float</span> b12=<a class="code" href="a04734.html#a11">a12</a>, b22=<a class="code" href="a04734.html#a12">a22</a>, b32=<a class="code" href="a04734.html#a13">a32</a>; +00511 <span class="keywordtype">float</span> b13=<a class="code" href="a04734.html#a16">a13</a>, b23=<a class="code" href="a04734.html#a17">a23</a>, b33=<a class="code" href="a04734.html#a18">a33</a>; +00512 <a class="code" href="a04734.html#a11">a12</a>= (<span class="keywordtype">float</span>)(b12*ca + b13*sa); +00513 <a class="code" href="a04734.html#a12">a22</a>= (<span class="keywordtype">float</span>)(b22*ca + b23*sa); +00514 <a class="code" href="a04734.html#a13">a32</a>= (<span class="keywordtype">float</span>)(b32*ca + b33*sa); +00515 <a class="code" href="a04734.html#a16">a13</a>= (<span class="keywordtype">float</span>)(b13*ca - b12*sa); +00516 <a class="code" href="a04734.html#a17">a23</a>= (<span class="keywordtype">float</span>)(b23*ca - b22*sa); +00517 <a class="code" href="a04734.html#a18">a33</a>= (<span class="keywordtype">float</span>)(b33*ca - b32*sa); +00518 } +00519 <span class="keywordflow">else</span> +00520 { +00521 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00522 <a class="code" href="a04734.html#a11">a12</a>= 0.0f; <a class="code" href="a04734.html#a12">a22</a>= (<span class="keywordtype">float</span>)ca; <a class="code" href="a04734.html#a13">a32</a>= (<span class="keywordtype">float</span>)sa; +00523 <a class="code" href="a04734.html#a16">a13</a>= 0.0f; <a class="code" href="a04734.html#a17">a23</a>= (<span class="keywordtype">float</span>)-sa; <a class="code" href="a04734.html#a18">a33</a>= (<span class="keywordtype">float</span>)ca; +00524 } +00525 +00526 <span class="comment">// SetProj.</span> +00527 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00528 { +00529 <span class="keywordtype">float</span> b42=<a class="code" href="a04734.html#a14">a42</a>, b43=<a class="code" href="a04734.html#a19">a43</a>; +00530 <a class="code" href="a04734.html#a14">a42</a>= (<span class="keywordtype">float</span>)(b42*ca + b43*sa); +00531 <a class="code" href="a04734.html#a19">a43</a>= (<span class="keywordtype">float</span>)(b43*ca - b42*sa); +00532 } +00533 +00534 <span class="comment">// set Rot.</span> +00535 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>; +00536 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_3" doxytag="NLMISC::CMatrix::rotateY" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::rotateY </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>a</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a rotation on axis Y to the matrix. same as M=M*Ry <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>a</em> </td><td>angle (in radian).</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00538">538</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, and <a class="el" href="a05972.html#l00618">rotate()</a>. +<p> +<div class="fragment"><pre>00539 { +00540 +00541 <span class="keywordflow">if</span>(a==0) +00542 <span class="keywordflow">return</span>; +00543 <span class="keywordtype">double</span> ca,sa; +00544 ca=cos(a); +00545 sa=sin(a); +00546 +00547 <span class="comment">// SetRot.</span> +00548 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +00549 { +00550 <span class="keywordtype">float</span> b11=<a class="code" href="a04734.html#a6">a11</a>, b21=<a class="code" href="a04734.html#a7">a21</a>, b31=<a class="code" href="a04734.html#a8">a31</a>; +00551 <span class="keywordtype">float</span> b13=<a class="code" href="a04734.html#a16">a13</a>, b23=<a class="code" href="a04734.html#a17">a23</a>, b33=<a class="code" href="a04734.html#a18">a33</a>; +00552 <a class="code" href="a04734.html#a6">a11</a>= (<span class="keywordtype">float</span>)(b11*ca - b13*sa); +00553 <a class="code" href="a04734.html#a7">a21</a>= (<span class="keywordtype">float</span>)(b21*ca - b23*sa); +00554 <a class="code" href="a04734.html#a8">a31</a>= (<span class="keywordtype">float</span>)(b31*ca - b33*sa); +00555 <a class="code" href="a04734.html#a16">a13</a>= (<span class="keywordtype">float</span>)(b13*ca + b11*sa); +00556 <a class="code" href="a04734.html#a17">a23</a>= (<span class="keywordtype">float</span>)(b23*ca + b21*sa); +00557 <a class="code" href="a04734.html#a18">a33</a>= (<span class="keywordtype">float</span>)(b33*ca + b31*sa); +00558 } +00559 <span class="keywordflow">else</span> +00560 { +00561 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00562 <a class="code" href="a04734.html#a6">a11</a>= (<span class="keywordtype">float</span>)ca; <a class="code" href="a04734.html#a7">a21</a>=0.0f; <a class="code" href="a04734.html#a8">a31</a>= (<span class="keywordtype">float</span>)-sa; +00563 <a class="code" href="a04734.html#a16">a13</a>= (<span class="keywordtype">float</span>)sa; <a class="code" href="a04734.html#a17">a23</a>=0.0f; <a class="code" href="a04734.html#a18">a33</a>= (<span class="keywordtype">float</span>)ca; +00564 } +00565 +00566 <span class="comment">// SetProj.</span> +00567 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00568 { +00569 <span class="keywordtype">float</span> b41=<a class="code" href="a04734.html#a9">a41</a>, b43=<a class="code" href="a04734.html#a19">a43</a>; +00570 <a class="code" href="a04734.html#a9">a41</a>= (<span class="keywordtype">float</span>)(b41*ca - b43*sa); +00571 <a class="code" href="a04734.html#a19">a43</a>= (<span class="keywordtype">float</span>)(b43*ca + b41*sa); +00572 } +00573 +00574 <span class="comment">// set Rot.</span> +00575 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>; +00576 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_4" doxytag="NLMISC::CMatrix::rotateZ" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::rotateZ </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>a</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a rotation on axis Z to the matrix. same as M=M*Rz <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>a</em> </td><td>angle (in radian).</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00578">578</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a06766.html#l00212">NLLIGO::CZoneEdge::buildMatrix()</a>, <a class="el" href="a05935.html#l00068">NL3D::CLodCharacterManager::CLodCharacterManager()</a>, <a class="el" href="a06700.html#l00041">NL3D::CVegetableQuadrant::CVegetableQuadrant()</a>, <a class="el" href="a06493.html#l00150">NL3D::CTessFacePriorityList::init()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, and <a class="el" href="a05972.html#l00618">rotate()</a>. +<p> +<div class="fragment"><pre>00579 { +00580 +00581 <span class="keywordflow">if</span>(a==0) +00582 <span class="keywordflow">return</span>; +00583 <span class="keywordtype">double</span> ca,sa; +00584 ca=cos(a); +00585 sa=sin(a); +00586 +00587 <span class="comment">// SetRot.</span> +00588 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & (<a class="code" href="a04549.html#a1">MAT_ROT</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) ) +00589 { +00590 <span class="keywordtype">float</span> b11=<a class="code" href="a04734.html#a6">a11</a>, b21=<a class="code" href="a04734.html#a7">a21</a>, b31=<a class="code" href="a04734.html#a8">a31</a>; +00591 <span class="keywordtype">float</span> b12=<a class="code" href="a04734.html#a11">a12</a>, b22=<a class="code" href="a04734.html#a12">a22</a>, b32=<a class="code" href="a04734.html#a13">a32</a>; +00592 <a class="code" href="a04734.html#a6">a11</a>= (<span class="keywordtype">float</span>)(b11*ca + b12*sa); +00593 <a class="code" href="a04734.html#a7">a21</a>= (<span class="keywordtype">float</span>)(b21*ca + b22*sa); +00594 <a class="code" href="a04734.html#a8">a31</a>= (<span class="keywordtype">float</span>)(b31*ca + b32*sa); +00595 <a class="code" href="a04734.html#a11">a12</a>= (<span class="keywordtype">float</span>)(b12*ca - b11*sa); +00596 <a class="code" href="a04734.html#a12">a22</a>= (<span class="keywordtype">float</span>)(b22*ca - b21*sa); +00597 <a class="code" href="a04734.html#a13">a32</a>= (<span class="keywordtype">float</span>)(b32*ca - b31*sa); +00598 } +00599 <span class="keywordflow">else</span> +00600 { +00601 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00602 <a class="code" href="a04734.html#a6">a11</a>= (<span class="keywordtype">float</span>)ca; <a class="code" href="a04734.html#a7">a21</a>= (<span class="keywordtype">float</span>)sa; <a class="code" href="a04734.html#a8">a31</a>=0.0f; +00603 <a class="code" href="a04734.html#a11">a12</a>= (<span class="keywordtype">float</span>)-sa; <a class="code" href="a04734.html#a12">a22</a>= (<span class="keywordtype">float</span>)ca; <a class="code" href="a04734.html#a13">a32</a>=0.0f; +00604 } +00605 +00606 <span class="comment">// SetProj.</span> +00607 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00608 { +00609 <span class="keywordtype">float</span> b41=<a class="code" href="a04734.html#a9">a41</a>, b42=<a class="code" href="a04734.html#a14">a42</a>; +00610 <a class="code" href="a04734.html#a9">a41</a>= (<span class="keywordtype">float</span>)(b41*ca + b42*sa); +00611 <a class="code" href="a04734.html#a14">a42</a>= (<span class="keywordtype">float</span>)(b42*ca - b41*sa); +00612 } +00613 +00614 <span class="comment">// set Rot.</span> +00615 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>; +00616 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_5" doxytag="NLMISC::CMatrix::scale" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::scale </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>scale</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a non-uniform scale to the matrix. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00669">669</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00644">scale()</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a05972.html#l00135">testExpandRot()</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +<div class="fragment"><pre>00670 { +00671 +00672 <span class="keywordflow">if</span>( <a class="code" href="a04223.html#a576">v</a>==CVector(1,1,1) ) <span class="keywordflow">return</span>; +00673 <span class="keywordflow">if</span>( !(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) && <a class="code" href="a04223.html#a576">v</a>.x==<a class="code" href="a04223.html#a576">v</a>.y && <a class="code" href="a04223.html#a576">v</a>.x==<a class="code" href="a04223.html#a576">v</a>.z) +00674 { +00675 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_6">scale</a>(<a class="code" href="a04223.html#a576">v</a>.x); +00676 } +00677 <span class="keywordflow">else</span> +00678 { +00679 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00680 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|=<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>; +00681 <a class="code" href="a04734.html#a6">a11</a>*= <a class="code" href="a04223.html#a576">v</a>.x; <a class="code" href="a04734.html#a11">a12</a>*=<a class="code" href="a04223.html#a576">v</a>.y; <a class="code" href="a04734.html#a16">a13</a>*=<a class="code" href="a04223.html#a576">v</a>.z; +00682 <a class="code" href="a04734.html#a7">a21</a>*= <a class="code" href="a04223.html#a576">v</a>.x; <a class="code" href="a04734.html#a12">a22</a>*=<a class="code" href="a04223.html#a576">v</a>.y; <a class="code" href="a04734.html#a17">a23</a>*=<a class="code" href="a04223.html#a576">v</a>.z; +00683 <a class="code" href="a04734.html#a8">a31</a>*= <a class="code" href="a04223.html#a576">v</a>.x; <a class="code" href="a04734.html#a13">a32</a>*=<a class="code" href="a04223.html#a576">v</a>.y; <a class="code" href="a04734.html#a18">a33</a>*=<a class="code" href="a04223.html#a576">v</a>.z; +00684 +00685 <span class="comment">// SetProj.</span> +00686 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00687 { +00688 <a class="code" href="a04734.html#a9">a41</a>*=<a class="code" href="a04223.html#a576">v</a>.x; +00689 <a class="code" href="a04734.html#a14">a42</a>*=<a class="code" href="a04223.html#a576">v</a>.y; +00690 <a class="code" href="a04734.html#a19">a43</a>*=<a class="code" href="a04223.html#a576">v</a>.z; +00691 } +00692 } +00693 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_6" doxytag="NLMISC::CMatrix::scale" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::scale </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>f</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a uniform scale to the matrix. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00644">644</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a06273.html#l00436">NL3D::ComputeTexturedRibbonMesh()</a>, <a class="el" href="a06273.html#l00404">NL3D::ComputeUntexturedRibbonMesh()</a>, <a class="el" href="a06350.html#l01224">NL3D::CInstanceGroup::displayDebugClusters()</a>, <a class="el" href="a06250.html#l00521">NL3D::CPSConstraintMeshHelper::drawMeshs()</a>, <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>, <a class="el" href="a06350.html#l00205">NL3D::CInstanceGroup::getInstanceMatrix()</a>, <a class="el" href="a06741.html#l00609">NL3D::CWaterShape::getShapeInWorldSpace()</a>, <a class="el" href="a05824.html#l00305">NL3D::CInstanceLighter::light()</a>, <a class="el" href="a05824.html#l01502">NL3D::CInstanceLighter::lightIgSimple()</a>, <a class="el" href="a06285.html#l00235">NL3D::CPSUtil::print()</a>, <a class="el" href="a05972.html#l00669">scale()</a>, <a class="el" href="a06574.html#l00141">NL3D::ITransformable::updateMatrix()</a>, and <a class="el" href="a06250.html#l00295">NL3D::CPSMesh::updatePos()</a>. +<p> +<div class="fragment"><pre>00645 { +00646 +00647 <span class="keywordflow">if</span>(f==1.0f) <span class="keywordflow">return</span>; +00648 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) +00649 { +00650 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_6">scale</a>(CVector(f,f,f)); +00651 } +00652 <span class="keywordflow">else</span> +00653 { +00654 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00655 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>; +00656 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>*=f; +00657 <a class="code" href="a04734.html#a6">a11</a>*= f; <a class="code" href="a04734.html#a11">a12</a>*=f; <a class="code" href="a04734.html#a16">a13</a>*=f; +00658 <a class="code" href="a04734.html#a7">a21</a>*= f; <a class="code" href="a04734.html#a12">a22</a>*=f; <a class="code" href="a04734.html#a17">a23</a>*=f; +00659 <a class="code" href="a04734.html#a8">a31</a>*= f; <a class="code" href="a04734.html#a13">a32</a>*=f; <a class="code" href="a04734.html#a18">a33</a>*=f; +00660 +00661 <span class="comment">// SetProj.</span> +00662 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00663 { +00664 <a class="code" href="a04734.html#a9">a41</a>*=f; <a class="code" href="a04734.html#a14">a42</a>*=f; <a class="code" href="a04734.html#a19">a43</a>*=f; +00665 } +00666 } +00667 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1970_4" doxytag="NLMISC::CMatrix::serial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::serial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02270.html">IStream</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>f</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return true the uniform scale. valid only if <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform()</a> is true, else 1 is returned. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01500">1500</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00121">hasTrans()</a>, <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a06463.html#l00064">NLMISC::IStream::isReading()</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a06462.html#l00232">NLMISC::IStream::serial()</a>, <a class="el" href="a06461.html#l00266">NLMISC::IStream::serialVersion()</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>01501 { +01502 <span class="comment">// Use versionning, maybe for futur improvement.</span> +01503 (<span class="keywordtype">void</span>)f.serialVersion(0); +01504 +01505 <span class="keywordflow">if</span>(f.isReading()) +01506 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +01507 f.serial(StateBit); +01508 f.serial(Scale33); +01509 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +01510 { +01511 f.serial(a11, a12, a13); +01512 f.serial(a21, a22, a23); +01513 f.serial(a31, a32, a33); +01514 } +01515 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() ) +01516 { +01517 f.serial(a14, a24, a34); +01518 } +01519 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(f.isReading()) +01520 { +01521 <span class="comment">// must reset because Pos must always be valid</span> +01522 <a class="code" href="a04734.html#a21">a14</a>= <a class="code" href="a04734.html#a22">a24</a>= <a class="code" href="a04734.html#a23">a34</a>= 0; +01523 } +01524 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +01525 { +01526 f.serial(a41, a42, a43, a44); +01527 } +01528 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_3" doxytag="NLMISC::CMatrix::set" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::set </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const float </td> + <td class="mdname1" valign="top" nowrap> <em>m44</em>[16] </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the 4*4 matrix. Avoid it. It implies low compute since no check is done on rotation matrix to see what type of matrix it is (identity, rotation, scale, uniform scale). BUT check are made to see if it has translation or projection components. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>m44</em> </td><td>the 4*4 column matrix (4x4 matrix stored in column-major order as 16 consecutive values)</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00320">320</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00061">MAT_IDENTITY</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05642.html#l02589">NL3D::CDriverGL::refreshProjMatrixFromGL()</a>. +<p> +<div class="fragment"><pre>00321 { +00322 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= <a class="code" href="a04549.html#a8">MAT_IDENTITY</a>; +00323 +00324 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>; +00325 memcpy(M, m44, 16*<span class="keyword">sizeof</span>(<span class="keywordtype">float</span>)); +00326 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= 1.0f; +00327 +00328 <span class="comment">// Check Trans state.</span> +00329 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a21">a14</a>!=0 || <a class="code" href="a04734.html#a22">a24</a>!=0 || <a class="code" href="a04734.html#a23">a34</a>!=0) +00330 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00331 <span class="keywordflow">else</span> +00332 <span class="comment">// The trans is identity</span> +00333 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00334 +00335 <span class="comment">// Check Proj state.</span> +00336 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a9">a41</a>!=0 || <a class="code" href="a04734.html#a14">a42</a>!=0 || <a class="code" href="a04734.html#a19">a43</a>!=0 || <a class="code" href="a04734.html#a24">a44</a>!=1) +00337 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00338 <span class="keywordflow">else</span> +00339 { +00340 <span class="comment">// The proj is identity, and is correcly setup!</span> +00341 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00342 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>; +00343 } +00344 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_5" doxytag="NLMISC::CMatrix::setMulMatrix" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setMulMatrix </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>m1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>m2</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Matrix multiplication. Because of copy avoidance, this is the fastest method Equivalent to *this= m1 * m2 <dl compact><dt><b>Warning:</b></dt><dd>*this MUST NOT be the same as m1 or m2, else it doesn't work (not checked/nlasserted)</dd></dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00744">744</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00121">hasTrans()</a>, <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05972.html#l00059">MAT_VALIDALL</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a05973.html#l00272">operator *()</a>, <a class="el" href="a05973.html#l00279">operator *=()</a>, and <a class="el" href="a06372.html#l00445">NL3D::CShadowMapManager::renderProject()</a>. +<p> +<div class="fragment"><pre>00745 { +00746 <span class="comment">// Do *this= m1*m2</span> +00747 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +00748 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> | m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>; +00749 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a7">MAT_VALIDALL</a>; +00750 +00751 <span class="comment">// Build Rot part.</span> +00752 <span class="comment">//===============</span> +00753 <span class="keywordtype">bool</span> M1Identity= ! m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>(); +00754 <span class="keywordtype">bool</span> M2Identity= ! m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>(); +00755 <span class="keywordtype">bool</span> M1ScaleOnly= ! (m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a1">MAT_ROT</a>); +00756 <span class="keywordtype">bool</span> M2ScaleOnly= ! (m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a1">MAT_ROT</a>); +00757 <span class="keywordtype">bool</span> MGeneralCase= !M1Identity && !M2Identity && !M1ScaleOnly && !M2ScaleOnly; +00758 +00759 +00760 <span class="comment">// Manage the most common general case first (optim the if ): blending of two rotations.</span> +00761 <span class="keywordflow">if</span>( MGeneralCase ) +00762 { +00763 <a class="code" href="a04734.html#a6">a11</a>= m1.a11*m2.a11 + m1.a12*m2.a21 + m1.a13*m2.a31; +00764 <a class="code" href="a04734.html#a11">a12</a>= m1.a11*m2.a12 + m1.a12*m2.a22 + m1.a13*m2.a32; +00765 <a class="code" href="a04734.html#a16">a13</a>= m1.a11*m2.a13 + m1.a12*m2.a23 + m1.a13*m2.a33; +00766 +00767 <a class="code" href="a04734.html#a7">a21</a>= m1.a21*m2.a11 + m1.a22*m2.a21 + m1.a23*m2.a31; +00768 <a class="code" href="a04734.html#a12">a22</a>= m1.a21*m2.a12 + m1.a22*m2.a22 + m1.a23*m2.a32; +00769 <a class="code" href="a04734.html#a17">a23</a>= m1.a21*m2.a13 + m1.a22*m2.a23 + m1.a23*m2.a33; +00770 +00771 <a class="code" href="a04734.html#a8">a31</a>= m1.a31*m2.a11 + m1.a32*m2.a21 + m1.a33*m2.a31; +00772 <a class="code" href="a04734.html#a13">a32</a>= m1.a31*m2.a12 + m1.a32*m2.a22 + m1.a33*m2.a32; +00773 <a class="code" href="a04734.html#a18">a33</a>= m1.a31*m2.a13 + m1.a32*m2.a23 + m1.a33*m2.a33; +00774 } +00775 <span class="comment">// If one of the 3x3 matrix is an identity, just do a copy</span> +00776 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( M1Identity || M2Identity ) +00777 { +00778 <span class="comment">// If both identity, then me too.</span> +00779 <span class="keywordflow">if</span>( M1Identity && M2Identity ) +00780 { +00781 <span class="comment">// just expand me (important because validated below)</span> +00782 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00783 } +00784 <span class="keywordflow">else</span> +00785 { +00786 <span class="comment">// Copy the non identity matrix.</span> +00787 <span class="keyword">const</span> <a class="code" href="a02851.html">CMatrix</a> *c= M2Identity? &m1 : &m2; +00788 <a class="code" href="a04734.html#a6">a11</a>= c->a11; <a class="code" href="a04734.html#a11">a12</a>= c->a12; <a class="code" href="a04734.html#a16">a13</a>= c->a13; +00789 <a class="code" href="a04734.html#a7">a21</a>= c->a21; <a class="code" href="a04734.html#a12">a22</a>= c->a22; <a class="code" href="a04734.html#a17">a23</a>= c->a23; +00790 <a class="code" href="a04734.html#a8">a31</a>= c->a31; <a class="code" href="a04734.html#a13">a32</a>= c->a32; <a class="code" href="a04734.html#a18">a33</a>= c->a33; +00791 } +00792 } +00793 <span class="comment">// If two 3x3 matrix are just scaleOnly matrix, do a scaleFact.</span> +00794 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( M1ScaleOnly && M2ScaleOnly ) +00795 { +00796 <span class="comment">// same process for scaleUni or scaleAny.</span> +00797 <a class="code" href="a04734.html#a6">a11</a>= m1.a11*m2.a11; <a class="code" href="a04734.html#a11">a12</a>= 0; <a class="code" href="a04734.html#a16">a13</a>= 0; +00798 <a class="code" href="a04734.html#a7">a21</a>= 0; <a class="code" href="a04734.html#a12">a22</a>= m1.a22*m2.a22; <a class="code" href="a04734.html#a17">a23</a>= 0; +00799 <a class="code" href="a04734.html#a8">a31</a>= 0; <a class="code" href="a04734.html#a13">a32</a>= 0; <a class="code" href="a04734.html#a18">a33</a>= m1.a33*m2.a33; +00800 } +00801 <span class="comment">// If one of the matrix is a scaleOnly matrix, do a scale*Rot.</span> +00802 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( M1ScaleOnly && !M2ScaleOnly ) +00803 { +00804 <a class="code" href="a04734.html#a6">a11</a>= m1.a11*m2.a11; <a class="code" href="a04734.html#a11">a12</a>= m1.a11*m2.a12; <a class="code" href="a04734.html#a16">a13</a>= m1.a11*m2.a13; +00805 <a class="code" href="a04734.html#a7">a21</a>= m1.a22*m2.a21; <a class="code" href="a04734.html#a12">a22</a>= m1.a22*m2.a22; <a class="code" href="a04734.html#a17">a23</a>= m1.a22*m2.a23; +00806 <a class="code" href="a04734.html#a8">a31</a>= m1.a33*m2.a31; <a class="code" href="a04734.html#a13">a32</a>= m1.a33*m2.a32; <a class="code" href="a04734.html#a18">a33</a>= m1.a33*m2.a33; +00807 } +00808 <span class="keywordflow">else</span> +00809 { +00810 <span class="comment">// This must be this case</span> +00811 <a class="code" href="a04199.html#a6">nlassert</a>(!M1ScaleOnly && M2ScaleOnly); +00812 <a class="code" href="a04734.html#a6">a11</a>= m1.a11*m2.a11; <a class="code" href="a04734.html#a11">a12</a>= m1.a12*m2.a22; <a class="code" href="a04734.html#a16">a13</a>= m1.a13*m2.a33; +00813 <a class="code" href="a04734.html#a7">a21</a>= m1.a21*m2.a11; <a class="code" href="a04734.html#a12">a22</a>= m1.a22*m2.a22; <a class="code" href="a04734.html#a17">a23</a>= m1.a23*m2.a33; +00814 <a class="code" href="a04734.html#a8">a31</a>= m1.a31*m2.a11; <a class="code" href="a04734.html#a13">a32</a>= m1.a32*m2.a22; <a class="code" href="a04734.html#a18">a33</a>= m1.a33*m2.a33; +00815 } +00816 +00817 <span class="comment">// If M1 has translate and M2 has projective, rotation is modified.</span> +00818 <span class="keywordflow">if</span>( m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() && m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00819 { +00820 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>; +00821 +00822 <a class="code" href="a04734.html#a6">a11</a>+= m1.a14*m2.a41; +00823 <a class="code" href="a04734.html#a11">a12</a>+= m1.a14*m2.a42; +00824 <a class="code" href="a04734.html#a16">a13</a>+= m1.a14*m2.a43; +00825 +00826 <a class="code" href="a04734.html#a7">a21</a>+= m1.a24*m2.a41; +00827 <a class="code" href="a04734.html#a12">a22</a>+= m1.a24*m2.a42; +00828 <a class="code" href="a04734.html#a17">a23</a>+= m1.a24*m2.a43; +00829 +00830 <a class="code" href="a04734.html#a8">a31</a>+= m1.a34*m2.a41; +00831 <a class="code" href="a04734.html#a13">a32</a>+= m1.a34*m2.a42; +00832 <a class="code" href="a04734.html#a18">a33</a>+= m1.a34*m2.a43; +00833 } +00834 +00835 <span class="comment">// Modify Scale.</span> +00836 <span class="keywordflow">if</span>( (<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>) && !(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>) ) +00837 { +00838 <span class="comment">// Must have correct Scale33</span> +00839 m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00840 m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00841 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>*m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00842 } +00843 <span class="keywordflow">else</span> +00844 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>=1; +00845 +00846 <span class="comment">// In every case, I am valid now!</span> +00847 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|=<a class="code" href="a04549.html#a5">MAT_VALIDROT</a>; +00848 +00849 +00850 <span class="comment">// Build Trans part.</span> +00851 <span class="comment">//=================</span> +00852 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a0">MAT_TRANS</a> ) +00853 { +00854 <span class="comment">// Compose M2 part.</span> +00855 <span class="keywordflow">if</span>( M1Identity ) +00856 { +00857 <a class="code" href="a04734.html#a21">a14</a>= m2.a14; +00858 <a class="code" href="a04734.html#a22">a24</a>= m2.a24; +00859 <a class="code" href="a04734.html#a23">a34</a>= m2.a34; +00860 } +00861 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (M1ScaleOnly ) +00862 { +00863 <a class="code" href="a04734.html#a21">a14</a>= m1.a11*m2.a14; +00864 <a class="code" href="a04734.html#a22">a24</a>= m1.a22*m2.a24; +00865 <a class="code" href="a04734.html#a23">a34</a>= m1.a33*m2.a34; +00866 } +00867 <span class="keywordflow">else</span> +00868 { +00869 <a class="code" href="a04734.html#a21">a14</a>= m1.a11*m2.a14 + m1.a12*m2.a24 + m1.a13*m2.a34; +00870 <a class="code" href="a04734.html#a22">a24</a>= m1.a21*m2.a14 + m1.a22*m2.a24 + m1.a23*m2.a34; +00871 <a class="code" href="a04734.html#a23">a34</a>= m1.a31*m2.a14 + m1.a32*m2.a24 + m1.a33*m2.a34; +00872 } +00873 <span class="comment">// Compose M1 part.</span> +00874 <span class="keywordflow">if</span>(m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a0">MAT_TRANS</a>) +00875 { +00876 <span class="keywordflow">if</span>(m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a4">MAT_PROJ</a>) +00877 { +00878 <a class="code" href="a04734.html#a21">a14</a>+= m1.a14*m2.a44; +00879 <a class="code" href="a04734.html#a22">a24</a>+= m1.a24*m2.a44; +00880 <a class="code" href="a04734.html#a23">a34</a>+= m1.a34*m2.a44; +00881 } +00882 <span class="keywordflow">else</span> +00883 { +00884 <a class="code" href="a04734.html#a21">a14</a>+= m1.a14; +00885 <a class="code" href="a04734.html#a22">a24</a>+= m1.a24; +00886 <a class="code" href="a04734.html#a23">a34</a>+= m1.a34; +00887 } +00888 } +00889 } +00890 +00891 +00892 <span class="comment">// Build Proj part.</span> +00893 <span class="comment">//=================</span> +00894 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a4">MAT_PROJ</a> ) +00895 { +00896 <span class="comment">// optimise nothing... (projection matrix are rare).</span> +00897 m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00898 m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +00899 m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00900 m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +00901 <a class="code" href="a04734.html#a9">a41</a>= m1.a41*m2.a11 + m1.a42*m2.a21 + m1.a43*m2.a31 + m1.a44*m2.a41; +00902 <a class="code" href="a04734.html#a14">a42</a>= m1.a41*m2.a12 + m1.a42*m2.a22 + m1.a43*m2.a32 + m1.a44*m2.a42; +00903 <a class="code" href="a04734.html#a19">a43</a>= m1.a41*m2.a13 + m1.a42*m2.a23 + m1.a43*m2.a33 + m1.a44*m2.a43; +00904 <a class="code" href="a04734.html#a24">a44</a>= m1.a41*m2.a14 + m1.a42*m2.a24 + m1.a43*m2.a34 + m1.a44*m2.a44; +00905 <span class="comment">// The proj is valid now</span> +00906 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>; +00907 } +00908 <span class="keywordflow">else</span> +00909 { +00910 <span class="comment">// Don't copy proj part, and leave MAT_VALIDPROJ not set</span> +00911 } +00912 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_6" doxytag="NLMISC::CMatrix::setMulMatrixNoProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setMulMatrixNoProj </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>m1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>m2</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Matrix multiplication assuming no projection at all in m1/m2 and Hence this. Even Faster than <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1967_5">setMulMatrix()</a> Equivalent to *this= m1 * m2 NB: Also always suppose m1 has a translation, for optim consideration <dl compact><dt><b>Warning:</b></dt><dd>*this MUST NOT be the same as m1 or m2, else it doesn't work (not checked/nlasserted)</dd></dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00702">702</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00102">hasScaleUniform()</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. +<p> +Referenced by <a class="el" href="a05491.html#l00155">NL3D::CBone::compute()</a>. +<p> +<div class="fragment"><pre>00703 { +00704 <span class="comment">/*</span> +00705 <span class="comment"> For a fast MulMatrix, it appears to be better to not take State bits into account (no test/if() overhead)</span> +00706 <span class="comment"> Just do heavy mul all the time (common case, and not so slow)</span> +00707 <span class="comment"> */</span> +00708 +00709 <span class="comment">// Ensure the src matrix have correct values in rot part</span> +00710 m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00711 m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +00712 +00713 <span class="comment">// Rot Mul</span> +00714 <a class="code" href="a04734.html#a6">a11</a>= m1.a11*m2.a11 + m1.a12*m2.a21 + m1.a13*m2.a31; +00715 <a class="code" href="a04734.html#a11">a12</a>= m1.a11*m2.a12 + m1.a12*m2.a22 + m1.a13*m2.a32; +00716 <a class="code" href="a04734.html#a16">a13</a>= m1.a11*m2.a13 + m1.a12*m2.a23 + m1.a13*m2.a33; +00717 +00718 <a class="code" href="a04734.html#a7">a21</a>= m1.a21*m2.a11 + m1.a22*m2.a21 + m1.a23*m2.a31; +00719 <a class="code" href="a04734.html#a12">a22</a>= m1.a21*m2.a12 + m1.a22*m2.a22 + m1.a23*m2.a32; +00720 <a class="code" href="a04734.html#a17">a23</a>= m1.a21*m2.a13 + m1.a22*m2.a23 + m1.a23*m2.a33; +00721 +00722 <a class="code" href="a04734.html#a8">a31</a>= m1.a31*m2.a11 + m1.a32*m2.a21 + m1.a33*m2.a31; +00723 <a class="code" href="a04734.html#a13">a32</a>= m1.a31*m2.a12 + m1.a32*m2.a22 + m1.a33*m2.a32; +00724 <a class="code" href="a04734.html#a18">a33</a>= m1.a31*m2.a13 + m1.a32*m2.a23 + m1.a33*m2.a33; +00725 +00726 <span class="comment">// Trans mul</span> +00727 <a class="code" href="a04734.html#a21">a14</a>= m1.a11*m2.a14 + m1.a12*m2.a24 + m1.a13*m2.a34 + m1.a14; +00728 <a class="code" href="a04734.html#a22">a24</a>= m1.a21*m2.a14 + m1.a22*m2.a24 + m1.a23*m2.a34 + m1.a24; +00729 <a class="code" href="a04734.html#a23">a34</a>= m1.a31*m2.a14 + m1.a32*m2.a24 + m1.a33*m2.a34 + m1.a34; +00730 +00731 <span class="comment">// Setup no proj at all, and force valid rot (still may be identity, but 0/1 are filled)</span> +00732 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>= (m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> | m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> | <a class="code" href="a04549.html#a5">MAT_VALIDROT</a>) & ~(<a class="code" href="a04549.html#a4">MAT_PROJ</a>|<a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>); +00733 +00734 <span class="comment">// Modify Scale. This test is important because Scale33 may be a #NAN if SCALEANY => avoid very slow mul.</span> +00735 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform</a>() ) +00736 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= m1.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>*m2.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>; +00737 <span class="keywordflow">else</span> +00738 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>=1; +00739 +00740 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_4" doxytag="NLMISC::CMatrix::setPos" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setPos </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Translation component. v==Null is tested to see if the matrix now have a translation component. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>v</em> </td><td>the translation vector.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00267">267</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +Referenced by <a class="el" href="a05532.html#l00048">NL3D::CCameraCol::build()</a>, <a class="el" href="a06287.html#l00112">NL3D::CPSZonePlane::buildBasis()</a>, <a class="el" href="a06190.html#l00141">NLMISC::CPolygon::buildBasis()</a>, <a class="el" href="a06766.html#l00212">NLLIGO::CZoneEdge::buildMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a05557.html#l00437">NL3D::CCloud::calcBill()</a>, <a class="el" href="a05870.html#l00143">NL3D::CLandscapeModel::clipAndRenderLandscape()</a>, <a class="el" href="a05491.html#l00155">NL3D::CBone::compute()</a>, <a class="el" href="a06273.html#l00366">NL3D::ComputeRibbonSlice()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a06350.html#l01224">NL3D::CInstanceGroup::displayDebugClusters()</a>, <a class="el" href="a05935.html#l00736">NL3D::CLodCharacterManager::endRender()</a>, <a class="el" href="a05557.html#l00509">NL3D::CCloud::genBill()</a>, <a class="el" href="a06393.html#l01781">NL3D::CSkeletonModel::generateShadowMap()</a>, <a class="el" href="a06001.html#l00166">NL3D::CMeshInstance::generateShadowMap()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, <a class="el" href="a06287.html#l01419">NL3D::CPSZoneRectangle::getMatrix()</a>, <a class="el" href="a06287.html#l01212">NL3D::CPSZoneCylinder::getMatrix()</a>, <a class="el" href="a06239.html#l00933">NL3D::CPSCylindricVortex::getMatrix()</a>, <a class="el" href="a06229.html#l02331">NL3D::CPSEmitterRectangle::getMatrix()</a>, <a class="el" href="a06722.html#l00081">NL3D::CViewport::getRayWithPoint()</a>, <a class="el" href="a05686.html#l00341">NL3D::CEvent3dMouseListener::getViewMatrix()</a>, <a class="el" href="a06768.html#l00741">InitZBuffer()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a05824.html#l00305">NL3D::CInstanceLighter::light()</a>, <a class="el" href="a05824.html#l01502">NL3D::CInstanceLighter::lightIgSimple()</a>, <a class="el" href="a06768.html#l02927">NL3D::CZoneLighter::lightWater()</a>, <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, <a class="el" href="a05686.html#l00089">NL3D::CEvent3dMouseListener::operator()()</a>, <a class="el" href="a06285.html#l00235">NL3D::CPSUtil::print()</a>, <a class="el" href="a06698.html#l01713">NL3D::CVegetableManager::render()</a>, <a class="el" href="a06374.html#l00192">NL3D::CShadowPolyReceiver::render()</a>, <a class="el" href="a06358.html#l00141">NL3D::CSegRemanence::render()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a06393.html#l02062">NL3D::CSkeletonModel::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a06001.html#l00367">NL3D::CMeshInstance::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a06372.html#l00445">NL3D::CShadowMapManager::renderProject()</a>, <a class="el" href="a05649.html#l00124">NL3D::CDriverGL::setupModelMatrix()</a>, <a class="el" href="a05935.html#l00776">NL3D::CLodCharacterManager::setupNormalCorrectionMatrix()</a>, <a class="el" href="a05649.html#l00086">NL3D::CDriverGL::setupViewMatrix()</a>, <a class="el" href="a05649.html#l00053">NL3D::CDriverGL::setupViewMatrixEx()</a>, <a class="el" href="a06688.html#l00065">NL3D::CVegetableBlendLayerModel::setWorldPos()</a>, <a class="el" href="a06287.html#l01375">NL3D::CPSZoneRectangle::show()</a>, <a class="el" href="a06287.html#l01160">NL3D::CPSZoneCylinder::show()</a>, <a class="el" href="a06287.html#l00625">NL3D::CPSZoneDisc::show()</a>, <a class="el" href="a06229.html#l02391">NL3D::CPSEmitterRectangle::showTool()</a>, <a class="el" href="a06737.html#l00437">NL3D::CWaterModel::traverseRender()</a>, and <a class="el" href="a05437.html#l00197">NL3D::CAnimatedMaterial::update()</a>. +<p> +<div class="fragment"><pre>00268 { +00269 <a class="code" href="a04734.html#a21">a14</a>= <a class="code" href="a04223.html#a576">v</a>.x; +00270 <a class="code" href="a04734.html#a22">a24</a>= <a class="code" href="a04223.html#a576">v</a>.y; +00271 <a class="code" href="a04734.html#a23">a34</a>= <a class="code" href="a04223.html#a576">v</a>.z; +00272 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a21">a14</a>!=0 || <a class="code" href="a04734.html#a22">a24</a>!=0 || <a class="code" href="a04734.html#a23">a34</a>!=0) +00273 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00274 <span class="keywordflow">else</span> +00275 <span class="comment">// The trans is identity</span> +00276 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00277 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_5" doxytag="NLMISC::CMatrix::setProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setProj </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const float </td> + <td class="mdname1" valign="top" nowrap> <em>proj</em>[4] </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Projection component. Proj is tested to see if the matrix now have a projection component. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>proj</em> </td><td>the 4th line of the matrix. Set it to 0 0 0 1 to reset it to default.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00291">291</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00292 { +00293 <a class="code" href="a04734.html#a9">a41</a>= proj[0]; +00294 <a class="code" href="a04734.html#a14">a42</a>= proj[1]; +00295 <a class="code" href="a04734.html#a19">a43</a>= proj[2]; +00296 <a class="code" href="a04734.html#a24">a44</a>= proj[3]; +00297 +00298 <span class="comment">// Check Proj state.</span> +00299 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a9">a41</a>!=0 || <a class="code" href="a04734.html#a14">a42</a>!=0 || <a class="code" href="a04734.html#a19">a43</a>!=0 || <a class="code" href="a04734.html#a24">a44</a>!=1) +00300 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00301 <span class="keywordflow">else</span> +00302 { +00303 <span class="comment">// The proj is identity, and is correcly setup!</span> +00304 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00305 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>; +00306 } +00307 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_6" doxytag="NLMISC::CMatrix::setRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>matrix</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation/Scale matrix (base) with the rotation part of an other matrix. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>matrix</em> </td><td>the matrix to copy rot part.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00243">243</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00102">hasScaleUniform()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05646.html#l00243">matrix</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00244 { +00245 <span class="comment">// copy rotpart statebit from other.</span> +00246 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>); +00247 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04223.html#a578">matrix</a>.StateBit & (<a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>); +00248 <span class="comment">// copy values.</span> +00249 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00250 { +00251 <a class="code" href="a04734.html#a6">a11</a>= <a class="code" href="a04223.html#a578">matrix</a>.a11; <a class="code" href="a04734.html#a11">a12</a>= <a class="code" href="a04223.html#a578">matrix</a>.a12; <a class="code" href="a04734.html#a16">a13</a>= <a class="code" href="a04223.html#a578">matrix</a>.a13; +00252 <a class="code" href="a04734.html#a7">a21</a>= <a class="code" href="a04223.html#a578">matrix</a>.a21; <a class="code" href="a04734.html#a12">a22</a>= <a class="code" href="a04223.html#a578">matrix</a>.a22; <a class="code" href="a04734.html#a17">a23</a>= <a class="code" href="a04223.html#a578">matrix</a>.a23; +00253 <a class="code" href="a04734.html#a8">a31</a>= <a class="code" href="a04223.html#a578">matrix</a>.a31; <a class="code" href="a04734.html#a13">a32</a>= <a class="code" href="a04223.html#a578">matrix</a>.a32; <a class="code" href="a04734.html#a18">a33</a>= <a class="code" href="a04223.html#a578">matrix</a>.a33; +00254 <span class="comment">// if has scale uniform, copy from matrix.</span> +00255 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1970_3">hasScaleUniform</a>()) +00256 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= <a class="code" href="a04223.html#a578">matrix</a>.Scale33; +00257 } +00258 <span class="keywordflow">else</span> +00259 { +00260 <span class="comment">// we are rot identity, with undefined values.</span> +00261 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a5">MAT_VALIDROT</a>; +00262 } +00263 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_7" doxytag="NLMISC::CMatrix::setRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03296.html">CQuat</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>quat</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation matrix (base) as a Quaternion rotation matrix. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>quat</em> </td><td>a UNIT qauternion</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l01347">1347</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06308.html#l00103">NLMISC::CQuatT< float >::isIdentity()</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::w</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::x</a>, <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::y</a>, and <a class="el" href="a06308.html#l00077">NLMISC::CQuatT< float >::z</a>. +<p> +<div class="fragment"><pre>01348 { +01349 <span class="comment">// A quaternion do not have scale.</span> +01350 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>); +01351 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= 1.0f; +01352 <span class="keywordflow">if</span>(quat.isIdentity()) +01353 { +01354 <a class="code" href="a04734.html#a6">a11</a>= 1; <a class="code" href="a04734.html#a11">a12</a>= 0; <a class="code" href="a04734.html#a16">a13</a>= 0; +01355 <a class="code" href="a04734.html#a7">a21</a>= 0; <a class="code" href="a04734.html#a12">a22</a>= 1; <a class="code" href="a04734.html#a17">a23</a>= 0; +01356 <a class="code" href="a04734.html#a8">a31</a>= 0; <a class="code" href="a04734.html#a13">a32</a>= 0; <a class="code" href="a04734.html#a18">a33</a>= 1; +01357 } +01358 <span class="keywordflow">else</span> +01359 { +01360 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a>; +01361 <span class="keywordtype">float</span> wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; +01362 +01363 <span class="comment">// calculate coefficients</span> +01364 x2 = quat.x + quat.x; y2 = quat.y + quat.y; +01365 z2 = quat.z + quat.z; +01366 xx = quat.x * x2; xy = quat.x * y2; xz = quat.x * z2; +01367 yy = quat.y * y2; yz = quat.y * z2; zz = quat.z * z2; +01368 wx = quat.w * x2; wy = quat.w * y2; wz = quat.w * z2; +01369 +01370 <a class="code" href="a04734.html#a6">a11</a> = 1.0f - (yy + zz); +01371 <a class="code" href="a04734.html#a11">a12</a> = xy - wz; +01372 <a class="code" href="a04734.html#a16">a13</a> = xz + wy; +01373 +01374 <a class="code" href="a04734.html#a7">a21</a> = xy + wz; +01375 <a class="code" href="a04734.html#a12">a22</a> = 1.0f - (xx + zz); +01376 <a class="code" href="a04734.html#a17">a23</a> = yz - wx; +01377 +01378 <a class="code" href="a04734.html#a8">a31</a> = xz - wy; +01379 <a class="code" href="a04734.html#a13">a32</a> = yz + wx; +01380 <a class="code" href="a04734.html#a18">a33</a> = 1.0f - (xx + yy); +01381 } +01382 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_8" doxytag="NLMISC::CMatrix::setRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>v</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02851.html#NLMISC_1_1CMatrixw0">TRotOrder</a> </td> + <td class="mdname" nowrap> <em>ro</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation matrix (base) as a Euler rotation matrix. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>v</em> </td><td>a vector of 3 angle (in radian), giving rotation around each axis (x,y,z) </td></tr> + <tr><td valign=top><em>ro</em> </td><td>the order of transformation applied. if ro==XYZ, then the transform is M=M*Rx*Ry*Rz</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00231">231</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00353">getRot()</a>, <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a05972.html#l00618">rotate()</a>, <a class="el" href="a05972.html#l00209">setRot()</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +<div class="fragment"><pre>00232 { +00233 <a class="code" href="a02851.html">CMatrix</a> rot; +00234 rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a>(); +00235 rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1965_1">rotate</a>(v, ro); +00236 <span class="keywordtype">float</span> m33[9]; +00237 rot.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_11">getRot</a>(m33); +00238 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_10">setRot</a>(m33, <span class="keyword">true</span>); +00239 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_9" doxytag="NLMISC::CMatrix::setRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const float </td> + <td class="mdname" nowrap> <em>m33</em>[9], </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>hintNoScale</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation/Scale matrix (base). Avoid it. It implies low compute since no check is done on m33 to see what type of matrix it is (identity, raotation, scale, uniform scale) <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>m33</em> </td><td>the 3*3 column rotation matrix. (3x3 matrix stored in column-major order as 9 consecutive values) </td></tr> + <tr><td valign=top><em>hintNoScale</em> </td><td>set it to true if you are sure that your rot matrix is a pure rot matrix with no scale. If set to true and your rotation is not an orthonormal basis, unpredictable result are excepted.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00220">220</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +<div class="fragment"><pre>00221 { +00222 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>; +00223 <span class="keywordflow">if</span>(hintNoScale) +00224 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>); +00225 <a class="code" href="a04734.html#a6">a11</a>= m33[0]; <a class="code" href="a04734.html#a11">a12</a>= m33[3]; <a class="code" href="a04734.html#a16">a13</a>= m33[6]; +00226 <a class="code" href="a04734.html#a7">a21</a>= m33[1]; <a class="code" href="a04734.html#a12">a22</a>= m33[4]; <a class="code" href="a04734.html#a17">a23</a>= m33[7]; +00227 <a class="code" href="a04734.html#a8">a31</a>= m33[2]; <a class="code" href="a04734.html#a13">a32</a>= m33[5]; <a class="code" href="a04734.html#a18">a33</a>= m33[8]; +00228 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= 1.0f; +00229 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_10" doxytag="NLMISC::CMatrix::setRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setRot </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>i</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>j</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>k</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>hintNoScale</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation/Scale matrix (base). Avoid it. It implies low compute since no check is done on base to see what type of matrix it is (identity, rotation, scale, uniform scale...) <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>i</em> </td><td>The I vector of the cartesian base. </td></tr> + <tr><td valign=top><em>j</em> </td><td>The J vector of the cartesian base. </td></tr> + <tr><td valign=top><em>k</em> </td><td>The K vector of the cartesian base. </td></tr> + <tr><td valign=top><em>hintNoScale</em> </td><td>set it to true if you are sure that your rot matrix is a pure rot matrix with no scale. If set to true and your rotation is not an orthonormal basis, unpredictable result are excepted.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00209">209</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a05532.html#l00048">NL3D::CCameraCol::build()</a>, <a class="el" href="a06190.html#l00141">NLMISC::CPolygon::buildBasis()</a>, <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06370.html#l00167">NL3D::CShadowMap::buildProjectionInfos()</a>, <a class="el" href="a06285.html#l00257">NL3D::CPSUtil::buildSchmidtBasis()</a>, <a class="el" href="a05557.html#l00437">NL3D::CCloud::calcBill()</a>, <a class="el" href="a05618.html#l00109">NL3D::CCubeGrid< TCell >::CCubeGrid()</a>, <a class="el" href="a06566.html#l00430">CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile()</a>, <a class="el" href="a06737.html#l00344">NL3D::ComputeUpMatrix()</a>, <a class="el" href="a06372.html#l00059">NL3D::CShadowMapManager::CShadowMapManager()</a>, <a class="el" href="a05968.html#l00523">NL3D::CMaterial::decompUserTexMat()</a>, <a class="el" href="a05557.html#l00328">NL3D::CCloud::disp()</a>, <a class="el" href="a06350.html#l01224">NL3D::CInstanceGroup::displayDebugClusters()</a>, <a class="el" href="a06250.html#l00521">NL3D::CPSConstraintMeshHelper::drawMeshs()</a>, <a class="el" href="a06483.html#l00062">NL3D::CTargetAnimCtrl::execute()</a>, <a class="el" href="a05557.html#l00509">NL3D::CCloud::genBill()</a>, <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>, <a class="el" href="a06162.html#l00050">NL3D::CPatch::generateTileVegetable()</a>, <a class="el" href="a06287.html#l01419">NL3D::CPSZoneRectangle::getMatrix()</a>, <a class="el" href="a06287.html#l01212">NL3D::CPSZoneCylinder::getMatrix()</a>, <a class="el" href="a06229.html#l02331">NL3D::CPSEmitterRectangle::getMatrix()</a>, <a class="el" href="a05491.html#l00233">NL3D::CBone::interpolateBoneSkinMatrix()</a>, <a class="el" href="a05824.html#l00305">NL3D::CInstanceLighter::light()</a>, <a class="el" href="a05824.html#l01502">NL3D::CInstanceLighter::lightIgSimple()</a>, <a class="el" href="a06768.html#l02927">NL3D::CZoneLighter::lightWater()</a>, <a class="el" href="a06574.html#l00169">NL3D::ITransformable::lookAt()</a>, <a class="el" href="a06250.html#l01531">NL3D::CPSConstraintMesh::makePrerotatedVb()</a>, <a class="el" href="a06393.html#l02062">NL3D::CSkeletonModel::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a06001.html#l00367">NL3D::CMeshInstance::renderIntoSkeletonShadowMap()</a>, <a class="el" href="a05972.html#l00636">rotate()</a>, <a class="el" href="a06306.html#l00817">NL3D::CQuadTree< T >::selectRay()</a>, <a class="el" href="a06306.html#l00848">NL3D::CQuadTree< T >::selectSegment()</a>, <a class="el" href="a05657.html#l00464">NL3D::CDriverUser::setMatrixMode2D()</a>, <a class="el" href="a05557.html#l00751">NL3D::CCloud::setMode2D()</a>, <a class="el" href="a05972.html#l00231">setRot()</a>, <a class="el" href="a06024.html#l00228">NL3D::CMeshVPWindTree::setupPerInstanceConstants()</a>, <a class="el" href="a06273.html#l01107">NL3D::CPSRibbon::setupTextureMatrix()</a>, <a class="el" href="a06279.html#l00267">NL3D::CPSShockWave::setupUFactor()</a>, <a class="el" href="a05649.html#l00086">NL3D::CDriverGL::setupViewMatrix()</a>, <a class="el" href="a05649.html#l00053">NL3D::CDriverGL::setupViewMatrixEx()</a>, <a class="el" href="a06287.html#l01375">NL3D::CPSZoneRectangle::show()</a>, <a class="el" href="a06287.html#l01160">NL3D::CPSZoneCylinder::show()</a>, <a class="el" href="a06244.html#l00363">NL3D::CPSLight::show()</a>, <a class="el" href="a06229.html#l02391">NL3D::CPSEmitterRectangle::showTool()</a>, <a class="el" href="a05437.html#l00197">NL3D::CAnimatedMaterial::update()</a>, <a class="el" href="a06737.html#l01339">NL3D::CWaterModel::updateDiffuseMapMatrix()</a>, and <a class="el" href="a06250.html#l00295">NL3D::CPSMesh::updatePos()</a>. +<p> +<div class="fragment"><pre>00210 { +00211 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a>; +00212 <span class="keywordflow">if</span>(hintNoScale) +00213 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>); +00214 <a class="code" href="a04734.html#a6">a11</a>= i.x; <a class="code" href="a04734.html#a11">a12</a>= j.x; <a class="code" href="a04734.html#a16">a13</a>= k.x; +00215 <a class="code" href="a04734.html#a7">a21</a>= i.y; <a class="code" href="a04734.html#a12">a22</a>= j.y; <a class="code" href="a04734.html#a17">a23</a>= k.y; +00216 <a class="code" href="a04734.html#a8">a31</a>= i.z; <a class="code" href="a04734.html#a13">a32</a>= j.z; <a class="code" href="a04734.html#a18">a33</a>= k.z; +00217 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= 1.0f; +00218 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_11" doxytag="NLMISC::CMatrix::setScale" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setScale </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation). case where <a class="el" href="a04223.html#a572">v.x</a>==v.y==v.z is tested to set a uniform scale <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>scale</em> </td><td>the scale to set</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l01478">1478</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05972.html#l01459">setScaleUni()</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +<div class="fragment"><pre>01479 { +01480 <span class="comment">// actually a scale uniform?</span> +01481 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a576">v</a>.x==<a class="code" href="a04223.html#a576">v</a>.y && <a class="code" href="a04223.html#a576">v</a>.x==<a class="code" href="a04223.html#a576">v</a>.z) +01482 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd8">setScaleUni</a>(<a class="code" href="a04223.html#a576">v</a>.x); +01483 +01484 <span class="comment">// A Scale matrix do not have rotation.</span> +01485 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a> | <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>); +01486 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a3">MAT_SCALEANY</a> | <a class="code" href="a04549.html#a5">MAT_VALIDROT</a>; +01487 <a class="code" href="a04734.html#a6">a11</a>= <a class="code" href="a04223.html#a576">v</a>.x; <a class="code" href="a04734.html#a11">a12</a>= 0; <a class="code" href="a04734.html#a16">a13</a>= 0; +01488 <a class="code" href="a04734.html#a7">a21</a>= 0; <a class="code" href="a04734.html#a12">a22</a>= <a class="code" href="a04223.html#a576">v</a>.y; <a class="code" href="a04734.html#a17">a23</a>= 0; +01489 <a class="code" href="a04734.html#a8">a31</a>= 0; <a class="code" href="a04734.html#a13">a32</a>= 0; <a class="code" href="a04734.html#a18">a33</a>= <a class="code" href="a04223.html#a576">v</a>.z; +01490 +01491 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1961_12" doxytag="NLMISC::CMatrix::setScale" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setScale </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>scale</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation). 1 is tested to update bits accordingly <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>scale</em> </td><td>the scale to set</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05972.html#l01471">1471</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l01459">setScaleUni()</a>. +<p> +Referenced by <a class="el" href="a05491.html#l00155">NL3D::CBone::compute()</a>. +<p> +<div class="fragment"><pre>01472 { +01473 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd8">setScaleUni</a>(scale); +01474 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd8" doxytag="NLMISC::CMatrix::setScaleUni" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::setScaleUni </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>scale</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01459">1459</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a05972.html#l00051">MAT_ROT</a>, <a class="el" href="a05972.html#l00053">MAT_SCALEANY</a>, <a class="el" href="a05972.html#l00052">MAT_SCALEUNI</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01471">setScale()</a>. +<p> +<div class="fragment"><pre>01460 { +01461 <span class="comment">// A Scale matrix do not have rotation.</span> +01462 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a1">MAT_ROT</a> | <a class="code" href="a04549.html#a3">MAT_SCALEANY</a> | <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>); +01463 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a2">MAT_SCALEUNI</a> | <a class="code" href="a04549.html#a5">MAT_VALIDROT</a>; +01464 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= scale; +01465 <a class="code" href="a04734.html#a6">a11</a>= scale; <a class="code" href="a04734.html#a11">a12</a>= 0; <a class="code" href="a04734.html#a16">a13</a>= 0; +01466 <a class="code" href="a04734.html#a7">a21</a>= 0; <a class="code" href="a04734.html#a12">a22</a>= scale; <a class="code" href="a04734.html#a17">a23</a>= 0; +01467 <a class="code" href="a04734.html#a8">a31</a>= 0; <a class="code" href="a04734.html#a13">a32</a>= 0; <a class="code" href="a04734.html#a18">a33</a>= scale; +01468 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd9" doxytag="NLMISC::CMatrix::slowInvert33" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::slowInvert33 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>ret</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00999">999</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00419">getI()</a>, <a class="el" href="a05972.html#l00427">getJ()</a>, <a class="el" href="a05972.html#l00435">getK()</a>, <a class="el" href="a05646.html#l00977">s</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01090">inverted()</a>. +<p> +<div class="fragment"><pre>01000 { +01001 CVector invi,invj,invk; +01002 CVector i,j,k; +01003 <span class="keywordtype">double</span> <a class="code" href="a04223.html#a626">s</a>; +01004 +01005 i= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_2">getI</a>(); +01006 j= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_3">getJ</a>(); +01007 k= <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1963_4">getK</a>(); +01008 <span class="comment">// Compute cofactors (minors *(-1)^(i+j)).</span> +01009 invi.x= j.y*k.z - k.y*j.z; +01010 invi.y= j.z*k.x - k.z*j.x; +01011 invi.z= j.x*k.y - k.x*j.y; +01012 invj.x= k.y*i.z - i.y*k.z; +01013 invj.y= k.z*i.x - i.z*k.x; +01014 invj.z= k.x*i.y - i.x*k.y; +01015 invk.x= i.y*j.z - j.y*i.z; +01016 invk.y= i.z*j.x - j.z*i.x; +01017 invk.z= i.x*j.y - j.x*i.y; +01018 <span class="comment">// compute determinant.</span> +01019 <a class="code" href="a04223.html#a626">s</a>= invi.x*i.x + invj.x*j.x + invk.x*k.x; +01020 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a626">s</a>==0) +01021 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01022 <span class="comment">// Transpose the Comatrice, and divide by determinant.</span> +01023 <a class="code" href="a04223.html#a626">s</a>=1.0/<a class="code" href="a04223.html#a626">s</a>; +01024 ret.a11= (<span class="keywordtype">float</span>)(invi.x*<a class="code" href="a04223.html#a626">s</a>); ret.a12= (<span class="keywordtype">float</span>)(invi.y*<a class="code" href="a04223.html#a626">s</a>); ret.a13= (<span class="keywordtype">float</span>)(invi.z*<a class="code" href="a04223.html#a626">s</a>); +01025 ret.a21= (<span class="keywordtype">float</span>)(invj.x*<a class="code" href="a04223.html#a626">s</a>); ret.a22= (<span class="keywordtype">float</span>)(invj.y*<a class="code" href="a04223.html#a626">s</a>); ret.a23= (<span class="keywordtype">float</span>)(invj.z*<a class="code" href="a04223.html#a626">s</a>); +01026 ret.a31= (<span class="keywordtype">float</span>)(invk.x*<a class="code" href="a04223.html#a626">s</a>); ret.a32= (<span class="keywordtype">float</span>)(invk.y*<a class="code" href="a04223.html#a626">s</a>); ret.a33= (<span class="keywordtype">float</span>)(invk.z*<a class="code" href="a04223.html#a626">s</a>); +01027 +01028 <span class="keywordflow">return</span> <span class="keyword">true</span>; +01029 <span class="comment">// Roundly 82 cycles. (1Div=10 cycles).</span> +01030 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd10" doxytag="NLMISC::CMatrix::slowInvert44" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool NLMISC::CMatrix::slowInvert44 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>ret</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01032">1032</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05973.html#l00372">getCofactIndex()</a>, <a class="el" href="a05973.html#l00362">mat()</a>, <a class="el" href="a05646.html#l00977">s</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +Referenced by <a class="el" href="a05972.html#l01090">inverted()</a>. +<p> +<div class="fragment"><pre>01033 { +01034 <a class="code" href="a04558.html#a14">sint</a> i,j; +01035 <span class="keywordtype">double</span> <a class="code" href="a04223.html#a626">s</a>; +01036 +01037 <span class="comment">// Compute Cofactors</span> +01038 <span class="comment">//==================</span> +01039 <span class="keywordflow">for</span>(i=0;i<=3;i++) +01040 { +01041 <span class="keywordflow">for</span>(j=0;j<=3;j++) +01042 { +01043 <a class="code" href="a04558.html#a14">sint</a> l1,l2,l3; +01044 <a class="code" href="a04558.html#a14">sint</a> c1,c2,c3; +01045 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd1">getCofactIndex</a>(i,l1,l2,l3); +01046 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd1">getCofactIndex</a>(j,c1,c2,c3); +01047 +01048 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)= 0; +01049 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)+= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c1) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c2) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c3); +01050 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)+= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c2) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c3) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c1); +01051 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)+= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c3) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c1) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c2); +01052 +01053 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)-= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c1) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c3) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c2); +01054 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)-= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c2) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c1) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c3); +01055 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)-= <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l1,c3) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l2,c2) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(l3,c1); +01056 +01057 <span class="keywordflow">if</span>( (i+j)&1 ) +01058 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)=-ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j); +01059 } +01060 } +01061 +01062 <span class="comment">// Compute determinant.</span> +01063 <span class="comment">//=====================</span> +01064 <a class="code" href="a04223.html#a626">s</a>= ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,0) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,0) + ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,1) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,1) + ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,2) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,2) + ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,3) * <a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(0,3); +01065 <span class="keywordflow">if</span>(<a class="code" href="a04223.html#a626">s</a>==0) +01066 <span class="keywordflow">return</span> <span class="keyword">false</span>; +01067 +01068 <span class="comment">// Divide by determinant.</span> +01069 <span class="comment">//=======================</span> +01070 <a class="code" href="a04223.html#a626">s</a>=1.0/<a class="code" href="a04223.html#a626">s</a>; +01071 <span class="keywordflow">for</span>(i=0;i<=3;i++) +01072 { +01073 <span class="keywordflow">for</span>(j=0;j<=3;j++) +01074 ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)= (<span class="keywordtype">float</span>)(ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j)*<a class="code" href="a04223.html#a626">s</a>); +01075 } +01076 +01077 <span class="comment">// Transpose the comatrice.</span> +01078 <span class="comment">//=========================</span> +01079 <span class="keywordflow">for</span>(i=0;i<=3;i++) +01080 { +01081 <span class="keywordflow">for</span>(j=i+1;j<=3;j++) +01082 { +01083 swap(ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(i,j), ret.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd7">mat</a>(j,i)); +01084 } +01085 } +01086 +01087 <span class="keywordflow">return</span> <span class="keyword">true</span>; +01088 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd11" doxytag="NLMISC::CMatrix::testExpandProj" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::testExpandProj </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00149">149</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00443">get()</a>, <a class="el" href="a05972.html#l01090">inverted()</a>, <a class="el" href="a05972.html#l01308">NLMISC::operator *()</a>, <a class="el" href="a05972.html#l01290">operator *()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, and <a class="el" href="a05972.html#l00935">transpose()</a>. +<p> +<div class="fragment"><pre>00150 { +00151 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00152 <span class="keywordflow">return</span>; +00153 <span class="keywordflow">if</span>(!(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&<a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>)) +00154 { +00155 <a class="code" href="a02851.html">CMatrix</a> *self= const_cast<CMatrix*>(<span class="keyword">this</span>); +00156 self-><a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|=<a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>; +00157 self->a41=0; self->a42=0; self->a43=0; self->a44=1; +00158 } +00159 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixd12" doxytag="NLMISC::CMatrix::testExpandRot" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::testExpandRot </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00135">135</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00057">MAT_VALIDROT</a>, <a class="el" href="a05973.html#l00354">Scale33</a>, and <a class="el" href="a05973.html#l00355">StateBit</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00443">get()</a>, <a class="el" href="a05972.html#l01090">inverted()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05972.html#l01308">NLMISC::operator *()</a>, <a class="el" href="a05972.html#l01290">operator *()</a>, <a class="el" href="a05972.html#l00498">rotateX()</a>, <a class="el" href="a05972.html#l00538">rotateY()</a>, <a class="el" href="a05972.html#l00578">rotateZ()</a>, <a class="el" href="a05972.html#l00644">scale()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, and <a class="el" href="a05972.html#l00702">setMulMatrixNoProj()</a>. +<p> +<div class="fragment"><pre>00136 { +00137 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00138 <span class="keywordflow">return</span>; +00139 <span class="keywordflow">if</span>(!(<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&<a class="code" href="a04549.html#a5">MAT_VALIDROT</a>)) +00140 { +00141 <a class="code" href="a02851.html">CMatrix</a> *self= const_cast<CMatrix*>(<span class="keyword">this</span>); +00142 self-><a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|=<a class="code" href="a04549.html#a5">MAT_VALIDROT</a>; +00143 self->a11= 1; self->a12=0; self->a13=0; +00144 self->a21= 0; self->a22=1; self->a23=0; +00145 self->a31= 0; self->a32=0; self->a33=1; +00146 self-><a class="code" href="a02851.html#NLMISC_1_1CMatrixr1">Scale33</a>= 1; +00147 } +00148 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1965_7" doxytag="NLMISC::CMatrix::translate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::translate </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>v</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Apply a translation to the matrix. same as M=M*T. +<p> +Get Euler angles (in radians). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>ro</em> </td><td>the RotOrder which show how to get the euler. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>one solution of Euler angle. A <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1965_1">rotate()</a> with this value and the RotOrder ro will give the same matrix. </dd></dl> +<dl compact><dt><b><a class="el" href="todo.html#_todo000047">Todo:</a></b></dt><dd>yoyo: implement it. </dd></dl> + +<p> +Definition at line <a class="el" href="a05972.html#l00470">470</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01426">a11</a>, <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01433">a22</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, <a class="el" href="a06157.html#l01440">a33</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a06157.html#l01447">a44</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, and <a class="el" href="a05646.html#l00237">v</a>. +<p> +Referenced by <a class="el" href="a06370.html#l00135">NL3D::CShadowMap::buildCasterCameraMatrix()</a>, <a class="el" href="a06350.html#l00205">NL3D::CInstanceGroup::getInstanceMatrix()</a>, <a class="el" href="a06287.html#l00668">NL3D::CPSZoneDisc::getMatrix()</a>, <a class="el" href="a06287.html#l00477">NL3D::CPSZoneSphere::getMatrix()</a>, <a class="el" href="a06229.html#l02520">NL3D::CPSSphericalEmitter::getMatrix()</a>, <a class="el" href="a06741.html#l00609">NL3D::CWaterShape::getShapeInWorldSpace()</a>, <a class="el" href="a06239.html#l00413">NL3D::CPSGravity::show()</a>, <a class="el" href="a06574.html#l00141">NL3D::ITransformable::updateMatrix()</a>, and <a class="el" href="a06250.html#l00295">NL3D::CPSMesh::updatePos()</a>. +<p> +<div class="fragment"><pre>00471 { +00472 <span class="comment">// SetTrans.</span> +00473 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>() ) +00474 { +00475 <a class="code" href="a04734.html#a21">a14</a>+= <a class="code" href="a04734.html#a6">a11</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a11">a12</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a16">a13</a>*<a class="code" href="a04223.html#a576">v</a>.z; +00476 <a class="code" href="a04734.html#a22">a24</a>+= <a class="code" href="a04734.html#a7">a21</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a12">a22</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a17">a23</a>*<a class="code" href="a04223.html#a576">v</a>.z; +00477 <a class="code" href="a04734.html#a23">a34</a>+= <a class="code" href="a04734.html#a8">a31</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a13">a32</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a18">a33</a>*<a class="code" href="a04223.html#a576">v</a>.z; +00478 } +00479 <span class="keywordflow">else</span> +00480 { +00481 <a class="code" href="a04734.html#a21">a14</a>+= <a class="code" href="a04223.html#a576">v</a>.x; +00482 <a class="code" href="a04734.html#a22">a24</a>+= <a class="code" href="a04223.html#a576">v</a>.y; +00483 <a class="code" href="a04734.html#a23">a34</a>+= <a class="code" href="a04223.html#a576">v</a>.z; +00484 } +00485 +00486 <span class="comment">// SetProj.</span> +00487 <span class="keywordflow">if</span>( <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>() ) +00488 <a class="code" href="a04734.html#a24">a44</a>+= <a class="code" href="a04734.html#a9">a41</a>*<a class="code" href="a04223.html#a576">v</a>.x + <a class="code" href="a04734.html#a14">a42</a>*<a class="code" href="a04223.html#a576">v</a>.y + <a class="code" href="a04734.html#a19">a43</a>*<a class="code" href="a04223.html#a576">v</a>.z; +00489 +00490 <span class="comment">// Check Trans.</span> +00491 <span class="keywordflow">if</span>(<a class="code" href="a04734.html#a21">a14</a>!=0 || <a class="code" href="a04734.html#a22">a24</a>!=0 || <a class="code" href="a04734.html#a23">a34</a>!=0) +00492 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00493 <span class="keywordflow">else</span> +00494 <span class="comment">// The trans is identity, and is correcly setup!</span> +00495 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00496 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_7" doxytag="NLMISC::CMatrix::transpose" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::transpose </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +transpose the matrix (swap columns/lines). NB: this transpose the 4*4 matrix entirely (even proj/translate part). +<p> +Definition at line <a class="el" href="a05972.html#l00935">935</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01444">a14</a>, <a class="el" href="a06157.html#l01445">a24</a>, <a class="el" href="a06157.html#l01446">a34</a>, <a class="el" href="a06157.html#l01429">a41</a>, <a class="el" href="a06157.html#l01435">a42</a>, <a class="el" href="a06157.html#l01441">a43</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00121">hasTrans()</a>, <a class="el" href="a05972.html#l00054">MAT_PROJ</a>, <a class="el" href="a05972.html#l00050">MAT_TRANS</a>, <a class="el" href="a05972.html#l00058">MAT_VALIDPROJ</a>, <a class="el" href="a05973.html#l00355">StateBit</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, and <a class="el" href="a05972.html#l00922">transpose3x3()</a>. +<p> +Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06285.html#l00235">NL3D::CPSUtil::print()</a>, and <a class="el" href="a05656.html#l01366">NL3D::CDriverGL::setConstantMatrix()</a>. +<p> +<div class="fragment"><pre>00936 { +00937 <a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_8">transpose3x3</a>(); +00938 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() || <a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00939 { +00940 <span class="comment">// if necessary, Get valid 0 on proj part.</span> +00941 <a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +00942 <span class="comment">// swap values</span> +00943 swap(a41, a14); +00944 swap(a42, a24); +00945 swap(a43, a34); +00946 <span class="comment">// swap StateBit flags, if not both were sets...</span> +00947 <span class="keywordflow">if</span>(!<a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>() || !<a class="code" href="a02851.html#NLMISC_1_1CMatrixd3">hasProj</a>()) +00948 { +00949 <span class="comment">// swap StateBit flags (swap trans with proj).</span> +00950 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd5">hasTrans</a>()) +00951 { +00952 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00953 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00954 } +00955 <span class="keywordflow">else</span> +00956 { +00957 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~<a class="code" href="a04549.html#a4">MAT_PROJ</a>; +00958 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>|= <a class="code" href="a04549.html#a0">MAT_TRANS</a>; +00959 } +00960 } +00961 <span class="comment">// reset validity. NB, maybe not usefull, but simpler, and bugfree.</span> +00962 <a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a>&= ~(<a class="code" href="a04549.html#a6">MAT_VALIDPROJ</a>); +00963 } +00964 <span class="comment">// NB: if no Trans or no Proj, do nothing, so don't need to modify VALIDTRANS and VALIDPROJ too.</span> +00965 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixz1967_8" doxytag="NLMISC::CMatrix::transpose3x3" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CMatrix::transpose3x3 </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +transpose the rotation part only of the matrix (swap columns/lines). +<p> +Definition at line <a class="el" href="a05972.html#l00922">922</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +References <a class="el" href="a06157.html#l01432">a12</a>, <a class="el" href="a06157.html#l01438">a13</a>, <a class="el" href="a06157.html#l01427">a21</a>, <a class="el" href="a06157.html#l01439">a23</a>, <a class="el" href="a06157.html#l01428">a31</a>, <a class="el" href="a06157.html#l01434">a32</a>, and <a class="el" href="a05972.html#l00117">hasRot()</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00935">transpose()</a>. +<p> +<div class="fragment"><pre>00923 { +00924 <span class="keywordflow">if</span>(<a class="code" href="a02851.html#NLMISC_1_1CMatrixd4">hasRot</a>()) +00925 { +00926 <span class="comment">// swap values.</span> +00927 swap(a12, a21); +00928 swap(a13, a31); +00929 swap(a32, a23); +00930 <span class="comment">// Scale mode (none, uni, or any) is conserved. Scale33 too...</span> +00931 } +00932 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Friends And Related Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CMatrixn0" doxytag="NLMISC::CMatrix::operator *" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03082.html">CPlane</a> operator * </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03082.html">CPlane</a> & </td> + <td class="mdname" nowrap> <em>p</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>m</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [friend]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Plane (line vector) multiplication. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l01308">1308</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. +<p> +<div class="fragment"><pre>01309 { +01310 <span class="comment">// \todo yoyo: TODO_OPTIMIZE it...</span> +01311 m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd12">testExpandRot</a>(); +01312 m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixd11">testExpandProj</a>(); +01313 +01314 +01315 CPlane ret; +01316 +01317 <span class="keywordflow">if</span>( m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & (<a class="code" href="a04549.html#a1">MAT_ROT</a>|<a class="code" href="a04549.html#a2">MAT_SCALEUNI</a>|<a class="code" href="a04549.html#a3">MAT_SCALEANY</a>|<a class="code" href="a04549.html#a4">MAT_PROJ</a>) ) +01318 { +01319 <span class="comment">// Compose with translation too.</span> +01320 ret.a= p.a*m.a11 + p.b*m.a21 + p.c*m.a31 + p.d*m.a41; +01321 ret.b= p.a*m.a12 + p.b*m.a22 + p.c*m.a32 + p.d*m.a42; +01322 ret.c= p.a*m.a13 + p.b*m.a23 + p.c*m.a33 + p.d*m.a43; +01323 ret.d= p.a*m.a14 + p.b*m.a24 + p.c*m.a34 + p.d*m.a44; +01324 <span class="keywordflow">return</span> ret; +01325 } +01326 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( m.<a class="code" href="a02851.html#NLMISC_1_1CMatrixr2">StateBit</a> & <a class="code" href="a04549.html#a0">MAT_TRANS</a> ) +01327 { +01328 +01329 <span class="comment">// Compose just with a translation.</span> +01330 ret.a= p.a; +01331 ret.b= p.b; +01332 ret.c= p.c; +01333 ret.d= p.a*m.a14 + p.b*m.a24 + p.c*m.a34 + p.d*m.a44; +01334 <span class="keywordflow">return</span> ret; +01335 } +01336 <span class="keywordflow">else</span> <span class="comment">// Identity!!</span> +01337 <span class="keywordflow">return</span> p; +01338 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CMatrixs0" doxytag="NLMISC::CMatrix::Identity" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a02851.html">CMatrix</a> <a class="el" href="a02851.html#NLMISC_1_1CMatrixs0">NLMISC::CMatrix::Identity</a><code> [static]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The identity matrix. Same as <a class="el" href="a02851.html#NLMISC_1_1CMatrixz1959_1">CMatrix()</a>. +<p> + +<p> +Definition at line <a class="el" href="a05972.html#l00041">41</a> of file <a class="el" href="a05972.html">matrix.cpp</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixr0" doxytag="NLMISC::CMatrix::M" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a02851.html#NLMISC_1_1CMatrixr0">NLMISC::CMatrix::M</a>[16]<code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00353">353</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00168">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixr1" doxytag="NLMISC::CMatrix::Scale33" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a02851.html#NLMISC_1_1CMatrixr1">NLMISC::CMatrix::Scale33</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00354">354</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +Referenced by <a class="el" href="a05972.html#l00969">fastInvert33()</a>, <a class="el" href="a05972.html#l00106">getScaleUniform()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05972.html#l00168">operator=()</a>, <a class="el" href="a05972.html#l00644">scale()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05972.html#l00320">set()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, <a class="el" href="a05972.html#l00702">setMulMatrixNoProj()</a>, <a class="el" href="a05972.html#l00209">setRot()</a>, <a class="el" href="a05972.html#l01459">setScaleUni()</a>, and <a class="el" href="a05972.html#l00135">testExpandRot()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CMatrixr2" doxytag="NLMISC::CMatrix::StateBit" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02851.html#NLMISC_1_1CMatrixr2">NLMISC::CMatrix::StateBit</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05973.html#l00355">355</a> of file <a class="el" href="a05973.html">matrix.h</a>. +<p> +Referenced by <a class="el" href="a05973.html#l00088">CMatrix()</a>, <a class="el" href="a05972.html#l00969">fastInvert33()</a>, <a class="el" href="a05972.html#l01386">getRot()</a>, <a class="el" href="a05972.html#l00125">hasProj()</a>, <a class="el" href="a05972.html#l00096">hasProjectionPart()</a>, <a class="el" href="a05972.html#l00117">hasRot()</a>, <a class="el" href="a05972.html#l00092">hasScalePart()</a>, <a class="el" href="a05972.html#l00102">hasScaleUniform()</a>, <a class="el" href="a05972.html#l00121">hasTrans()</a>, <a class="el" href="a05972.html#l00200">identity()</a>, <a class="el" href="a05972.html#l01090">inverted()</a>, <a class="el" href="a05972.html#l00279">movePos()</a>, <a class="el" href="a05972.html#l01170">normalize()</a>, <a class="el" href="a05972.html#l01308">NLMISC::operator *()</a>, <a class="el" href="a05972.html#l00168">operator=()</a>, <a class="el" href="a05972.html#l00309">resetProj()</a>, <a class="el" href="a05972.html#l00498">rotateX()</a>, <a class="el" href="a05972.html#l00538">rotateY()</a>, <a class="el" href="a05972.html#l00578">rotateZ()</a>, <a class="el" href="a05972.html#l00644">scale()</a>, <a class="el" href="a05972.html#l01500">serial()</a>, <a class="el" href="a05972.html#l00320">set()</a>, <a class="el" href="a05972.html#l00744">setMulMatrix()</a>, <a class="el" href="a05972.html#l00702">setMulMatrixNoProj()</a>, <a class="el" href="a05972.html#l00267">setPos()</a>, <a class="el" href="a05972.html#l00291">setProj()</a>, <a class="el" href="a05972.html#l00209">setRot()</a>, <a class="el" href="a05972.html#l01478">setScale()</a>, <a class="el" href="a05972.html#l01459">setScaleUni()</a>, <a class="el" href="a05972.html#l00149">testExpandProj()</a>, <a class="el" href="a05972.html#l00135">testExpandRot()</a>, <a class="el" href="a05972.html#l00470">translate()</a>, and <a class="el" href="a05972.html#l00935">transpose()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05973.html">matrix.h</a><li><a class="el" href="a05972.html">matrix.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:21:55 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |