aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a02207.html
blob: 87ad07c932c65cc695e8fa1365de7c3503259e62 (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
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
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
<!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::CAnimationOptimizer 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::CAnimationOptimizer Class Reference</h1><code>#include &lt;<a class="el" href="a05446.html">animation_optimizer.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Purpose of this class is to optimize for memory and speed a <a class="el" href="a02205.html">CAnimation</a>. Quaternion tracks are optimized. They are transformed to <a class="el" href="a03591.html">CTrackSampledQuat</a> or <a class="el" href="a03548.html">CTrackDefaultQuat</a>. Vector tracks are optimized. They are transformed to <a class="el" href="a03593.html">CTrackSampledVector</a> or <a class="el" href="a03551.html">CTrackDefaultVector</a>. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a05446.html#l00054">54</a> of file <a class="el" href="a05446.html">animation_optimizer.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="a02207.html#NL3D_1_1CAnimationOptimizera0">addLowPrecisionTrack</a> (const std::string &amp;name)</td></tr>

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

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#NL3D_1_1CAnimationOptimizera1"></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="a02207.html#NL3D_1_1CAnimationOptimizera2">clearLowPrecisionTracks</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">see addLowPrecisionTrack. This clear the array.  <a href="#NL3D_1_1CAnimationOptimizera2"></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="a02207.html#NL3D_1_1CAnimationOptimizera3">optimize</a> (const <a class="el" href="a02205.html">CAnimation</a> &amp;animIn, <a class="el" href="a02205.html">CAnimation</a> &amp;animOut)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera4">setQuaternionThreshold</a> (double lowPrecThre, double highPrecThre)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera5">setSampleFrameRate</a> (float frameRate)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera6">setVectorThreshold</a> (double lowPrecThre, double highPrecThre)</td></tr>

<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03542.html">ITrack</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerd0">cloneTrack</a> (const <a class="el" href="a03542.html">ITrack</a> *trackIn)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerd1">isLowPrecisionTrack</a> (const std::string &amp;trackName)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerd2">isTrackOptimisable</a> (const <a class="el" href="a03542.html">ITrack</a> *trackIn)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03542.html">ITrack</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerd3">optimizeTrack</a> (const <a class="el" href="a03542.html">ITrack</a> *trackIn)</td></tr>

<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_0">nearlySameQuaternion</a> (const <a class="el" href="a03298.html">CQuatD</a> &amp;quat0, const <a class="el" href="a03298.html">CQuatD</a> &amp;quat1)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_1">optimizeQuatTrack</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_2">sampleQuatTrack</a> (const <a class="el" href="a03542.html">ITrack</a> *trackIn, float beginTime, float endTime, <a class="el" href="a04558.html#a15">uint</a> numSamples)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_3">testConstantQuatTrack</a> ()</td></tr>

<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_0">nearlySameVector</a> (const <a class="el" href="a03664.html">CVectorD</a> &amp;v0, const <a class="el" href="a03664.html">CVectorD</a> &amp;v1)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_1">optimizeVectorTrack</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_2">sampleVectorTrack</a> (const <a class="el" href="a03542.html">ITrack</a> *trackIn, float beginTime, float endTime, <a class="el" href="a04558.html#a15">uint</a> numSamples)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_3">testConstantVectorTrack</a> ()</td></tr>

<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; std::string &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr0">_LowPrecTrackKeyName</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr1">_QuaternionThreshold</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr2">_QuaternionThresholdHighPrec</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr3">_QuaternionThresholdLowPrec</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a03296.html">CQuat</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr5">_SampleFrameRate</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a04558.html#a9">uint16</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector&lt; <a class="el" href="a03128.html">CVector</a> &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr8">_VectorThreshold</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr9">_VectorThresholdHighPrec</a></td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>double&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr10">_VectorThresholdLowPrec</a></td></tr>

</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera1" doxytag="NL3D::CAnimationOptimizer::CAnimationOptimizer" ></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::CAnimationOptimizer::CAnimationOptimizer </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="a05445.html#l00047">47</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00108">_QuaternionThresholdHighPrec</a>, <a class="el" href="a05446.html#l00107">_QuaternionThresholdLowPrec</a>, <a class="el" href="a05446.html#l00106">_SampleFrameRate</a>, <a class="el" href="a05446.html#l00111">_VectorThresholdHighPrec</a>, and <a class="el" href="a05446.html#l00110">_VectorThresholdLowPrec</a>.
<p>
<div class="fragment"><pre>00048 {
00049         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr5">_SampleFrameRate</a>= 30;
00050         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr3">_QuaternionThresholdLowPrec</a>= 1.0 - 0.0001;
00051         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr2">_QuaternionThresholdHighPrec</a>= 1.0 - 0.000001;
00052         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr10">_VectorThresholdLowPrec</a>= 0.001;
00053         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr9">_VectorThresholdHighPrec</a>= 0.0001;
00054 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera0" doxytag="NL3D::CAnimationOptimizer::addLowPrecisionTrack" ></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::CAnimationOptimizer::addLowPrecisionTrack </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>name</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>
see <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera4">setQuaternionThreshold()</a>. Any track which contains this name will be considered as a Low precision track. Default setup is empty, so all track are "high precision" track. A good setup is for example addLowPrecisionTrack("Finger") and addLowPrecisionTrack("Ponytail") Warning: case sensitive
<p>
Definition at line <a class="el" href="a05445.html#l00599">599</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00116">_LowPrecTrackKeyName</a>.
<p>
<div class="fragment"><pre>00600 {
00601         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr0">_LowPrecTrackKeyName</a>.push_back(name);
00602 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera2" doxytag="NL3D::CAnimationOptimizer::clearLowPrecisionTracks" ></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::CAnimationOptimizer::clearLowPrecisionTracks </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>
see addLowPrecisionTrack. This clear the array. 
<p>

<p>
Definition at line <a class="el" href="a05445.html#l00605">605</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00116">_LowPrecTrackKeyName</a>.
<p>
<div class="fragment"><pre>00606 {
00607         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr0">_LowPrecTrackKeyName</a>.clear();
00608 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerd0" doxytag="NL3D::CAnimationOptimizer::cloneTrack" ></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="a03542.html">ITrack</a> * NL3D::CAnimationOptimizer::cloneTrack </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03542.html">ITrack</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>trackIn</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </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="a05445.html#l00138">138</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05979.html#l00331">NLMISC::CMemStream::invert()</a>, and <a class="el" href="a06462.html#l00492">NLMISC::IStream::serialPolyPtr()</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00086">optimize()</a>, and <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00139 {
00140         <a class="code" href="a02271.html">CMemStream</a>      memStream;
00141 
00142         <span class="comment">// write to the stream.</span>
00143         ITrack  *trackInSerial= const_cast&lt;ITrack*&gt;(trackIn);
00144         memStream.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_6">serialPolyPtr</a>(trackInSerial);
00145 
00146         <span class="comment">// read from the stream.</span>
00147         memStream.<a class="code" href="a02271.html#NLMISC_1_1CStringStreama12">invert</a>();
00148         ITrack  *ret= NULL;
00149         memStream.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_6">serialPolyPtr</a>(ret);
00150 
00151         <span class="keywordflow">return</span> ret;
00152 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerd1" doxytag="NL3D::CAnimationOptimizer::isLowPrecisionTrack" ></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 NL3D::CAnimationOptimizer::isLowPrecisionTrack </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>trackName</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </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="a05445.html#l00611">611</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00116">_LowPrecTrackKeyName</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00086">optimize()</a>.
<p>
<div class="fragment"><pre>00612 {
00613         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i&lt;<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr0">_LowPrecTrackKeyName</a>.size(); i++)
00614         {
00615                 <span class="comment">// if find a substr of the key, it is a low prec track</span>
00616                 <span class="keywordflow">if</span>( trackName.find(_LowPrecTrackKeyName[i]) != string::npos )
00617                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00618         }
00619 
00620         <span class="comment">// no key found</span>
00621         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00622 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerd2" doxytag="NL3D::CAnimationOptimizer::isTrackOptimisable" ></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 NL3D::CAnimationOptimizer::isTrackOptimisable </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03542.html">ITrack</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>trackIn</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </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="a05445.html#l00156">156</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00086">optimize()</a>.
<p>
<div class="fragment"><pre>00157 {
00158         <a class="code" href="a04199.html#a6">nlassert</a>(trackIn);
00159 
00160         <span class="comment">// If the track is a Linear, Bezier or a TCB track, suppose we can optimize it. Constant may not be interressant....</span>
00161         <span class="keywordflow">if</span>(     dynamic_cast&lt;const CTrackKeyFramerTCBQuat*&gt;(trackIn) || 
00162                 dynamic_cast&lt;const CTrackKeyFramerBezierQuat*&gt;(trackIn) ||
00163                 dynamic_cast&lt;const CTrackKeyFramerLinearQuat*&gt;(trackIn) )
00164                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00165 
00166         <span class="comment">// If the track is a Linear, Bezier or a TCB track, suppose we can optimize it. Constant may not be interressant....</span>
00167         <span class="keywordflow">if</span>(     dynamic_cast&lt;const CTrackKeyFramerTCBVector*&gt;(trackIn) || 
00168                 dynamic_cast&lt;const CTrackKeyFramerBezierVector*&gt;(trackIn) ||
00169                 dynamic_cast&lt;const CTrackKeyFramerLinearVector*&gt;(trackIn) )
00170                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00171 
00172         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00173 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz28_0" doxytag="NL3D::CAnimationOptimizer::nearlySameQuaternion" ></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 NL3D::CAnimationOptimizer::nearlySameQuaternion </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03298.html">CQuatD</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>quat0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03298.html">CQuatD</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>quat1</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
return true if suppose same quaternion. NB: quaternion must be normalized. NB: test if quat1==quat0 or quat1==-quat0 of course.
<p>
Definition at line <a class="el" href="a05445.html#l00423">423</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00109">_QuaternionThreshold</a>, <a class="el" href="a06308.html#l00139">NLMISC::CQuatT&lt; double &gt;::conjugate()</a>, and <a class="el" href="a06308.html#l00077">NLMISC::CQuatT&lt; double &gt;::w</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00341">optimizeQuatTrack()</a>, and <a class="el" href="a05445.html#l00321">testConstantQuatTrack()</a>.
<p>
<div class="fragment"><pre>00424 {
00425         <span class="comment">// true if exactly same, or exactly inverse</span>
00426         <span class="keywordflow">if</span>(quat0==quat1 || quat0==-quat1)
00427                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00428 
00429         <span class="comment">// Else compute the rotation to go from qRef to q. Use double for better presion.</span>
00430         <a class="code" href="a03298.html">CQuatD</a>  quatDif;
00431         quatDif= quat1 * quat0.<a class="code" href="a03297.html#NLMISC_1_1CQuatTz2008_0">conjugate</a>();
00432         <span class="comment">// inverse the quaternion if necessary. ie make closest to the identity quaternion.</span>
00433         <span class="keywordflow">if</span>(quatDif.<a class="code" href="a03297.html#NLMISC_1_1CQuatTo0">w</a>&lt;0)
00434                 quatDif= -quatDif;
00435 
00436         <span class="comment">// compare "angle threshold"</span>
00437         <span class="keywordflow">return</span> (quatDif.<a class="code" href="a03297.html#NLMISC_1_1CQuatTo0">w</a> &gt;= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr1">_QuaternionThreshold</a>);
00438 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz29_0" doxytag="NL3D::CAnimationOptimizer::nearlySameVector" ></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 NL3D::CAnimationOptimizer::nearlySameVector </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03664.html">CVectorD</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>v0</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="a03664.html">CVectorD</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>v1</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
return true if suppose same vector.
<p>
Definition at line <a class="el" href="a05445.html#l00576">576</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00112">_VectorThreshold</a>, and <a class="el" href="a06685.html#l00115">NLMISC::CVectorD::norm()</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00499">optimizeVectorTrack()</a>, and <a class="el" href="a05445.html#l00479">testConstantVectorTrack()</a>.
<p>
<div class="fragment"><pre>00577 {
00578         <span class="comment">// true if exactly same</span>
00579         <span class="keywordflow">if</span>(v0==v1)
00580                 <span class="keywordflow">return</span> <span class="keyword">true</span>;
00581 
00582         <span class="comment">// Else compute the dif, use double for better precision</span>
00583         <a class="code" href="a03664.html">CVectorD</a>        vDif;
00584         vDif= v1-v0;
00585 
00586         <span class="comment">// compare norm</span>
00587         <span class="keywordflow">return</span> (vDif.<a class="code" href="a03664.html#NLMISC_1_1CVectorDz2077_0">norm</a>() &lt;= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr8">_VectorThreshold</a>);
00588 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera3" doxytag="NL3D::CAnimationOptimizer::optimize" ></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::CAnimationOptimizer::optimize </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a02205.html">CAnimation</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>animIn</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="a02205.html">CAnimation</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>animOut</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
optimize an animation animOut is the same as animIn, but optimized. If a track can't be optimized, it is just duplicated in animOut.
<p>
Definition at line <a class="el" href="a05445.html#l00086">86</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00109">_QuaternionThreshold</a>, <a class="el" href="a05446.html#l00108">_QuaternionThresholdHighPrec</a>, <a class="el" href="a05446.html#l00107">_QuaternionThresholdLowPrec</a>, <a class="el" href="a05446.html#l00112">_VectorThreshold</a>, <a class="el" href="a05446.html#l00111">_VectorThresholdHighPrec</a>, <a class="el" href="a05446.html#l00110">_VectorThresholdLowPrec</a>, <a class="el" href="a05443.html#l00064">NL3D::CAnimation::addTrack()</a>, <a class="el" href="a05445.html#l00138">cloneTrack()</a>, <a class="el" href="a05443.html#l00157">NL3D::CAnimation::getEndTime()</a>, <a class="el" href="a05444.html#l00077">NL3D::CAnimation::getIdTrackByName()</a>, <a class="el" href="a05444.html#l00103">NL3D::CAnimation::getTrack()</a>, <a class="el" href="a05443.html#l00108">NL3D::CAnimation::getTrackNames()</a>, <a class="el" href="a05445.html#l00611">isLowPrecisionTrack()</a>, <a class="el" href="a05445.html#l00156">isTrackOptimisable()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05445.html#l00177">optimizeTrack()</a>, <a class="el" href="a05443.html#l00251">NL3D::CAnimation::setMinEndTime()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
<div class="fragment"><pre>00087 {
00088         <span class="comment">// reset animOut</span>
00089         <a class="code" href="a05378.html#a381">contReset</a>(animOut);
00090 
00091         <span class="comment">// Parse all tracks of the animation.</span>
00092         set&lt;string&gt;             setString;
00093         animIn.getTrackNames (setString);
00094         set&lt;string&gt;::iterator   it;
00095 
00096         <span class="keywordflow">for</span>(it=setString.begin();it!=setString.end();it++)
00097         {
00098                 <span class="keyword">const</span> string    &amp;trackName= *it;
00099                 <a class="code" href="a04558.html#a15">uint</a>    trackId= animIn.getIdTrackByName(trackName);
00100                 <a class="code" href="a04199.html#a6">nlassert</a>(trackId!=CAnimation::NotFound);
00101                 <span class="keyword">const</span> ITrack    *track= animIn.getTrack(trackId);
00102 
00103                 <span class="comment">// If the track is optimisable.</span>
00104                 ITrack  *newTrack;
00105                 <span class="keywordflow">if</span>(<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerd2">isTrackOptimisable</a>(track))
00106                 {
00107                         <span class="comment">// choose the threshold according to precision wanted</span>
00108                         <span class="keywordflow">if</span>( <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerd1">isLowPrecisionTrack</a>(trackName) )
00109                         {
00110                                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr1">_QuaternionThreshold</a>= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr3">_QuaternionThresholdLowPrec</a>;
00111                                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr8">_VectorThreshold</a>= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr10">_VectorThresholdLowPrec</a>;
00112                         }
00113                         <span class="keywordflow">else</span>
00114                         {
00115                                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr1">_QuaternionThreshold</a>= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr2">_QuaternionThresholdHighPrec</a>;
00116                                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr8">_VectorThreshold</a>= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr9">_VectorThresholdHighPrec</a>;
00117                         }
00118 
00119                         <span class="comment">// optimize it.</span>
00120                         newTrack= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerd3">optimizeTrack</a>(track);
00121                 }
00122                 <span class="keywordflow">else</span>
00123                 {
00124                         <span class="comment">// just clone it.</span>
00125                         newTrack= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerd0">cloneTrack</a>(track);
00126                 }
00127 
00128                 <span class="comment">// Add it to the animation</span>
00129                 animOut.addTrack(trackName, newTrack);
00130         }
00131 
00132         <span class="comment">// Set min animation length</span>
00133         animOut.setMinEndTime (animIn.getEndTime ());
00134         <a class="code" href="a04199.html#a6">nlassert</a> (animOut.getEndTime() == animIn.getEndTime());
00135 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz28_1" doxytag="NL3D::CAnimationOptimizer::optimizeQuatTrack" ></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::CAnimationOptimizer::optimizeQuatTrack </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><code> [private]</code></td>
        </tr>

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

<p>
optimze the current track
<p>
Definition at line <a class="el" href="a05445.html#l00341">341</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00120">_QuatKeyList</a>, <a class="el" href="a05446.html#l00119">_TimeList</a>, <a class="el" href="a05445.html#l00423">nearlySameQuaternion()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00342 {
00343         <a class="code" href="a04558.html#a15">uint</a>    numSamples= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>.size();
00344         <a class="code" href="a04199.html#a6">nlassert</a>(numSamples&gt;0);
00345 
00346         <span class="comment">// &lt;=2 key? =&gt; no opt possible..</span>
00347         <span class="keywordflow">if</span>(numSamples&lt;=2)
00348                 <span class="keywordflow">return</span>;
00349 
00350         <span class="comment">// prepare dest opt</span>
00351         std::vector&lt;uint16&gt;             optTimeList;
00352         std::vector&lt;CQuat&gt;              optKeyList;
00353         optTimeList.reserve(numSamples);
00354         optKeyList.reserve(numSamples);
00355 
00356         <span class="comment">// Add the first key.</span>
00357         optTimeList.push_back(_TimeList[0]);
00358         optKeyList.push_back(_QuatKeyList[0]);
00359         <span class="keywordtype">double</span>  timeRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>[0];
00360         <a class="code" href="a03298.html">CQuatD</a>  quatRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>[0];
00361 
00362         <span class="comment">// For all keys, but the first and the last, test if can remove them.</span>
00363         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=1; i&lt;numSamples-1; i++)
00364         {
00365                 <a class="code" href="a03298.html">CQuatD</a>  quatCur= _QuatKeyList[i];
00366                 <a class="code" href="a03298.html">CQuatD</a>  quatNext= _QuatKeyList[i+1];
00367                 <span class="keywordtype">double</span>  timeCur= _TimeList[i];
00368                 <span class="keywordtype">double</span>  timeNext= _TimeList[i+1];
00369 
00370                 <span class="comment">// must add the key?</span>
00371                 <span class="keywordtype">bool</span>    mustAdd= <span class="keyword">false</span>;
00372 
00373                 <span class="comment">// If the Delta time are too big, abort (CTrackSampledQuat limitation)</span>
00374                 <span class="keywordflow">if</span>(timeNext-timeRef&gt;255)
00375                 {
00376                         mustAdd= <span class="keyword">true</span>;
00377                 }
00378                 <span class="comment">// If the next quaternion or the current quaternion are not on same hemisphere than ref, abort.</span>
00379                 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( <a class="code" href="a03297.html#NLMISC_1_1CQuatTz2014_0">CQuatD::dotProduct</a>(quatCur, quatRef)&lt;0 || <a class="code" href="a03297.html#NLMISC_1_1CQuatTz2014_0">CQuatD::dotProduct</a>(quatNext, quatRef)&lt;0 )
00380                 {
00381                         mustAdd= <span class="keyword">true</span>;
00382                 }
00383                 <span class="comment">// else, test interpolation</span>
00384                 <span class="keywordflow">else</span>
00385                 {
00386                         <span class="comment">// If the 3 quats are nearly equals, it is ok (avoid interpolation)</span>
00387                         <span class="keywordflow">if</span>( <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_0">nearlySameQuaternion</a>(quatRef, quatCur) &amp;&amp; <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_0">nearlySameQuaternion</a>(quatRef, quatNext) )
00388                                 mustAdd= <span class="keyword">false</span>;
00389                         <span class="keywordflow">else</span>
00390                         {
00391                                 <span class="comment">// interpolate.</span>
00392                                 <a class="code" href="a03298.html">CQuatD</a>  quatInterpolated;
00393                                 <span class="keywordtype">double</span>  <a class="code" href="a04223.html#a627">t</a>= (timeCur-timeRef)/(timeNext/timeRef);
00394                                 quatInterpolated= <a class="code" href="a03297.html#NLMISC_1_1CQuatTz2014_2">CQuatD::slerp</a>(quatRef, quatNext, (<span class="keywordtype">float</span>)t);
00395 
00396                                 <span class="comment">// test if cur and interpolate are equal.</span>
00397                                 <span class="keywordflow">if</span>( !<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_0">nearlySameQuaternion</a>(quatCur, quatInterpolated) )
00398                                         mustAdd= <span class="keyword">true</span>;
00399                         }
00400                 }
00401 
00402                 <span class="comment">// If must add the key to the optimized track.</span>
00403                 <span class="keywordflow">if</span>(mustAdd)
00404                 {
00405                         optTimeList.push_back(_TimeList[i]);
00406                         optKeyList.push_back(_QuatKeyList[i]);
00407                         timeRef= _TimeList[i];
00408                         quatRef= _QuatKeyList[i];
00409                 }
00410         }
00411 
00412         <span class="comment">// Add the last key.</span>
00413         optTimeList.push_back(_TimeList[numSamples-1]);
00414         optKeyList.push_back(_QuatKeyList[numSamples-1]);
00415 
00416         <span class="comment">// copy the optimized track to the main one.</span>
00417         _TimeList= optTimeList;
00418         _QuatKeyList= optKeyList;
00419 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerd3" doxytag="NL3D::CAnimationOptimizer::optimizeTrack" ></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="a03542.html">ITrack</a> * NL3D::CAnimationOptimizer::optimizeTrack </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03542.html">ITrack</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>trackIn</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </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="a05445.html#l00177">177</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00120">_QuatKeyList</a>, <a class="el" href="a05446.html#l00106">_SampleFrameRate</a>, <a class="el" href="a05446.html#l00119">_TimeList</a>, <a class="el" href="a05446.html#l00123">_VectorKeyList</a>, <a class="el" href="a06564.html#l00079">NL3D::CTrackSampledVector::build()</a>, <a class="el" href="a06562.html#l00159">NL3D::CTrackSampledQuat::build()</a>, <a class="el" href="a05445.html#l00138">cloneTrack()</a>, <a class="el" href="a03881.html#NL3D_1_1UTrackz1572_0">NL3D::UTrack::getBeginTime()</a>, <a class="el" href="a03881.html#NL3D_1_1UTrackz1572_1">NL3D::UTrack::getEndTime()</a>, <a class="el" href="a03542.html#NL3D_1_1ITracka2">NL3D::ITrack::getLoopMode()</a>, <a class="el" href="a03542.html#NL3D_1_1ITrackKeyFramer_3_01CKeyVector_01_4a11">NL3D::ITrack::getValue()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00416">nlstop</a>, <a class="el" href="a05445.html#l00341">optimizeQuatTrack()</a>, <a class="el" href="a05445.html#l00499">optimizeVectorTrack()</a>, <a class="el" href="a05445.html#l00282">sampleQuatTrack()</a>, <a class="el" href="a05445.html#l00449">sampleVectorTrack()</a>, <a class="el" href="a06560.html#l00204">NL3D::CTrackSampledCommon::setLoopMode()</a>, <a class="el" href="a06556.html#l00162">NL3D::CTrackDefaultBlendable&lt; CVector &gt;::setValue()</a>, <a class="el" href="a06556.html#l00162">NL3D::CTrackDefaultBlendable&lt; CQuat &gt;::setValue()</a>, <a class="el" href="a05445.html#l00321">testConstantQuatTrack()</a>, <a class="el" href="a05445.html#l00479">testConstantVectorTrack()</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00086">optimize()</a>.
<p>
<div class="fragment"><pre>00178 {
00179         <span class="comment">// Get track param.</span>
00180         <span class="keywordtype">float</span> beginTime= trackIn-&gt;getBeginTime();
00181         <span class="keywordtype">float</span> endTime= trackIn-&gt;getEndTime();
00182         <a class="code" href="a04199.html#a6">nlassert</a>(endTime&gt;=beginTime);
00183 
00184         <span class="comment">// Get num Sample </span>
00185         <a class="code" href="a04558.html#a15">uint</a>    numSamples= (<a class="code" href="a04558.html#a15">uint</a>)ceil( (endTime-beginTime)*_SampleFrameRate);
00186         numSamples= max(1U, numSamples);
00187         <a class="code" href="a04199.html#a6">nlassert</a>(numSamples&lt;65535);
00188 
00189 
00190         <span class="comment">// Optimize Quaternion track??</span>
00191         <span class="comment">//================</span>
00192         <span class="keywordflow">if</span>( dynamic_cast&lt;const CAnimatedValueQuat *&gt;(&amp;trackIn-&gt;getValue()) )
00193         {
00194                 <span class="comment">// sample the animation. Store result in _TimeList/_QuatKeyList</span>
00195                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_2">sampleQuatTrack</a>(trackIn, beginTime, endTime, numSamples);
00196 
00197                 <span class="comment">// check if the sampled track can be reduced to a TrackDefaultQuat. Test _QuatKeyList.</span>
00198                 <span class="keywordflow">if</span>( <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_3">testConstantQuatTrack</a>() )
00199                 {
00200                         <span class="comment">// create a default Track Quat.</span>
00201                         CTrackDefaultQuat       *trackDefault= <span class="keyword">new</span> CTrackDefaultQuat;
00202                         <span class="comment">// setup the uniform value.</span>
00203                         trackDefault-&gt;setValue(_QuatKeyList[0]);
00204 
00205                         <span class="comment">// return the result.</span>
00206                         <span class="keywordflow">return</span> trackDefault;
00207                 }
00208                 <span class="comment">// else optimize the sampled animation, and build.</span>
00209                 <span class="keywordflow">else</span>
00210                 {
00211                         <span class="comment">// optimize.</span>
00212                         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_1">optimizeQuatTrack</a>();
00213 
00214                         <span class="comment">// Create a sampled quaternion track</span>
00215                         CTrackSampledQuat       *trackSQ= <span class="keyword">new</span> CTrackSampledQuat;
00216 
00217                         <span class="comment">// Copy loop from track.</span>
00218                         trackSQ-&gt;setLoopMode(trackIn-&gt;getLoopMode());
00219 
00220                         <span class="comment">// Build it.</span>
00221                         trackSQ-&gt;build(_TimeList, _QuatKeyList, beginTime, endTime);
00222 
00223                         <span class="comment">// return result.</span>
00224                         <span class="keywordflow">return</span> trackSQ;
00225                 }
00226         }
00227         <span class="comment">// Optimize Position track??</span>
00228         <span class="comment">//================</span>
00229         <span class="keywordflow">else</span> <span class="keywordflow">if</span>( dynamic_cast&lt;const CAnimatedValueVector *&gt;(&amp;trackIn-&gt;getValue()) )
00230         {
00231                 <span class="comment">// sample the animation. Store result in _TimeList/_VectorKeyList</span>
00232                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_2">sampleVectorTrack</a>(trackIn, beginTime, endTime, numSamples);
00233 
00234                 <span class="comment">// check if the sampled track can be reduced to a TrackDefaultVector. Test _VectorKeyList.</span>
00235                 <span class="keywordflow">if</span>( <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_3">testConstantVectorTrack</a>() )
00236                 {
00237                         <span class="comment">// create a default Track Vector.</span>
00238                         CTrackDefaultVector     *trackDefault= <span class="keyword">new</span> CTrackDefaultVector;
00239                         <span class="comment">// setup the uniform value.</span>
00240                         trackDefault-&gt;setValue(_VectorKeyList[0]);
00241 
00242                         <span class="comment">// return the result.</span>
00243                         <span class="keywordflow">return</span> trackDefault;
00244                 }
00245                 <span class="comment">// else optimize the sampled animation, and build.</span>
00246                 <span class="keywordflow">else</span>
00247                 {
00248                         <span class="comment">// optimize.</span>
00249                         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_1">optimizeVectorTrack</a>();
00250 
00251                         <span class="comment">// Create a sampled Vector track</span>
00252                         CTrackSampledVector     *trackSV= <span class="keyword">new</span> CTrackSampledVector;
00253 
00254                         <span class="comment">// Copy loop from track.</span>
00255                         trackSV-&gt;setLoopMode(trackIn-&gt;getLoopMode());
00256 
00257                         <span class="comment">// Build it.</span>
00258                         trackSV-&gt;build(_TimeList, _VectorKeyList, beginTime, endTime);
00259 
00260                         <span class="comment">// return result.</span>
00261                         <span class="keywordflow">return</span> trackSV;
00262                 }
00263         }
00264         <span class="keywordflow">else</span>
00265         {
00266                 <span class="comment">// Must be a quaternion track or vector track for now.</span>
00267                 <a class="code" href="a04199.html#a12">nlstop</a>;
00268                 <span class="comment">// Avoid warning.</span>
00269                 <span class="keywordflow">return</span> <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerd0">cloneTrack</a>(trackIn);
00270         }
00271 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz29_1" doxytag="NL3D::CAnimationOptimizer::optimizeVectorTrack" ></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::CAnimationOptimizer::optimizeVectorTrack </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><code> [private]</code></td>
        </tr>

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

<p>
optimze the current track
<p>
Definition at line <a class="el" href="a05445.html#l00499">499</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00119">_TimeList</a>, <a class="el" href="a05446.html#l00123">_VectorKeyList</a>, <a class="el" href="a05445.html#l00576">nearlySameVector()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00500 {
00501         <a class="code" href="a04558.html#a15">uint</a>    numSamples= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>.size();
00502         <a class="code" href="a04199.html#a6">nlassert</a>(numSamples&gt;0);
00503 
00504         <span class="comment">// &lt;=2 key? =&gt; no opt possible..</span>
00505         <span class="keywordflow">if</span>(numSamples&lt;=2)
00506                 <span class="keywordflow">return</span>;
00507 
00508         <span class="comment">// prepare dest opt</span>
00509         std::vector&lt;uint16&gt;             optTimeList;
00510         std::vector&lt;CVector&gt;    optKeyList;
00511         optTimeList.reserve(numSamples);
00512         optKeyList.reserve(numSamples);
00513 
00514         <span class="comment">// Add the first key.</span>
00515         optTimeList.push_back(_TimeList[0]);
00516         optKeyList.push_back(_VectorKeyList[0]);
00517         <span class="keywordtype">double</span>          timeRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>[0];
00518         <a class="code" href="a03664.html">CVectorD</a>        vectorRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>[0];
00519 
00520         <span class="comment">// For all keys, but the first and the last, test if can remove them.</span>
00521         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=1; i&lt;numSamples-1; i++)
00522         {
00523                 <a class="code" href="a03664.html">CVectorD</a>        vectorCur= _VectorKeyList[i];
00524                 <a class="code" href="a03664.html">CVectorD</a>        vectorNext= _VectorKeyList[i+1];
00525                 <span class="keywordtype">double</span>  timeCur= _TimeList[i];
00526                 <span class="keywordtype">double</span>  timeNext= _TimeList[i+1];
00527 
00528                 <span class="comment">// must add the key?</span>
00529                 <span class="keywordtype">bool</span>    mustAdd= <span class="keyword">false</span>;
00530 
00531                 <span class="comment">// If the Delta time are too big, abort (CTrackSampledVector limitation)</span>
00532                 <span class="keywordflow">if</span>(timeNext-timeRef&gt;255)
00533                 {
00534                         mustAdd= <span class="keyword">true</span>;
00535                 }
00536                 <span class="comment">// else, test interpolation</span>
00537                 <span class="keywordflow">else</span>
00538                 {
00539                         <span class="comment">// If the 3 Vectors are nearly equals, it is ok (avoid interpolation)</span>
00540                         <span class="keywordflow">if</span>( <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_0">nearlySameVector</a>(vectorRef, vectorCur) &amp;&amp; <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_0">nearlySameVector</a>(vectorRef, vectorNext) )
00541                                 mustAdd= <span class="keyword">false</span>;
00542                         <span class="keywordflow">else</span>
00543                         {
00544                                 <span class="comment">// interpolate.</span>
00545                                 <a class="code" href="a03664.html">CVectorD</a>        vectorInterpolated;
00546                                 <span class="keywordtype">double</span>  <a class="code" href="a04223.html#a627">t</a>= (timeCur-timeRef)/(timeNext/timeRef);
00547                                 vectorInterpolated= vectorRef*(1-<a class="code" href="a04223.html#a627">t</a>) + vectorNext*<a class="code" href="a04223.html#a627">t</a>;
00548 
00549                                 <span class="comment">// test if cur and interpolate are equal.</span>
00550                                 <span class="keywordflow">if</span>( !<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_0">nearlySameVector</a>(vectorCur, vectorInterpolated) )
00551                                         mustAdd= <span class="keyword">true</span>;
00552                         }
00553                 }
00554 
00555                 <span class="comment">// If must add the key to the optimized track.</span>
00556                 <span class="keywordflow">if</span>(mustAdd)
00557                 {
00558                         optTimeList.push_back(_TimeList[i]);
00559                         optKeyList.push_back(_VectorKeyList[i]);
00560                         timeRef= _TimeList[i];
00561                         vectorRef= _VectorKeyList[i];
00562                 }
00563         }
00564 
00565         <span class="comment">// Add the last key.</span>
00566         optTimeList.push_back(_TimeList[numSamples-1]);
00567         optKeyList.push_back(_VectorKeyList[numSamples-1]);
00568 
00569         <span class="comment">// copy the optimized track to the main one.</span>
00570         _TimeList= optTimeList;
00571         _VectorKeyList= optKeyList;
00572 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz28_2" doxytag="NL3D::CAnimationOptimizer::sampleQuatTrack" ></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::CAnimationOptimizer::sampleQuatTrack </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03542.html">ITrack</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>trackIn</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>beginTime</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>endTime</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>&nbsp;</td>
          <td class="mdname" nowrap> <em>numSamples</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
sample the track from beginTime to endTime, sample to numSamples, such that key[0].Time==beginTime and key[numSamples-1].Time==endTime. NB: quaternion are normalized, and are makeClosest()-ed from sample to the next.
<p>
Definition at line <a class="el" href="a05445.html#l00282">282</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00120">_QuatKeyList</a>, <a class="el" href="a05446.html#l00119">_TimeList</a>, <a class="el" href="a03297.html#NLMISC_1_1CQuatTz2012_2">NLMISC::CQuatT&lt; float &gt;::makeClosest()</a>, <a class="el" href="a03297.html#NLMISC_1_1CQuatTz2006_1">NLMISC::CQuatT&lt; float &gt;::normalize()</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00283 {
00284         <span class="comment">// resize tmp samples</span>
00285         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>.resize(numSamples);
00286         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>.resize(numSamples);
00287 
00288         <span class="comment">// Sample the animation.</span>
00289         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a627">t</a>= beginTime;
00290         <span class="keywordtype">float</span>   dt= 0;
00291         <span class="keywordflow">if</span>(numSamples&gt;1)
00292                 dt= (endTime-beginTime)/(numSamples-1);
00293         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;numSamples; i++, <a class="code" href="a04223.html#a627">t</a>+=dt)
00294         {
00295                 CQuat   quat;
00296 
00297                 <span class="comment">// make exact endTime match (avoid precision problem)</span>
00298                 <span class="keywordflow">if</span>(i==numSamples-1)
00299                         <a class="code" href="a04223.html#a627">t</a>= endTime;
00300 
00301                 <span class="comment">// evaluate the track</span>
00302                 const_cast&lt;ITrack*&gt;(trackIn)-&gt;interpolate(t, quat);
00303 
00304                 <span class="comment">// normalize this quaternion</span>
00305                 quat.normalize();
00306 
00307                 <span class="comment">// force on same hemisphere according to precedent frame.</span>
00308                 <span class="keywordflow">if</span>(i&gt;0)
00309                 {
00310                         quat.makeClosest(_QuatKeyList[i-1]);
00311                 }
00312 
00313                 <span class="comment">// store time and key.</span>
00314                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>[i]= i;
00315                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>[i]= quat;
00316         }
00317 
00318 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz29_2" doxytag="NL3D::CAnimationOptimizer::sampleVectorTrack" ></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::CAnimationOptimizer::sampleVectorTrack </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="a03542.html">ITrack</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>trackIn</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>beginTime</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>float&nbsp;</td>
          <td class="mdname" nowrap> <em>endTime</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>&nbsp;</td>
          <td class="mdname" nowrap> <em>numSamples</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [private]</code></td>
        </tr>

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

<p>
sample the track from beginTime to endTime, sample to numSamples, such that key[0].Time==beginTime and key[numSamples-1].Time==endTime.
<p>
Definition at line <a class="el" href="a05445.html#l00449">449</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00119">_TimeList</a>, <a class="el" href="a05446.html#l00123">_VectorKeyList</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00450 {
00451         <span class="comment">// resize tmp samples</span>
00452         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>.resize(numSamples);
00453         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>.resize(numSamples);
00454 
00455         <span class="comment">// Sample the animation.</span>
00456         <span class="keywordtype">float</span>   <a class="code" href="a04223.html#a627">t</a>= beginTime;
00457         <span class="keywordtype">float</span>   dt= 0;
00458         <span class="keywordflow">if</span>(numSamples&gt;1)
00459                 dt= (endTime-beginTime)/(numSamples-1);
00460         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;numSamples; i++, <a class="code" href="a04223.html#a627">t</a>+=dt)
00461         {
00462                 CVector vector;
00463 
00464                 <span class="comment">// make exact endTime match (avoid precision problem)</span>
00465                 <span class="keywordflow">if</span>(i==numSamples-1)
00466                         <a class="code" href="a04223.html#a627">t</a>= endTime;
00467 
00468                 <span class="comment">// evaluate the track</span>
00469                 const_cast&lt;ITrack*&gt;(trackIn)-&gt;interpolate(t, vector);
00470 
00471                 <span class="comment">// store time and key.</span>
00472                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">_TimeList</a>[i]= i;
00473                 <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>[i]= vector;
00474         }
00475 
00476 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera4" doxytag="NL3D::CAnimationOptimizer::setQuaternionThreshold" ></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::CAnimationOptimizer::setQuaternionThreshold </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">double&nbsp;</td>
          <td class="mdname" nowrap> <em>lowPrecThre</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>double&nbsp;</td>
          <td class="mdname" nowrap> <em>highPrecThre</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
Set the Quaternion Error Thresholds. must be&gt;=0. Default is 0.0001 and 0.000001. Above this value, 2 quaternions are said different. NB: comparing 2 quaternions is made by multiplying the one with the inverse of the other. the W component is then tested and must be &gt;1-threshold (modulo sign) to conclude to equality. Since quat.W= cos(angle/2), you can deduce the angle threshold with angleThre= acos(1-thre)*2<p>
Give 2 value, one For Low precision and High precision. Default setup use high precision. Use <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera0">addLowPrecisionTrack()</a> to drive low precision tracks.
<p>
Definition at line <a class="el" href="a05445.html#l00058">58</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00108">_QuaternionThresholdHighPrec</a>, <a class="el" href="a05446.html#l00107">_QuaternionThresholdLowPrec</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
<div class="fragment"><pre>00059 {
00060         <a class="code" href="a04199.html#a6">nlassert</a>(lowPrecThre&gt;=0);
00061         <a class="code" href="a04199.html#a6">nlassert</a>(highPrecThre&gt;=0);
00062         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr3">_QuaternionThresholdLowPrec</a>= 1.0 - lowPrecThre;
00063         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr2">_QuaternionThresholdHighPrec</a>= 1.0 - highPrecThre;
00064 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera5" doxytag="NL3D::CAnimationOptimizer::setSampleFrameRate" ></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::CAnimationOptimizer::setSampleFrameRate </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">float&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>frameRate</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>
Set the Sample Frame Rate (&gt;0) Default is 30 fps. NB: final numSamples must be &lt;65535, else assert at <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera3">optimize()</a> time.
<p>
Definition at line <a class="el" href="a05445.html#l00078">78</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00106">_SampleFrameRate</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
<div class="fragment"><pre>00079 {
00080         <a class="code" href="a04199.html#a6">nlassert</a>(frameRate&gt;0);
00081         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr5">_SampleFrameRate</a>= frameRate;
00082 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizera6" doxytag="NL3D::CAnimationOptimizer::setVectorThreshold" ></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::CAnimationOptimizer::setVectorThreshold </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">double&nbsp;</td>
          <td class="mdname" nowrap> <em>lowPrecThre</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>double&nbsp;</td>
          <td class="mdname" nowrap> <em>highPrecThre</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

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

<p>
Same principle as for <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera4">setQuaternionThreshold()</a>, but for vector tracks (positions/scale). Default is 0.001 and 0.0001. Above this value, 2 vectors are said different. NB: comparing 2 vectors is made by geting the norm of the difference<p>
Give 2 value, one For Low precision and High precision. Default setup use high precision. Use <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizera0">addLowPrecisionTrack()</a> to drive low precision tracks.
<p>
Definition at line <a class="el" href="a05445.html#l00068">68</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00111">_VectorThresholdHighPrec</a>, <a class="el" href="a05446.html#l00110">_VectorThresholdLowPrec</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>.
<p>
<div class="fragment"><pre>00069 {
00070         <a class="code" href="a04199.html#a6">nlassert</a>(lowPrecThre&gt;=0);
00071         <a class="code" href="a04199.html#a6">nlassert</a>(highPrecThre&gt;=0);
00072         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr10">_VectorThresholdLowPrec</a>= lowPrecThre;
00073         <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr9">_VectorThresholdHighPrec</a>= highPrecThre;
00074 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz28_3" doxytag="NL3D::CAnimationOptimizer::testConstantQuatTrack" ></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 NL3D::CAnimationOptimizer::testConstantQuatTrack </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><code> [private]</code></td>
        </tr>

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

<p>
Test if the current track is constant (ie always same quaternion value) NB: test if q==qRef or q==-qRef of course.
<p>
Definition at line <a class="el" href="a05445.html#l00321">321</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00120">_QuatKeyList</a>, <a class="el" href="a05445.html#l00423">nearlySameQuaternion()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00322 {
00323         <a class="code" href="a04558.html#a15">uint</a>    numSamples= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>.size();
00324         <a class="code" href="a04199.html#a6">nlassert</a>(numSamples&gt;0);
00325 
00326         <span class="comment">// Get the first sample as the reference quaternion, and test others from this one.</span>
00327         CQuat   quatRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">_QuatKeyList</a>[0];
00328         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;numSamples;i++)
00329         {
00330                 <span class="comment">// All values must be nearly equal to the reference quaternion.</span>
00331                 <span class="keywordflow">if</span>(!<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz28_0">nearlySameQuaternion</a>(quatRef, _QuatKeyList[i]))
00332                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00333         }
00334 
00335         <span class="comment">// ok.</span>
00336         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00337 }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerz29_3" doxytag="NL3D::CAnimationOptimizer::testConstantVectorTrack" ></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 NL3D::CAnimationOptimizer::testConstantVectorTrack </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><code> [private]</code></td>
        </tr>

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

<p>
Test if the current track is constant (ie always same Vector value)
<p>
Definition at line <a class="el" href="a05445.html#l00479">479</a> of file <a class="el" href="a05445.html">animation_optimizer.cpp</a>.
<p>
References <a class="el" href="a05446.html#l00123">_VectorKeyList</a>, <a class="el" href="a05445.html#l00576">nearlySameVector()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>.
<p>
<div class="fragment"><pre>00480 {
00481         <a class="code" href="a04558.html#a15">uint</a>    numSamples= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>.size();
00482         <a class="code" href="a04199.html#a6">nlassert</a>(numSamples&gt;0);
00483 
00484         <span class="comment">// Get the first sample as the reference Vectorer, and test others from this one.</span>
00485         CVector vectorRef= <a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">_VectorKeyList</a>[0];
00486         <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i&lt;numSamples;i++)
00487         {
00488                 <span class="comment">// All values must be nearly equal to the reference vector.</span>
00489                 <span class="keywordflow">if</span>(!<a class="code" href="a02207.html#NL3D_1_1CAnimationOptimizerz29_0">nearlySameVector</a>(vectorRef, _VectorKeyList[i]))
00490                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
00491         }
00492 
00493         <span class="comment">// ok.</span>
00494         <span class="keywordflow">return</span> <span class="keyword">true</span>;
00495 }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr0" doxytag="NL3D::CAnimationOptimizer::_LowPrecTrackKeyName" ></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;std::string&gt; <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr0">NL3D::CAnimationOptimizer::_LowPrecTrackKeyName</a><code> [private]</code>
      </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="a05446.html#l00116">116</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00599">addLowPrecisionTrack()</a>, <a class="el" href="a05445.html#l00605">clearLowPrecisionTracks()</a>, and <a class="el" href="a05445.html#l00611">isLowPrecisionTrack()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr1" doxytag="NL3D::CAnimationOptimizer::_QuaternionThreshold" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr1">NL3D::CAnimationOptimizer::_QuaternionThreshold</a><code> [private]</code>
      </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="a05446.html#l00109">109</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00423">nearlySameQuaternion()</a>, and <a class="el" href="a05445.html#l00086">optimize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr2" doxytag="NL3D::CAnimationOptimizer::_QuaternionThresholdHighPrec" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr2">NL3D::CAnimationOptimizer::_QuaternionThresholdHighPrec</a><code> [private]</code>
      </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="a05446.html#l00108">108</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00047">CAnimationOptimizer()</a>, <a class="el" href="a05445.html#l00086">optimize()</a>, and <a class="el" href="a05445.html#l00058">setQuaternionThreshold()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr3" doxytag="NL3D::CAnimationOptimizer::_QuaternionThresholdLowPrec" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr3">NL3D::CAnimationOptimizer::_QuaternionThresholdLowPrec</a><code> [private]</code>
      </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="a05446.html#l00107">107</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00047">CAnimationOptimizer()</a>, <a class="el" href="a05445.html#l00086">optimize()</a>, and <a class="el" href="a05445.html#l00058">setQuaternionThreshold()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr4" doxytag="NL3D::CAnimationOptimizer::_QuatKeyList" ></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="a03296.html">CQuat</a>&gt; <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr4">NL3D::CAnimationOptimizer::_QuatKeyList</a><code> [private]</code>
      </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="a05446.html#l00120">120</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00341">optimizeQuatTrack()</a>, <a class="el" href="a05445.html#l00177">optimizeTrack()</a>, <a class="el" href="a05445.html#l00282">sampleQuatTrack()</a>, and <a class="el" href="a05445.html#l00321">testConstantQuatTrack()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr5" doxytag="NL3D::CAnimationOptimizer::_SampleFrameRate" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> float <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr5">NL3D::CAnimationOptimizer::_SampleFrameRate</a><code> [private]</code>
      </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="a05446.html#l00106">106</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00047">CAnimationOptimizer()</a>, <a class="el" href="a05445.html#l00177">optimizeTrack()</a>, and <a class="el" href="a05445.html#l00078">setSampleFrameRate()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr6" doxytag="NL3D::CAnimationOptimizer::_TimeList" ></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#a9">uint16</a>&gt; <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr6">NL3D::CAnimationOptimizer::_TimeList</a><code> [private]</code>
      </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="a05446.html#l00119">119</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00341">optimizeQuatTrack()</a>, <a class="el" href="a05445.html#l00177">optimizeTrack()</a>, <a class="el" href="a05445.html#l00499">optimizeVectorTrack()</a>, <a class="el" href="a05445.html#l00282">sampleQuatTrack()</a>, and <a class="el" href="a05445.html#l00449">sampleVectorTrack()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr7" doxytag="NL3D::CAnimationOptimizer::_VectorKeyList" ></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="a03128.html">CVector</a>&gt; <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr7">NL3D::CAnimationOptimizer::_VectorKeyList</a><code> [private]</code>
      </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="a05446.html#l00123">123</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00177">optimizeTrack()</a>, <a class="el" href="a05445.html#l00499">optimizeVectorTrack()</a>, <a class="el" href="a05445.html#l00449">sampleVectorTrack()</a>, and <a class="el" href="a05445.html#l00479">testConstantVectorTrack()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr8" doxytag="NL3D::CAnimationOptimizer::_VectorThreshold" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr8">NL3D::CAnimationOptimizer::_VectorThreshold</a><code> [private]</code>
      </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="a05446.html#l00112">112</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00576">nearlySameVector()</a>, and <a class="el" href="a05445.html#l00086">optimize()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr9" doxytag="NL3D::CAnimationOptimizer::_VectorThresholdHighPrec" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr9">NL3D::CAnimationOptimizer::_VectorThresholdHighPrec</a><code> [private]</code>
      </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="a05446.html#l00111">111</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00047">CAnimationOptimizer()</a>, <a class="el" href="a05445.html#l00086">optimize()</a>, and <a class="el" href="a05445.html#l00068">setVectorThreshold()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="NL3D_1_1CAnimationOptimizerr10" doxytag="NL3D::CAnimationOptimizer::_VectorThresholdLowPrec" ></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"> double <a class="el" href="a02207.html#NL3D_1_1CAnimationOptimizerr10">NL3D::CAnimationOptimizer::_VectorThresholdLowPrec</a><code> [private]</code>
      </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="a05446.html#l00110">110</a> of file <a class="el" href="a05446.html">animation_optimizer.h</a>.
<p>
Referenced by <a class="el" href="a05445.html#l00047">CAnimationOptimizer()</a>, <a class="el" href="a05445.html#l00086">optimize()</a>, and <a class="el" href="a05445.html#l00068">setVectorThreshold()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="a05446.html">animation_optimizer.h</a><li><a class="el" href="a05445.html">animation_optimizer.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:44:26 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>