@types/three 0.167.2 → 0.168.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 (247) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGL.d.ts +11 -3
  4. three/examples/jsm/controls/ArcballControls.d.ts +111 -77
  5. three/examples/jsm/controls/DragControls.d.ts +56 -27
  6. three/examples/jsm/controls/FirstPersonControls.d.ts +82 -12
  7. three/examples/jsm/controls/FlyControls.d.ts +35 -11
  8. three/examples/jsm/controls/OrbitControls.d.ts +84 -137
  9. three/examples/jsm/controls/PointerLockControls.d.ts +68 -9
  10. three/examples/jsm/controls/TrackballControls.d.ts +110 -26
  11. three/examples/jsm/effects/AnaglyphEffect.d.ts +11 -5
  12. three/examples/jsm/effects/ParallaxBarrierEffect.d.ts +7 -4
  13. three/examples/jsm/environments/RoomEnvironment.d.ts +2 -2
  14. three/examples/jsm/loaders/KTX2Loader.d.ts +4 -0
  15. three/examples/jsm/objects/SkyMesh.d.ts +17 -0
  16. three/examples/jsm/objects/Water2.d.ts +2 -2
  17. three/examples/jsm/objects/Water2Mesh.d.ts +42 -0
  18. three/examples/jsm/objects/WaterMesh.d.ts +31 -0
  19. three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
  20. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +11 -2
  21. three/package.json +4 -3
  22. three/src/Three.WebGPU.d.ts +6 -0
  23. three/src/Three.d.ts +1 -0
  24. three/src/core/EventDispatcher.d.ts +0 -3
  25. three/src/core/Object3D.d.ts +2 -0
  26. three/src/extras/Controls.d.ts +54 -0
  27. three/src/{nodes/loaders → loaders/nodes}/NodeLoader.d.ts +3 -3
  28. three/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.d.ts +1 -1
  29. three/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.d.ts +1 -1
  30. three/src/materials/Material.d.ts +17 -13
  31. three/src/materials/nodes/InstancedPointsNodeMaterial.d.ts +33 -0
  32. three/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.d.ts +2 -2
  33. three/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.d.ts +1 -1
  34. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +29 -0
  35. three/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.d.ts +1 -1
  36. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -0
  37. three/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.d.ts +2 -2
  38. three/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.d.ts +1 -1
  39. three/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.d.ts +2 -2
  40. three/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.d.ts +5 -2
  41. three/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.d.ts +2 -2
  42. three/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.d.ts +3 -3
  43. three/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.d.ts +2 -2
  44. three/src/materials/nodes/NodeMaterial.d.ts +91 -0
  45. three/src/{nodes/materials/Materials.d.ts → materials/nodes/NodeMaterials.d.ts} +5 -2
  46. three/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.d.ts +1 -2
  47. three/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.d.ts +1 -1
  48. three/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.d.ts +2 -2
  49. three/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.d.ts +1 -1
  50. three/src/nodes/Nodes.d.ts +117 -362
  51. three/src/nodes/TSL.d.ts +269 -0
  52. three/src/nodes/accessors/AccessorsUtils.d.ts +1 -1
  53. three/src/nodes/accessors/BatchNode.d.ts +1 -2
  54. three/src/nodes/accessors/{BitangentNode.d.ts → Bitangent.d.ts} +1 -1
  55. three/src/nodes/accessors/BufferAttributeNode.d.ts +4 -4
  56. three/src/nodes/accessors/BufferNode.d.ts +1 -1
  57. three/src/nodes/accessors/{CameraNode.d.ts → Camera.d.ts} +1 -1
  58. three/src/nodes/accessors/ClippingNode.d.ts +1 -1
  59. three/src/nodes/accessors/CubeTextureNode.d.ts +1 -7
  60. three/src/nodes/accessors/InstanceNode.d.ts +1 -1
  61. three/src/nodes/accessors/MaterialNode.d.ts +3 -3
  62. three/src/nodes/accessors/MaterialProperties.d.ts +4 -0
  63. three/src/nodes/accessors/MaterialReferenceNode.d.ts +3 -1
  64. three/src/nodes/accessors/ModelNode.d.ts +1 -1
  65. three/src/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
  66. three/src/nodes/accessors/MorphNode.d.ts +15 -0
  67. three/src/nodes/accessors/{NormalNode.d.ts → Normal.d.ts} +11 -4
  68. three/src/nodes/accessors/Object3DNode.d.ts +1 -1
  69. three/src/nodes/accessors/PointUVNode.d.ts +1 -1
  70. three/src/nodes/accessors/{PositionNode.d.ts → Position.d.ts} +2 -1
  71. three/src/nodes/accessors/ReferenceBaseNode.d.ts +27 -0
  72. three/src/nodes/accessors/ReferenceNode.d.ts +7 -5
  73. three/src/nodes/accessors/{ReflectVectorNode.d.ts → ReflectVector.d.ts} +1 -1
  74. three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
  75. three/src/nodes/accessors/SceneNode.d.ts +20 -0
  76. three/src/nodes/accessors/SkinningNode.d.ts +11 -1
  77. three/src/nodes/accessors/StorageBufferNode.d.ts +2 -2
  78. three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
  79. three/src/nodes/accessors/{TangentNode.d.ts → Tangent.d.ts} +1 -1
  80. three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
  81. three/src/nodes/accessors/TextureBicubic.d.ts +4 -0
  82. three/src/nodes/accessors/TextureNode.d.ts +26 -7
  83. three/src/nodes/accessors/TextureSizeNode.d.ts +18 -0
  84. three/src/nodes/accessors/{UVNode.d.ts → UV.d.ts} +1 -1
  85. three/src/nodes/accessors/UniformArrayNode.d.ts +30 -0
  86. three/src/nodes/accessors/UserDataNode.d.ts +1 -1
  87. three/src/nodes/accessors/VelocityNode.d.ts +15 -0
  88. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  89. three/src/nodes/code/CodeNode.d.ts +1 -1
  90. three/src/nodes/code/ExpressionNode.d.ts +1 -1
  91. three/src/nodes/code/FunctionCallNode.d.ts +2 -2
  92. three/src/nodes/code/FunctionNode.d.ts +5 -6
  93. three/src/nodes/code/ScriptableNode.d.ts +22 -0
  94. three/src/nodes/code/ScriptableValueNode.d.ts +10 -0
  95. three/src/nodes/core/AssignNode.d.ts +2 -2
  96. three/src/nodes/core/AttributeNode.d.ts +2 -5
  97. three/src/nodes/core/BypassNode.d.ts +2 -2
  98. three/src/nodes/core/CacheNode.d.ts +2 -2
  99. three/src/nodes/core/ContextNode.d.ts +10 -7
  100. three/src/nodes/core/IndexNode.d.ts +11 -3
  101. three/src/nodes/core/MRTNode.d.ts +7 -2
  102. three/src/nodes/core/Node.d.ts +8 -2
  103. three/src/nodes/core/OutputStructNode.d.ts +1 -1
  104. three/src/nodes/core/ParameterNode.d.ts +12 -0
  105. three/src/nodes/core/PropertyNode.d.ts +1 -1
  106. three/src/nodes/core/StackNode.d.ts +12 -2
  107. three/src/nodes/core/UniformNode.d.ts +1 -1
  108. three/src/nodes/core/VarNode.d.ts +2 -10
  109. three/src/nodes/core/VaryingNode.d.ts +2 -2
  110. three/src/nodes/display/AfterImageNode.d.ts +1 -7
  111. three/src/nodes/display/AnaglyphPassNode.d.ts +14 -0
  112. three/src/nodes/display/AnamorphicNode.d.ts +1 -7
  113. three/src/nodes/display/BleachBypass.d.ts +4 -0
  114. three/src/nodes/display/BlendMode.d.ts +10 -0
  115. three/src/nodes/display/BloomNode.d.ts +1 -7
  116. three/src/nodes/display/BumpMapNode.d.ts +16 -0
  117. three/src/nodes/display/ColorAdjustment.d.ts +27 -0
  118. three/src/nodes/display/ColorSpaceFunctions.d.ts +6 -0
  119. three/src/nodes/display/ColorSpaceNode.d.ts +23 -23
  120. three/src/nodes/display/DenoiseNode.d.ts +3 -9
  121. three/src/nodes/display/DepthOfFieldNode.d.ts +4 -8
  122. three/src/nodes/display/DotScreenNode.d.ts +4 -8
  123. three/src/nodes/display/FXAANode.d.ts +3 -9
  124. three/src/nodes/display/FilmNode.d.ts +3 -9
  125. three/src/nodes/display/FrontFacingNode.d.ts +4 -2
  126. three/src/nodes/display/GTAONode.d.ts +3 -9
  127. three/src/nodes/display/GaussianBlurNode.d.ts +4 -8
  128. three/src/nodes/display/Lut3DNode.d.ts +3 -9
  129. three/src/nodes/display/MotionBlur.d.ts +8 -0
  130. three/src/nodes/display/NormalMapNode.d.ts +4 -8
  131. three/src/nodes/display/ParallaxBarrierPassNode.d.ts +14 -0
  132. three/src/nodes/display/PassNode.d.ts +11 -2
  133. three/src/nodes/display/PixelationPassNode.d.ts +1 -37
  134. three/src/nodes/display/PosterizeNode.d.ts +1 -7
  135. three/src/nodes/display/RGBShiftNode.d.ts +1 -7
  136. three/src/nodes/display/RenderOutputNode.d.ts +2 -2
  137. three/src/nodes/display/SSAAPassNode.d.ts +26 -0
  138. three/src/nodes/display/Sepia.d.ts +4 -0
  139. three/src/nodes/display/SobelOperatorNode.d.ts +4 -8
  140. three/src/nodes/display/StereoCompositePassNode.d.ts +17 -0
  141. three/src/nodes/display/StereoPassNode.d.ts +17 -0
  142. three/src/nodes/display/ToneMappingFunctions.d.ts +14 -0
  143. three/src/nodes/display/ToneMappingNode.d.ts +5 -6
  144. three/src/nodes/display/TransitionNode.d.ts +3 -9
  145. three/src/nodes/display/ViewportDepthNode.d.ts +6 -2
  146. three/src/nodes/display/ViewportDepthTextureNode.d.ts +4 -2
  147. three/src/nodes/display/ViewportNode.d.ts +23 -16
  148. three/src/nodes/display/ViewportSharedTextureNode.d.ts +4 -8
  149. three/src/nodes/display/ViewportTextureNode.d.ts +4 -9
  150. three/src/nodes/fog/FogExp2Node.d.ts +4 -8
  151. three/src/nodes/fog/FogNode.d.ts +4 -8
  152. three/src/nodes/fog/FogRangeNode.d.ts +4 -8
  153. three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
  154. three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
  155. three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +1 -1
  156. three/src/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
  157. three/src/nodes/functions/BSDF/D_GGX.d.ts +1 -1
  158. three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +1 -1
  159. three/src/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
  160. three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +10 -0
  161. three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  162. three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
  163. three/src/nodes/functions/ShadowMaskModel.d.ts +1 -1
  164. three/src/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  165. three/src/nodes/functions/material/getRoughness.d.ts +1 -1
  166. three/src/nodes/geometry/RangeNode.d.ts +1 -1
  167. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
  168. three/src/nodes/lighting/AmbientLightNode.d.ts +8 -0
  169. three/src/nodes/lighting/DirectionalLightNode.d.ts +8 -0
  170. three/src/nodes/lighting/IESSpotLightNode.d.ts +5 -0
  171. three/src/nodes/lighting/LightNode.d.ts +18 -0
  172. three/src/nodes/lighting/LightProbeNode.d.ts +11 -0
  173. three/src/nodes/lighting/LightUtils.d.ts +3 -3
  174. three/src/nodes/lighting/LightingContextNode.d.ts +1 -7
  175. three/src/nodes/lighting/LightsNode.d.ts +9 -13
  176. three/src/nodes/materialx/MaterialXNodes.d.ts +1 -1
  177. three/src/nodes/materialx/lib/mx_hsv.d.ts +2 -2
  178. three/src/nodes/materialx/lib/mx_noise.d.ts +1 -1
  179. three/src/nodes/materialx/lib/mx_transform_color.d.ts +1 -1
  180. three/src/nodes/math/ConditionalNode.d.ts +39 -0
  181. three/src/nodes/math/Hash.d.ts +4 -0
  182. three/src/nodes/math/MathNode.d.ts +2 -2
  183. three/src/nodes/math/MathUtils.d.ts +0 -10
  184. three/src/nodes/math/OperatorNode.d.ts +18 -4
  185. three/src/nodes/math/TriNoise3D.d.ts +1 -1
  186. three/src/nodes/parsers/GLSLNodeFunction.d.ts +9 -0
  187. three/src/nodes/parsers/GLSLNodeParser.d.ts +8 -0
  188. three/src/nodes/pmrem/PMREMNode.d.ts +4 -2
  189. three/src/nodes/pmrem/PMREMUtils.d.ts +28 -0
  190. three/src/nodes/procedural/Checker.d.ts +4 -0
  191. three/src/nodes/tsl/TSLBase.d.ts +21 -0
  192. three/src/nodes/{shadernode/ShaderNode.d.ts → tsl/TSLCore.d.ts} +23 -23
  193. three/src/nodes/utils/CubeMapNode.d.ts +13 -0
  194. three/src/nodes/utils/Discard.d.ts +11 -0
  195. three/src/nodes/utils/EquirectUVNode.d.ts +1 -1
  196. three/src/nodes/utils/FunctionOverloadingNode.d.ts +13 -0
  197. three/src/nodes/utils/LoopNode.d.ts +22 -0
  198. three/src/nodes/utils/MatcapUVNode.d.ts +1 -1
  199. three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
  200. three/src/nodes/utils/OscNode.d.ts +1 -1
  201. three/src/nodes/utils/Packing.d.ts +5 -0
  202. three/src/nodes/utils/RTTNode.d.ts +7 -7
  203. three/src/nodes/utils/ReflectorNode.d.ts +1 -1
  204. three/src/nodes/utils/RemapNode.d.ts +2 -2
  205. three/src/nodes/utils/RotateNode.d.ts +1 -7
  206. three/src/nodes/utils/SetNode.d.ts +11 -0
  207. three/src/nodes/utils/SplitNode.d.ts +1 -1
  208. three/src/nodes/utils/SpriteSheetUVNode.d.ts +1 -1
  209. three/src/nodes/utils/SpriteUtils.d.ts +6 -0
  210. three/src/nodes/utils/{StoargeArrayElementNode.d.ts → StorageArrayElementNode.d.ts} +1 -7
  211. three/src/nodes/utils/TimerNode.d.ts +1 -1
  212. three/src/nodes/utils/TriplanarTexturesNode.d.ts +1 -7
  213. three/src/nodes/utils/UVUtils.d.ts +14 -0
  214. three/src/nodes/utils/ViewportUtils.d.ts +4 -0
  215. three/src/renderers/common/BindGroup.d.ts +8 -1
  216. three/src/renderers/common/Bindings.d.ts +2 -2
  217. three/src/renderers/common/ClippingContext.d.ts +1 -0
  218. three/src/renderers/common/QuadMesh.d.ts +2 -0
  219. three/src/renderers/common/RenderContext.d.ts +2 -0
  220. three/src/renderers/common/RenderContexts.d.ts +6 -4
  221. three/src/renderers/common/RenderObjects.d.ts +1 -1
  222. three/src/renderers/common/Renderer.d.ts +16 -4
  223. three/src/renderers/common/SampledTexture.d.ts +7 -1
  224. three/src/renderers/common/StandardRenderer.d.ts +12 -0
  225. three/src/renderers/common/Textures.d.ts +1 -0
  226. three/src/renderers/common/nodes/NodeLibrary.d.ts +56 -0
  227. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +3 -3
  228. three/src/renderers/common/nodes/Nodes.d.ts +7 -9
  229. three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +5 -0
  230. three/src/renderers/webgl/WebGLProperties.d.ts +5 -4
  231. three/src/renderers/webgpu/WebGPUBackend.d.ts +6 -2
  232. three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -3
  233. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +2 -2
  234. three/src/renderers/webxr/WebXRManager.d.ts +0 -2
  235. three/examples/jsm/loaders/LogLuvLoader.d.ts +0 -19
  236. three/src/nodes/accessors/TextureBicubicNode.d.ts +0 -18
  237. three/src/nodes/accessors/UniformsNode.d.ts +0 -23
  238. three/src/nodes/core/NodeKeywords.d.ts +0 -17
  239. three/src/nodes/display/BlendModeNode.d.ts +0 -47
  240. three/src/nodes/display/ColorAdjustmentNode.d.ts +0 -47
  241. three/src/nodes/materials/NodeMaterial.d.ts +0 -124
  242. three/src/nodes/math/CondNode.d.ts +0 -22
  243. three/src/nodes/math/HashNode.d.ts +0 -16
  244. three/src/nodes/procedural/CheckerNode.d.ts +0 -15
  245. three/src/nodes/utils/DiscardNode.d.ts +0 -17
  246. three/src/nodes/utils/PackingNode.d.ts +0 -24
  247. three/src/nodes/utils/RotateUVNode.d.ts +0 -19
