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
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>nevrax.org : docs</TITLE>
<LINK REL=stylesheet TYPE="text/css" HREF="/inc/css/nevrax.css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY MARGINHEIGHT="0" MARGINWIDTH="0">
<!-- uplinks -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=><b>Home</B></FONT></A> </TD>
<TD><IMG width=6 height=14 SRC="/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD>
</TR>
</TABLE>
<!-- banner Nevrax -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
<TR><TD BGCOLOR="#000000" BACKGROUND="/inc/img/black_banner.jpg"><A HREF=""><IMG SRC="/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR>
</TABLE>
<!-- main table -->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%>
<TR>
<TD WIDTH=16><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD>
<TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!------ Begin Box ------>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black>
<FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF>
<TABLE cellspacing=0 cellpadding=1 border=0>
<tr><td ALIGN=middle><a class='linkbox' href="/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="/news/" TITLE="News">News</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="/docs/" TITLE="Documentation">Documentation</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="/cvs/" TITLE="CVS Web">CVS</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="/bugs/" TITLE="Bugtracking">Bugs</a></td></tr>
<tr><td ALIGN=middle><a class='linkbox' href="/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="/GPL.php3" TITLE="License">License</a></td></tr>
</TABLE>
</TD></TR></TABLE></TD></TR></TABLE>
<!------ End Box ------>
</TD>
<TD WIDTH=15><IMG SRC="/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD>
<TD ALIGN=left valign=top><IMG SRC="/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT="">
<!-- title -->
<TABLE background="/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td>
<A HREF="/docs/"><img src="/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A>
</td><td><IMG SRC="/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT="">
</td></tr></table>
<!-- block -->
<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="/inc/img/reddots.gif"></TD>
<TD><B>Documentation</B></TD>
<TD ALIGN=RIGHT> </td>
</tr></table>
<!-- Generated by Doxygen 1.2.14 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:/cgi-bin/nel-search.cgi" href="/cgi-bin/nel-search.cgi">Search</a> </center>
<hr><h1>scene.cpp</h1><a href="scene_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font>
00008 <font class="comment"> *</font>
00009 <font class="comment"> * This file is part of NEVRAX NEL.</font>
00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font>
00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font>
00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font>
00013 <font class="comment"> * any later version.</font>
00014 <font class="comment"></font>
00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font>
00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00018 <font class="comment"> * General Public License for more details.</font>
00019 <font class="comment"></font>
00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font>
00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font>
00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font>
00023 <font class="comment"> * MA 02111-1307, USA.</font>
00024 <font class="comment"> */</font>
00025
00026 <font class="preprocessor">#include "<a class="code" href="std3d_8h.html">std3d.h</a>"</font>
00027
00028 <font class="preprocessor">#include "<a class="code" href="scene_8h.html">3d/scene.h</a>"</font>
00029 <font class="preprocessor">#include "<a class="code" href="trav__scene_8h.html">3d/trav_scene.h</a>"</font>
00030 <font class="preprocessor">#include "<a class="code" href="hrc__trav_8h.html">3d/hrc_trav.h</a>"</font>
00031 <font class="preprocessor">#include "<a class="code" href="clip__trav_8h.html">3d/clip_trav.h</a>"</font>
00032 <font class="preprocessor">#include "<a class="code" href="light__trav_8h.html">3d/light_trav.h</a>"</font>
00033 <font class="preprocessor">#include "<a class="code" href="anim__detail__trav_8h.html">3d/anim_detail_trav.h</a>"</font>
00034 <font class="preprocessor">#include "<a class="code" href="load__balancing__trav_8h.html">3d/load_balancing_trav.h</a>"</font>
00035 <font class="preprocessor">#include "<a class="code" href="render__trav_8h.html">3d/render_trav.h</a>"</font>
00036 <font class="preprocessor">#include "<a class="code" href="transform_8h.html">3d/transform.h</a>"</font>
00037 <font class="preprocessor">#include "<a class="code" href="camera_8h.html">3d/camera.h</a>"</font>
00038 <font class="preprocessor">#include "<a class="code" href="landscape__model_8h.html">3d/landscape_model.h</a>"</font>
00039 <font class="preprocessor">#include "<a class="code" href="driver_8h.html">3d/driver.h</a>"</font>
00040 <font class="preprocessor">#include "<a class="code" href="transform__shape_8h.html">3d/transform_shape.h</a>"</font>
00041 <font class="preprocessor">#include "<a class="code" href="mesh__base_8h.html">3d/mesh_base.h</a>"</font>
00042 <font class="preprocessor">#include "<a class="code" href="mesh__base__instance_8h.html">3d/mesh_base_instance.h</a>"</font>
00043 <font class="preprocessor">#include "<a class="code" href="mesh__instance_8h.html">3d/mesh_instance.h</a>"</font>
00044 <font class="preprocessor">#include "<a class="code" href="mesh__mrm__instance_8h.html">3d/mesh_mrm_instance.h</a>"</font>
00045 <font class="preprocessor">#include "<a class="code" href="mesh__multi__lod__instance_8h.html">3d/mesh_multi_lod_instance.h</a>"</font>
00046 <font class="preprocessor">#include "<a class="code" href="shape__bank_8h.html">3d/shape_bank.h</a>"</font>
00047 <font class="preprocessor">#include "<a class="code" href="skeleton__model_8h.html">3d/skeleton_model.h</a>"</font>
00048 <font class="preprocessor">#include "<a class="code" href="particle__system__model_8h.html">3d/particle_system_model.h</a>"</font>
00049 <font class="preprocessor">#include "<a class="code" href="coarse__mesh__manager_8h.html">3d/coarse_mesh_manager.h</a>"</font>
00050 <font class="preprocessor">#include "<a class="code" href="cluster_8h.html">3d/cluster.h</a>"</font>
00051 <font class="preprocessor">#include "<a class="code" href="scene__group_8h.html">3d/scene_group.h</a>"</font>
00052 <font class="preprocessor">#include "<a class="code" href="flare__model_8h.html">3d/flare_model.h</a>"</font>
00053 <font class="preprocessor">#include "<a class="code" href="skip__model_8h.html">3d/skip_model.h</a>"</font>
00054 <font class="preprocessor">#include "<a class="code" href="quad__grid__clip__cluster_8h.html">3d/quad_grid_clip_cluster.h</a>"</font>
00055 <font class="preprocessor">#include "<a class="code" href="water__model_8h.html">3d/water_model.h</a>"</font>
00056 <font class="preprocessor">#include "<a class="code" href="vegetable__blend__layer__model_8h.html">3d/vegetable_blend_layer_model.h</a>"</font>
00057 <font class="preprocessor">#include "<a class="code" href="root__model_8h.html">3d/root_model.h</a>"</font>
00058 <font class="preprocessor">#include "<a class="code" href="point__light__model_8h.html">3d/point_light_model.h</a>"</font>
00059 <font class="preprocessor">#include "<a class="code" href="animation_8h.html">3d/animation.h</a>"</font>
00060 <font class="preprocessor">#include "<a class="code" href="lod__character__manager_8h.html">3d/lod_character_manager.h</a>"</font>
00061 <font class="preprocessor">#include "<a class="code" href="seg__remanence_8h.html">3d/seg_remanence.h</a>"</font>
00062 <font class="preprocessor">#include "<a class="code" href="async__texture__manager_8h.html">3d/async_texture_manager.h</a>"</font>
00063
00064 <font class="preprocessor">#include <memory></font>
00065
00066 <font class="preprocessor">#include "<a class="code" href="time__nl_8h.html">nel/misc/time_nl.h</a>"</font>
00067 <font class="preprocessor">#include "<a class="code" href="file_8h.html">nel/misc/file.h</a>"</font>
00068 <font class="preprocessor">#include "<a class="code" href="path_8h.html">nel/misc/path.h</a>"</font>
00069 <font class="keyword">using</font> <font class="keyword">namespace </font>std;
00070 <font class="keyword">using</font> <font class="keyword">namespace </font>NLMISC;
00071
<a name="l00072"></a><a class="code" href="scene_8cpp.html#a0">00072</a> <font class="preprocessor">#define NL3D_SCENE_STATIC_COARSE_MANAGER_TEXTURE "nel_coarse_texture.tga"</font>
<a name="l00073"></a><a class="code" href="scene_8cpp.html#a1">00073</a> <font class="preprocessor"></font><font class="preprocessor">#define NL3D_SCENE_DYNAMIC_COARSE_MANAGER_TEXTURE NL3D_SCENE_STATIC_COARSE_MANAGER_TEXTURE</font>
00074 <font class="preprocessor"></font>
<a name="l00075"></a><a class="code" href="scene_8cpp.html#a2">00075</a> <font class="preprocessor">#define NL3D_MEM_INSTANCE NL_ALLOC_CONTEXT( 3dInst )</font>
<a name="l00076"></a><a class="code" href="scene_8cpp.html#a3">00076</a> <font class="preprocessor"></font><font class="preprocessor">#define NL3D_MEM_MOT NL_ALLOC_CONTEXT( 3dMot )</font>
00077 <font class="preprocessor"></font>
<a name="l00078"></a><a class="code" href="scene_8cpp.html#a4">00078</a> <font class="preprocessor">#define NL3D_SCENE_QUADGRID_CLIP_CLUSTER_SIZE 400</font>
<a name="l00079"></a><a class="code" href="scene_8cpp.html#a5">00079</a> <font class="preprocessor"></font><font class="preprocessor">#define NL3D_SCENE_QUADGRID_CLIP_NUM_MAXDIST 3</font>
<a name="l00080"></a><a class="code" href="scene_8cpp.html#a6">00080</a> <font class="preprocessor"></font><font class="keyword">const</font> <font class="keywordtype">float</font> <a class="code" href="scene_8cpp.html#a6">NL3D_QuadGridClipManagerMaxDist</a>[<a class="code" href="scene_8cpp.html#a5">NL3D_SCENE_QUADGRID_CLIP_NUM_MAXDIST</a>]= {200, 400, 600};
00081 <font class="comment">// The manager is limited to a square of 3000m*3000m around the camera. Beyond, models are clipped individually (bad!!).</font>
<a name="l00082"></a><a class="code" href="scene_8cpp.html#a7">00082</a> <font class="keyword">const</font> <font class="keywordtype">float</font> <a class="code" href="scene_8cpp.html#a7">NL3D_QuadGridClipManagerRadiusMax</a>= 1500;
00083
00084
00085 <font class="keyword">namespace </font>NL3D
00086 {
00087
00088 <font class="comment">// ***************************************************************************</font>
00089 <font class="comment">// ***************************************************************************</font>
00090 <font class="comment">// ***************************************************************************</font>
00091
00092
<a name="l00093"></a><a class="code" href="classNL3D_1_1CScene.html#z751_0">00093</a> <font class="keywordtype">void</font> CScene::registerBasics()
00094 {
00095 CTransform::registerBasic();
00096 CCamera::registerBasic();
00097 CMeshBaseInstance::registerBasic();
00098 CMeshInstance::registerBasic();
00099 CMeshMRMInstance::registerBasic();
00100 CLandscapeModel::registerBasic();
00101 CTransformShape::registerBasic();
00102 CSkeletonModel::registerBasic();
00103 CParticleSystemModel::registerBasic() ;
00104 CMeshMultiLodInstance::registerBasic();
00105 CCoarseMeshManager::registerBasic();
00106 CCluster::registerBasic();
00107 CFlareModel::registerBasic();
00108 CSkipModel::registerBasic();
00109 CQuadGridClipCluster::registerBasic();
00110 CWaterModel::registerBasic();
00111 CWaveMakerModel::registerBasic();
00112 CVegetableBlendLayerModel::registerBasic();
00113 CRootModel::registerBasic();
00114 CPointLightModel::registerBasic();
00115 CSegRemanence::registerBasic();
00116 }
00117
00118
00119 <font class="comment">// ***************************************************************************</font>
00120 <font class="comment">// ***************************************************************************</font>
00121 <font class="comment">// ***************************************************************************</font>
00122
00123 <font class="comment">// ***************************************************************************</font>
<a name="l00124"></a><a class="code" href="classNL3D_1_1CScene.html#z752_0">00124</a> CScene::CScene()
00125 {
00126 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>= NULL;
00127 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>= NULL;
00128 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>= NULL;
00129 <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>= NULL;
00130 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>= NULL;
00131 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>= NULL;
00132
00133 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a> = NULL;
00134
00135 <a class="code" href="classNL3D_1_1CScene.html#z766_0">_StaticCoarseMeshManager</a> = NULL;
00136 <a class="code" href="classNL3D_1_1CScene.html#z766_1">_DynamicCoarseMeshManager</a> = NULL;
00137
00138 <a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>= NULL;
00139 <a class="code" href="classNL3D_1_1CScene.html#o11">SkipModelRoot</a>= NULL;
00140 <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>= NULL;
00141 <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>= NULL;
00142
00143 <a class="code" href="classNL3D_1_1CScene.html#o3">_CurrentTime</a> = 0 ;
00144 <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> = 0 ;
00145 <a class="code" href="classNL3D_1_1CScene.html#o4">_RealTime</a> = 0 ;
00146 <a class="code" href="classNL3D_1_1CScene.html#o5">_FirstAnimateCall</a> = <font class="keyword">true</font> ;
00147
00148 <a class="code" href="classNL3D_1_1CScene.html#o18">_LightingSystemEnabled</a>= <font class="keyword">false</font>;
00149 <a class="code" href="classNL3D_1_1CScene.html#o19">_CoarseMeshLightingUpdate</a>= 50;
00150
00151 <a class="code" href="classNL3D_1_1CScene.html#z769_1">_GlobalWindDirection</a>.set(1,0,0);
00152 <font class="comment">// Default as Sithikt wants.</font>
00153 <a class="code" href="classNL3D_1_1CScene.html#z769_0">_GlobalWindPower</a>= 0.2f;
00154
00155 <font class="comment">// global manager (created in CDriverUser)</font>
00156 <a class="code" href="classNL3D_1_1CScene.html#z766_2">_LodCharacterManager</a>= NULL;
00157 <a class="code" href="classNL3D_1_1CScene.html#o21">_AsyncTextureManager</a>= NULL;
00158
00159 <a class="code" href="classNL3D_1_1CScene.html#o9">_NumRender</a> = 0;
00160
00161 <a class="code" href="classNL3D_1_1CScene.html#o23">_MaxSkeletonsInNotCLodForm</a>= 20;
00162 }
00163 <font class="comment">// ***************************************************************************</font>
<a name="l00164"></a><a class="code" href="classNL3D_1_1CScene.html#z752_10">00164</a> <font class="keywordtype">void</font> CScene::release()
00165 {
00166 <font class="comment">// terminate async loading</font>
00167 CAsyncFileManager::terminate();
00168
00169 <font class="comment">// reset the _QuadGridClipManager, => unlink models, and delete clusters.</font>
00170 <a class="code" href="classNL3D_1_1CScene.html#z767_0">_QuadGridClipManager</a>.reset();
00171
00172 <font class="comment">// First, delete models and un-register traversals.</font>
00173 CMOT::release();
00174
00175 <font class="keywordflow">for</font> (uint k = 0; k < <a class="code" href="classNL3D_1_1CMOT.html#z613_1">getNumTrav</a>(); ++k)
00176 {
00177 ITravScene *ts = dynamic_cast<ITravScene *>(<a class="code" href="classNL3D_1_1CMOT.html#z613_2">getTrav</a>(k));
00178 <font class="keywordflow">if</font> (ts)
00179 {
00180 ts->Scene = NULL;
00181 }
00182 }
00183
00184 <font class="comment">// Unlink the rendertrav.</font>
00185 <a class="code" href="classNL3D_1_1CScene.html#o0">RenderTraversals</a>.clear();
00186
00187 <font class="comment">// Delete only the 5 default Traversals (owned by CScene).</font>
00188 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a> != NULL)
00189 {
00190 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>;
00191 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>= NULL;
00192 }
00193
00194 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a> != NULL)
00195 {
00196 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>;
00197 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>= NULL;
00198 }
00199
00200 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a> != NULL)
00201 {
00202 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>;
00203 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>= NULL;
00204 }
00205
00206 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a> != NULL)
00207 {
00208 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>;
00209 <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>= NULL;
00210 }
00211
00212 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a> != NULL)
00213 {
00214 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>;
00215 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>= NULL;
00216 }
00217
00218 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a> != NULL)
00219 {
00220 <font class="keyword">delete</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>;
00221 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>= NULL;
00222 }
00223
00224 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a> = NULL;
00225 <a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>= NULL;
00226 <a class="code" href="classNL3D_1_1CScene.html#o11">SkipModelRoot</a>= NULL;
00227 <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>= NULL;
00228 <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>= NULL;
00229 <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>= NULL;
00230
00231 <font class="comment">// reset the _LodCharacterManager</font>
00232 <font class="keywordflow">if</font>(_LodCharacterManager)
00233 <a class="code" href="classNL3D_1_1CScene.html#z766_2">_LodCharacterManager</a>->reset();
00234 }
00235 <font class="comment">// ***************************************************************************</font>
<a name="l00236"></a><a class="code" href="classNL3D_1_1CScene.html#z752_1">00236</a> CScene::~CScene()
00237 {
00238 <a class="code" href="classNL3D_1_1CScene.html#z752_10">release</a>();
00239 }
00240 <font class="comment">// ***************************************************************************</font>
<a name="l00241"></a><a class="code" href="classNL3D_1_1CScene.html#z752_2">00241</a> <font class="keywordtype">void</font> CScene::initDefaultTravs()
00242 {
00243 <a class="code" href="scene_8cpp.html#a3">NL3D_MEM_MOT</a>
00244
00245 <font class="comment">// Add the 4 default traversals.</font>
00246 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>= <font class="keyword">new</font> CHrcTrav;
00247 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>= <font class="keyword">new</font> CClipTrav;
00248 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>= <font class="keyword">new</font> CLightTrav;
00249 <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>= <font class="keyword">new</font> CAnimDetailTrav;
00250 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>= <font class="keyword">new</font> CLoadBalancingTrav;
00251 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>= <font class="keyword">new</font> CRenderTrav;
00252
00253 <font class="comment">// Register them to the scene.</font>
00254 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>);
00255 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>);
00256 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>);
00257 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>);
00258 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00259 <a class="code" href="classNL3D_1_1CScene.html#z752_9">addTrav</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>);
00260 }
00261 <font class="comment">// ***************************************************************************</font>
<a name="l00262"></a><a class="code" href="classNL3D_1_1CScene.html#z752_3">00262</a> <font class="keywordtype">void</font> CScene::initDefaultRoots()
00263 {
00264 <font class="comment">// Create and set root the default models.</font>
00265 <a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>= static_cast<CTransform*>(<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a>(<a class="code" href="namespaceNL3D.html#a276">TransformId</a>));
00266 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>->setRoot(<a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>);
00267 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setRoot(<a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>);
00268
00269 <font class="comment">// need no root for AnimDetailTrav, LoadBalancingTrav, LightTrav and RenderTrav</font>
00270 <font class="comment">// because all of them use either the ClipVisibilityList or their own list.</font>
00271 <font class="comment">// AnimDetailTrav->setRoot(Root);</font>
00272 <font class="comment">// LoadBalancingTrav->setRoot(Root);</font>
00273 <font class="comment">// LightTrav->setRoot(Root);</font>
00274 <font class="comment">// RenderTrav->setRoot(Root);</font>
00275
00276
00277 <font class="comment">// The root is always freezed (never move).</font>
00278 <a class="code" href="classNL3D_1_1CScene.html#o10">Root</a>->freeze();
00279
00280
00281 <font class="comment">// Create a SkipModelRoot, for CTransform::freezeHRC().</font>
00282 <a class="code" href="classNL3D_1_1CScene.html#o11">SkipModelRoot</a>= static_cast<CSkipModel*>(<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a>(<a class="code" href="namespaceNL3D.html#a237">SkipModelId</a>));
00283
00284
00285 <font class="comment">// Create a SonsOfAncestorSkeletonModelGroup, for models which have a skeleton ancestor</font>
00286 <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>= static_cast<CRootModel*>(<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a>(<a class="code" href="namespaceNL3D.html#a233">RootModelId</a>));
00287 <font class="comment">// must unlink it from all traversals, because special, only used in CClipTrav::traverse()</font>
00288 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00289 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00290 <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00291 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00292 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00293 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00294 <font class="comment">// inform the clipTrav of this model.</font>
00295 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setSonsOfAncestorSkeletonModelGroup(<a class="code" href="classNL3D_1_1CScene.html#o12">SonsOfAncestorSkeletonModelGroup</a>);
00296
00297
00298 <font class="comment">// init root for Lighting.</font>
00299 <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>= static_cast<CRootModel*>(<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a>(<a class="code" href="namespaceNL3D.html#a233">RootModelId</a>));
00300 <font class="comment">// unlink it from all traversals, because special, only used in CLightTrav::traverse()</font>
00301 <a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00302 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00303 <a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00304 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00305 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00306 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->unlink(NULL, <a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00307 <font class="comment">// inform the LightTrav of this model.</font>
00308 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->setLightModelRoot(<a class="code" href="classNL3D_1_1CScene.html#o13">LightModelRoot</a>);
00309 }
00310
00311 <font class="comment">// ***************************************************************************</font>
<a name="l00312"></a><a class="code" href="classNL3D_1_1CScene.html#z752_5">00312</a> <font class="keywordtype">void</font> CScene::initCoarseMeshManager ()
00313 {
00314 <a class="code" href="classNL3D_1_1CScene.html#z766_0">_StaticCoarseMeshManager</a>=(CCoarseMeshManager*)<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a> (<a class="code" href="namespaceNL3D.html#a27">CoarseMeshManagerId</a>);
00315 <a class="code" href="classNL3D_1_1CScene.html#z766_1">_DynamicCoarseMeshManager</a>=(CCoarseMeshManager*)<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a> (<a class="code" href="namespaceNL3D.html#a27">CoarseMeshManagerId</a>);
00316
00317 <font class="comment">// Init default texture files</font>
00318 <a class="code" href="classNL3D_1_1CScene.html#z766_0">_StaticCoarseMeshManager</a>->setTextureFile (<a class="code" href="scene_8cpp.html#a0">NL3D_SCENE_STATIC_COARSE_MANAGER_TEXTURE</a>);
00319 <a class="code" href="classNL3D_1_1CScene.html#z766_1">_DynamicCoarseMeshManager</a>->setTextureFile (<a class="code" href="scene_8cpp.html#a1">NL3D_SCENE_DYNAMIC_COARSE_MANAGER_TEXTURE</a>);
00320 }
00321
00322 <font class="comment">// ***************************************************************************</font>
<a name="l00323"></a><a class="code" href="classNL3D_1_1CScene.html#z752_4">00323</a> <font class="keywordtype">void</font> CScene::initGlobalnstanceGroup ()
00324 {
00325 <font class="comment">// Init the instance group that represent the world</font>
00326 <a class="code" href="classNL3D_1_1CScene.html#z765_3">_GlobalInstanceGroup</a> = <font class="keyword">new</font> CInstanceGroup;
00327 CCluster *pCluster = (CCluster*)<a class="code" href="classNL3D_1_1CMOT.html#z614_0">createModel</a> (<a class="code" href="namespaceNL3D.html#a26">ClusterId</a>);
00328 CClipTrav *pClipTrav = (CClipTrav*)(<a class="code" href="classNL3D_1_1CMOT.html#z613_2">getTrav</a> (<a class="code" href="namespaceNL3D.html#a25">ClipTravId</a>));
00329 pClipTrav->unlink (NULL, pCluster);
00330 pCluster->Name = <font class="stringliteral">"ClusterRoot"</font>;
00331 pCluster->Group = <a class="code" href="classNL3D_1_1CScene.html#z765_3">_GlobalInstanceGroup</a>;
00332 <a class="code" href="classNL3D_1_1CScene.html#z765_3">_GlobalInstanceGroup</a>->addCluster (pCluster);
00333
00334 <font class="comment">// init the ClipTrav->RootCluster.</font>
00335 pClipTrav->RootCluster = <a class="code" href="classNL3D_1_1CScene.html#z765_3">_GlobalInstanceGroup</a>->_ClusterInstances[0];
00336 }
00337
00338
00339 <font class="comment">// ***************************************************************************</font>
<a name="l00340"></a><a class="code" href="classNL3D_1_1CScene.html#z752_6">00340</a> <font class="keywordtype">void</font> CScene::initQuadGridClipManager ()
00341 {
00342 <font class="comment">// Init clip features.</font>
00343 <font class="comment">// setup maxDists clip.</font>
00344 vector<float> maxDists;
00345 <font class="keywordflow">for</font>(uint i=0; i<<a class="code" href="scene_8cpp.html#a5">NL3D_SCENE_QUADGRID_CLIP_NUM_MAXDIST</a>; i++)
00346 maxDists.push_back(<a class="code" href="scene_8cpp.html#a6">NL3D_QuadGridClipManagerMaxDist</a>[i]);
00347 <font class="comment">// init _QuadGridClipManager.</font>
00348 <a class="code" href="classNL3D_1_1CScene.html#z767_0">_QuadGridClipManager</a>.init(<font class="keyword">this</font>, <a class="code" href="scene_8cpp.html#a4">NL3D_SCENE_QUADGRID_CLIP_CLUSTER_SIZE</a>, maxDists, <a class="code" href="scene_8cpp.html#a7">NL3D_QuadGridClipManagerRadiusMax</a>);
00349 }
00350
00351
00352 <font class="comment">// ***************************************************************************</font>
<a name="l00353"></a><a class="code" href="classNL3D_1_1CScene.html#z752_9">00353</a> <font class="keywordtype">void</font> CScene::addTrav(ITrav *<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>)
00354 {
00355 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>);
00356 sint order=0;
00357
00358 ITravScene *sv= dynamic_cast<ITravScene*>(v);
00359 <font class="keywordflow">if</font>(sv)
00360 {
00361 order= sv->getRenderOrder();
00362 }
00363
00364 <font class="comment">// If ok, add it to the render traversal list.</font>
00365 <font class="keywordflow">if</font>(order)
00366 {
00367 <a class="code" href="classNL3D_1_1CScene.html#o0">RenderTraversals</a>.insert( TTravMap::value_type(order, sv) );
00368 }
00369
00370 <font class="comment">// And register it normally.</font>
00371 CMOT::addTrav(<a class="code" href="driver__opengl__extension__def_8h.html#a368">v</a>);
00372 }
00373 <font class="comment">// ***************************************************************************</font>
<a name="l00374"></a><a class="code" href="classNL3D_1_1CScene.html#z753_0">00374</a> <font class="keywordtype">void</font> CScene::render(<font class="keywordtype">bool</font> doHrcPass)
00375 {
00376 <font class="keywordtype">double</font> fNewGlobalSystemTime = <a class="code" href="classNLMISC_1_1CTime.html#d3">NLMISC::CTime::ticksToSecond</a>(<a class="code" href="classNLMISC_1_1CTime.html#d2">NLMISC::CTime::getPerformanceTime</a>());
00377 <a class="code" href="classNL3D_1_1CScene.html#o7">_DeltaSystemTimeBetweenRender</a>= fNewGlobalSystemTime - <a class="code" href="classNL3D_1_1CScene.html#o8">_GlobalSystemTime</a>;
00378 <a class="code" href="classNL3D_1_1CScene.html#o8">_GlobalSystemTime</a> = fNewGlobalSystemTime;
00379 <font class="comment">//</font>
00380 ++ <a class="code" href="classNL3D_1_1CScene.html#o9">_NumRender</a>;
00381 <font class="comment">//</font>
00382 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>);
00383
00384 <font class="comment">// validate models.</font>
00385 CMOT::validateModels();
00386
00387 <font class="comment">// Use the camera to setup Clip / Render pass.</font>
00388 <font class="keywordtype">float</font> left, right, bottom, top, znear, zfar;
00389 <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>->getFrustum(left, right, bottom, top, znear, zfar);
00390
00391 <font class="comment">// setup basic camera.</font>
00392 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setFrustum(left, right, bottom, top, znear, zfar, <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>->isPerspective());
00393
00394 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setFrustum (left, right, bottom, top, znear, zfar, <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>->isPerspective());
00395 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setViewport (<a class="code" href="classNL3D_1_1CScene.html#o2">_Viewport</a>);
00396
00397 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->setFrustum (left, right, bottom, top, znear, zfar, <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>->isPerspective());
00398
00399
00400 <font class="comment">// Set the renderTrav for cliptrav.</font>
00401 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setHrcTrav (<a class="code" href="classNL3D_1_1CScene.html#z764_0">HrcTrav</a>);
00402 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setLightTrav (<a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>);
00403 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setAnimDetailTrav (<a class="code" href="classNL3D_1_1CScene.html#z764_3">AnimDetailTrav</a>);
00404 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setLoadBalancingTrav (<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00405 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setRenderTrav (<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>);
00406 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->Camera = <a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>;
00407 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setQuadGridClipManager (&<a class="code" href="classNL3D_1_1CScene.html#z767_0">_QuadGridClipManager</a>);
00408
00409 <font class="comment">// For all render traversals, traverse them (except the Hrc one), in ascending order.</font>
00410 TTravMap::iterator it;
00411 <font class="keywordflow">for</font>(it= <a class="code" href="classNL3D_1_1CScene.html#o0">RenderTraversals</a>.begin(); it!= <a class="code" href="classNL3D_1_1CScene.html#o0">RenderTraversals</a>.end(); it++)
00412 {
00413 ITravScene *trav= (*it).second;
00414 <font class="comment">// TestYoyo</font>
00415 <font class="comment">/*if(AnimDetailTravId!=trav->getClassId() && </font>
00416 <font class="comment"> LoadBalancingTravId!=trav->getClassId() && </font>
00417 <font class="comment"> HrcTravId!=trav->getClassId() && </font>
00418 <font class="comment"> ClipTravId!=trav->getClassId() )</font>
00419 <font class="comment"> continue;*/</font>
00420 <font class="comment">// maybe don't traverse HRC pass.</font>
00421 <font class="keywordflow">if</font>(doHrcPass || <a class="code" href="namespaceNL3D.html#a41">HrcTravId</a>!=trav->getClassId())
00422 <font class="comment">// Go!</font>
00423 trav->traverse();
00424
00425 <font class="comment">// if HrcTrav done, set World Camera matrix for Clip and Render.</font>
00426 <font class="keywordflow">if</font>(<a class="code" href="namespaceNL3D.html#a41">HrcTravId</a>==trav->getClassId())
00427 {
00428 CTransformHrcObs *camObs= (CTransformHrcObs*)CMOT::getModelObs(<a class="code" href="classNL3D_1_1CScene.html#o1">CurrentCamera</a>, <a class="code" href="namespaceNL3D.html#a41">HrcTravId</a>);
00429 <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->setCamMatrix(camObs->WorldMatrix);
00430 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setCamMatrix (camObs->WorldMatrix);
00431 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->setCamMatrix (camObs->WorldMatrix);
00432 }
00433 }
00434
00438 <a class="code" href="classNL3D_1_1CScene.html#z768_0">_ParticleSystemManager</a>.refreshModels(<a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->WorldFrustumPyramid, <a class="code" href="classNL3D_1_1CScene.html#z764_1">ClipTrav</a>->CamPos);
00439
00440 <font class="comment">// Wainting Instance handling</font>
00441 <font class="keywordtype">double</font> deltaT = <a class="code" href="classNL3D_1_1CScene.html#o7">_DeltaSystemTimeBetweenRender</a>;
00442 <a class="code" href="namespaceNLMISC.html#a215">clamp</a> (deltaT, 0.01, 0.1);
00443 <a class="code" href="classNL3D_1_1CScene.html#a0">updateWaitingInstances</a>(deltaT);
00444
00445 }
00446
00447 <font class="comment">// ***************************************************************************</font>
<a name="l00448"></a><a class="code" href="classNL3D_1_1CScene.html#a0">00448</a> <font class="keywordtype">void</font> CScene::updateWaitingInstances(<font class="keywordtype">double</font> systemTimeEllapsed)
00449 {
00450 <font class="comment">// First set up max AGP upload</font>
00451 <font class="keywordtype">double</font> fMaxBytesToUp = 100 * 256 * 256 * systemTimeEllapsed;
00452 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->setMaxBytesToUpload ((uint32)fMaxBytesToUp);
00453 <font class="comment">// Parse all the waiting instance</font>
00454 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->processWaitingShapes (); <font class="comment">// Process waiting shapes load shape, texture, and lightmaps</font>
00455 <font class="comment">// and upload all maps to VRAM pieces by pieces</font>
00456 TWaitingInstancesMMap::iterator wimmIt = <a class="code" href="classNL3D_1_1CScene.html#z765_2">_WaitingInstances</a>.begin();
00457 <font class="keywordflow">while</font>( wimmIt != <a class="code" href="classNL3D_1_1CScene.html#z765_2">_WaitingInstances</a>.end() )
00458 {
00459 CShapeBank::TShapeState st = <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->isPresent (wimmIt->first);
00460 <font class="keywordflow">if</font> (st == CShapeBank::AsyncLoad_Error)
00461 {
00462 <font class="comment">// Delete the waiting instance - Nobody can be informed of that...</font>
00463 TWaitingInstancesMMap::iterator itDel= wimmIt;
00464 ++wimmIt;
00465 <a class="code" href="classNL3D_1_1CScene.html#z765_2">_WaitingInstances</a>.erase(itDel);
00466 }
00467 <font class="keywordflow">else</font> <font class="keywordflow">if</font> (st == CShapeBank::Present)
00468 {
00469 <font class="comment">// Then create a reference to the shape</font>
00470 *(wimmIt->second) = <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->addRef(wimmIt->first)->createInstance (*<font class="keyword">this</font>);
00471 <font class="comment">// Delete the waiting instance</font>
00472 TWaitingInstancesMMap::iterator itDel= wimmIt;
00473 ++wimmIt;
00474 <a class="code" href="classNL3D_1_1CScene.html#z765_2">_WaitingInstances</a>.erase(itDel);
00475 }
00476 <font class="keywordflow">else</font> <font class="comment">// st == CShapeBank::NotPresent or loading</font>
00477 {
00478 ++wimmIt;
00479 }
00480 }
00481 }
00482
00483 <font class="comment">// ***************************************************************************</font>
<a name="l00484"></a><a class="code" href="classNL3D_1_1CScene.html#z752_7">00484</a> <font class="keywordtype">void</font> CScene::setDriver(IDriver *drv)
00485 {
00486 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a> != NULL)
00487 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setDriver(drv);
00488 }
00489
00490 <font class="comment">// ***************************************************************************</font>
<a name="l00491"></a><a class="code" href="classNL3D_1_1CScene.html#z752_8">00491</a> IDriver *CScene::getDriver()<font class="keyword"> const</font>
00492 <font class="keyword"></font>{
00493 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a> != NULL)
00494 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->getDriver();
00495 <font class="keywordflow">else</font>
00496 <font class="keywordflow">return</font> NULL;
00497 }
00498
00499
00500 <font class="comment">// ***************************************************************************</font>
00501 <font class="comment">// ***************************************************************************</font>
00502 <font class="comment">// Shape mgt.</font>
00503 <font class="comment">// ***************************************************************************</font>
00504 <font class="comment">// ***************************************************************************</font>
00505
00506 <font class="comment">// ***************************************************************************</font>
00507
<a name="l00508"></a><a class="code" href="classNL3D_1_1CScene.html#z755_0">00508</a> <font class="keywordtype">void</font> CScene::setShapeBank(CShapeBank*pShapeBank)
00509 {
00510 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a> = pShapeBank;
00511 }
00512
00513 <font class="comment">// ***************************************************************************</font>
00514
00515 CTransformShape *CScene::createInstance(<font class="keyword">const</font> string &shapeName)
00516 {
00517 <a class="code" href="scene_8cpp.html#a2">NL3D_MEM_INSTANCE</a>
00518
00519 <font class="comment">// We must attach a bank to the scene (a ShapeBank handle the shape caches and </font>
00520 <font class="comment">// the creation/deletion of the instances)</font>
00521 <a class="code" href="debug_8h.html#a6">nlassert</a>( <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a> != NULL );
00522
00523 <font class="comment">// If the shape is not present in the bank</font>
00524 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->isPresent( shapeName ) != CShapeBank::Present)
00525 {
00526 <font class="comment">// Load it from file</font>
00527 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->load( shapeName );
00528 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->isPresent( shapeName ) != CShapeBank::Present)
00529 {
00530 <font class="keywordflow">return</font> NULL;
00531 }
00532 }
00533 <font class="comment">// Then create a reference to the shape</font>
00534 CTransformShape *pTShp = <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->addRef( shapeName )->createInstance(*<font class="keyword">this</font>);
00535 <font class="keywordflow">if</font> (pTShp) pTShp->setDistMax(pTShp->Shape->getDistMax());
00536 <font class="preprocessor">#ifdef NL_DEBUG</font>
00537 <font class="preprocessor"></font><font class="comment">// pTShp->NameForDebug = shapeName; // \todo traptemp</font>
00538 <font class="preprocessor">#endif</font>
00539 <font class="preprocessor"></font>
00540 <font class="comment">// Look if this instance get lightmap information</font>
00541 <font class="preprocessor">#if defined(__GNUC__) && __GNUC__ < 3</font>
00542 <font class="preprocessor"></font> CMeshBase *pMB = (CMeshBase*)((IShape*)(pTShp->Shape));
00543 <font class="preprocessor">#else // not GNUC</font>
00544 <font class="preprocessor"></font> CMeshBase *pMB = dynamic_cast<CMeshBase*>((IShape*)(pTShp->Shape));
00545 <font class="preprocessor">#endif // not GNUC</font>
00546 <font class="preprocessor"></font> CMeshBaseInstance *pMBI = dynamic_cast<CMeshBaseInstance*>( pTShp );
00547 <font class="keywordflow">if</font>( ( pMB != NULL ) && ( pMBI != NULL ) )
00548 { <font class="comment">// Try to bind to automatic animation</font>
00549 CMeshBase::TLightInfoMap::iterator itLM = pMB->_LightInfos.begin();
00550 <font class="keywordflow">while</font>( itLM != pMB->_LightInfos.end() )
00551 { <font class="comment">// Is it the same name in the name of the lightmap ?</font>
00552 set<CAnimatedLightmap*>::iterator itSet = <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.begin();
00553 <font class="keywordflow">while</font>( itSet != <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.end() )
00554 {
00555 <font class="keyword">const</font> <font class="keywordtype">char</font> *GroupName = strchr( (*itSet)->getName().c_str(), <font class="charliteral">'.'</font>)+1;
00556 <font class="keywordflow">if</font>( GroupName == itLM->first )
00557 {
00558 <font class="comment">// Ok bind automatic animation</font>
00559 pMBI->setAnimatedLightmap( *itSet );
00560 }
00561 ++itSet;
00562 }
00563 ++itLM;
00564 }
00565
00566 <font class="comment">// Auto animations</font>
00567 <font class="comment">//==========================</font>
00568
00569 <font class="keywordflow">if</font> (_AutomaticAnimationSet)
00570 {
00571 <font class="keywordflow">if</font> (pMB->getAutoAnim())
00572 {
00573
00574 std::string animName = CFile::getFilenameWithoutExtension(shapeName);
00575 uint animID = <a class="code" href="classNL3D_1_1CScene.html#o20">_AutomaticAnimationSet</a>->getAnimationIdByName(animName);
00576 <font class="keywordflow">if</font> (animID != CAnimationSet::NotFound)
00577 {
00578 CChannelMixer *chanMix = <font class="keyword">new</font> CChannelMixer;
00579 chanMix->setAnimationSet((CAnimationSet *) <a class="code" href="classNL3D_1_1CScene.html#o20">_AutomaticAnimationSet</a>);
00580 chanMix->setSlotAnimation(0, animID);
00581
00582 pMBI->registerToChannelMixer(chanMix, <font class="stringliteral">""</font>);
00583 <font class="comment">// Gives this object ownership of the channel mixer so we don't need to keep track of it</font>
00584 pMBI->setChannelMixerOwnerShip(<font class="keyword">true</font>);
00585 }
00586 }
00587 }
00588 }
00589
00590 <font class="keywordflow">return</font> pTShp;
00591 }
00592
00593 <font class="comment">// ***************************************************************************</font>
00594
00595 <font class="keywordtype">void</font> CScene::createInstanceAsync(<font class="keyword">const</font> string &shapeName, CTransformShape **pInstance)
00596 {
00597 <font class="comment">// We must attach a bank to the scene (a ShapeBank handle the shape caches and </font>
00598 <font class="comment">// the creation/deletion of the instances)</font>
00599 <a class="code" href="debug_8h.html#a6">nlassert</a>( <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a> != NULL );
00600 *pInstance = NULL;
00601 <font class="comment">// Add the instance request</font>
00602 <a class="code" href="classNL3D_1_1CScene.html#z765_2">_WaitingInstances</a>.insert(TWaitingInstancesMMap::value_type(shapeName,pInstance));
00603 <font class="comment">// If the shape is not present in the bank</font>
00604 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->isPresent( shapeName ) != CShapeBank::Present)
00605 {
00606 <font class="comment">// Load it from file asynchronously</font>
00607 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->loadAsync( strlwr(shapeName), <a class="code" href="classNL3D_1_1CScene.html#z752_8">getDriver</a>() );
00608 }
00609 }
00610
00611 <font class="comment">// ***************************************************************************</font>
<a name="l00612"></a><a class="code" href="classNL3D_1_1CScene.html#z755_5">00612</a> <font class="keywordtype">void</font> CScene::deleteInstance(CTransformShape *pTrfmShp)
00613 {
00614 IShape *pShp = NULL;
00615 <font class="keywordflow">if</font>( pTrfmShp == NULL )
00616 <font class="keywordflow">return</font>;
00617
00618 pShp = pTrfmShp->Shape;
00619
00620 <a class="code" href="classNL3D_1_1CMOT.html#z614_1">deleteModel</a>( pTrfmShp );
00621
00622 <font class="keywordflow">if</font> (pShp)
00623 {
00624 <font class="comment">// Even if model already deleted by smarptr the release function works</font>
00625 <a class="code" href="classNL3D_1_1CScene.html#z765_1">_ShapeBank</a>->release( pShp );
00626 }
00627
00628 }
00629
00630 <font class="comment">// ***************************************************************************</font>
00631 <font class="comment">// ANIMATION FOR LIGHT MAPS</font>
<a name="l00632"></a><a class="code" href="classNL3D_1_1CScene.html#z756_1">00632</a> <font class="keywordtype">void</font> CScene::setAutoAnim( CAnimation *pAnim )
00633 {
00634 uint nAnimNb;
00635 <font class="comment">// Reset the automatic animation if no animation wanted</font>
00636 <font class="keywordflow">if</font>( pAnim == NULL )
00637 {
00638 set<CAnimatedLightmap*>::iterator itSAL = <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.begin();
00639 <font class="keywordflow">while</font>( itSAL != <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.end() )
00640 {
00641 <font class="keyword">delete</font> *itSAL;
00642 ++itSAL;
00643 }
00644 <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.clear();
00645 nAnimNb = <a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a>.getAnimationIdByName(<font class="stringliteral">"Automatic"</font>);
00646 <font class="keywordflow">if</font>( nAnimNb != CAnimationSet::NotFound )
00647 {
00648 CAnimation *anim = <a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a>.getAnimation( nAnimNb );
00649 <font class="keyword">delete</font> anim;
00650 }
00651 <a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a>.reset();
00652 <a class="code" href="classNL3D_1_1CScene.html#o16">_LMAnimsAuto</a>.deleteAll();
00653 <font class="keywordflow">return</font>;
00654 }
00655
00656
00657 set<string> setTrackNames;
00658 pAnim->getTrackNames( setTrackNames );
00659
00660 nAnimNb = <a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a>.addAnimation( <font class="stringliteral">"Automatic"</font>, pAnim );
00661 <a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a>.build();
00662 CChannelMixer *cm = <font class="keyword">new</font> CChannelMixer();
00663 cm->setAnimationSet( &<a class="code" href="classNL3D_1_1CScene.html#o14">_LightmapAnimations</a> );
00664
00665 set<string>::iterator itSel = setTrackNames.begin();
00666 <font class="keywordflow">while</font> ( itSel != setTrackNames.end() )
00667 {
00668 string ate = *itSel;
00669 <font class="keywordflow">if</font>( strncmp( itSel->c_str(), <font class="stringliteral">"LightmapController."</font>, 19 ) == 0 )
00670 {
00671 CAnimatedLightmap *animLM = <font class="keyword">new</font> CAnimatedLightmap();
00672 animLM->setName( *itSel );
00673
00674 cm->addChannel( animLM->getName(), animLM, animLM->getValue(CAnimatedLightmap::FactorValue),
00675 animLM->getDefaultTrack(CAnimatedLightmap::FactorValue), CAnimatedLightmap::FactorValue,
00676 CAnimatedLightmap::OwnerBit, <font class="keyword">false</font>);
00677
00678 <font class="comment">//animLM->registerToChannelMixer( cm, "" );</font>
00679 <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.insert( animLM );
00680
00681 }
00682 ++itSel;
00683 }
00684
00685 CAnimationPlaylist *pl = <font class="keyword">new</font> CAnimationPlaylist();
00686 pl->setAnimation( 0, nAnimNb );
00687 pl->setWrapMode( 0, CAnimationPlaylist::Repeat );
00688 <a class="code" href="classNL3D_1_1CScene.html#o16">_LMAnimsAuto</a>.addPlaylist(pl,cm);
00689 }
00690
00691 <font class="comment">// ***************************************************************************</font>
00692
<a name="l00693"></a><a class="code" href="classNL3D_1_1CScene.html#z756_0">00693</a> <font class="keywordtype">void</font> CScene::loadLightmapAutoAnim( <font class="keyword">const</font> std::string &filename )
00694 {
00695 <font class="keywordflow">try</font>
00696 {
00697 CAnimation *anim = <font class="keyword">new</font> CAnimation();
00698 CIFile fIn( CPath::lookup(filename) );
00699 anim->serial( fIn );
00700
00701 <a class="code" href="classNL3D_1_1CScene.html#z756_1">setAutoAnim</a>( anim );
00702 }
00703 <font class="keywordflow">catch</font>(EPathNotFound &)
00704 {
00705 <font class="keywordflow">return</font>;
00706 }
00707 }
00708
00709 <font class="comment">// ***************************************************************************</font>
<a name="l00710"></a><a class="code" href="classNL3D_1_1CScene.html#z756_2">00710</a> <font class="keywordtype">void</font> CScene::animate( <a class="code" href="namespaceNL3D.html#a2">TGlobalAnimationTime</a> atTime )
00711 {
00712 <font class="keywordflow">if</font> (_FirstAnimateCall)
00713 {
00714 <a class="code" href="classNL3D_1_1CScene.html#o4">_RealTime</a> = atTime ;
00715 <font class="comment">// dummy value for first frame</font>
00716 <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> = 0.01f ;
00717 <a class="code" href="classNL3D_1_1CScene.html#o5">_FirstAnimateCall</a> = <font class="keyword">false</font> ;
00718 }
00719 <font class="keywordflow">else</font>
00720 {
00721 <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> = (float) (atTime - <a class="code" href="classNL3D_1_1CScene.html#o4">_RealTime</a>) ;
00722 <font class="comment">//nlassert(_EllapsedTime >= 0);</font>
00723 <font class="keywordflow">if</font> (<a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> < 0.0f) <font class="comment">// NT WorkStation PATCH (Yes you are not dreaming</font>
00724 <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> = 0.01f; <font class="comment">// deltaTime can be less than zero!!)</font>
00725 <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> = fabsf(<a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a>);
00726 <a class="code" href="classNL3D_1_1CScene.html#o4">_RealTime</a> = atTime ;
00727 <a class="code" href="classNL3D_1_1CScene.html#o3">_CurrentTime</a> += <a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a> ;
00728 }
00729
00730 <a class="code" href="classNL3D_1_1CScene.html#o16">_LMAnimsAuto</a>.animate( atTime );
00731 <a class="code" href="classNL3D_1_1CScene.html#z768_0">_ParticleSystemManager</a>.processAnimate(<a class="code" href="classNL3D_1_1CScene.html#o6">_EllapsedTime</a>); <font class="comment">// deals with permanently animated particle systems</font>
00732
00733
00734 <font class="comment">// Change PointLightFactors of all pointLights in registered Igs.</font>
00735 <font class="comment">//----------------</font>
00736 <font class="keyword">static</font> vector<string> anlNames;
00737 <font class="keyword">static</font> vector<CRGBA> anlFactors;
00738 anlNames.clear();
00739 anlFactors.clear();
00740 <font class="comment">// First list all current AnimatedLightmaps (for faster vector iteration per ig)</font>
00741 std::set<CAnimatedLightmap*>::iterator itAnlSet;
00742 <font class="keywordflow">for</font>(itAnlSet= <a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.begin(); itAnlSet!=<a class="code" href="classNL3D_1_1CScene.html#o15">_AnimatedLightmap</a>.end(); itAnlSet++)
00743 {
00744 <font class="keyword">const</font> <font class="keywordtype">char</font> *GroupName = strchr( (*itAnlSet)->getName().c_str(), <font class="charliteral">'.'</font>)+1;
00745 <font class="comment">// Append to vector</font>
00746 anlNames.push_back(GroupName);
00747 anlFactors.push_back( (*itAnlSet)->getFactor() );
00748 }
00749
00750 <font class="comment">// For all registered igs.</font>
00751 <a class="code" href="classNL3D_1_1CScene.html#u2">ItAnimatedIgSet</a> itAnIgSet;
00752 <font class="keywordflow">for</font>(itAnIgSet= <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.begin(); itAnIgSet!=<a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.end(); itAnIgSet++)
00753 {
00754 CInstanceGroup *ig= *itAnIgSet;
00755 <font class="comment">// For all Animated Light Factor</font>
00756 <font class="keywordflow">for</font>(uint i= 0; i<anlNames.size(); i++)
00757 {
00758 ig->setPointLightFactor(anlNames[i], anlFactors[i]);
00759 }
00760 }
00761 }
00762
00763
00764 <font class="comment">// ***************************************************************************</font>
<a name="l00765"></a><a class="code" href="classNL3D_1_1CScene.html#z757_1">00765</a> <font class="keywordtype">float</font> CScene::getNbFaceAsked ()<font class="keyword"> const</font>
00766 <font class="keyword"></font>{
00767 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00768 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->getNbFaceAsked ();
00769 }
00770
00771
00772 <font class="comment">// ***************************************************************************</font>
<a name="l00773"></a><a class="code" href="classNL3D_1_1CScene.html#z757_2">00773</a> <font class="keywordtype">void</font> CScene::setGroupLoadMaxPolygon(<font class="keyword">const</font> std::string &group, uint nFaces)
00774 {
00775 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00776 nFaces= max(nFaces, (uint)1);
00777 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->setGroupNbFaceWanted(group, nFaces);
00778 }
00779 <font class="comment">// ***************************************************************************</font>
<a name="l00780"></a><a class="code" href="classNL3D_1_1CScene.html#z757_3">00780</a> uint CScene::getGroupLoadMaxPolygon(<font class="keyword">const</font> std::string &group)
00781 {
00782 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00783 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->getGroupNbFaceWanted(group);
00784 }
00785 <font class="comment">// ***************************************************************************</font>
<a name="l00786"></a><a class="code" href="classNL3D_1_1CScene.html#z757_4">00786</a> <font class="keywordtype">float</font> CScene::getGroupNbFaceAsked (<font class="keyword">const</font> std::string &group)<font class="keyword"> const</font>
00787 <font class="keyword"></font>{
00788 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00789 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->getGroupNbFaceAsked(group);
00790 }
00791
00792
00793
00794 <font class="comment">// ***************************************************************************</font>
<a name="l00795"></a><a class="code" href="classNL3D_1_1CScene.html#z757_5">00795</a> <font class="keywordtype">void</font> CScene::setPolygonBalancingMode(TPolygonBalancingMode polBalMode)
00796 {
00797 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00798 <a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->PolygonBalancingMode= (CLoadBalancingGroup::TPolygonBalancingMode)(uint)polBalMode;
00799 }
00800
00801
00802 <font class="comment">// ***************************************************************************</font>
<a name="l00803"></a><a class="code" href="classNL3D_1_1CScene.html#z757_6">00803</a> CScene::TPolygonBalancingMode CScene::getPolygonBalancingMode()<font class="keyword"> const</font>
00804 <font class="keyword"></font>{
00805 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>);
00806 <font class="keywordflow">return</font> (CScene::TPolygonBalancingMode)(uint)<a class="code" href="classNL3D_1_1CScene.html#z764_4">LoadBalancingTrav</a>->PolygonBalancingMode;
00807 }
00808
00809 <font class="comment">// ***************************************************************************</font>
<a name="l00810"></a><a class="code" href="classNL3D_1_1CScene.html#z759_0">00810</a> <font class="keywordtype">void</font> CScene::setLayersRenderingOrder(<font class="keywordtype">bool</font> directOrder <font class="comment">/*= true*/</font>)
00811 {
00812 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>);
00813 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setLayersRenderingOrder(directOrder);
00814 }
00815
00816 <font class="comment">// ***************************************************************************</font>
<a name="l00817"></a><a class="code" href="classNL3D_1_1CScene.html#z759_1">00817</a> <font class="keywordtype">bool</font> CScene::getLayersRenderingOrder()<font class="keyword"> const</font>
00818 <font class="keyword"></font>{
00819 <a class="code" href="debug_8h.html#a6">nlassert</a>(<a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>);
00820 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->getLayersRenderingOrder();
00821 }
00822
00823 <font class="comment">// ***************************************************************************</font>
<a name="l00824"></a><a class="code" href="classNL3D_1_1CScene.html#a7">00824</a> CParticleSystemManager &CScene::getParticleSystemManager()
00825 {
00826 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z768_0">_ParticleSystemManager</a>;
00827 }
00828
00829
00830 <font class="comment">// ***************************************************************************</font>
00831 <font class="comment">// ***************************************************************************</font>
00832 <font class="comment">// Lighting Mgt.</font>
00833 <font class="comment">// ***************************************************************************</font>
00834 <font class="comment">// ***************************************************************************</font>
00835
00836
00837 <font class="comment">// ***************************************************************************</font>
<a name="l00838"></a><a class="code" href="classNL3D_1_1CScene.html#z760_0">00838</a> <font class="keywordtype">void</font> CScene::enableLightingSystem(<font class="keywordtype">bool</font> enable)
00839 {
00840 <a class="code" href="classNL3D_1_1CScene.html#o18">_LightingSystemEnabled</a>= enable;
00841
00842 <font class="comment">// Set to RenderTrav and LightTrav</font>
00843 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->LightingSystemEnabled= <a class="code" href="classNL3D_1_1CScene.html#o18">_LightingSystemEnabled</a>;
00844 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->LightingSystemEnabled= <a class="code" href="classNL3D_1_1CScene.html#o18">_LightingSystemEnabled</a>;
00845 }
00846
00847
00848 <font class="comment">// ***************************************************************************</font>
<a name="l00849"></a><a class="code" href="classNL3D_1_1CScene.html#z760_2">00849</a> <font class="keywordtype">void</font> CScene::setAmbientGlobal(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> ambient)
00850 {
00851 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->AmbientGlobal= ambient;
00852 }
<a name="l00853"></a><a class="code" href="classNL3D_1_1CScene.html#z760_3">00853</a> <font class="keywordtype">void</font> CScene::setSunAmbient(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> ambient)
00854 {
00855 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunAmbient= ambient;
00856 }
<a name="l00857"></a><a class="code" href="classNL3D_1_1CScene.html#z760_4">00857</a> <font class="keywordtype">void</font> CScene::setSunDiffuse(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> diffuse)
00858 {
00859 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunDiffuse= diffuse;
00860 }
<a name="l00861"></a><a class="code" href="classNL3D_1_1CScene.html#z760_5">00861</a> <font class="keywordtype">void</font> CScene::setSunSpecular(<a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> specular)
00862 {
00863 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunSpecular= specular;
00864 }
<a name="l00865"></a><a class="code" href="classNL3D_1_1CScene.html#z760_6">00865</a> <font class="keywordtype">void</font> CScene::setSunDirection(<font class="keyword">const</font> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> &direction)
00866 {
00867 <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->setSunDirection(direction);
00868 }
00869
00870
00871 <font class="comment">// ***************************************************************************</font>
<a name="l00872"></a><a class="code" href="classNL3D_1_1CScene.html#z760_7">00872</a> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> CScene::getAmbientGlobal()<font class="keyword"> const</font>
00873 <font class="keyword"></font>{
00874 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->AmbientGlobal;
00875 }
<a name="l00876"></a><a class="code" href="classNL3D_1_1CScene.html#z760_8">00876</a> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> CScene::getSunAmbient()<font class="keyword"> const</font>
00877 <font class="keyword"></font>{
00878 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunAmbient;
00879 }
<a name="l00880"></a><a class="code" href="classNL3D_1_1CScene.html#z760_9">00880</a> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> CScene::getSunDiffuse()<font class="keyword"> const</font>
00881 <font class="keyword"></font>{
00882 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunDiffuse;
00883 }
<a name="l00884"></a><a class="code" href="classNL3D_1_1CScene.html#z760_10">00884</a> <a class="code" href="classNLMISC_1_1CRGBA.html">NLMISC::CRGBA</a> CScene::getSunSpecular()<font class="keyword"> const</font>
00885 <font class="keyword"></font>{
00886 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->SunSpecular;
00887 }
<a name="l00888"></a><a class="code" href="classNL3D_1_1CScene.html#z760_11">00888</a> <a class="code" href="classNLMISC_1_1CVector.html">NLMISC::CVector</a> CScene::getSunDirection()<font class="keyword"> const</font>
00889 <font class="keyword"></font>{
00890 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_5">RenderTrav</a>->getSunDirection();
00891 }
00892
00893
00894 <font class="comment">// ***************************************************************************</font>
<a name="l00895"></a><a class="code" href="classNL3D_1_1CScene.html#z760_12">00895</a> <font class="keywordtype">void</font> CScene::setMaxLightContribution(uint nlights)
00896 {
00897 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->LightingManager.setMaxLightContribution(nlights);
00898 }
<a name="l00899"></a><a class="code" href="classNL3D_1_1CScene.html#z760_13">00899</a> uint CScene::getMaxLightContribution()<font class="keyword"> const</font>
00900 <font class="keyword"></font>{
00901 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->LightingManager.getMaxLightContribution();
00902 }
00903
<a name="l00904"></a><a class="code" href="classNL3D_1_1CScene.html#z760_14">00904</a> <font class="keywordtype">void</font> CScene::setLightTransitionThreshold(<font class="keywordtype">float</font> lightTransitionThreshold)
00905 {
00906 <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->LightingManager.setLightTransitionThreshold(lightTransitionThreshold);
00907 }
<a name="l00908"></a><a class="code" href="classNL3D_1_1CScene.html#z760_15">00908</a> <font class="keywordtype">float</font> CScene::getLightTransitionThreshold()<font class="keyword"> const</font>
00909 <font class="keyword"></font>{
00910 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#z764_2">LightTrav</a>->LightingManager.getLightTransitionThreshold();
00911 }
00912
00913
00914 <font class="comment">// ***************************************************************************</font>
<a name="l00915"></a><a class="code" href="classNL3D_1_1CScene.html#z756_3">00915</a> <font class="keywordtype">void</font> CScene::addInstanceGroupForLightAnimation(CInstanceGroup *ig)
00916 {
00917 <a class="code" href="debug_8h.html#a6">nlassert</a>( ig );
00918 <a class="code" href="debug_8h.html#a6">nlassert</a>( <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.find(ig) == <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.end() );
00919 <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.insert(ig);
00920 }
00921
00922 <font class="comment">// ***************************************************************************</font>
<a name="l00923"></a><a class="code" href="classNL3D_1_1CScene.html#z756_4">00923</a> <font class="keywordtype">void</font> CScene::removeInstanceGroupForLightAnimation(CInstanceGroup *ig)
00924 {
00925 <a class="code" href="debug_8h.html#a6">nlassert</a>( ig );
00926 <a class="code" href="classNL3D_1_1CScene.html#u2">ItAnimatedIgSet</a> itIg= <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.find(ig);
00927 <a class="code" href="debug_8h.html#a6">nlassert</a>( itIg != <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.end() );
00928 <a class="code" href="classNL3D_1_1CScene.html#o17">_AnimatedIgSet</a>.erase(itIg);
00929 }
00930
00931
00932 <font class="comment">// ***************************************************************************</font>
<a name="l00933"></a><a class="code" href="classNL3D_1_1CScene.html#z758_2">00933</a> <font class="keywordtype">void</font> CScene::setCoarseMeshLightingUpdate(uint8 period)
00934 {
00935 <a class="code" href="classNL3D_1_1CScene.html#o19">_CoarseMeshLightingUpdate</a>= max((uint8)1, period);
00936 }
00937
00938
00939 <font class="comment">// ***************************************************************************</font>
00940 <font class="comment">// ***************************************************************************</font>
00942 <font class="comment">// ***************************************************************************</font>
00943 <font class="comment">// ***************************************************************************</font>
00944
00945 <font class="comment">// ***************************************************************************</font>
<a name="l00946"></a><a class="code" href="classNL3D_1_1CScene.html#z761_0">00946</a> <font class="keywordtype">void</font> CScene::setGlobalWindPower(<font class="keywordtype">float</font> gwp)
00947 {
00948 <a class="code" href="classNL3D_1_1CScene.html#z769_0">_GlobalWindPower</a>= gwp;
00949 }
00950 <font class="comment">// ***************************************************************************</font>
<a name="l00951"></a><a class="code" href="classNL3D_1_1CScene.html#z761_2">00951</a> <font class="keywordtype">void</font> CScene::setGlobalWindDirection(<font class="keyword">const</font> CVector &gwd)
00952 {
00953 <a class="code" href="classNL3D_1_1CScene.html#z769_1">_GlobalWindDirection</a>= gwd;
00954 <a class="code" href="classNL3D_1_1CScene.html#z769_1">_GlobalWindDirection</a>.z= 0;
00955 <a class="code" href="classNL3D_1_1CScene.html#z769_1">_GlobalWindDirection</a>.normalize();
00956 }
00957
00958
00959 <font class="comment">// ***************************************************************************</font>
00960 <font class="comment">// ***************************************************************************</font>
00962 <font class="comment">// ***************************************************************************</font>
00963 <font class="comment">// ***************************************************************************</font>
00964
00965 <font class="comment">// ***************************************************************************</font>
<a name="l00966"></a><a class="code" href="classNL3D_1_1CScene.html#z763_2">00966</a> CScene::ItSkeletonModelList CScene::appendSkeletonModelToList(CSkeletonModel *skel)
00967 {
00968 <a class="code" href="classNL3D_1_1CScene.html#o22">_SkeletonModelList</a>.push_front(skel);
00969 <font class="keywordflow">return</font> <a class="code" href="classNL3D_1_1CScene.html#o22">_SkeletonModelList</a>.begin();
00970 }
00971
00972 <font class="comment">// ***************************************************************************</font>
<a name="l00973"></a><a class="code" href="classNL3D_1_1CScene.html#z763_3">00973</a> <font class="keywordtype">void</font> CScene::eraseSkeletonModelToList(CScene::ItSkeletonModelList it)
00974 {
00975 <a class="code" href="classNL3D_1_1CScene.html#o22">_SkeletonModelList</a>.erase(it);
00976 }
00977
00978
00979 } <font class="comment">// NL3D</font>
</pre></div>
<!-- footer -->
<BR><FONT Size=+5> </FONT>
</TD>
<TD WIDTH=15><IMG SRC=/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|