UNPKG

19 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <title>FluxCameras - Documentation</title>
6
7 <script src="scripts/prettify/prettify.js"></script>
8 <script src="scripts/prettify/lang-css.js"></script>
9 <!--[if lt IE 9]>
10 <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11 <![endif]-->
12 <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
13 <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
14 <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
15</head>
16<body>
17
18<input type="checkbox" id="nav-trigger" class="nav-trigger" />
19<label for="nav-trigger" class="navicon-button x">
20 <div class="navicon"></div>
21</label>
22
23<label for="nav-trigger" class="overlay"></label>
24
25<nav>
26 <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="EdgesHelper.html">EdgesHelper</a><ul class='methods'><li data-type='method'><a href="EdgesHelper.html#.AddEdges">AddEdges</a></li></ul></li><li><a href="FluxCameras.html">FluxCameras</a><ul class='methods'><li data-type='method'><a href="FluxCameras.html#.cameraFromJSON">cameraFromJSON</a></li><li data-type='method'><a href="FluxCameras.html#.cameraToJSON">cameraToJSON</a></li><li data-type='method'><a href="FluxCameras.html#fromJSON">fromJSON</a></li><li data-type='method'><a href="FluxCameras.html#getCamera">getCamera</a></li><li data-type='method'><a href="FluxCameras.html#setView">setView</a></li><li data-type='method'><a href="FluxCameras.html#toJSON">toJSON</a></li><li data-type='method'><a href="FluxCameras.html#updateCamera">updateCamera</a></li></ul></li><li><a href="FluxRenderContext.html">FluxRenderContext</a><ul class='methods'><li data-type='method'><a href="FluxRenderContext.html#.getNextContext">getNextContext</a></li></ul></li><li><a href="FluxRenderer.html">FluxRenderer</a><ul class='methods'><li data-type='method'><a href="FluxRenderer.html#addControls">addControls</a></li><li data-type='method'><a href="FluxRenderer.html#anyValidPrims">anyValidPrims</a></li><li data-type='method'><a href="FluxRenderer.html#detach">detach</a></li><li data-type='method'><a href="FluxRenderer.html#doRender">doRender</a></li><li data-type='method'><a href="FluxRenderer.html#focus">focus</a></li><li data-type='method'><a href="FluxRenderer.html#fromJSON">fromJSON</a></li><li data-type='method'><a href="FluxRenderer.html#getGlCanvas">getGlCanvas</a></li><li data-type='method'><a href="FluxRenderer.html#getSelection">getSelection</a></li><li data-type='method'><a href="FluxRenderer.html#homeCamera">homeCamera</a></li><li data-type='method'><a href="FluxRenderer.html#setClearColor">setClearColor</a></li><li data-type='method'><a href="FluxRenderer.html#setEdgesMode">setEdgesMode</a></li><li data-type='method'><a href="FluxRenderer.html#setHelpersVisible">setHelpersVisible</a></li><li data-type='method'><a href="FluxRenderer.html#setLights">setLights</a></li><li data-type='method'><a href="FluxRenderer.html#setModel">setModel</a></li><li data-type='method'><a href="FluxRenderer.html#setSelection">setSelection</a></li><li data-type='method'><a href="FluxRenderer.html#setSelectionMaterial">setSelectionMaterial</a></li><li data-type='method'><a href="FluxRenderer.html#setSize">setSize</a></li><li data-type='method'><a href="FluxRenderer.html#setView">setView</a></li><li data-type='method'><a href="FluxRenderer.html#toJSON">toJSON</a></li></ul></li><li><a href="FluxViewport.html">FluxViewport</a><ul class='methods'><li data-type='method'><a href="FluxViewport.html#.getChangeEvent">getChangeEvent</a></li><li data-type='method'><a href="FluxViewport.html#.getEdgesModes">getEdgesModes</a></li><li data-type='method'><a href="FluxViewport.html#.getEvents">getEvents</a></li><li data-type='method'><a href="FluxViewport.html#.getSelectionModes">getSelectionModes</a></li><li data-type='method'><a href="FluxViewport.html#.getViews">getViews</a></li><li data-type='method'><a href="FluxViewport.html#.isKnownGeom">isKnownGeom</a></li><li data-type='method'><a href="FluxViewport.html#activateShadows">activateShadows</a></li><li data-type='method'><a href="FluxViewport.html#addControls">addControls</a></li><li data-type='method'><a href="FluxViewport.html#downloadState">downloadState</a></li><li data-type='method'><a href="FluxViewport.html#focus">focus</a></li><li data-type='method'><a href="FluxViewport.html#fromJSON">fromJSON</a></li><li data-type='method'><a href="FluxViewport.html#getAutoFocus">getAutoFocus</a></li><li data-type='method'><a href="FluxViewport.html#getGlCanvas">getGlCanvas</a></li><li data-type='method'><a href="FluxViewport.html#getJson">getJson</a></li><li data-type='method'><a href="FluxViewport.html#getObjectMap">getObjectMap</a></li><li data-type='method'><a href="FluxViewport.html#getSelection">getSelection</a></li><li data-type='method'><a href="FluxViewport.html#homeCamera">homeCamera</a></li><li data-type='method'><a href="FluxViewport.html#render">render</a></li><li data-type='method'><a href="FluxViewport.html#setAutoFocus">setAutoFocus</a></li><li data-type='method'><a href="FluxViewport.html#setClearColor">setClearColor</a></li><li data-type='method'><a href="FluxViewport.html#setEdgesMode">setEdgesMode</a></li><li data-type='method'><a href="FluxViewport.html#setFogDensity">setFogDensity</a></li><li data-type='method'><a href="FluxViewport.html#setGeometryEntity">setGeometryEntity</a></li><li data-type='method'><a href="FluxViewport.html#setGeometryJson">setGeometryJson</a></li><li data-type='method'><a href="FluxViewport.html#setHelpersVisible">setHelpersVisible</a></li><li data-type='method'><a href="FluxViewport.html#setSelection">setSelection</a></li><li data-type='method'><a href="FluxViewport.html#setSelectionMaterial">setSelectionMaterial</a></li><li data-type='method'><a href="FluxViewport.html#setSize">setSize</a></li><li data-type='method'><a href="FluxViewport.html#setTessUrl">setTessUrl</a></li><li data-type='method'><a href="FluxViewport.html#setupDefaultLighting">setupDefaultLighting</a></li><li data-type='method'><a href="FluxViewport.html#setView">setView</a></li><li data-type='method'><a href="FluxViewport.html#toJSON">toJSON</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#_deleteFromScene">_deleteFromScene</a></li><li><a href="global.html#_removeGeometries">_removeGeometries</a></li></ul>
27</nav>
28
29<div id="main">
30
31 <h1 class="page-title">FluxCameras</h1>
32
33
34
35
36
37
38
39<section>
40
41<header>
42
43 <h2>
44 FluxCameras
45 </h2>
46
47
48</header>
49
50<article>
51 <div class="container-overview">
52
53
54
55
56
57 <h4 class="name" id="FluxCameras"><span class="type-signature"></span>new FluxCameras<span class="signature">(width, height)</span><span class="type-signature"></span></h4>
58
59
60
61
62
63<div class="description">
64 Class for managing multiple cameras used in a viewport.
65</div>
66
67
68
69
70
71
72
73
74
75 <h5>Parameters:</h5>
76
77
78<table class="params">
79 <thead>
80 <tr>
81
82 <th>Name</th>
83
84
85 <th>Type</th>
86
87
88
89
90
91 <th class="last">Description</th>
92 </tr>
93 </thead>
94
95 <tbody>
96
97
98 <tr>
99
100 <td class="name"><code>width</code></td>
101
102
103 <td class="type">
104
105
106<span class="param-type">Number</span>
107
108
109
110 </td>
111
112
113
114
115
116 <td class="description last">Width of the viewport</td>
117 </tr>
118
119
120
121 <tr>
122
123 <td class="name"><code>height</code></td>
124
125
126 <td class="type">
127
128
129<span class="param-type">Number</span>
130
131
132
133 </td>
134
135
136
137
138
139 <td class="description last">Height of the viewport</td>
140 </tr>
141
142
143 </tbody>
144</table>
145
146
147
148
149
150
151<dl class="details">
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 <dt class="tag-source">Source:</dt>
179 <dd class="tag-source"><ul class="dummy"><li>
180 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line5">line 5</a>
181 </li></ul></dd>
182
183
184
185
186
187
188
189</dl>
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207 </div>
208
209
210
211
212
213
214
215
216
217
218
219
220 <h3 class="subsection-title">Members</h3>
221
222
223
224<h4 class="name" id=".VIEWS"><span class="type-signature">(static) </span>VIEWS<span class="type-signature"> :Object</span></h4>
225
226
227
228
229<div class="description">
230 Enumeration of all possible views for the camera.
231Values are perspective, top, bottom, front, back, right, left.
232</div>
233
234
235
236 <h5>Type:</h5>
237 <ul>
238 <li>
239
240<span class="param-type">Object</span>
241
242
243 </li>
244 </ul>
245
246
247
248
249
250<dl class="details">
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 <dt class="tag-source">Source:</dt>
278 <dd class="tag-source"><ul class="dummy"><li>
279 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line28">line 28</a>
280 </li></ul></dd>
281
282
283
284
285
286
287
288</dl>
289
290
291
292
293
294
295
296
297
298
299 <h3 class="subsection-title">Methods</h3>
300
301
302
303
304
305
306 <h4 class="name" id=".cameraFromJSON"><span class="type-signature">(static) </span>cameraFromJSON<span class="signature">(camera, data)</span><span class="type-signature"></span></h4>
307
308
309
310
311
312<div class="description">
313 Rehydrate camera instance from an object property tree.
314</div>
315
316
317
318
319
320
321
322
323
324 <h5>Parameters:</h5>
325
326
327<table class="params">
328 <thead>
329 <tr>
330
331 <th>Name</th>
332
333
334 <th>Type</th>
335
336
337
338
339
340 <th class="last">Description</th>
341 </tr>
342 </thead>
343
344 <tbody>
345
346
347 <tr>
348
349 <td class="name"><code>camera</code></td>
350
351
352 <td class="type">
353
354
355<span class="param-type">THREE.camera</span>
356
357
358
359 </td>
360
361
362
363
364
365 <td class="description last">The camera to receive data</td>
366 </tr>
367
368
369
370 <tr>
371
372 <td class="name"><code>data</code></td>
373
374
375 <td class="type">
376
377
378<span class="param-type">Object</span>
379
380
381
382 </td>
383
384
385
386
387
388 <td class="description last">The data to parse and apply</td>
389 </tr>
390
391
392 </tbody>
393</table>
394
395
396
397
398
399
400<dl class="details">
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 <dt class="tag-source">Source:</dt>
428 <dd class="tag-source"><ul class="dummy"><li>
429 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line171">line 171</a>
430 </li></ul></dd>
431
432
433
434
435
436
437
438</dl>
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460 <h4 class="name" id=".cameraToJSON"><span class="type-signature">(static) </span>cameraToJSON<span class="signature">(camera)</span><span class="type-signature"> &rarr; {Object}</span></h4>
461
462
463
464
465
466<div class="description">
467 Extract only relevant properties from a camera
468</div>
469
470
471
472
473
474
475
476
477
478 <h5>Parameters:</h5>
479
480
481<table class="params">
482 <thead>
483 <tr>
484
485 <th>Name</th>
486
487
488 <th>Type</th>
489
490
491
492
493
494 <th class="last">Description</th>
495 </tr>
496 </thead>
497
498 <tbody>
499
500
501 <tr>
502
503 <td class="name"><code>camera</code></td>
504
505
506 <td class="type">
507
508
509<span class="param-type">THREE.Camera</span>
510
511
512
513 </td>
514
515
516
517
518
519 <td class="description last">The camera source</td>
520 </tr>
521
522
523 </tbody>
524</table>
525
526
527
528
529
530
531<dl class="details">
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 <dt class="tag-source">Source:</dt>
559 <dd class="tag-source"><ul class="dummy"><li>
560 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line115">line 115</a>
561 </li></ul></dd>
562
563
564
565
566
567
568
569</dl>
570
571
572
573
574
575
576
577
578
579
580
581
582
583<h5>Returns:</h5>
584
585
586<div class="param-desc">
587 The camera data
588</div>
589
590
591
592<dl class="param-type">
593 <dt>
594 Type
595 </dt>
596 <dd>
597
598<span class="param-type">Object</span>
599
600
601 </dd>
602</dl>
603
604
605
606
607
608
609
610
611
612
613 <h4 class="name" id="fromJSON"><span class="type-signature"></span>fromJSON<span class="signature">(serializableCameras)</span><span class="type-signature"></span></h4>
614
615
616
617
618
619<div class="description">
620 Update the corresponding cameras in this object from a serialized object.
621</div>
622
623
624
625
626
627
628
629
630
631 <h5>Parameters:</h5>
632
633
634<table class="params">
635 <thead>
636 <tr>
637
638 <th>Name</th>
639
640
641 <th>Type</th>
642
643
644
645
646
647 <th class="last">Description</th>
648 </tr>
649 </thead>
650
651 <tbody>
652
653
654 <tr>
655
656 <td class="name"><code>serializableCameras</code></td>
657
658
659 <td class="type">
660
661
662<span class="param-type">Object</span>
663
664
665
666 </td>
667
668
669
670
671
672 <td class="description last">The camera data to use.</td>
673 </tr>
674
675
676 </tbody>
677</table>
678
679
680
681
682
683
684<dl class="details">
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 <dt class="tag-source">Source:</dt>
712 <dd class="tag-source"><ul class="dummy"><li>
713 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line211">line 211</a>
714 </li></ul></dd>
715
716
717
718
719
720
721
722</dl>
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744 <h4 class="name" id="getCamera"><span class="type-signature"></span>getCamera<span class="signature">()</span><span class="type-signature"> &rarr; {THREE.Camera}</span></h4>
745
746
747
748
749
750<div class="description">
751 Get the current camera object
752</div>
753
754
755
756
757
758
759
760
761
762
763
764
765
766<dl class="details">
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 <dt class="tag-source">Source:</dt>
794 <dd class="tag-source"><ul class="dummy"><li>
795 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line43">line 43</a>
796 </li></ul></dd>
797
798
799
800
801
802
803
804</dl>
805
806
807
808
809
810
811
812
813
814
815
816
817
818<h5>Returns:</h5>
819
820
821<div class="param-desc">
822 The current camera
823</div>
824
825
826
827<dl class="param-type">
828 <dt>
829 Type
830 </dt>
831 <dd>
832
833<span class="param-type">THREE.Camera</span>
834
835
836 </dd>
837</dl>
838
839
840
841
842
843
844
845
846
847
848 <h4 class="name" id="setView"><span class="type-signature"></span>setView<span class="signature">(view)</span><span class="type-signature"></span></h4>
849
850
851
852
853
854<div class="description">
855 Set which camera view to use (ex perspective, top etc.).
856</div>
857
858
859
860
861
862
863
864
865
866 <h5>Parameters:</h5>
867
868
869<table class="params">
870 <thead>
871 <tr>
872
873 <th>Name</th>
874
875
876 <th>Type</th>
877
878
879
880
881
882 <th class="last">Description</th>
883 </tr>
884 </thead>
885
886 <tbody>
887
888
889 <tr>
890
891 <td class="name"><code>view</code></td>
892
893
894 <td class="type">
895
896
897<span class="param-type"><a href="FluxCameras.html#.VIEWS">FluxCameras.VIEWS</a></span>
898
899
900
901 </td>
902
903
904
905
906
907 <td class="description last">The new view mode</td>
908 </tr>
909
910
911 </tbody>
912</table>
913
914
915
916
917
918
919<dl class="details">
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 <dt class="tag-source">Source:</dt>
947 <dd class="tag-source"><ul class="dummy"><li>
948 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line78">line 78</a>
949 </li></ul></dd>
950
951
952
953
954
955
956
957</dl>
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979 <h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
980
981
982
983
984
985<div class="description">
986 Make serializable by pruning all references and building an object property tree
987</div>
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001<dl class="details">
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 <dt class="tag-source">Source:</dt>
1029 <dd class="tag-source"><ul class="dummy"><li>
1030 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line198">line 198</a>
1031 </li></ul></dd>
1032
1033
1034
1035
1036
1037
1038
1039</dl>
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053<h5>Returns:</h5>
1054
1055
1056<div class="param-desc">
1057 The simplified model
1058</div>
1059
1060
1061
1062<dl class="param-type">
1063 <dt>
1064 Type
1065 </dt>
1066 <dd>
1067
1068<span class="param-type">Object</span>
1069
1070
1071 </dd>
1072</dl>
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083 <h4 class="name" id="updateCamera"><span class="type-signature"></span>updateCamera<span class="signature">(width, height)</span><span class="type-signature"></span></h4>
1084
1085
1086
1087
1088
1089<div class="description">
1090 Recompute derived state when the camera is changed.
1091</div>
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101 <h5>Parameters:</h5>
1102
1103
1104<table class="params">
1105 <thead>
1106 <tr>
1107
1108 <th>Name</th>
1109
1110
1111 <th>Type</th>
1112
1113
1114
1115
1116
1117 <th class="last">Description</th>
1118 </tr>
1119 </thead>
1120
1121 <tbody>
1122
1123
1124 <tr>
1125
1126 <td class="name"><code>width</code></td>
1127
1128
1129 <td class="type">
1130
1131
1132<span class="param-type">Number</span>
1133
1134
1135
1136 </td>
1137
1138
1139
1140
1141
1142 <td class="description last">Width of the viewport (used to calculate aspect ratio)</td>
1143 </tr>
1144
1145
1146
1147 <tr>
1148
1149 <td class="name"><code>height</code></td>
1150
1151
1152 <td class="type">
1153
1154
1155<span class="param-type">Number</span>
1156
1157
1158
1159 </td>
1160
1161
1162
1163
1164
1165 <td class="description last">Height of the viewport (used to calculate aspect ratio)</td>
1166 </tr>
1167
1168
1169 </tbody>
1170</table>
1171
1172
1173
1174
1175
1176
1177<dl class="details">
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 <dt class="tag-source">Source:</dt>
1205 <dd class="tag-source"><ul class="dummy"><li>
1206 <a href="FluxCameras.js.html">FluxCameras.js</a>, <a href="FluxCameras.js.html#line97">line 97</a>
1207 </li></ul></dd>
1208
1209
1210
1211
1212
1213
1214
1215</dl>
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238</article>
1239
1240</section>
1241
1242
1243
1244
1245</div>
1246
1247<br class="clear">
1248
1249<footer>
1250 Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jan 05 2017 16:26:56 GMT-0800 (PST) using the Minami theme.
1251</footer>
1252
1253<script>prettyPrint();</script>
1254<script src="scripts/linenumber.js"></script>
1255</body>
1256</html>
\No newline at end of file