@@ -1,49 +1,32 @@
1
- import { Camera, EventDispatcher, MOUSE, TOUCH, Vector3 } from "three";
1
+ import { Camera, Controls, MOUSE, TOUCH, Vector3 } from "three";
2
2
 
3
3
  export interface OrbitControlsEventMap {
4
- change: {};
5
- start: {};
6
- end: {};
7
- }
8
-
9
- /**
10
- * Orbit controls allow the camera to orbit around a target.
11
- * @param object - The camera to be controlled. The camera must not
12
- * be a child of another object, unless that object is the scene itself.
13
- * @param domElement - The HTML element used for
14
- * event listeners.
15
- */
16
- export class OrbitControls extends EventDispatcher<OrbitControlsEventMap> {
17
- constructor(object: Camera, domElement: HTMLElement);
18
-
19
4
  /**
20
- * The camera being controlled.
5
+ * Fires when the camera has been transformed by the controls.
21
6
  */
22
- object: Camera;
7
+ change: {};
23
8
 
24
9
  /**
25
- * The HTMLElement used to listen for mouse / touch events.
26
- * This must be passed in the constructor;
27
- * changing it here will not set up new event listeners.
10
+ * Fires when an interaction was initiated.
28
11
  */
29
- domElement: HTMLElement | Document;
12
+ start: {};
30
13
 
31
14
  /**
32
- * When set to `false`, the controls will not respond to user input.
33
- * @default true
15
+ * Fires when an interaction has finished.
34
16
  */
35
- enabled: boolean;
17
+ end: {};
18
+ }
36
19
 
