aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/ps__shockwave_8cpp-source.html
blob: a608ea69f668712b9112c601b7b23880c8d0e58d (plain)
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
	<TITLE>nevrax.org : docs</TITLE>
	<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
	<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">

<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0>
 <TR>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=140 BGCOLOR=#dddddd><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
        <TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>Home</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
        <TD><IMG  width=6 height=14  SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle>&nbsp;<A CLASS=uplinks HREF='/'><b>nevrax.com</B></FONT></A>&nbsp;&nbsp;&nbsp;</TD>
 </TR>
</TABLE> 

<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 WIDTH=100%>
 <TR><TD  BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG  SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>

<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0  BORDER=0 height=100%>
 <TR>
	<TD WIDTH=16><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
	<TD WIDTH=140   BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

		<!------ Begin Box ------>
		<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0  cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
		<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td  colspan=2 bgcolor=#FFFFFF>
		<TABLE cellspacing=0 cellpadding=1 border=0>
			<tr><td ALIGN=middle><a  class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15  hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a  class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11  hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a  class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16  hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a  class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17  hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a  class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16  hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a  class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
			<tr><td ALIGN=middle><a  class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img  width=18 height=12   hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a  class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
		</TABLE>
		</TD></TR></TABLE></TD></TR></TABLE>
		<!------ End Box  ------>

	</TD>
	<TD WIDTH=15><IMG  SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
	<TD ALIGN=left valign=top><IMG  SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">

<!-- title -->
<TABLE  background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG  SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
&nbsp;

<!-- block -->
<TABLE  bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0  BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
	<TD><B>Documentation</B></TD>
	<TD ALIGN=RIGHT>&nbsp;</td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> &nbsp; </center>
