diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a05345.html | 1881 |
1 files changed, 1881 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a05345.html b/docs/doxygen/nel/a05345.html new file mode 100644 index 00000000..b690393e --- /dev/null +++ b/docs/doxygen/nel/a05345.html @@ -0,0 +1,1881 @@ +<!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: zone_lighter.cpp File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>zone_lighter.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2> +Class to light zones<p> +<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a05345.html">zone_lighter.cpp</a>,v 1.34 2004/01/15 17:33:18 lecroart Exp </dd></dl> + +<p> +Definition in file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +<code>#include "<a class="el" href="a06438.html">std3d.h</a>"</code><br> +<code>#include "<a class="el" href="a06769.html">3d/zone_lighter.h</a>"</code><br> +<code>#include "<a class="el" href="a05863.html">3d/landscape.h</a>"</code><br> +<code>#include "<a class="el" href="a06166.html">3d/patchuv_locator.h</a>"</code><br> +<code>#include "<a class="el" href="a06377.html">3d/shape.h</a>"</code><br> +<code>#include "<a class="el" href="a05990.html">3d/mesh.h</a>"</code><br> +<code>#include "<a class="el" href="a06017.html">3d/mesh_multi_lod.h</a>"</code><br> +<code>#include "<a class="el" href="a06006.html">3d/mesh_mrm.h</a>"</code><br> +<code>#include "<a class="el" href="a06571.html">3d/transform_shape.h</a>"</code><br> +<code>#include "<a class="el" href="a06742.html">3d/water_shape.h</a>"</code><br> +<code>#include "<a class="el" href="a06522.html">3d/texture_file.h</a>"</code><br> +<code>#include "<a class="el" href="a05587.html">nel/misc/common.h</a>"</code><br> +<code>#include "<a class="el" href="a06535.html">nel/misc/thread.h</a>"</code><br> +<code>#include "<a class="el" href="a06168.html">nel/misc/path.h</a>"</code><br> +<code>#include "<a class="el" href="a05709.html">nel/misc/file.h</a>"</code><br> +<code>#include "<a class="el" href="a05385.html">nel/misc/aabbox.h</a>"</code><br> +<code>#include "<a class="el" href="a05426.html">nel/misc/algo.h</a>"</code><br> + +<p> +<a href="a06768.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Data Structures</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>struct </td><td class="memItemRight" valign=bottom><a class="el" href="a03533.html">CTileOfPatch</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">a struct that helps us to know which tile we've processed </em> <a href="a03533.html#_details">More...</a><em><br><br></td></tr> +<tr><td colspan=2><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a16">AllBack</a> 1</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a15">AllFront</a> 0</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a18">BLUR_SIZE</a> 4</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a17">Clipped</a> 2</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a14">CLIPPED_ALL</a> (CLIPPED_TOP|CLIPPED_BOTTOM|CLIPPED_LEFT|CLIPPED_RIGHT)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a11">CLIPPED_BOTTOM</a> 2</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a13">CLIPPED_LEFT</a> 4</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a12">CLIPPED_RIGHT</a> 3</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a10">CLIPPED_TOP</a> 1</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a1">DEFAULT_JITTER</a> 0.4f</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a6">DEFAULT_SUN_CENTER</a> (CVector (0, 0, 0))</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a4">DEFAULT_SUN_DISTANCE</a> 50000</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a5">DEFAULT_SUN_FOV</a> (<a class="el" href="a05378.html#a44">NLMISC::Pi</a>/6)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a7">DEFAULT_SUN_RADIUS</a> 5000</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a8">DEFAULT_SUN_SRQT_SAMPLES</a> 4</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a2">DEFAULT_ZBUFFER_LANDSCAPE_SIZE</a> 32768</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a3">DEFAULT_ZBUFFER_OBJECT_SIZE</a> (32768*3)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a9">NL3D_ZONE_LIGHTER_CUBE_GRID_SIZE</a> 16</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a0">USE_JPEG</a></td></tr> + +<tr><td colspan=2><br><h2>Typedefs</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a03533.html">CTileOfPatch</a>,<br> + <a class="el" href="a02156.html">NLMISC::CAABBox</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a21">TTileOfPatchMap</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">A set of tiles from patch and their bbox. <a href="#a21"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a28">draw2dLine</a> (<a class="el" href="a02268.html">CBitmap</a> &bitmap, float x0, float y0, float x1, float y1, const <a class="el" href="a03337.html">CRGBA</a> &color)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a22">easineasout</a> (float <a class="el" href="a04223.html#a572">x</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a31">easineasoutC2</a> (float <a class="el" href="a04223.html#a572">x</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a30">FilterZBuffer</a> (<a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> &zbuffer, <a class="el" href="a04558.html#a15">uint</a> filterRadius)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a32">getDir</a> (const std::string &path)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a34">getExt</a> (const std::string &path)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a33">getName</a> (const std::string &path)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a29">InitZBuffer</a> (<a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> &zbuffer, const CVector &SunPosition, const CMatrix &rayBasis, const <a class="el" href="a02157.html">CAABBoxExt</a> &zoneBB, <a class="el" href="a04558.html#a15">uint</a> zBufferPixelSize, const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> &description)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a25">NEL3DCalcBase</a> (CVector &direction, CMatrix &<a class="el" href="a04223.html#a578">matrix</a>)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a35">operator<</a> (const <a class="el" href="a03533.html">CTileOfPatch</a> &lhs, const <a class="el" href="a03533.html">CTileOfPatch</a> &rhs)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">for map insertion of <a class="el" href="a03533.html">CTileOfPatch</a> structs <a href="#a35"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a27">RenderTriangle</a> (const <a class="el" href="a03750.html">CZoneLighter::CTriangle</a> &triangle, const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> &description, <a class="el" href="a03101.html#NLMISC_1_1CPolygon2Dw1">CPolygon2D::TRasterVect</a> &borders, <a class="el" href="a02516.html">CFastMutex</a> &mutex, <a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> &zbuffer, <a class="el" href="a04558.html#a15">uint</a> radius)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a26">setCPUMask</a> (IThread *thread, <a class="el" href="a04558.html#a15">uint</a> process)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a24">testZPercentageCloserFilter</a> (float <a class="el" href="a04223.html#a572">x</a>, float <a class="el" href="a04223.html#a573">y</a>, float <a class="el" href="a04223.html#a574">z</a>, <a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> &zbuffer, const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> &description, bool &zBufferOverflowFlag)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a23">transformVectorToZBuffer</a> (const <a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> &zbuffer, const CVector &world, CVector &projected)</td></tr> + +<tr><td colspan=2><br><h2>Variables</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a20">deltaDirection</a> [8][2]</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a05345.html#a19">DeltaZ</a> [9][2]</td></tr> + +</table> +<hr><h2>Define Documentation</h2> +<a class="anchor" name="a16" doxytag="zone_lighter.cpp::AllBack" ></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"> #define AllBack 1 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l01446">1446</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. </td> + </tr> +</table> +<a class="anchor" name="a15" doxytag="zone_lighter.cpp::AllFront" ></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"> #define AllFront 0 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l01445">1445</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. </td> + </tr> +</table> +<a class="anchor" name="a18" doxytag="zone_lighter.cpp::BLUR_SIZE" ></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"> #define BLUR_SIZE 4 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Referenced by <a class="el" href="a06768.html#l02045">NL3D::CZoneLighter::buildZoneInformation()</a>. </td> + </tr> +</table> +<a class="anchor" name="a17" doxytag="zone_lighter.cpp::Clipped" ></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"> #define Clipped 2 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l01447">1447</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. </td> + </tr> +</table> +<a class="anchor" name="a14" doxytag="zone_lighter.cpp::CLIPPED_ALL" ></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"> #define CLIPPED_ALL (CLIPPED_TOP|CLIPPED_BOTTOM|CLIPPED_LEFT|CLIPPED_RIGHT) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00442">442</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<a class="anchor" name="a11" doxytag="zone_lighter.cpp::CLIPPED_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"> #define CLIPPED_BOTTOM 2 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00439">439</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<a class="anchor" name="a13" doxytag="zone_lighter.cpp::CLIPPED_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"> #define CLIPPED_LEFT 4 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00441">441</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<a class="anchor" name="a12" doxytag="zone_lighter.cpp::CLIPPED_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"> #define CLIPPED_RIGHT 3 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00440">440</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<a class="anchor" name="a10" doxytag="zone_lighter.cpp::CLIPPED_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"> #define CLIPPED_TOP 1 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00438">438</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<a class="anchor" name="a1" doxytag="zone_lighter.cpp::DEFAULT_JITTER" ></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"> #define DEFAULT_JITTER 0.4f + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00072">72</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a6" doxytag="zone_lighter.cpp::DEFAULT_SUN_CENTER" ></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"> #define DEFAULT_SUN_CENTER (CVector (0, 0, 0)) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00077">77</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a4" doxytag="zone_lighter.cpp::DEFAULT_SUN_DISTANCE" ></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"> #define DEFAULT_SUN_DISTANCE 50000 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00075">75</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a5" doxytag="zone_lighter.cpp::DEFAULT_SUN_FOV" ></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"> #define DEFAULT_SUN_FOV (<a class="el" href="a05378.html#a44">NLMISC::Pi</a>/6) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00076">76</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a7" doxytag="zone_lighter.cpp::DEFAULT_SUN_RADIUS" ></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"> #define DEFAULT_SUN_RADIUS 5000 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00078">78</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a8" doxytag="zone_lighter.cpp::DEFAULT_SUN_SRQT_SAMPLES" ></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"> #define DEFAULT_SUN_SRQT_SAMPLES 4 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00079">79</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a2" doxytag="zone_lighter.cpp::DEFAULT_ZBUFFER_LANDSCAPE_SIZE" ></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"> #define DEFAULT_ZBUFFER_LANDSCAPE_SIZE 32768 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00073">73</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a3" doxytag="zone_lighter.cpp::DEFAULT_ZBUFFER_OBJECT_SIZE" ></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"> #define DEFAULT_ZBUFFER_OBJECT_SIZE (32768*3) + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00074">74</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02752">NL3D::CZoneLighter::CLightDesc::CLightDesc()</a>. </td> + </tr> +</table> +<a class="anchor" name="a9" doxytag="zone_lighter.cpp::NL3D_ZONE_LIGHTER_CUBE_GRID_SIZE" ></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"> #define NL3D_ZONE_LIGHTER_CUBE_GRID_SIZE 16 + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00082">82</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l03202">NL3D::CZoneLighter::compilePointLightRT()</a>. </td> + </tr> +</table> +<a class="anchor" name="a0" doxytag="zone_lighter.cpp::USE_JPEG" ></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"> #define USE_JPEG + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00028">28</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. </td> + </tr> +</table> +<hr><h2>Typedef Documentation</h2> +<a class="anchor" name="a21" doxytag="zone_lighter.cpp::TTileOfPatchMap" ></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"> typedef std::map<<a class="el" href="a03533.html">CTileOfPatch</a>, <a class="el" href="a02156.html">NLMISC::CAABBox</a>> <a class="el" href="a05345.html#a21">TTileOfPatchMap</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +A set of tiles from patch and their bbox. +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l03560">3560</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l03563">NL3D::CZoneLighter::computeTileFlagsForPositionTowardWater()</a>. </td> + </tr> +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="a28" doxytag="zone_lighter.cpp::draw2dLine" ></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 draw2dLine </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02268.html">CBitmap</a> & </td> + <td class="mdname" nowrap> <em>bitmap</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>x0</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>y0</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>x1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>y1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03337.html">CRGBA</a> & </td> + <td class="mdname" nowrap> <em>color</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00712">712</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05425.html#l00142">NLMISC::drawFullLine()</a>, <a class="el" href="a05486.html#l01388">NLMISC::CBitmap::getHeight()</a>, <a class="el" href="a05487.html#l00308">NLMISC::CBitmap::getPixels()</a>, <a class="el" href="a05486.html#l01363">NLMISC::CBitmap::getWidth()</a>, <a class="el" href="a05646.html#l01013">height</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l01013">width</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +<div class="fragment"><pre>00713 { +00714 <span class="keyword">static</span> vector< std::pair<sint, sint> > lines; +00715 <a class="code" href="a05378.html#a249">drawFullLine</a> (x0, y0, x1, y1, lines); +00716 +00717 <span class="comment">// Bitmap pixels</span> +00718 <a class="code" href="a03337.html">CRGBA</a> *pixels = (<a class="code" href="a03337.html">CRGBA</a>*)&(bitmap.<a class="code" href="a02268.html#NL3D_1_1ITexturez1927_1">getPixels</a> ()[0]); +00719 +00720 <span class="comment">// Bitmap size</span> +00721 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a632">width</a> = (<a class="code" href="a04558.html#a14">sint</a>)bitmap.<a class="code" href="a02268.html#NL3D_1_1ITexturea20">getWidth</a> (); +00722 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a633">height</a> = (<a class="code" href="a04558.html#a14">sint</a>)bitmap.<a class="code" href="a02268.html#NL3D_1_1ITexturea12">getHeight</a> (); +00723 +00724 <span class="comment">// Draw the line</span> +00725 <a class="code" href="a04558.html#a15">uint</a> i; +00726 <span class="keywordflow">for</span> (i=0; i<lines.size (); i++) +00727 { +00728 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a> = lines[i].first; +00729 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a573">y</a> = lines[i].second; +00730 +00731 <span class="comment">// Clip</span> +00732 <span class="keywordflow">if</span> ( (<a class="code" href="a04223.html#a572">x</a> >= 0) && (x < width) && (y >= 0) && (<a class="code" href="a04223.html#a573">y</a> < <a class="code" href="a04223.html#a633">height</a>) ) +00733 { +00734 pixels[<a class="code" href="a04223.html#a572">x</a>+(<a class="code" href="a04223.html#a633">height</a>-<a class="code" href="a04223.html#a573">y</a>-1)*<a class="code" href="a04223.html#a632">width</a>] = color; +00735 } +00736 } +00737 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a22" doxytag="zone_lighter.cpp::easineasout" ></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 easineasout </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>x</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00158">158</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02045">NL3D::CZoneLighter::buildZoneInformation()</a>. +<p> +<div class="fragment"><pre>00159 { +00160 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a573">y</a>; +00161 <span class="comment">// cubic tq f(0)=0, f'(0)=0, f(1)=1, f'(1)=0.</span> +00162 <span class="keywordtype">float</span> x2=<a class="code" href="a04223.html#a572">x</a>*<a class="code" href="a04223.html#a572">x</a>; +00163 <span class="keywordtype">float</span> x3=x2*<a class="code" href="a04223.html#a572">x</a>; +00164 <a class="code" href="a04223.html#a573">y</a>= -2*x3 + 3*x2; +00165 <span class="keywordflow">return</span> <a class="code" href="a04223.html#a573">y</a>; +00166 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a31" doxytag="zone_lighter.cpp::easineasoutC2" ></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 easineasoutC2 </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>x</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l01487">1487</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +<div class="fragment"><pre>01488 { +01489 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a573">y</a>; +01490 <span class="comment">// 5-nome tq f(0)=0, f'(0)=0, f''(0)=0, f(1)=1, f'(1)=0, f''(1)=0.</span> +01491 <span class="keywordtype">float</span> x3=<a class="code" href="a04223.html#a572">x</a>*<a class="code" href="a04223.html#a572">x</a>*<a class="code" href="a04223.html#a572">x</a>; +01492 <span class="keywordtype">float</span> x4=x3*<a class="code" href="a04223.html#a572">x</a>; +01493 <span class="keywordtype">float</span> x5=x4*<a class="code" href="a04223.html#a572">x</a>; +01494 <a class="code" href="a04223.html#a573">y</a>= 6*x5 -15*x4 +10*x3; +01495 <span class="keywordflow">return</span> <a class="code" href="a04223.html#a573">y</a>; +01496 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a30" doxytag="zone_lighter.cpp::FilterZBuffer" ></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 FilterZBuffer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> & </td> + <td class="mdname" nowrap> <em>zbuffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>filterRadius</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00883">883</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06768.html#l00186">DeltaZ</a>, <a class="el" href="a06769.html#l00285">NL3D::CZoneLighter::CZBuffer::LocalZBufferHeight</a>, <a class="el" href="a06769.html#l00284">NL3D::CZoneLighter::CZBuffer::LocalZBufferWidth</a>, <a class="el" href="a06769.html#l00275">NL3D::CZoneLighter::CZBuffer::Pixels</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00920">NL3D::CZoneLighter::light()</a>. +<p> +<div class="fragment"><pre>00884 { +00885 <span class="comment">// Resize the temp buffer</span> +00886 <span class="keyword">static</span> std::vector<float> tempPixels; +00887 tempPixels = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>; +00888 +00889 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>; +00890 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a><zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>; <a class="code" href="a04223.html#a573">y</a>++) +00891 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a572">x</a>=0; <a class="code" href="a04223.html#a572">x</a><zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>; <a class="code" href="a04223.html#a572">x</a>++) +00892 { +00893 <span class="comment">// The Value</span> +00894 <span class="keyword">const</span> <span class="keywordtype">float</span> &oldValue = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>[<a class="code" href="a04223.html#a572">x</a>+<a class="code" href="a04223.html#a573">y</a>*zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>]; +00895 <span class="keywordtype">float</span> &newValue = tempPixels[<a class="code" href="a04223.html#a572">x</a>+<a class="code" href="a04223.html#a573">y</a>*zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>]; +00896 +00897 <a class="code" href="a04558.html#a15">uint</a> n; +00898 <span class="keywordflow">for</span> (n=1; n<filterRadius; n++) +00899 { +00900 <span class="keyword">const</span> <a class="code" href="a04558.html#a14">sint</a> fx = <a class="code" href="a04223.html#a572">x</a> + <a class="code" href="a05345.html#a19">DeltaZ</a>[n][0]; +00901 <span class="keyword">const</span> <a class="code" href="a04558.html#a14">sint</a> fy = <a class="code" href="a04223.html#a573">y</a> + <a class="code" href="a05345.html#a19">DeltaZ</a>[n][1]; +00902 +00903 <span class="comment">// Clip</span> +00904 <span class="keywordflow">if</span> ( (fx>=0) && (fx < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>) && (fy>=0) && (fy < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>) ) +00905 { +00906 <span class="keyword">const</span> <span class="keywordtype">float</span> &testValue = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>[fx+fy*zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>]; +00907 <span class="keywordflow">if</span> (testValue < newValue) +00908 newValue = testValue; +00909 } +00910 } +00911 +00912 } +00913 +00914 <span class="comment">// Copy the new zbuffer</span> +00915 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a> = tempPixels; +00916 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a32" doxytag="zone_lighter.cpp::getDir" ></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"> std::string getDir </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>path</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l02868">2868</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02910">getExt()</a>, and <a class="el" href="a06768.html#l02889">getName()</a>. +<p> +<div class="fragment"><pre>02869 { +02870 <span class="keywordtype">char</span> tmpPath[512]; +02871 strcpy (tmpPath, path.c_str()); +02872 <span class="keywordtype">char</span>* slash=strrchr (tmpPath, <span class="charliteral">'/'</span>); +02873 <span class="keywordflow">if</span> (!slash) +02874 { +02875 slash=strrchr (tmpPath, <span class="charliteral">'\\'</span>); +02876 } +02877 +02878 <span class="keywordflow">if</span> (!slash) +02879 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; +02880 +02881 slash++; +02882 *slash=0; +02883 <span class="keywordflow">return</span> tmpPath; +02884 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a34" doxytag="zone_lighter.cpp::getExt" ></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"> std::string getExt </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>path</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l02910">2910</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06768.html#l02868">getDir()</a>, <a class="el" href="a06768.html#l02889">getName()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a06768.html#l02927">NL3D::CZoneLighter::lightWater()</a>. +<p> +<div class="fragment"><pre>02911 { +02912 std::string dir = <a class="code" href="a05345.html#a32">getDir</a> (path); +02913 std::string name = <a class="code" href="a05345.html#a33">getName</a> (path); +02914 +02915 <span class="keywordtype">char</span> tmpPath[512]; +02916 strcpy (tmpPath, path.c_str()); +02917 +02918 <span class="keywordtype">char</span> *ext=tmpPath; +02919 <a class="code" href="a04199.html#a6">nlassert</a> (dir.length()+name.length()<=strlen(tmpPath)); +02920 ext+=dir.length()+name.length(); +02921 +02922 <span class="keywordflow">return</span> ext; +02923 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a33" doxytag="zone_lighter.cpp::getName" ></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"> std::string getName </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname1" valign="top" nowrap> <em>path</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l02889">2889</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06768.html#l02868">getDir()</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +Referenced by <a class="el" href="a06350.html#l00503">NL3D::CInstanceGroup::addToScene()</a>, <a class="el" href="a06350.html#l01065">NL3D::CInstanceGroup::getDynamicPortals()</a>, <a class="el" href="a06768.html#l02910">getExt()</a>, and <a class="el" href="a05993.html#l00076">NL3D::CMeshBaseInstance::registerToChannelMixer()</a>. +<p> +<div class="fragment"><pre>02890 { +02891 std::string dir=<a class="code" href="a05345.html#a32">getDir</a> (path); +02892 +02893 <span class="keywordtype">char</span> tmpPath[512]; +02894 strcpy (tmpPath, path.c_str()); +02895 +02896 <span class="keywordtype">char</span> *name=tmpPath; +02897 <a class="code" href="a04199.html#a6">nlassert</a> (dir.length()<=strlen(tmpPath)); +02898 name+=dir.length(); +02899 +02900 <span class="keywordtype">char</span>* point=strrchr (name, <span class="charliteral">'.'</span>); +02901 <span class="keywordflow">if</span> (point) +02902 *point=0; +02903 +02904 <span class="keywordflow">return</span> name; +02905 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a29" doxytag="zone_lighter.cpp::InitZBuffer" ></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 InitZBuffer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> & </td> + <td class="mdname" nowrap> <em>zbuffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const CVector & </td> + <td class="mdname" nowrap> <em>SunPosition</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const CMatrix & </td> + <td class="mdname" nowrap> <em>rayBasis</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02157.html">CAABBoxExt</a> & </td> + <td class="mdname" nowrap> <em>zoneBB</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>zBufferPixelSize</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>description</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00741">741</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06769.html#l00287">NL3D::CZoneLighter::CZBuffer::BoundingBoxVectors</a>, <a class="el" href="a05385.html#l00198">NLMISC::CAABBoxExt::getMax()</a>, <a class="el" href="a05385.html#l00197">NLMISC::CAABBoxExt::getMin()</a>, <a class="el" href="a05972.html#l00200">NLMISC::CMatrix::identity()</a>, <a class="el" href="a05732.html#l00039">NL3D::CFrustum::init()</a>, <a class="el" href="a05972.html#l00914">NLMISC::CMatrix::invert()</a>, <a class="el" href="a06769.html#l00285">NL3D::CZoneLighter::CZBuffer::LocalZBufferHeight</a>, <a class="el" href="a06769.html#l00284">NL3D::CZoneLighter::CZBuffer::LocalZBufferWidth</a>, <a class="el" href="a06769.html#l00279">NL3D::CZoneLighter::CZBuffer::LocalZBufferXMax</a>, <a class="el" href="a06769.html#l00278">NL3D::CZoneLighter::CZBuffer::LocalZBufferXMin</a>, <a class="el" href="a06769.html#l00281">NL3D::CZoneLighter::CZBuffer::LocalZBufferYMax</a>, <a class="el" href="a06769.html#l00280">NL3D::CZoneLighter::CZBuffer::LocalZBufferYMin</a>, <a class="el" href="a06769.html#l00283">NL3D::CZoneLighter::CZBuffer::LocalZBufferZMax</a>, <a class="el" href="a06769.html#l00282">NL3D::CZoneLighter::CZBuffer::LocalZBufferZMin</a>, <a class="el" href="a06769.html#l00275">NL3D::CZoneLighter::CZBuffer::Pixels</a>, <a class="el" href="a05972.html#l00267">NLMISC::CMatrix::setPos()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06769.html#l00102">NL3D::CZoneLighter::CLightDesc::SunDistance</a>, <a class="el" href="a06769.html#l00105">NL3D::CZoneLighter::CLightDesc::SunFOV</a>, <a class="el" href="a06768.html#l00170">transformVectorToZBuffer()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06769.html#l00277">NL3D::CZoneLighter::CZBuffer::WorldToZBuffer</a>, <a class="el" href="a06769.html#l00276">NL3D::CZoneLighter::CZBuffer::WorldToZBufferFrustum</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>, and <a class="el" href="a06769.html#l00286">NL3D::CZoneLighter::CZBuffer::ZBufferPixelSize</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00920">NL3D::CZoneLighter::light()</a>. +<p> +<div class="fragment"><pre>00742 { +00743 <span class="comment">// Clac the zbuffer world size</span> +00744 <span class="keyword">const</span> <span class="keywordtype">float</span> zBufferWorldSize = (<span class="keywordtype">float</span>)(tan (description.<a class="code" href="a03741.html#NL3D_1_1CZoneLighter_1_1CLightDescz1204_3">SunFOV</a>/2)*description.<a class="code" href="a03741.html#NL3D_1_1CZoneLighter_1_1CLightDescz1204_2">SunDistance</a>*2); +00745 +00746 <span class="comment">// ** Compute the zbuffer basis</span> +00747 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero10">WorldToZBuffer</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_0">identity</a> (); +00748 +00749 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero10">WorldToZBuffer</a> = rayBasis; +00750 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero10">WorldToZBuffer</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_4">setPos</a> (SunPosition); +00751 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero10">WorldToZBuffer</a>.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_0">invert</a> (); +00752 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero11">WorldToZBufferFrustum</a>.<a class="code" href="a02562.html#NL3D_1_1CFrustuma4">init</a> ((<span class="keywordtype">float</span>)zBufferWorldSize, (<span class="keywordtype">float</span>)zBufferWorldSize, description.<a class="code" href="a03741.html#NL3D_1_1CZoneLighter_1_1CLightDescz1204_2">SunDistance</a>, description.<a class="code" href="a03741.html#NL3D_1_1CZoneLighter_1_1CLightDescz1204_2">SunDistance</a>*2); +00753 +00754 <span class="comment">// Zbuffer size</span> +00755 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero12">ZBufferPixelSize</a> = zBufferPixelSize; +00756 +00757 <span class="comment">// Evaluate the size of the local zbuffer</span> +00758 +00759 <span class="comment">// The zone bounding box </span> +00760 CVector bMin = zoneBB.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1912_4">getMin</a> (); +00761 CVector bMax = zoneBB.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1912_3">getMax</a> (); +00762 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMin.x, bMax.y, bMin.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[0]); +00763 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMin.x, bMin.y, bMin.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[1]); +00764 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMax.x, bMin.y, bMin.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[2]); +00765 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMax.x, bMax.y, bMin.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[3]); +00766 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMin.x, bMax.y, bMax.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[4]); +00767 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMin.x, bMin.y, bMax.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[5]); +00768 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMax.x, bMin.y, bMax.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[6]); +00769 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, CVector (bMax.x, bMax.y, bMax.z), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[7]); +00770 +00771 <span class="comment">// Get the min and max</span> +00772 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a> = 0x7fffffff; +00773 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a> = 0x7fffffff; +00774 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a> = 0x80000000; +00775 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a> = 0x80000000; +00776 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero8">LocalZBufferZMin</a> = FLT_MAX; +00777 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero7">LocalZBufferZMax</a> = -FLT_MAX; +00778 <a class="code" href="a04558.html#a15">uint</a> j; +00779 <span class="keywordflow">for</span> (j=0; j<8; j++) +00780 { +00781 <a class="code" href="a04558.html#a14">sint</a> minX = (<a class="code" href="a04558.html#a14">sint</a>)floor (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro0">x</a>); +00782 <a class="code" href="a04558.html#a14">sint</a> maxX = (<a class="code" href="a04558.html#a14">sint</a>)ceil (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro0">x</a>); +00783 <a class="code" href="a04558.html#a14">sint</a> minY = (<a class="code" href="a04558.html#a14">sint</a>)floor (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro1">y</a>); +00784 <a class="code" href="a04558.html#a14">sint</a> maxY = (<a class="code" href="a04558.html#a14">sint</a>)ceil (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro1">y</a>); +00785 <span class="keywordflow">if</span> (minX<zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a>) +00786 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a> = minX; +00787 <span class="keywordflow">if</span> (maxX>zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a>) +00788 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a> = maxX; +00789 <span class="keywordflow">if</span> (minY<zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a>) +00790 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a> = minY; +00791 <span class="keywordflow">if</span> (maxY>zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a>) +00792 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a> = maxY; +00793 <span class="keywordflow">if</span> ((-zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a>)<zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero8">LocalZBufferZMin</a>) +00794 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero8">LocalZBufferZMin</a> = -zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a>; +00795 <span class="keywordflow">if</span> ((-zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a>)>zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero7">LocalZBufferZMax</a>) +00796 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero7">LocalZBufferZMax</a> = -zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero0">BoundingBoxVectors</a>[j].<a class="code" href="a03128.html#NLMISC_1_1CVectoro2">z</a>; +00797 } +00798 +00799 <span class="comment">// Expand the zbuffer</span> +00800 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a>++; +00801 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a>--; +00802 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a>++; +00803 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a>--; +00804 +00805 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a> = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a>-zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a>; +00806 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a> = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a>-zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a>; +00807 +00808 <span class="comment">// Resize and clear the zbuffer</span> +00809 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>.resize (0); +00810 zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>.resize (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>*zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>, FLT_MAX); +00811 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a25" doxytag="zone_lighter.cpp::NEL3DCalcBase" ></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 NEL3DCalcBase </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">CVector & </td> + <td class="mdname" nowrap> <em>direction</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>CMatrix & </td> + <td class="mdname" nowrap> <em>matrix</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00323">323</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05646.html#l00243">matrix</a>. +<p> +<div class="fragment"><pre>00324 { +00325 direction.normalize(); +00326 CVector K=-direction; +00327 CVector I=CVector::K^K; +00328 CVector J=K^I; +00329 J.normalize(); +00330 I=J^K; +00331 I.normalize(); +00332 <a class="code" href="a04223.html#a578">matrix</a>.identity(); +00333 <a class="code" href="a04223.html#a578">matrix</a>.setRot(I,J,K, <span class="keyword">true</span>); +00334 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a35" doxytag="zone_lighter.cpp::operator<" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool operator< </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03533.html">CTileOfPatch</a> & </td> + <td class="mdname" nowrap> <em>lhs</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03533.html">CTileOfPatch</a> & </td> + <td class="mdname" nowrap> <em>rhs</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, static]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +for map insertion of <a class="el" href="a03533.html">CTileOfPatch</a> structs +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l03552">3552</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06768.html#l03115">CTileOfPatch::Patch</a>, and <a class="el" href="a06768.html#l03114">CTileOfPatch::TileId</a>. +<p> +<div class="fragment"><pre>03553 { +03554 <span class="keywordflow">return</span> lhs.<a class="code" href="a03533.html#CTileOfPatcho0">Patch</a> == rhs.<a class="code" href="a03533.html#CTileOfPatcho0">Patch</a> ? +03555 lhs.<a class="code" href="a03533.html#CTileOfPatcho1">TileId</a> < rhs.<a class="code" href="a03533.html#CTileOfPatcho1">TileId</a> : +03556 lhs.<a class="code" href="a03533.html#CTileOfPatcho0">Patch</a> < rhs.<a class="code" href="a03533.html#CTileOfPatcho0">Patch</a>; +03557 }; +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a27" doxytag="zone_lighter.cpp::RenderTriangle" ></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 RenderTriangle </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03750.html">CZoneLighter::CTriangle</a> & </td> + <td class="mdname" nowrap> <em>triangle</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>description</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03101.html#NLMISC_1_1CPolygon2Dw1">CPolygon2D::TRasterVect</a> & </td> + <td class="mdname" nowrap> <em>borders</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02516.html">CFastMutex</a> & </td> + <td class="mdname" nowrap> <em>mutex</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> & </td> + <td class="mdname" nowrap> <em>zbuffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>radius</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00444">444</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01173">alpha</a>, <a class="el" href="a06769.html#l00229">NL3D::CZoneLighter::CTriangle::AlphaTestThreshold</a>, <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, <a class="el" href="a06768.html#l00442">CLIPPED_ALL</a>, <a class="el" href="a06768.html#l00439">CLIPPED_BOTTOM</a>, <a class="el" href="a06768.html#l00441">CLIPPED_LEFT</a>, <a class="el" href="a06768.html#l00440">CLIPPED_RIGHT</a>, <a class="el" href="a06768.html#l00438">CLIPPED_TOP</a>, <a class="el" href="a06190.html#l01075">NLMISC::CPolygon2D::computeBorders()</a>, <a class="el" href="a06584.html#l00067">NLMISC::CTriangle::computeGradient()</a>, <a class="el" href="a06768.html#l00186">DeltaZ</a>, <a class="el" href="a06088.html#l00238">NLMISC::CFastMutex::enter()</a>, <a class="el" href="a06769.html#l00228">NL3D::CZoneLighter::CTriangle::Flags</a>, <a class="el" href="a05486.html#l01388">NLMISC::CBitmap::getHeight()</a>, <a class="el" href="a05487.html#l00308">NLMISC::CBitmap::getPixels()</a>, <a class="el" href="a05486.html#l01363">NLMISC::CBitmap::getWidth()</a>, <a class="el" href="a05646.html#l01013">height</a>, <a class="el" href="a05646.html#l01122">in</a>, <a class="el" href="a06088.html#l00273">NLMISC::CFastMutex::leave()</a>, <a class="el" href="a06769.html#l00285">NL3D::CZoneLighter::CZBuffer::LocalZBufferHeight</a>, <a class="el" href="a06769.html#l00284">NL3D::CZoneLighter::CZBuffer::LocalZBufferWidth</a>, <a class="el" href="a06769.html#l00279">NL3D::CZoneLighter::CZBuffer::LocalZBufferXMax</a>, <a class="el" href="a06769.html#l00278">NL3D::CZoneLighter::CZBuffer::LocalZBufferXMin</a>, <a class="el" href="a06769.html#l00281">NL3D::CZoneLighter::CZBuffer::LocalZBufferYMax</a>, <a class="el" href="a06769.html#l00280">NL3D::CZoneLighter::CZBuffer::LocalZBufferYMin</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a06769.html#l00275">NL3D::CZoneLighter::CZBuffer::Pixels</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06769.html#l00236">NL3D::CZoneLighter::CTriangle::Texture</a>, <a class="el" href="a06768.html#l00170">transformVectorToZBuffer()</a>, <a class="el" href="a06191.html#l00159">NLMISC::CPolygon2D::TRaster</a>, <a class="el" href="a06191.html#l00160">NLMISC::CPolygon2D::TRasterVect</a>, <a class="el" href="a06769.html#l00225">NL3D::CZoneLighter::CTriangle::Triangle</a>, <a class="el" href="a06769.html#l00232">NL3D::CZoneLighter::CTriangle::U</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a06769.html#l00233">NL3D::CZoneLighter::CTriangle::V</a>, <a class="el" href="a06585.html#l00051">NLMISC::CTriangle::V0</a>, <a class="el" href="a06191.html#l00126">NLMISC::CPolygon2D::Vertices</a>, <a class="el" href="a05646.html#l01013">width</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a05646.html#l00236">z</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00633">NL3D::CRenderZBuffer::run()</a>. +<p> +<div class="fragment"><pre>00446 { +00447 <span class="comment">// *** Transform it in the zbuffer basis</span> +00448 +00449 <span class="comment">// 2d polygon used for rasteriation</span> +00450 <a class="code" href="a03101.html">CPolygon2D</a> zBasis; +00451 zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Do0">Vertices</a>.resize (3); +00452 +00453 <span class="comment">// 3d polygon used for the gradient</span> +00454 <a class="code" href="a03616.html">NLMISC::CTriangle</a> gradientTriangle; +00455 +00456 <span class="comment">// One over z value</span> +00457 <span class="keywordtype">float</span> ooz[3]; +00458 +00459 <span class="comment">// Clipping</span> +00460 <a class="code" href="a04558.html#a7">uint8</a> <a class="code" href="a04223.html#a647">in</a> = 0; +00461 +00462 <span class="comment">// For each vertex</span> +00463 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> j=0; j<3; j++) +00464 { +00465 <span class="comment">// Pointer on the vector</span> +00466 <span class="keyword">const</span> CVector *pt = (&triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo3">Triangle</a>.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVo3">V0</a>)+j; +00467 CVector *ptDest = (&gradientTriangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVo3">V0</a>)+j; +00468 +00469 <span class="comment">// Transform it in the zbuffer basis</span> +00470 <a class="code" href="a05345.html#a23">transformVectorToZBuffer</a> (zbuffer, *pt, *ptDest); +00471 +00472 <span class="comment">// Clip</span> +00473 <span class="keywordflow">if</span> (ptDest->x >= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a>) +00474 <a class="code" href="a04223.html#a647">in</a> |= <a class="code" href="a05345.html#a13">CLIPPED_LEFT</a>; +00475 <span class="keywordflow">if</span> (ptDest->x <= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero3">LocalZBufferXMax</a>) +00476 <a class="code" href="a04223.html#a647">in</a> |= <a class="code" href="a05345.html#a12">CLIPPED_RIGHT</a>; +00477 <span class="keywordflow">if</span> (ptDest->y >= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a>) +00478 <a class="code" href="a04223.html#a647">in</a> |= <a class="code" href="a05345.html#a10">CLIPPED_TOP</a>; +00479 <span class="keywordflow">if</span> (ptDest->y <= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero5">LocalZBufferYMax</a>) +00480 <a class="code" href="a04223.html#a647">in</a> |= <a class="code" href="a05345.html#a11">CLIPPED_BOTTOM</a>; +00481 +00482 <span class="comment">// Set the 2d points</span> +00483 zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Do0">Vertices</a>[j].x = ptDest->x - (<span class="keywordtype">float</span>)zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero4">LocalZBufferXMin</a>; +00484 zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Do0">Vertices</a>[j].y = ptDest->y - (<span class="keywordtype">float</span>)zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero6">LocalZBufferYMin</a>; +00485 ooz[j] = 1.f / ptDest->z; +00486 +00487 <span class="comment">// No z</span> +00488 ptDest->z = 0; +00489 } +00490 +00491 <span class="comment">// Not clipped ?</span> +00492 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a647">in</a> == <a class="code" href="a05345.html#a14">CLIPPED_ALL</a>) +00493 { +00494 <span class="comment">// Rasterise</span> +00495 <a class="code" href="a04558.html#a14">sint</a> minimumY; +00496 borders.clear (); +00497 zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Da1">computeBorders</a> (borders, minimumY); +00498 +00499 <span class="comment">// Compute the gradient for one over z </span> +00500 CVector ozzGradient; +00501 gradientTriangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa0">computeGradient</a> (ooz[0], ooz[1], ooz[2], ozzGradient); +00502 +00503 <span class="comment">// Need uv ?</span> +00504 <span class="keywordtype">bool</span> needUV = triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo2">Texture</a> != NULL; +00505 +00506 <span class="comment">// Compute the gradient for uv</span> +00507 CVector uGradient; +00508 CVector vGradient; +00509 <span class="keywordflow">if</span> (needUV) +00510 { +00511 gradientTriangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa0">computeGradient</a> (triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo4">U</a>[0], triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo4">U</a>[1], triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo4">U</a>[2], uGradient); +00512 gradientTriangle.<a class="code" href="a03616.html#NLMISC_1_1CTriangleUVa0">computeGradient</a> (triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo5">V</a>[0], triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo5">V</a>[1], triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo5">V</a>[2], vGradient); +00513 } +00514 +00515 <span class="comment">// Texture informations</span> +00516 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a632">width</a>; +00517 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a633">height</a>; +00518 <span class="keyword">const</span> <a class="code" href="a03000.html">CObjectVector<uint8></a> *pixels; +00519 <span class="keywordflow">if</span> (needUV) +00520 { +00521 <span class="comment">// Get pixels</span> +00522 pixels = &triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo2">Texture</a>-><a class="code" href="a02268.html#NL3D_1_1ITexturez1927_1">getPixels</a> (); +00523 +00524 <span class="comment">// Get width and height</span> +00525 <a class="code" href="a04223.html#a632">width</a> = triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo2">Texture</a>-><a class="code" href="a02268.html#NL3D_1_1ITexturea20">getWidth</a> (); +00526 <a class="code" href="a04223.html#a633">height</a> = triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo2">Texture</a>-><a class="code" href="a02268.html#NL3D_1_1ITexturea12">getHeight</a> (); +00527 } +00528 +00529 <span class="comment">// For each scanlines</span> +00530 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a573">y</a> = std::max (minimumY, 0); +00531 <a class="code" href="a04558.html#a14">sint</a> yMax = <a class="code" href="a04061.html#a0">std::min</a> ((<a class="code" href="a04558.html#a14">sint</a>)(minimumY+borders.size ()), zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>); +00532 <span class="keywordflow">for</span> (; <a class="code" href="a04223.html#a573">y</a><yMax; <a class="code" href="a04223.html#a573">y</a>++) +00533 { +00534 <span class="comment">// Ref on the raster</span> +00535 <span class="keyword">const</span> <a class="code" href="a03101.html#NLMISC_1_1CPolygon2Dw0">CPolygon2D::TRaster</a> &raster = borders[<a class="code" href="a04223.html#a573">y</a>-minimumY]; +00536 +00537 <span class="comment">// Gradient y for ooz, u and v</span> +00538 <span class="keyword">const</span> <span class="keywordtype">float</span> deltaY = (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a573">y</a> - zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Do0">Vertices</a>[0].y; +00539 <span class="keyword">const</span> <span class="keywordtype">float</span> oozGradientY = deltaY * ozzGradient.y; +00540 <span class="keywordtype">float</span> uGradientY; +00541 <span class="keywordtype">float</span> vGradientY; +00542 <span class="keywordflow">if</span> (needUV) +00543 { +00544 uGradientY = deltaY * uGradient.y; +00545 vGradientY = deltaY * vGradient.y; +00546 } +00547 +00548 <span class="comment">// Clip it</span> +00549 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a> = std::max (raster.first, 0); +00550 <a class="code" href="a04558.html#a14">sint</a> xMax = <a class="code" href="a04061.html#a0">std::min</a> (raster.second+1, zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>); +00551 <span class="keywordflow">for</span> (; <a class="code" href="a04223.html#a572">x</a><xMax; <a class="code" href="a04223.html#a572">x</a>++) +00552 { +00553 <span class="comment">// Gradient x for ooz, u and v</span> +00554 <span class="keyword">const</span> <span class="keywordtype">float</span> deltaX = (<span class="keywordtype">float</span>)<a class="code" href="a04223.html#a572">x</a> - zBasis.<a class="code" href="a03101.html#NLMISC_1_1CPolygon2Do0">Vertices</a>[0].x; +00555 <span class="keyword">const</span> <span class="keywordtype">float</span> oozGradientX = deltaX * ozzGradient.x; +00556 <span class="keywordtype">float</span> uGradientX; +00557 <span class="keywordtype">float</span> vGradientX; +00558 <span class="keywordflow">if</span> (needUV) +00559 { +00560 uGradientX = deltaX * uGradient.x; +00561 vGradientX = deltaX * vGradient.x; +00562 } +00563 +00564 <span class="comment">// Calc z</span> +00565 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a574">z</a> = - 1.f / (ooz[0] + oozGradientX + oozGradientY); +00566 +00567 <span class="comment">// Calc u & v</span> +00568 <span class="keywordtype">float</span> u; +00569 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a576">v</a>; +00570 <span class="keywordtype">bool</span> alphaTest = <span class="keyword">true</span>; +00571 <span class="keywordflow">if</span> (needUV) +00572 { +00573 <span class="comment">// Compute uv</span> +00574 u = triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo4">U</a>[0] + uGradientX + uGradientY; +00575 <a class="code" href="a04223.html#a576">v</a> = triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo5">V</a>[0] + vGradientX + vGradientY; +00576 +00577 <span class="comment">// Clamp or wrap ?</span> +00578 <span class="keywordflow">if</span> (triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo1">Flags</a> & CZoneLighter::CTriangle::ClampU) +00579 <a class="code" href="a05378.html#a374">clamp</a> (u, 0.f, 1.f); +00580 <span class="keywordflow">else</span> +00581 u -= (<span class="keywordtype">float</span>)floor (u); +00582 <span class="keywordflow">if</span> (triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo1">Flags</a> & CZoneLighter::CTriangle::ClampV) +00583 <a class="code" href="a05378.html#a374">clamp</a> (v, 0.f, 1.f); +00584 <span class="keywordflow">else</span> +00585 <a class="code" href="a04223.html#a576">v</a> -= (<span class="keywordtype">float</span>)floor (v); +00586 +00587 <span class="comment">// Lookup in the texture</span> +00588 u *= <a class="code" href="a04223.html#a632">width</a>; +00589 <a class="code" href="a04223.html#a576">v</a> *= <a class="code" href="a04223.html#a633">height</a>; +00590 <a class="code" href="a05378.html#a374">clamp</a> (u, 0, width-1); +00591 <a class="code" href="a05378.html#a374">clamp</a> (v, 0, height-1); +00592 <a class="code" href="a04558.html#a7">uint8</a> <a class="code" href="a04223.html#a663">alpha</a> = ((<span class="keyword">const</span> <a class="code" href="a03337.html">CRGBA</a>*)&((*pixels)[(((<a class="code" href="a04558.html#a15">uint</a>)u)+((<a class="code" href="a04558.html#a15">uint</a>)<a class="code" href="a04223.html#a576">v</a>)*<a class="code" href="a04223.html#a632">width</a>)*<span class="keyword">sizeof</span> (<a class="code" href="a03337.html">CRGBA</a>)]))->A; +00593 +00594 <span class="comment">// Alpha test</span> +00595 alphaTest = <a class="code" href="a04223.html#a663">alpha</a> >= triangle.<a class="code" href="a03750.html#NL3D_1_1CZoneLighter_1_1CTriangleo0">AlphaTestThreshold</a>; +00596 } +00597 +00598 <span class="comment">// Good alpha test ?</span> +00599 <span class="keywordflow">if</span> (alphaTest) +00600 { +00601 <span class="comment">// Enter the mutex</span> +00602 mutex.<a class="code" href="a02516.html#NLMISC_1_1CFastMutexa1">enter</a> (); +00603 +00604 <span class="comment">// Write Z around</span> +00605 <a class="code" href="a04558.html#a15">uint</a> d; +00606 <span class="keywordflow">for</span> (d=0; d<radius; d++) +00607 { +00608 <span class="comment">// Ref in the zbuffer</span> +00609 <a class="code" href="a04558.html#a14">sint</a> fx = <a class="code" href="a04223.html#a572">x</a> + <a class="code" href="a05345.html#a19">DeltaZ</a>[d][0]; +00610 <a class="code" href="a04558.html#a14">sint</a> fy = <a class="code" href="a04223.html#a573">y</a> + <a class="code" href="a05345.html#a19">DeltaZ</a>[d][1]; +00611 <span class="keywordflow">if</span> ( (fx >= 0) && (fx < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>) && (fy >= 0) && (fy < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>) ) +00612 { +00613 <span class="keywordtype">float</span> &zValue = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>[fx+(zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>-fy-1)*zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>]; +00614 +00615 <span class="comment">// Z test</span> +00616 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a574">z</a> < zValue) +00617 { +00618 <span class="comment">// Render z in zbuffer</span> +00619 zValue = <a class="code" href="a04223.html#a574">z</a>; +00620 } +00621 } +00622 } +00623 +00624 <span class="comment">// Leave the mutex</span> +00625 mutex.<a class="code" href="a02516.html#NLMISC_1_1CFastMutexa3">leave</a> (); +00626 } +00627 } +00628 } +00629 } +00630 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a26" doxytag="zone_lighter.cpp::setCPUMask" ></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 setCPUMask </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">IThread * </td> + <td class="mdname" nowrap> <em>thread</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>process</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00338">338</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05646.html#l00240">count</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00633">NL3D::CRenderZBuffer::run()</a>, and <a class="el" href="a06768.html#l00390">NL3D::CLightRunnable::run()</a>. +<p> +<div class="fragment"><pre>00339 { +00340 <span class="comment">// Set the processor mask</span> +00341 <a class="code" href="a04558.html#a13">uint64</a> mask = IProcess::getCurrentProcess()->getCPUMask (); +00342 +00343 <span class="comment">// Mask must not be NULL</span> +00344 <a class="code" href="a04199.html#a6">nlassert</a> (mask != 0); +00345 +00346 <span class="keywordflow">if</span> (mask != 0) +00347 { +00348 <a class="code" href="a04558.html#a15">uint</a> i=0; +00349 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a577">count</a> = 0; +00350 <span class="keywordflow">while</span> (1) +00351 { +00352 <span class="keywordflow">if</span> (mask & (1<<i)) +00353 { +00354 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a577">count</a> == process) +00355 <span class="keywordflow">break</span>; +00356 <a class="code" href="a04223.html#a577">count</a>++; +00357 } +00358 i++; +00359 <span class="keywordflow">if</span> (i==64) +00360 i = 0; +00361 } +00362 +00363 <span class="comment">// Set the CPU mask</span> +00364 thread->setCPUMask (1<<i); +00365 } +00366 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a24" doxytag="zone_lighter.cpp::testZPercentageCloserFilter" ></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 testZPercentageCloserFilter </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname" nowrap> <em>x</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>y</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>z</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> & </td> + <td class="mdname" nowrap> <em>zbuffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03741.html">CZoneLighter::CLightDesc</a> & </td> + <td class="mdname" nowrap> <em>description</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool & </td> + <td class="mdname" nowrap> <em>zBufferOverflowFlag</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00201">201</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a06769.html#l00285">NL3D::CZoneLighter::CZBuffer::LocalZBufferHeight</a>, <a class="el" href="a06769.html#l00284">NL3D::CZoneLighter::CZBuffer::LocalZBufferWidth</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06769.html#l00275">NL3D::CZoneLighter::CZBuffer::Pixels</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a05646.html#l00236">z</a>. +<p> +Referenced by <a class="el" href="a06768.html#l03767">NL3D::CZoneLighter::attenuation()</a>. +<p> +<div class="fragment"><pre>00202 { +00203 <span class="comment">// See "Rendering Antialiased Shadows With Depth Maps" Reeves, Salesint, Cook, ACM 1987</span> +00204 +00205 <span class="comment">// Bilinear filtering</span> +00206 +00207 <span class="keywordtype">float</span> biliValues[2][2]; +00208 +00209 <span class="keywordtype">float</span> ix = (<span class="keywordtype">float</span>)floor (x-0.5f); +00210 <span class="keywordtype">float</span> factorX = <a class="code" href="a04223.html#a572">x</a> - (ix+0.5f); +00211 <a class="code" href="a04199.html#a6">nlassert</a> (factorX>=0); +00212 <a class="code" href="a04199.html#a6">nlassert</a> (factorX<=1); +00213 +00214 <span class="keywordtype">float</span> iy = (<span class="keywordtype">float</span>)floor (y-0.5f); +00215 <span class="keywordtype">float</span> factorY = <a class="code" href="a04223.html#a573">y</a> - (iy+0.5f); +00216 <a class="code" href="a04199.html#a6">nlassert</a> (factorY>=0); +00217 <a class="code" href="a04199.html#a6">nlassert</a> (factorY<=1); +00218 +00219 <a class="code" href="a04558.html#a14">sint</a> dx, dy; +00220 <span class="keywordflow">for</span> (dy=0; dy<2; dy++) +00221 <span class="keywordflow">for</span> (dx=0; dx<2; dx++) +00222 { +00223 <span class="keyword">const</span> <a class="code" href="a04558.html#a14">sint</a> fx = dx + (<a class="code" href="a04558.html#a14">sint</a>)ix; +00224 <span class="keyword">const</span> <a class="code" href="a04558.html#a14">sint</a> fy = dy + (<a class="code" href="a04558.html#a14">sint</a>)iy; +00225 <span class="keywordflow">if</span> ((fx >= 0) && (fx < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>) && (fy >= 0) && (fy < zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a>)) +00226 { +00227 <span class="keyword">const</span> <span class="keywordtype">float</span> zRed = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero9">Pixels</a>[fx + (zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero1">LocalZBufferHeight</a> - 1 - fy) * zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero2">LocalZBufferWidth</a>]; +00228 +00229 biliValues[dx][dy] = (zRed < (-<a class="code" href="a04223.html#a574">z</a>)) ? 0.f : 1.f; +00230 } +00231 <span class="keywordflow">else</span> +00232 { +00233 biliValues[dx][dy] = 1; +00234 zBufferOverflowFlag = <span class="keyword">true</span>; +00235 } +00236 } +00237 +00238 <span class="comment">// Bilinear</span> +00239 <span class="keywordflow">return</span> (biliValues[0][0] * (1 - factorX) + biliValues[1][0] * factorX) * (1 - factorY) + +00240 (biliValues[0][1] * (1 - factorX) + biliValues[1][1] * factorX) * factorY; +00241 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="a23" doxytag="zone_lighter.cpp::transformVectorToZBuffer" ></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 transformVectorToZBuffer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03751.html">CZoneLighter::CZBuffer</a> & </td> + <td class="mdname" nowrap> <em>zbuffer</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const CVector & </td> + <td class="mdname" nowrap> <em>world</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>CVector & </td> + <td class="mdname" nowrap> <em>projected</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06768.html#l00170">170</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +References <a class="el" href="a05732.html#l00077">NL3D::CFrustum::project()</a>, <a class="el" href="a06769.html#l00277">NL3D::CZoneLighter::CZBuffer::WorldToZBuffer</a>, <a class="el" href="a06769.html#l00276">NL3D::CZoneLighter::CZBuffer::WorldToZBufferFrustum</a>, and <a class="el" href="a06769.html#l00286">NL3D::CZoneLighter::CZBuffer::ZBufferPixelSize</a>. +<p> +Referenced by <a class="el" href="a06768.html#l03767">NL3D::CZoneLighter::attenuation()</a>, <a class="el" href="a06768.html#l00741">InitZBuffer()</a>, and <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. +<p> +<div class="fragment"><pre>00171 { +00172 projected = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero10">WorldToZBuffer</a> * world; +00173 <span class="keywordtype">float</span> temp = projected.z; +00174 projected.z = projected.y; +00175 projected.y = -temp; +00176 projected = zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero11">WorldToZBufferFrustum</a>.<a class="code" href="a02562.html#NL3D_1_1CFrustuma6">project</a> (projected); +00177 +00178 <span class="comment">// Scale to zbuffer size</span> +00179 projected.x *= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero12">ZBufferPixelSize</a>; +00180 projected.y *= zbuffer.<a class="code" href="a03751.html#NL3D_1_1CZoneLighter_1_1CZBuffero12">ZBufferPixelSize</a>; +00181 projected.z = temp; +00182 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Variable Documentation</h2> +<a class="anchor" name="a20" doxytag="zone_lighter.cpp::deltaDirection" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a05345.html#a20">deltaDirection</a>[8][2]<code> [static]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<b>Initial value:</b><div class="fragment"><pre> +{ + {1, 0}, + {1, 1}, + {0, 1}, + {-1, 1}, + {-1, 0}, + {-1, -1}, + {0, -1}, + {1, -1}, +} +</pre></div> +<p> +Definition at line <a class="el" href="a06768.html#l00282">282</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00296">NL3D::CZoneLighter::calcSkyContribution()</a>. </td> + </tr> +</table> +<a class="anchor" name="a19" doxytag="zone_lighter.cpp::DeltaZ" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a04558.html#a14">sint</a> <a class="el" href="a05345.html#a19">DeltaZ</a>[9][2]<code> [static]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<b>Initial value:</b><div class="fragment"><pre> +{ + {0, 0}, + {-1, 0}, + {1, 0}, + {0, -1}, + {0, 1}, + {-1, -1}, + {1, 1}, + {1, -1}, + {-1, 1}, +} +</pre></div> +<p> +Definition at line <a class="el" href="a06768.html#l00186">186</a> of file <a class="el" href="a06768.html">zone_lighter.cpp</a>. +<p> +Referenced by <a class="el" href="a06768.html#l00883">FilterZBuffer()</a>, and <a class="el" href="a06768.html#l00444">RenderTriangle()</a>. </td> + </tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:43:39 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> |