dxfview 0.0.2

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 (258) hide show
  1. package/README.md +1 -0
  2. package/dist/dxfview.esm.min.js +7 -0
  3. package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
  4. package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
  5. package/dist/types/components/pop-panel/PopPanel.d.ts +14 -0
  6. package/dist/types/components/pop-panel/index.d.ts +1 -0
  7. package/dist/types/components/progress-bar/ProgressBar.d.ts +34 -0
  8. package/dist/types/components/progress-bar/index.d.ts +1 -0
  9. package/dist/types/components/settings/ProjectSettingsDef.d.ts +44 -0
  10. package/dist/types/components/settings/index.d.ts +1 -0
  11. package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
  12. package/dist/types/components/tool-tip/index.d.ts +1 -0
  13. package/dist/types/core/Configs.d.ts +238 -0
  14. package/dist/types/core/Constants.d.ts +164 -0
  15. package/dist/types/core/Units.d.ts +16 -0
  16. package/dist/types/core/VersionManager.d.ts +3 -0
  17. package/dist/types/core/camera-controls/CameraControls.d.ts +773 -0
  18. package/dist/types/core/camera-controls/Constants.d.ts +2 -0
  19. package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
  20. package/dist/types/core/camera-controls/index.d.ts +2 -0
  21. package/dist/types/core/camera-controls/types.d.ts +112 -0
  22. package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
  23. package/dist/types/core/camera-controls/utils/math-utils.d.ts +11 -0
  24. package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
  25. package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
  26. package/dist/types/core/canvas/Constants.d.ts +28 -0
  27. package/dist/types/core/canvas/Drawable.d.ts +87 -0
  28. package/dist/types/core/canvas/DrawableList.d.ts +29 -0
  29. package/dist/types/core/canvas/index.d.ts +4 -0
  30. package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
  31. package/dist/types/core/compare/CompareDrawable.d.ts +17 -0
  32. package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
  33. package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
  34. package/dist/types/core/compare/index.d.ts +4 -0
  35. package/dist/types/core/controls/CameraControlsEx.d.ts +34 -0
  36. package/dist/types/core/controls/index.d.ts +1 -0
  37. package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
  38. package/dist/types/core/dxf/DxfConstants.d.ts +15 -0
  39. package/dist/types/core/dxf/DxfLoader.d.ts +526 -0
  40. package/dist/types/core/dxf/DxfObject.d.ts +32 -0
  41. package/dist/types/core/dxf/DxfUtils.d.ts +79 -0
  42. package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
  43. package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
  44. package/dist/types/core/dxf/bspline.d.ts +8 -0
  45. package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
  46. package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
  47. package/dist/types/core/dxf/index.d.ts +10 -0
  48. package/dist/types/core/dxf/round10.d.ts +2 -0
  49. package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
  50. package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
  51. package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
  52. package/dist/types/core/dxf-parser/DxfParser.d.ts +327 -0
  53. package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
  54. package/dist/types/core/dxf-parser/ParseHelpers.d.ts +36 -0
  55. package/dist/types/core/dxf-parser/entities/3dface.d.ts +11 -0
  56. package/dist/types/core/dxf-parser/entities/arc.d.ts +16 -0
  57. package/dist/types/core/dxf-parser/entities/attdef.d.ts +31 -0
  58. package/dist/types/core/dxf-parser/entities/attrib.d.ts +31 -0
  59. package/dist/types/core/dxf-parser/entities/circle.d.ts +13 -0
  60. package/dist/types/core/dxf-parser/entities/dimension.d.ts +22 -0
  61. package/dist/types/core/dxf-parser/entities/ellipse.d.ts +15 -0
  62. package/dist/types/core/dxf-parser/entities/geomtry.d.ts +40 -0
  63. package/dist/types/core/dxf-parser/entities/hatch.d.ts +108 -0
  64. package/dist/types/core/dxf-parser/entities/image.d.ts +37 -0
  65. package/dist/types/core/dxf-parser/entities/insert.d.ts +20 -0
  66. package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
  67. package/dist/types/core/dxf-parser/entities/line.d.ts +10 -0
  68. package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +21 -0
  69. package/dist/types/core/dxf-parser/entities/mleader.d.ts +101 -0
  70. package/dist/types/core/dxf-parser/entities/mtext.d.ts +18 -0
  71. package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +20 -0
  72. package/dist/types/core/dxf-parser/entities/point.d.ts +11 -0
  73. package/dist/types/core/dxf-parser/entities/polyline.d.ts +20 -0
  74. package/dist/types/core/dxf-parser/entities/ray.d.ts +10 -0
  75. package/dist/types/core/dxf-parser/entities/region.d.ts +10 -0
  76. package/dist/types/core/dxf-parser/entities/seqend.d.ts +8 -0
  77. package/dist/types/core/dxf-parser/entities/solid.d.ts +10 -0
  78. package/dist/types/core/dxf-parser/entities/spline.d.ts +23 -0
  79. package/dist/types/core/dxf-parser/entities/table.d.ts +42 -0
  80. package/dist/types/core/dxf-parser/entities/text.d.ts +18 -0
  81. package/dist/types/core/dxf-parser/entities/vertex.d.ts +20 -0
  82. package/dist/types/core/dxf-parser/entities/viewport.d.ts +46 -0
  83. package/dist/types/core/dxf-parser/entities/xline.d.ts +10 -0
  84. package/dist/types/core/dxf-parser/index.d.ts +27 -0
  85. package/dist/types/core/dxf-parser/objects/common.d.ts +15 -0
  86. package/dist/types/core/dxf-parser/objects/dictionary.d.ts +19 -0
  87. package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
  88. package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
  89. package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
  90. package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
  91. package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
  92. package/dist/types/core/font/BaseFont.d.ts +88 -0
  93. package/dist/types/core/font/FontManager.d.ts +107 -0
  94. package/dist/types/core/font/MeshFont.d.ts +44 -0
  95. package/dist/types/core/font/ShxFont.d.ts +108 -0
  96. package/dist/types/core/font/index.d.ts +1 -0
  97. package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +1 -0
  98. package/dist/types/core/font/shx/Shx.constants.d.ts +11 -0
  99. package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
  100. package/dist/types/core/font/shx/TextShape.d.ts +24 -0
  101. package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
  102. package/dist/types/core/font/shx/index.d.ts +1 -0
  103. package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
  104. package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
  105. package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
  106. package/dist/types/core/geometry-offset/index.d.ts +1 -0
  107. package/dist/types/core/helpers/BinaryReader.d.ts +24 -0
  108. package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
  109. package/dist/types/core/helpers/LoadingHelper.d.ts +46 -0
  110. package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
  111. package/dist/types/core/helpers/OSnapHelper.d.ts +167 -0
  112. package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
  113. package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
  114. package/dist/types/core/helpers/RafHelper.d.ts +18 -0
  115. package/dist/types/core/helpers/ZoomToRectHelper.d.ts +17 -0
  116. package/dist/types/core/helpers/index.d.ts +9 -0
  117. package/dist/types/core/index.d.ts +18 -0
  118. package/dist/types/core/indexeddb/AnnotationTable.d.ts +14 -0
  119. package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
  120. package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
  121. package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
  122. package/dist/types/core/indexeddb/IndexedDbManager.d.ts +29 -0
  123. package/dist/types/core/indexeddb/ViewpointTable.d.ts +14 -0
  124. package/dist/types/core/indexeddb/index.d.ts +6 -0
  125. package/dist/types/core/input/InputManager.d.ts +161 -0
  126. package/dist/types/core/input/index.d.ts +1 -0
  127. package/dist/types/core/license/AutoConfig.d.ts +17 -0
  128. package/dist/types/core/license/LicenseManager.d.ts +107 -0
  129. package/dist/types/core/license/PublicKey.d.ts +1 -0
  130. package/dist/types/core/license/index.d.ts +1 -0
  131. package/dist/types/core/markup/ArrowMarkup.d.ts +14 -0
  132. package/dist/types/core/markup/BaseMarkup.d.ts +28 -0
  133. package/dist/types/core/markup/CircleMarkup.d.ts +12 -0
  134. package/dist/types/core/markup/CloudLineMarkup.d.ts +10 -0
  135. package/dist/types/core/markup/CloudRectMarkup.d.ts +11 -0
  136. package/dist/types/core/markup/CloudRectWithTextMarkup.d.ts +43 -0
  137. package/dist/types/core/markup/Constants.d.ts +17 -0
  138. package/dist/types/core/markup/DotMarkup.d.ts +9 -0
  139. package/dist/types/core/markup/EllipseMarkup.d.ts +12 -0
  140. package/dist/types/core/markup/LeaderLineMarkup.d.ts +25 -0
  141. package/dist/types/core/markup/MarkupManager.d.ts +91 -0
  142. package/dist/types/core/markup/PolylineMarkup.d.ts +11 -0
  143. package/dist/types/core/markup/RectMarkup.d.ts +10 -0
  144. package/dist/types/core/markup/TextMarkup.d.ts +40 -0
  145. package/dist/types/core/markup/XMarkup.d.ts +10 -0
  146. package/dist/types/core/markup/index.d.ts +13 -0
  147. package/dist/types/core/model/Constants.d.ts +51 -0
  148. package/dist/types/core/model/Model.d.ts +18 -0
  149. package/dist/types/core/model/Model2d.d.ts +115 -0
  150. package/dist/types/core/model/index.d.ts +3 -0
  151. package/dist/types/core/patches/Constants.d.ts +4 -0
  152. package/dist/types/core/patches/Line.d.ts +2 -0
  153. package/dist/types/core/patches/Mesh.d.ts +2 -0
  154. package/dist/types/core/patches/Points.d.ts +2 -0
  155. package/dist/types/core/patches/index.d.ts +4 -0
  156. package/dist/types/core/undo-redo/AddAnnotationCommand.d.ts +11 -0
  157. package/dist/types/core/undo-redo/AddMarkupCommand.d.ts +10 -0
  158. package/dist/types/core/undo-redo/AddMeasurementCommand.d.ts +9 -0
  159. package/dist/types/core/undo-redo/Command.d.ts +6 -0
  160. package/dist/types/core/undo-redo/RemoveAnnotationCommand.d.ts +11 -0
  161. package/dist/types/core/undo-redo/RemoveMarkupCommand.d.ts +10 -0
  162. package/dist/types/core/undo-redo/RemoveMeasurementCommand.d.ts +9 -0
  163. package/dist/types/core/undo-redo/UndoRedoManager.d.ts +21 -0
  164. package/dist/types/core/undo-redo/UpdateMarkupCommand.d.ts +11 -0
  165. package/dist/types/core/undo-redo/index.d.ts +9 -0
  166. package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
  167. package/dist/types/core/utils/ColorUtils.d.ts +21 -0
  168. package/dist/types/core/utils/CommonUtils.d.ts +125 -0
  169. package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
  170. package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +4 -0
  171. package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
  172. package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
  173. package/dist/types/core/utils/Event.d.ts +33 -0
  174. package/dist/types/core/utils/FpsUtils.d.ts +13 -0
  175. package/dist/types/core/utils/GeometryUtils.d.ts +111 -0
  176. package/dist/types/core/utils/Locale.d.ts +190 -0
  177. package/dist/types/core/utils/LogUtils.d.ts +7 -0
  178. package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
  179. package/dist/types/core/utils/MathUtils.d.ts +59 -0
  180. package/dist/types/core/utils/MergeUtils.d.ts +638 -0
  181. package/dist/types/core/utils/ObjectUtils.d.ts +87 -0
  182. package/dist/types/core/utils/PolygonUtils.d.ts +8 -0
  183. package/dist/types/core/utils/SVGObjectUtils.d.ts +16 -0
  184. package/dist/types/core/utils/SceneUtils.d.ts +26 -0
  185. package/dist/types/core/utils/SectionUtils.d.ts +11 -0
  186. package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
  187. package/dist/types/core/utils/index.d.ts +21 -0
  188. package/dist/types/core/viewers/BaseViewer.d.ts +265 -0
  189. package/dist/types/core/viewers/DxfViewer.d.ts +1372 -0
  190. package/dist/types/core/viewers/Plugin.d.ts +29 -0
  191. package/dist/types/core/viewers/ViewerEvent.d.ts +178 -0
  192. package/dist/types/core/viewers/index.d.ts +4 -0
  193. package/dist/types/export.doc.d.ts +10 -0
  194. package/dist/types/fetch-polyfill.d.ts +2 -0
  195. package/dist/types/index.d.ts +8 -0
  196. package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +139 -0
  197. package/dist/types/plugins/annotation/AutoDrawAnnotation.d.ts +63 -0
  198. package/dist/types/plugins/annotation/BaseAnnotation.d.ts +113 -0
  199. package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +139 -0
  200. package/dist/types/plugins/annotation/CopyAnnotation.d.ts +36 -0
  201. package/dist/types/plugins/annotation/CopyDrawable.d.ts +26 -0
  202. package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +59 -0
  203. package/dist/types/plugins/annotation/RectAnnotation.d.ts +53 -0
  204. package/dist/types/plugins/annotation/RectDrawable.d.ts +42 -0
  205. package/dist/types/plugins/annotation/ShapeFinder.d.ts +51 -0
  206. package/dist/types/plugins/annotation/freeDrawDrawable.d.ts +21 -0
  207. package/dist/types/plugins/annotation/index.d.ts +8 -0
  208. package/dist/types/plugins/annotation/type.d.ts +182 -0
  209. package/dist/types/plugins/axis-gizmo/AxisGizmoPlugin.d.ts +49 -0
  210. package/dist/types/plugins/axis-gizmo/CoordinateAxes.d.ts +12 -0
  211. package/dist/types/plugins/axis-gizmo/index.d.ts +1 -0
  212. package/dist/types/plugins/bottom-bar/BottomBarPlugin.d.ts +44 -0
  213. package/dist/types/plugins/bottom-bar/index.d.ts +1 -0
  214. package/dist/types/plugins/divide/CoverLayerManager.d.ts +44 -0
  215. package/dist/types/plugins/divide/DivGeometryUtils.d.ts +66 -0
  216. package/dist/types/plugins/divide/DividePlugin.d.ts +181 -0
  217. package/dist/types/plugins/divide/FrameAnnotation.d.ts +142 -0
  218. package/dist/types/plugins/divide/FrameDrawable.d.ts +75 -0
  219. package/dist/types/plugins/divide/index.d.ts +6 -0
  220. package/dist/types/plugins/divide/types.d.ts +38 -0
  221. package/dist/types/plugins/hotpoint/HotpointPlugin.d.ts +93 -0
  222. package/dist/types/plugins/hotpoint/index.d.ts +1 -0
  223. package/dist/types/plugins/index.d.ts +12 -0
  224. package/dist/types/plugins/layer-manager/LayerManagerPlugin.d.ts +59 -0
  225. package/dist/types/plugins/layer-manager/index.d.ts +1 -0
  226. package/dist/types/plugins/local-model-uploader/IUploader.d.ts +10 -0
  227. package/dist/types/plugins/local-model-uploader/LocalDxfUploader.d.ts +19 -0
  228. package/dist/types/plugins/local-model-uploader/index.d.ts +1 -0
  229. package/dist/types/plugins/measure/AngleMeasureDrawable.d.ts +12 -0
  230. package/dist/types/plugins/measure/AngleMeasurement.d.ts +16 -0
  231. package/dist/types/plugins/measure/AreaMeasureDrawable.d.ts +14 -0
  232. package/dist/types/plugins/measure/AreaMeasurement.d.ts +31 -0
  233. package/dist/types/plugins/measure/BaseMeasureDrawable.d.ts +35 -0
  234. package/dist/types/plugins/measure/BaseMeasurement.d.ts +127 -0
  235. package/dist/types/plugins/measure/CoordinateMeasureDrawable.d.ts +10 -0
  236. package/dist/types/plugins/measure/CoordinateMeasurement.d.ts +15 -0
  237. package/dist/types/plugins/measure/DistanceMeasureDrawable.d.ts +15 -0
  238. package/dist/types/plugins/measure/DistanceMeasurement.d.ts +28 -0
  239. package/dist/types/plugins/measure/MeasurementPlugin.d.ts +131 -0
  240. package/dist/types/plugins/measure/index.d.ts +3 -0
  241. package/dist/types/plugins/overview-map/ImageDrawable.d.ts +41 -0
  242. package/dist/types/plugins/overview-map/LineDrawable.d.ts +20 -0
  243. package/dist/types/plugins/overview-map/OverviewMapDrawable.d.ts +24 -0
  244. package/dist/types/plugins/overview-map/OverviewMapPlugin.d.ts +156 -0
  245. package/dist/types/plugins/overview-map/TextDrawable.d.ts +50 -0
  246. package/dist/types/plugins/overview-map/index.d.ts +5 -0
  247. package/dist/types/plugins/screenshot/ScreenshotPlugin.d.ts +88 -0
  248. package/dist/types/plugins/screenshot/index.d.ts +1 -0
  249. package/dist/types/plugins/stats/StatsPlugin.d.ts +20 -0
  250. package/dist/types/plugins/stats/index.d.ts +1 -0
  251. package/dist/types/plugins/toolbars/DxfViewerToolbarPlugin.d.ts +67 -0
  252. package/dist/types/plugins/toolbars/MarkupToolbar.d.ts +33 -0
  253. package/dist/types/plugins/toolbars/Toolbar.config.d.ts +5 -0
  254. package/dist/types/plugins/toolbars/Toolbar.constants.d.ts +96 -0
  255. package/dist/types/plugins/toolbars/Toolbar.d.ts +102 -0
  256. package/dist/types/plugins/toolbars/index.d.ts +5 -0
  257. package/dist/types/version.d.ts +2 -0
  258. package/package.json +90 -0
