aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02562.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02562.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a02562.html')
-rw-r--r--docs/doxygen/nel/a02562.html1073
1 files changed, 1073 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02562.html b/docs/doxygen/nel/a02562.html
new file mode 100644
index 00000000..e89353d3
--- /dev/null
+++ b/docs/doxygen/nel/a02562.html
@@ -0,0 +1,1073 @@
+<!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: NL3D::CFrustum 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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
+<h1>NL3D::CFrustum Class Reference</h1><code>#include &lt;<a class="el" href="a05733.html">frustum.h</a>&gt;</code>
+<p>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+A Screen frustum, perspective or orthogonal. No default ctor. Usefull for camera. <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="a05733.html#l00047">47</a> of file <a class="el" href="a05733.html">frustum.h</a>.<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma0">CFrustum</a> (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">ctor. <a href="#NL3D_1_1CFrustuma0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma1">CFrustum</a> ()</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Un-initialized frustum. <a href="#NL3D_1_1CFrustuma1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma2">getValues</a> (float &amp;left, float &amp;right, float &amp;bottom, float &amp;top, float &amp;znear, float &amp;zfar) const </td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the value of the frustum. <a href="#NL3D_1_1CFrustuma2"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma3">init</a> (float <a class="el" href="a04223.html#a632">width</a>, float <a class="el" href="a04223.html#a633">height</a>, float znear, float zfar, bool perspective=true)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Init a centered frustum. <a href="#NL3D_1_1CFrustuma3"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma4">init</a> (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true)</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Init a frustum. <a href="#NL3D_1_1CFrustuma4"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma5">initPerspective</a> (float fov, float aspectRatio, float znear, float zfar)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma6">project</a> (const <a class="el" href="a03128.html">CVector</a> &amp;vec) const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma7">projectZ</a> (const <a class="el" href="a03128.html">CVector</a> &amp;vec) const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma8">unProject</a> (const <a class="el" href="a03128.html">CVector</a> &amp;vec) const </td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustuma9">unProjectZ</a> (const <a class="el" href="a03128.html">CVector</a> &amp;vec) const </td></tr>
+
+<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo0"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo1">Far</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo1"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo2">Left</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo2"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo3">Near</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo3"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo5">Right</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo5"></a><br><br></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02562.html#NL3D_1_1CFrustumo6">Top</a></td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">NB: znear and zfar must be &gt;0 (if perspective). <a href="#NL3D_1_1CFrustumo6"></a><br><br></td></tr>
+</table>
+<hr><h2>Constructor &amp; Destructor Documentation</h2>
+<a class="anchor" name="NL3D_1_1CFrustuma1" doxytag="NL3D::CFrustum::CFrustum" ></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"> NL3D::CFrustum::CFrustum </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Un-initialized frustum.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00056">56</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>.
+<p>
+<div class="fragment"><pre>00057 {
+00058 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00059 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma0" doxytag="NL3D::CFrustum::CFrustum" ></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"> NL3D::CFrustum::CFrustum </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname" nowrap> <em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>bottom</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>top</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>znear</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>zfar</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool&nbsp;</td>
+ <td class="mdname" nowrap> <em>perspective</em> = true</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ctor.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00061">61</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+References <a class="el" href="a05732.html#l00039">init()</a>, and <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>.
+<p>
+<div class="fragment"><pre>00062 {
+00063 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00064 <a class="code" href="a02562.html#NL3D_1_1CFrustuma4">init</a>( left, right, bottom, top, znear, zfar, perspective);
+00065 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Member Function Documentation</h2>
+<a class="anchor" name="NL3D_1_1CFrustuma2" doxytag="NL3D::CFrustum::getValues" ></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 NL3D::CFrustum::getValues </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>bottom</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>top</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>znear</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>zfar</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Get the value of the frustum.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00064">64</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>.
+<p>
+Referenced by <a class="el" href="a06722.html#l00081">NL3D::CViewport::getRayWithPoint()</a>.
+<p>
+<div class="fragment"><pre>00065 {
+00066 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00067 left= <a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>;
+00068 right= <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>;
+00069 bottom= <a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>;
+00070 top= <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>;
+00071 znear= <a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>;
+00072 zfar= <a class="code" href="a02562.html#NL3D_1_1CFrustumo1">Far</a>;
+00073 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma3" doxytag="NL3D::CFrustum::init" ></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 NL3D::CFrustum::init </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname" nowrap> <em>width</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>height</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>znear</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>zfar</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool&nbsp;</td>
+ <td class="mdname" nowrap> <em>perspective</em> = true</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Init a centered frustum.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00051">51</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05646.html#l01013">height</a>, <a class="el" href="a05732.html#l00039">init()</a>, <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, and <a class="el" href="a05646.html#l01013">width</a>.
+<p>
+<div class="fragment"><pre>00052 {
+00053 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00054 <a class="code" href="a02562.html#NL3D_1_1CFrustuma4">init</a>(-width/2, width/2, -height/2, height/2, znear, zfar, perspective);
+00055 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma4" doxytag="NL3D::CFrustum::init" ></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 NL3D::CFrustum::init </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname" nowrap> <em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>bottom</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>top</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>znear</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>zfar</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>bool&nbsp;</td>
+ <td class="mdname" nowrap> <em>perspective</em> = true</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Init a frustum.
+<p>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00039">39</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>.
+<p>
+Referenced by <a class="el" href="a05686.html#l00040">NL3D::CEvent3dMouseListener::CEvent3dMouseListener()</a>, <a class="el" href="a05733.html#l00061">CFrustum()</a>, <a class="el" href="a05732.html#l00051">init()</a>, <a class="el" href="a05732.html#l00056">initPerspective()</a>, <a class="el" href="a06768.html#l00741">InitZBuffer()</a>, and <a class="el" href="a05530.html#l00061">NL3D::CCamera::setFrustum()</a>.
+<p>
+<div class="fragment"><pre>00040 {
+00041 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00042 <a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>= left;
+00043 <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>= right;
+00044 <a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>= bottom;
+00045 <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>= top;
+00046 <a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>= znear;
+00047 <a class="code" href="a02562.html#NL3D_1_1CFrustumo1">Far</a>= zfar;
+00048 <a class="code" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a>= perspective;
+00049 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma5" doxytag="NL3D::CFrustum::initPerspective" ></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 NL3D::CFrustum::initPerspective </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float&nbsp;</td>
+ <td class="mdname" nowrap> <em>fov</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>aspectRatio</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>znear</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>zfar</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+Setup a perspective frustum, giving a fov in radians. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>fov</em>&nbsp;</td><td>the horizontal angle of view, in radians. (Pi/2 as example) </td></tr>
+ <tr><td valign=top><em>aspectRatio</em>&nbsp;</td><td>the ratio horizontal/vertical (1.33 as example). </td></tr>
+ <tr><td valign=top><em>znear</em>&nbsp;</td><td>the front clipping plane distance. </td></tr>
+ <tr><td valign=top><em>zfar</em>&nbsp;</td><td>the back clipping plane distance.</td></tr>
+ </table>
+</dl>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00056">56</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05732.html#l00039">init()</a>, <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, and <a class="el" href="a05646.html#l00236">w</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00071">NL3D::CCamera::setPerspective()</a>.
+<p>
+<div class="fragment"><pre>00057 {
+00058 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00059 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a575">w</a>,h;
+00060 <a class="code" href="a04223.html#a575">w</a>= 2*znear*(<span class="keywordtype">float</span>)tan(fov/2);
+00061 h= aspectRatio != 0.f ? <a class="code" href="a04223.html#a575">w</a>/aspectRatio : 0.f;
+00062 <a class="code" href="a02562.html#NL3D_1_1CFrustuma4">init</a>(w,h,znear,zfar,<span class="keyword">true</span>);
+00063 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma6" doxytag="NL3D::CFrustum::project" ></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> NL3D::CFrustum::project </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>vec</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+project a vector (x,y,z) onto frustum. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>vec</em>&nbsp;</td><td>the point in 3D frustum space. Axis is <a class="el" href="a05363.html">NL3D</a> axis: Xright, Yfront, Ztop. </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the point in 2D: Xright, Ytop, Z=0. Screen is mapped to X:[0..1], Y: [0..1].</dd></dl>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00077">77</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, <a class="el" href="a05646.html#l00236">w</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="a06768.html#l00170">transformVectorToZBuffer()</a>.
+<p>
+<div class="fragment"><pre>00078 {
+00079 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00080 CVector ret;
+00081 <span class="keywordtype">float</span> decalX, decalY;
+00082 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a575">w</a>, h;
+00083 <span class="keywordtype">float</span> OOw, OOh;
+00084
+00085 <span class="comment">// Fast transform to openGL like axis.</span>
+00086 CVector pt;
+00087 pt.x= vec.x;
+00088 pt.y= vec.z;
+00089 pt.z= -vec.y;
+00090
+00091 decalX= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>);
+00092 decalY= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>);
+00093 <a class="code" href="a04223.html#a575">w</a>= <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>;
+00094 h= <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>;
+00095 OOw= 1.0f/<a class="code" href="a04223.html#a575">w</a>;
+00096 OOh= 1.0f/h;
+00097
+00098 <span class="comment">// project to -1..+1.</span>
+00099 <span class="keywordflow">if</span>(<a class="code" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a>)
+00100 {
+00101 ret.x= (2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>*pt.x + decalX*pt.z)*OOw;
+00102 ret.x/= -pt.z;
+00103 ret.y= (2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>*pt.y + decalY*pt.z)*OOh;
+00104 ret.y/= -pt.z;
+00105 }
+00106 <span class="keywordflow">else</span>
+00107 {
+00108 ret.x= (2*pt.x-decalX)*OOw;
+00109 ret.y= (2*pt.y-decalY)*OOh;
+00110 }
+00111
+00112
+00113 <span class="comment">// Map it to 0..1.</span>
+00114 ret.x= 0.5f*(ret.x+1);
+00115 ret.y= 0.5f*(ret.y+1);
+00116 ret.z= 0;
+00117
+00118 <span class="keywordflow">return</span> ret;
+00119 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma7" doxytag="NL3D::CFrustum::projectZ" ></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> NL3D::CFrustum::projectZ </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>vec</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+project a vector (x,y,z) onto frustum. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>vec</em>&nbsp;</td><td>the point in 3D frustum space. Axis is <a class="el" href="a05363.html">NL3D</a> axis: Xright, Yfront, Ztop. </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the point in 2D: Xright, Ytop, Z=0. Screen is mapped to X:[0..1], Y: [0..1] Z is a positive screen depth in world units.</dd></dl>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00123">123</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, <a class="el" href="a05646.html#l00236">w</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>
+<div class="fragment"><pre>00124 {
+00125 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00126 CVector ret;
+00127 <span class="keywordtype">float</span> decalX, decalY;
+00128 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a575">w</a>, h;
+00129 <span class="keywordtype">float</span> OOw, OOh;
+00130
+00131 <span class="comment">// Fast transform to openGL like axis.</span>
+00132 CVector pt;
+00133 pt.x= vec.x;
+00134 pt.y= vec.z;
+00135 pt.z= -vec.y;
+00136
+00137 decalX= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>);
+00138 decalY= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>);
+00139 <a class="code" href="a04223.html#a575">w</a>= <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>;
+00140 h= <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>;
+00141 OOw= 1.0f/<a class="code" href="a04223.html#a575">w</a>;
+00142 OOh= 1.0f/h;
+00143
+00144 <span class="comment">// project to -1..+1.</span>
+00145 <span class="keywordflow">if</span>(<a class="code" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a>)
+00146 {
+00147 ret.x= (2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>*pt.x + decalX*pt.z)*OOw;
+00148 ret.x/= -pt.z;
+00149 ret.y= (2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>*pt.y + decalY*pt.z)*OOh;
+00150 ret.y/= -pt.z;
+00151 }
+00152 <span class="keywordflow">else</span>
+00153 {
+00154 ret.x= (2*pt.x-decalX)*OOw;
+00155 ret.y= (2*pt.y-decalY)*OOh;
+00156 }
+00157
+00158
+00159 <span class="comment">// Map it to 0..1.</span>
+00160 ret.x= 0.5f*(ret.x+1);
+00161 ret.y= 0.5f*(ret.y+1);
+00162 ret.z= pt.z;
+00163
+00164 <span class="keywordflow">return</span> ret;
+00165 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma8" doxytag="NL3D::CFrustum::unProject" ></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> NL3D::CFrustum::unProject </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>vec</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+unproject a point from screen to the frustum space. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>vec</em>&nbsp;</td><td>the point on the screen, in Left hand axis (XRight, YTop, ZFront). Z must be in [0..1] and hyperbolic. </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the point in the frustum space (<a class="el" href="a05363.html">NL3D</a> right hand axis).</dd></dl>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00169">169</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, <a class="el" href="a05646.html#l00236">w</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>
+<div class="fragment"><pre>00170 {
+00171 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00172 CVector ret;
+00173 <span class="keywordtype">float</span> decalX, decalY;
+00174 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a575">w</a>, h;
+00175
+00176 decalX= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>);
+00177 decalY= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>);
+00178 <a class="code" href="a04223.html#a575">w</a>= <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>;
+00179 h= <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>;
+00180
+00181 <span class="comment">// vec is a vector in a left hand axis.</span>
+00182 CVector pt;
+00183 pt.x= vec.x;
+00184 pt.y= vec.y;
+00185 pt.z= vec.z;
+00186
+00187 <span class="comment">// Map it to -1..1</span>
+00188 pt.x= 2*(pt.x-0.5f);
+00189 pt.y= 2*(pt.y-0.5f);
+00190
+00191 <span class="comment">// Map Z to Near..Far.</span>
+00192 <span class="comment">// Z IN is 1/Z, and is in 0..1.</span>
+00193 <span class="comment">// inverse to 1..0.</span>
+00194 pt.z= 1-pt.z;
+00195 <span class="comment">// Map ret.z to 1/Far..1/Near.</span>
+00196 pt.z= 1/<a class="code" href="a02562.html#NL3D_1_1CFrustumo1">Far</a>+(1/<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>-1/<a class="code" href="a02562.html#NL3D_1_1CFrustumo1">Far</a>)*pt.z;
+00197 <span class="comment">// Inverse, so ret.z E Near..Far.</span>
+00198 pt.z= 1/pt.z;
+00199 <span class="comment">// Actually, pt.z==w, homogenous coordinate.</span>
+00200
+00201
+00202 <span class="comment">// unproject</span>
+00203 <span class="keywordflow">if</span>(<a class="code" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a>)
+00204 {
+00205 <span class="comment">// w of homogenous coordinate.</span>
+00206 <span class="keywordtype">float</span> Wh;
+00207 <span class="keywordtype">float</span> Zin;
+00208 Wh= pt.z;
+00209 Zin= -pt.z;
+00210
+00211 <span class="comment">// unproject. (Projection is: x'= x/w. y'= y/w).</span>
+00212 pt.x= pt.x*Wh;
+00213 pt.y= pt.y*Wh;
+00214 ret.x= (pt.x*<a class="code" href="a04223.html#a575">w</a>-decalX*Zin)/(2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>);
+00215 ret.y= (pt.y*h-decalY*Zin)/(2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>);
+00216 ret.z= Zin;
+00217 }
+00218 <span class="keywordflow">else</span>
+00219 {
+00220 <span class="comment">// NOT DONE YET.</span>
+00221 <a class="code" href="a04199.html#a12">nlstop</a>;
+00222 <span class="comment">/*ret.x= (pt.x*w+decalX)/2;</span>
+00223 <span class="comment"> ret.y= (pt.y*h+decalY)/2;</span>
+00224 <span class="comment"> */</span>
+00225 }
+00226
+00227 <span class="comment">// Fast transform from openGL like axis.</span>
+00228 pt =ret;
+00229 ret.x= pt.x;
+00230 ret.y= -pt.z;
+00231 ret.z= pt.y;
+00232
+00233 <span class="keywordflow">return</span> ret;
+00234 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustuma9" doxytag="NL3D::CFrustum::unProjectZ" ></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> NL3D::CFrustum::unProjectZ </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>vec</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+unproject a point from screen to the frustum space. <dl compact><dt><b>Parameters:</b></dt><dd>
+ <table border="0" cellspacing="2" cellpadding="0">
+ <tr><td valign=top><em>vec</em>&nbsp;</td><td>the point on the screen, in Left hand axis (XRight, YTop, ZFront). Z is a positive depth in world unit. </td></tr>
+ </table>
+</dl>
+<dl compact><dt><b>Returns:</b></dt><dd>the point in the frustum space (<a class="el" href="a05363.html">NL3D</a> right hand axis).</dd></dl>
+
+<p>
+Definition at line <a class="el" href="a05732.html#l00238">238</a> of file <a class="el" href="a05732.html">frustum.cpp</a>.
+<p>
+References <a class="el" href="a05733.html#l00032">NL3D_MEM_FRUSTRUM</a>, <a class="el" href="a05646.html#l00236">w</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>
+<div class="fragment"><pre>00239 {
+00240 <a class="code" href="a04310.html#a0">NL3D_MEM_FRUSTRUM</a>
+00241 CVector ret;
+00242 <span class="keywordtype">float</span> decalX, decalY;
+00243 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a575">w</a>, h;
+00244
+00245 decalX= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>);
+00246 decalY= (<a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>+<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>);
+00247 <a class="code" href="a04223.html#a575">w</a>= <a class="code" href="a02562.html#NL3D_1_1CFrustumo5">Right</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo2">Left</a>;
+00248 h= <a class="code" href="a02562.html#NL3D_1_1CFrustumo6">Top</a>-<a class="code" href="a02562.html#NL3D_1_1CFrustumo0">Bottom</a>;
+00249
+00250 <span class="comment">// vec is a vector in a left hand axis.</span>
+00251 CVector pt;
+00252 pt.x= vec.x;
+00253 pt.y= vec.y;
+00254 pt.z= vec.z;
+00255
+00256 <span class="comment">// Map it to -1..1</span>
+00257 pt.x= 2*(pt.x-0.5f);
+00258 pt.y= 2*(pt.y-0.5f);
+00259
+00260 <span class="comment">// unproject</span>
+00261 <span class="keywordflow">if</span>(<a class="code" href="a02562.html#NL3D_1_1CFrustumo4">Perspective</a>)
+00262 {
+00263 <span class="comment">// w of homogenous coordinate.</span>
+00264 <span class="keywordtype">float</span> Wh;
+00265 <span class="keywordtype">float</span> Zin;
+00266 Wh= pt.z;
+00267 Zin= -pt.z;
+00268
+00269 <span class="comment">// unproject. (Projection is: x'= x/w. y'= y/w).</span>
+00270 pt.x= pt.x*Wh;
+00271 pt.y= pt.y*Wh;
+00272 ret.x= (pt.x*<a class="code" href="a04223.html#a575">w</a>-decalX*Zin)/(2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>);
+00273 ret.y= (pt.y*h-decalY*Zin)/(2*<a class="code" href="a02562.html#NL3D_1_1CFrustumo3">Near</a>);
+00274 ret.z= Zin;
+00275 }
+00276 <span class="keywordflow">else</span>
+00277 {
+00278 <span class="comment">// NOT DONE YET.</span>
+00279 <span class="comment">//nlstop;</span>
+00280 <span class="comment">/*ret.x= (pt.x*w+decalX)/2;</span>
+00281 <span class="comment"> ret.y= (pt.y*h+decalY)/2;</span>
+00282 <span class="comment"> */</span>
+00283 <span class="comment">// Yoyo: crash avoid for lem</span>
+00284 ret= vec;
+00285 }
+00286
+00287 <span class="comment">// Fast transform from openGL like axis.</span>
+00288 pt =ret;
+00289 ret.x= pt.x;
+00290 ret.y= -pt.z;
+00291 ret.z= pt.y;
+00292
+00293 <span class="keywordflow">return</span> ret;
+00294 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="NL3D_1_1CFrustumo0" doxytag="NL3D::CFrustum::Bottom" ></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="a02562.html#NL3D_1_1CFrustumo0">NL3D::CFrustum::Bottom</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, and <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo1" doxytag="NL3D::CFrustum::Far" ></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="a02562.html#NL3D_1_1CFrustumo1">NL3D::CFrustum::Far</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>, and <a class="el" href="a05530.html#l00164">NL3D::CCamera::update()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo2" doxytag="NL3D::CFrustum::Left" ></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="a02562.html#NL3D_1_1CFrustumo2">NL3D::CFrustum::Left</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, and <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo3" doxytag="NL3D::CFrustum::Near" ></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="a02562.html#NL3D_1_1CFrustumo3">NL3D::CFrustum::Near</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>, and <a class="el" href="a05530.html#l00164">NL3D::CCamera::update()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo4" doxytag="NL3D::CFrustum::Perspective" ></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 <a class="el" href="a02562.html#NL3D_1_1CFrustumo4">NL3D::CFrustum::Perspective</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00052">52</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00086">NL3D::CCamera::isOrtho()</a>, <a class="el" href="a05530.html#l00091">NL3D::CCamera::isPerspective()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, and <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo5" doxytag="NL3D::CFrustum::Right" ></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="a02562.html#NL3D_1_1CFrustumo5">NL3D::CFrustum::Right</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, and <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NL3D_1_1CFrustumo6" doxytag="NL3D::CFrustum::Top" ></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="a02562.html#NL3D_1_1CFrustumo6">NL3D::CFrustum::Top</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+NB: znear and zfar must be &gt;0 (if perspective).
+<p>
+
+<p>
+Definition at line <a class="el" href="a05733.html#l00051">51</a> of file <a class="el" href="a05733.html">frustum.h</a>.
+<p>
+Referenced by <a class="el" href="a05530.html#l00243">NL3D::CCamera::buildCameraPyramid()</a>, <a class="el" href="a05530.html#l00076">NL3D::CCamera::getFrustum()</a>, <a class="el" href="a05559.html#l00777">NL3D::CCloudScape::render()</a>, <a class="el" href="a05657.html#l00351">NL3D::CDriverUser::restoreMatrixContextMatrixOnly()</a>, and <a class="el" href="a05657.html#l00363">NL3D::CDriverUser::setupMatrixContext()</a>. </td>
+ </tr>
+</table>
+<hr>The documentation for this class was generated from the following files:<ul>
+<li><a class="el" href="a05733.html">frustum.h</a><li><a class="el" href="a05732.html">frustum.cpp</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:47:00 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>