<hr><h1>ps_shockwave.cpp</h1><a href="ps__shockwave_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00007 <font class="comment">/* Copyright, 2001 Nevrax Ltd.</font>
00008 <font class="comment"> *</font>
00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00013 <font class="comment"> * any later version.</font>
00014 <font class="comment"></font>
00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00018 <font class="comment"> * General Public License for more details.</font>
00019 <font class="comment"></font>
00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00023 <font class="comment"> * MA 02111-1307, USA.</font>
00024 <font class="comment"> */</font>
00025 
00026 <font class="preprocessor">#include "<a class="code" href="std3d_8h.html">std3d.h</a>"</font>
00027 
00028 <font class="preprocessor">#include "<a class="code" href="ps__macro_8h.html">3d/ps_macro.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="ps__shockwave_8h.html">3d/ps_shockwave.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="driver_8h.html">3d/driver.h</a>"</font>
00031 <font class="preprocessor">#include "<a class="code" href="texture__grouped_8h.html">3d/texture_grouped.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="ps__iterator_8h.html">3d/ps_iterator.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="particle__system_8h.html">3d/particle_system.h</a>"</font>
00034 
00035 
00036 <font class="keyword">namespace </font>NL3D 
00037 {                                                          
00038 
00040 <font class="comment">// constant definition   //</font>
00042 <font class="comment"></font>
00043 <font class="comment">// max number of shockwave to be processed at once</font>
00044 <font class="keyword">static</font> <font class="keyword">const</font> uint <a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a> = 128; 
00045 
00046 <font class="comment">// the number of vertices we want in a vertex buffer</font>
00047 <font class="keyword">static</font> <font class="keyword">const</font> uint <a class="code" href="namespaceNL3D.html#a191">NumVertsInBuffer</a> = 8 * <a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>;
00048 
00049 
<a name="l00050"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#r0">00050</a> CPSShockWave::TPBMap CPSShockWave::_PBMap; <font class="comment">// the primitive blocks</font>
<a name="l00051"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#r1">00051</a> CPSShockWave::TVBMap CPSShockWave::_VBMap; <font class="comment">// vb ith unanimated texture</font>
<a name="l00052"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#r2">00052</a> CPSShockWave::TVBMap CPSShockWave::_AnimTexVBMap; <font class="comment">// vb ith unanimated texture</font>
<a name="l00053"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#r3">00053</a> CPSShockWave::TVBMap CPSShockWave::_ColoredVBMap; <font class="comment">// vb ith unanimated texture</font>
<a name="l00054"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#r4">00054</a> CPSShockWave::TVBMap CPSShockWave::_ColoredAnimTexVBMap; <font class="comment">// vb ith unanimated texture</font>
00056 <font class="comment">// CPSShockWave implementation //</font>
00058 <font class="comment"></font>
00059 
<a name="l00065"></a><a class="code" href="classNL3D_1_1CPSShockWaveHelper.html">00065</a> <font class="keyword">class </font>CPSShockWaveHelper
00066 {
00067 <font class="keyword">public</font>:
00068         <font class="keyword">template</font> &lt;<font class="keyword">class</font> T&gt;      
<a name="l00069"></a><a class="code" href="classNL3D_1_1CPSShockWaveHelper.html#d0">00069</a>         <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="classNL3D_1_1CPSShockWaveHelper.html#d0">drawShockWave</a>(T posIt, CPSShockWave &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>, uint size, uint32 srcStep)
00070         {
00071                 PARTICLES_CHECK_MEM;
00072                 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Owner);
00073 
00074                 <font class="comment">// get / build the vertex buffer and the primitive block</font>
00075                 CVertexBuffer *vb;
00076                 CPrimitiveBlock *pb;
00077                 <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getVBnPB(vb, pb);
00078 
00079                 <font class="keyword">const</font> uint32 vSize = vb-&gt;getVertexSize();
00080                 IDriver *driver = <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getDriver();
00081                 <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Owner-&gt;incrementNbDrawnParticles(size); <font class="comment">// for benchmark purpose     </font>
00082                 <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.setupDriverModelMatrix();
00083                 <font class="keyword">const</font> uint numShockWaveToDealWith = <a class="code" href="bit__set_8cpp.html#a0">std::min</a>(<a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>, <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.getNumShockWavesInVB());
00084                 driver-&gt;activeVertexBuffer(*vb);        
00085 
00086                 <font class="keyword">static</font> CPlaneBasis planeBasis[<a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>];
00087                 <font class="keywordtype">float</font>       sizes[<a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>];
00088                 <font class="keywordtype">float</font>       angles[<a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>];
00089                 
00090                 uint leftToDo  = size, toProcess;
00091                 T endIt;
00092                 uint8 *currVertex;
00093                 uint k ;
00094 
00095                 <font class="keyword">const</font> <font class="keywordtype">float</font> angleStep = 256.f / <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._NbSeg;
00096                 <font class="keywordtype">float</font> currAngle;
00097 
00098                 CPlaneBasis *ptCurrBasis;
00099                 uint32  ptCurrBasisIncrement = <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._PlaneBasisScheme ? 1 : 0;
00100 
00101                 <font class="keywordtype">float</font> *ptCurrSize;
00102                 uint32 ptCurrSizeIncrement = <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._SizeScheme ? 1 : 0;
00103 
00104                 <font class="keywordtype">float</font> *ptCurrAngle;
00105                 uint32 ptCurrAngleIncrement = <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Angle2DScheme ? 1 : 0;
00106 
00107                 CVector radVect, innerVect;
00108                 <font class="keywordtype">float</font> radiusRatio;
00109 
00110                 <font class="keywordflow">do</font>
00111                 {
00112                         currVertex = (uint8 *) vb-&gt;getVertexCoordPointer();
00113                         toProcess = leftToDo &gt; numShockWaveToDealWith ? numShockWaveToDealWith : leftToDo;
00114                         endIt = posIt + toProcess;
00115                         <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._SizeScheme)
00116                         {
00117                                 ptCurrSize  = (<font class="keywordtype">float</font> *) (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._SizeScheme-&gt;make(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Owner, size - leftToDo, (<font class="keywordtype">void</font> *) sizes, <font class="keyword">sizeof</font>(<font class="keywordtype">float</font>), toProcess, <font class="keyword">true</font>, srcStep));                      
00118                         }
00119                         <font class="keywordflow">else</font>
00120                         {
00121                                 ptCurrSize = &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._ParticleSize;
00122                         }
00123 
00124                         <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._PlaneBasisScheme)
00125                         {
00126                                 ptCurrBasis  = (CPlaneBasis *) (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._PlaneBasisScheme-&gt;make(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Owner, size - leftToDo, (<font class="keywordtype">void</font> *) planeBasis, <font class="keyword">sizeof</font>(CPlaneBasis), toProcess, <font class="keyword">true</font>, srcStep));                      
00127                         }
00128                         <font class="keywordflow">else</font>
00129                         {
00130                                 ptCurrBasis = &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._PlaneBasis;
00131                         }
00132 
00133                         <font class="keywordflow">if</font> (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Angle2DScheme)
00134                         {
00135                                 ptCurrAngle  = (<font class="keywordtype">float</font> *) (<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Angle2DScheme-&gt;make(<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Owner, size - leftToDo, (<font class="keywordtype">void</font> *) angles, <font class="keyword">sizeof</font>(<font class="keywordtype">float</font>), toProcess, <font class="keyword">true</font>, srcStep));                 
00136                         }
00137                         <font class="keywordflow">else</font>
00138                         {
00139                                 ptCurrAngle = &amp;<a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Angle2D;
00140                         }
00141                         
00142 
00143                         <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>.updateVbColNUVForRender(size - leftToDo, toProcess, srcStep, *vb);
00144                         <font class="keywordflow">do</font>
00145                         {                       
00146                                 currAngle = *ptCurrAngle;
00147                                 <font class="keywordflow">if</font> (fabsf(*ptCurrSize) &gt; 10E-6)
00148                                 {
00149                                         radiusRatio = (*ptCurrSize - <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._RadiusCut) / *ptCurrSize;
00150                                 }
00151                                 <font class="keywordflow">else</font>
00152                                 {
00153                                         radiusRatio = 0.f;
00154                                 }
00155 
00156                                 <font class="keywordflow">for</font> (k = 0; k &lt;= <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._NbSeg; ++k)
00157                                 {
00158                                         radVect = *ptCurrSize * (CPSUtil::getCos((sint32) currAngle) * ptCurrBasis-&gt;X + CPSUtil::getSin((sint32) currAngle) * ptCurrBasis-&gt;Y);
00159                                         innerVect = radiusRatio * radVect;
00160                                         <a class="code" href="ps__macro_8h.html#a0">CHECK_VERTEX_BUFFER</a>(*vb, currVertex);
00161                                         * (CVector *) currVertex = *posIt + radVect;
00162                                         currVertex += vSize;
00163                                         <a class="code" href="ps__macro_8h.html#a0">CHECK_VERTEX_BUFFER</a>(*vb, currVertex);
00164                                         * (CVector *) currVertex = *posIt + innerVect;
00165                                         currVertex += vSize;
00166                                         currAngle += angleStep;                         
00167                                 }
00168                                 
00169                                 ++posIt;
00170                                 ptCurrBasis +=  ptCurrBasisIncrement;
00171                                 ptCurrSize  +=  ptCurrSizeIncrement;
00172                                 ptCurrAngle  +=  ptCurrAngleIncrement;
00173                         }
00174                         <font class="keywordflow">while</font> (posIt != endIt);                 
00175 
00176                         pb-&gt;setNumQuad(toProcess * <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._NbSeg);
00177                         driver-&gt;render(*pb, <a class="code" href="driver__opengl__extension__def_8h.html#a383">s</a>._Mat);
00178                         leftToDo -= toProcess;          
00179                 }
00180                 <font class="keywordflow">while</font> (leftToDo);
00181                 PARTICLES_CHECK_MEM;
00182         }
00183 };
00184 
<a name="l00186"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a0">00186</a> CPSShockWave::CPSShockWave(uint nbSeg, <font class="keywordtype">float</font> radiusCut, CSmartPtr&lt;ITexture&gt; tex) 
00187                 :  _NbSeg(nbSeg)
00188                    , _RadiusCut(radiusCut)
00189                    , _UFactor(1.f)
00190 
00191 {
00192         <a class="code" href="debug_8h.html#a6">nlassert</a>(nbSeg &gt; 2 &amp;&amp; nbSeg &lt;= 64);
00193         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#a8">setTexture</a>(tex);
00194         <a class="code" href="classNL3D_1_1CPSShockWave.html#c4">init</a>();
00195         <a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n3">_Name</a> = std::string(<font class="stringliteral">"ShockWave"</font>);
00196 }
00197 
<a name="l00199"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a10">00199</a> uint32 CPSShockWave::getMaxNumFaces(<font class="keywordtype">void</font>)<font class="keyword"> const</font>
00200 <font class="keyword"></font>{
00201         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>);
00202         <font class="keywordflow">return</font> (<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getMaxSize() * <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>) &lt;&lt; 1 ;
00203 }
00204 
<a name="l00206"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a8">00206</a> <font class="keywordtype">bool</font> CPSShockWave::hasTransparentFaces(<font class="keywordtype">void</font>)
00207 {
00208         <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CPSMaterial.html#a3">getBlendingMode</a>() != CPSMaterial::alphaTest ;
00209 }
00210 
<a name="l00212"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a9">00212</a> <font class="keywordtype">bool</font> CPSShockWave::hasOpaqueFaces(<font class="keywordtype">void</font>)
00213 {
00214         <font class="keywordflow">return</font> !<a class="code" href="classNL3D_1_1CPSShockWave.html#a8">hasTransparentFaces</a>();
00215 }
00216 
<a name="l00218"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a1">00218</a> <font class="keywordtype">void</font> CPSShockWave::setNbSegs(uint nbSeg)
00219 {
00220         <a class="code" href="debug_8h.html#a6">nlassert</a>(nbSeg &gt; 2 &amp;&amp; nbSeg &lt;= 64);
00221         <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> = nbSeg;
00222         <font class="keywordflow">if</font> (_Owner)
00223         {
00224                 <a class="code" href="classNL3D_1_1CPSShockWave.html#b5">resize</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getMaxSize());
00225                 <a class="code" href="classNL3D_1_1CPSParticle.html#b0">notifyOwnerMaxNumFacesChanged</a>();
00226         }
00227 }
00228 
<a name="l00230"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a3">00230</a> <font class="keywordtype">void</font> CPSShockWave::setRadiusCut(<font class="keywordtype">float</font> radiusCut)
00231 {
00232         <a class="code" href="classNL3D_1_1CPSShockWave.html#o1">_RadiusCut</a> = radiusCut; 
00233         <font class="keywordflow">if</font> (_Owner)
00234         {
00235                 <a class="code" href="classNL3D_1_1CPSShockWave.html#b5">resize</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getMaxSize());
00236         }
00237 }
00238 
<a name="l00240"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a11">00240</a> <font class="keywordtype">void</font>    CPSShockWave::setUFactor(<font class="keywordtype">float</font> <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>)
00241 {
00242         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>); <font class="comment">// must be attached to an owner before to call this method</font>
00243         <a class="code" href="classNL3D_1_1CPSShockWave.html#o2">_UFactor</a> = <a class="code" href="driver__opengl__extension__def_8h.html#a415">value</a>;
00244         <a class="code" href="classNL3D_1_1CPSShockWave.html#b5">resize</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getSize()); <font class="comment">// resize also recomputes the UVs..</font>
00245 }
00246 
<a name="l00248"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a5">00248</a> <font class="keywordtype">void</font> CPSShockWave::serial(<a class="code" href="classNLMISC_1_1IStream.html">NLMISC::IStream</a> &amp;f) <font class="keywordflow">throw</font>(NLMISC::EStream)
00249 {       
00250         sint ver  = f.serialVersion(2);
00251         CPSParticle::serial(f);
00252         CPSColoredParticle::serialColorScheme(f);
00253         CPSSizedParticle::serialSizeScheme(f);
00254         CPSTexturedParticle::serialTextureScheme(f);
00255         CPSRotated3DPlaneParticle::serialPlaneBasisScheme(f);
00256         CPSRotated2DParticle::serialAngle2DScheme(f);
00257         serialMaterial(f);
00258         f.serial(_NbSeg, _RadiusCut);
00259         <font class="keywordflow">if</font> (ver &gt; 1)
00260         {
00261                 f.serial(_UFactor);
00262         }
00263         init(); 
00264 }
00265 
<a name="l00267"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#c2">00267</a> <font class="keyword">inline</font> <font class="keywordtype">void</font> CPSShockWave::setupUFactor()
00268 {       
00269         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSShockWave.html#o2">_UFactor</a> != 1.f)
00270         {
00271                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.enableUserTexMat(0);
00272                 CMatrix texMat;
00273                 texMat.setRot(<a class="code" href="classNL3D_1_1CPSShockWave.html#o2">_UFactor</a>  * <a class="code" href="classNLMISC_1_1CVector.html#p1">NLMISC::CVector::I</a>,
00274                                           <a class="code" href="classNLMISC_1_1CVector.html#p2">NLMISC::CVector::J</a>,
00275                                           <a class="code" href="classNLMISC_1_1CVector.html#p3">NLMISC::CVector::K</a>
00276                                          );
00277                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setUserTexMat(0, texMat);
00278         }
00279         <font class="keywordflow">else</font>
00280         {
00281                 <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.enableUserTexMat(0, <font class="keyword">false</font>);
00282         }       
00283 }
00284 
<a name="l00286"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#c3">00286</a> <font class="keywordtype">void</font> CPSShockWave::draw(<font class="keywordtype">bool</font> opaque)
00287 {
00288         PARTICLES_CHECK_MEM;    
00289         <font class="keywordflow">if</font> (!<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getSize()) <font class="keywordflow">return</font>; 
00290 
00291         uint32 <a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a>;
00292         uint   numToProcess;
00293         <a class="code" href="classNL3D_1_1CPSParticle.html#b4">computeSrcStep</a>(<a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a>, numToProcess);     
00294         <font class="keywordflow">if</font> (!numToProcess) <font class="keywordflow">return</font>;
00295 
00296 
00297         
00299         CParticleSystem &amp;ps = *(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getOwner());
00301         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a> != NULL &amp;&amp; ps.getColorAttenuationScheme() != NULL)
00302         {               
00303                 CPSMaterial::forceModulateConstantColor(<font class="keyword">true</font>, ps.getGlobalColor());             
00304         }
00305         <font class="keywordflow">else</font>
00306         {
00307                 <a class="code" href="classNL3D_1_1CPSMaterial.html#a4">forceModulateConstantColor</a>(<font class="keyword">false</font>);
00308                 <font class="keywordflow">if</font> (!ps.getColorAttenuationScheme())
00309                 {
00310                         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setColor(<a class="code" href="classNL3D_1_1CPSColoredParticle.html#n0">_Color</a>);
00311                 }
00312                 <font class="keywordflow">else</font>
00313                 {
00314                         <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> col;
00315                         col.<a class="code" href="classNLMISC_1_1CRGBA.html#a9">modulateFromColor</a>(ps.getGlobalColor(), <a class="code" href="classNL3D_1_1CPSColoredParticle.html#n0">_Color</a>);
00316                         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setColor(col);
00317                 }
00318         }
00320 
00321         <a class="code" href="classNL3D_1_1CPSShockWave.html#c2">setupUFactor</a>();
00322         
00323         <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a> == (1 &lt;&lt; 16))
00324         {
00325                 CPSShockWaveHelper::drawShockWave(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getPos().begin(),                                
00326                                                                                   *<font class="keyword">this</font>,
00327                                                                                   numToProcess,
00328                                                                                   <a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a>
00329                                                                                  );
00330         }
00331         <font class="keywordflow">else</font>
00332         {               
00333                 CPSShockWaveHelper::drawShockWave(<a class="code" href="namespaceNL3D.html#a199">TIteratorVectStep1616</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getPos().begin(), 0, <a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a>),                                
00334                                                                                   *<font class="keyword">this</font>,
00335                                                                                   numToProcess,
00336                                                                                   <a class="code" href="classNL3D_1_1CPSParticle.html#a4">step</a>
00337                                                                                  );
00338         }
00339         
00340         PARTICLES_CHECK_MEM;
00341 }
00342 
<a name="l00344"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#a7">00344</a> <font class="keywordtype">bool</font> CPSShockWave::completeBBox(<a class="code" href="classNLMISC_1_1CAABBox.html">NLMISC::CAABBox</a> &amp;box)<font class="keyword"> const</font>
00345 <font class="keyword"></font>{
00346         <font class="comment">// TODO : implement this</font>
00347         <font class="keywordflow">return</font> <font class="keyword">false</font>;
00348 }
00349 
<a name="l00351"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#c4">00351</a> <font class="keywordtype">void</font> CPSShockWave::init(<font class="keywordtype">void</font>)
00352 {
00353         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setLighting(<font class="keyword">false</font>);        
00354         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setZFunc(CMaterial::less);
00355         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setDoubleSided(<font class="keyword">true</font>);
00356         <a class="code" href="classNL3D_1_1CPSShockWave.html#b1">updateMatAndVbForColor</a>();
00357         <a class="code" href="classNL3D_1_1CPSShockWave.html#b2">updateMatAndVbForTexture</a>();
00358 }
00359 
<a name="l00361"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b0">00361</a> <font class="keywordtype">void</font> CPSShockWave::updateVbColNUVForRender(uint32 startIndex, uint32 size, uint32 srcStep, CVertexBuffer &amp;vb)
00362 {
00363         <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>);
00364         <font class="keywordflow">if</font> (!size) <font class="keywordflow">return</font>;
00365         <font class="keywordflow">if</font> (_ColorScheme)
00366         {
00367                 <font class="comment">// compute the colors, each color is replicated n times...</font>
00368                 <a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a>-&gt;makeN(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, vb.getColorPointer(), vb.getVertexSize(), size, (<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1) &lt;&lt; 1, srcStep);
00369         }
00370 
00371         <font class="keywordflow">if</font> (_TexGroup) <font class="comment">// if it has a constant texture we are sure it has been setupped before...</font>
00372         {       
00373                 sint32 textureIndex[<a class="code" href="namespaceNL3D.html#a219">ShockWaveBufSize</a>];
00374                 <font class="keyword">const</font> uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> = vb.getVertexSize(), stride2 = <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a> &lt;&lt; 1;
00375                 uint8 *currUV = (uint8 *) vb.getTexCoordPointer();                              
00376                 uint k;         
00377 
00378                 uint32 currIndexIncr;
00379                 <font class="keyword">const</font> sint32 *currIndex;                
00380 
00381                 <font class="keywordflow">if</font> (_TextureIndexScheme)
00382                 {
00383                         currIndex  = (sint32 *) (<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n2">_TextureIndexScheme</a>-&gt;make(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>, startIndex, textureIndex, <font class="keyword">sizeof</font>(sint32), size, <font class="keyword">true</font>, srcStep));                     
00384                         currIndexIncr = 1;
00385                 }
00386                 <font class="keywordflow">else</font>
00387                 {       
00388                         currIndex = &amp;<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n3">_TextureIndex</a>;
00389                         currIndexIncr = 0;
00390                 }
00391                 
00392                 <font class="keywordflow">while</font> (size--)
00393                 {
00394                         <font class="comment">// for now, we don't make texture index wrapping</font>
00395                         <font class="keyword">const</font> CTextureGrouped::TFourUV &amp;uvGroup = <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a>-&gt;getUVQuad((uint32) *currIndex);
00396 
00397                         k = <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1;
00398 
00399                         <font class="keywordflow">for</font> (k = 0; k &lt;= <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>; ++k)
00400                         {
00401                                 
00402                                 *(CUV *) currUV = uvGroup.uv0 + CUV(k * <a class="code" href="classNL3D_1_1CPSShockWave.html#o2">_UFactor</a>, 0);
00403                                 *(CUV *) (currUV + <a class="code" href="driver__opengl__extension__def_8h.html#a374">stride</a>) = uvGroup.uv3 + CUV(k * <a class="code" href="classNL3D_1_1CPSShockWave.html#o2">_UFactor</a>, 0);                                
00404                                 <font class="comment">// point the next quad</font>
00405                                 currUV += stride2;
00406                         }
00407                         <font class="keywordflow">while</font> (--k);
00408 
00409                         currIndex += currIndexIncr;
00410                 }               
00411         }       
00412 }
00413 
<a name="l00415"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b1">00415</a> <font class="keywordtype">void</font> CPSShockWave::updateMatAndVbForColor(<font class="keywordtype">void</font>)
00416 {       
00417 
00418         <font class="keywordflow">if</font> (_Owner)
00419         {
00420                 <a class="code" href="classNL3D_1_1CPSShockWave.html#b5">resize</a>(<a class="code" href="classNL3D_1_1CPSLocatedBindable.html#n0">_Owner</a>-&gt;getMaxSize());
00421         }       
00422 }
00423 
<a name="l00425"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b2">00425</a> <font class="keywordtype">void</font> CPSShockWave::updateMatAndVbForTexture(<font class="keywordtype">void</font>)
00426 {
00427         <a class="code" href="classNL3D_1_1CPSMaterial.html#n0">_Mat</a>.setTexture(0, <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> ? (ITexture *) <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> : (ITexture *) <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n0">_Tex</a>);     
00428 }
00429 
<a name="l00431"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b3">00431</a> <font class="keywordtype">void</font> CPSShockWave::newElement(CPSLocated *emitterLocated, uint32 emitterIndex)
00432 {
00433         <a class="code" href="classNL3D_1_1CPSColoredParticle.html#b2">newColorElement</a>(emitterLocated, emitterIndex);
00434         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#b2">newTextureIndexElement</a>(emitterLocated, emitterIndex);
00435         <a class="code" href="classNL3D_1_1CPSSizedParticle.html#b1">newSizeElement</a>(emitterLocated, emitterIndex);
00436         <a class="code" href="classNL3D_1_1CPSRotated2DParticle.html#b1">newAngle2DElement</a>(emitterLocated, emitterIndex);
00437 }
00438 
<a name="l00440"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b4">00440</a> <font class="keywordtype">void</font> CPSShockWave::deleteElement(uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>)
00441 {
00442         <a class="code" href="classNL3D_1_1CPSColoredParticle.html#b3">deleteColorElement</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00443         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#b3">deleteTextureIndexElement</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00444         <a class="code" href="classNL3D_1_1CPSSizedParticle.html#b2">deleteSizeElement</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00445         <a class="code" href="classNL3D_1_1CPSRotated2DParticle.html#b2">deleteAngle2DElement</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>);
00446 }
00447 
<a name="l00449"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#b5">00449</a> <font class="keywordtype">void</font> CPSShockWave::resize(uint32 aSize)
00450 {
00451         <a class="code" href="debug_8h.html#a6">nlassert</a>(aSize &lt; (1 &lt;&lt; 16));
00452         <a class="code" href="classNL3D_1_1CPSColoredParticle.html#b4">resizeColor</a>(aSize);
00453         <a class="code" href="classNL3D_1_1CPSTexturedParticle.html#b4">resizeTextureIndex</a>(aSize);
00454         <a class="code" href="classNL3D_1_1CPSSizedParticle.html#b3">resizeSize</a>(aSize);
00455         <a class="code" href="classNL3D_1_1CPSRotated2DParticle.html#b3">resizeAngle2D</a>(aSize);   
00456 }
00457 
<a name="l00459"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#c0">00459</a> <font class="keywordtype">void</font> CPSShockWave::getVBnPB(CVertexBuffer *&amp;retVb, CPrimitiveBlock *&amp;retPb)
00460 {
00461         <a class="code" href="classNL3D_1_1CPSShockWave.html#u0">TVBMap</a> &amp;vbMap = <a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a> == NULL  ? (<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> == NULL ?  <a class="code" href="classNL3D_1_1CPSShockWave.html#r1">_VBMap</a> : <a class="code" href="classNL3D_1_1CPSShockWave.html#r2">_AnimTexVBMap</a>)
00462                                                                                   : (<a class="code" href="classNL3D_1_1CPSTexturedParticle.html#n1">_TexGroup</a> == NULL ?  <a class="code" href="classNL3D_1_1CPSShockWave.html#r3">_ColoredVBMap</a> : <a class="code" href="classNL3D_1_1CPSShockWave.html#r4">_ColoredAnimTexVBMap</a>);
00463 
00464 
00465         TVBMap::iterator vbIt = vbMap.find(<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>);
00466         <font class="keywordflow">if</font> (vbIt != vbMap.end())
00467         {
00468                 retVb = &amp;(vbIt-&gt;second);
00469                 TPBMap::iterator pbIt = <a class="code" href="classNL3D_1_1CPSShockWave.html#r0">_PBMap</a>.find(<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>);
00470                 <a class="code" href="debug_8h.html#a6">nlassert</a>(pbIt != <a class="code" href="classNL3D_1_1CPSShockWave.html#r0">_PBMap</a>.end());
00471                 retPb = &amp;(pbIt-&gt;second);
00472         }
00473         <font class="keywordflow">else</font> <font class="comment">// we need to create the vb</font>
00474         {               
00475                 <font class="comment">// create an entry (we setup the primitive block at the same time, this could be avoided, but doesn't make much difference)             </font>
00476                 CVertexBuffer &amp;vb = vbMap[<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>]; <font class="comment">// create a vb</font>
00477                 CPrimitiveBlock &amp;pb = <a class="code" href="classNL3D_1_1CPSShockWave.html#r0">_PBMap</a>[<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>]; <font class="comment">// eventually create a pb</font>
00478                 <font class="keyword">const</font> uint32 size = <a class="code" href="classNL3D_1_1CPSShockWave.html#c1">getNumShockWavesInVB</a>();
00479                 vb.setVertexFormat(CVertexBuffer::PositionFlag |
00480                                                    CVertexBuffer::TexCoord0Flag |
00481                                                    (<a class="code" href="classNL3D_1_1CPSColoredParticle.html#n1">_ColorScheme</a> != NULL ?  CVertexBuffer::PrimaryColorFlag : 0) 
00482                                                   );    
00483                 vb.setNumVertices((size * (<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1)) &lt;&lt; 1 );         
00484                 pb.reserveQuad(size * <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>);
00485                 <font class="keywordflow">for</font> (uint32 k = 0; k &lt; size; ++k)
00486                 {
00487                         <font class="keywordflow">for</font> (uint32 <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> = 0; <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> &lt; <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>; ++<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a>)
00488                         {       
00489                                 <font class="keyword">const</font> uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> = ((k * (<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1)) + <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a>) &lt;&lt; 1;                                             
00490                                 pb.setQuad(<a class="code" href="namespaceNLAISCRIPT.html#a20">l</a> + (k * <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>) , <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> , <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> + 2, <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> + 3, <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> + 1);                 
00491                                 vb.setTexCoord(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, 0, CUV((<font class="keywordtype">float</font>) <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a>, 0));
00492                                 vb.setTexCoord(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> + 1, 0, CUV((<font class="keywordtype">float</font>) <a class="code" href="namespaceNLAISCRIPT.html#a20">l</a>, 1));                        
00493                         }
00494                         <font class="keyword">const</font> uint32 <a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> = ((k * (<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1)) + <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>) &lt;&lt; 1;
00495                         vb.setTexCoord(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a>, 0, CUV((<font class="keywordtype">float</font>) <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>, 0));
00496                         vb.setTexCoord(<a class="code" href="driver__opengl__extension__def_8h.html#a358">index</a> + 1, 0, CUV((<font class="keywordtype">float</font>) <a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a>, 1));                   
00497                 }
00498                 retVb = &amp;vb;
00499                 retPb = &amp;pb;
00500         }
00501 }
00502 
<a name="l00504"></a><a class="code" href="classNL3D_1_1CPSShockWave.html#c1">00504</a> uint CPSShockWave::getNumShockWavesInVB()<font class="keyword"> const</font>
00505 <font class="keyword"></font>{
00506         <font class="keyword">const</font> uint numRib = <a class="code" href="namespaceNL3D.html#a191">NumVertsInBuffer</a> / ((<a class="code" href="classNL3D_1_1CPSShockWave.html#o0">_NbSeg</a> + 1) &lt;&lt; 1);
00507         <font class="keywordflow">return</font> std::max(1u, numRib);
00508 }
00509 
00510 } <font class="comment">// NL3D</font>
</pre></div>

<!-- footer -->
<BR><FONT Size=+5>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT>
</TD>
<TD WIDTH=15><IMG  SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>