1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: NL3D::CLightInfluenceInterpolator class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CLightInfluenceInterpolator Class Reference</h1><code>#include <<a class="el" href="a05896.html">light_influence_interpolator.h</a>></code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class is used by <a class="el" href="a02702.html">CLandscape</a> and IG/Pacs to compute interpolated influence of lights (biLinear-like) on a square. It works only with <a class="el" href="a03094.html">CPointLightNamed</a>. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>
<p>
<p>
Definition at line <a class="el" href="a05896.html#l00048">48</a> of file <a class="el" href="a05896.html">light_influence_interpolator.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom>{ <a class="el" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatorw0NL3D_1_1CLightInfluenceInterpolatorw1">NumLightPerCorner</a> = 2
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">We support only 2 light per corner. <a href="#NL3D_1_1CLightInfluenceInterpolatorw0">More...</a><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatora0">CLightInfluenceInterpolator</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. No-op !! <a href="#NL3D_1_1CLightInfluenceInterpolatora0"></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="a02745.html#NL3D_1_1CLightInfluenceInterpolatora1">interpolate</a> (std::vector< <a class="el" href="a03092.html">CPointLightInfluence</a> > &pointLightList, float subX, float subY)</td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02746.html">CCorner</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a> [4]</td></tr>
</table>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightInfluenceInterpolatorw0" doxytag="NL3D::CLightInfluenceInterpolator::@16" ></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"> anonymous enum
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
We support only 2 light per corner.
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CLightInfluenceInterpolatorw0NL3D_1_1CLightInfluenceInterpolatorw1" doxytag="NumLightPerCorner" ></a>NumLightPerCorner</em> </td><td>
</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05896.html#l00053">53</a> of file <a class="el" href="a05896.html">light_influence_interpolator.h</a>.
<p>
<div class="fragment"><pre>00053 {<a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatorw0NL3D_1_1CLightInfluenceInterpolatorw1">NumLightPerCorner</a>= 2};
</pre></div> </td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightInfluenceInterpolatora0" doxytag="NL3D::CLightInfluenceInterpolator::CLightInfluenceInterpolator" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> NL3D::CLightInfluenceInterpolator::CLightInfluenceInterpolator </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructor. No-op !!
<p>
<p>
Definition at line <a class="el" href="a05896.html#l00077">77</a> of file <a class="el" href="a05896.html">light_influence_interpolator.h</a>.
<p>
<div class="fragment"><pre>00077 {}
</pre></div> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightInfluenceInterpolatora1" doxytag="NL3D::CLightInfluenceInterpolator::interpolate" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void NL3D::CLightInfluenceInterpolator::interpolate </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< <a class="el" href="a03092.html">CPointLightInfluence</a> > & </td>
<td class="mdname" nowrap> <em>pointLightList</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>subX</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>float </td>
<td class="mdname" nowrap> <em>subY</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>
solve the biLinear (regrouping multiple influence of light at same id), and add <a class="el" href="a03092.html">CPointLightInfluence</a> to the list. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>subX</em> </td><td>E [0, 1] is the x coord for biLinear </td></tr>
<tr><td valign=top><em>subY</em> </td><td>E [0, 1] is the y coord for biLinear</td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="a05895.html#l00038">38</a> of file <a class="el" href="a05895.html">light_influence_interpolator.cpp</a>.
<p>
References <a class="el" href="a06185.html#l00099">NL3D::CPointLightNamed::_IdInInfluenceList</a>, <a class="el" href="a05896.html#l00071">Corners</a>, <a class="el" href="a05896.html#l00065">NL3D::CLightInfluenceInterpolator::CCorner::Influence</a>, <a class="el" href="a05896.html#l00060">NL3D::CLightInfluenceInterpolator::CCorner::Lights</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatorw0NL3D_1_1CLightInfluenceInterpolatorw1">NumLightPerCorner</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a06157.html#l01543">NL3D::CPatch::appendTileLightInfluences()</a>, and <a class="el" href="a06475.html#l00062">NL3D::CSurfaceLightGrid::getStaticLightSetup()</a>.
<p>
<div class="fragment"><pre>00039 {
00040 <a class="code" href="a04558.html#a15">uint</a> crn;
00041 <span class="comment">// UnRolled loops.</span>
00042 <a class="code" href="a04199.html#a6">nlassert</a>(NumLightPerCorner==2);
00043
00044 <span class="comment">// Reset index for each light.</span>
00045 <span class="keywordflow">for</span>(crn= 0; crn<4; crn++)
00046 {
00047 CCorner &corner= <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[crn];
00048 <span class="comment">// UnRolled.</span>
00049 <span class="keywordflow">if</span>(corner.Lights[0])
00050 corner.<a class="code" href="a02746.html#NL3D_1_1CLightInfluenceInterpolator_1_1CCornero0">Lights</a>[0]->_IdInInfluenceList= -1;
00051 <span class="keywordflow">if</span>(corner.Lights[1])
00052 corner.Lights[1]->_IdInInfluenceList= -1;
00053 }
00054
00055 <span class="comment">// Compute biLinear influence on each corner</span>
00056 <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[0].<a class="code" href="a02746.html#NL3D_1_1CLightInfluenceInterpolator_1_1CCornerr0">Influence</a>= (1-subX) * (1-subY);
00057 <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[1].<a class="code" href="a02746.html#NL3D_1_1CLightInfluenceInterpolator_1_1CCornerr0">Influence</a>= subX * (1-subY);
00058 <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[2].<a class="code" href="a02746.html#NL3D_1_1CLightInfluenceInterpolator_1_1CCornerr0">Influence</a>= (1-subX) * subY;
00059 <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[3].<a class="code" href="a02746.html#NL3D_1_1CLightInfluenceInterpolator_1_1CCornerr0">Influence</a>= subX * subY;
00060
00061 <span class="comment">// For each light of each corner</span>
00062 <span class="keywordflow">for</span>(crn= 0; crn<4; crn++)
00063 {
00064 CCorner &corner= <a class="code" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">Corners</a>[crn];
00065 <span class="comment">// UnRolled.</span>
00066 <span class="comment">// light 0.</span>
00067 <span class="keywordflow">if</span>(corner.Lights[0])
00068 {
00069 <span class="keywordflow">if</span>(corner.Lights[0]->_IdInInfluenceList==-1)
00070 {
00071 <span class="comment">// append a PointLightInfluence</span>
00072 pointLightList.push_back(CPointLightInfluence());
00073 <a class="code" href="a04558.html#a14">sint</a> <span class="keywordtype">id</span>= pointLightList.size()-1;
00074 <span class="comment">// setup the PointLightInfluence</span>
00075 corner.Lights[0]->_IdInInfluenceList= <span class="keywordtype">id</span>;
00076 pointLightList[<span class="keywordtype">id</span>].PointLight= corner.Lights[0];
00077 pointLightList[<span class="keywordtype">id</span>].Influence= corner.Influence;
00078 }
00079 <span class="keywordflow">else</span>
00080 {
00081 <span class="comment">// get the PointLightInfluence</span>
00082 <a class="code" href="a04558.html#a14">sint</a> <span class="keywordtype">id</span>= corner.Lights[0]->_IdInInfluenceList;
00083 <span class="comment">// increment the influence of the PointLightInfluence</span>
00084 pointLightList[<span class="keywordtype">id</span>].Influence+= corner.Influence;
00085 }
00086 }
00087 <span class="comment">// light 1.</span>
00088 <span class="keywordflow">if</span>(corner.Lights[1])
00089 {
00090 <span class="keywordflow">if</span>(corner.Lights[1]->_IdInInfluenceList==-1)
00091 {
00092 <span class="comment">// append a PointLightInfluence</span>
00093 pointLightList.push_back(CPointLightInfluence());
00094 <a class="code" href="a04558.html#a14">sint</a> <span class="keywordtype">id</span>= pointLightList.size()-1;
00095 <span class="comment">// setup the PointLightInfluence</span>
00096 corner.Lights[1]->_IdInInfluenceList= <span class="keywordtype">id</span>;
00097 pointLightList[<span class="keywordtype">id</span>].PointLight= corner.Lights[1];
00098 pointLightList[<span class="keywordtype">id</span>].Influence= corner.Influence;
00099 }
00100 <span class="keywordflow">else</span>
00101 {
00102 <span class="comment">// get the PointLightInfluence</span>
00103 <a class="code" href="a04558.html#a14">sint</a> <span class="keywordtype">id</span>= corner.Lights[1]->_IdInInfluenceList;
00104 <span class="comment">// increment the influence of the PointLightInfluence</span>
00105 pointLightList[<span class="keywordtype">id</span>].Influence+= corner.Influence;
00106 }
00107 }
00108 }
00109 }
</pre></div> </td>
</tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CLightInfluenceInterpolatoro0" doxytag="NL3D::CLightInfluenceInterpolator::Corners" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a02746.html">CCorner</a> <a class="el" href="a02745.html#NL3D_1_1CLightInfluenceInterpolatoro0">NL3D::CLightInfluenceInterpolator::Corners</a>[4]
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The User must setup Lights correctly for each corner (ie set NULL for each light not here). Corner order is TL(0,0), TR(1,0), BL(0,1), BR(1,1).
<p>
Definition at line <a class="el" href="a05896.html#l00071">71</a> of file <a class="el" href="a05896.html">light_influence_interpolator.h</a>.
<p>
Referenced by <a class="el" href="a06157.html#l01543">NL3D::CPatch::appendTileLightInfluences()</a>, <a class="el" href="a06475.html#l00062">NL3D::CSurfaceLightGrid::getStaticLightSetup()</a>, and <a class="el" href="a05895.html#l00038">interpolate()</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05896.html">light_influence_interpolator.h</a><li><a class="el" href="a05895.html">light_influence_interpolator.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:49:26 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>
|