aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/water__model_8cpp-source.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/water__model_8cpp-source.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/water__model_8cpp-source.html1144
1 files changed, 1144 insertions, 0 deletions
diff --git a/docs/doxygen/nel/water__model_8cpp-source.html b/docs/doxygen/nel/water__model_8cpp-source.html
new file mode 100644
index 00000000..c76d275d
--- /dev/null
+++ b/docs/doxygen/nel/water__model_8cpp-source.html
@@ -0,0 +1,1144 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+ <TITLE>nevrax.org : docs</TITLE>
+ <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css">
+ <link href="doxygen.css" rel="stylesheet" type="text/css">
+</HEAD>
+<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
+
+<!-- uplinks -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
+ </TR>
+</TABLE>
+
+<!-- banner Nevrax -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
+ <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
+</TABLE>
+
+<!-- main table -->
+<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
+ <TR>
+ <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
+ <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+ <!------ Begin Box ------>
+ <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
+ <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
+ <TABLE cellspacing=0 cellpadding=1 border=0>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
+ <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr>
+ </TABLE>
+ </TD></TR></TABLE></TD></TR></TABLE>
+ <!------ End Box ------>
+
+ </TD>
+ <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
+ <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
+
+<!-- title -->
+<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
+<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
+</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
+</td></tr></table>
+&nbsp;
+
+<!-- block -->
+<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD>
+ <TD><B>Documentation</B></TD>
+ <TD ALIGN=RIGHT>&nbsp;</td>
+</tr></table>
+<!-- Generated by Doxygen 1.2.14 -->
+<center>
+<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
+<hr><h1>water_model.cpp</h1><a href="water__model_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
+00007 <font class="comment">/* Copyright, 2000, 2001 Nevrax Ltd.</font>
+00008 <font class="comment"> *</font>
+00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
+00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
+00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
+00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
+00013 <font class="comment"> * any later version.</font>
+00014 <font class="comment"></font>
+00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
+00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
+00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
+00018 <font class="comment"> * General Public License for more details.</font>
+00019 <font class="comment"></font>
+00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
+00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
+00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
+00023 <font class="comment"> * MA 02111-1307, USA.</font>
+00024 <font class="comment"> */</font>
+00025
+00026 <font class="preprocessor">#include "<a class="code" href="std3d_8h.html">std3d.h</a>"</font>
+00027
+00028 <font class="preprocessor">#include "<a class="code" href="vector__2d_8h.html">nel/misc/vector_2d.h</a>"</font>
+00029 <font class="preprocessor">#include "<a class="code" href="vector__h_8h.html">nel/misc/vector_h.h</a>"</font>
+00030 <font class="preprocessor">#include "<a class="code" href="hierarchical__timer_8h.html">nel/misc/hierarchical_timer.h</a>"</font>
+00031 <font class="preprocessor">#include "<a class="code" href="animation__time_8h.html">nel/3d/animation_time.h</a>"</font>
+00032 <font class="preprocessor">#include "<a class="code" href="water__model_8h.html">3d/water_model.h</a>"</font>
+00033 <font class="preprocessor">#include "<a class="code" href="water__shape_8h.html">3d/water_shape.h</a>"</font>
+00034 <font class="preprocessor">#include "<a class="code" href="water__pool__manager_8h.html">3d/water_pool_manager.h</a>"</font>
+00035 <font class="preprocessor">#include "<a class="code" href="water__height__map_8h.html">3d/water_height_map.h</a>"</font>
+00036 <font class="preprocessor">#include "<a class="code" href="dru_8h.html">3d/dru.h</a>"</font>
+00037 <font class="preprocessor">#include "<a class="code" href="scene_8h.html">3d/scene.h</a>"</font>
+00038 <font class="preprocessor">#include "<a class="code" href="driver_8h.html">3d/driver.h</a>"</font>
+00039 <font class="preprocessor">#include "<a class="code" href="render__trav_8h.html">3d/render_trav.h</a>"</font>
+00040 <font class="preprocessor">#include "<a class="code" href="anim__detail__trav_8h.html">3d/anim_detail_trav.h</a>"</font>
+00041
+00042
+00043
+00044
+00045 <font class="keyword">namespace </font>NL3D {
+00046
+00047
+00048 <font class="comment">//=======================================================================</font>
+00049
+<a name="l00050"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a0">00050</a> CWaterModel::CWaterModel() : _Scene(NULL)
+00051 {
+00052 <a class="code" href="classNL3D_1_1CTransform.html#a1">setOpacity</a>(<font class="keyword">false</font>);
+00053 <a class="code" href="classNL3D_1_1CTransform.html#a0">setTransparency</a>(<font class="keyword">true</font>);
+00054 <a class="code" href="classNL3D_1_1CTransform.html#a4">setOrderingLayer</a>(1);
+00055 }
+00056
+00057 <font class="comment">//=======================================================================</font>
+00058
+<a name="l00059"></a><a class="code" href="classNL3D_1_1CWaterModel.html#d0">00059</a> <font class="keywordtype">void</font> CWaterModel::registerBasic()
+00060 {
+00061 CMOT::registerModel(<a class="code" href="namespaceNL3D.html#a310">WaterModelClassId</a>, <a class="code" href="namespaceNL3D.html#a277">TransformShapeId</a>, CWaterModel::creator);
+00062 CMOT::registerObs(<a class="code" href="namespaceNL3D.html#a232">RenderTravId</a>, <a class="code" href="namespaceNL3D.html#a310">WaterModelClassId</a>, CWaterRenderObs::creator);
+00063 }
+00064
+00065
+00066 <font class="comment">//=======================================================================</font>
+00067
+<a name="l00068"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a1">00068</a> ITrack* CWaterModel::getDefaultTrack (uint valueId)
+00069 {
+00070 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00071 <a class="code" href="classNL3D_1_1CWaterModel.html#l1">CWaterShape</a> *ws = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00072 <font class="keywordflow">switch</font> (valueId)
+00073 {
+00074 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1ITransformable.html#z872_0s5">PosValue</a>: <font class="keywordflow">return</font> ws-&gt;getDefaultPos(); <font class="keywordflow">break</font>;
+00075 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1ITransformable.html#z872_0s8">ScaleValue</a>: <font class="keywordflow">return</font> ws-&gt;getDefaultScale(); <font class="keywordflow">break</font>;
+00076 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1ITransformable.html#z872_0s7">RotQuatValue</a>: <font class="keywordflow">return</font> ws-&gt;getDefaultRotQuat(); <font class="keywordflow">break</font>;
+00077 <font class="keywordflow">default</font>: <font class="comment">// delegate to parent</font>
+00078 <font class="keywordflow">return</font> CTransformShape::getDefaultTrack(valueId);
+00079 <font class="keywordflow">break</font>;
+00080 }
+00081 }
+00082
+00083 <font class="comment">//=======================================================================</font>
+00084
+<a name="l00085"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a2">00085</a> uint32 CWaterModel::getWaterHeightMapID()<font class="keyword"> const</font>
+00086 <font class="keyword"></font>{
+00087 <a class="code" href="classNL3D_1_1CWaterModel.html#l1">CWaterShape</a> *ws = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00088 <font class="keywordflow">return</font> ws-&gt;_WaterPoolID;
+00089 }
+00090
+00091 <font class="comment">//=======================================================================</font>
+00092
+<a name="l00093"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a3">00093</a> <font class="keywordtype">float</font> CWaterModel::getHeightFactor()<font class="keyword"> const</font>
+00094 <font class="keyword"></font>{
+00095 <a class="code" href="classNL3D_1_1CWaterModel.html#l1">CWaterShape</a> *ws = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00096 <font class="keywordflow">return</font> ws-&gt;_WaveHeightFactor;
+00097 }
+00098
+00099
+00100 <font class="comment">//=======================================================================</font>
+00101
+<a name="l00102"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a4">00102</a> <font class="keywordtype">float</font> CWaterModel::getHeight(<font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector2f.html">NLMISC::CVector2f</a> &amp;pos)
+00103 {
+00104 <a class="code" href="classNL3D_1_1CWaterModel.html#l1">CWaterShape</a> *ws = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00105 CWaterHeightMap &amp;whm = <a class="code" href="namespaceNL3D.html#a480">GetWaterPoolManager</a>().getPoolByID(ws-&gt;_WaterPoolID);
+00106 <font class="keyword">const</font> <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = whm.getHeight(pos);
+00107 <font class="keywordflow">return</font> <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> * ws-&gt;_WaveHeightFactor + this-&gt;<a class="code" href="classNL3D_1_1ITransformable.html#z870_7">getPos</a>().z;
+00108 }
+00109
+00110 <font class="comment">//=======================================================================</font>
+00111
+<a name="l00112"></a><a class="code" href="classNL3D_1_1CWaterModel.html#a5">00112</a> <font class="keywordtype">float</font> CWaterModel::getAttenuatedHeight(<font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector2f.html">NLMISC::CVector2f</a> &amp;pos, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &amp;viewer)
+00113 {
+00114 <a class="code" href="classNL3D_1_1CWaterModel.html#l1">CWaterShape</a> *ws = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+00115 CWaterHeightMap &amp;whm = <a class="code" href="namespaceNL3D.html#a480">GetWaterPoolManager</a>().getPoolByID(ws-&gt;_WaterPoolID);
+00116 <font class="keyword">const</font> <font class="keywordtype">float</font> maxDist = whm.getUnitSize() * (whm.getSize() &gt;&gt; 1);
+00117 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> planePos(pos.<a class="code" href="classNLMISC_1_1CVector2f.html#m0">x</a>, pos.<a class="code" href="classNLMISC_1_1CVector2f.html#m1">y</a>, this-&gt;getPos().z);
+00118 <font class="keyword">const</font> <font class="keywordtype">float</font> userDist = (planePos - viewer).norm();
+00119
+00120 <font class="keywordflow">if</font> (userDist &gt; maxDist)
+00121 {
+00122 <font class="keywordflow">return</font> this-&gt;<a class="code" href="classNL3D_1_1ITransformable.html#z870_7">getPos</a>().z;
+00123 }
+00124 <font class="keywordflow">else</font>
+00125 {
+00126 <font class="keyword">const</font> <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> = whm.getHeight(pos);
+00127 <font class="keywordflow">return</font> ws-&gt;_WaveHeightFactor * <a class="code" href="driver__opengl__extension__def_8h.html#a390">height</a> * (1.f - userDist / maxDist) + this-&gt;<a class="code" href="classNL3D_1_1ITransformable.html#z870_7">getPos</a>().z;
+00128 }
+00129 }
+00130
+00131
+00132 <font class="comment">//=======================================================================</font>
+00133
+00134 <font class="comment">// perform a bilinear on 4 values</font>
+00135 <font class="comment">// 0---1</font>
+00136 <font class="comment">// | |</font>
+00137 <font class="comment">// 3---2</font>
+00138 <font class="keyword">static</font> <font class="keywordtype">float</font> <font class="keyword">inline</font> <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(<font class="keywordtype">float</font> v0, <font class="keywordtype">float</font> v1, <font class="keywordtype">float</font> v2, <font class="keywordtype">float</font> v3, <font class="keywordtype">float</font> u, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)
+00139 {
+00140 <font class="keywordtype">float</font> g = <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> * v3 + (1.f - <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>) * v0;
+00141 <font class="keywordtype">float</font> h = <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a> * v2 + (1.f - <a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>) * v1;
+00142 <font class="keywordflow">return</font> u * h + (1.f - u) * g;
+00143 }
+00144
+00145
+00146
+00147 <font class="comment">//=======================================================================</font>
+00148
+00150 <font class="keyword">static</font> <font class="keywordtype">void</font> <font class="keyword">inline</font> <a class="code" href="namespaceNL3D.html#a476">FillWaterVB</a>(uint8 *&amp;vbPointer, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>, <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a366">z</a>, <font class="keywordtype">float</font> nx, <font class="keywordtype">float</font> ny)
+00151 {
+00152 * (<font class="keywordtype">float</font> *) vbPointer = <a class="code" href="driver__opengl__extension__def_8h.html#a364">x</a>;
+00153 ((<font class="keywordtype">float</font> *) vbPointer)[1] = <a class="code" href="driver__opengl__extension__def_8h.html#a365">y</a>;
+00154 ((<font class="keywordtype">float</font> *) vbPointer)[2] = <a class="code" href="driver__opengl__extension__def_8h.html#a366">z</a>;
+00155 *((<font class="keywordtype">float</font> *) (vbPointer + 3 * <font class="keyword">sizeof</font>(float))) = nx;
+00156 *((<font class="keywordtype">float</font> *) (vbPointer + 4 * <font class="keyword">sizeof</font>(float))) = ny;
+00157 vbPointer += 5 * <font class="keyword">sizeof</font>(float);
+00158 }
+00159
+00160 <font class="comment">//***************************************************************************************************************</font>
+00161
+00162
+00164 <font class="preprocessor">#ifdef NL_OS_WINDOWS</font>
+00165 <font class="preprocessor"></font> __forceinline
+00166 <font class="preprocessor">#endif</font>
+00167 <font class="preprocessor"></font><font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a477">SetupWaterVertex</a>( sint qLeft,
+00168 sint qRight,
+00169 sint qUp,
+00170 sint qDown,
+00171 sint qSubLeft,
+00172 sint qSubDown,
+00173 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &amp;inter,
+00174 <font class="keywordtype">float</font> invWaterRatio,
+00175 sint doubleWaterHeightMapSize,
+00176 CWaterHeightMap &amp;whm,
+00177 uint8 *&amp;vbPointer,
+00178 <font class="keywordtype">float</font> offsetX,
+00179 <font class="keywordtype">float</font> offsetY
+00180 )
+00181 {
+00182 <font class="keyword">const</font> <font class="keywordtype">float</font> wXf = invWaterRatio * (inter.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> + offsetX);
+00183 <font class="keyword">const</font> <font class="keywordtype">float</font> wYf = invWaterRatio * (inter.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> + offsetY);
+00184
+00185 sint wx = (sint) floorf(wXf);
+00186 sint wy = (sint) floorf(wYf);
+00187
+00188
+00189
+00190 <font class="keywordflow">if</font> (!
+00191 (wx &gt;= qLeft &amp;&amp; wx &lt; qRight &amp;&amp; wy &lt; qUp &amp;&amp; wy &gt;= qDown)
+00192 )
+00193 {
+00194 <font class="comment">// no perturbation is visible</font>
+00195 <a class="code" href="namespaceNL3D.html#a476">FillWaterVB</a>(vbPointer, inter.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, inter.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>, 0, 0, 0);
+00196 }
+00197 <font class="keywordflow">else</font>
+00198 {
+00199
+00200
+00201 <font class="comment">// filter height and gradient at the given point</font>
+00202 <font class="keyword">const</font> sint <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> = doubleWaterHeightMapSize;
+00203
+00204
+00205 <font class="keyword">const</font> uint xm = (uint) (wx - qSubLeft);
+00206 <font class="keyword">const</font> uint ym = (uint) (wy - qSubDown);
+00207 <font class="keyword">const</font> sint <a class="code" href="driver__opengl__extension__def_8h.html#a378">offset</a> = xm + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> * ym;
+00208 <font class="keyword">const</font> <font class="keywordtype">float</font> *ptWater = whm.getPointer() + <a class="code" href="driver__opengl__extension__def_8h.html#a378">offset</a>;
+00209
+00210 <font class="comment">/* float epsilon = 10E-5f;</font>
+00211 <font class="comment"> if (ptWater[0] &gt; epsilon || ptWater[0] &lt; epsilon </font>
+00212 <font class="comment"> || ptWater[1] &gt; epsilon || ptWater[1] &lt; epsilon </font>
+00213 <font class="comment"> || ptWater[stride] &gt; epsilon || ptWater[stride] &lt; epsilon</font>
+00214 <font class="comment"> || ptWater[stride + 1] &gt; epsilon || ptWater[stride + 1] &lt; epsilon</font>
+00215 <font class="comment"> )</font>
+00216 <font class="comment"> {*/</font>
+00217
+00218 <font class="keywordtype">float</font> deltaU = wXf - wx;
+00219 <font class="keywordtype">float</font> deltaV = wYf - wy;
+00220 <a class="code" href="debug_8h.html#a6">nlassert</a>(deltaU &gt;= 0.f &amp;&amp; deltaU &lt;= 1.f &amp;&amp; deltaV &gt;= 0.f &amp;&amp; deltaV &lt;= 1.f);
+00221 <font class="keyword">const</font> <font class="keywordtype">float</font> *ptWaterPrev = whm.getPrevPointer() + <a class="code" href="driver__opengl__extension__def_8h.html#a378">offset</a>;
+00222
+00223
+00224
+00225 <font class="keywordtype">float</font> g0x, g1x, g2x, g3x; <font class="comment">// x gradient for current </font>
+00226 <font class="keywordtype">float</font> g0xp, g1xp, g2xp, g3xp;
+00227
+00228 <font class="keywordtype">float</font> gradCurrX, gradCurrY;
+00229
+00230 <font class="keywordtype">float</font> g0y, g1y, g2y, g3y; <font class="comment">// y gradient for previous map</font>
+00231 <font class="keywordtype">float</font> g0yp, g1yp, g2yp, g3yp;
+00232
+00233 <font class="keywordtype">float</font> gradPrevX, gradPrevY;
+00234
+00236
+00237 g0x = ptWater[ 1] - ptWater[ - 1];
+00238 g1x = ptWater[ 2] - ptWater[ 0 ];
+00239 g2x = ptWater[ 2 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWater[ <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00240 g3x = ptWater[ 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWater[ - 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00241
+00242 gradCurrX = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(g0x, g1x, g2x, g3x, deltaU, deltaV);
+00243
+00244
+00245 g0y = ptWater[ <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWater[ - <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00246 g1y = ptWater[ <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> + 1] - ptWater[ - <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> + 1];
+00247 g2y = ptWater[ (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1) + 1] - ptWater[ 1];
+00248 g3y = ptWater[ (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1)] - ptWater[0];
+00249
+00250 gradCurrY = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(g0y, g1y, g2y, g3y, deltaU, deltaV);
+00251
+00253
+00254 g0xp = ptWaterPrev[ 1] - ptWaterPrev[ - 1];
+00255 g1xp = ptWaterPrev[ 2] - ptWaterPrev[ 0 ];
+00256 g2xp = ptWaterPrev[ 2 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWaterPrev[ + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00257 g3xp = ptWaterPrev[ 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWaterPrev[ - 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00258
+00259 gradPrevX = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(g0xp, g1xp, g2xp, g3xp, deltaU, deltaV);
+00260
+00261
+00262 g0yp = ptWaterPrev[ <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>] - ptWaterPrev[ - <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>];
+00263 g1yp = ptWaterPrev[ <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> + 1] - ptWaterPrev[ - <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> + 1];
+00264 g2yp = ptWaterPrev[ (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1) + 1] - ptWaterPrev[ 1 ];
+00265 g3yp = ptWaterPrev[ (<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1)] - ptWaterPrev[ 0 ];
+00266
+00267 gradPrevY = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(g0yp, g1yp, g2yp, g3yp, deltaU, deltaV);
+00268
+00269
+00271 <font class="keywordtype">float</font> h = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(ptWater[ 0 ], ptWater[ + 1], ptWater[ 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>], ptWater[<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>], deltaU, deltaV);
+00272
+00274 <font class="keywordtype">float</font> hPrev = <a class="code" href="namespaceNL3D.html#a475">BilinFilter</a>(ptWaterPrev[ 0 ], ptWaterPrev[ 1], ptWaterPrev[ 1 + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>], ptWaterPrev[<a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>], deltaU, deltaV);
+00275
+00276
+00277 <font class="keywordtype">float</font> timeRatio = whm.getBufferRatio();
+00278
+00279
+00280 <a class="code" href="namespaceNL3D.html#a476">FillWaterVB</a>(vbPointer, inter.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, inter.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>, timeRatio * h + (1.f - timeRatio) * hPrev,
+00281 4.5f * (timeRatio * gradCurrX + (1.f - timeRatio) * gradPrevX),
+00282 4.5f * (timeRatio * gradCurrY + (1.f - timeRatio) * gradPrevY)
+00283 );
+00284
+00285
+00286
+00287 <font class="comment">//NLMISC::CVector2f *ptGrad = whm.getGradPointer() + offset;</font>
+00288
+00289
+00290
+00291
+00292
+00293 <font class="comment">/* float dh1 = deltaV * ptWater[stride] + (1.f - deltaV) * ptWater[0];</font>
+00294 <font class="comment"> float dh2 = deltaV * ptWater[stride + 1] + (1.f - deltaV) * ptWater[1];</font>
+00295 <font class="comment"> float h = deltaU * dh2 + (1.f - deltaU ) * dh1;</font>
+00296 <font class="comment"></font>
+00297 <font class="comment"> </font>
+00298 <font class="comment"> float gR = deltaV * ptGrad[stride + 1].x + (1.f - deltaV) * ptGrad[1].x;</font>
+00299 <font class="comment"> float gL = deltaV * ptGrad[stride].x + (1.f - deltaV) * ptGrad[0].x;</font>
+00300 <font class="comment"></font>
+00301 <font class="comment"> float grU = 4.5f * (deltaU * gR + (1.f - deltaU) * gL);</font>
+00302 <font class="comment"></font>
+00303 <font class="comment"> gR = deltaV * ptGrad[stride + 1].y + (1.f - deltaV) * ptGrad[1].y;</font>
+00304 <font class="comment"> gL = deltaV * ptGrad[stride].y + (1.f - deltaV) * ptGrad[0].y;</font>
+00305 <font class="comment"></font>
+00306 <font class="comment"> float grV = 4.5f * (deltaU * gR + (1.f - deltaU) * gL);</font>
+00307 <font class="comment"></font>
+00308 <font class="comment"> vb.setValueFloat3Ex (Water_VB_POS, vbIndex, inter.x, inter.y, h);</font>
+00309 <font class="comment"> vb.setValueFloat2Ex (Water_VB_DX, vbIndex, grU, grV);</font>
+00310 <font class="comment"> */</font>
+00311 <font class="comment">/*}</font>
+00312 <font class="comment"> else</font>
+00313 <font class="comment"> {</font>
+00314 <font class="comment"> // no perturbation is visible</font>
+00315 <font class="comment"> FillWaterVB(vbPointer, inter.x, inter.y, 0, 0, 0); </font>
+00316 <font class="comment"> }*/</font>
+00317 }
+00318 }
+00319
+00320 <font class="comment">//*********************************************************</font>
+00321 <font class="comment">// compute a rotation matrix from the K and the up vector</font>
+00322 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a478">ComputeUpMatrix</a>(<font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &amp;J, <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> &amp;dest, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> &amp;defaultMat)
+00323 {
+00324 <font class="comment">// if the J vector is oriented toward K, we must use another vector to compute the matrix</font>
+00325 <font class="keyword">const</font> <font class="keywordtype">float</font> JdotK = J.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a>;
+00326 <font class="keywordflow">if</font> ( (1.0f - fabsf(J.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a>)) &lt; 10E-6)
+00327 {
+00328 dest.<a class="code" href="classNLMISC_1_1CMatrix.html#z290_1">setRot</a>(defaultMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_0">getRot</a>());
+00329 }
+00330 <font class="keywordflow">else</font>
+00331 {
+00332 <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> up = (<a class="code" href="classNLMISC_1_1CVector.html#p3">NLMISC::CVector::K</a> - JdotK * J).normed();
+00333 <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> right = J ^ up;
+00334 dest.<a class="code" href="classNLMISC_1_1CMatrix.html#z290_1">setRot</a>(right, J, up);
+00335 }
+00336 }
+00337
+00338 <font class="comment">//*************************************************************</font>
+00339 <font class="comment">// draw a 2d polygon after a transformation</font>
+00340 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="namespaceNL3D.html#a479">DrawPoly2D</a>(CVertexBuffer &amp;vb, IDriver *drv, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> &amp;mat, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CPolygon.html">NLMISC::CPolygon</a> &amp;p)
+00341 {
+00342 uint k;
+00343
+00344 <font class="keywordflow">for</font> (k = 0; k &lt; p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size(); ++k)
+00345 {
+00346 <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> tPos = mat * <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a>(p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>[k].x, p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>[k].y, 0);
+00347 vb.setValueFloat3Ex (<a class="code" href="namespaceNL3D.html#a308">WATER_VB_POS</a>, k, tPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, tPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>, tPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a>);
+00348 vb.setValueFloat2Ex (<a class="code" href="namespaceNL3D.html#a309">WATER_VB_DX</a>, k, 0, 0);
+00349 }
+00350 <font class="keyword">static</font> std::vector&lt;uint32&gt; ib;
+00351 ib.resize(3 * p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size());
+00352
+00353 <font class="keywordflow">for</font> (k = 0; k &lt; p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size() - 2; ++k)
+00354 {
+00355 ib[ k * 3 ] = 0;
+00356 ib[ k * 3 + 1 ] = k + 1;
+00357 ib[ k * 3 + 2 ] = k + 2;
+00358 }
+00359 drv-&gt;renderSimpleTriangles(&amp;ib[0], p.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size() - 2);
+00360 }
+00361
+00362 <font class="comment">//***************************************************************************************************************</font>
+00363
+<a name="l00364"></a><a class="code" href="classNL3D_1_1CWaterRenderObs.html#a0">00364</a> <font class="keywordtype">void</font> CWaterRenderObs::traverse(IObs *caller)
+00365 {
+00366 <a class="code" href="hierarchical__timer_8h.html#a4">H_AUTO</a>( NL3D_Water_Render );
+00367
+00368 CRenderTrav *trav = NLMISC::safe_cast&lt;CRenderTrav *&gt;(Trav);
+00369 CWaterModel *m = NLMISC::safe_cast&lt;CWaterModel *&gt;(Model);
+00370 CWaterShape *shape = NLMISC::safe_cast&lt;CWaterShape *&gt;((IShape *) m-&gt;Shape);
+00371 IDriver *drv = trav-&gt;getDriver();
+00372 <font class="keyword">const</font> std::vector&lt;CPlane&gt; &amp;worldPyramid = ((NLMISC::safe_cast&lt;CClipTrav *&gt;(<a class="code" href="classNL3D_1_1IBaseRenderObs.html#m1">ClipObs</a>-&gt;Trav))-&gt;WorldFrustumPyramid);
+00373
+00374 <font class="keywordflow">if</font> (shape-&gt;_GridSizeTouched)
+00375 {
+00376 shape-&gt;setupVertexBuffer();
+00377 }
+00378
+00379
+00380 <font class="comment">// inverted object world matrix</font>
+00381 <font class="comment">//NLMISC::CMatrix invObjMat = HrcObs-&gt;WorldMatrix.inverted();</font>
+00382
+00383 <font class="comment">// viewer pos in world space</font>
+00384 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &amp;obsPos = <font class="comment">/*invObjMat **/</font> trav-&gt;CamPos;
+00385
+00386 <font class="comment">// camera matrix in world space</font>
+00387 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> &amp;camMat = trav-&gt;CamMatrix;
+00388
+00389 <font class="comment">// view matrix (inverted cam matrix)</font>
+00390 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> &amp;viewMat = trav-&gt;ViewMatrix;
+00391
+00392 <font class="comment">// compute the camera matrix such as there is no rotation around the y axis</font>
+00393 <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> camMatUp;
+00394 <a class="code" href="namespaceNL3D.html#a478">ComputeUpMatrix</a>(camMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_8">getJ</a>(), camMatUp, camMat);
+00395 camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z290_6">setPos</a>(camMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_4">getPos</a>());
+00396
+00397 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> matViewUp = camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z293_7">inverted</a>();
+00398
+00399 <font class="comment">// plane z pos in world</font>
+00400 <font class="keyword">const</font> <font class="keywordtype">float</font> zHeight = <a class="code" href="classNL3D_1_1IBaseRenderObs.html#m0">HrcObs</a>-&gt;WorldMatrix.getPos().z;
+00401
+00402 <font class="keyword">const</font> sint numStepX = CWaterShape::getScreenXGridSize();
+00403 <font class="keyword">const</font> sint numStepY = CWaterShape::getScreenYGridSize();
+00404
+00405 <font class="keyword">const</font> <font class="keywordtype">float</font> invNumStepX = 1.f / numStepX;
+00406 <font class="keyword">const</font> <font class="keywordtype">float</font> invNumStepY = 1.f / numStepY;
+00407
+00408 <font class="keyword">const</font> uint rotBorderSize = (shape-&gt;_MaxGridSize + (shape-&gt;_XGridBorder &lt;&lt; 1) - numStepX) &gt;&gt; 1;
+00409
+00410 <font class="keyword">const</font> sint isAbove = obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a> &gt; zHeight ? 1 : 0;
+00411
+00412
+00413
+00414 <font class="comment">//==================//</font>
+00415 <font class="comment">// polygon clipping //</font>
+00416 <font class="comment">//==================//</font>
+00417
+00418 uint k;
+00419 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CPolygon.html">NLMISC::CPolygon</a> clippedPoly, endClippedPoly;
+00420 clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.resize(shape-&gt;_Poly.Vertices.size());
+00421 <font class="keywordflow">for</font> (k = 0; k &lt; shape-&gt;_Poly.Vertices.size(); ++k)
+00422 {
+00423 clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>[k].set(shape-&gt;_Poly.Vertices[k].x,
+00424 shape-&gt;_Poly.Vertices[k].y,
+00425 0
+00426 );
+00427 }
+00428
+00429 endClippedPoly = clippedPoly;
+00430
+00431
+00432 <font class="comment">// Build the view pyramid. We need to rebuild it because we use a wider one to avoid holes on the border of the screen</font>
+00433
+00434 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CPlane.html">NLMISC::CPlane</a> plvect[6];
+00435
+00436 <font class="keyword">const</font> <font class="keywordtype">float</font> borderFactor = 0.67f; <font class="comment">// we must avoid numerical imprecision as well as the rotation case (must divide by sqrt(2))</font>
+00437 <font class="keyword">const</font> <font class="keywordtype">float</font> fRight = trav-&gt;Right * (2.f * borderFactor * (float) CWaterShape::_XGridBorder + (float) numStepX) / numStepX;
+00438 <font class="keyword">const</font> <font class="keywordtype">float</font> fTop = trav-&gt;Top * (2.f * borderFactor * (float) CWaterShape::_YGridBorder + (float) numStepY) / numStepY;
+00439
+00440 <font class="comment">// build pyramid corners</font>
+00441 <font class="keyword">const</font> <font class="keywordtype">float</font> nearDist = trav-&gt;Near;
+00442 <font class="keyword">const</font> <font class="keywordtype">float</font> farDist = trav-&gt;Far;
+00443 <font class="keyword">const</font> <font class="keywordtype">float</font> transitionDist = shape-&gt;_TransitionRatio * farDist;
+00444
+00445 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> pfoc(0,0,0);
+00446 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lb(-fRight, nearDist, - fTop );
+00447 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lt(-fRight, nearDist, fTop );
+00448 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> rb( fRight, nearDist, -fTop );
+00449 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> rt(fRight, nearDist, fTop );
+00450
+00451 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> lbfarDist(-fRight, transitionDist, -fTop);
+00452 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> ltfarDist(-fRight, transitionDist, fTop );
+00453 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> rtfarDist(fRight , transitionDist, fTop );
+00454
+00455
+00456 plvect[0].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(lt, lb, rt); <font class="comment">// near plane</font>
+00457 plvect[1].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(lbfarDist, ltfarDist, rtfarDist); <font class="comment">// far plane</font>
+00458
+00459 plvect[2].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(pfoc, lt, lb);
+00460 plvect[3].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(pfoc, rt, lt);
+00461 plvect[4].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(pfoc, rb, rt);
+00462 plvect[5].<a class="code" href="classNLMISC_1_1CPlane.html#z305_0">make</a>(pfoc, lb, rb);
+00463
+00464
+00465 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> pyramidMat = viewMat * <a class="code" href="classNL3D_1_1IBaseRenderObs.html#m0">HrcObs</a>-&gt;WorldMatrix;
+00466 <font class="keywordflow">for</font> (k = 0; k &lt; worldPyramid.size(); ++k)
+00467 {
+00468 plvect[k] = plvect[k] * pyramidMat; <font class="comment">// put the plane in object space</font>
+00469 }
+00470
+00471 clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#a3">clip</a>(plvect, 6); <font class="comment">// get the tesselated part of the poly </font>
+00472
+00473 <font class="comment">// modify the pyramid to get the transition part of the poly (no tesselated)</font>
+00474 plvect[0].<a class="code" href="classNLMISC_1_1CPlane.html#m3">d</a> += (transitionDist - nearDist);
+00475 <font class="comment">// plvect[1].d -= (farDist - transitionDist);</font>
+00476 <font class="comment">// dont clip by far plane (done by driver)</font>
+00477 endClippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#a3">clip</a>(plvect, 1);
+00478 endClippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#a3">clip</a>(plvect + 2, 4);
+00479
+00480
+00481
+00483 <font class="keywordflow">if</font> (clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size() == 0 &amp;&amp; endClippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size() == 0)
+00484 {
+00485 <font class="keywordflow">return</font>;
+00486 }
+00487
+00488
+00489 <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> modelMat;
+00490 modelMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z290_6">setPos</a>(<a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a>(obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>, zHeight));
+00491 drv-&gt;setupModelMatrix(modelMat);
+00492
+00493
+00494 <font class="comment">//==================//</font>
+00495 <font class="comment">// material setup //</font>
+00496 <font class="comment">//==================//</font>
+00497
+00498 CWaterHeightMap &amp;whm = <a class="code" href="namespaceNL3D.html#a480">GetWaterPoolManager</a>().getPoolByID(shape-&gt;_WaterPoolID);
+00499 <a class="code" href="classNL3D_1_1CWaterRenderObs.html#c0">setupMaterialNVertexShader</a>(drv, shape, obsPos, isAbove &gt; 0, whm.getUnitSize() * (whm.getSize() &gt;&gt; 1), zHeight);
+00500
+00501 <font class="comment">//setAttenuationFactor(drv, false, obsPos, camMat.getJ(), farDist);</font>
+00502 <font class="comment">//disableAttenuation(drv);</font>
+00503
+00504
+00505 <font class="comment">//================================//</font>
+00506 <font class="comment">// Vertex buffer setup //</font>
+00507 <font class="comment">//================================//</font>
+00508
+00509 drv-&gt;activeVertexBuffer(shape-&gt;_VB);
+00510
+00511 <font class="comment">//================================//</font>
+00512 <font class="comment">// tesselated part of the poly //</font>
+00513 <font class="comment">//================================//</font>
+00514
+00515 <font class="keywordflow">if</font> (clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size())
+00516 {
+00517
+00518 <font class="comment">//======================================//</font>
+00519 <font class="comment">// Polygon projection on the near plane //</font>
+00520 <font class="comment">//======================================//</font>
+00521
+00522 <font class="keyword">static</font> <a class="code" href="classNLMISC_1_1CPolygon2D.html">NLMISC::CPolygon2D</a> projPoly; <font class="comment">// projected poly</font>
+00523 projPoly.<a class="code" href="classNLMISC_1_1CPolygon2D.html#m0">Vertices</a>.resize(clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size());
+00524 <font class="keyword">const</font> <font class="keywordtype">float</font> Near = trav-&gt;Near;
+00525 <font class="keyword">const</font> <font class="keywordtype">float</font> xFactor = (numStepX &gt;&gt; 1) * Near / trav-&gt;Right;
+00526 <font class="keyword">const</font> <font class="keywordtype">float</font> xOffset = (float) (numStepX &gt;&gt; 1) + 0.5f;
+00527 <font class="keyword">const</font> <font class="keywordtype">float</font> yFactor = - (numStepX &gt;&gt; 1) * Near / trav-&gt;Top;
+00528 <font class="keyword">const</font> <font class="keywordtype">float</font> yOffset = (float) (numStepY &gt;&gt; 1) - 0.5f * isAbove;
+00529
+00530 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CMatrix.html">NLMISC::CMatrix</a> projMat = matViewUp * <a class="code" href="classNL3D_1_1IBaseRenderObs.html#m0">HrcObs</a>-&gt;WorldMatrix;
+00531 <font class="keywordflow">for</font> (k = 0; k &lt; clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size(); ++k)
+00532 {
+00533 <font class="comment">// project points in the view</font>
+00534 <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = projMat * clippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>[k];
+00535 <font class="keywordtype">float</font> invY = 1.f / t.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>;
+00536 projPoly.<a class="code" href="classNLMISC_1_1CPolygon2D.html#m0">Vertices</a>[k].set(xFactor * t.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> * invY + xOffset, yFactor * t.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a> * invY + yOffset);
+00537 }
+00538
+00539
+00540
+00541 <font class="comment">//=============================================//</font>
+00542 <font class="comment">// compute borders of poly at a low resolution //</font>
+00543 <font class="comment">//=============================================//</font>
+00544
+00545 <a class="code" href="classNLMISC_1_1CPolygon2D.html#s2">NLMISC::CPolygon2D::TRasterVect</a> rasters;
+00546 sint startY;
+00547 projPoly.<a class="code" href="classNLMISC_1_1CPolygon2D.html#a7">computeBorders</a>(rasters, startY);
+00548
+00549 <font class="keywordflow">if</font> (rasters.size())
+00550 {
+00551 <font class="comment">//===========================//</font>
+00552 <font class="comment">// perform Water animation //</font>
+00553 <font class="comment">//===========================// </font>
+00554
+00555 <font class="keyword">const</font> <font class="keywordtype">float</font> WaterRatio = whm.getUnitSize();
+00556 <font class="keyword">const</font> <font class="keywordtype">float</font> invWaterRatio = 1.f / WaterRatio;
+00557 <font class="keyword">const</font> uint WaterHeightMapSize = whm.getSize();
+00558 <font class="keyword">const</font> uint doubleWaterHeightMapSize = (WaterHeightMapSize &lt;&lt; 1);
+00559
+00560
+00561 sint64 idate = (NLMISC::safe_cast&lt;CHrcTrav *&gt;(<a class="code" href="classNL3D_1_1IBaseRenderObs.html#m0">HrcObs</a>-&gt;Trav))-&gt;CurrentDate;
+00562
+00563
+00564
+00565 <font class="keywordflow">if</font> (idate != whm.Date)
+00566 {
+00567 whm.setUserPos((sint) (obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> * invWaterRatio) - (WaterHeightMapSize &gt;&gt; 1),
+00568 (sint) (obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> * invWaterRatio) - (WaterHeightMapSize &gt;&gt; 1)
+00569 );
+00570 <a class="code" href="debug_8h.html#a6">nlassert</a>(m-&gt;_Scene); <font class="comment">// this object should have been created from a CWaterShape!</font>
+00571 whm.animate((<font class="keywordtype">float</font>) (m-&gt;_Scene-&gt;getEllapsedTime()));
+00572 whm.Date = idate;
+00573 }
+00574
+00575 <font class="comment">//float startDate = (float) (1000.f * NLMISC::CTime::ticksToSecond(NLMISC::CTime::getPerformanceTime()));</font>
+00576
+00577 <font class="comment">//=====================================//</font>
+00578 <font class="comment">// compute heightmap useful area //</font>
+00579 <font class="comment">//=====================================//</font>
+00580
+00588 sint mapPosX, mapPosY;
+00589
+00592 whm.getUserPos(mapPosX, mapPosY);
+00593
+00594 <font class="keyword">const</font> uint mapBorder = 3;
+00595 <font class="comment">/*const sint qRight = (sint) mapPosX + (WaterHeightMapSize &gt;&gt; 1) - mapBorder;</font>
+00596 <font class="comment"> sint qLeft = (sint) mapPosX - (WaterHeightMapSize &gt;&gt; 1);</font>
+00597 <font class="comment"> const sint qUp = (sint) mapPosY + (WaterHeightMapSize &gt;&gt; 1) - mapBorder;</font>
+00598 <font class="comment"> sint qDown = (sint) mapPosY - (WaterHeightMapSize &gt;&gt; 1); */</font>
+00599
+00600
+00601 <font class="keyword">const</font> sint qRight = (sint) mapPosX + WaterHeightMapSize - mapBorder;
+00602 sint qLeft = (sint) mapPosX;
+00603 <font class="keyword">const</font> sint qUp = (sint) mapPosY + WaterHeightMapSize - mapBorder;
+00604 sint qDown = (sint) mapPosY;
+00605
+00607 <font class="keyword">const</font> sint qSubLeft = qLeft - (uint) qLeft % WaterHeightMapSize;
+00608 <font class="keyword">const</font> sint qSubDown = qDown - (uint) qDown % WaterHeightMapSize;
+00609
+00610 qLeft += mapBorder;
+00611 qDown += mapBorder;
+00612
+00613
+00614
+00615
+00616 <font class="comment">//==============================================//</font>
+00617 <font class="comment">// setup rays to be traced, and their increment //</font>
+00618 <font class="comment">//==============================================//</font>
+00619
+00620
+00621 <font class="comment">// compute camera rays in world space</font>
+00622 CVector currHV = trav-&gt;Left * camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_7">getI</a>() + trav-&gt;Near * camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_8">getJ</a>() + trav-&gt;Top * camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_9">getK</a>(); <font class="comment">// current border vector, incremented at each line</font>
+00623 CVector currV; <font class="comment">// current ray vector</font>
+00624 CVector xStep = (trav-&gt;Right - trav-&gt;Left) * invNumStepX * camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_7">getI</a>(); <font class="comment">// xStep for the ray vector</font>
+00625 CVector yStep = (trav-&gt;Bottom - trav-&gt;Top) * invNumStepY * camMatUp.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_9">getK</a>(); <font class="comment">// yStep for the ray vector</font>
+00626
+00627
+00628
+00629 <font class="comment">//===============================================//</font>
+00630 <font class="comment">// perform display //</font>
+00631 <font class="comment">//===============================================//</font>
+00632
+00633 <font class="comment">// scale currHV at the top of the poly</font>
+00634 currHV += (startY - 0.5f * isAbove) * yStep;
+00635
+00636 <font class="comment">// current index buffer used. We swap each time a row has been drawn</font>
+00637 std::vector&lt;uint32&gt; *currIB = &amp;CWaterShape::_IBUpDown, *otherIB = &amp;CWaterShape::_IBDownUp;
+00638
+00639
+00640 sint vIndex = 0; <font class="comment">// index in vertices </font>
+00641
+00642 <font class="comment">// current raster position</font>
+00643 sint oldStartX, oldEndX, realStartX, realEndX;
+00644 <font class="comment">//float invNearWidth = numStepX / (trav-&gt;Right - trav-&gt;Left);</font>
+00645
+00646 <font class="comment">//nlinfo("size = %d, maxSize = ", rasters.size(), numStepY);</font>
+00647
+00648
+00649 <font class="keyword">const</font> uint wqHeight = rasters.size();
+00650 <font class="keywordflow">if</font> (wqHeight)
+00651 {
+00652 <font class="comment">// denominator of the intersection equation</font>
+00653 <font class="keyword">const</font> <font class="keywordtype">float</font> denom = - obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a> + zHeight;
+00654 <font class="comment">// test the upper raster</font>
+00655 <font class="comment">// if it is above the horizon, we modify it to reach the correct location</font>
+00656 <font class="keyword">const</font> <font class="keywordtype">float</font> horizonEpsilon = 10E-4f; <font class="comment">// we must be a little below the horizon</font>
+00657
+00658 <font class="comment">// distance from the viewer along the traced ray</font>
+00659 <font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a>;
+00660
+00661
+00662
+00663
+00664 NLMISC::CPolygon2D::TRasterVect::const_iterator it = rasters.begin();
+00665 <font class="keywordflow">for</font> (uint <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> = 0; <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> &lt;= wqHeight; ++<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a>)
+00666 {
+00667 <font class="comment">//nlinfo("start = %d, end = %d", it-&gt;first, it-&gt;second); </font>
+00668 <font class="keyword">const</font> sint startX = it-&gt;first;
+00669 <font class="keyword">const</font> sint endX = (it-&gt;second + 1);
+00670
+00671 <a class="code" href="debug_8h.html#a6">nlassert</a>(startX &gt;= - (sint) rotBorderSize);
+00672 <a class="code" href="debug_8h.html#a6">nlassert</a>(endX &lt;= (sint) (numStepX + rotBorderSize));
+00673
+00674 <font class="keywordflow">if</font> (<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> != 0)
+00675 {
+00676 realStartX = <a class="code" href="bit__set_8cpp.html#a0">std::min</a>(startX, oldStartX);
+00677 realEndX = std::max(endX, oldEndX);
+00678 }
+00679 <font class="keywordflow">else</font>
+00680 {
+00681 realStartX = startX;
+00682 realEndX = endX;
+00683 }
+00684
+00685
+00686 <font class="comment">// current view vector</font>
+00687 currV = currHV + (realStartX - 0.5f) * xStep;
+00688
+00689 <font class="keywordflow">if</font> (<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> == 0)
+00690 {
+00691 <font class="keywordflow">if</font> (isAbove)
+00692 {
+00693 <font class="comment">// test wether the first row is out of horizon.</font>
+00694 <font class="comment">// if this is the case, we make a correction</font>
+00695 <font class="keywordflow">if</font> (denom * currV.z &lt;= 0)
+00696 {
+00697 <font class="comment">// correct for the first line only by adding a y offset</font>
+00698 currV += yStep * ((denom &gt; 0 ? horizonEpsilon : - horizonEpsilon) - currV.z) / yStep.z;
+00699 }
+00700
+00701 <font class="comment">// now, for the transition, check wether the first raster does not go over the transition dist</font>
+00702
+00703 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = denom / currV.z;
+00704 <font class="keyword">const</font> <font class="keywordtype">float</font> VJ = camMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_8">getJ</a>() * currV;
+00705 <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> * VJ &gt; transitionDist)
+00706 {
+00707 <font class="keywordtype">float</font> delta = (1.f / yStep.z) * ( denom * VJ / transitionDist - currV.z);
+00708 <font class="comment">// correct the first line to reach that position</font>
+00709 currV += delta * yStep;
+00710 }
+00711 }
+00712 }
+00713
+00714
+00715 uint8 *vbPointer = (uint8 *) shape-&gt;_VB.getVertexCoordPointer() + shape-&gt;_VB.getVertexSize() * (vIndex + realStartX + rotBorderSize);
+00716
+00717
+00718 <font class="keywordflow">for</font> (sint k = realStartX; k &lt;= realEndX; ++k)
+00719 {
+00720 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = denom / currV.z;
+00721 <font class="comment">// compute intersection with plane </font>
+00722 CVector inter = <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> * currV;
+00723 inter.z += obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a>;
+00724 <a class="code" href="namespaceNL3D.html#a477">SetupWaterVertex</a>(qLeft, qRight, qUp, qDown, qSubLeft, qSubDown, inter, invWaterRatio, doubleWaterHeightMapSize, whm, vbPointer, obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>);
+00725 currV += xStep;
+00726 }
+00727
+00728 <font class="keywordflow">if</font> (<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> != 0) <font class="comment">// 2 line of the ib done ?</font>
+00729 {
+00730 sint count = oldEndX - oldStartX;
+00731 <font class="keywordflow">if</font> (count &gt; 0)
+00732 {
+00733 drv-&gt;renderSimpleTriangles(&amp;((*currIB)[(oldStartX + rotBorderSize) * 6]),
+00734 2 * count );
+00735 }
+00736 }
+00737
+00738 oldStartX = startX;
+00739 oldEndX = endX;
+00740 currHV += yStep;
+00741 vIndex = (numStepX + 2 * rotBorderSize + 1) - vIndex; <font class="comment">// swap first row and second row</font>
+00742 std::swap(currIB, otherIB);
+00743 <font class="keywordflow">if</font> (<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> &lt; (wqHeight - 1))
+00744 {
+00745 ++it;
+00746 }
+00747 <font class="keywordflow">else</font>
+00748 {
+00749 <font class="keywordflow">if</font> (!isAbove)
+00750 {
+00751 <font class="comment">// last line</font>
+00752 <font class="comment">// test wether we are out of horizon</font>
+00753 <font class="keywordflow">if</font> (denom * currHV.z &lt;= 0)
+00754 {
+00755 <font class="comment">// correct for the first line only by adding a y offset</font>
+00756 currHV += yStep * ((denom &gt; 0 ? horizonEpsilon : - horizonEpsilon) - currHV.z) / yStep.z;
+00757 }
+00758
+00759 <font class="comment">// now, for the transition, check wether the first raster does not go over the transition dist</font>
+00760
+00761 <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> = denom / currHV.z;
+00762 <font class="keyword">const</font> <font class="keywordtype">float</font> VJ = camMat.<a class="code" href="classNLMISC_1_1CMatrix.html#z291_8">getJ</a>() * currHV;
+00763 <font class="keywordflow">if</font> ( <a class="code" href="driver__opengl__extension__def_8h.html#a384">t</a> * VJ &gt; transitionDist)
+00764 {
+00765 <font class="keywordtype">float</font> delta = (1.f / yStep.z) * ( denom * VJ / transitionDist - currHV.z);
+00766 <font class="comment">// correct the first line to reach that position</font>
+00767 currHV += delta * yStep;
+00768 }
+00769 }
+00770
+00771 }
+00772 }
+00773
+00774 }
+00775 <font class="comment">//nlinfo("display: %f ms", (float) (1000.f * NLMISC::CTime::ticksToSecond(NLMISC::CTime::getPerformanceTime()) - startDate));</font>
+00776 }
+00777 }
+00778
+00779 <font class="comment">//=========================================//</font>
+00780 <font class="comment">// display end poly //</font>
+00781 <font class="comment">//=========================================//</font>
+00782
+00783 <font class="keywordflow">if</font> (endClippedPoly.<a class="code" href="classNLMISC_1_1CPolygon.html#m0">Vertices</a>.size() != 0)
+00784 {
+00785 CMatrix mtx; <font class="comment">/*= HrcObs-&gt;WorldMatrix;*/</font>
+00786 <font class="comment">// mtx.setPos(NLMISC::CVector(-obsPos.x, -obsPos.y, obsPos.z));</font>
+00787
+00788 mtx.setPos(<a class="code" href="classNL3D_1_1IBaseRenderObs.html#m0">HrcObs</a>-&gt;WorldMatrix.getPos() + <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a>(-obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, -obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>, 0));
+00789 <font class="comment">// set right obsever position</font>
+00790 drv-&gt;setConstant(7, 0, 0, obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a> <font class="comment">/* - zHeight*/</font> , 0.f);
+00791 <font class="comment">//setAttenuationFactor(drv, true, obsPos, camMat.getJ(), farDist); </font>
+00792 <a class="code" href="namespaceNL3D.html#a479">DrawPoly2D</a>(shape-&gt;_VB, drv, mtx, endClippedPoly);
+00793 }
+00794
+00795 <font class="comment">/*if (endTransitionClippedPoly.Vertices.size() != 0)</font>
+00796 <font class="comment"> { </font>
+00797 <font class="comment"> disableAttenuation(drv); </font>
+00798 <font class="comment"> DrawPoly2D(shape-&gt;_VB, drv, HrcObs-&gt;WorldMatrix, endTransitionClippedPoly);</font>
+00799 <font class="comment"> }*/</font>
+00800
+00801
+00802 <font class="keywordflow">if</font> (drv-&gt;isVertexProgramSupported())
+00803 {
+00804 <font class="keywordtype">bool</font> result = drv-&gt;activeVertexProgram(NULL);
+00805 <font class="keywordflow">if</font> (!result) <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"no vertex program setupped"</font>);
+00806 }
+00807
+00808
+00809 this-&gt;<a class="code" href="classNL3D_1_1IObs.html#z620_0">traverseSons</a>();
+00810 }
+00811
+00812 <font class="comment">//***********************</font>
+00813 <font class="comment">// Water MATERIAL SETUP //</font>
+00814 <font class="comment">//***********************</font>
+00815
+<a name="l00816"></a><a class="code" href="classNL3D_1_1CWaterRenderObs.html#c0">00816</a> <font class="keywordtype">void</font> CWaterRenderObs::setupMaterialNVertexShader(IDriver *drv, CWaterShape *shape, <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &amp;obsPos, <font class="keywordtype">bool</font> above, <font class="keywordtype">float</font> maxDist, <font class="keywordtype">float</font> zHeight)
+00817 {
+00818 CMaterial WaterMat;
+00819 WaterMat.setLighting(<font class="keyword">false</font>);
+00820 WaterMat.setDoubleSided(<font class="keyword">true</font>);
+00821 WaterMat.setColor(<a class="code" href="classNLMISC_1_1CRGBA.html#p7">NLMISC::CRGBA::White</a>);
+00822
+00823 WaterMat.setBlend(<font class="keyword">true</font>);
+00824 WaterMat.setSrcBlend(CMaterial::srcalpha);
+00825 WaterMat.setDstBlend(CMaterial::invsrcalpha);
+00826 WaterMat.setZWrite(<font class="keyword">true</font>);
+00827
+00828 <font class="keywordflow">if</font> (drv-&gt;isVertexProgramSupported())
+00829 {
+00830 <font class="keyword">const</font> uint cstOffset = 4; <font class="comment">// 4 places for the matrix</font>
+00831 <a class="code" href="classNLMISC_1_1CVectorH.html">NLMISC::CVectorH</a> cst[13];
+00832
+00833
+00834 <font class="comment">//=========================//</font>
+00835 <font class="comment">// setup Water material //</font>
+00836 <font class="comment">//=========================//</font>
+00837
+00838 uint alphaMapStage, envMapStage;
+00839 WaterMat.setColor(<a class="code" href="classNLMISC_1_1CRGBA.html#p7">NLMISC::CRGBA::White</a>);
+00840
+00841 <font class="keywordtype">bool</font> useBumpedVersion = <font class="keyword">false</font>;
+00842 <font class="keywordtype">bool</font> useEMBM = <font class="keyword">false</font>;
+00843 <font class="keywordflow">if</font> (drv-&gt;getNbTextureStages() &gt;= 4 &amp;&amp; (drv-&gt;supportTextureShaders() || drv-&gt;supportEMBM()))
+00844 {
+00845 <font class="keywordflow">if</font> (drv-&gt;supportTextureShaders())
+00846 {
+00847 useBumpedVersion = <font class="keyword">true</font>;
+00848 }
+00849 <font class="keywordflow">else</font> <font class="comment">// must support EMBM on stages 0 and 1</font>
+00850 {
+00851 <font class="keywordflow">if</font> (drv-&gt;isEMBMSupportedAtStage(0) &amp;&amp; drv-&gt;isEMBMSupportedAtStage(1))
+00852 {
+00853 useBumpedVersion = <font class="keyword">true</font>;
+00854 useEMBM = <font class="keyword">true</font>;
+00855 }
+00856 }
+00857 }
+00858
+00859
+00860 <font class="keywordflow">if</font> (!useBumpedVersion)
+00861 {
+00862 WaterMat.texEnvOpRGB(0, CMaterial::Modulate);
+00863 alphaMapStage = 1;
+00864 envMapStage = 0;
+00865 }
+00866 <font class="keywordflow">else</font>
+00867 {
+00868 shape-&gt;updateHeightMapNormalizationFactors();
+00869
+00870 <font class="comment">// setup bump proj matrix </font>
+00871 <font class="keyword">const</font> <font class="keywordtype">float</font> idMat[] = {0.25f * shape-&gt;_HeightMapNormalizationFactor[0], 0, 0, 0.25f * shape-&gt;_HeightMapNormalizationFactor[0]};
+00872 <font class="keyword">const</font> <font class="keywordtype">float</font> idMat2[] = {shape-&gt;_HeightMapNormalizationFactor[1], 0, 0, shape-&gt;_HeightMapNormalizationFactor[1]};
+00873
+00874 WaterMat.setTexture(0, shape-&gt;_BumpMap[0]);
+00875 WaterMat.setTexture(1, shape-&gt;_BumpMap[1]);
+00876 WaterMat.texEnvOpRGB(2, CMaterial::Replace);
+00877 alphaMapStage = 3;
+00878 envMapStage = 2;
+00879
+00880 <font class="comment">// Version with texture shaders</font>
+00881 <font class="keywordflow">if</font> (!useEMBM)
+00882 {
+00883 drv-&gt;setMatrix2DForTextureOffsetAddrMode(1, idMat);
+00884 drv-&gt;setMatrix2DForTextureOffsetAddrMode(2, idMat2);
+00885
+00886
+00887 <font class="comment">//if (shape-&gt;_BumpMap[0]-&gt;supportSharing()) nlinfo(shape-&gt;_BumpMap[0]-&gt;getShareName().c_str());</font>
+00888 <font class="comment">//if (shape-&gt;_BumpMap[1]-&gt;supportSharing()) nlinfo(shape-&gt;_BumpMap[1]-&gt;getShareName().c_str());</font>
+00889
+00890 <font class="comment">/*WaterMat.texEnvOpRGB(1, CMaterial::Replace);</font>
+00891 <font class="comment"> WaterMat.texEnvOpRGB(1, CMaterial::Replace);*/</font>
+00892 WaterMat.enableTexAddrMode();
+00893 WaterMat.setTexAddressingMode(0, CMaterial::FetchTexture);
+00894 WaterMat.setTexAddressingMode(1, CMaterial::OffsetTexture);
+00895 WaterMat.setTexAddressingMode(2, CMaterial::OffsetTexture);
+00896 WaterMat.setTexAddressingMode(3, shape-&gt;_ColorMap ? CMaterial::FetchTexture : CMaterial::TextureOff);
+00897 }
+00898 <font class="keywordflow">else</font> <font class="comment">// version with EMBM</font>
+00899 {
+00900 drv-&gt;setEMBMMatrix(0, idMat2);
+00901 drv-&gt;setEMBMMatrix(1, idMat2);
+00902 WaterMat.texEnvOpRGB(0, CMaterial::EMBM);
+00903 <font class="comment">//WaterMat.texEnvOpRGB(0, CMaterial::Replace);</font>
+00904 <font class="comment">//WaterMat.texEnvOpRGB(0, CMaterial::EMBM);</font>
+00905 WaterMat.texEnvOpRGB(1, CMaterial::EMBM);
+00906 WaterMat.setTexture(0, NULL);
+00907 }
+00908 }
+00909
+00910
+00911 <font class="keywordflow">if</font> (!above &amp;&amp; shape-&gt;_EnvMap[1])
+00912 {
+00913 WaterMat.setTexture(envMapStage, shape-&gt;_EnvMap[1]);
+00914 <font class="comment">//if (shape-&gt;_EnvMap[1]-&gt;supportSharing()) nlinfo(shape-&gt;_EnvMap[1]-&gt;getShareName().c_str());</font>
+00915 }
+00916 <font class="keywordflow">else</font>
+00917 {
+00918 WaterMat.setTexture(envMapStage, shape-&gt;_EnvMap[0]);
+00919 }
+00920 shape-&gt;envMapUpdate();
+00921
+00922
+00923 <font class="keywordflow">if</font> (shape-&gt;_ColorMap)
+00924 {
+00925 WaterMat.setTexture(alphaMapStage, shape-&gt;_ColorMap);
+00926 <font class="comment">//if (shape-&gt;_ColorMap-&gt;supportSharing()) nlinfo(shape-&gt;_ColorMap-&gt;getShareName().c_str());</font>
+00927
+00928
+00929 <font class="comment">// setup 2x3 matrix for lookup in diffuse map</font>
+00930 cst[13 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(shape-&gt;_ColorMapMatColumn0.x, shape-&gt;_ColorMapMatColumn1.x, 0, shape-&gt;_ColorMapMatColumn0.x * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> + shape-&gt;_ColorMapMatColumn1.x * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> + shape-&gt;_ColorMapMatPos.x);
+00931 cst[14 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(shape-&gt;_ColorMapMatColumn0.y, shape-&gt;_ColorMapMatColumn1.y, 0, shape-&gt;_ColorMapMatColumn0.y * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> + shape-&gt;_ColorMapMatColumn1.y * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> + shape-&gt;_ColorMapMatPos.y);
+00932 WaterMat.texEnvOpRGB(alphaMapStage, CMaterial::Modulate);
+00933 WaterMat.texEnvOpAlpha(alphaMapStage, CMaterial::Modulate);
+00934 }
+00935 <font class="keywordflow">else</font>
+00936 {
+00937 cst[13 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0, 0, 0, 0);
+00938 cst[14 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0, 0, 0, 0);
+00939 }
+00940
+00941 cst[16 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0.1f, 0.1f, 0.1f, 0.1f); <font class="comment">// used to avoid imprecision when performing a RSQ to get distance from the origin</font>
+00942 <font class="comment">// cst[16 - cstOffset].set(0.0f, 0.0f, 0.0f, 0.0f); // used to avoid imprecision when performing a RSQ to get distance from the origin</font>
+00943
+00944
+00945
+00946
+00947 cst[5 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0.f, 0.f, 0.f, 0.f); <font class="comment">// claping negative values to 0</font>
+00948
+00949 <font class="comment">// slope of attenuation of normal / height with distance </font>
+00950 <font class="keyword">const</font> <font class="keywordtype">float</font> invMaxDist = shape-&gt;_WaveHeightFactor / maxDist;
+00951 cst[6 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(invMaxDist, shape-&gt;_WaveHeightFactor, 0, 0);
+00952
+00953 <font class="comment">/*cst[6 - cstOffset].set(invMaxDist, invMaxDist, invMaxDist, invMaxDist); // upcoming light vectorshape-&gt;_WaveHeightFactor </font>
+00954 <font class="comment"> cst[15 - cstOffset].set(shape-&gt;_WaveHeightFactor, shape-&gt;_WaveHeightFactor, shape-&gt;_WaveHeightFactor, shape-&gt;_WaveHeightFactor);</font>
+00955 <font class="comment"> */</font>
+00956
+00957
+00958
+00959
+00961 drv-&gt;setConstantMatrix(0, IDriver::ModelViewProjection, IDriver::Identity);
+00962
+00963 <font class="comment">// retrieve current time</font>
+00964 <font class="keywordtype">float</font> date = 0.001f * <a class="code" href="classNLMISC_1_1CTime.html#d1">NLMISC::CTime::getLocalTime</a>();
+00965 <font class="comment">// set bumpmaps pos</font>
+00966 cst[9 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> * shape-&gt;_HeightMapScale[0].x + date * shape-&gt;_HeightMapSpeed[0].x, shape-&gt;_HeightMapScale[0].y * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> + date * shape-&gt;_HeightMapSpeed[0].y, 0.f, 0.f); <font class="comment">// bump map 0 offset</font>
+00967 cst[10 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(shape-&gt;_HeightMapScale[0].x, shape-&gt;_HeightMapScale[0].y, 0, 0); <font class="comment">// bump map 0 scale</font>
+00968 cst[11 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(shape-&gt;_HeightMapScale[1].x * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a> + date * shape-&gt;_HeightMapSpeed[1].x, shape-&gt;_HeightMapScale[1].y * obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a> + date * shape-&gt;_HeightMapSpeed[0].y, 0.f, 0.f); <font class="comment">// bump map 1 offset</font>
+00969 cst[12 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(shape-&gt;_HeightMapScale[1].x, shape-&gt;_HeightMapScale[1].y, 0, 0); <font class="comment">// bump map 1 scale</font>
+00970
+00971
+00972
+00973
+00974
+00975
+00976 cst[4 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(1.f, 1.f, 1.f, 1.f); <font class="comment">// use with min man, and to get the 1 constant </font>
+00977 cst[7 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0, 0, obsPos.<a class="code" href="classNLMISC_1_1CVector.html#m2">z</a> - zHeight, 0.f);
+00978 cst[8 - cstOffset].<a class="code" href="classNLMISC_1_1CVectorH.html#a4">set</a>(0.5f, 0.5f, 0.f, 0.f); <font class="comment">// used to scale reflected ray into the envmap</font>
+00979
+00980
+00981
+00982
+00984 drv-&gt;setConstant(4, <font class="keyword">sizeof</font>(cst) / <font class="keyword">sizeof</font>(cst[0]), (<font class="keywordtype">float</font> *) &amp;cst[0]);
+00985
+00986 shape-&gt;initVertexProgram();
+00987 <font class="keywordtype">bool</font> result;
+00988 <font class="keywordflow">if</font> (useBumpedVersion)
+00989 {
+00990 <font class="keywordflow">if</font> (!useEMBM)
+00991 {
+00992 result = shape-&gt;getColorMap() ? drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramBump2Diffuse).get())
+00993 : drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramBump2).get());
+00994 }
+00995 <font class="keywordflow">else</font>
+00996 {
+00997 result = shape-&gt;getColorMap() ? drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramBump1Diffuse).get())
+00998 : drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramBump1).get());
+00999 }
+01000 }
+01001 <font class="keywordflow">else</font>
+01002 {
+01003 result = shape-&gt;getColorMap() ? drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramNoBumpDiffuse).get())
+01004 : drv-&gt;activeVertexProgram((shape-&gt;_VertexProgramNoBump).get());
+01005 }
+01006 <font class="keywordflow">if</font> (!result) <a class="code" href="debug_8h.html#a2">nlwarning</a>(<font class="stringliteral">"no vertex program setupped"</font>);
+01007 }
+01008 <font class="keywordflow">else</font>
+01009 {
+01010 WaterMat.setColor(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a>(0, 32, 190, 128));
+01011 }
+01012
+01013
+01014 <font class="comment">// temp for test</font>
+01015 <font class="comment">/* WaterMat = CMaterial();</font>
+01016 <font class="comment"> WaterMat.initUnlit();</font>
+01017 <font class="comment"> WaterMat.setDoubleSided(true);</font>
+01018 <font class="comment"> WaterMat.setColor(CRGBA::Red);</font>
+01019 <font class="comment"></font>
+01020 <font class="comment"></font>
+01021 <font class="comment"> WaterMat.texEnvOpRGB(0, CMaterial::Replace);</font>
+01022 <font class="comment"> WaterMat.texEnvOpAlpha(0, CMaterial::Replace);</font>
+01023 <font class="comment"> WaterMat.texEnvArg0RGB(0, CMaterial::Diffuse, CMaterial::SrcColor);</font>
+01024 <font class="comment"> WaterMat.texEnvArg0Alpha(0, CMaterial::Diffuse, CMaterial::SrcAlpha);</font>
+01025 <font class="comment"> */</font>
+01026
+01027 drv-&gt;setupMaterial(WaterMat);
+01028 }
+01029
+01030 <font class="comment">//=======================================================================================</font>
+01031 <font class="comment">// wave maker implementation</font>
+01032 <font class="comment">//=======================================================================================</font>
+01033
+01034
+<a name="l01035"></a><a class="code" href="classNL3D_1_1CWaveMakerModel.html#a0">01035</a> CWaveMakerModel::CWaveMakerModel() : _Time(0), _Scene(NULL)
+01036 {
+01037 <font class="comment">// AnimDetail behavior: Must be traversed in AnimDetail, even if no channel mixer registered</font>
+01038 CTransform::setIsForceAnimDetail(<font class="keyword">true</font>);
+01039 }
+01040
+01041 <font class="comment">//================================================</font>
+01042
+<a name="l01043"></a><a class="code" href="classNL3D_1_1CWaveMakerModel.html#d0">01043</a> <font class="keywordtype">void</font> CWaveMakerModel::registerBasic()
+01044 {
+01045 CMOT::registerModel(<a class="code" href="namespaceNL3D.html#a311">WaveMakerModelClassId</a>, <a class="code" href="namespaceNL3D.html#a277">TransformShapeId</a>, CWaveMakerModel::creator);
+01046 CMOT::registerObs(<a class="code" href="namespaceNL3D.html#a3">AnimDetailTravId</a>, <a class="code" href="namespaceNL3D.html#a311">WaveMakerModelClassId</a>, CWaveMakerDetailObs::creator);
+01047 }
+01048
+01049 <font class="comment">//================================================</font>
+01050
+<a name="l01051"></a><a class="code" href="classNL3D_1_1CWaveMakerModel.html#a1">01051</a> ITrack* CWaveMakerModel::getDefaultTrack (uint valueId)
+01052 {
+01053 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+01054 <a class="code" href="classNL3D_1_1CWaveMakerModel.html#l1">CWaveMakerShape</a> *ws = NLMISC::safe_cast&lt;CWaveMakerShape *&gt;((IShape *) <a class="code" href="classNL3D_1_1CTransformShape.html#m0">Shape</a>);
+01055 <font class="keywordflow">switch</font> (valueId)
+01056 {
+01057 <font class="keywordflow">case</font> <a class="code" href="classNL3D_1_1ITransformable.html#z872_0s5">PosValue</a>: <font class="keywordflow">return</font> ws-&gt;getDefaultPos(); <font class="keywordflow">break</font>;
+01058 <font class="keywordflow">default</font>: <font class="comment">// delegate to parent</font>
+01059 <font class="keywordflow">return</font> CTransformShape::getDefaultTrack(valueId);
+01060 <font class="keywordflow">break</font>;
+01061 }
+01062 }
+01063
+01064 <font class="comment">//================================================</font>
+01065
+<a name="l01066"></a><a class="code" href="classNL3D_1_1CWaveMakerDetailObs.html#a0">01066</a> <font class="keywordtype">void</font> CWaveMakerDetailObs::traverse(IObs *caller)
+01067 {
+01068 CTransformAnimDetailObs::traverse(caller);
+01070 CWaveMakerModel *wmm = NLMISC::safe_cast&lt;CWaveMakerModel *&gt;(Model);
+01071 <a class="code" href="debug_8h.html#a6">nlassert</a>(wmm-&gt;_Scene);
+01073 CWaveMakerShape *wms = NLMISC::safe_cast&lt;CWaveMakerShape *&gt;((IShape *) wmm-&gt;Shape);
+01074 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> worldPos = this-&gt;<a class="code" href="classNL3D_1_1IBaseAnimDetailObs.html#m1">ClipObs</a>-&gt;HrcObs-&gt;WorldMatrix.getPos();
+01075 <font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector2f.html">NLMISC::CVector2f</a> pos2d(worldPos.<a class="code" href="classNLMISC_1_1CVector.html#m0">x</a>, worldPos.<a class="code" href="classNLMISC_1_1CVector.html#m1">y</a>);
+01077 CWaterHeightMap &amp;whm = <a class="code" href="namespaceNL3D.html#a480">GetWaterPoolManager</a>().getPoolByID(wms-&gt;_PoolID);
+01078 <font class="comment">// get the time delta </font>
+01079 <font class="keyword">const</font> <a class="code" href="namespaceNL3D.html#a1">TAnimationTime</a> deltaT = <a class="code" href="bit__set_8cpp.html#a0">std::min</a>(wmm-&gt;_Scene-&gt;getEllapsedTime(), (TAnimationTime) whm.getPropagationTime());
+01080 wmm-&gt;_Time += deltaT;
+01081 <font class="keywordflow">if</font> (!wms-&gt;_ImpulsionMode)
+01082 {
+01083 whm.perturbate(pos2d, wms-&gt;_Intensity * cosf(2.f / wms-&gt;_Period * (<font class="keywordtype">float</font>) NLMISC::Pi * wmm-&gt;_Time), wms-&gt;_Radius);
+01084 }
+01085 <font class="keywordflow">else</font>
+01086 {
+01087 <font class="keywordflow">if</font> (wmm-&gt;_Time &gt; wms-&gt;_Period)
+01088 {
+01089 wmm-&gt;_Time -= wms-&gt;_Period;
+01090 whm.perturbate(pos2d, wms-&gt;_Intensity, wms-&gt;_Radius);
+01091 }
+01092 }
+01093 this-&gt;<a class="code" href="classNL3D_1_1IObs.html#z620_0">traverseSons</a>();
+01094 }
+01095
+01096
+01097 } <font class="comment">// NL3D</font>
+</pre></div>
+
+<!-- footer -->
+<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
+</TD>
+<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
+</TR>
+</TABLE>
+</BODY>
+</HTML>