@@ -0,0 +1,773 @@
1
+ import type * as _THREE from 'three';
2
+ import { THREESubset, Ref, MOUSE_BUTTON, ACTION, PointerInput, MouseButtons, Touches, FitToOptions, CameraControlsEventMap } from './types';
3
+ import { EventDispatcher } from './EventDispatcher';
4
+ export declare class CameraControls extends EventDispatcher {
5
+ /**
6
+ * Injects THREE as the dependency. You can then proceed to use CameraControls.
7
+ *
8
+ * e.g
9
+ * ```javascript
10
+ * CameraControls.install( { THREE: THREE } );
11
+ * ```
12
+ *
13
+ * Note: If you do not wish to use enter three.js to reduce file size(tree-shaking for example), make a subset to install.
14
+ *
15
+ * ```js
16
+ * import {
17
+ * Vector2,
18
+ * Vector3,
19
+ * Vector4,
20
+ * Quaternion,
21
+ * Matrix4,
22
+ * Spherical,
23
+ * Box3,
24
+ * Sphere,
25
+ * Raycaster,
26
+ * MathUtils,
27
+ * } from 'three';
28
+ *
29
+ * const subsetOfTHREE = {
30
+ * Vector2 : Vector2,
31
+ * Vector3 : Vector3,
32
+ * Vector4 : Vector4,
33
+ * Quaternion: Quaternion,
34
+ * Matrix4 : Matrix4,
35
+ * Spherical : Spherical,
36
+ * Box3 : Box3,
37
+ * Sphere : Sphere,
38
+ * Raycaster : Raycaster,
39
+ * };
40
+
41
+ * CameraControls.install( { THREE: subsetOfTHREE } );
42
+ * ```
43
+ * @category Statics
44
+ */
45
+ static install(libs: {
46
+ THREE: THREESubset;
47
+ }): void;
48
+ /**
49
+ * list all ACTIONs
50
+ * @category Statics
51
+ */
52
+ static get ACTION(): typeof ACTION;
53
+ /**
54
+ * Minimum vertical angle in radians.
55
+ * The angle has to be between `0` and `.maxPolarAngle` inclusive.
56
+ * The default value is `0`.
57
+ *
58
+ * e.g.
59
+ * ```
60
+ * cameraControls.maxPolarAngle = 0;
61
+ * ```
62
+ * @category Properties
63
+ */
64
+ minPolarAngle: number;
65
+ /**
66
+ * Maximum vertical angle in radians.
67
+ * The angle has to be between `.maxPolarAngle` and `Math.PI` inclusive.
68
+ * The default value is `Math.PI`.
69
+ *
70
+ * e.g.
71
+ * ```
72
+ * cameraControls.maxPolarAngle = Math.PI;
73
+ * ```
74
+ * @category Properties
75
+ */
76
+ maxPolarAngle: number;
77
+ /**
78
+ * Minimum horizontal angle in radians.
79
+ * The angle has to be less than `.maxAzimuthAngle`.
80
+ * The default value is `- Infinity`.
81
+ *
82
+ * e.g.
83
+ * ```
84
+ * cameraControls.minAzimuthAngle = - Infinity;
85
+ * ```
86
+ * @category Properties
87
+ */
88
+ minAzimuthAngle: number;
89
+ /**
90
+ * Maximum horizontal angle in radians.
91
+ * The angle has to be greater than `.minAzimuthAngle`.
92
+ * The default value is `Infinity`.
93
+ *
94
+ * e.g.
95
+ * ```
96
+ * cameraControls.maxAzimuthAngle = Infinity;
97
+ * ```
98
+ * @category Properties
99
+ */
100
+ maxAzimuthAngle: number;
101
+ /**
102
+ * Minimum distance for dolly. The value must be higher than `0`.
103
+ * PerspectiveCamera only.
104
+ * @category Properties
105
+ */
106
+ minDistance: number;
107
+ /**
108
+ * Maximum distance for dolly. The value must be higher than `minDistance`.
109
+ * PerspectiveCamera only.
110
+ * @category Properties
111
+ */
112
+ maxDistance: number;
113
+ /**
114
+ * `true` to enable Infinity Dolly.
115
+ * When the Dolly distance is less than the `minDistance`, radius of the sphere will be set `minDistance` automatically.
116
+ * @category Properties
117
+ */
118
+ infinityDolly: boolean;
119
+ /**
120
+ * Minimum camera zoom.
121
+ * @category Properties
122
+ */
123
+ minZoom: number;
124
+ /**
125
+ * Maximum camera zoom.
126
+ * @category Properties
127
+ */
128
+ maxZoom: number;
129
+ /**
130
+ * Approximate time in seconds to reach the target. A smaller value will reach the target faster.
131
+ * @category Properties
132
+ */
133
+ smoothTime: number;
134
+ /**
135
+ * the smoothTime while dragging
136
+ * @category Properties
137
+ */
138
+ draggingSmoothTime: number;
139
+ /**
140
+ * Max transition speed in unit-per-seconds
141
+ * @category Properties
142
+ */
143
+ maxSpeed: number;
144
+ /**
145
+ * Speed of azimuth (horizontal) rotation.
146
+ * @category Properties
147
+ */
148
+ azimuthRotateSpeed: number;
149
+ /**
150
+ * Speed of polar (vertical) rotation.
151
+ * @category Properties
152
+ */
153
+ polarRotateSpeed: number;
154
+ /**
155
+ * Speed of mouse-wheel dollying.
156
+ * @category Properties
157
+ */
158
+ dollySpeed: number;
159
+ /**
160
+ * Speed of drag for truck and pedestal.
161
+ * @category Properties
162
+ */
163
+ truckSpeed: number;
164
+ /**
165
+ * `true` to enable Dolly-in to the mouse cursor coords.
166
+ * @category Properties
167
+ */
168
+ dollyToCursor: boolean;
169
+ /**
170
+ * @category Properties
171
+ */
172
+ dragToOffset: boolean;
173
+ /**
174
+ * The same as `.screenSpacePanning` in three.js's OrbitControls.
175
+ * @category Properties
176
+ */
177
+ verticalDragToForward: boolean;
178
+ /**
179
+ * Friction ratio of the boundary.
180
+ * @category Properties
181
+ */
182
+ boundaryFriction: number;
183
+ /**
184
+ * Controls how soon the `rest` event fires as the camera slows.
185
+ * @category Properties
186
+ */
187
+ restThreshold: number;
188
+ /**
189
+ * An array of Meshes to collide with camera.
190
+ * Be aware colliderMeshes may decrease performance. The collision test uses 4 raycasters from the camera since the near plane has 4 corners.
191
+ * @category Properties
192
+ */
193
+ colliderMeshes: _THREE.Object3D[];
194
+ /**
195
+ * User's mouse input config.
196
+ *
197
+ * | button to assign | behavior |
198
+ * | --------------------- | -------- |
199
+ * | `mouseButtons.left` | `CameraControls.ACTION.ROTATE`* \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
200
+ * | `mouseButtons.right` | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK`* \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
201
+ * | `mouseButtons.wheel` ¹ | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY` \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
202
+ * | `mouseButtons.middle` ² | `CameraControls.ACTION.ROTATE` \| `CameraControls.ACTION.TRUCK` \| `CameraControls.ACTION.OFFSET` \| `CameraControls.ACTION.DOLLY`* \| `CameraControls.ACTION.ZOOM` \| `CameraControls.ACTION.NONE` |
203
+ *
204
+ * 1. Mouse wheel event for scroll "up/down" on mac "up/down/left/right"
205
+ * 2. Mouse click on wheel event "button"
206
+ * - \* is the default.
207
+ * - The default of `mouseButtons.wheel` is:
208
+ * - `DOLLY` for Perspective camera.
209
+ * - `ZOOM` for Orthographic camera, and can't set `DOLLY`.
210
+ * @category Properties
211
+ */
212
+ mouseButtons: MouseButtons;
213
+ /**
214
+ * User's touch input config.
215
+ *
216
+ * | fingers to assign | behavior |
217
+ * | --------------------- | -------- |
218
+ * | `touches.one` | `CameraControls.ACTION.TOUCH_ROTATE`* \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.DOLLY` | `CameraControls.ACTION.ZOOM` | `CameraControls.ACTION.NONE` |
219
+ * | `touches.two` | `ACTION.TOUCH_DOLLY_TRUCK` \| `ACTION.TOUCH_DOLLY_OFFSET` \| `ACTION.TOUCH_DOLLY_ROTATE` \| `ACTION.TOUCH_ZOOM_TRUCK` \| `ACTION.TOUCH_ZOOM_OFFSET` \| `ACTION.TOUCH_ZOOM_ROTATE` \| `ACTION.TOUCH_DOLLY` \| `ACTION.TOUCH_ZOOM` \| `CameraControls.ACTION.TOUCH_ROTATE` \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.NONE` |
220
+ * | `touches.three` | `ACTION.TOUCH_DOLLY_TRUCK` \| `ACTION.TOUCH_DOLLY_OFFSET` \| `ACTION.TOUCH_DOLLY_ROTATE` \| `ACTION.TOUCH_ZOOM_TRUCK` \| `ACTION.TOUCH_ZOOM_OFFSET` \| `ACTION.TOUCH_ZOOM_ROTATE` \| `CameraControls.ACTION.TOUCH_ROTATE` \| `CameraControls.ACTION.TOUCH_TRUCK` \| `CameraControls.ACTION.TOUCH_OFFSET` \| `CameraControls.ACTION.NONE` |
221
+ *
222
+ * - \* is the default.
223
+ * - The default of `touches.two` and `touches.three` is:
224
+ * - `TOUCH_DOLLY_TRUCK` for Perspective camera.
225
+ * - `TOUCH_ZOOM_TRUCK` for Orthographic camera, and can't set `TOUCH_DOLLY_TRUCK` and `TOUCH_DOLLY`.
226
+ * @category Properties
227
+ */
228
+ touches: Touches;
229
+ /**
230
+ * Force cancel user dragging.
231
+ * @category Methods
232
+ */
233
+ cancel: () => void;
234
+ protected _enabled: boolean;
235
+ protected _camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera;
236
+ protected _yAxisUpSpace: _THREE.Quaternion;
237
+ protected _yAxisUpSpaceInverse: _THREE.Quaternion;
238
+ protected _state: ACTION;
239
+ protected _domElement?: HTMLElement;
240
+ protected _viewport: _THREE.Vector4 | null;
241
+ protected _target: _THREE.Vector3;
242
+ protected _targetEnd: _THREE.Vector3;
243
+ protected _focalOffset: _THREE.Vector3;
244
+ protected _focalOffsetEnd: _THREE.Vector3;
245
+ protected _spherical: _THREE.Spherical;
246
+ protected _sphericalEnd: _THREE.Spherical;
247
+ protected _zoom: number;
248
+ protected _zoomEnd: number;
249
+ protected _target0: _THREE.Vector3;
250
+ protected _position0: _THREE.Vector3;
251
+ protected _zoom0: number;
252
+ protected _focalOffset0: _THREE.Vector3;
253
+ protected _dollyControlAmount: number;
254
+ protected _dollyControlCoord: _THREE.Vector2;
255
+ protected _nearPlaneCorners: [_THREE.Vector3, _THREE.Vector3, _THREE.Vector3, _THREE.Vector3];
256
+ protected _hasRested: boolean;
257
+ protected _boundary: _THREE.Box3;
258
+ protected _boundaryEnclosesCamera: boolean;
259
+ protected _needsUpdate: boolean;
260
+ protected _updatedLastTime: boolean;
261
+ protected _elementRect: DOMRect | {
262
+ x: number;
263
+ y: number;
264
+ width: number;
265
+ height: number;
266
+ left: number;
267
+ right: number;
268
+ top: number;
269
+ bottom: number;
270
+ };
271
+ protected _activePointers: PointerInput[];
272
+ protected _isUserControllingRotate: boolean;
273
+ protected _isUserControllingDolly: boolean;
274
+ protected _isUserControllingTruck: boolean;
275
+ protected _isUserControllingOffset: boolean;
276
+ protected _isUserControllingZoom: boolean;
277
+ protected _thetaVelocity: Ref;
278
+ protected _phiVelocity: Ref;
279
+ protected _radiusVelocity: Ref;
280
+ protected _targetVelocity: _THREE.Vector3;
281
+ protected _focalOffsetVelocity: _THREE.Vector3;
282
+ protected _zoomVelocity: Ref;
283
+ /**
284
+ * Creates a `CameraControls` instance.
285
+ *
286
+ * Note:
287
+ * You **must install** three.js before using camera-controls. see [#install](#install)
288
+ * Not doing so will lead to runtime errors (`undefined` references to THREE).
289
+ *
290
+ * e.g.
291
+ * ```
292
+ * CameraControls.install( { THREE } );
293
+ * const cameraControls = new CameraControls( camera, domElement );
294
+ * ```
295
+ *
296
+ * @param camera A `THREE.PerspectiveCamera` or `THREE.OrthographicCamera` to be controlled.
297
+ * @param domElement A `HTMLElement` for the draggable area, usually `renderer.domElement`.
298
+ * @category Constructor
299
+ */
300
+ constructor(camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera, domElement?: HTMLElement);
301
+ /**
302
+ * The camera to be controlled
303
+ * @category Properties
304
+ */
305
+ get camera(): _THREE.PerspectiveCamera | _THREE.OrthographicCamera;
306
+ set camera(camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera);
307
+ /**
308
+ * Whether or not the controls are enabled.
309
+ * `false` to disable user dragging/touch-move, but all methods works.
310
+ * @category Properties
311
+ */
312
+ get enabled(): boolean;
313
+ set enabled(enabled: boolean);
314
+ /**
315
+ * Returns `true` if the controls are active updating.
316
+ * readonly value.
317
+ * @category Properties
318
+ */
319
+ get active(): boolean;
320
+ /**
321
+ * Getter for the current `ACTION`.
322
+ * readonly value.
323
+ * @category Properties
324
+ */
325
+ get currentAction(): ACTION;
326
+ /**
327
+ * get/set Current distance.
328
+ * @category Properties
329
+ */
330
+ get distance(): number;
331
+ set distance(distance: number);
332
+ /**
333
+ * get/set the azimuth angle (horizontal) in radians.
334
+ * Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative.
335
+ * @category Properties
336
+ */
337
+ get azimuthAngle(): number;
338
+ set azimuthAngle(azimuthAngle: number);
339
+ /**
340
+ * get/set the polar angle (vertical) in radians.
341
+ * @category Properties
342
+ */
343
+ get polarAngle(): number;
344
+ set polarAngle(polarAngle: number);
345
+ /**
346
+ * Whether camera position should be enclosed in the boundary or not.
347
+ * @category Properties
348
+ */
349
+ get boundaryEnclosesCamera(): boolean;
350
+ set boundaryEnclosesCamera(boundaryEnclosesCamera: boolean);
351
+ /**
352
+ * Adds the specified event listener.
353
+ * Applicable event types (which is `K`) are:
354
+ * | Event name | Timing |
355
+ * | ------------------- | ------ |
356
+ * | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ |
357
+ * | `'control'` | When the user controls the camera (dragging). |
358
+ * | `'controlend'` | When the user ends to control the camera. ¹ |
359
+ * | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` |
360
+ * | `'update'` | When the camera position is updated. |
361
+ * | `'wake'` | When the camera starts moving. |
362
+ * | `'rest'` | When the camera movement is below `.restThreshold` ². |
363
+ * | `'sleep'` | When the camera end moving. |
364
+ *
365
+ * 1. `mouseButtons.wheel` (Mouse wheel control) does not emit `'controlstart'` and `'controlend'`. `mouseButtons.wheel` uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected.
366
+ * 2. Due to damping, `sleep` will usually fire a few seconds after the camera _appears_ to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the `rest` event. This can be fine tuned using the `.restThreshold` parameter. See the [Rest and Sleep Example](https://yomotsu.github.io/camera-controls/examples/rest-and-sleep.html).
367
+ *
368
+ * e.g.
369
+ * ```
370
+ * cameraControl.addEventListener( 'controlstart', myCallbackFunction );
371
+ * ```
372
+ * @param type event name
373
+ * @param listener handler function
374
+ * @category Methods
375
+ */
376
+ addEventListener<K extends keyof CameraControlsEventMap>(type: K, listener: (event: CameraControlsEventMap[K]) => any): void;
377
+ /**
378
+ * Removes the specified event listener
379
+ * e.g.
380
+ * ```
381
+ * cameraControl.addEventListener( 'controlstart', myCallbackFunction );
382
+ * ```
383
+ * @param type event name
384
+ * @param listener handler function
385
+ * @category Methods
386
+ */
387
+ removeEventListener<K extends keyof CameraControlsEventMap>(type: K, listener: (event: CameraControlsEventMap[K]) => any): void;
388
+ /**
389
+ * Rotate azimuthal angle(horizontal) and polar angle(vertical).
390
+ * Every value is added to the current value.
391
+ * @param azimuthAngle Azimuth rotate angle. In radian.
392
+ * @param polarAngle Polar rotate angle. In radian.
393
+ * @param enableTransition Whether to move smoothly or immediately
394
+ * @category Methods
395
+ */
396
+ rotate(azimuthAngle: number, polarAngle: number, enableTransition?: boolean): Promise<void>;
397
+ /**
398
+ * Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.
399
+ *
400
+ * e.g.
401
+ * ```
402
+ * cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true );
403
+ * ```
404
+ * @param azimuthAngle Azimuth rotate angle. In radian.
405
+ * @param enableTransition Whether to move smoothly or immediately
406
+ * @category Methods
407
+ */
408
+ rotateAzimuthTo(azimuthAngle: number, enableTransition?: boolean): Promise<void>;
409
+ /**
410
+ * Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.
411
+ *
412
+ * e.g.
413
+ * ```
414
+ * cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true );
415
+ * ```
416
+ * @param polarAngle Polar rotate angle. In radian.
417
+ * @param enableTransition Whether to move smoothly or immediately
418
+ * @category Methods
419
+ */
420
+ rotatePolarTo(polarAngle: number, enableTransition?: boolean): Promise<void>;
421
+ /**
422
+ * Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle.
423
+ * Camera view will rotate over the orbit pivot absolutely:
424
+ *
425
+ * azimuthAngle
426
+ * ```
427
+ * 0º
428
+ * \
429
+ * 90º -----+----- -90º
430
+ * \
431
+ * 180º
432
+ * ```
433
+ * | direction | angle |
434
+ * | --------- | ---------------------- |
435
+ * | front | 0º |
436
+ * | left | 90º (`Math.PI / 2`) |
437
+ * | right | -90º (`- Math.PI / 2`) |
438
+ * | back | 180º (`Math.PI`) |
439
+ *
440
+ * polarAngle
441
+ * ```
442
+ * 180º
443
+ * |
444
+ * 90º
445
+ * |
446
+ * 0º
447
+ * ```
448
+ * | direction | angle |
449
+ * | -------------------- | ---------------------- |
450
+ * | top/sky | 180º (`Math.PI`) |
451
+ * | horizontal from view | 90º (`Math.PI / 2`) |
452
+ * | bottom/floor | 0º |
453
+ *
454
+ * @param azimuthAngle Azimuth rotate angle to. In radian.
455
+ * @param polarAngle Polar rotate angle to. In radian.
456
+ * @param enableTransition Whether to move smoothly or immediately
457
+ * @category Methods
458
+ */
459
+ rotateTo(azimuthAngle: number, polarAngle: number, enableTransition?: boolean): Promise<void>;
460
+ /**
461
+ * Dolly in/out camera position.
462
+ * @param distance Distance of dollyIn. Negative number for dollyOut.
463
+ * @param enableTransition Whether to move smoothly or immediately.
464
+ * @category Methods
465
+ */
466
+ dolly(distance: number, enableTransition?: boolean): Promise<void>;
467
+ /**
468
+ * Dolly in/out camera position to given distance.
469
+ * @param distance Distance of dolly.
470
+ * @param enableTransition Whether to move smoothly or immediately.
471
+ * @category Methods
472
+ */
473
+ dollyTo(distance: number, enableTransition?: boolean): Promise<void>;
474
+ /**
475
+ * Zoom in/out camera. The value is added to camera zoom.
476
+ * Limits set with `.minZoom` and `.maxZoom`
477
+ * @param zoomStep zoom scale
478
+ * @param enableTransition Whether to move smoothly or immediately
479
+ * @category Methods
480
+ */
481
+ zoom(zoomStep: number, enableTransition?: boolean): Promise<void>;
482
+ /**
483
+ * Zoom in/out camera to given scale. The value overwrites camera zoom.
484
+ * Limits set with .minZoom and .maxZoom
485
+ * @param zoom
486
+ * @param enableTransition
487
+ * @category Methods
488
+ */
489
+ zoomTo(zoom: number, enableTransition?: boolean): Promise<void>;
490
+ /**
491
+ * @deprecated `pan()` has been renamed to `truck()`
492
+ * @category Methods
493
+ */
494
+ pan(x: number, y: number, enableTransition?: boolean): Promise<void>;
495
+ /**
496
+ * Truck and pedestal camera using current azimuthal angle
497
+ * @param x Horizontal translate amount
498
+ * @param y Vertical translate amount
499
+ * @param enableTransition Whether to move smoothly or immediately
500
+ * @category Methods
501
+ */
502
+ truck(x: number, y: number, enableTransition?: boolean): Promise<void>;
503
+ /**
504
+ * Move forward / backward.
505
+ * @param distance Amount to move forward / backward. Negative value to move backward
506
+ * @param enableTransition Whether to move smoothly or immediately
507
+ * @category Methods
508
+ */
509
+ forward(distance: number, enableTransition?: boolean): Promise<void>;
510
+ /**
511
+ * Move up / down.
512
+ * @param height Amount to move up / down. Negative value to move down
513
+ * @param enableTransition Whether to move smoothly or immediately
514
+ * @category Methods
515
+ */
516
+ elevate(height: number, enableTransition?: boolean): Promise<void>;
517
+ /**
518
+ * Move target position to given point.
519
+ * @param x x coord to move center position
520
+ * @param y y coord to move center position
521
+ * @param z z coord to move center position
522
+ * @param enableTransition Whether to move smoothly or immediately
523
+ * @category Methods
524
+ */
525
+ moveTo(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
526
+ /**
527
+ * Look in the given point direction.
528
+ * @param x point x.
529
+ * @param y point y.
530
+ * @param z point z.
531
+ * @param enableTransition Whether to move smoothly or immediately.
532
+ * @returns Transition end promise
533
+ * @category Methods
534
+ */
535
+ lookInDirectionOf(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
536
+ /**
537
+ * Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit.
538
+ * set `cover: true` to fill enter screen.
539
+ * e.g.
540
+ * ```
541
+ * cameraControls.fitToBox( myMesh );
542
+ * ```
543
+ * @param box3OrObject Axis aligned bounding box to fit the view.
544
+ * @param enableTransition Whether to move smoothly or immediately.
545
+ * @param options | `<object>` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }
546
+ * @returns Transition end promise
547
+ * @category Methods
548
+ */
549
+ fitToBox(box3OrObject: _THREE.Box3 | _THREE.Object3D, enableTransition: boolean, { cover, paddingLeft, paddingRight, paddingBottom, paddingTop }?: Partial<FitToOptions>): Promise<void[]>;
550
+ /**
551
+ * Fit the viewport to the sphere or the bounding sphere of the object.
552
+ * @param sphereOrMesh
553
+ * @param enableTransition
554
+ * @category Methods
555
+ */
556
+ fitToSphere(sphereOrMesh: _THREE.Sphere | _THREE.Object3D, enableTransition: boolean): Promise<void[]>;
557
+ /**
558
+ * Look at the `target` from the `position`.
559
+ * @param positionX
560
+ * @param positionY
561
+ * @param positionZ
562
+ * @param targetX
563
+ * @param targetY
564
+ * @param targetZ
565
+ * @param enableTransition
566
+ * @category Methods
567
+ */
568
+ setLookAt(positionX: number, positionY: number, positionZ: number, targetX: number, targetY: number, targetZ: number, enableTransition?: boolean): Promise<void>;
569
+ /**
570
+ * Similar to setLookAt, but it interpolates between two states.
571
+ * @param positionAX
572
+ * @param positionAY
573
+ * @param positionAZ
574
+ * @param targetAX
575
+ * @param targetAY
576
+ * @param targetAZ
577
+ * @param positionBX
578
+ * @param positionBY
579
+ * @param positionBZ
580
+ * @param targetBX
581
+ * @param targetBY
582
+ * @param targetBZ
583
+ * @param t
584
+ * @param enableTransition
585
+ * @category Methods
586
+ */
587
+ lerpLookAt(positionAX: number, positionAY: number, positionAZ: number, targetAX: number, targetAY: number, targetAZ: number, positionBX: number, positionBY: number, positionBZ: number, targetBX: number, targetBY: number, targetBZ: number, t: number, enableTransition?: boolean): Promise<void>;
588
+ /**
589
+ * Set angle and distance by given position.
590
+ * An alias of `setLookAt()`, without target change. Thus keep gazing at the current target
591
+ * @param positionX
592
+ * @param positionY
593
+ * @param positionZ
594
+ * @param enableTransition
595
+ * @category Methods
596
+ */
597
+ setPosition(positionX: number, positionY: number, positionZ: number, enableTransition?: boolean): Promise<void>;
598
+ /**
599
+ * Set the target position where gaze at.
600
+ * An alias of `setLookAt()`, without position change. Thus keep the same position.
601
+ * @param targetX
602
+ * @param targetY
603
+ * @param targetZ
604
+ * @param enableTransition
605
+ * @category Methods
606
+ */
607
+ setTarget(targetX: number, targetY: number, targetZ: number, enableTransition?: boolean): Promise<void>;
608
+ /**
609
+ * Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
610
+ * @param x
611
+ * @param y
612
+ * @param z
613
+ * @param enableTransition
614
+ * @category Methods
615
+ */
616
+ setFocalOffset(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
617
+ /**
618
+ * Set orbit point without moving the camera.
619
+ * SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions.
620
+ * @param targetX
621
+ * @param targetY
622
+ * @param targetZ
623
+ * @category Methods
624
+ */
625
+ setOrbitPoint(targetX: number, targetY: number, targetZ: number): void;
626
+ /**
627
+ * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
628
+ * @param box3
629
+ * @category Methods
630
+ */
631
+ setBoundary(box3?: _THREE.Box3): void;
632
+ /**
633
+ * Set (or unset) the current viewport.
634
+ * Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.
635
+ * @param viewportOrX
636
+ * @param y
637
+ * @param width
638
+ * @param height
639
+ * @category Methods
640
+ */
641
+ setViewport(viewportOrX: _THREE.Vector4 | number | null, y: number, width: number, height: number): void;
642
+ /**
643
+ * Calculate the distance to fit the box.
644
+ * @param width box width
645
+ * @param height box height
646
+ * @param depth box depth
647
+ * @returns distance
648
+ * @category Methods
649
+ */
650
+ getDistanceToFitBox(width: number, height: number, depth: number, cover?: boolean): number;
651
+ /**
652
+ * Calculate the distance to fit the sphere.
653
+ * @param radius sphere radius
654
+ * @returns distance
655
+ * @category Methods
656
+ */
657
+ getDistanceToFitSphere(radius: number): number;
658
+ /**
659
+ * Returns its current gazing target, which is the center position of the orbit.
660
+ * @param out current gazing target
661
+ * @category Methods
662
+ */
663
+ getTarget(out: _THREE.Vector3): _THREE.Vector3;
664
+ /**
665
+ * Returns its current position.
666
+ * @param out current position
667
+ * @category Methods
668
+ */
669
+ getPosition(out: _THREE.Vector3): _THREE.Vector3;
670
+ /**
671
+ * Returns its current focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
672
+ * @param out current focal offset
673
+ * @category Methods
674
+ */
675
+ getFocalOffset(out: _THREE.Vector3): _THREE.Vector3;
676
+ /**
677
+ * Normalize camera azimuth angle rotation between 0 and 360 degrees.
678
+ * @category Methods
679
+ */
680
+ normalizeRotations(): void;
681
+ /**
682
+ * Reset all rotation and position to defaults.
683
+ * @param enableTransition
684
+ * @category Methods
685
+ */
686
+ reset(enableTransition?: boolean): Promise<void[]>;
687
+ /**
688
+ * Set current camera position as the default position.
689
+ * @category Methods
690
+ */
691
+ saveState(): void;
692
+ /**
693
+ * Sync camera-up direction.
694
+ * When camera-up vector is changed, `.updateCameraUp()` must be called.
695
+ * @category Methods
696
+ */
697
+ updateCameraUp(): void;
698
+ /**
699
+ * Update camera position and directions.
700
+ * This should be called in your tick loop every time, and returns true if re-rendering is needed.
701
+ * @param delta
702
+ * @returns updated
703
+ * @category Methods
704
+ */
705
+ update(delta: number): boolean;
706
+ /**
707
+ * Get all state in JSON string
708
+ * @category Methods
709
+ */
710
+ toJSON(): string;
711
+ /**
712
+ * Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.
713
+ * @param json
714
+ * @param enableTransition
715
+ * @category Methods
716
+ */
717
+ fromJSON(json: string, enableTransition?: boolean): void;
718
+ /**
719
+ * Attach all internal event handlers to enable drag control.
720
+ * @category Methods
721
+ */
722
+ connect(domElement: HTMLElement): void;
723
+ /**
724
+ * Detach all internal event handlers to disable drag control.
725
+ */
726
+ disconnect(): void;
727
+ /**
728
+ * Dispose the cameraControls instance itself, remove all eventListeners.
729
+ * @category Methods
730
+ */
731
+ dispose(): void;
732
+ protected _findPointerById(pointerId: number): PointerInput | undefined;
733
+ protected _findPointerByMouseButton(mouseButton: MOUSE_BUTTON): PointerInput | undefined;
734
+ protected _encloseToBoundary(position: _THREE.Vector3, offset: _THREE.Vector3, friction: number): _THREE.Vector3;
735
+ protected _updateNearPlaneCorners(): void;
736
+ protected _truckInternal: (deltaX: number, deltaY: number, dragToOffset: boolean) => void;
737
+ protected _rotateInternal: (deltaX: number, deltaY: number) => void;
738
+ protected _dollyInternal: (delta: number, x: number, y: number) => void;
739
+ protected _zoomInternal: (delta: number, x: number, y: number) => void;
740
+ protected _collisionTest(): number;
741
+ /**
742
+ * Get its client rect and package into given `DOMRect` .
743
+ */
744
+ protected _getClientRect(target: DOMRect | any): DOMRect | undefined;
745
+ protected _createOnRestPromise(resolveImmediately: boolean): Promise<void>;
746
+ protected _addAllEventListeners(_domElement: HTMLElement): void;
747
+ protected _removeAllEventListeners(): void;
748
+ /**
749
+ * backward compatible
750
+ * @deprecated use smoothTime (in seconds) instead
751
+ * @category Properties
752
+ */
753
+ get dampingFactor(): number;
754
+ /**
755
+ * backward compatible
756
+ * @deprecated use smoothTime (in seconds) instead
757
+ * @category Properties
758
+ */
759
+ set dampingFactor(_: number);
760
+ /**
761
+ * backward compatible
762
+ * @deprecated use draggingSmoothTime (in seconds) instead
763
+ * @category Properties
764
+ */
765
+ get draggingDampingFactor(): number;
766
+ /**
767
+ * backward compatible
768
+ * @deprecated use draggingSmoothTime (in seconds) instead
769
+ * @category Properties
770
+ */
771
+ set draggingDampingFactor(_: number);
772
+ static createBoundingSphere(object3d: _THREE.Object3D, out?: _THREE.Sphere): _THREE.Sphere;
773
+ }