@maqiuyao/dxf-viewer 0.1.0

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 (227) hide show
  1. package/README.md +79 -0
  2. package/dist/assets/vite-project.css +1 -0
  3. package/dist/dxf-viewer.cjs +1533 -0
  4. package/dist/dxf-viewer.js +33490 -0
  5. package/dist/src/dxfViewer/core/Configs.d.ts +250 -0
  6. package/dist/src/dxfViewer/core/Constants.d.ts +76 -0
  7. package/dist/src/dxfViewer/core/Units.d.ts +16 -0
  8. package/dist/src/dxfViewer/core/VersionManager.d.ts +14 -0
  9. package/dist/src/dxfViewer/core/camera/CameraManager.d.ts +81 -0
  10. package/dist/src/dxfViewer/core/camera/index.d.ts +1 -0
  11. package/dist/src/dxfViewer/core/camera-controls/CameraControls.d.ts +744 -0
  12. package/dist/src/dxfViewer/core/camera-controls/Constants.d.ts +2 -0
  13. package/dist/src/dxfViewer/core/camera-controls/EventDispatcher.d.ts +42 -0
  14. package/dist/src/dxfViewer/core/camera-controls/index.d.ts +2 -0
  15. package/dist/src/dxfViewer/core/camera-controls/types.d.ts +112 -0
  16. package/dist/src/dxfViewer/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +7 -0
  17. package/dist/src/dxfViewer/core/camera-controls/utils/math-utils.d.ts +14 -0
  18. package/dist/src/dxfViewer/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
  19. package/dist/src/dxfViewer/core/canvas/CanvasRender.d.ts +49 -0
  20. package/dist/src/dxfViewer/core/canvas/Constants.d.ts +28 -0
  21. package/dist/src/dxfViewer/core/canvas/Drawable.d.ts +87 -0
  22. package/dist/src/dxfViewer/core/canvas/DrawableList.d.ts +40 -0
  23. package/dist/src/dxfViewer/core/canvas/index.d.ts +4 -0
  24. package/dist/src/dxfViewer/core/compare/BaseDxfCompareHelper.d.ts +104 -0
  25. package/dist/src/dxfViewer/core/compare/CompareDrawable.d.ts +30 -0
  26. package/dist/src/dxfViewer/core/compare/DxfCompareHelper.d.ts +76 -0
  27. package/dist/src/dxfViewer/core/compare/DxfCompareMarkupManager.d.ts +11 -0
  28. package/dist/src/dxfViewer/core/compare/index.d.ts +4 -0
  29. package/dist/src/dxfViewer/core/components/Container.d.ts +38 -0
  30. package/dist/src/dxfViewer/core/components/ProgressBar.d.ts +31 -0
  31. package/dist/src/dxfViewer/core/components/Spinner.d.ts +13 -0
  32. package/dist/src/dxfViewer/core/components/index.d.ts +3 -0
  33. package/dist/src/dxfViewer/core/controls/CameraControlsEx.d.ts +33 -0
  34. package/dist/src/dxfViewer/core/controls/Control.d.ts +17 -0
  35. package/dist/src/dxfViewer/core/controls/OrbitControls.d.ts +13 -0
  36. package/dist/src/dxfViewer/core/controls/PlanControls.d.ts +13 -0
  37. package/dist/src/dxfViewer/core/controls/index.d.ts +3 -0
  38. package/dist/src/dxfViewer/core/dxf/DxfCompare.d.ts +170 -0
  39. package/dist/src/dxfViewer/core/dxf/DxfConstants.d.ts +24 -0
  40. package/dist/src/dxfViewer/core/dxf/DxfLoader.d.ts +569 -0
  41. package/dist/src/dxfViewer/core/dxf/DxfObject.d.ts +44 -0
  42. package/dist/src/dxfViewer/core/dxf/DxfUtils.d.ts +79 -0
  43. package/dist/src/dxfViewer/core/dxf/HatchPatternShaders.d.ts +12 -0
  44. package/dist/src/dxfViewer/core/dxf/LinePatternShaders.d.ts +12 -0
  45. package/dist/src/dxfViewer/core/dxf/bspline.d.ts +7 -0
  46. package/dist/src/dxfViewer/core/dxf/dxfom-mtext.d.ts +46 -0
  47. package/dist/src/dxfViewer/core/dxf/dxfom-text.d.ts +16 -0
  48. package/dist/src/dxfViewer/core/dxf/index.d.ts +10 -0
  49. package/dist/src/dxfViewer/core/dxf/round10.d.ts +1 -0
  50. package/dist/src/dxfViewer/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
  51. package/dist/src/dxfViewer/core/dxf-parser/DxfBaseReader.d.ts +13 -0
  52. package/dist/src/dxfViewer/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
  53. package/dist/src/dxfViewer/core/dxf-parser/DxfParser.d.ts +321 -0
  54. package/dist/src/dxfViewer/core/dxf-parser/DxfTextReader.d.ts +30 -0
  55. package/dist/src/dxfViewer/core/dxf-parser/ParseHelpers.d.ts +18 -0
  56. package/dist/src/dxfViewer/core/dxf-parser/entities/3dface.d.ts +11 -0
  57. package/dist/src/dxfViewer/core/dxf-parser/entities/arc.d.ts +16 -0
  58. package/dist/src/dxfViewer/core/dxf-parser/entities/attdef.d.ts +31 -0
  59. package/dist/src/dxfViewer/core/dxf-parser/entities/attrib.d.ts +31 -0
  60. package/dist/src/dxfViewer/core/dxf-parser/entities/circle.d.ts +13 -0
  61. package/dist/src/dxfViewer/core/dxf-parser/entities/dimension.d.ts +22 -0
  62. package/dist/src/dxfViewer/core/dxf-parser/entities/ellipse.d.ts +15 -0
  63. package/dist/src/dxfViewer/core/dxf-parser/entities/geomtry.d.ts +40 -0
  64. package/dist/src/dxfViewer/core/dxf-parser/entities/hatch.d.ts +104 -0
  65. package/dist/src/dxfViewer/core/dxf-parser/entities/image.d.ts +37 -0
  66. package/dist/src/dxfViewer/core/dxf-parser/entities/insert.d.ts +21 -0
  67. package/dist/src/dxfViewer/core/dxf-parser/entities/leader.d.ts +20 -0
  68. package/dist/src/dxfViewer/core/dxf-parser/entities/line.d.ts +10 -0
  69. package/dist/src/dxfViewer/core/dxf-parser/entities/lwpolyline.d.ts +17 -0
  70. package/dist/src/dxfViewer/core/dxf-parser/entities/mleader.d.ts +97 -0
  71. package/dist/src/dxfViewer/core/dxf-parser/entities/mtext.d.ts +18 -0
  72. package/dist/src/dxfViewer/core/dxf-parser/entities/ole2frame.d.ts +18 -0
  73. package/dist/src/dxfViewer/core/dxf-parser/entities/point.d.ts +11 -0
  74. package/dist/src/dxfViewer/core/dxf-parser/entities/polyline.d.ts +19 -0
  75. package/dist/src/dxfViewer/core/dxf-parser/entities/ray.d.ts +10 -0
  76. package/dist/src/dxfViewer/core/dxf-parser/entities/region.d.ts +10 -0
  77. package/dist/src/dxfViewer/core/dxf-parser/entities/seqend.d.ts +8 -0
  78. package/dist/src/dxfViewer/core/dxf-parser/entities/solid.d.ts +10 -0
  79. package/dist/src/dxfViewer/core/dxf-parser/entities/spline.d.ts +23 -0
  80. package/dist/src/dxfViewer/core/dxf-parser/entities/table.d.ts +44 -0
  81. package/dist/src/dxfViewer/core/dxf-parser/entities/text.d.ts +18 -0
  82. package/dist/src/dxfViewer/core/dxf-parser/entities/vertex.d.ts +23 -0
  83. package/dist/src/dxfViewer/core/dxf-parser/entities/viewport.d.ts +46 -0
  84. package/dist/src/dxfViewer/core/dxf-parser/entities/xline.d.ts +10 -0
  85. package/dist/src/dxfViewer/core/dxf-parser/index.d.ts +27 -0
  86. package/dist/src/dxfViewer/core/dxf-parser/objects/common.d.ts +15 -0
  87. package/dist/src/dxfViewer/core/dxf-parser/objects/dictionary.d.ts +19 -0
  88. package/dist/src/dxfViewer/core/dxf-parser/objects/imagedef.d.ts +24 -0
  89. package/dist/src/dxfViewer/core/dxf-parser/objects/layout.d.ts +26 -0
  90. package/dist/src/dxfViewer/core/dxf-parser/objects/sortentstable.d.ts +12 -0
  91. package/dist/src/dxfViewer/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
  92. package/dist/src/dxfViewer/core/dxf-parser/objects/xrecord.d.ts +11 -0
  93. package/dist/src/dxfViewer/core/effect/EffectManager.d.ts +43 -0
  94. package/dist/src/dxfViewer/core/effect/index.d.ts +1 -0
  95. package/dist/src/dxfViewer/core/font/BaseFont.d.ts +41 -0
  96. package/dist/src/dxfViewer/core/font/FontManager.d.ts +52 -0
  97. package/dist/src/dxfViewer/core/font/MeshFont.d.ts +14 -0
  98. package/dist/src/dxfViewer/core/font/ShxFont.d.ts +49 -0
  99. package/dist/src/dxfViewer/core/font/index.d.ts +1 -0
  100. package/dist/src/dxfViewer/core/font/shx/ExtraLettersTemplate.d.ts +4 -0
  101. package/dist/src/dxfViewer/core/font/shx/Shx.constants.d.ts +20 -0
  102. package/dist/src/dxfViewer/core/font/shx/ShxParser.d.ts +18 -0
  103. package/dist/src/dxfViewer/core/font/shx/TextShape.d.ts +24 -0
  104. package/dist/src/dxfViewer/core/font/shx/gbk/index.d.ts +3 -0
  105. package/dist/src/dxfViewer/core/font/shx/index.d.ts +1 -0
  106. package/dist/src/dxfViewer/core/font/shx/util/BitConverter.d.ts +21 -0
  107. package/dist/src/dxfViewer/core/geometry-offset/Edge.d.ts +27 -0
  108. package/dist/src/dxfViewer/core/geometry-offset/Offset.d.ts +46 -0
  109. package/dist/src/dxfViewer/core/geometry-offset/index.d.ts +1 -0
  110. package/dist/src/dxfViewer/core/helpers/BinaryReader.d.ts +23 -0
  111. package/dist/src/dxfViewer/core/helpers/BoxSelectHelper.d.ts +44 -0
  112. package/dist/src/dxfViewer/core/helpers/InstantiateHelper.d.ts +26 -0
  113. package/dist/src/dxfViewer/core/helpers/LoadingHelper.d.ts +59 -0
  114. package/dist/src/dxfViewer/core/helpers/MeshBvhHelper.d.ts +15 -0
  115. package/dist/src/dxfViewer/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
  116. package/dist/src/dxfViewer/core/helpers/OSnapHelper.d.ts +158 -0
  117. package/dist/src/dxfViewer/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
  118. package/dist/src/dxfViewer/core/helpers/PickMarkupHelper.d.ts +29 -0
  119. package/dist/src/dxfViewer/core/helpers/RafHelper.d.ts +18 -0
  120. package/dist/src/dxfViewer/core/helpers/ZoomToRectHelper.d.ts +24 -0
  121. package/dist/src/dxfViewer/core/helpers/index.d.ts +11 -0
  122. package/dist/src/dxfViewer/core/index.d.ts +19 -0
  123. package/dist/src/dxfViewer/core/indexeddb/BaseTable.d.ts +36 -0
  124. package/dist/src/dxfViewer/core/indexeddb/DxfDataTable.d.ts +22 -0
  125. package/dist/src/dxfViewer/core/indexeddb/FontDataTable.d.ts +32 -0
  126. package/dist/src/dxfViewer/core/indexeddb/IndexedDbManager.d.ts +50 -0
  127. package/dist/src/dxfViewer/core/indexeddb/index.d.ts +4 -0
  128. package/dist/src/dxfViewer/core/input-manager/InputManager.d.ts +146 -0
  129. package/dist/src/dxfViewer/core/input-manager/index.d.ts +2 -0
  130. package/dist/src/dxfViewer/core/materials/BimTilesHighlightMaterial.d.ts +21 -0
  131. package/dist/src/dxfViewer/core/materials/BimTilesMaterial.d.ts +32 -0
  132. package/dist/src/dxfViewer/core/materials/BimTilesPickMaterial.d.ts +14 -0
  133. package/dist/src/dxfViewer/core/materials/BimTilesTransparentMaterial.d.ts +20 -0
  134. package/dist/src/dxfViewer/core/materials/StandardMaterialEx.d.ts +29 -0
  135. package/dist/src/dxfViewer/core/materials/constants.d.ts +4 -0
  136. package/dist/src/dxfViewer/core/materials/index.d.ts +5 -0
  137. package/dist/src/dxfViewer/core/model/Constants.d.ts +58 -0
  138. package/dist/src/dxfViewer/core/model/Model.d.ts +18 -0
  139. package/dist/src/dxfViewer/core/model/Model2d.d.ts +144 -0
  140. package/dist/src/dxfViewer/core/model/Model3d.d.ts +111 -0
  141. package/dist/src/dxfViewer/core/model/bimtiles/BatchedMeshesParser.d.ts +26 -0
  142. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesConfigParser.d.ts +43 -0
  143. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesData.d.ts +280 -0
  144. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesMaterialManager.d.ts +139 -0
  145. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesModel.d.ts +70 -0
  146. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesPropertyParser.d.ts +45 -0
  147. package/dist/src/dxfViewer/core/model/bimtiles/BimTilesRenderer.d.ts +59 -0
  148. package/dist/src/dxfViewer/core/model/bimtiles/InstancedMeshesParser.d.ts +41 -0
  149. package/dist/src/dxfViewer/core/model/bimtiles/TileParser.d.ts +14 -0
  150. package/dist/src/dxfViewer/core/model/bimtiles/Utils.d.ts +29 -0
  151. package/dist/src/dxfViewer/core/model/index.d.ts +6 -0
  152. package/dist/src/dxfViewer/core/patches/Constants.d.ts +6 -0
  153. package/dist/src/dxfViewer/core/patches/Line.d.ts +3 -0
  154. package/dist/src/dxfViewer/core/patches/Mesh.d.ts +2 -0
  155. package/dist/src/dxfViewer/core/patches/Points.d.ts +3 -0
  156. package/dist/src/dxfViewer/core/patches/index.d.ts +4 -0
  157. package/dist/src/dxfViewer/core/patches/shaders/ShaderChunk.d.ts +143 -0
  158. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/common_ex.glsl.d.ts +2 -0
  159. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/id_pars_vertex.glsl.d.ts +2 -0
  160. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/id_vertex.glsl.d.ts +2 -0
  161. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outine_bc_vertex.glsl.d.ts +2 -0
  162. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_fragment.glsl.d.ts +2 -0
  163. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_pars_fragment.glsl.d.ts +2 -0
  164. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_pars_vertex.glsl.d.ts +2 -0
  165. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_fragment.glsl.d.ts +2 -0
  166. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_highlight_fragment.glsl.d.ts +2 -0
  167. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_pars_fragment.glsl.d.ts +2 -0
  168. package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_transparent_fragment.glsl.d.ts +2 -0
  169. package/dist/src/dxfViewer/core/patches/shaders/shaderLib/pick_ex.glsl.d.ts +2 -0
  170. package/dist/src/dxfViewer/core/patches/shaders/shaderLib/standard_ex.glsl.d.ts +2 -0
  171. package/dist/src/dxfViewer/core/pick/PickManager.d.ts +54 -0
  172. package/dist/src/dxfViewer/core/pick/index.d.ts +1 -0
  173. package/dist/src/dxfViewer/core/scene/SceneManager.d.ts +43 -0
  174. package/dist/src/dxfViewer/core/scene/index.d.ts +1 -0
  175. package/dist/src/dxfViewer/core/shp-js/BitView.d.ts +12 -0
  176. package/dist/src/dxfViewer/core/shp-js/SHPLoader.d.ts +12 -0
  177. package/dist/src/dxfViewer/core/shp-js/Shp.d.ts +10 -0
  178. package/dist/src/dxfViewer/core/shp-js/ShpThree.d.ts +24 -0
  179. package/dist/src/dxfViewer/core/shp-js/index.d.ts +4 -0
  180. package/dist/src/dxfViewer/core/text-texture/TextTexture.d.ts +45 -0
  181. package/dist/src/dxfViewer/core/undo/Command.d.ts +6 -0
  182. package/dist/src/dxfViewer/core/undo/UndoManager.d.ts +24 -0
  183. package/dist/src/dxfViewer/core/undo/index.d.ts +2 -0
  184. package/dist/src/dxfViewer/core/utils/CSS2DObjectUtils.d.ts +14 -0
  185. package/dist/src/dxfViewer/core/utils/CancelablePromise.d.ts +6 -0
  186. package/dist/src/dxfViewer/core/utils/ColorUtils.d.ts +21 -0
  187. package/dist/src/dxfViewer/core/utils/CommonUtils.d.ts +129 -0
  188. package/dist/src/dxfViewer/core/utils/CoordinateUtils.d.ts +81 -0
  189. package/dist/src/dxfViewer/core/utils/DecimalPrecisionUtils.d.ts +10 -0
  190. package/dist/src/dxfViewer/core/utils/DeviceUtils.d.ts +15 -0
  191. package/dist/src/dxfViewer/core/utils/EdgeUtils.d.ts +14 -0
  192. package/dist/src/dxfViewer/core/utils/Event.d.ts +34 -0
  193. package/dist/src/dxfViewer/core/utils/ExportUtils.d.ts +61 -0
  194. package/dist/src/dxfViewer/core/utils/FpsUtils.d.ts +13 -0
  195. package/dist/src/dxfViewer/core/utils/GeometryUtils.d.ts +78 -0
  196. package/dist/src/dxfViewer/core/utils/Locale.d.ts +22 -0
  197. package/dist/src/dxfViewer/core/utils/LogUtils.d.ts +7 -0
  198. package/dist/src/dxfViewer/core/utils/MaterialUtils.d.ts +40 -0
  199. package/dist/src/dxfViewer/core/utils/MathUtils.d.ts +41 -0
  200. package/dist/src/dxfViewer/core/utils/MergeUtils.d.ts +120 -0
  201. package/dist/src/dxfViewer/core/utils/ObjectUtils.d.ts +215 -0
  202. package/dist/src/dxfViewer/core/utils/PolygonUtils.d.ts +9 -0
  203. package/dist/src/dxfViewer/core/utils/SVGObjectUtils.d.ts +22 -0
  204. package/dist/src/dxfViewer/core/utils/SceneUtils.d.ts +26 -0
  205. package/dist/src/dxfViewer/core/utils/SectionUtils.d.ts +11 -0
  206. package/dist/src/dxfViewer/core/utils/SimplifyUtils.d.ts +15 -0
  207. package/dist/src/dxfViewer/core/utils/TextUtils.d.ts +37 -0
  208. package/dist/src/dxfViewer/core/utils/TextureUtils.d.ts +16 -0
  209. package/dist/src/dxfViewer/core/utils/UnitConversionUtils.d.ts +31 -0
  210. package/dist/src/dxfViewer/core/utils/Viewer3dUtils.d.ts +25 -0
  211. package/dist/src/dxfViewer/core/utils/index.d.ts +26 -0
  212. package/dist/src/dxfViewer/core/viewers/BaseViewer.d.ts +248 -0
  213. package/dist/src/dxfViewer/core/viewers/BimTilesViewer.d.ts +126 -0
  214. package/dist/src/dxfViewer/core/viewers/Constants.d.ts +9 -0
  215. package/dist/src/dxfViewer/core/viewers/Plugin.d.ts +29 -0
  216. package/dist/src/dxfViewer/core/viewers/Viewer2d.d.ts +405 -0
  217. package/dist/src/dxfViewer/core/viewers/Viewer3d.d.ts +130 -0
  218. package/dist/src/dxfViewer/core/viewers/Viewer3dLite.d.ts +143 -0
  219. package/dist/src/dxfViewer/core/viewers/ViewerEvent.d.ts +96 -0
  220. package/dist/src/dxfViewer/core/viewers/index.d.ts +8 -0
  221. package/dist/src/dxfViewer/core/webcam/WebCam.d.ts +27 -0
  222. package/dist/src/dxfViewer/core/webcam/index.d.ts +1 -0
  223. package/dist/src/dxfViewer/core/workers/CreateMeshBvh.worker.d.ts +1 -0
  224. package/dist/src/dxfViewer/core/workers/GenerateMeshBvhWorker.d.ts +17 -0
  225. package/dist/src/dxfViewer/core/workers/index.d.ts +1 -0
  226. package/dist/src/dxfViewer/lib.d.ts +1 -0
  227. package/package.json +62 -0
