@xtctwins/tctwins-core 1.1.19 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/README.md +4 -4
  2. package/dist/tctwins-core.es5.js +27557 -27494
  3. package/dist/tctwins-core.min.es5.js +4 -4
  4. package/package.json +84 -84
  5. package/types/extras/ContextMenu/ContextMenu.d.ts +127 -127
  6. package/types/extras/ContextMenu/index.d.ts +1 -1
  7. package/types/extras/PointerCircle/PointerCircle.d.ts +51 -51
  8. package/types/extras/PointerCircle/index.d.ts +1 -1
  9. package/types/extras/PointerLens/PointerLens.d.ts +146 -146
  10. package/types/extras/index.d.ts +3 -3
  11. package/types/index.d.ts +3 -3
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +204 -204
  13. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +91 -91
  14. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +125 -125
  15. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +151 -151
  16. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsSimulateMouseControl.d.ts +86 -86
  17. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +124 -124
  18. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +5 -5
  19. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -135
  20. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +172 -172
  21. package/types/plugins/AnnotationsPlugin/index.d.ts +2 -2
  22. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +148 -148
  23. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -1
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +253 -253
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +96 -96
  26. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +102 -102
  27. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +192 -192
  28. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsSimulateMouseControl.d.ts +83 -83
  29. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.d.ts +103 -103
  30. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +5 -5
  31. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +223 -223
  32. package/types/plugins/FastNavPlugin/index.d.ts +1 -1
  33. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +142 -142
  34. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -1
  35. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +240 -240
  36. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -1
  37. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +177 -177
  38. package/types/plugins/NavCubePlugin/index.d.ts +1 -1
  39. package/types/plugins/ObjectEditPlugin/ObjectEditPlugin.d.ts +242 -242
  40. package/types/plugins/ObjectEditPlugin/index.d.ts +1 -1
  41. package/types/plugins/SectionPlanesPlugin/SectionBoxControl.d.ts +36 -36
  42. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +186 -186
  43. package/types/plugins/SectionPlanesPlugin/index.d.ts +2 -2
  44. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +66 -66
  45. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -1
  46. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +69 -69
  47. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -41
  48. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -180
  49. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -1
  50. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -24
  51. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +71 -71
  52. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +267 -267
  53. package/types/plugins/TreeViewPlugin/index.d.ts +1 -1
  54. package/types/plugins/TreeViewPlugin/renderService.d.ts +128 -128
  55. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -34
  56. package/types/plugins/ViewCullPlugin/index.d.ts +1 -1
  57. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +236 -236
  58. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -1
  59. package/types/plugins/XTCLoaderPlugin/XTCLoaderPlugin.d.ts +288 -288
  60. package/types/plugins/XTCLoaderPlugin/index.d.ts +1 -1
  61. package/types/plugins/index.d.ts +30 -30
  62. package/types/viewer/Configs.d.ts +46 -46
  63. package/types/viewer/Plugin.d.ts +69 -69
  64. package/types/viewer/Viewer.d.ts +282 -282
  65. package/types/viewer/index.d.ts +6 -6
  66. package/types/viewer/localization/LocaleService.d.ts +183 -183
  67. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -9
  68. package/types/viewer/metadata/MetaModel.d.ts +94 -102
  69. package/types/viewer/metadata/MetaObject.d.ts +74 -74
  70. package/types/viewer/metadata/MetaScene.d.ts +135 -135
  71. package/types/viewer/metadata/Property.d.ts +29 -29
  72. package/types/viewer/metadata/PropertySet.d.ts +31 -31
  73. package/types/viewer/metadata/index.d.ts +6 -6
  74. package/types/viewer/scene/Bitmap/Bitmap.d.ts +255 -255
  75. package/types/viewer/scene/CameraControl/CameraControl.d.ts +777 -777
  76. package/types/viewer/scene/Component.d.ts +155 -155
  77. package/types/viewer/scene/Entity.d.ts +401 -401
  78. package/types/viewer/scene/LineSet/LineSet.d.ts +111 -111
  79. package/types/viewer/scene/camera/Camera.d.ts +364 -364
  80. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -167
  81. package/types/viewer/scene/camera/CameraPath.d.ts +28 -28
  82. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -95
  83. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -57
  84. package/types/viewer/scene/camera/Frustum.d.ts +166 -166
  85. package/types/viewer/scene/camera/Ortho.d.ts +115 -115
  86. package/types/viewer/scene/camera/Perspective.d.ts +136 -136
  87. package/types/viewer/scene/camera/index.d.ts +4 -4
  88. package/types/viewer/scene/geometry/Geometry.d.ts +7 -7
  89. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -95
  90. package/types/viewer/scene/geometry/VBOGeometry.d.ts +62 -62
  91. package/types/viewer/scene/geometry/builders/buildBoxGeometry.d.ts +21 -21
  92. package/types/viewer/scene/geometry/builders/buildBoxLinesGeometry.d.ts +21 -21
  93. package/types/viewer/scene/geometry/builders/buildCylinderGeometry.d.ts +27 -27
  94. package/types/viewer/scene/geometry/builders/buildGridGeometry.d.ts +17 -17
  95. package/types/viewer/scene/geometry/builders/buildPlaneGeometry.d.ts +21 -21
  96. package/types/viewer/scene/geometry/builders/buildSphereGeometry.d.ts +21 -21
  97. package/types/viewer/scene/geometry/builders/buildTorusGeometry.d.ts +25 -25
  98. package/types/viewer/scene/geometry/builders/buildVectorTextGeometry.d.ts +21 -21
  99. package/types/viewer/scene/geometry/builders/index.d.ts +8 -8
  100. package/types/viewer/scene/geometry/index.d.ts +2 -2
  101. package/types/viewer/scene/index.d.ts +23 -23
  102. package/types/viewer/scene/input/input.d.ts +69 -69
  103. package/types/viewer/scene/lights/AmbientLight.d.ts +19 -19
  104. package/types/viewer/scene/lights/DirLight.d.ts +25 -25
  105. package/types/viewer/scene/lights/Light.d.ts +3 -3
  106. package/types/viewer/scene/lights/PointLight.d.ts +30 -30
  107. package/types/viewer/scene/lights/index.d.ts +2 -2
  108. package/types/viewer/scene/marker/Marker.d.ts +136 -136
  109. package/types/viewer/scene/marker/SpriteMarker.d.ts +185 -185
  110. package/types/viewer/scene/marker/index.d.ts +2 -2
  111. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -83
  112. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -241
  113. package/types/viewer/scene/materials/Fresnel.d.ts +148 -148
  114. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -71
  115. package/types/viewer/scene/materials/Material.d.ts +3 -3
  116. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -468
  117. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -206
  118. package/types/viewer/scene/materials/Texture.d.ts +260 -260
  119. package/types/viewer/scene/materials/index.d.ts +6 -6
  120. package/types/viewer/scene/math/Frustum.d.ts +41 -41
  121. package/types/viewer/scene/math/index.d.ts +1 -1
  122. package/types/viewer/scene/math/math.d.ts +104 -104
  123. package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -28
  124. package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -44
  125. package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -39
  126. package/types/viewer/scene/mementos/index.d.ts +3 -3
  127. package/types/viewer/scene/mesh/Mesh.d.ts +793 -793
  128. package/types/viewer/scene/mesh/index.d.ts +1 -1
  129. package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +9 -9
  130. package/types/viewer/scene/models/PerformanceModel/index.d.ts +1 -1
  131. package/types/viewer/scene/models/SceneModel.d.ts +757 -762
  132. package/types/viewer/scene/models/SceneModelEntity.d.ts +417 -417
  133. package/types/viewer/scene/models/SceneModelMesh.d.ts +68 -68
  134. package/types/viewer/scene/models/SceneModelTexture.d.ts +16 -16
  135. package/types/viewer/scene/models/SceneModelTextureSet.d.ts +51 -51
  136. package/types/viewer/scene/models/SceneModelTransform.d.ts +197 -197
  137. package/types/viewer/scene/models/VBOSceneModel/VBOSceneModel.d.ts +7 -7
  138. package/types/viewer/scene/models/index.d.ts +7 -7
  139. package/types/viewer/scene/nodes/Node.d.ts +664 -664
  140. package/types/viewer/scene/nodes/index.d.ts +1 -1
  141. package/types/viewer/scene/postfx/CrossSections.d.ts +42 -42
  142. package/types/viewer/scene/postfx/SAO.d.ts +209 -209
  143. package/types/viewer/scene/scene/Scene.d.ts +1068 -1068
  144. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +110 -110
  145. package/types/viewer/scene/sectionPlane/index.d.ts +1 -1
  146. package/types/viewer/scene/stats.d.ts +40 -40
  147. package/types/viewer/scene/viewport/Viewport.d.ts +23 -23
  148. package/types/viewer/scene/viewport/index.d.ts +1 -1
  149. package/types/viewer/scene/webgl/PickResult.d.ts +115 -115
  150. package/types/viewer/scene/webgl/index.d.ts +1 -1
  151. package/dist/tctwins-core.umd.js +0 -37