20
+ /**
21
+ * Orbit controls allow the camera to orbit around a target.
22
+ */
23
+ declare class OrbitControls extends Controls<OrbitControlsEventMap> {
37
24
  /**
38
- * The focus point of the controls, the .object orbits around this.
39
- * It can be updated manually at any point to change the focus
40
- * of the controls.
25
+ * The focus point of the controls, the {@link .object} orbits around this. It can be updated manually at any point
26
+ * to change the focus of the controls.
41
27
  */
42
28
  target: Vector3;
43
29
 
44
- /** @deprecated */
45
- center: Vector3;
46
-
47
30
  /**
48
31
  * The focus point of the {@link .minTargetRadius} and {@link .maxTargetRadius} limits. It can be updated manually
49
32
  * at any point to change the center of interest for the {@link .target}.
@@ -51,178 +34,141 @@ export class OrbitControls extends EventDispatcher<OrbitControlsEventMap> {
51
34
  cursor: Vector3;
52
35
 
53
36
  /**
54
- * How far you can dolly in ( PerspectiveCamera only ).
55
- * @default 0
37
+ * How far you can dolly in ( {@link PerspectiveCamera} only ). Default is 0.
56
38
  */
57
39
  minDistance: number;
58
40
 
59
41
  /**
60
- * How far you can dolly out ( PerspectiveCamera only ).
61
- * @default Infinity
42
+ * How far you can dolly out ( {@link PerspectiveCamera} only ). Default is Infinity.
62
43
  */
63
44
  maxDistance: number;
64
45
 
65
46
  /**
66
- * How far you can zoom in ( OrthographicCamera only ).
67
- * @default 0
47
+ * How far you can zoom in ( {@link OrthographicCamera} only ). Default is 0.
68
48
  */
69
49
  minZoom: number;
70
50
 
71
51
  /**
72
- * How far you can zoom out ( OrthographicCamera only ).
73
- * @default Infinity
52
+ * How far you can zoom out ( {@link OrthographicCamera} only ). Default is Infinity.
74
53
  */
75
54
  maxZoom: number;
76
55
 
77
56
  /**
78
- * How close you can get the target to the 3D {@link .cursor}.
79
- * @default 0
57
+ * How close you can get the target to the 3D {@link .cursor}. Default is 0.
80
58
  */
81
59
  minTargetRadius: number;
82
60
 
83
61
  /**
84
- * How far you can move the target from the 3D {@link .cursor}.
85
- * @default Infinity
62
+ * How far you can move the target from the 3D {@link .cursor}. Default is Infinity.
86
63
  */
87
64
  maxTargetRadius: number;
88
65
 
89
66
  /**
90
- * How far you can orbit vertically, lower limit.
91
- * Range is 0 to Math.PI radians.
92
- * @default 0
67
+ * How far you can orbit vertically, lower limit. Range is 0 to Math.PI radians, and default is 0.
93
68
  */
94
69
  minPolarAngle: number;
95
70
 
96
71
  /**
97
- * How far you can orbit vertically, upper limit.
98
- * Range is 0 to Math.PI radians.
99
- * @default Math.PI.
72
+ * How far you can orbit vertically, upper limit. Range is 0 to Math.PI radians, and default is Math.PI.
100
73
  */
101
74
  maxPolarAngle: number;
102
75
 
103
76
  /**
104
- * How far you can orbit horizontally, lower limit.
105
- * If set, the interval [ min, max ]
106
- * must be a sub-interval of [ - 2 PI, 2 PI ],
107
- * with ( max - min < 2 PI ).
108
- * @default Infinity
77
+ * How far you can orbit horizontally, lower limit. If set, the interval [ min, max ] must be a sub-interval of
78
+ * [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity.
109
79
  */
110
80
  minAzimuthAngle: number;
111
81
 
112
82
  /**
113
- * How far you can orbit horizontally, upper limit.
114
- * If set, the interval [ min, max ] must be a sub-interval
115
- * of [ - 2 PI, 2 PI ], with ( max - min < 2 PI ).
116
- * @default Infinity
83
+ * How far you can orbit horizontally, upper limit. If set, the interval [ min, max ] must be a sub-interval of
84
+ * [ - 2 PI, 2 PI ], with ( max - min < 2 PI ). Default is Infinity.
117
85
  */
118
86
  maxAzimuthAngle: number;
119
87
 
120
88
  /**
121
- * Set to true to enable damping (inertia), which can
122
- * be used to give a sense of weight to the controls.
123
- * Note that if this is enabled, you must call
124
- * .update () in your animation loop.
125
- * @default false
89
+ * Set to true to enable damping (inertia), which can be used to give a sense of weight to the controls. Default is
90
+ * false.
91
+ * Note that if this is enabled, you must call {@link .update}() in your animation loop.
126
92
  */
127
93
  enableDamping: boolean;
128
94
 
129
95
  /**
130
- * The damping inertia used if .enableDamping is set to true.
131
- * Note that for this to work,
132
- * you must call .update () in your animation loop.
133
- * @default 0.05
96
+ * The damping inertia used if .enableDamping is set to true. Default is `0.05`.
97
+ * Note that for this to work, you must call {@link .update}() in your animation loop.
134
98
  */
135
99
  dampingFactor: number;
136
100
 
137
101
  /**
138
102
  * Enable or disable zooming (dollying) of the camera.
139
- * @default true
140
103
  */
141
104
  enableZoom: boolean;
142
105
 
143
106
  /**
144
- * Speed of zooming / dollying.
145
- * @default 1
107
+ * Speed of zooming / dollying. Default is 1.
146
108
  */
147
109
  zoomSpeed: number;
148
110
 
149
111
  /**
150
- * Setting this property to `true` allows to zoom to the cursor's position.
151
- * @default false
152
- */
153
- zoomToCursor: boolean;
154
-
155
- /**
156
- * Enable or disable horizontal and
157
- * vertical rotation of the camera.
158
- * Note that it is possible to disable a single axis
159
- * by setting the min and max of the polar angle or
160
- * azimuth angle to the same value, which will cause
161
- * the vertical or horizontal rotation to be fixed at that value.
162
- * @default true
112
+ * Enable or disable horizontal and vertical rotation of the camera. Default is true.
113
+ * Note that it is possible to disable a single axis by setting the min and max of the
114
+ * [polar angle]{@link .minPolarAngle} or [azimuth angle]{@link .minAzimuthAngle} to the same value, which will
115
+ * cause the vertical or horizontal rotation to be fixed at that value.
163
116
  */
164
117
  enableRotate: boolean;
165
118
 
166
119
  /**
167
- * Speed of rotation.
168
- * @default 1
120
+ * Speed of rotation. Default is 1.
169
121
  */
170
122
  rotateSpeed: number;
171
123
 
172
124
  /**
173
- * Enable or disable camera panning.
174
- * @default true
125
+ * Enable or disable camera panning. Default is true.
175
126
  */
176
127
  enablePan: boolean;
177
128
 
178
129
  /**
179
- * Speed of panning.
180
- * @default 1
130
+ * Speed of panning. Default is 1.
181
131
  */
182
132
  panSpeed: number;
183
133
 
184
134
  /**
185
- * Defines how the camera's position is translated when panning.
186
- * If true, the camera pans in screen space. Otherwise,
187
- * the camera pans in the plane orthogonal to the camera's
188
- * up direction. Default is true for OrbitControls; false for MapControls.
189
- * @default true
135
+ * Defines how the camera's position is translated when panning. If true, the camera pans in screen space.
136
+ * Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is `true`.
190
137
  */
191
138
  screenSpacePanning: boolean;
192
139
 
193
140
  /**
194
- * How fast to pan the camera when the keyboard is used.
195
- * Default is 7.0 pixels per keypress.
196
- * @default 7
141
+ * How fast to pan the camera when the keyboard is used. Default is 7.0 pixels per keypress.
197
142
  */
198
143
  keyPanSpeed: number;
199
144
 
145
+ /**
146
+ * Setting this property to `true` allows to zoom to the cursor's position. Default is `false`.
147
+ */
148
+ zoomToCursor: boolean;
149
+
200
150
  /**
201
151
  * Set to true to automatically rotate around the target.
202
- * Note that if this is enabled, you must call .update() in your animation loop. If you want the auto-rotate speed
152
+ * Note that if this is enabled, you must call {@link .update}() in your animation loop. If you want the auto-rotate speed
203
153
  * to be independent of the frame rate (the refresh rate of the display), you must pass the time `deltaTime`, in
204
- * seconds, to .update().
154
+ * seconds, to {@link .update}().
205
155
  */
206
156
  autoRotate: boolean;
207
157
 
208
158
  /**
209
- * How fast to rotate around the target if .autoRotate is true.
210
- * Default is 2.0, which equates to 30 seconds per orbit at 60fps.
211
- * Note that if .autoRotate is enabled, you must call
212
- * .update () in your animation loop.
213
- * @default 2
159
+ * How fast to rotate around the target if {@link .autoRotate} is true. Default is 2.0, which equates to 30 seconds
160
+ * per orbit at 60fps.
161
+ * Note that if {@link .autoRotate} is enabled, you must call {@link .update}() in your animation loop.
214
162
  */
215
163
  autoRotateSpeed: number;
216
164
 
217
165
  /**
218
- * This object contains references to the keycodes for controlling
219
- * camera panning. Default is the 4 arrow keys.
166
+ * This object contains references to the keycodes for controlling camera panning. Default is the 4 arrow keys.
220
167
  */
221
168
  keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
222
169
 
223
170
  /**
224
- * This object contains references to the mouse actions used
225
- * by the controls.
171
+ * This object contains references to the mouse actions used by the controls.
226
172
  */
227
173
  mouseButtons: {
228
174
  LEFT?: MOUSE | null | undefined;
@@ -231,74 +177,75 @@ export class OrbitControls extends EventDispatcher<OrbitControlsEventMap> {
231
177
  };
232
178
 
233
179
  /**
234
- * This object contains references to the touch actions used by
235
- * the controls.
180
+ * This object contains references to the touch actions used by the controls.
236
181
  */
237
182
  touches: { ONE?: TOUCH | null | undefined; TWO?: TOUCH | null | undefined };
238
183
 
239
184
  /**
240
- * Used internally by the .saveState and .reset methods.
185
+ * Used internally by the {@link .saveState} and {@link .reset} methods.
241
186
  */
242
187
  target0: Vector3;
243
188
 
244
189
  /**
245
- * Used internally by the .saveState and .reset methods.
190
+ * Used internally by the {@link .saveState} and {@link .reset} methods.
246
191
  */
247
192
  position0: Vector3;
248
193
 
249
194
  /**
250
- * Used internally by the .saveState and .reset methods.
195
+ * Used internally by the {@link .saveState} and {@link .reset} methods.
251
196
  */
252
197
  zoom0: number;
253
198
 
254
199
  /**
255
- * Update the controls. Must be called after any manual changes to the camera's transform, or in the update loop if
256
- * .autoRotate or .enableDamping are set. `deltaTime`, in seconds, is optional, and is only required if you want the
257
- * auto-rotate speed to be independent of the frame rate (the refresh rate of the display).
200
+ * @param object The camera to be controlled. The camera must not be a child of another object, unless that object
201
+ * is the scene itself.
202
+ * @param domElement The HTML element used for event listeners. (optional)
258
203
  */
259
- update(deltaTime?: number): boolean;
204
+ constructor(object: Camera, domElement?: HTMLElement | null);
260
205
 
261
206
  /**
262
- * Adds key event listeners to the given DOM element. `window`
263
- * is a recommended argument for using this method.
264
- * @param domElement
207
+ * Get the current vertical rotation, in radians.
265
208
  */
266
- listenToKeyEvents(domElement: HTMLElement | Window): void;
209
+ getPolarAngle(): number;
267
210
 
268
211
  /**
269
- * Removes the key event listener previously defined with {@link listenToKeyEvents}.
212
+ * Get the current horizontal rotation, in radians.
270
213
  */
271
- stopListenToKeyEvents(): void;
214
+ getAzimuthalAngle(): number;
272
215
 
273
216
  /**
274
- * Save the current state of the controls. This can later be
275
- * recovered with .reset.
217
+ * Returns the distance from the camera to the target.
276
218
  */
277
- saveState(): void;
219
+ getDistance(): number;
278
220
 
279
221
  /**
280
- * Reset the controls to their state from either the last time
281
- * the .saveState was called, or the initial state.
222
+ * Adds key event listeners to the given DOM element. `window` is a recommended argument for using this method.
223
+ * @param domElement
282
224
  */
283
- reset(): void;
225
+ listenToKeyEvents(domElement: HTMLElement | Window): void;
284
226
 
285
227
  /**
286
- * Remove all the event listeners.
228
+ * Removes the key event listener previously defined with {@link .listenToKeyEvents}().
287
229
  */
288
- dispose(): void;
230
+ stopListenToKeyEvents(): void;
289
231
 
290
232
  /**
291
- * Get the current vertical rotation, in radians.
233
+ * Save the current state of the controls. This can later be recovered with {@link .reset}.
292
234
  */
293
- getPolarAngle(): number;
235
+ saveState(): void;
294
236
 
295
237
  /**
296
- * Get the current horizontal rotation, in radians.
238
+ * Reset the controls to their state from either the last time the {@link .saveState} was called, or the initial
239
+ * state.
297
240
  */
298
- getAzimuthalAngle(): number;
241
+ reset(): void;
299
242
 
300
243
  /**
301
- * Returns the distance from the camera to the target.
244
+ * Update the controls. Must be called after any manual changes to the camera's transform, or in the update loop if
245
+ * {@link .autoRotate} or {@link .enableDamping} are set. `deltaTime`, in seconds, is optional, and is only required
246
+ * if you want the auto-rotate speed to be independent of the frame rate (the refresh rate of the display).
302
247
  */
303
- getDistance(): number;
248
+ update(deltaTime?: number | null): boolean;
304
249
  }
250
+
251
+ export { OrbitControls };
@@ -1,27 +1,86 @@
1
- import { Camera, EventDispatcher, Vector3 } from "three";
1
+ import { Camera, Controls, Vector3 } from "three";
2
2
 
3
- export class PointerLockControls extends EventDispatcher {
4
- constructor(camera: Camera, domElement?: HTMLElement);
3
+ export interface PointerLockControlsEventMap {
4
+ /**
5
+ * Fires when the user moves the mouse.
6
+ */
7
+ change: {};
5
8
 
6
- camera: Camera;
7
- domElement: HTMLElement;
9
+ /**
10
+ * Fires when the pointer lock status is "locked" (in other words: the mouse is captured).
11
+ */
12
+ lock: {};
8
13
 
9
- // API
14
+ /**
15
+ * Fires when the pointer lock status is "unlocked" (in other words: the mouse is not captured anymore).
16
+ */
17
+ unlock: {};
18
+ }
10
19
 
20
+ /**
21
+ * The implementation of this class is based on the [Pointer Lock API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API}.
22
+ * {@link PointerLockControls} is a perfect choice for first person 3D games.
23
+ */
24
+ declare class PointerLockControls extends Controls<PointerLockControlsEventMap> {
25
+ /**
26
+ * Whether or not the controls are locked.
27
+ */
11
28
  isLocked: boolean;
12
29
 
30
+ /**
31
+ * Camera pitch, lower limit. Range is 0 to Math.PI radians. Default is 0.
32
+ */
13
33
  minPolarAngle: number;
34
+
35
+ /**
36
+ * Camera pitch, upper limit. Range is 0 to Math.PI radians. Default is Math.PI.
37
+ */
14
38
  maxPolarAngle: number;
15
39
 
40
+ /**
41
+ * Multiplier for how much the pointer movement influences the camera rotation. Default is 1.
42
+ */
16
43
  pointerSpeed: number;
17
44
 
18
- connect(): void;
19
- disconnect(): void;
20
- dispose(): void;
45
+ /**
46
+ * Creates a new instance of {@link PointerLockControls}.
47
+ * @param camera The camera of the rendered scene.
48
+ * @param domElement The HTML element used for event listeners.
49
+ */
50
+ constructor(camera: Camera, domElement?: HTMLElement | null);
51
+
52
+ /**
53
+ * @deprecated getObject() has been deprecated. Use controls.object instead.
54
+ */
21
55
  getObject(): Camera;
56
+
57
+ /**
58
+ * Returns the look direction of the camera.
59
+ * @param v The target vector.
60
+ */
22
61
  getDirection(v: Vector3): Vector3;
62
+
63
+ /**
64
+ * Moves the camera forward parallel to the xz-plane. Assumes camera.up is y-up.
65
+ * @param distance The signed distance.
66
+ */
23
67
  moveForward(distance: number): void;
68
+
69
+ /**
70
+ * Moves the camera sidewards parallel to the xz-plane.
71
+ * @param distance The signed distance.
72
+ */
24
73
  moveRight(distance: number): void;
74
+
75
+ /**
76
+ * Activates the pointer lock.
77
+ */
25
78
  lock(): void;
79
+
80
+ /**
81
+ * Exits the pointer lock.
82
+ */
26
83
  unlock(): void;
27
84
  }
85
+
86
+ export { PointerLockControls };
@@ -1,58 +1,142 @@
1
- import { Camera, EventDispatcher, MOUSE, Vector3 } from "three";
1
+ import { Camera, Controls, MOUSE, Vector3 } from "three";
2
2
 
3
3
  export interface TrackballControlsEventMap {
4
+ /**
5
+ * Fires when the camera has been transformed by the controls.
6
+ */
4
7
  change: {};
8
+
9
+ /**
10
+ * Fires when an interaction (e.g. touch) was initiated.
11
+ */
5
12
  start: {};
13
+
14
+ /**
15
+ * Fires when an interaction has finished.
16
+ */
6
17
  end: {};
7
18
  }
8
19
 
9
- export class TrackballControls extends EventDispatcher<TrackballControlsEventMap> {
10
- constructor(object: Camera, domElement?: HTMLElement);
11
-
12
- object: Camera;
13
- domElement: HTMLElement;
14
-
15
- // API
16
- enabled: boolean;
20
+ /**
21
+ * TrackballControls is similar to {@link OrbitControls}. However, it does not maintain a constant camera
22
+ * [up]{@link Object3D.up} vector. That means if the camera orbits over the “north” and “south” poles, it does not flip
23
+ * to stay "right side up".
24
+ */
25
+ declare class TrackballControls extends Controls<TrackballControlsEventMap> {
26
+ /**
27
+ * Represents the properties of the screen. Automatically set when {@link .handleResize}() is called.
28
+ * - left: Represents the offset in pixels to the screen's left boundary.
29
+ * - top: Represents the offset in pixels to the screen's top boundary.
30
+ * - width: Represents the screen width in pixels.
31
+ * - height: Represents the screen height in pixels.
32
+ */
17
33
  screen: { left: number; top: number; width: number; height: number };
34
+
35
+ /**
36
+ * The rotation speed. Default is `1.0`.
37
+ */
18
38
  rotateSpeed: number;
39
+
40
+ /**
41
+ * The zoom speed. Default is `1.2`.
42
+ */
19
43
  zoomSpeed: number;
44
+
45
+ /**
46
+ * The pan speed. Default is `0.3`.
47
+ */
20
48
  panSpeed: number;
49
+
50
+ /**
51
+ * Whether or not rotation is disabled. Default is `false`.
52
+ */
21
53
  noRotate: boolean;
54
+
55
+ /**
56
+ * Whether or not zooming is disabled. Default is `false`.
57
+ */
22
58
  noZoom: boolean;
59
+
60
+ /**
61
+ * Whether or not panning is disabled. Default is `false`.
62
+ */
23
63
  noPan: boolean;
24
- noRoll: boolean;
64
+
65
+ /**
66
+ * Whether or not damping is disabled. Default is `false`.
67
+ */
25
68
  staticMoving: boolean;
69
+
70
+ /**
71
+ * Defines the intensity of damping. Only considered if {@link .staticMoving} is set to `false`. Default is `0.2`.
72
+ */
26
73
  dynamicDampingFactor: number;
74
+
75
+ /**
76
+ * How far you can dolly in ( {@link PerspectiveCamera} only ). Default is *0*.
77
+ */
27
78
  minDistance: number;
79
+
80
+ /**
81
+ * How far you can dolly out ( {@link PerspectiveCamera} only ). Default is `Infinity`.
82
+ */
28
83
  maxDistance: number;
84
+
85
+ /**
86
+ * How far you can zoom out ( {@link OrthographicCamera} only ). Default is `Infinity`.
87
+ */
29
88
  minZoom: number;
89
+
90
+ /**
91
+ * How far you can zoom in ( {@link OrthographicCamera} only ). Default is *0*.
92
+ */
30
93
  maxZoom: number;
31
- keys: string[];
94
+
95
+ /**
96
+ * This array holds keycodes for controlling interactions.
97
+ * - When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.
98
+ * - When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.
99
+ * - When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.
100
+ *
101
+ * Default is *KeyA, KeyS, KeyD* which represents A, S, D.
102
+ */
103
+ keys: [string, string, string];
104
+
105
+ /**
106
+ * This object contains references to the mouse actions used by the controls.
107
+ * - .LEFT is assigned with `THREE.MOUSE.ROTATE`
108
+ * - .MIDDLE is assigned with `THREE.MOUSE.ZOOM`
109
+ * - .RIGHT is assigned with `THREE.MOUSE.PAN`
110
+ */
32
111
  mouseButtons: {
33
112
  LEFT?: MOUSE | null | undefined;
34
113
  MIDDLE?: MOUSE | null | undefined;
35
114
  RIGHT?: MOUSE | null | undefined;
36
115
  };
37
116
 
117
+ /**
118
+ * The focus point of the controls.
119
+ */
38
120
  target: Vector3;
39
- position0: Vector3;
40
- target0: Vector3;
41
- up0: Vector3;
42
-
43
- update(): void;
44
-
45
- reset(): void;
46
121
 
47
- dispose(): void;
122
+ /**
123
+ * Creates a new instance of TrackballControls.
124
+ * @param camera The camera of the rendered scene.
125
+ * @param domElement The HTML element used for event listeners. (optional)
126
+ */
127
+ constructor(camera: Camera, domElement?: HTMLElement | null);
48
128
 
49
- checkDistances(): void;
50
-
51
- zoomCamera(): void;
52
-
53
- panCamera(): void;
129
+ /**
130
+ * Should be called if the application window is resized.
131
+ */
132
+ handleResize(): void;
54
133
 
55
- rotateCamera(): void;
134
+ update(): void;
56
135
 
57
- handleResize(): void;
136
+ /**
137
+ * Resets the controls to its initial state.
138
+ */
139
+ reset(): void;
58
140
  }
141
+
142
+ export { TrackballControls };
@@ -1,11 +1,17 @@
1
1
  import { Camera, Matrix3, Scene, WebGLRenderer } from "three";
2
2
 
3
- export class AnaglyphEffect {
4
- constructor(renderer: WebGLRenderer, width?: number, height?: number);
3
+ declare class AnaglyphEffect {
5
4
  colorMatrixLeft: Matrix3;
5
+
6
6
  colorMatrixRight: Matrix3;
7
7
 
8
- dispose(): void;
9
- render(scene: Scene, camera: Camera): void;
10
- setSize(width: number, height: number): void;
8
+ setSize: (width: number, height: number) => void;
9
+
10
+ render: (scene: Scene, camera: Camera) => void;
11
+
12
+ dispose: () => void;
13
+
14
+ constructor(renderer: WebGLRenderer, width?: number, height?: number);
11
15
  }
16
+
17
+ export { AnaglyphEffect };