@@ -0,0 +1,744 @@
1
+ import { ACTION, CameraControlsEventMap, FitToOptions, MOUSE_BUTTON, MouseButtons, PointerInput, Ref, THREESubset, Touches } from './types';
2
+ import { EventDispatcher } from './EventDispatcher';
3
+ import type * as _THREE from "three";
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
+ protected _truckInternal: (deltaX: number, deltaY: number, dragToOffset: boolean) => void;
284
+ protected _rotateInternal: (deltaX: number, deltaY: number) => void;
285
+ protected _dollyInternal: (delta: number, x: number, y: number) => void;
286
+ protected _zoomInternal: (delta: number, x: number, y: number) => void;
287
+ /**
288
+ * Creates a `CameraControls` instance.
289
+ *
290
+ * Note:
291
+ * You **must install** three.js before using camera-controls. see [#install](#install)
292
+ * Not doing so will lead to runtime errors (`undefined` references to THREE).
293
+ *
294
+ * e.g.
295
+ * ```
296
+ * CameraControls.install( { THREE } );
297
+ * const cameraControls = new CameraControls( camera, domElement );
298
+ * ```
299
+ *
300
+ * @param camera A `THREE.PerspectiveCamera` or `THREE.OrthographicCamera` to be controlled.
301
+ * @param domElement A `HTMLElement` for the draggable area, usually `renderer.domElement`.
302
+ * @category Constructor
303
+ */
304
+ constructor(camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera, domElement?: HTMLElement);
305
+ /**
306
+ * The camera to be controlled
307
+ * @category Properties
308
+ */
309
+ get camera(): _THREE.PerspectiveCamera | _THREE.OrthographicCamera;
310
+ set camera(camera: _THREE.PerspectiveCamera | _THREE.OrthographicCamera);
311
+ /**
312
+ * Whether or not the controls are enabled.
313
+ * `false` to disable user dragging/touch-move, but all methods works.
314
+ * @category Properties
315
+ */
316
+ get enabled(): boolean;
317
+ set enabled(enabled: boolean);
318
+ /**
319
+ * Returns `true` if the controls are active updating.
320
+ * readonly value.
321
+ * @category Properties
322
+ */
323
+ get active(): boolean;
324
+ /**
325
+ * Getter for the current `ACTION`.
326
+ * readonly value.
327
+ * @category Properties
328
+ */
329
+ get currentAction(): ACTION;
330
+ /**
331
+ * get/set Current distance.
332
+ * @category Properties
333
+ */
334
+ get distance(): number;
335
+ set distance(distance: number);
336
+ /**
337
+ * get/set the azimuth angle (horizontal) in radians.
338
+ * Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative.
339
+ * @category Properties
340
+ */
341
+ get azimuthAngle(): number;
342
+ set azimuthAngle(azimuthAngle: number);
343
+ /**
344
+ * get/set the polar angle (vertical) in radians.
345
+ * @category Properties
346
+ */
347
+ get polarAngle(): number;
348
+ set polarAngle(polarAngle: number);
349
+ /**
350
+ * Whether camera position should be enclosed in the boundary or not.
351
+ * @category Properties
352
+ */
353
+ get boundaryEnclosesCamera(): boolean;
354
+ set boundaryEnclosesCamera(boundaryEnclosesCamera: boolean);
355
+ /**
356
+ * Adds the specified event listener.
357
+ * Applicable event types (which is `K`) are:
358
+ * | Event name | Timing |
359
+ * | ------------------- | ------ |
360
+ * | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ |
361
+ * | `'control'` | When the user controls the camera (dragging). |
362
+ * | `'controlend'` | When the user ends to control the camera. ¹ |
363
+ * | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` |
364
+ * | `'update'` | When the camera position is updated. |
365
+ * | `'wake'` | When the camera starts moving. |
366
+ * | `'rest'` | When the camera movement is below `.restThreshold` ². |
367
+ * | `'sleep'` | When the camera end moving. |
368
+ *
369
+ * 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.
370
+ * 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).
371
+ *
372
+ * e.g.
373
+ * ```
374
+ * cameraControl.addEventListener( 'controlstart', myCallbackFunction );
375
+ * ```
376
+ * @param type event name
377
+ * @param listener handler function
378
+ * @category Methods
379
+ */
380
+ addEventListener<K extends keyof CameraControlsEventMap>(type: K, listener: (event: CameraControlsEventMap[K]) => any): void;
381
+ /**
382
+ * Removes the specified event listener
383
+ * e.g.
384
+ * ```
385
+ * cameraControl.addEventListener( 'controlstart', myCallbackFunction );
386
+ * ```
387
+ * @param type event name
388
+ * @param listener handler function
389
+ * @category Methods
390
+ */
391
+ removeEventListener<K extends keyof CameraControlsEventMap>(type: K, listener: (event: CameraControlsEventMap[K]) => any): void;
392
+ /**
393
+ * Rotate azimuthal angle(horizontal) and polar angle(vertical).
394
+ * Every value is added to the current value.
395
+ * @param azimuthAngle Azimuth rotate angle. In radian.
396
+ * @param polarAngle Polar rotate angle. In radian.
397
+ * @param enableTransition Whether to move smoothly or immediately
398
+ * @category Methods
399
+ */
400
+ rotate(azimuthAngle: number, polarAngle: number, enableTransition?: boolean): Promise<void>;
401
+ /**
402
+ * Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.
403
+ *
404
+ * e.g.
405
+ * ```
406
+ * cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true );
407
+ * ```
408
+ * @param azimuthAngle Azimuth rotate angle. In radian.
409
+ * @param enableTransition Whether to move smoothly or immediately
410
+ * @category Methods
411
+ */
412
+ rotateAzimuthTo(azimuthAngle: number, enableTransition?: boolean): Promise<void>;
413
+ /**
414
+ * Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.
415
+ *
416
+ * e.g.
417
+ * ```
418
+ * cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true );
419
+ * ```
420
+ * @param polarAngle Polar rotate angle. In radian.
421
+ * @param enableTransition Whether to move smoothly or immediately
422
+ * @category Methods
423
+ */
424
+ rotatePolarTo(polarAngle: number, enableTransition?: boolean): Promise<void>;
425
+ /**
426
+ * Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle.
427
+ * Camera view will rotate over the orbit pivot absolutely:
428
+ *
429
+ * azimuthAngle
430
+ * ```
431
+ * 0º
432
+ * \
433
+ * 90º -----+----- -90º
434
+ * \
435
+ * 180º
436
+ * ```
437
+ * | direction | angle |
438
+ * | --------- | ---------------------- |
439
+ * | front | 0º |
440
+ * | left | 90º (`Math.PI / 2`) |
441
+ * | right | -90º (`- Math.PI / 2`) |
442
+ * | back | 180º (`Math.PI`) |
443
+ *
444
+ * polarAngle
445
+ * ```
446
+ * 180º
447
+ * |
448
+ * 90º
449
+ * |
450
+ * 0º
451
+ * ```
452
+ * | direction | angle |
453
+ * | -------------------- | ---------------------- |
454
+ * | top/sky | 180º (`Math.PI`) |
455
+ * | horizontal from view | 90º (`Math.PI / 2`) |
456
+ * | bottom/floor | 0º |
457
+ *
458
+ * @param azimuthAngle Azimuth rotate angle to. In radian.
459
+ * @param polarAngle Polar rotate angle to. In radian.
460
+ * @param enableTransition Whether to move smoothly or immediately
461
+ * @category Methods
462
+ */
463
+ rotateTo(azimuthAngle: number, polarAngle: number, enableTransition?: boolean): Promise<void>;
464
+ /**
465
+ * Dolly in/out camera position.
466
+ * @param distance Distance of dollyIn. Negative number for dollyOut.
467
+ * @param enableTransition Whether to move smoothly or immediately.
468
+ * @category Methods
469
+ */
470
+ dolly(distance: number, enableTransition?: boolean): Promise<void>;
471
+ /**
472
+ * Dolly in/out camera position to given distance.
473
+ * @param distance Distance of dolly.
474
+ * @param enableTransition Whether to move smoothly or immediately.
475
+ * @category Methods
476
+ */
477
+ dollyTo(distance: number, enableTransition?: boolean): Promise<void>;
478
+ /**
479
+ * Zoom in/out camera. The value is added to camera zoom.
480
+ * Limits set with `.minZoom` and `.maxZoom`
481
+ * @param zoomStep zoom scale
482
+ * @param enableTransition Whether to move smoothly or immediately
483
+ * @category Methods
484
+ */
485
+ zoom(zoomStep: number, enableTransition?: boolean): Promise<void>;
486
+ /**
487
+ * Zoom in/out camera to given scale. The value overwrites camera zoom.
488
+ * Limits set with .minZoom and .maxZoom
489
+ * @param zoom
490
+ * @param enableTransition
491
+ * @category Methods
492
+ */
493
+ zoomTo(zoom: number, enableTransition?: boolean): Promise<void>;
494
+ /**
495
+ * Truck and pedestal camera using current azimuthal angle
496
+ * @param x Horizontal translate amount
497
+ * @param y Vertical translate amount
498
+ * @param enableTransition Whether to move smoothly or immediately
499
+ * @category Methods
500
+ */
501
+ truck(x: number, y: number, enableTransition?: boolean): Promise<void>;
502
+ /**
503
+ * Move forward / backward.
504
+ * @param distance Amount to move forward / backward. Negative value to move backward
505
+ * @param enableTransition Whether to move smoothly or immediately
506
+ * @category Methods
507
+ */
508
+ forward(distance: number, enableTransition?: boolean): Promise<void>;
509
+ /**
510
+ * Move up / down.
511
+ * @param height Amount to move up / down. Negative value to move down
512
+ * @param enableTransition Whether to move smoothly or immediately
513
+ * @category Methods
514
+ */
515
+ elevate(height: number, enableTransition?: boolean): Promise<void>;
516
+ /**
517
+ * Move target position to given point.
518
+ * @param x x coord to move center position
519
+ * @param y y coord to move center position
520
+ * @param z z coord to move center position
521
+ * @param enableTransition Whether to move smoothly or immediately
522
+ * @category Methods
523
+ */
524
+ moveTo(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
525
+ /**
526
+ * Look in the given point direction.
527
+ * @param x point x.
528
+ * @param y point y.
529
+ * @param z point z.
530
+ * @param enableTransition Whether to move smoothly or immediately.
531
+ * @returns Transition end promise
532
+ * @category Methods
533
+ */
534
+ lookInDirectionOf(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
535
+ /**
536
+ * Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit.
537
+ * set `cover: true` to fill enter screen.
538
+ * e.g.
539
+ * ```
540
+ * cameraControls.fitToBox( myMesh );
541
+ * ```
542
+ * @param box3OrObject Axis aligned bounding box to fit the view.
543
+ * @param enableTransition Whether to move smoothly or immediately.
544
+ * @param options | `<object>` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }
545
+ * @returns Transition end promise
546
+ * @category Methods
547
+ */
548
+ fitToBox(box3OrObject: _THREE.Box3 | _THREE.Object3D, enableTransition: boolean, { cover, paddingLeft, paddingRight, paddingBottom, paddingTop, }?: Partial<FitToOptions>): Promise<void[]>;
549
+ /**
550
+ * Fit the viewport to the sphere or the bounding sphere of the object.
551
+ * @param sphereOrMesh
552
+ * @param enableTransition
553
+ * @category Methods
554
+ */
555
+ fitToSphere(sphereOrMesh: _THREE.Sphere | _THREE.Object3D, enableTransition: boolean): Promise<void[]>;
556
+ /**
557
+ * Look at the `target` from the `position`.
558
+ * @param positionX
559
+ * @param positionY
560
+ * @param positionZ
561
+ * @param targetX
562
+ * @param targetY
563
+ * @param targetZ
564
+ * @param enableTransition
565
+ * @category Methods
566
+ */
567
+ setLookAt(positionX: number, positionY: number, positionZ: number, targetX: number, targetY: number, targetZ: number, enableTransition?: boolean): Promise<void>;
568
+ /**
569
+ * Similar to setLookAt, but it interpolates between two states.
570
+ * @param positionAX
571
+ * @param positionAY
572
+ * @param positionAZ
573
+ * @param targetAX
574
+ * @param targetAY
575
+ * @param targetAZ
576
+ * @param positionBX
577
+ * @param positionBY
578
+ * @param positionBZ
579
+ * @param targetBX
580
+ * @param targetBY
581
+ * @param targetBZ
582
+ * @param t
583
+ * @param enableTransition
584
+ * @category Methods
585
+ */
586
+ 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>;
587
+ /**
588
+ * Set angle and distance by given position.
589
+ * An alias of `setLookAt()`, without target change. Thus keep gazing at the current target
590
+ * @param positionX
591
+ * @param positionY
592
+ * @param positionZ
593
+ * @param enableTransition
594
+ * @category Methods
595
+ */
596
+ setPosition(positionX: number, positionY: number, positionZ: number, enableTransition?: boolean): Promise<void>;
597
+ /**
598
+ * Set the target position where gaze at.
599
+ * An alias of `setLookAt()`, without position change. Thus keep the same position.
600
+ * @param targetX
601
+ * @param targetY
602
+ * @param targetZ
603
+ * @param enableTransition
604
+ * @category Methods
605
+ */
606
+ setTarget(targetX: number, targetY: number, targetZ: number, enableTransition?: boolean): Promise<void>;
607
+ /**
608
+ * Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
609
+ * @param x
610
+ * @param y
611
+ * @param z
612
+ * @param enableTransition
613
+ * @category Methods
614
+ */
615
+ setFocalOffset(x: number, y: number, z: number, enableTransition?: boolean): Promise<void>;
616
+ /**
617
+ * Set orbit point without moving the camera.
618
+ * SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions.
619
+ * @param targetX
620
+ * @param targetY
621
+ * @param targetZ
622
+ * @category Methods
623
+ */
624
+ setOrbitPoint(targetX: number, targetY: number, targetZ: number): void;
625
+ /**
626
+ * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
627
+ * @param box3
628
+ * @category Methods
629
+ */
630
+ setBoundary(box3?: _THREE.Box3): void;
631
+ /**
632
+ * Set (or unset) the current viewport.
633
+ * Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.
634
+ * @param viewportOrX
635
+ * @param y
636
+ * @param width
637
+ * @param height
638
+ * @category Methods
639
+ */
640
+ setViewport(viewportOrX: _THREE.Vector4 | number | null, y: number, width: number, height: number): void;
641
+ /**
642
+ * Calculate the distance to fit the box.
643
+ * @param width box width
644
+ * @param height box height
645
+ * @param depth box depth
646
+ * @returns distance
647
+ * @category Methods
648
+ */
649
+ getDistanceToFitBox(width: number, height: number, depth: number, cover?: boolean): number;
650
+ /**
651
+ * Calculate the distance to fit the sphere.
652
+ * @param radius sphere radius
653
+ * @returns distance
654
+ * @category Methods
655
+ */
656
+ getDistanceToFitSphere(radius: number): number;
657
+ /**
658
+ * Returns its current gazing target, which is the center position of the orbit.
659
+ * @param out current gazing target
660
+ * @category Methods
661
+ */
662
+ getTarget(out: _THREE.Vector3): _THREE.Vector3;
663
+ /**
664
+ * Returns its current position.
665
+ * @param out current position
666
+ * @category Methods
667
+ */
668
+ getPosition(out: _THREE.Vector3): _THREE.Vector3;
669
+ /**
670
+ * Returns its current focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
671
+ * @param out current focal offset
672
+ * @category Methods
673
+ */
674
+ getFocalOffset(out: _THREE.Vector3): _THREE.Vector3;
675
+ /**
676
+ * Normalize camera azimuth angle rotation between 0 and 360 degrees.
677
+ * @category Methods
678
+ */
679
+ normalizeRotations(): void;
680
+ /**
681
+ * Reset all rotation and position to defaults.
682
+ * @param enableTransition
683
+ * @category Methods
684
+ */
685
+ reset(enableTransition?: boolean): Promise<void[]>;
686
+ /**
687
+ * Set current camera position as the default position.
688
+ * @category Methods
689
+ */
690
+ saveState(): void;
691
+ /**
692
+ * Sync camera-up direction.
693
+ * When camera-up vector is changed, `.updateCameraUp()` must be called.
694
+ * @category Methods
695
+ */
696
+ updateCameraUp(): void;
697
+ /**
698
+ * Update camera position and directions.
699
+ * This should be called in your tick loop every time, and returns true if re-rendering is needed.
700
+ * @param delta
701
+ * @returns updated
702
+ * @category Methods
703
+ */
704
+ update(delta: number): boolean;
705
+ /**
706
+ * Get all state in JSON string
707
+ * @category Methods
708
+ */
709
+ toJSON(): string;
710
+ /**
711
+ * Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.
712
+ * @param json
713
+ * @param enableTransition
714
+ * @category Methods
715
+ */
716
+ fromJSON(json: string, enableTransition?: boolean): void;
717
+ /**
718
+ * Attach all internal event handlers to enable drag control.
719
+ * @category Methods
720
+ */
721
+ connect(domElement: HTMLElement): void;
722
+ /**
723
+ * Detach all internal event handlers to disable drag control.
724
+ */
725
+ disconnect(): void;
726
+ /**
727
+ * Dispose the cameraControls instance itself, remove all eventListeners.
728
+ * @category Methods
729
+ */
730
+ dispose(): void;
731
+ protected _findPointerById(pointerId: number): PointerInput | undefined;
732
+ protected _findPointerByMouseButton(mouseButton: MOUSE_BUTTON): PointerInput | undefined;
733
+ protected _encloseToBoundary(position: _THREE.Vector3, offset: _THREE.Vector3, friction: number): _THREE.Vector3;
734
+ protected _updateNearPlaneCorners(): void;
735
+ protected _collisionTest(): number;
736
+ /**
737
+ * Get its client rect and package into given `DOMRect` .
738
+ */
739
+ protected _getClientRect(target: DOMRect | any): DOMRect | undefined;
740
+ protected _createOnRestPromise(resolveImmediately: boolean): Promise<void>;
741
+ protected _addAllEventListeners(_domElement: HTMLElement): void;
742
+ protected _removeAllEventListeners(): void;
743
+ static createBoundingSphere(object3d: _THREE.Object3D, out?: _THREE.Sphere): _THREE.Sphere;
744
+ }