@@ -1,777 +1,777 @@
1
- import { Component } from "../Component";
2
- import { Entity } from "../Entity";
3
- import { PickResult } from "../webgl/PickResult";
4
-
5
- /**
6
- * Controls the {@link Camera} with user input, and fires events when the user interacts with pickable {@link Entity}s.
7
- */
8
- export declare class CameraControl extends Component {
9
- PAN_LEFT: number;
10
- PAN_RIGHT: number;
11
- PAN_UP: number;
12
- PAN_DOWN: number;
13
- PAN_FORWARDS: number;
14
- PAN_BACKWARDS: number;
15
- ROTATE_X_POS: number;
16
- ROTATE_X_NEG: number;
17
- ROTATE_Y_POS: number;
18
- ROTATE_Y_NEG: number;
19
- DOLLY_FORWARDS: number;
20
- DOLLY_BACKWARDS: number;
21
- AXIS_VIEW_RIGHT: number;
22
- AXIS_VIEW_BACK: number;
23
- AXIS_VIEW_LEFT: number;
24
- AXIS_VIEW_FRONT: number;
25
- AXIS_VIEW_TOP: number;
26
- AXIS_VIEW_BOTTOM: number;
27
-
28
- /**
29
- * Fires when the model is loaded
30
- * @param event The loaded event
31
- * @param callback Called fired on the event
32
- * @param scope Scope for the callback
33
- */
34
- on(
35
- event: "rightClick",
36
- callback: (e: { event: MouseEvent; pagePos: number[]; canvasPos: number[] }) => void,
37
- scope?: any
38
- ): string;
39
-
40
- /**
41
- * Event fired when the pointer moves while hovering over an Entity.
42
- * @param event The hover event
43
- * @param callback Called fired on the event
44
- * @param scope Scope for the callback
45
- */
46
- on(event: "hover", callback: (e: PickResult) => void, scope?: any): string;
47
-
48
- /**
49
- * Event fired when the pointer moves while hovering over empty space.
50
- * @param event The hoverOff event
51
- * @param callback Called fired on the event
52
- * @param scope Scope for the callback
53
- */
54
- on(event: "hoverOff", callback: (e: { canvasPos: number[] }) => void, scope?: any): string;
55
-
56
- /**
57
- * Event fired when the pointer moves onto an Entity.
58
- * @param event The hoverEnter event
59
- * @param callback Called fired on the event
60
- * @param scope Scope for the callback
61
- */
62
- on(event: "hoverEnter", callback: (e: PickResult) => void, scope?: any): string;
63
-
64
- /**
65
- * Event fired when the pointer moves off an Entity.
66
- * @param event The hoverOut event
67
- * @param callback Called fired on the event
68
- * @param scope Scope for the callback
69
- */
70
- on(event: "hoverOut", callback: (e: { entity: Entity }) => void, scope?: any): string;
71
-
72
- /**
73
- * Event fired when we left-click or tap on an Entity.
74
- * @param event The picked event
75
- * @param callback Called fired on the event
76
- * @param scope Scope for the callback
77
- */
78
- on(event: "picked", callback: (e: PickResult) => void, scope?: any): string;
79
-
80
- /**
81
- * Event fired when we left-click or tap on the surface of an Entity.
82
- * @param event The pickedSurface event
83
- * @param callback Called fired on the event
84
- * @param scope Scope for the callback
85
- */
86
- on(event: "pickedSurface", callback: (e: PickResult) => void, scope?: any): string;
87
-
88
- /**
89
- * Event fired when we left-click or tap on empty space.
90
- * @param event The pickedNothing event
91
- * @param callback Called fired on the event
92
- * @param scope Scope for the callback
93
- */
94
- on(event: "pickedNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
95
-
96
- /**
97
- * Event fired wwhen we left-double-click or double-tap on an Entity.
98
- * @param event The doublePicked event
99
- * @param callback Called fired on the event
100
- * @param scope Scope for the callback
101
- */
102
- on(event: "doublePicked", callback: (e: PickResult) => void, scope?: any): string;
103
-
104
- /**
105
- * Event fired when we left-double-click or double-tap on the surface of an Entity.
106
- * @param event The doublePickedSurface event
107
- * @param callback Called fired on the event
108
- * @param scope Scope for the callback
109
- */
110
- on(event: "doublePickedSurface", callback: (e: PickResult) => void, scope?: any): string;
111
-
112
- /**
113
- * Event fired when we left-double-click or double-tap on empty space.
114
- * @param event The doublePickedNothing event
115
- * @param callback Called fired on the event
116
- * @param scope Scope for the callback
117
- */
118
- on(event: "doublePickedNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
119
-
120
- /**
121
- * Event fired when we left-click (press and release without dragging) on the surface of an Entity.
122
- * Dragging to rotate or pan the Camera does not fire this event.
123
- * @param event The mouseDownEntity event
124
- * @param callback Called fired on the event
125
- * @param scope Scope for the callback
126
- */
127
- on(event: "mouseDownEntity", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
128
-
129
- /**
130
- * Event fired when we left-click (press and release without dragging) on empty space.
131
- * Dragging to rotate or pan the Camera does not fire this event.
132
- * @param event The mouseDownNothing event
133
- * @param callback Called fired on the event
134
- * @param scope Scope for the callback
135
- */
136
- on(event: "mouseDownNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
137
- on(event: "touchPicked", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
138
- on(event: "touchPickedSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
139
- on(event: "touchPickedNothing", callback: () => void, scope?: any): string;
140
- on(event: "touchEntity", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
141
- on(event: "touchSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
142
- on(event: "touchNothing", callback: () => void, scope?: any): string;
143
- on(event: "touchDoublePicked", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
144
- on(event: "touchDoublePickedSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
145
- on(event: "touchDoublePickedNothing", callback: () => void, scope?: any): string;
146
-
147
- on(event: "personModeSpeedUp", callback: (speedNum: number) => void, scope?: any): string;
148
- on(event: "personModeSpeedDown", callback: (speedNum: number) => void, scope?: any): string;
149
- on(event: "touchmoveCanvas", callback: () => void): string;
150
-
151
- /**
152
- * 停止漫游
153
- */
154
- setdirectionChangeCancel(): void;
155
- /**
156
- * 设置漫游移动速率
157
- * @param {number} rate
158
- */
159
- set moveRate(rate: number);
160
-
161
- get moveRate(): number;
162
-
163
- speedUp(): void;
164
- speedDown(): void;
165
-
166
- /**
167
- * 漫游向右
168
- * @param {boolean} go
169
- */
170
- set goRight(go: boolean);
171
- /**
172
- * 漫游向左
173
- * @param {boolean} go
174
- */
175
- set goLeft(go: boolean);
176
- /**
177
- * 漫游向上
178
- * @param {boolean} go
179
- */
180
- set goUp(go: boolean);
181
- /**
182
- * 漫游向下
183
- * @param {boolean} go
184
- */
185
- set goDown(go: boolean);
186
- /**
187
- * 漫游向前
188
- * @param {boolean} go
189
- */
190
- set goForward(go: boolean);
191
- /**
192
- * 漫游向后
193
- * @param {boolean} go
194
- */
195
- set goBackward(go: boolean);
196
-
197
- /**
198
- * Sets the current navigation mode.
199
- *
200
- * Accepted values are:
201
- *
202
- * * "orbit" - rotation orbits about the current target or pivot point,
203
- * * "firstPerson" - rotation is about the current eye position,
204
- * * "planView" - rotation is disabled.
205
- *
206
- * See class comments for more info.
207
- *
208
- * @param {String} navMode The navigation mode.
209
- */
210
- set navMode(arg: "orbit" | "firstPerson" | "planView");
211
-
212
- /**
213
- * Gets the current navigation mode.
214
- *
215
- * @returns {String} The navigation mode
216
- */
217
- get navMode(): "orbit" | "firstPerson" | "planView";
218
-
219
- /**
220
- * Sets whether to vertically constrain the {@link Camera} position for first-person navigation.
221
- *
222
- * When set ````true````, this constrains {@link Camera.eye} to its current vertical position.
223
- *
224
- * Only applies when {@link CameraControl.navMode} is ````"firstPerson"````.
225
- *
226
- * Default is ````false````.
227
- *
228
- * @param {Boolean} value Set ````true```` to vertically constrain the Camera.
229
- */
230
- set constrainVertical(arg: boolean);
231
-
232
- /**
233
- * Gets whether to vertically constrain the {@link Camera} position for first-person navigation.
234
- *
235
- * When set ````true````, this constrains {@link Camera.eye} to its current vertical position.
236
- *
237
- * Only applies when {@link CameraControl.navMode} is ````"firstPerson"````.
238
- *
239
- * Default is ````false````.
240
- *
241
- * @returns {Boolean} ````true```` when Camera is vertically constrained.
242
- */
243
- get constrainVertical(): boolean;
244
-
245
- /**
246
- * Sets custom mappings of keys to ````CameraControl```` actions.
247
- *
248
- * See class docs for usage.
249
- *
250
- * @param {{Number:Number}|String} value Either a set of new key mappings, or a string to select a keyboard layout,
251
- * which causes ````CameraControl```` to use the default key mappings for that layout.
252
- */
253
- set keyMap(arg: { [key: number]: number });
254
-
255
- /**
256
- * Gets custom mappings of keys to {@link CameraControl} actions.
257
- *
258
- * @returns {{Number:Number}} Current key mappings.
259
- */
260
- get keyMap(): {
261
- [key: number]: number;
262
- };
263
-
264
- /**
265
- * Sets whether double-picking an {@link Entity} causes the {@link Camera} to fly to its boundary.
266
- *
267
- * Default is ````false````.
268
- *
269
- * @param {Boolean} value Set ````true```` to enable double-pick-fly-to mode.
270
- */
271
- set doublePickFlyTo(arg: boolean);
272
-
273
- /**
274
- * Gets whether double-picking an {@link Entity} causes the {@link Camera} to fly to its boundary.
275
- *
276
- * Default is ````false````.
277
- *
278
- * @returns {Boolean} Returns ````true```` when double-pick-fly-to mode is enabled.
279
- */
280
- get doublePickFlyTo(): boolean;
281
-
282
- /**
283
- * Sets whether either right-clicking (true) or middle-clicking (false) pans the {@link Camera}.
284
- *
285
- * Default is ````true````.
286
- *
287
- * @param {Boolean} value Set ````false```` to disable pan on right-click.
288
- */
289
- set panRightClick(arg: boolean);
290
-
291
- /**
292
- * Gets whether right-clicking pans the {@link Camera}.
293
- *
294
- * Default is ````true````.
295
- *
296
- * @returns {Boolean} Returns ````false```` when pan on right-click is disabled.
297
- */
298
- get panRightClick(): boolean;
299
-
300
- /**
301
- * Sets if this ````CameraControl```` is active or not.
302
- *
303
- * When inactive, the ````CameraControl```` will not react to input.
304
- *
305
- * Default is ````true````.
306
- *
307
- * @param {Boolean} value Set ````true```` to activate this ````CameraControl````.
308
- */
309
- set active(arg: boolean);
310
-
311
- /**
312
- * Gets if this ````CameraControl```` is active or not.
313
- *
314
- * When inactive, the ````CameraControl```` will not react to input.
315
- *
316
- * Default is ````true````.
317
- *
318
- * @returns {Boolean} Returns ````true```` if this ````CameraControl```` is active.
319
- */
320
- get active(): boolean;
321
-
322
- /**
323
- * Sets whether the {@link Camera} follows the mouse/touch pointer.
324
- *
325
- * In orbiting mode, the Camera will orbit about the pointer, and will dolly to and from the pointer.
326
- *
327
- * In fly-to mode, the Camera will dolly to and from the pointer, however the World will always rotate about the Camera position.
328
- *
329
- * In plan-view mode, the Camera will dolly to and from the pointer, however the Camera will not rotate.
330
- *
331
- * Default is ````true````.
332
- *
333
- * See class comments for more info.
334
- *
335
- * @param {Boolean} value Set ````true```` to enable the Camera to follow the pointer.
336
- */
337
- set followPointer(arg: boolean);
338
-
339
- /**
340
- * Sets whether the {@link Camera} follows the mouse/touch pointer.
341
- *
342
- * In orbiting mode, the Camera will orbit about the pointer, and will dolly to and from the pointer.
343
- *
344
- * In fly-to mode, the Camera will dolly to and from the pointer, however the World will always rotate about the Camera position.
345
- *
346
- * In plan-view mode, the Camera will dolly to and from the pointer, however the Camera will not rotate.
347
- *
348
- * Default is ````true````.
349
- *
350
- * See class comments for more info.
351
- *
352
- * @returns {Boolean} Returns ````true```` if the Camera follows the pointer.
353
- */
354
- get followPointer(): boolean;
355
-
356
- /**
357
- * Sets a factor in range ````[0..1]```` indicating how much the {@link Camera} keeps moving after you finish rotating it.
358
- *
359
- * A value of ````0.0```` causes it to immediately stop, ````0.5```` causes its movement to decay 50% on each tick,
360
- * while ````1.0```` causes no decay, allowing it continue moving, by the current rate of rotation.
361
- *
362
- * You may choose an inertia of zero when you want be able to precisely rotate the Camera,
363
- * without interference from inertia. Zero inertia can also mean that less frames are rendered while
364
- * you are rotating the Camera.
365
- *
366
- * Default is ````0.0````.
367
- *
368
- * Does not apply when {@link CameraControl.navMode} is ````"planView"````, which disallows rotation.
369
- *
370
- * @param {Number} rotationInertia New inertial factor.
371
- */
372
- set rotationInertia(arg: number);
373
-
374
- /**
375
- * Gets the rotation inertia factor.
376
- *
377
- * Default is ````0.0````.
378
- *
379
- * Does not apply when {@link CameraControl.navMode} is ````"planView"````, which disallows rotation.
380
- *
381
- * @returns {Number} The inertia factor.
382
- */
383
- get rotationInertia(): number;
384
-
385
- /**
386
- * Sets how much the {@link Camera} pans each second with keyboard input.
387
- *
388
- * Default is ````5.0````, to pan the Camera ````5.0```` World-space units every second that
389
- * a panning key is depressed. See the ````CameraControl```` class documentation for which keys control
390
- * panning.
391
- *
392
- * Panning direction is aligned to our Camera's orientation. When we pan horizontally, we pan
393
- * to our left and right, when we pan vertically, we pan upwards and downwards, and when we pan forwards
394
- * and backwards, we pan along the direction the Camera is pointing.
395
- *
396
- * Unlike dollying when {@link followPointer} is ````true````, panning does not follow the pointer.
397
- *
398
- * @param {Number} keyboardPanRate The new keyboard pan rate.
399
- */
400
- set keyboardPanRate(arg: number);
401
-
402
- /**
403
- * Gets how much the {@link Camera} pans each second with keyboard input.
404
- *
405
- * Default is ````5.0````.
406
- *
407
- * @returns {Number} The current keyboard pan rate.
408
- */
409
- get keyboardPanRate(): number;
410
-
411
- /**
412
- * Sets how fast the camera pans on touch panning
413
- *
414
- * @param {Number} touchPanRate The new touch pan rate.
415
- */
416
- set touchPanRate(arg: number);
417
-
418
- /**
419
- * Gets how fast the {@link Camera} pans on touch panning
420
- *
421
- * Default is ````1.0````.
422
- *
423
- * @returns {Number} The current touch pan rate.
424
- */
425
- get touchPanRate(): number;
426
-
427
- /**
428
- * Sets how many degrees per second the {@link Camera} rotates/orbits with keyboard input.
429
- *
430
- * Default is ````90.0````, to rotate/orbit the Camera ````90.0```` degrees every second that
431
- * a rotation key is depressed. See the ````CameraControl```` class documentation for which keys control
432
- * rotation/orbit.
433
- *
434
- * @param {Number} keyboardRotationRate The new keyboard rotation rate.
435
- */
436
- set keyboardRotationRate(arg: number);
437
-
438
- /**
439
- * Sets how many degrees per second the {@link Camera} rotates/orbits with keyboard input.
440
- *
441
- * Default is ````90.0````.
442
- *
443
- * @returns {Number} The current keyboard rotation rate.
444
- */
445
- get keyboardRotationRate(): number;
446
-
447
- /**
448
- * Sets the current drag rotation rate.
449
- *
450
- * This configures how many degrees the {@link Camera} rotates/orbits for a full sweep of the canvas by mouse or touch dragging.
451
- *
452
- * For example, a value of ````360.0```` indicates that the ````Camera```` rotates/orbits ````360.0```` degrees horizontally
453
- * when we sweep the entire width of the canvas.
454
- *
455
- * ````CameraControl```` makes vertical rotation half as sensitive as horizontal rotation, so that we don't tend to
456
- * flip upside-down. Therefore, a value of ````360.0```` rotates/orbits the ````Camera```` through ````180.0```` degrees
457
- * vertically when we sweep the entire height of the canvas.
458
- *
459
- * Default is ````360.0````.
460
- *
461
- * @param {Number} dragRotationRate The new drag rotation rate.
462
- */
463
- set dragRotationRate(arg: number);
464
-
465
- /**
466
- * Gets the current drag rotation rate.
467
- *
468
- * Default is ````360.0````.
469
- *
470
- * @returns {Number} The current drag rotation rate.
471
- */
472
- get dragRotationRate(): number;
473
-
474
- /**
475
- * Sets how much the {@link Camera} dollys with touch input.
476
- *
477
- * Default is ````0.2````
478
- *
479
- * @param {Number} touchDollyRate The new touch dolly rate.
480
- */
481
- set touchDollyRate(arg: number);
482
-
483
- /**
484
- * Gets how much the {@link Camera} dollys each second with touch input.
485
- *
486
- * Default is ````0.2````.
487
- *
488
- * @returns {Number} The current touch dolly rate.
489
- */
490
- get touchDollyRate(): number;
491
-
492
- /**
493
- * Sets the dolly inertia factor.
494
- *
495
- * This factor configures how much the {@link Camera} keeps moving after you finish dollying it.
496
- *
497
- * This factor is a value in range ````[0..1]````. A value of ````0.0```` causes dollying to immediately stop,
498
- * ````0.5```` causes dollying to decay 50% on each animation frame, while ````1.0```` causes no decay, which allows dollying
499
- * to continue until further input stops it.
500
- *
501
- * You might set ````dollyInertia```` to zero when you want be able to precisely position or rotate the Camera,
502
- * without interference from inertia. This also means that xeokit renders less frames while dollying the Camera,
503
- * which can improve rendering performance.
504
- *
505
- * Default is ````0````.
506
- *
507
- * @param {Number} dollyInertia New dolly inertia factor.
508
- */
509
- set dollyInertia(arg: number);
510
-
511
- /**
512
- * Gets the dolly inertia factor.
513
- *
514
- * Default is ````0````.
515
- *
516
- * @returns {Number} The current dolly inertia factor.
517
- */
518
- get dollyInertia(): number;
519
-
520
- /**
521
- * Sets the proximity to the closest object below which dolly speed decreases, and above which dolly speed increases.
522
- *
523
- * Default is ````35.0````.
524
- *
525
- * @param {Number} dollyProximityThreshold New dolly proximity threshold.
526
- */
527
- set dollyProximityThreshold(arg: number);
528
-
529
- /**
530
- * Gets the proximity to the closest object below which dolly speed decreases, and above which dolly speed increases.
531
- *
532
- * Default is ````35.0````.
533
- *
534
- * @returns {Number} The current dolly proximity threshold.
535
- */
536
- get dollyProximityThreshold(): number;
537
-
538
- /**
539
- * Sets the minimum dolly speed.
540
- *
541
- * Default is ````0.04````.
542
- *
543
- * @param {Number} dollyMinSpeed New dolly minimum speed.
544
- */
545
- set dollyMinSpeed(arg: number);
546
-
547
- /**
548
- * Gets the minimum dolly speed.
549
- *
550
- * Default is ````0.04````.
551
- *
552
- * @returns {Number} The current minimum dolly speed.
553
- */
554
- get dollyMinSpeed(): number;
555
-
556
- /**
557
- * Sets the pan inertia factor.
558
- *
559
- * This factor configures how much the {@link Camera} keeps moving after you finish panning it.
560
- *
561
- * This factor is a value in range ````[0..1]````. A value of ````0.0```` causes panning to immediately stop,
562
- * ````0.5```` causes panning to decay 50% on each animation frame, while ````1.0```` causes no decay, which allows panning
563
- * to continue until further input stops it.
564
- *
565
- * You might set ````panInertia```` to zero when you want be able to precisely position or rotate the Camera,
566
- * without interference from inertia. This also means that xeokit renders less frames while panning the Camera,
567
- * wich can improve rendering performance.
568
- *
569
- * Default is ````0.5````.
570
- *
571
- * @param {Number} panInertia New pan inertia factor.
572
- */
573
- set panInertia(arg: number);
574
-
575
- /**
576
- * Gets the pan inertia factor.
577
- *
578
- * Default is ````0.5````.
579
- *
580
- * @returns {Number} The current pan inertia factor.
581
- */
582
- get panInertia(): number;
583
-
584
- /**
585
- * Sets whether mouse and touch input is enabled.
586
- *
587
- * Default is ````true````.
588
- *
589
- * Disabling mouse and touch input on ````CameraControl```` is useful when we want to temporarily use mouse or
590
- * touch input to interact with some other 3D control, without disturbing the {@link Camera}.
591
- *
592
- * @param {Boolean} value Set ````true```` to enable mouse and touch input.
593
- */
594
- set pointerEnabled(arg: boolean);
595
-
596
- /**
597
- * Gets whether mouse and touch input is enabled.
598
- *
599
- * Default is ````true````.
600
- *
601
- * Disabling mouse and touch input on ````CameraControl```` is desirable when we want to temporarily use mouse or
602
- * touch input to interact with some other 3D control, without interfering with the {@link Camera}.
603
- *
604
- * @returns {Boolean} Returns ````true```` if mouse and touch input is enabled.
605
- */
606
- get pointerEnabled(): boolean;
607
-
608
- /**
609
- * Sets how much the {@link Camera} dollys each second with keyboard input.
610
- *
611
- * Default is ````15.0````, to dolly the {@link Camera} ````15.0```` World-space units per second while we hold down
612
- * the ````+```` and ````-```` keys.
613
- *
614
- * @param {Number} keyboardDollyRate The new keyboard dolly rate.
615
- */
616
- set keyboardDollyRate(arg: number);
617
-
618
- /**
619
- * Gets how much the {@link Camera} dollys each second with keyboard input.
620
- *
621
- * Default is ````15.0````.
622
- *
623
- * @returns {Number} The current keyboard dolly rate.
624
- */
625
- get keyboardDollyRate(): number;
626
-
627
- /**
628
- * Sets how much the {@link Camera} dollys each second while the mouse wheel is spinning.
629
- *
630
- * Default is ````100.0````, to dolly the {@link Camera} ````10.0```` World-space units per second as we spin
631
- * the mouse wheel.
632
- *
633
- * @param {Number} mouseWheelDollyRate The new mouse wheel dolly rate.
634
- */
635
- set mouseWheelDollyRate(arg: number);
636
-
637
- /**
638
- * Gets how much the {@link Camera} dollys each second while the mouse wheel is spinning.
639
- *
640
- * Default is ````100.0````.
641
- *
642
- * @returns {Number} The current mouseWheel dolly rate.
643
- */
644
- get mouseWheelDollyRate(): number;
645
-
646
- /**
647
- * Returns true if any keys configured for the given action are down.
648
- * @param action
649
- * @param keyDownMap
650
- * @private
651
- */
652
- private _isKeyDownForAction;
653
-
654
- /**
655
- * Sets the HTMl element to represent the pivot point when {@link CameraControl.followPointer} is true.
656
- *
657
- * See class comments for an example.
658
- *
659
- * @param {HTMLElement} element HTML element representing the pivot point.
660
- */
661
- set pivotElement(arg: HTMLElement);
662
-
663
- /**
664
- * Sets the current World-space 3D target position.
665
- *
666
- * Only applies when {@link CameraControl.followPointer} is ````true````.
667
- *
668
- * @param {Number[]} worldPos The new World-space 3D target position.
669
- */
670
- set pivotPos(arg: number[]);
671
-
672
- /**
673
- * Gets the current World-space 3D pivot position.
674
- *
675
- * Only applies when {@link CameraControl.followPointer} is ````true````.
676
- *
677
- * @return {Number[]} worldPos The current World-space 3D pivot position.
678
- */
679
- get pivotPos(): number[];
680
-
681
- /**
682
- * @deprecated
683
- * @param {Boolean} value Set ````true```` to enable dolly-to-pointer behaviour.
684
- */
685
- set dollyToPointer(arg: boolean);
686
-
687
- /**
688
- * @deprecated
689
- * @returns {Boolean} Returns ````true```` if dolly-to-pointer behaviour is enabled.
690
- */
691
- get dollyToPointer(): boolean;
692
-
693
- /**
694
- * @deprecated
695
- * @param {Boolean} value Set ````true```` to enable dolly-to-pointer behaviour.
696
- */
697
- set panToPointer(arg: boolean);
698
-
699
- /**
700
- * @deprecated
701
- * @returns {Boolean} Returns ````true```` if dolly-to-pointer behaviour is enabled.
702
- */
703
- get panToPointer(): boolean;
704
-
705
- /**
706
- * Sets whether this ````CameraControl```` is in first-person mode.
707
- *
708
- * In "first person" mode (disabled by default) the look position rotates about the eye position. Otherwise, {@link Camera.eye} rotates about {@link Camera.look}.
709
- *
710
- * Default is ````false````.
711
- *
712
- * Deprecated - use {@link CameraControl.navMode} instead.
713
- *
714
- * @param {Boolean} value Set ````true```` to enable first-person mode.
715
- * @deprecated
716
- */
717
- set firstPerson(arg: boolean);
718
-
719
- /**
720
- * Gets whether this ````CameraControl```` is in first-person mode.
721
- *
722
- * In "first person" mode (disabled by default) the look position rotates about the eye position. Otherwise, {@link Camera.eye} rotates about {@link Camera.look}.
723
- *
724
- * Default is ````false````.
725
- *
726
- * Deprecated - use {@link CameraControl.navMode} instead.
727
- *
728
- * @returns {Boolean} Returns ````true```` if first-person mode is enabled.
729
- * @deprecated
730
- */
731
- get firstPerson(): boolean;
732
-
733
- /**
734
- * Sets whether smart default pivoting is enabled.
735
- *
736
- * When ````true````, we'll pivot by default about the 3D position of the mouse/touch pointer on an
737
- * imaginary sphere that's centered at {@link Camera.eye} and sized to the {@link Scene} boundary.
738
- *
739
- * When ````false````, we'll pivot by default about {@link Camera.look}.
740
- *
741
- * Default is ````false````.
742
- *
743
- * @param {Boolean} enabled Set ````true```` to pivot by default about the selected point on the virtual sphere, or ````false```` to pivot by default about {@link Camera.look}.
744
- */
745
- set smartPivot(arg: boolean);
746
-
747
- /**
748
- * Gets whether smart default pivoting is enabled.
749
- *
750
- * When ````true````, we'll pivot by default about the 3D position of the mouse/touch pointer on an
751
- * imaginary sphere that's centered at {@link Camera.eye} and sized to the {@link Scene} boundary.
752
- *
753
- * When ````false````, we'll pivot by default about {@link Camera.look}.
754
- *
755
- * Default is ````false````.
756
- *
757
- * @returns {Boolean} Returns ````true```` when pivoting by default about the selected point on the virtual sphere, or ````false```` when pivoting by default about {@link Camera.look}.
758
- */
759
- get smartPivot(): boolean;
760
-
761
- /**
762
- * Sets the current snap radius for "hoverSnapOrSurface" events, to specify whether the radius
763
- * within which the pointer snaps to the nearest vertex or the nearest edge.
764
- *
765
- * Default value is 30 pixels.
766
- *
767
- * @param {Number} snapRadius The snap radius.
768
- */
769
- set snapRadius(snapRadius: number);
770
-
771
- /**
772
- * Gets the current snap radius.
773
- *
774
- * @returns {Number} The snap radius.
775
- */
776
- get snapRadius(): number;
777
- }
1
+ import { Component } from "../Component";
2
+ import { Entity } from "../Entity";
3
+ import { PickResult } from "../webgl/PickResult";
4
+
5
+ /**
6
+ * Controls the {@link Camera} with user input, and fires events when the user interacts with pickable {@link Entity}s.
7
+ */
8
+ export declare class CameraControl extends Component {
9
+ PAN_LEFT: number;
10
+ PAN_RIGHT: number;
11
+ PAN_UP: number;
12
+ PAN_DOWN: number;
13
+ PAN_FORWARDS: number;
14
+ PAN_BACKWARDS: number;
15
+ ROTATE_X_POS: number;
16
+ ROTATE_X_NEG: number;
17
+ ROTATE_Y_POS: number;
18
+ ROTATE_Y_NEG: number;
19
+ DOLLY_FORWARDS: number;
20
+ DOLLY_BACKWARDS: number;
21
+ AXIS_VIEW_RIGHT: number;
22
+ AXIS_VIEW_BACK: number;
23
+ AXIS_VIEW_LEFT: number;
24
+ AXIS_VIEW_FRONT: number;
25
+ AXIS_VIEW_TOP: number;
26
+ AXIS_VIEW_BOTTOM: number;
27
+
28
+ /**
29
+ * Fires when the model is loaded
30
+ * @param event The loaded event
31
+ * @param callback Called fired on the event
32
+ * @param scope Scope for the callback
33
+ */
34
+ on(
35
+ event: "rightClick",
36
+ callback: (e: { event: MouseEvent; pagePos: number[]; canvasPos: number[] }) => void,
37
+ scope?: any
38
+ ): string;
39
+
40
+ /**
41
+ * Event fired when the pointer moves while hovering over an Entity.
42
+ * @param event The hover event
43
+ * @param callback Called fired on the event
44
+ * @param scope Scope for the callback
45
+ */
46
+ on(event: "hover", callback: (e: PickResult) => void, scope?: any): string;
47
+
48
+ /**
49
+ * Event fired when the pointer moves while hovering over empty space.
50
+ * @param event The hoverOff event
51
+ * @param callback Called fired on the event
52
+ * @param scope Scope for the callback
53
+ */
54
+ on(event: "hoverOff", callback: (e: { canvasPos: number[] }) => void, scope?: any): string;
55
+
56
+ /**
57
+ * Event fired when the pointer moves onto an Entity.
58
+ * @param event The hoverEnter event
59
+ * @param callback Called fired on the event
60
+ * @param scope Scope for the callback
61
+ */
62
+ on(event: "hoverEnter", callback: (e: PickResult) => void, scope?: any): string;
63
+
64
+ /**
65
+ * Event fired when the pointer moves off an Entity.
66
+ * @param event The hoverOut event
67
+ * @param callback Called fired on the event
68
+ * @param scope Scope for the callback
69
+ */
70
+ on(event: "hoverOut", callback: (e: { entity: Entity }) => void, scope?: any): string;
71
+
72
+ /**
73
+ * Event fired when we left-click or tap on an Entity.
74
+ * @param event The picked event
75
+ * @param callback Called fired on the event
76
+ * @param scope Scope for the callback
77
+ */
78
+ on(event: "picked", callback: (e: PickResult) => void, scope?: any): string;
79
+
80
+ /**
81
+ * Event fired when we left-click or tap on the surface of an Entity.
82
+ * @param event The pickedSurface event
83
+ * @param callback Called fired on the event
84
+ * @param scope Scope for the callback
85
+ */
86
+ on(event: "pickedSurface", callback: (e: PickResult) => void, scope?: any): string;
87
+
88
+ /**
89
+ * Event fired when we left-click or tap on empty space.
90
+ * @param event The pickedNothing event
91
+ * @param callback Called fired on the event
92
+ * @param scope Scope for the callback
93
+ */
94
+ on(event: "pickedNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
95
+
96
+ /**
97
+ * Event fired wwhen we left-double-click or double-tap on an Entity.
98
+ * @param event The doublePicked event
99
+ * @param callback Called fired on the event
100
+ * @param scope Scope for the callback
101
+ */
102
+ on(event: "doublePicked", callback: (e: PickResult) => void, scope?: any): string;
103
+
104
+ /**
105
+ * Event fired when we left-double-click or double-tap on the surface of an Entity.
106
+ * @param event The doublePickedSurface event
107
+ * @param callback Called fired on the event
108
+ * @param scope Scope for the callback
109
+ */
110
+ on(event: "doublePickedSurface", callback: (e: PickResult) => void, scope?: any): string;
111
+
112
+ /**
113
+ * Event fired when we left-double-click or double-tap on empty space.
114
+ * @param event The doublePickedNothing event
115
+ * @param callback Called fired on the event
116
+ * @param scope Scope for the callback
117
+ */
118
+ on(event: "doublePickedNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
119
+
120
+ /**
121
+ * Event fired when we left-click (press and release without dragging) on the surface of an Entity.
122
+ * Dragging to rotate or pan the Camera does not fire this event.
123
+ * @param event The mouseDownEntity event
124
+ * @param callback Called fired on the event
125
+ * @param scope Scope for the callback
126
+ */
127
+ on(event: "mouseDownEntity", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
128
+
129
+ /**
130
+ * Event fired when we left-click (press and release without dragging) on empty space.
131
+ * Dragging to rotate or pan the Camera does not fire this event.
132
+ * @param event The mouseDownNothing event
133
+ * @param callback Called fired on the event
134
+ * @param scope Scope for the callback
135
+ */
136
+ on(event: "mouseDownNothing", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
137
+ on(event: "touchPicked", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
138
+ on(event: "touchPickedSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
139
+ on(event: "touchPickedNothing", callback: () => void, scope?: any): string;
140
+ on(event: "touchEntity", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
141
+ on(event: "touchSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
142
+ on(event: "touchNothing", callback: () => void, scope?: any): string;
143
+ on(event: "touchDoublePicked", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
144
+ on(event: "touchDoublePickedSurface", callback: (e?: { canvasPos: number[] }) => void, scope?: any): string;
145
+ on(event: "touchDoublePickedNothing", callback: () => void, scope?: any): string;
146
+
147
+ on(event: "personModeSpeedUp", callback: (speedNum: number) => void, scope?: any): string;
148
+ on(event: "personModeSpeedDown", callback: (speedNum: number) => void, scope?: any): string;
149
+ on(event: "touchmoveCanvas", callback: () => void): string;
150
+
151
+ /**
152
+ * 停止漫游
153
+ */
154
+ setdirectionChangeCancel(): void;
155
+ /**
156
+ * 设置漫游移动速率
157
+ * @param {number} rate
158
+ */
159
+ set moveRate(rate: number);
160
+
161
+ get moveRate(): number;
162
+
163
+ speedUp(): void;
164
+ speedDown(): void;
165
+
166
+ /**
167
+ * 漫游向右
168
+ * @param {boolean} go
169
+ */
170
+ set goRight(go: boolean);
171
+ /**
172
+ * 漫游向左
173
+ * @param {boolean} go
174
+ */
175
+ set goLeft(go: boolean);
176
+ /**
177
+ * 漫游向上
178
+ * @param {boolean} go
179
+ */
180
+ set goUp(go: boolean);
181
+ /**
182
+ * 漫游向下
183
+ * @param {boolean} go
184
+ */
185
+ set goDown(go: boolean);
186
+ /**
187
+ * 漫游向前
188
+ * @param {boolean} go
189
+ */
190
+ set goForward(go: boolean);
191
+ /**
192
+ * 漫游向后
193
+ * @param {boolean} go
194
+ */
195
+ set goBackward(go: boolean);
196
+
197
+ /**
198
+ * Sets the current navigation mode.
199
+ *
200
+ * Accepted values are:
201
+ *
202
+ * * "orbit" - rotation orbits about the current target or pivot point,
203
+ * * "firstPerson" - rotation is about the current eye position,
204
+ * * "planView" - rotation is disabled.
205
+ *
206
+ * See class comments for more info.
207
+ *
208
+ * @param {String} navMode The navigation mode.
209
+ */
210
+ set navMode(arg: "orbit" | "firstPerson" | "planView");
211
+
212
+ /**
213
+ * Gets the current navigation mode.
214
+ *
215
+ * @returns {String} The navigation mode
216
+ */
217
+ get navMode(): "orbit" | "firstPerson" | "planView";
218
+
219
+ /**
220
+ * Sets whether to vertically constrain the {@link Camera} position for first-person navigation.
221
+ *
222
+ * When set ````true````, this constrains {@link Camera.eye} to its current vertical position.
223
+ *
224
+ * Only applies when {@link CameraControl.navMode} is ````"firstPerson"````.
225
+ *
226
+ * Default is ````false````.
227
+ *
228
+ * @param {Boolean} value Set ````true```` to vertically constrain the Camera.
229
+ */
230
+ set constrainVertical(arg: boolean);
231
+
232
+ /**
233
+ * Gets whether to vertically constrain the {@link Camera} position for first-person navigation.
234
+ *
235
+ * When set ````true````, this constrains {@link Camera.eye} to its current vertical position.
236
+ *
237
+ * Only applies when {@link CameraControl.navMode} is ````"firstPerson"````.
238
+ *
239
+ * Default is ````false````.
240
+ *
241
+ * @returns {Boolean} ````true```` when Camera is vertically constrained.
242
+ */
243
+ get constrainVertical(): boolean;
244
+
245
+ /**
246
+ * Sets custom mappings of keys to ````CameraControl```` actions.
247
+ *
248
+ * See class docs for usage.
249
+ *
250
+ * @param {{Number:Number}|String} value Either a set of new key mappings, or a string to select a keyboard layout,
251
+ * which causes ````CameraControl```` to use the default key mappings for that layout.
252
+ */
253
+ set keyMap(arg: { [key: number]: number });
254
+
255
+ /**
256
+ * Gets custom mappings of keys to {@link CameraControl} actions.
257
+ *
258
+ * @returns {{Number:Number}} Current key mappings.
259
+ */
260
+ get keyMap(): {
261
+ [key: number]: number;
262
+ };
263
+
264
+ /**
265
+ * Sets whether double-picking an {@link Entity} causes the {@link Camera} to fly to its boundary.
266
+ *
267
+ * Default is ````false````.
268
+ *
269
+ * @param {Boolean} value Set ````true```` to enable double-pick-fly-to mode.
270
+ */
271
+ set doublePickFlyTo(arg: boolean);
272
+
273
+ /**
274
+ * Gets whether double-picking an {@link Entity} causes the {@link Camera} to fly to its boundary.
275
+ *
276
+ * Default is ````false````.
277
+ *
278
+ * @returns {Boolean} Returns ````true```` when double-pick-fly-to mode is enabled.
279
+ */
280
+ get doublePickFlyTo(): boolean;
281
+
282
+ /**
283
+ * Sets whether either right-clicking (true) or middle-clicking (false) pans the {@link Camera}.
284
+ *
285
+ * Default is ````true````.
286
+ *
287
+ * @param {Boolean} value Set ````false```` to disable pan on right-click.
288
+ */
289
+ set panRightClick(arg: boolean);
290
+
291
+ /**
292
+ * Gets whether right-clicking pans the {@link Camera}.
293
+ *
294
+ * Default is ````true````.
295
+ *
296
+ * @returns {Boolean} Returns ````false```` when pan on right-click is disabled.
297
+ */
298
+ get panRightClick(): boolean;
299
+
300
+ /**
301
+ * Sets if this ````CameraControl```` is active or not.
302
+ *
303
+ * When inactive, the ````CameraControl```` will not react to input.
304
+ *
305
+ * Default is ````true````.
306
+ *
307
+ * @param {Boolean} value Set ````true```` to activate this ````CameraControl````.
308
+ */
309
+ set active(arg: boolean);
310
+
311
+ /**
312
+ * Gets if this ````CameraControl```` is active or not.
313
+ *
314
+ * When inactive, the ````CameraControl```` will not react to input.
315
+ *
316
+ * Default is ````true````.
317
+ *
318
+ * @returns {Boolean} Returns ````true```` if this ````CameraControl```` is active.
319
+ */
320
+ get active(): boolean;
321
+
322
+ /**
323
+ * Sets whether the {@link Camera} follows the mouse/touch pointer.
324
+ *
325
+ * In orbiting mode, the Camera will orbit about the pointer, and will dolly to and from the pointer.
326
+ *
327
+ * In fly-to mode, the Camera will dolly to and from the pointer, however the World will always rotate about the Camera position.
328
+ *
329
+ * In plan-view mode, the Camera will dolly to and from the pointer, however the Camera will not rotate.
330
+ *
331
+ * Default is ````true````.
332
+ *
333
+ * See class comments for more info.
334
+ *
335
+ * @param {Boolean} value Set ````true```` to enable the Camera to follow the pointer.
336
+ */
337
+ set followPointer(arg: boolean);
338
+
339
+ /**
340
+ * Sets whether the {@link Camera} follows the mouse/touch pointer.
341
+ *
342
+ * In orbiting mode, the Camera will orbit about the pointer, and will dolly to and from the pointer.
343
+ *
344
+ * In fly-to mode, the Camera will dolly to and from the pointer, however the World will always rotate about the Camera position.
345
+ *
346
+ * In plan-view mode, the Camera will dolly to and from the pointer, however the Camera will not rotate.
347
+ *
348
+ * Default is ````true````.
349
+ *
350
+ * See class comments for more info.
351
+ *
352
+ * @returns {Boolean} Returns ````true```` if the Camera follows the pointer.
353
+ */
354
+ get followPointer(): boolean;
355
+
356
+ /**
357
+ * Sets a factor in range ````[0..1]```` indicating how much the {@link Camera} keeps moving after you finish rotating it.
358
+ *
359
+ * A value of ````0.0```` causes it to immediately stop, ````0.5```` causes its movement to decay 50% on each tick,
360
+ * while ````1.0```` causes no decay, allowing it continue moving, by the current rate of rotation.
361
+ *
362
+ * You may choose an inertia of zero when you want be able to precisely rotate the Camera,
363
+ * without interference from inertia. Zero inertia can also mean that less frames are rendered while
364
+ * you are rotating the Camera.
365
+ *
366
+ * Default is ````0.0````.
367
+ *
368
+ * Does not apply when {@link CameraControl.navMode} is ````"planView"````, which disallows rotation.
369
+ *
370
+ * @param {Number} rotationInertia New inertial factor.
371
+ */
372
+ set rotationInertia(arg: number);
373
+
374
+ /**
375
+ * Gets the rotation inertia factor.
376
+ *
377
+ * Default is ````0.0````.
378
+ *
379
+ * Does not apply when {@link CameraControl.navMode} is ````"planView"````, which disallows rotation.
380
+ *
381
+ * @returns {Number} The inertia factor.
382
+ */
383
+ get rotationInertia(): number;
384
+
385
+ /**
386
+ * Sets how much the {@link Camera} pans each second with keyboard input.
387
+ *
388
+ * Default is ````5.0````, to pan the Camera ````5.0```` World-space units every second that
389
+ * a panning key is depressed. See the ````CameraControl```` class documentation for which keys control
390
+ * panning.
391
+ *
392
+ * Panning direction is aligned to our Camera's orientation. When we pan horizontally, we pan
393
+ * to our left and right, when we pan vertically, we pan upwards and downwards, and when we pan forwards
394
+ * and backwards, we pan along the direction the Camera is pointing.
395
+ *
396
+ * Unlike dollying when {@link followPointer} is ````true````, panning does not follow the pointer.
397
+ *
398
+ * @param {Number} keyboardPanRate The new keyboard pan rate.
399
+ */
400
+ set keyboardPanRate(arg: number);
401
+
402
+ /**
403
+ * Gets how much the {@link Camera} pans each second with keyboard input.
404
+ *
405
+ * Default is ````5.0````.
406
+ *
407
+ * @returns {Number} The current keyboard pan rate.
408
+ */
409
+ get keyboardPanRate(): number;
410
+
411
+ /**
412
+ * Sets how fast the camera pans on touch panning
413
+ *
414
+ * @param {Number} touchPanRate The new touch pan rate.
415
+ */
416
+ set touchPanRate(arg: number);
417
+
418
+ /**
419
+ * Gets how fast the {@link Camera} pans on touch panning
420
+ *
421
+ * Default is ````1.0````.
422
+ *
423
+ * @returns {Number} The current touch pan rate.
424
+ */
425
+ get touchPanRate(): number;
426
+
427
+ /**
428
+ * Sets how many degrees per second the {@link Camera} rotates/orbits with keyboard input.
429
+ *
430
+ * Default is ````90.0````, to rotate/orbit the Camera ````90.0```` degrees every second that
431
+ * a rotation key is depressed. See the ````CameraControl```` class documentation for which keys control
432
+ * rotation/orbit.
433
+ *
434
+ * @param {Number} keyboardRotationRate The new keyboard rotation rate.
435
+ */
436
+ set keyboardRotationRate(arg: number);
437
+
438
+ /**
439
+ * Sets how many degrees per second the {@link Camera} rotates/orbits with keyboard input.
440
+ *
441
+ * Default is ````90.0````.
442
+ *
443
+ * @returns {Number} The current keyboard rotation rate.
444
+ */
445
+ get keyboardRotationRate(): number;
446
+
447
+ /**
448
+ * Sets the current drag rotation rate.
449
+ *
450
+ * This configures how many degrees the {@link Camera} rotates/orbits for a full sweep of the canvas by mouse or touch dragging.
451
+ *
452
+ * For example, a value of ````360.0```` indicates that the ````Camera```` rotates/orbits ````360.0```` degrees horizontally
453
+ * when we sweep the entire width of the canvas.
454
+ *
455
+ * ````CameraControl```` makes vertical rotation half as sensitive as horizontal rotation, so that we don't tend to
456
+ * flip upside-down. Therefore, a value of ````360.0```` rotates/orbits the ````Camera```` through ````180.0```` degrees
457
+ * vertically when we sweep the entire height of the canvas.
458
+ *
459
+ * Default is ````360.0````.
460
+ *
461
+ * @param {Number} dragRotationRate The new drag rotation rate.
462
+ */
463
+ set dragRotationRate(arg: number);
464
+
465
+ /**
466
+ * Gets the current drag rotation rate.
467
+ *
468
+ * Default is ````360.0````.
469
+ *
470
+ * @returns {Number} The current drag rotation rate.
471
+ */
472
+ get dragRotationRate(): number;
473
+
474
+ /**
475
+ * Sets how much the {@link Camera} dollys with touch input.
476
+ *
477
+ * Default is ````0.2````
478
+ *
479
+ * @param {Number} touchDollyRate The new touch dolly rate.
480
+ */
481
+ set touchDollyRate(arg: number);
482
+
483
+ /**
484
+ * Gets how much the {@link Camera} dollys each second with touch input.
485
+ *
486
+ * Default is ````0.2````.
487
+ *
488
+ * @returns {Number} The current touch dolly rate.
489
+ */
490
+ get touchDollyRate(): number;
491
+
492
+ /**
493
+ * Sets the dolly inertia factor.
494
+ *
495
+ * This factor configures how much the {@link Camera} keeps moving after you finish dollying it.
496
+ *
497
+ * This factor is a value in range ````[0..1]````. A value of ````0.0```` causes dollying to immediately stop,
498
+ * ````0.5```` causes dollying to decay 50% on each animation frame, while ````1.0```` causes no decay, which allows dollying
499
+ * to continue until further input stops it.
500
+ *
501
+ * You might set ````dollyInertia```` to zero when you want be able to precisely position or rotate the Camera,
502
+ * without interference from inertia. This also means that xeokit renders less frames while dollying the Camera,
503
+ * which can improve rendering performance.
504
+ *
505
+ * Default is ````0````.
506
+ *
507
+ * @param {Number} dollyInertia New dolly inertia factor.
508
+ */
509
+ set dollyInertia(arg: number);
510
+
511
+ /**
512
+ * Gets the dolly inertia factor.
513
+ *
514
+ * Default is ````0````.
515
+ *
516
+ * @returns {Number} The current dolly inertia factor.
517
+ */
518
+ get dollyInertia(): number;
519
+
520
+ /**
521
+ * Sets the proximity to the closest object below which dolly speed decreases, and above which dolly speed increases.
522
+ *
523
+ * Default is ````35.0````.
524
+ *
525
+ * @param {Number} dollyProximityThreshold New dolly proximity threshold.
526
+ */
527
+ set dollyProximityThreshold(arg: number);
528
+
529
+ /**
530
+ * Gets the proximity to the closest object below which dolly speed decreases, and above which dolly speed increases.
531
+ *
532
+ * Default is ````35.0````.
533
+ *
534
+ * @returns {Number} The current dolly proximity threshold.
535
+ */
536
+ get dollyProximityThreshold(): number;
537
+
538
+ /**
539
+ * Sets the minimum dolly speed.
540
+ *
541
+ * Default is ````0.04````.
542
+ *
543
+ * @param {Number} dollyMinSpeed New dolly minimum speed.
544
+ */
545
+ set dollyMinSpeed(arg: number);
546
+
547
+ /**
548
+ * Gets the minimum dolly speed.
549
+ *
550
+ * Default is ````0.04````.
551
+ *
552
+ * @returns {Number} The current minimum dolly speed.
553
+ */
554
+ get dollyMinSpeed(): number;
555
+
556
+ /**
557
+ * Sets the pan inertia factor.
558
+ *
559
+ * This factor configures how much the {@link Camera} keeps moving after you finish panning it.
560
+ *
561
+ * This factor is a value in range ````[0..1]````. A value of ````0.0```` causes panning to immediately stop,
562
+ * ````0.5```` causes panning to decay 50% on each animation frame, while ````1.0```` causes no decay, which allows panning
563
+ * to continue until further input stops it.
564
+ *
565
+ * You might set ````panInertia```` to zero when you want be able to precisely position or rotate the Camera,
566
+ * without interference from inertia. This also means that xeokit renders less frames while panning the Camera,
567
+ * wich can improve rendering performance.
568
+ *
569
+ * Default is ````0.5````.
570
+ *
571
+ * @param {Number} panInertia New pan inertia factor.
572
+ */
573
+ set panInertia(arg: number);
574
+
575
+ /**
576
+ * Gets the pan inertia factor.
577
+ *
578
+ * Default is ````0.5````.
579
+ *
580
+ * @returns {Number} The current pan inertia factor.
581
+ */
582
+ get panInertia(): number;
583
+
584
+ /**
585
+ * Sets whether mouse and touch input is enabled.
586
+ *
587
+ * Default is ````true````.
588
+ *
589
+ * Disabling mouse and touch input on ````CameraControl```` is useful when we want to temporarily use mouse or
590
+ * touch input to interact with some other 3D control, without disturbing the {@link Camera}.
591
+ *
592
+ * @param {Boolean} value Set ````true```` to enable mouse and touch input.
593
+ */
594
+ set pointerEnabled(arg: boolean);
595
+
596
+ /**
597
+ * Gets whether mouse and touch input is enabled.
598
+ *
599
+ * Default is ````true````.
600
+ *
601
+ * Disabling mouse and touch input on ````CameraControl```` is desirable when we want to temporarily use mouse or
602
+ * touch input to interact with some other 3D control, without interfering with the {@link Camera}.
603
+ *
604
+ * @returns {Boolean} Returns ````true```` if mouse and touch input is enabled.
605
+ */
606
+ get pointerEnabled(): boolean;
607
+
608
+ /**
609
+ * Sets how much the {@link Camera} dollys each second with keyboard input.
610
+ *
611
+ * Default is ````15.0````, to dolly the {@link Camera} ````15.0```` World-space units per second while we hold down
612
+ * the ````+```` and ````-```` keys.
613
+ *
614
+ * @param {Number} keyboardDollyRate The new keyboard dolly rate.
615
+ */
616
+ set keyboardDollyRate(arg: number);
617
+
618
+ /**
619
+ * Gets how much the {@link Camera} dollys each second with keyboard input.
620
+ *
621
+ * Default is ````15.0````.
622
+ *
623
+ * @returns {Number} The current keyboard dolly rate.
624
+ */
625
+ get keyboardDollyRate(): number;
626
+
627
+ /**
628
+ * Sets how much the {@link Camera} dollys each second while the mouse wheel is spinning.
629
+ *
630
+ * Default is ````100.0````, to dolly the {@link Camera} ````10.0```` World-space units per second as we spin
631
+ * the mouse wheel.
632
+ *
633
+ * @param {Number} mouseWheelDollyRate The new mouse wheel dolly rate.
634
+ */
635
+ set mouseWheelDollyRate(arg: number);
636
+
637
+ /**
638
+ * Gets how much the {@link Camera} dollys each second while the mouse wheel is spinning.
639
+ *
640
+ * Default is ````100.0````.
641
+ *
642
+ * @returns {Number} The current mouseWheel dolly rate.
643
+ */
644
+ get mouseWheelDollyRate(): number;
645
+
646
+ /**
647
+ * Returns true if any keys configured for the given action are down.
648
+ * @param action
649
+ * @param keyDownMap
650
+ * @private
651
+ */
652
+ private _isKeyDownForAction;
653
+
654
+ /**
655
+ * Sets the HTMl element to represent the pivot point when {@link CameraControl.followPointer} is true.
656
+ *
657
+ * See class comments for an example.
658
+ *
659
+ * @param {HTMLElement} element HTML element representing the pivot point.
660
+ */
661
+ set pivotElement(arg: HTMLElement);
662
+
663
+ /**
664
+ * Sets the current World-space 3D target position.
665
+ *
666
+ * Only applies when {@link CameraControl.followPointer} is ````true````.
667
+ *
668
+ * @param {Number[]} worldPos The new World-space 3D target position.
669
+ */
670
+ set pivotPos(arg: number[]);
671
+
672
+ /**
673
+ * Gets the current World-space 3D pivot position.
674
+ *
675
+ * Only applies when {@link CameraControl.followPointer} is ````true````.
676
+ *
677
+ * @return {Number[]} worldPos The current World-space 3D pivot position.
678
+ */
679
+ get pivotPos(): number[];
680
+
681
+ /**
682
+ * @deprecated
683
+ * @param {Boolean} value Set ````true```` to enable dolly-to-pointer behaviour.
684
+ */
685
+ set dollyToPointer(arg: boolean);
686
+
687
+ /**
688
+ * @deprecated
689
+ * @returns {Boolean} Returns ````true```` if dolly-to-pointer behaviour is enabled.
690
+ */
691
+ get dollyToPointer(): boolean;
692
+
693
+ /**
694
+ * @deprecated
695
+ * @param {Boolean} value Set ````true```` to enable dolly-to-pointer behaviour.
696
+ */
697
+ set panToPointer(arg: boolean);
698
+
699
+ /**
700
+ * @deprecated
701
+ * @returns {Boolean} Returns ````true```` if dolly-to-pointer behaviour is enabled.
702
+ */
703
+ get panToPointer(): boolean;
704
+
705
+ /**
706
+ * Sets whether this ````CameraControl```` is in first-person mode.
707
+ *
708
+ * In "first person" mode (disabled by default) the look position rotates about the eye position. Otherwise, {@link Camera.eye} rotates about {@link Camera.look}.
709
+ *
710
+ * Default is ````false````.
711
+ *
712
+ * Deprecated - use {@link CameraControl.navMode} instead.
713
+ *
714
+ * @param {Boolean} value Set ````true```` to enable first-person mode.
715
+ * @deprecated
716
+ */
717
+ set firstPerson(arg: boolean);
718
+
719
+ /**
720
+ * Gets whether this ````CameraControl```` is in first-person mode.
721
+ *
722
+ * In "first person" mode (disabled by default) the look position rotates about the eye position. Otherwise, {@link Camera.eye} rotates about {@link Camera.look}.
723
+ *
724
+ * Default is ````false````.
725
+ *
726
+ * Deprecated - use {@link CameraControl.navMode} instead.
727
+ *
728
+ * @returns {Boolean} Returns ````true```` if first-person mode is enabled.
729
+ * @deprecated
730
+ */
731
+ get firstPerson(): boolean;
732
+
733
+ /**
734
+ * Sets whether smart default pivoting is enabled.
735
+ *
736
+ * When ````true````, we'll pivot by default about the 3D position of the mouse/touch pointer on an
737
+ * imaginary sphere that's centered at {@link Camera.eye} and sized to the {@link Scene} boundary.
738
+ *
739
+ * When ````false````, we'll pivot by default about {@link Camera.look}.
740
+ *
741
+ * Default is ````false````.
742
+ *
743
+ * @param {Boolean} enabled Set ````true```` to pivot by default about the selected point on the virtual sphere, or ````false```` to pivot by default about {@link Camera.look}.
744
+ */
745
+ set smartPivot(arg: boolean);
746
+
747
+ /**
748
+ * Gets whether smart default pivoting is enabled.
749
+ *
750
+ * When ````true````, we'll pivot by default about the 3D position of the mouse/touch pointer on an
751
+ * imaginary sphere that's centered at {@link Camera.eye} and sized to the {@link Scene} boundary.
752
+ *
753
+ * When ````false````, we'll pivot by default about {@link Camera.look}.
754
+ *
755
+ * Default is ````false````.
756
+ *
757
+ * @returns {Boolean} Returns ````true```` when pivoting by default about the selected point on the virtual sphere, or ````false```` when pivoting by default about {@link Camera.look}.
758
+ */
759
+ get smartPivot(): boolean;
760
+
761
+ /**
762
+ * Sets the current snap radius for "hoverSnapOrSurface" events, to specify whether the radius
763
+ * within which the pointer snaps to the nearest vertex or the nearest edge.
764
+ *
765
+ * Default value is 30 pixels.
766
+ *
767
+ * @param {Number} snapRadius The snap radius.
768
+ */
769
+ set snapRadius(snapRadius: number);
770
+
771
+ /**
772
+ * Gets the current snap radius.
773
+ *
774
+ * @returns {Number} The snap radius.
775
+ */
776
+ get snapRadius(): number;
777
+ }