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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
|
<!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: mesh_mrm_skin_template.cpp File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>mesh_mrm_skin_template.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
File not compiled. Included from <a class="el" href="a04586.html">mesh_mrm_skin.cpp</a>. It is a "old school" template.<p>
<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a04587.html">mesh_mrm_skin_template.cpp</a>,v 1.9 2003/12/10 12:47:33 berenguier Exp </dd></dl>
<p>
Definition in file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>.
<p>
<p>
<a href="a06010.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a3">NL3D_RAWSKIN_NORMAL_OFF</a> 12</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a0">NL3D_RAWSKIN_NORMAL_OFF</a> 12</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a4">NL3D_RAWSKIN_UV_OFF</a> 24</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a1">NL3D_RAWSKIN_UV_OFF</a> 24</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a5">NL3D_RAWSKIN_VERTEX_SIZE</a> 32</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a2">NL3D_RAWSKIN_VERTEX_SIZE</a> 32</td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a6">applyArraySkinNormalT</a> (<a class="el" href="a04558.html#a15">uint</a> numMatrixes, <a class="el" href="a04558.html#a11">uint32</a> *infPtr, CMesh::CSkinWeight *srcSkinPtr, CVector *srcVertexPtr, CVector *srcNormalPtr, <a class="el" href="a04558.html#a15">uint</a> normalOff, <a class="el" href="a04558.html#a7">uint8</a> *destVertexPtr, vector< CMatrix3x4 > &boneMat3x4, <a class="el" href="a04558.html#a15">uint</a> vertexSize, <a class="el" href="a04558.html#a15">uint</a> nInf)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a04587.html#a7">applyArraySkinTangentSpaceT</a> (<a class="el" href="a04558.html#a15">uint</a> numMatrixes, <a class="el" href="a04558.html#a11">uint32</a> *infPtr, CMesh::CSkinWeight *srcSkinPtr, CVector *srcVertexPtr, CVector *srcNormalPtr, CVector *tgSpacePtr, <a class="el" href="a04558.html#a15">uint</a> normalOff, <a class="el" href="a04558.html#a15">uint</a> tgSpaceOff, <a class="el" href="a04558.html#a7">uint8</a> *destVertexPtr, vector< CMatrix3x4 > &boneMat3x4, <a class="el" href="a04558.html#a15">uint</a> vertexSize, <a class="el" href="a04558.html#a15">uint</a> nInf)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a3" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_NORMAL_OFF" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_NORMAL_OFF 12
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00482">482</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<a class="anchor" name="a0" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_NORMAL_OFF" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_NORMAL_OFF 12
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00482">482</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_UV_OFF" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_UV_OFF 24
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00483">483</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_UV_OFF" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_UV_OFF 24
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00483">483</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_VERTEX_SIZE" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_VERTEX_SIZE 32
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00484">484</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="mesh_mrm_skin_template.cpp::NL3D_RAWSKIN_VERTEX_SIZE" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define NL3D_RAWSKIN_VERTEX_SIZE 32
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00484">484</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>. </td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a6" doxytag="mesh_mrm_skin_template.cpp::applyArraySkinNormalT" ></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 applyArraySkinNormalT </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>numMatrixes</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> * </td>
<td class="mdname" nowrap> <em>infPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CMesh::CSkinWeight * </td>
<td class="mdname" nowrap> <em>srcSkinPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CVector * </td>
<td class="mdname" nowrap> <em>srcVertexPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CVector * </td>
<td class="mdname" nowrap> <em>srcNormalPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>normalOff</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a7">uint8</a> * </td>
<td class="mdname" nowrap> <em>destVertexPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>vector< CMatrix3x4 > & </td>
<td class="mdname" nowrap> <em>boneMat3x4</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>vertexSize</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>nInf</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00036">36</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>.
<p>
References <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00039 {
00040 <span class="comment">/* Prefetch all vertex/normal before, it is to be faster.</span>
00041 <span class="comment"> */</span>
00042 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00043 <span class="preprocessor"></span> {
00044 <a class="code" href="a04558.html#a15">uint</a> nInfTmp= nInf;
00045 <a class="code" href="a04558.html#a11">uint32</a> *infTmpPtr= infPtr;
00046 <span class="keywordflow">for</span>(;nInfTmp>0;nInfTmp--, infTmpPtr++)
00047 {
00048 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infTmpPtr;
00049 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00050 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00051 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00052
00053 __asm
00054 {
00055 mov eax, srcSkin
00056 mov ebx, srcVertex
00057 mov ecx, srcNormal
00058 mov edx, [eax]
00059 mov edx, [ebx]
00060 mov edx, [ecx]
00061 }
00062
00063 }
00064 }
00065 <span class="preprocessor">#endif</span>
00066 <span class="preprocessor"></span>
00067 <span class="comment">// Process vertices.</span>
00068 <span class="keywordflow">switch</span>(numMatrixes)
00069 {
00070 <span class="comment">//=========</span>
00071 <span class="keywordflow">case</span> 0:
00072 <span class="comment">// Special case for Vertices influenced by one matrix. Just copy result of mul.</span>
00073 <span class="comment">// for all InfluencedVertices only.</span>
00074 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00075 {
00076 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00077 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00078 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00079 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00080 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00081 CVector *dstVertex= (CVector*)(dstVertexVB);
00082 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00083
00084
00085 <span class="comment">// Vertex.</span>
00086 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, *dstVertex);
00087 <span class="comment">// Normal.</span>
00088 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, *dstNormal);
00089 }
00090 <span class="keywordflow">break</span>;
00091
00092 <span class="comment">//=========</span>
00093 <span class="keywordflow">case</span> 1:
00094 <span class="comment">// for all InfluencedVertices only.</span>
00095 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00096 {
00097 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00098 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00099 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00100 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00101 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00102 CVector *dstVertex= (CVector*)(dstVertexVB);
00103 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00104
00105
00106 <span class="comment">// Vertex.</span>
00107 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00108 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00109 <span class="comment">// Normal.</span>
00110 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00111 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00112 }
00113 <span class="keywordflow">break</span>;
00114
00115 <span class="comment">//=========</span>
00116 <span class="keywordflow">case</span> 2:
00117 <span class="comment">// for all InfluencedVertices only.</span>
00118 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00119 {
00120 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00121 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00122 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00123 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00124 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00125 CVector *dstVertex= (CVector*)(dstVertexVB);
00126 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00127
00128
00129 <span class="comment">// Vertex.</span>
00130 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00131 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00132 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddPoint( *srcVertex, srcSkin->Weights[2], *dstVertex);
00133 <span class="comment">// Normal.</span>
00134 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00135 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00136 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcNormal, srcSkin->Weights[2], *dstNormal);
00137 }
00138 <span class="keywordflow">break</span>;
00139
00140 <span class="comment">//=========</span>
00141 <span class="keywordflow">case</span> 3:
00142 <span class="comment">// for all InfluencedVertices only.</span>
00143 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00144 {
00145 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00146 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00147 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00148 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00149 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00150 CVector *dstVertex= (CVector*)(dstVertexVB);
00151 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00152
00153
00154 <span class="comment">// Vertex.</span>
00155 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00156 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00157 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddPoint( *srcVertex, srcSkin->Weights[2], *dstVertex);
00158 boneMat3x4[ srcSkin->MatrixId[3] ].mulAddPoint( *srcVertex, srcSkin->Weights[3], *dstVertex);
00159 <span class="comment">// Normal.</span>
00160 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00161 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00162 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcNormal, srcSkin->Weights[2], *dstNormal);
00163 boneMat3x4[ srcSkin->MatrixId[3] ].mulAddVector( *srcNormal, srcSkin->Weights[3], *dstNormal);
00164 }
00165 <span class="keywordflow">break</span>;
00166
00167 }
00168 }
</pre></div> </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="mesh_mrm_skin_template.cpp::applyArraySkinTangentSpaceT" ></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 applyArraySkinTangentSpaceT </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>numMatrixes</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> * </td>
<td class="mdname" nowrap> <em>infPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CMesh::CSkinWeight * </td>
<td class="mdname" nowrap> <em>srcSkinPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CVector * </td>
<td class="mdname" nowrap> <em>srcVertexPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CVector * </td>
<td class="mdname" nowrap> <em>srcNormalPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>CVector * </td>
<td class="mdname" nowrap> <em>tgSpacePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>normalOff</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>tgSpaceOff</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a7">uint8</a> * </td>
<td class="mdname" nowrap> <em>destVertexPtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>vector< CMatrix3x4 > & </td>
<td class="mdname" nowrap> <em>boneMat3x4</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>vertexSize</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td>
<td class="mdname" nowrap> <em>nInf</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="a06010.html#l00173">173</a> of file <a class="el" href="a06010.html">mesh_mrm_skin_template.cpp</a>.
<p>
References <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>.
<p>
<div class="fragment"><pre>00176 {
00177 <span class="comment">/* Prefetch all vertex/normal/tgSpace before, it is faster.</span>
00178 <span class="comment"> */</span>
00179 <span class="preprocessor">#ifdef NL_OS_WINDOWS</span>
00180 <span class="preprocessor"></span> {
00181 <a class="code" href="a04558.html#a15">uint</a> nInfTmp= nInf;
00182 <a class="code" href="a04558.html#a11">uint32</a> *infTmpPtr= infPtr;
00183 <span class="keywordflow">for</span>(;nInfTmp>0;nInfTmp--, infTmpPtr++)
00184 {
00185 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infTmpPtr;
00186 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00187 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00188 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00189 CVector *srcTgSpace= tgSpacePtr + <a class="code" href="a04223.html#a566">index</a>;
00190
00191 __asm
00192 {
00193 mov eax, srcSkin
00194 mov ebx, srcVertex
00195 mov ecx, srcNormal
00196 mov esi, srcTgSpace
00197 mov edx, [eax]
00198 mov edx, [ebx]
00199 mov edx, [ecx]
00200 mov edx, [esi]
00201 }
00202
00203 }
00204 }
00205 <span class="preprocessor">#endif</span>
00206 <span class="preprocessor"></span>
00207 <span class="comment">// Process vertices.</span>
00208 <span class="keywordflow">switch</span>(numMatrixes)
00209 {
00210 <span class="comment">//=========</span>
00211 <span class="keywordflow">case</span> 0:
00212 <span class="comment">// Special case for Vertices influenced by one matrix. Just copy result of mul.</span>
00213 <span class="comment">// for all InfluencedVertices only.</span>
00214 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00215 {
00216 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00217 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00218 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00219 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00220 CVector *srcTgSpace= tgSpacePtr + <a class="code" href="a04223.html#a566">index</a>;
00221 <span class="comment">//</span>
00222 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00223 CVector *dstVertex= (CVector*)(dstVertexVB);
00224 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00225 CVector *dstTgSpace= (CVector*)(dstVertexVB + tgSpaceOff);
00226
00227
00228
00229 <span class="comment">// Vertex.</span>
00230 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, *dstVertex);
00231 <span class="comment">// Normal. </span>
00232 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, *dstNormal);
00233 <span class="comment">// Tg space</span>
00234 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcTgSpace, *dstTgSpace);
00235
00236 }
00237 <span class="keywordflow">break</span>;
00238
00239 <span class="comment">//=========</span>
00240 <span class="keywordflow">case</span> 1:
00241 <span class="comment">// for all InfluencedVertices only.</span>
00242 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00243 {
00244 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00245 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00246 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00247 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00248 CVector *srcTgSpace= tgSpacePtr + <a class="code" href="a04223.html#a566">index</a>;
00249 <span class="comment">//</span>
00250 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00251 CVector *dstVertex= (CVector*)(dstVertexVB);
00252 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00253 CVector *dstTgSpace= (CVector*)(dstVertexVB + tgSpaceOff);
00254
00255 <span class="comment">// Vertex.</span>
00256 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00257 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00258 <span class="comment">// Normal. </span>
00259 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00260 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00261 <span class="comment">// Tg space</span>
00262 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcTgSpace, srcSkin->Weights[0], *dstTgSpace);
00263 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcTgSpace, srcSkin->Weights[1], *dstTgSpace);
00264 }
00265 <span class="keywordflow">break</span>;
00266
00267 <span class="comment">//=========</span>
00268 <span class="keywordflow">case</span> 2:
00269 <span class="comment">// for all InfluencedVertices only.</span>
00270 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00271 {
00272 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00273 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00274 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00275 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00276 CVector *srcTgSpace= tgSpacePtr + <a class="code" href="a04223.html#a566">index</a>;
00277 <span class="comment">//</span>
00278 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00279 CVector *dstVertex= (CVector*)(dstVertexVB);
00280 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00281 CVector *dstTgSpace= (CVector*)(dstVertexVB + tgSpaceOff);
00282
00283 <span class="comment">// Vertex.</span>
00284 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00285 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00286 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddPoint( *srcVertex, srcSkin->Weights[2], *dstVertex);
00287 <span class="comment">// Normal. </span>
00288 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00289 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00290 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcNormal, srcSkin->Weights[2], *dstNormal);
00291 <span class="comment">// Tg space</span>
00292 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcTgSpace, srcSkin->Weights[0], *dstTgSpace);
00293 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcTgSpace, srcSkin->Weights[1], *dstTgSpace);
00294 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcTgSpace, srcSkin->Weights[2], *dstTgSpace);
00295 }
00296 <span class="keywordflow">break</span>;
00297
00298 <span class="comment">//=========</span>
00299 <span class="keywordflow">case</span> 3:
00300 <span class="comment">// for all InfluencedVertices only.</span>
00301 <span class="keywordflow">for</span>(;nInf>0;nInf--, infPtr++)
00302 {
00303 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a566">index</a>= *infPtr;
00304 CMesh::CSkinWeight *srcSkin= srcSkinPtr + <a class="code" href="a04223.html#a566">index</a>;
00305 CVector *srcVertex= srcVertexPtr + <a class="code" href="a04223.html#a566">index</a>;
00306 CVector *srcNormal= srcNormalPtr + <a class="code" href="a04223.html#a566">index</a>;
00307 CVector *srcTgSpace= tgSpacePtr + <a class="code" href="a04223.html#a566">index</a>;
00308 <span class="comment">//</span>
00309 <a class="code" href="a04558.html#a7">uint8</a> *dstVertexVB= destVertexPtr + <a class="code" href="a04223.html#a566">index</a> * vertexSize;
00310 CVector *dstVertex= (CVector*)(dstVertexVB);
00311 CVector *dstNormal= (CVector*)(dstVertexVB + normalOff);
00312 CVector *dstTgSpace= (CVector*)(dstVertexVB + tgSpaceOff);
00313
00314 <span class="comment">// Vertex.</span>
00315 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetPoint( *srcVertex, srcSkin->Weights[0], *dstVertex);
00316 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddPoint( *srcVertex, srcSkin->Weights[1], *dstVertex);
00317 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddPoint( *srcVertex, srcSkin->Weights[2], *dstVertex);
00318 boneMat3x4[ srcSkin->MatrixId[3] ].mulAddPoint( *srcVertex, srcSkin->Weights[3], *dstVertex);
00319 <span class="comment">// Normal. </span>
00320 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcNormal, srcSkin->Weights[0], *dstNormal);
00321 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcNormal, srcSkin->Weights[1], *dstNormal);
00322 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcNormal, srcSkin->Weights[2], *dstNormal);
00323 boneMat3x4[ srcSkin->MatrixId[3] ].mulAddVector( *srcNormal, srcSkin->Weights[3], *dstNormal);
00324 <span class="comment">// Tg space</span>
00325 boneMat3x4[ srcSkin->MatrixId[0] ].mulSetVector( *srcTgSpace, srcSkin->Weights[0], *dstTgSpace);
00326 boneMat3x4[ srcSkin->MatrixId[1] ].mulAddVector( *srcTgSpace, srcSkin->Weights[1], *dstTgSpace);
00327 boneMat3x4[ srcSkin->MatrixId[2] ].mulAddVector( *srcTgSpace, srcSkin->Weights[2], *dstTgSpace);
00328 boneMat3x4[ srcSkin->MatrixId[3] ].mulAddVector( *srcTgSpace, srcSkin->Weights[3], *dstTgSpace);
00329 }
00330 <span class="keywordflow">break</span>;
00331
00332 }
00333
00334 }
</pre></div> </td>
</tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:42:59 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>
|