aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03682.html
blob: cc4c06c8b69e58cf766cc833847091fa6f065af2 (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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<!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::CVegetableShape class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>NL3D::CVegetableShape Class Reference</h1><code>#include &lt;<a class="el" href="a06703.html">vegetable_shape.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A vegetable shape. Ie not deformed by instanciation. <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="a06703.html#l00108">108</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapea0">build</a> (<a class="el" href="a03683.html">CVegetableShapeBuild</a> &amp;vbuild)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapea1">CVegetableShape</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NL3D_1_1CVegetableShapea1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapea2">loadShape</a> (const std::string &amp;shape)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapea3">serial</a> (<a class="el" href="a02270.html">NLMISC::IStream</a> &amp;f)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">serial  <a href="#NL3D_1_1CVegetableShapea3"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Data Fields</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Shape def</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_0">AlphaBlend</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03683.html#NL3D_1_1CVegetableShapeBuildw3">CVegetableShapeBuild::TBendCenterMode</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_1">BendCenterMode</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_2">BestSidedPreComputeLighting</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_3">DoubleSided</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of this shape.  <a href="#NL3D_1_1CVegetableShapez1130_4"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">PreComputeLighting</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a04558.html#a11">uint32</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">TriangleIndices</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">list of triangles index  <a href="#NL3D_1_1CVegetableShapez1130_6"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a></td></tr>

<tr><td colspan="2"><div class="groupHeader">Temporary for easy Instanciation (correct size)</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a04558.html#a11">uint32</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1132_0">InstanceVertices</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">For each vertex of the shape, gives the index in the VegetableManager.  <a href="#NL3D_1_1CVegetableShapez1132_0"></a><br><br></td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CVegetableShapea1" doxytag="NL3D::CVegetableShape::CVegetableShape" ></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::CVegetableShape::CVegetableShape </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor. 
<p>

<p>
Definition at line <a class="el" href="a06702.html#l00042">42</a> of file <a class="el" href="a06702.html">vegetable_shape.cpp</a>.
<p>
<div class="fragment"><pre>00043 {
00044         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a>= <span class="keyword">false</span>;
00045         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_3">DoubleSided</a>= <span class="keyword">false</span>;
00046         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">PreComputeLighting</a>= <span class="keyword">false</span>;
00047         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_0">AlphaBlend</a>= <span class="keyword">false</span>;
00048         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_2">BestSidedPreComputeLighting</a>= <span class="keyword">false</span>;
00049 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CVegetableShapea0" doxytag="NL3D::CVegetableShape::build" ></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::CVegetableShape::build </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a03683.html">CVegetableShapeBuild</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>vbuild</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
build a vegetable shape, with a standard shape.
<p>
Definition at line <a class="el" href="a06702.html#l00052">52</a> of file <a class="el" href="a06702.html">vegetable_shape.cpp</a>.
<p>
References <a class="el" href="a06703.html#l00074">NL3D::CVegetableShapeBuild::AlphaBlend</a>, <a class="el" href="a06703.html#l00083">NL3D::CVegetableShapeBuild::BendCenterMode</a>, <a class="el" href="a06703.html#l00079">NL3D::CVegetableShapeBuild::BestSidedPreComputeLighting</a>, <a class="el" href="a06703.html#l00070">NL3D::CVegetableShapeBuild::DoubleSided</a>, <a class="el" href="a05646.html#l01016">format</a>, <a class="el" href="a06710.html#l00465">NL3D::CVertexBuffer::getColorPointer()</a>, <a class="el" href="a06710.html#l00449">NL3D::CVertexBuffer::getNormalCoordPointer()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06710.html#l00497">NL3D::CVertexBuffer::getTexCoordPointer()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a06703.html#l00147">InstanceVertices</a>, <a class="el" href="a06703.html#l00066">NL3D::CVegetableShapeBuild::Lighted</a>, <a class="el" href="a06703.html#l00081">NL3D::CVegetableShapeBuild::MaxBendWeight</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06703.html#l00064">NL3D::CVegetableShapeBuild::PB</a>, <a class="el" href="a06703.html#l00068">NL3D::CVegetableShapeBuild::PreComputeLighting</a>, <a class="el" href="a06340.html#l00334">NLMISC::CRGBA::R</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a06710.html#l00169">NL3D::CVertexBuffer::setVertexFormat()</a>, <a class="el" href="a06655.html#l00049">NLMISC::CUV::U</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, <a class="el" href="a06703.html#l00062">NL3D::CVegetableShapeBuild::VB</a>, <a class="el" href="a05646.html#l00236">w</a>, and <a class="el" href="a05646.html#l00236">z</a>.
<p>
<div class="fragment"><pre>00053 {
00054         <span class="comment">// Must have TexCoord0.</span>
00055         <a class="code" href="a04199.html#a6">nlassert</a>( vbuild.VB.getVertexFormat() &amp; CVertexBuffer::TexCoord0Flag );
00056 
00057         <span class="comment">// Header</span>
00058         <span class="comment">//---------</span>
00059 
00060         <span class="comment">// Lighted ?</span>
00061         <span class="keywordflow">if</span>(vbuild.Lighted &amp;&amp; ( vbuild.VB.getVertexFormat() &amp; CVertexBuffer::NormalFlag) )
00062                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a>= <span class="keyword">true</span>;
00063         <span class="keywordflow">else</span>
00064                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a>= <span class="keyword">false</span>;
00065 
00066         <span class="comment">// DoubleSided</span>
00067         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_3">DoubleSided</a>= vbuild.DoubleSided;
00068 
00069         <span class="comment">// PreComputeLighting.</span>
00070         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">PreComputeLighting</a>= <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a> &amp;&amp; vbuild.PreComputeLighting;
00071 
00072         <span class="comment">// AlphaBlend: valid only for 2Sided and Unlit (or similar PreComputeLighting) mode</span>
00073         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_0">AlphaBlend</a>= vbuild.AlphaBlend &amp;&amp; <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_3">DoubleSided</a> &amp;&amp; (!<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a> || <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">PreComputeLighting</a>);
00074 
00075         <span class="comment">// BestSidedPreComputeLighting</span>
00076         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_2">BestSidedPreComputeLighting</a>= <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">PreComputeLighting</a> &amp;&amp; vbuild.BestSidedPreComputeLighting;
00077 
00078         <span class="comment">// BendCenterMode</span>
00079         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_1">BendCenterMode</a>= vbuild.BendCenterMode;
00080 
00081         <span class="comment">// Format of the VB.</span>
00082         <a class="code" href="a04558.html#a11">uint32</a>  <a class="code" href="a04223.html#a641">format</a>;
00083         <a class="code" href="a04223.html#a641">format</a>= CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag | CVertexBuffer::TexCoord1Flag;
00084         <span class="comment">// lighted?</span>
00085         <span class="keywordflow">if</span>(<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a>)
00086                 <a class="code" href="a04223.html#a641">format</a>|= CVertexBuffer::NormalFlag;
00087         <span class="comment">// set VB.</span>
00088         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.setVertexFormat(format);
00089 
00090 
00091         <span class="comment">// Fill triangles.</span>
00092         <span class="comment">//---------</span>
00093         <a class="code" href="a04558.html#a15">uint</a>    i;
00094         <span class="comment">// resisz</span>
00095         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">TriangleIndices</a>.resize(vbuild.PB.getNumTri() * 3);
00096         <a class="code" href="a04558.html#a11">uint32</a>  *srcTri= vbuild.PB.getTriPointer();
00097         <span class="comment">// fill</span>
00098         <span class="keywordflow">for</span>(i=0; i&lt;vbuild.PB.getNumTri(); i++)
00099         {
00100                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">TriangleIndices</a>[i*3+0]= *(srcTri++);
00101                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">TriangleIndices</a>[i*3+1]= *(srcTri++);
00102                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">TriangleIndices</a>[i*3+2]= *(srcTri++);
00103         }
00104 
00105 
00106         <span class="comment">// Fill vertices.</span>
00107         <span class="comment">//---------</span>
00108         <span class="comment">// resize</span>
00109         <a class="code" href="a04558.html#a11">uint32</a>          nbVerts= vbuild.VB.getNumVertices();
00110         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.setNumVertices(nbVerts);
00111         <span class="comment">// if no vertex color, </span>
00112         <span class="keywordtype">float</span>   maxZ= 0;
00113         <span class="keywordtype">bool</span>    bendFromColor= <span class="keyword">true</span>;
00114         <span class="keywordflow">if</span>(! (vbuild.VB.getVertexFormat() &amp; CVertexBuffer::PrimaryColorFlag) )
00115         {
00116                 <span class="comment">// must compute bendWeight from z.</span>
00117                 bendFromColor= <span class="keyword">false</span>;
00118                 <span class="comment">// get the maximum Z.</span>
00119                 <span class="keywordflow">for</span>(i=0;i&lt;nbVerts;i++)
00120                 {
00121                         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a574">z</a>= ((CVector*)vbuild.VB.getVertexCoordPointer(i))-&gt;z;
00122                         maxZ= max(z, maxZ);
00123                 }
00124                 <span class="comment">// if no positive value, bend will always be 0.</span>
00125                 <span class="keywordflow">if</span>(maxZ==0)
00126                         maxZ= 1;
00127         }
00128 
00129         <span class="comment">// For all vertices, fill</span>
00130         <span class="keywordflow">for</span>(i=0;i&lt;nbVerts;i++)
00131         {
00132                 <span class="comment">// Position.</span>
00133                 CVector         *srcPos= (CVector*)vbuild.VB.getVertexCoordPointer(i);
00134                 CVector         *dstPos= (CVector*)<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getVertexCoordPointer(i);
00135                 *dstPos= *srcPos;
00136 
00137                 <span class="comment">// Normal</span>
00138                 <span class="keywordflow">if</span>(<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">Lighted</a>)
00139                 {
00140                         CVector         *srcNormal= (CVector*)vbuild.VB.getNormalCoordPointer(i);
00141                         CVector         *dstNormal= (CVector*)<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getNormalCoordPointer(i);
00142                         *dstNormal= *srcNormal;
00143                 }
00144 
00145                 <span class="comment">// Texture.</span>
00146                 <a class="code" href="a03640.html">CUV</a>             *srcUV= (<a class="code" href="a03640.html">CUV</a>*)vbuild.VB.getTexCoordPointer(i, 0);
00147                 <a class="code" href="a03640.html">CUV</a>             *dstUV= (<a class="code" href="a03640.html">CUV</a>*)<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getTexCoordPointer(i, 0);
00148                 *dstUV= *srcUV;
00149 
00150                 <span class="comment">// Bend.</span>
00151                 <span class="comment">// copy to texture stage 1.</span>
00152                 <a class="code" href="a03640.html">CUV</a>             *dstUVBend= (<a class="code" href="a03640.html">CUV</a>*)<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getTexCoordPointer(i, 1);
00153                 <span class="keywordflow">if</span>(bendFromColor)
00154                 {
00155                         <a class="code" href="a03337.html">CRGBA</a>   *srcColor= (<a class="code" href="a03337.html">CRGBA</a>*)vbuild.VB.getColorPointer(i);
00156                         <span class="comment">// Copy and scale by MaxBendWeight</span>
00157                         dstUVBend-&gt;<a class="code" href="a03640.html#NLMISC_1_1CUVo0">U</a>= (srcColor-&gt;<a class="code" href="a03337.html#NLMISC_1_1CRGBAo3">R</a> / 255.f) * vbuild.MaxBendWeight;
00158                 }
00159                 <span class="keywordflow">else</span>
00160                 {
00161                         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a575">w</a>= srcPos-&gt;z / maxZ;
00162                         <a class="code" href="a04223.html#a575">w</a>= max(w, 0.f);
00163                         <span class="comment">// Copy and scale by MaxBendWeight</span>
00164                         dstUVBend-&gt;<a class="code" href="a03640.html#NLMISC_1_1CUVo0">U</a>= <a class="code" href="a04223.html#a575">w</a> * vbuild.MaxBendWeight;
00165                 }
00166         }
00167 
00168 
00169         <span class="comment">// Misc.</span>
00170         <span class="comment">//---------</span>
00171         <span class="comment">// prepare for instanciation</span>
00172         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1132_0">InstanceVertices</a>.resize(<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getNumVertices());
00173 
00174 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapea2" doxytag="NL3D::CVegetableShape::loadShape" ></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::CVegetableShape::loadShape </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>shape</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
load a vegetable shape (.veget), lookup into CPath, and serial
<p>
Definition at line <a class="el" href="a06702.html#l00177">177</a> of file <a class="el" href="a06702.html">vegetable_shape.cpp</a>.
<p>
References <a class="el" href="a06702.html#l00186">serial()</a>.
<p>
Referenced by <a class="el" href="a06698.html#l00781">NL3D::CVegetableManager::getVegetableShape()</a>.
<p>
<div class="fragment"><pre>00178 {
00179         string  path= CPath::lookup(shape);
00180         <span class="comment">// read this file</span>
00181         <a class="code" href="a02653.html">CIFile</a>  f(path);
00182         <a class="code" href="a03682.html#NL3D_1_1CVegetableShapea3">serial</a>(f);
00183 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapea3" doxytag="NL3D::CVegetableShape::serial" ></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::CVegetableShape::serial </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="a02270.html">NLMISC::IStream</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>f</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
serial 
<p>

<p>
Definition at line <a class="el" href="a06702.html#l00186">186</a> of file <a class="el" href="a06702.html">vegetable_shape.cpp</a>.
<p>
References <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06703.html#l00147">InstanceVertices</a>, <a class="el" href="a06463.html#l00064">NLMISC::IStream::isReading()</a>, <a class="el" href="a06462.html#l00232">NLMISC::IStream::serial()</a>, <a class="el" href="a06462.html#l00520">NLMISC::IStream::serialCheck()</a>, <a class="el" href="a06462.html#l00324">NLMISC::IStream::serialCont()</a>, <a class="el" href="a06462.html#l00261">NLMISC::IStream::serialEnum()</a>, <a class="el" href="a06461.html#l00266">NLMISC::IStream::serialVersion()</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>.
<p>
Referenced by <a class="el" href="a06702.html#l00177">loadShape()</a>.
<p>
<div class="fragment"><pre>00187 {
00188         <span class="comment">/*</span>
00189 <span class="comment">        Version 1: </span>
00190 <span class="comment">                - BestSidedPreComputeLighting</span>
00191 <span class="comment">        */</span>
00192         <a class="code" href="a04558.html#a14">sint</a>    ver= f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_8">serialVersion</a>(1);
00193         f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_0">serialCheck</a>((<a class="code" href="a04558.html#a11">uint32</a>)'_LEN');
00194         f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_0">serialCheck</a>((<a class="code" href="a04558.html#a11">uint32</a>)'GEV_');
00195         f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_0">serialCheck</a>((<a class="code" href="a04558.html#a11">uint32</a>)'BATE');
00196         f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_0">serialCheck</a>((<a class="code" href="a04558.html#a11">uint32</a>)'__EL');
00197 
00198         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(Lighted);
00199         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(DoubleSided);
00200         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(PreComputeLighting);
00201         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(AlphaBlend);
00202         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama7">serialEnum</a>(BendCenterMode);
00203         f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(VB);
00204         f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a>(TriangleIndices);
00205 
00206         <span class="keywordflow">if</span>(ver&gt;=1)
00207                 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(BestSidedPreComputeLighting);
00208         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>())
00209                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_2">BestSidedPreComputeLighting</a>= <span class="keyword">false</span>;
00210 
00211         <span class="comment">// if reading</span>
00212         <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>())
00213         {
00214                 <span class="comment">// prepare for instanciation</span>
00215                 <a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1132_0">InstanceVertices</a>.resize(<a class="code" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">VB</a>.getNumVertices());
00216         }
00217 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_0" doxytag="NL3D::CVegetableShape::AlphaBlend" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_0">NL3D::CVegetableShape::AlphaBlend</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06703.html#l00132">132</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l00817">NL3D::CVegetableManager::getRdrPassInfoForShape()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_1" doxytag="NL3D::CVegetableShape::BendCenterMode" ></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="a03683.html#NL3D_1_1CVegetableShapeBuildw3">CVegetableShapeBuild::TBendCenterMode</a> <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_1">NL3D::CVegetableShape::BendCenterMode</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06703.html#l00134">134</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_2" doxytag="NL3D::CVegetableShape::BestSidedPreComputeLighting" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_2">NL3D::CVegetableShape::BestSidedPreComputeLighting</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06703.html#l00133">133</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_3" doxytag="NL3D::CVegetableShape::DoubleSided" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_3">NL3D::CVegetableShape::DoubleSided</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06703.html#l00130">130</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l00817">NL3D::CVegetableManager::getRdrPassInfoForShape()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1132_0" doxytag="NL3D::CVegetableShape::InstanceVertices" ></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::vector&lt;<a class="el" href="a04558.html#a11">uint32</a>&gt; <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1132_0">NL3D::CVegetableShape::InstanceVertices</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
For each vertex of the shape, gives the index in the VegetableManager. 
<p>

<p>
Definition at line <a class="el" href="a06703.html#l00147">147</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06702.html#l00052">build()</a>, <a class="el" href="a06702.html#l00186">serial()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_4" doxytag="NL3D::CVegetableShape::Lighted" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_4">NL3D::CVegetableShape::Lighted</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Type of this shape. 
<p>

<p>
Definition at line <a class="el" href="a06703.html#l00129">129</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>, <a class="el" href="a06698.html#l00817">NL3D::CVegetableManager::getRdrPassInfoForShape()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_5" doxytag="NL3D::CVegetableShape::PreComputeLighting" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_5">NL3D::CVegetableShape::PreComputeLighting</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06703.html#l00131">131</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l00817">NL3D::CVegetableManager::getRdrPassInfoForShape()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_6" doxytag="NL3D::CVegetableShape::TriangleIndices" ></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::vector&lt;<a class="el" href="a04558.html#a11">uint32</a>&gt; <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_6">NL3D::CVegetableShape::TriangleIndices</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
list of triangles index 
<p>

<p>
Definition at line <a class="el" href="a06703.html#l00140">140</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, and <a class="el" href="a06698.html#l00856">NL3D::CVegetableManager::reserveIgAddInstances()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CVegetableShapez1130_7" doxytag="NL3D::CVegetableShape::VB" ></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="a03692.html">CVertexBuffer</a> <a class="el" href="a03682.html#NL3D_1_1CVegetableShapez1130_7">NL3D::CVegetableShape::VB</a>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
VertexBuffer of this Shape, ready to be transformed and copied into vegetable manager Format is Pos/Normal/Tex0/Tex1 (no Normal if !Lighted). where Tex1.U==BendWeigth
<p>
Definition at line <a class="el" href="a06703.html#l00138">138</a> of file <a class="el" href="a06703.html">vegetable_shape.h</a>.
<p>
Referenced by <a class="el" href="a06698.html#l01036">NL3D::CVegetableManager::addInstance()</a>, <a class="el" href="a06698.html#l00856">NL3D::CVegetableManager::reserveIgAddInstances()</a>, and <a class="el" href="a06698.html#l02354">NL3D::CVegetableManager::updateInstanceLighting()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a06703.html">vegetable_shape.h</a><li><a class="el" href="a06702.html">vegetable_shape.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:22:23 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>