@types/three 0.168.0 → 0.170.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 (213) hide show
  1. three/README.md +1 -1
  2. three/build/three.webgpu.nodes.d.ts +1 -0
  3. three/build/three.webgpu.nodes.min.d.ts +1 -0
  4. three/examples/jsm/Addons.d.ts +3 -10
  5. three/examples/jsm/animation/MMDAnimationHelper.d.ts +4 -0
  6. three/examples/jsm/animation/MMDPhysics.d.ts +4 -0
  7. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  8. three/examples/jsm/controls/DragControls.d.ts +0 -15
  9. three/examples/jsm/controls/TransformControls.d.ts +195 -24
  10. three/examples/jsm/csm/CSMFrustum.d.ts +8 -2
  11. three/examples/jsm/csm/CSMHelper.d.ts +2 -1
  12. three/examples/jsm/csm/CSMShadowNode.d.ts +46 -0
  13. three/examples/jsm/curves/NURBSCurve.d.ts +12 -1
  14. three/examples/jsm/exporters/EXRExporter.d.ts +7 -2
  15. three/examples/jsm/exporters/GLTFExporter.d.ts +20 -3
  16. three/examples/jsm/exporters/KTX2Exporter.d.ts +3 -1
  17. three/examples/jsm/exporters/MMDExporter.d.ts +4 -0
  18. three/examples/jsm/exporters/USDZExporter.d.ts +4 -0
  19. three/examples/jsm/geometries/DecalGeometry.d.ts +9 -3
  20. three/examples/jsm/geometries/TeapotGeometry.d.ts +2 -2
  21. three/examples/jsm/helpers/LightProbeHelper.d.ts +5 -3
  22. three/examples/jsm/helpers/LightProbeHelperGPU.d.ts +12 -0
  23. three/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  24. three/examples/jsm/lighting/TiledLighting.d.ts +10 -0
  25. three/examples/jsm/lights/LightProbeGenerator.d.ts +5 -1
  26. three/examples/jsm/lines/Line2.d.ts +15 -1
  27. three/examples/jsm/lines/LineGeometry.d.ts +18 -1
  28. three/examples/jsm/lines/LineMaterial.d.ts +65 -12
  29. three/examples/jsm/lines/LineSegments2.d.ts +25 -2
  30. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +46 -9
  31. three/examples/jsm/lines/Wireframe.d.ts +5 -2
  32. three/examples/jsm/lines/WireframeGeometry2.d.ts +1 -1
  33. three/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  34. three/examples/jsm/loaders/DRACOLoader.d.ts +6 -0
  35. three/examples/jsm/loaders/EXRLoader.d.ts +2 -2
  36. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -2
  37. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -0
  38. three/examples/jsm/loaders/LDrawLoader.d.ts +10 -0
  39. three/examples/jsm/loaders/MMDLoader.d.ts +4 -0
  40. three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  41. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  42. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -1
  43. three/examples/jsm/math/ColorSpaces.d.ts +11 -0
  44. three/examples/jsm/misc/ProgressiveLightMap.d.ts +8 -10
  45. three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  46. three/examples/jsm/modifiers/CurveModifier.d.ts +7 -3
  47. three/examples/jsm/modifiers/CurveModifierGPU.d.ts +31 -0
  48. three/examples/jsm/objects/Lensflare.d.ts +13 -9
  49. three/examples/jsm/objects/LensflareMesh.d.ts +21 -0
  50. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -2
  51. three/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.d.ts +1 -5
  52. three/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.d.ts +2 -3
  53. three/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.d.ts +2 -4
  54. three/examples/jsm/tsl/display/BleachBypass.d.ts +3 -0
  55. three/{src/nodes → examples/jsm/tsl}/display/BloomNode.d.ts +1 -5
  56. three/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.d.ts +2 -6
  57. three/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.d.ts +1 -5
  58. three/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.d.ts +2 -5
  59. three/{src/nodes → examples/jsm/tsl}/display/FXAANode.d.ts +1 -3
  60. three/{src/nodes → examples/jsm/tsl}/display/FilmNode.d.ts +1 -3
  61. three/{src/nodes → examples/jsm/tsl}/display/GTAONode.d.ts +2 -8
  62. three/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.d.ts +13 -5
  63. three/examples/jsm/tsl/display/LensflareNode.d.ts +35 -0
  64. three/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.d.ts +2 -6
  65. three/{src/nodes → examples/jsm/tsl}/display/MotionBlur.d.ts +1 -2
  66. three/examples/jsm/tsl/display/OutlineNode.d.ts +32 -0
  67. three/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.d.ts +2 -3
  68. three/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.d.ts +2 -5
  69. three/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.d.ts +1 -4
  70. three/examples/jsm/tsl/display/SMAANode.d.ts +17 -0
  71. three/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.d.ts +2 -7
  72. three/examples/jsm/tsl/display/SSRNode.d.ts +38 -0
  73. three/examples/jsm/tsl/display/Sepia.d.ts +3 -0
  74. three/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.d.ts +1 -3
  75. three/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.d.ts +2 -5
  76. three/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.d.ts +2 -5
  77. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +15 -0
  78. three/{src/nodes → examples/jsm/tsl}/display/TransitionNode.d.ts +1 -5
  79. three/examples/jsm/tsl/display/hashBlur.d.ts +7 -0
  80. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +22 -0
  81. three/examples/jsm/utils/GeometryCompressionUtils.d.ts +20 -4
  82. three/examples/jsm/utils/ShadowMapViewer.d.ts +8 -6
  83. three/examples/jsm/utils/ShadowMapViewerGPU.d.ts +26 -0
  84. three/examples/jsm/utils/SkeletonUtils.d.ts +25 -5
  85. three/examples/jsm/utils/WebGPUTextureUtils.d.ts +3 -0
  86. three/package.json +4 -3
  87. three/src/Three.WebGPU.Nodes.d.ts +205 -0
  88. three/src/Three.WebGPU.d.ts +7 -2
  89. three/src/Three.d.ts +2 -7
  90. three/src/audio/Audio.d.ts +4 -1
  91. three/src/constants.d.ts +1 -9
  92. three/src/core/BufferAttribute.d.ts +0 -15
  93. three/src/core/BufferGeometry.d.ts +13 -2
  94. three/src/core/InterleavedBuffer.d.ts +0 -12
  95. three/src/core/Object3D.d.ts +1 -1
  96. three/src/core/Raycaster.d.ts +2 -1
  97. three/src/core/RenderTarget.d.ts +1 -2
  98. three/src/extras/Controls.d.ts +3 -3
  99. three/src/loaders/FileLoader.d.ts +3 -3
  100. three/src/loaders/MaterialLoader.d.ts +2 -0
  101. three/src/loaders/nodes/NodeLoader.d.ts +5 -0
  102. three/src/loaders/nodes/NodeMaterialLoader.d.ts +3 -0
  103. three/src/loaders/nodes/NodeObjectLoader.d.ts +12 -0
  104. three/src/materials/LineBasicMaterial.d.ts +0 -5
  105. three/src/materials/LineDashedMaterial.d.ts +0 -5
  106. three/src/materials/Material.d.ts +4 -6
  107. three/src/materials/MeshBasicMaterial.d.ts +0 -5
  108. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  109. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  110. three/src/materials/MeshLambertMaterial.d.ts +0 -5
  111. three/src/materials/MeshMatcapMaterial.d.ts +0 -5
  112. three/src/materials/MeshNormalMaterial.d.ts +0 -5
  113. three/src/materials/MeshPhongMaterial.d.ts +0 -5
  114. three/src/materials/MeshPhysicalMaterial.d.ts +0 -5
  115. three/src/materials/MeshStandardMaterial.d.ts +0 -5
  116. three/src/materials/MeshToonMaterial.d.ts +0 -5
  117. three/src/materials/PointsMaterial.d.ts +0 -5
  118. three/src/materials/RawShaderMaterial.d.ts +0 -2
  119. three/src/materials/ShaderMaterial.d.ts +0 -5
  120. three/src/materials/ShadowMaterial.d.ts +0 -5
  121. three/src/materials/SpriteMaterial.d.ts +0 -5
  122. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +2 -2
  123. three/src/materials/nodes/NodeMaterial.d.ts +4 -4
  124. three/src/materials/nodes/NodeMaterials.d.ts +19 -16
  125. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +96 -0
  126. three/src/math/Color.d.ts +39 -22
  127. three/src/math/ColorManagement.d.ts +24 -24
  128. three/src/math/Quaternion.d.ts +4 -3
  129. three/src/math/Triangle.d.ts +24 -0
  130. three/src/math/Vector4.d.ts +2 -0
  131. three/src/nodes/Nodes.d.ts +3 -23
  132. three/src/nodes/TSL.d.ts +75 -187
  133. three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -0
  134. three/src/nodes/accessors/Camera.d.ts +0 -1
  135. three/src/nodes/accessors/MaterialNode.d.ts +0 -1
  136. three/src/nodes/accessors/ModelNode.d.ts +7 -3
  137. three/src/nodes/accessors/Normal.d.ts +6 -0
  138. three/src/nodes/accessors/Object3DNode.d.ts +1 -5
  139. three/src/nodes/accessors/SceneNode.d.ts +2 -0
  140. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -2
  141. three/src/nodes/accessors/VelocityNode.d.ts +6 -1
  142. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  143. three/src/nodes/core/Node.d.ts +3 -12
  144. three/src/nodes/core/NodeUtils.d.ts +5 -1
  145. three/src/nodes/core/StackNode.d.ts +4 -4
  146. three/src/nodes/core/StructTypeNode.d.ts +1 -0
  147. three/src/nodes/core/UniformNode.d.ts +1 -0
  148. three/src/nodes/core/VarNode.d.ts +12 -1
  149. three/src/nodes/display/ColorAdjustment.d.ts +29 -0
  150. three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -2
  151. three/src/nodes/display/ColorSpaceNode.d.ts +33 -8
  152. three/src/nodes/display/RenderOutputNode.d.ts +4 -4
  153. three/src/nodes/display/ScreenNode.d.ts +48 -0
  154. three/src/nodes/display/ToneMappingFunctions.d.ts +6 -6
  155. three/src/nodes/display/ToonOutlinePassNode.d.ts +24 -0
  156. three/src/nodes/display/ViewportDepthNode.d.ts +2 -0
  157. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +6 -0
  158. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +10 -0
  159. three/src/nodes/functions/material/getShIrradianceAt.d.ts +6 -0
  160. three/src/nodes/gpgpu/ComputeNode.d.ts +5 -0
  161. three/src/nodes/lighting/LightsNode.d.ts +7 -2
  162. three/src/nodes/lighting/PointLightNode.d.ts +11 -1
  163. three/src/nodes/lighting/ShadowNode.d.ts +12 -0
  164. three/src/nodes/utils/Discard.d.ts +1 -1
  165. three/src/nodes/utils/Oscillators.d.ts +7 -0
  166. three/src/nodes/utils/PostProcessingUtils.d.ts +45 -0
  167. three/src/nodes/utils/ReflectorNode.d.ts +17 -4
  168. three/src/nodes/utils/Timer.d.ts +21 -0
  169. three/src/objects/BatchedMesh.d.ts +78 -0
  170. three/src/objects/Group.d.ts +0 -6
  171. three/src/objects/LOD.d.ts +7 -0
  172. three/src/renderers/WebGLRenderer.d.ts +24 -23
  173. three/src/renderers/common/BundleGroup.d.ts +10 -0
  174. three/src/renderers/common/ClippingContext.d.ts +1 -1
  175. three/src/renderers/common/Constants.d.ts +2 -1
  176. three/src/renderers/common/Geometries.d.ts +1 -0
  177. three/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  178. three/src/renderers/common/Lighting.d.ts +15 -0
  179. three/src/renderers/common/PostProcessingUtils.d.ts +66 -0
  180. three/src/renderers/common/RenderBundles.d.ts +3 -3
  181. three/src/renderers/common/RenderContext.d.ts +2 -2
  182. three/src/renderers/common/RenderList.d.ts +7 -3
  183. three/src/renderers/common/RenderLists.d.ts +3 -1
  184. three/src/renderers/common/RenderObject.d.ts +20 -1
  185. three/src/renderers/common/Renderer.d.ts +43 -10
  186. three/src/renderers/common/extras/PMREMGenerator.d.ts +5 -1
  187. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -2
  188. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -7
  189. three/src/renderers/common/nodes/Nodes.d.ts +8 -0
  190. three/src/renderers/webgl/WebGLCapabilities.d.ts +13 -0
  191. three/src/renderers/webgl/WebGLPrograms.d.ts +4 -10
  192. three/src/renderers/webgl/WebGLState.d.ts +13 -10
  193. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  194. three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts +12 -0
  195. three/src/renderers/webgpu/WebGPURenderer.d.ts +7 -3
  196. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +5 -0
  197. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +5 -0
  198. three/src/textures/CompressedTexture.d.ts +1 -2
  199. three/src/textures/CubeTexture.d.ts +1 -2
  200. three/src/textures/DataTexture.d.ts +1 -2
  201. three/src/textures/Texture.d.ts +3 -4
  202. three/examples/jsm/cameras/CinematicCamera.d.ts +0 -34
  203. three/examples/jsm/geometries/SDFGeometryGenerator.d.ts +0 -16
  204. three/examples/jsm/loaders/TiltLoader.d.ts +0 -7
  205. three/examples/jsm/utils/GPUStatsPanel.d.ts +0 -12
  206. three/examples/jsm/utils/PackedPhongMaterial.d.ts +0 -10
  207. three/src/nodes/display/BleachBypass.d.ts +0 -4
  208. three/src/nodes/display/Sepia.d.ts +0 -4
  209. three/src/nodes/display/ViewportNode.d.ts +0 -38
  210. three/src/nodes/utils/OscNode.d.ts +0 -25
  211. three/src/nodes/utils/TimerNode.d.ts +0 -25
  212. three/src/renderers/common/StandardRenderer.d.ts +0 -12
  213. /three/examples/jsm/utils/{TextureUtils.d.ts → WebGLTextureUtils.d.ts} +0 -0
three/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 30 Aug 2024 17:36:33 GMT
11
+ * Last updated: Tue, 12 Nov 2024 10:02:27 GMT
12
12
  * Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -0,0 +1 @@
1
+ export * from "../src/Three.WebGPU.Nodes.js";
@@ -0,0 +1 @@
1
+ export * from "../src/Three.WebGPU.Nodes.js";
@@ -3,8 +3,6 @@ export * from "./animation/CCDIKSolver.js";
3
3
  export * from "./animation/MMDAnimationHelper.js";
4
4
  export * from "./animation/MMDPhysics.js";
5
5
 
6
- export * from "./cameras/CinematicCamera.js";
7
-
8
6
  export { default as WebGL } from "./capabilities/WebGL.js";
9
7
 
10
8
  export * from "./controls/ArcballControls.js";
@@ -121,7 +119,6 @@ export * from "./loaders/SVGLoader.js";
121
119
  export * from "./loaders/TDSLoader.js";
122
120
  export * from "./loaders/TGALoader.js";
123
121
  export * from "./loaders/TIFFLoader.js";
124
- export * from "./loaders/TiltLoader.js";
125
122
  export * from "./loaders/TTFLoader.js";
126
123
  export * from "./loaders/UltraHDRLoader.js";
127
124
  export * from "./loaders/USDZLoader.js";
@@ -130,7 +127,9 @@ export * from "./loaders/VRMLLoader.js";
130
127
  export * from "./loaders/VTKLoader.js";
131
128
  export * from "./loaders/XYZLoader.js";
132
129
 
130
+ export * from "./materials/LDrawConditionalLineMaterial.js";
133
131
  export * from "./materials/MeshGouraudMaterial.js";
132
+ export * from "./materials/MeshPostProcessingMaterial.js";
134
133
 
135
134
  export * from "./math/Capsule.js";
136
135
  export * from "./math/ColorConverter.js";
@@ -169,13 +168,9 @@ export * from "./objects/ReflectorForSSRPass.js";
169
168
  export * from "./objects/Refractor.js";
170
169
  export * from "./objects/ShadowMesh.js";
171
170
  export * from "./objects/Sky.js";
172
- export * from "./objects/SkyMesh.js";
173
171
  export * from "./objects/Water.js";
174
172
  export { Water as Water2 } from "./objects/Water2.js";
175
173
  export type { WaterOptions as Water2Options } from "./objects/Water2.js";
176
- export { WaterMesh as Water2Mesh } from "./objects/Water2Mesh.js";
177
- export type { WaterMeshOptions as Water2MeshOptions } from "./objects/Water2Mesh.js";
178
- export * from "./objects/WaterMesh.js";
179
174
 
180
175
  export * from "./physics/AmmoPhysics.js";
181
176
  export * from "./physics/RapierPhysics.js";
@@ -274,15 +269,13 @@ export * as BufferGeometryUtils from "./utils/BufferGeometryUtils.js";
274
269
  export * as CameraUtils from "./utils/CameraUtils.js";
275
270
  export * as GeometryCompressionUtils from "./utils/GeometryCompressionUtils.js";
276
271
  export * as GeometryUtils from "./utils/GeometryUtils.js";
277
- export * from "./utils/GPUStatsPanel.js";
278
272
  export * from "./utils/LDrawUtils.js";
279
- export * from "./utils/PackedPhongMaterial.js";
280
273
  export * as SceneUtils from "./utils/SceneUtils.js";
281
274
  export * from "./utils/ShadowMapViewer.js";
282
275
  export * as SkeletonUtils from "./utils/SkeletonUtils.js";
283
276
  export * as SortUtils from "./utils/SortUtils.js";
284
- export * from "./utils/TextureUtils.js";
285
277
  export * from "./utils/UVsDebug.js";
278
+ export * from "./utils/WebGLTextureUtils.js";
286
279
  export * from "./utils/WorkerPool.js";
287
280
 
288
281
  export * from "./webxr/ARButton.js";
@@ -35,6 +35,10 @@ export interface MMDAnimationHelperMixer {
35
35
  duration?: number | undefined;
36
36
  }
37
37
 
38
+ /**
39
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
40
+ * https://github.com/takahirox/three-mmd-loader instead.
41
+ */
38
42
  export class MMDAnimationHelper {
39
43
  constructor(params?: MMDAnimationHelperParameter);
40
44
  meshes: SkinnedMesh[];
@@ -6,6 +6,10 @@ export interface MMDPhysicsParameter {
6
6
  gravity?: Vector3 | undefined;
7
7
  }
8
8
 
9
+ /**
10
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
11
+ * https://github.com/takahirox/three-mmd-loader instead.
12
+ */
9
13
  export class MMDPhysics {
10
14
  constructor(
11
15
  mesh: SkinnedMesh,
@@ -44,7 +44,7 @@ declare class ArcballControls extends Controls<ArcballControlsEventMap> {
44
44
  focusAnimationTime: number;
45
45
 
46
46
  /**
47
- * If true, camera's near and far values will be adjusted every time zoom is performed trying to mantain the same
47
+ * If true, camera's near and far values will be adjusted every time zoom is performed trying to maintain the same
48
48
  * visible portion given by initial near and far values ( {@link PerspectiveCamera} only ). Default is false.
49
49
  */
50
50
  adjustNearFar: boolean;
@@ -77,21 +77,6 @@ declare class DragControls extends Controls<DragControlsEventMap> {
77
77
  */
78
78
  constructor(objects: Object3D[], camera: Camera, domElement?: HTMLElement | null);
79
79
 
80
- /**
81
- * Adds the event listeners of the controls.
82
- */
83
- connect(): void;
84
-
85
- /**
86
- * Removes the event listeners of the controls.
87
- */
88
- disconnect(): void;
89
-
90
- /**
91
- * Should be called if the controls is no longer required.
92
- */
93
- dispose(): void;
94
-
95
80
  /**
96
81
  * Returns the internal {@link Raycaster} instance that is used for intersection tests.
97
82
  * @deprecated getRaycaster() has been deprecated. Use controls.raycaster instead.
@@ -1,12 +1,29 @@
1
- import { Camera, Mesh, MOUSE, Object3D, Object3DEventMap, Quaternion, Raycaster, Vector3 } from "three";
1
+ import { Camera, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three";
2
2
 
3
3
  type TransformControlsMode = "translate" | "rotate" | "scale";
4
4
 
5
- export interface TransformControlsEventMap extends Object3DEventMap {
5
+ export interface TransformControlsEventMap {
6
+ /**
7
+ * Fires if any type of change (object or property change) is performed. Property changes are separate events you
8
+ * can add event listeners to. The event type is "propertyname-changed".
9
+ */
6
10
  change: {};
11
+
12
+ /**
13
+ * Fires if a pointer (mouse/touch) becomes active.
14
+ */
7
15
  mouseDown: { mode: TransformControlsMode };
16
+
17
+ /**
18
+ * Fires if a pointer (mouse/touch) is no longer active.
19
+ */
8
20
  mouseUp: { mode: TransformControlsMode };
21
+
22
+ /**
23
+ * Fires if the controlled 3D object is changed.
24
+ */
9
25
  objectChange: {};
26
+
10
27
  "camera-changed": { value: unknown };
11
28
  "object-changed": { value: unknown };
12
29
  "enabled-changed": { value: unknown };
@@ -21,6 +38,12 @@ export interface TransformControlsEventMap extends Object3DEventMap {
21
38
  "showX-changed": { value: unknown };
22
39
  "showY-changed": { value: unknown };
23
40
  "showZ-changed": { value: unknown };
41
+ "minX-changed": { value: unknown };
42
+ "maxX-changed": { value: unknown };
43
+ "minY-changed": { value: unknown };
44
+ "maxY-changed": { value: unknown };
45
+ "minZ-changed": { value: unknown };
46
+ "maxZ-changed": { value: unknown };
24
47
  "worldPosition-changed": { value: unknown };
25
48
  "worldPositionStart-changed": { value: unknown };
26
49
  "worldQuaternion-changed": { value: unknown };
@@ -34,55 +57,202 @@ export interface TransformControlsEventMap extends Object3DEventMap {
34
57
  "eye-changed": { value: unknown };
35
58
  }
36
59
 
37
- export class TransformControls extends Object3D<TransformControlsEventMap> {
38
- constructor(object: Camera, domElement?: HTMLElement);
39
-
40
- domElement: HTMLElement;
41
-
42
- // API
43
-
60
+ /**
61
+ * This class can be used to transform objects in 3D space by adapting a similar interaction model of DCC tools like
62
+ * Blender. Unlike other controls, it is not intended to transform the scene's camera.
63
+ *
64
+ * TransformControls expects that its attached 3D object is part of the scene graph.
65
+ */
66
+ declare class TransformControls extends Controls<TransformControlsEventMap> {
67
+ /**
68
+ * The camera of the rendered scene.
69
+ */
44
70
  camera: Camera;
45
- object: Object3D | undefined;
46
- enabled: boolean;
71
+
72
+ /**
73
+ * The current transformation axis.
74
+ */
47
75
  axis: "X" | "Y" | "Z" | "E" | "XY" | "YZ" | "XZ" | "XYZ" | "XYZE" | null;
76
+
77
+ /**
78
+ * The current transformation mode. Possible values are "translate", "rotate" and "scale". Default is `translate`.
79
+ */
48
80
  mode: TransformControlsMode;
81
+
82
+ /**
83
+ * By default, 3D objects are continuously translated. If you set this property to a numeric value (world units),
84
+ * you can define in which steps the 3D object should be translated. Default is `null`.
85
+ */
49
86
  translationSnap: number | null;
87
+
88
+ /**
89
+ * By default, 3D objects are continuously rotated. If you set this property to a numeric value (radians), you can
90
+ * define in which steps the 3D object should be rotated. Default is `null`.
91
+ */
50
92
  rotationSnap: number | null;
93
+
94
+ /**
95
+ * By default, 3D objects are continuously scaled. If you set this property to a numeric value, you can define in
96
+ * which steps the 3D object should be scaled. Default is `null`.
97
+ */
98
+ scaleSnap: number | null;
99
+
100
+ /**
101
+ * Defines in which coordinate space transformations should be performed. Possible values are "world" and "local".
102
+ * Default is `world`.
103
+ */
51
104
  space: "world" | "local";
105
+
106
+ /**
107
+ * The size of the helper UI (axes/planes). Default is *1*.
108
+ */
52
109
  size: number;
110
+
111
+ /**
112
+ * Whether or not dragging is currently performed. Read-only property.
113
+ */
53
114
  dragging: boolean;
115
+
116
+ /**
117
+ * Whether or not the x-axis helper should be visible. Default is `true`.
118
+ */
54
119
  showX: boolean;
120
+
121
+ /**
122
+ * Whether or not the y-axis helper should be visible. Default is `true`.
123
+ */
55
124
  showY: boolean;
125
+
126
+ /**
127
+ * Whether or not the z-axis helper should be visible. Default is `true`.
128
+ */
56
129
  showZ: boolean;
57
130
 
58
- readonly isTransformControls: true;
59
- mouseButtons: {
60
- LEFT?: MOUSE | null | undefined;
61
- MIDDLE?: MOUSE | null | undefined;
62
- RIGHT?: MOUSE | null | undefined;
63
- };
131
+ /**
132
+ * The minimum allowed X position during translation. Default is `-Infinity`.
133
+ */
134
+ minx: number;
135
+
136
+ /**
137
+ * The maximum allowed X position during translation. Default is `Infinity`.
138
+ */
139
+ maxX: number;
140
+
141
+ /**
142
+ * The minimum allowed Y position during translation. Default is `-Infinity`.
143
+ */
144
+ minY: number;
145
+
146
+ /**
147
+ * The maximum allowed Y position during translation. Default is `Infinity`.
148
+ */
149
+ maxY: number;
150
+
151
+ /**
152
+ * The minimum allowed Z position during translation. Default is `-Infinity`.
153
+ */
154
+ minZ: number;
155
+
156
+ /**
157
+ * The maximum allowed Z position during translation. Default is `Infinity`.
158
+ */
159
+ maxZ: number;
160
+
161
+ /**
162
+ * Creates a new instance of TransformControls.
163
+ * @param camera The camera of the rendered scene.
164
+ * @param domElement The HTML element used for event listeners. (optional)
165
+ */
166
+ constructor(camera: Camera, domElement?: HTMLElement);
167
+
168
+ /**
169
+ * Returns the visual representation of the controls. Add the helper to your scene to visually transform the
170
+ * attached 3D object.
171
+ */
172
+ getHelper(): TransformControlsRoot;
64
173
 
65
174
  pointerHover(pointer: PointerEvent | null): void;
66
175
  pointerDown(pointer: PointerEvent | null): void;
67
176
  pointerMove(pointer: PointerEvent | null): void;
68
177
  pointerUp(pointer: PointerEvent | null): void;
69
178
 
179
+ /**
180
+ * Sets the 3D object that should be transformed and ensures the controls UI is visible.
181
+ * @param object The 3D object that should be transformed.
182
+ */
70
183
  attach(object: Object3D): this;
184
+
185
+ /**
186
+ * Removes the current 3D object from the controls and makes the helper UI invisible.
187
+ */
71
188
  detach(): this;
72
- getMode(): TransformControlsMode;
189
+
190
+ /**
191
+ * Resets the object's position, rotation and scale to when the current transform began.
192
+ */
193
+ reset(): void;
194
+
195
+ /**
196
+ * Returns the {@link Raycaster} object that is used for user interaction. This object is shared between all
197
+ * instances of TransformControls. If you set the [.layers]{@link Object3D.layers} property of the
198
+ * TransformControls, you will also want to set the [.layers]{@link Raycaster.layers} property on the
199
+ * {@link Raycaster} with a matching value, or else the TransformControls won't work as expected.
200
+ */
73
201
  getRaycaster(): Raycaster;
202
+
203
+ /**
204
+ * Returns the transformation mode.
205
+ */
206
+ getMode(): TransformControlsMode;
207
+
208
+ /**
209
+ * Sets the transformation mode.
210
+ * @param mode The transformation mode.
211
+ */
74
212
  setMode(mode: TransformControlsMode): void;
213
+
214
+ /**
215
+ * Sets the translation snap.
216
+ * @param translationSnap The translation snap.
217
+ */
75
218
  setTranslationSnap(translationSnap: number | null): void;
219
+
220
+ /**
221
+ * Sets the rotation snap.
222
+ * @param rotationSnap The rotation snap.
223
+ */
76
224
  setRotationSnap(rotationSnap: number | null): void;
225
+
226
+ /**
227
+ * Sets the scale snap.
228
+ * @param scaleSnap The scale snap.
229
+ */
77
230
  setScaleSnap(scaleSnap: number | null): void;
231
+
232
+ /**
233
+ * Sets the size of the helper UI.
234
+ * @param size The size of the helper UI.
235
+ */
78
236
  setSize(size: number): void;
237
+
238
+ /**
239
+ * Sets the coordinate space in which transformations are applied.
240
+ * @param space The coordinate space in which transformations are applied.
241
+ */
79
242
  setSpace(space: "world" | "local"): void;
80
- reset(): void;
243
+ }
244
+
245
+ declare class TransformControlsRoot extends Object3D {
246
+ readonly isTransformControlsRoot: true;
247
+
248
+ controls: TransformControls;
249
+
250
+ constructor(controls: TransformControls);
251
+
81
252
  dispose(): void;
82
253
  }
83
254
 
84
- export class TransformControlsGizmo extends Object3D {
85
- type: "TransformControlsGizmo";
255
+ declare class TransformControlsGizmo extends Object3D {
86
256
  isTransformControlsGizmo: true;
87
257
 
88
258
  gizmo: {
@@ -104,9 +274,8 @@ export class TransformControlsGizmo extends Object3D {
104
274
  constructor();
105
275
  }
106
276
 
107
- export class TransformControlsPlane extends Mesh {
108
- type: "TransformControlsPlane";
109
- isTransformControlsPlane: true;
277
+ declare class TransformControlsPlane extends Mesh {
278
+ readonly isTransformControlsPlane: true;
110
279
 
111
280
  constructor();
112
281
 
@@ -120,3 +289,5 @@ export class TransformControlsPlane extends Mesh {
120
289
  worldPosition: Vector3;
121
290
  worldQuaternion: Quaternion;
122
291
  }
292
+
293
+ export { TransformControls, TransformControlsGizmo, TransformControlsPlane };
@@ -6,14 +6,20 @@ export interface CSMFrustumVerticies {
6
6
  }
7
7
 
8
8
  export interface CSMFrustumParameters {
9
+ webGL?: boolean;
9
10
  projectionMatrix?: Matrix4;
10
11
  maxFar?: number;
11
12
  }
12
13
 
13
- export class CSMFrustum {
14
- constructor(data?: CSMFrustumParameters);
14
+ declare class CSMFrustum {
15
+ zNear: number;
15
16
  vertices: CSMFrustumVerticies;
17
+
18
+ constructor(data?: CSMFrustumParameters);
19
+
16
20
  setFromProjectionMatrix(projectionMatrix: Matrix4, maxFar: number): CSMFrustumVerticies;
17
21
  split(breaks: number[], target: CSMFrustum[]): void;
18
22
  toSpace(cameraMatrix: Matrix4, target: CSMFrustum): void;
19
23
  }
24
+
25
+ export { CSMFrustum };
@@ -10,8 +10,9 @@ import {
10
10
  } from "three";
11
11
 
12
12
  import { CSM } from "./CSM.js";
13
+ import { CSMShadowNode } from "./CSMShadowNode.js";
13
14
 
14
- export class CSMHelper<TCSM extends CSM = CSM> extends Group {
15
+ export class CSMHelper<TCSM extends CSM | CSMShadowNode = CSM | CSMShadowNode> extends Group {
15
16
  constructor(csm: TCSM);
16
17
  csm: TCSM;
17
18
  displayFrustum: boolean;
@@ -0,0 +1,46 @@
1
+ import { Camera, DirectionalLightShadow, Light, Object3D } from "three";
2
+ import { Node } from "three/tsl";
3
+ import { CSMFrustum } from "./CSMFrustum.js";
4
+
5
+ export type CSMShadowNodeMode = "uniform" | "logarithmic" | "practical" | "custom";
6
+
7
+ export interface CSMShadowNodeData {
8
+ cascades?: number | undefined;
9
+ maxFar?: number | undefined;
10
+ mode?: CSMShadowNodeMode | undefined;
11
+ lightMargin?: number | undefined;
12
+ customSplitsCallback?:
13
+ | ((cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void)
14
+ | undefined;
15
+ }
16
+
17
+ declare class LwLight extends Object3D {
18
+ target: Object3D;
19
+ shadow?: DirectionalLightShadow;
20
+
21
+ constructor();
22
+ }
23
+
24
+ declare class CSMShadowNode extends Node {
25
+ light: Light;
26
+ camera: Camera | null;
27
+ cascades: number;
28
+ maxFar: number;
29
+ mode: CSMShadowNodeMode;
30
+ lightMargin: number;
31
+ customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void;
32
+
33
+ fade: boolean;
34
+
35
+ breaks: number[];
36
+ mainFrustum: CSMFrustum | null;
37
+ frustums: CSMFrustum[];
38
+
39
+ lights: LwLight[];
40
+
41
+ constructor(light: Light, data?: CSMShadowNodeData);
42
+
43
+ updateFrustums(): void;
44
+ }
45
+
46
+ export { CSMShadowNode };
@@ -1,4 +1,12 @@
1
- import { Curve, Vector2, Vector3, Vector4 } from "three";
1
+ import { Curve, CurveJSON, Vector2, Vector3, Vector4 } from "three";
2
+
3
+ export interface NURBSCurveJSON extends CurveJSON {
4
+ degree: number;
5
+ knots: number[];
6
+ controlPoints: number[][];
7
+ startKnot: number;
8
+ endKnot: number;
9
+ }
2
10
 
3
11
  export class NURBSCurve extends Curve<Vector3> {
4
12
  degree: number;
@@ -14,4 +22,7 @@ export class NURBSCurve extends Curve<Vector3> {
14
22
  startKnot?: number,
15
23
  endKnot?: number,
16
24
  );
25
+
26
+ toJSON(): NURBSCurveJSON;
27
+ fromJSON(json: NURBSCurveJSON): this;
17
28
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  import { DataTexture, TextureDataType, WebGLRenderer, WebGLRenderTarget } from "three";
9
+ import { WebGPURenderer } from "three/webgpu";
9
10
 
10
11
  export const NO_COMPRESSION: 0;
11
12
  export const ZIPS_COMPRESSION: 2;
@@ -17,6 +18,10 @@ export interface EXRExporterParseOptions {
17
18
  }
18
19
 
19
20
  export class EXRExporter {
20
- parse(renderer: WebGLRenderer, renderTarget: WebGLRenderTarget, options?: EXRExporterParseOptions): Uint8Array;
21
- parse(dataTexture: DataTexture, options?: EXRExporterParseOptions): Uint8Array;
21
+ parse(
22
+ renderer: WebGLRenderer | WebGPURenderer,
23
+ renderTarget: WebGLRenderTarget,
24
+ options?: EXRExporterParseOptions,
25
+ ): Promise<Uint8Array>;
26
+ parse(dataTexture: DataTexture, options?: EXRExporterParseOptions): Promise<Uint8Array>;
22
27
  }
@@ -47,12 +47,22 @@ export interface GLTFExporterOptions {
47
47
  includeCustomExtensions?: boolean;
48
48
  }
49
49
 
50
- export class GLTFExporter {
50
+ type TextureUtils = {
51
+ decompress:
52
+ | ((texture: Texture, maxTextureSize?: number) => Promise<void>)
53
+ | ((texture: Texture, maxTextureSize?: number) => void);
54
+ };
55
+
56
+ declare class GLTFExporter {
57
+ textureUtils: TextureUtils | null;
58
+
51
59
  constructor();
52
60
 
53
61
  register(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
54
62
  unregister(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
55
63
 
64
+ setTextureUtils(utils: TextureUtils | null): this;
65
+
56
66
  /**
57
67
  * Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects)
58
68
  *
@@ -94,11 +104,15 @@ export class GLTFExporter {
94
104
  ): Promise<ArrayBuffer | { [key: string]: any }>;
95
105
  }
96
106
 
97
- export class GLTFWriter {
107
+ declare class GLTFWriter {
108
+ textureUtils: TextureUtils | null;
109
+
98
110
  constructor();
99
111
 
100
112
  setPlugins(plugins: GLTFExporterPlugin[]): void;
101
113
 
114
+ setTextureUtils(utils: TextureUtils | null): this;
115
+
102
116
  /**
103
117
  * Parse scenes and generate GLTF output
104
118
  *
@@ -106,7 +120,7 @@ export class GLTFWriter {
106
120
  * @param onDone Callback on completed
107
121
  * @param options options
108
122
  */
109
- write(
123
+ writeAsync(
110
124
  input: Object3D | Object3D[],
111
125
  onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
112
126
  options?: GLTFExporterOptions,
@@ -121,3 +135,6 @@ export interface GLTFExporterPlugin {
121
135
  beforeParse?: (input: Object3D | Object3D[]) => void;
122
136
  afterParse?: (input: Object3D | Object3D[]) => void;
123
137
  }
138
+
139
+ export { GLTFExporter };
140
+ export type { GLTFWriter };
@@ -1,5 +1,7 @@
1
1
  import { Data3DTexture, DataTexture, WebGLRenderer, WebGLRenderTarget } from "three";
2
+ import { WebGPURenderer } from "three/webgpu";
2
3
 
3
4
  export class KTX2Exporter {
4
- parse(arg1: Data3DTexture | DataTexture | WebGLRenderer, arg2?: WebGLRenderTarget): Uint8Array;
5
+ parse(renderer: WebGLRenderer | WebGPURenderer, rtt?: WebGLRenderTarget): Promise<Uint8Array>;
6
+ parse(texture: Data3DTexture | DataTexture): Promise<Uint8Array>;
5
7
  }
@@ -1,5 +1,9 @@
1
1
  import { Object3D } from "three";
2
2
 
3
+ /**
4
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
5
+ * https://github.com/takahirox/three-mmd-loader instead.
6
+ */
3
7
  export class MMDExporter {
4
8
  constructor();
5
9
 
@@ -1,4 +1,6 @@
1
1
  import { Object3D } from "three";
2
+ import * as WebGLTextureUtils from "../utils/WebGLTextureUtils.js";
3
+ import * as WebGPUTextureUtils from "../utils/WebGPUTextureUtils.js";
2
4
 
3
5
  export interface USDZExporterOptions {
4
6
  ar?: { anchoring: { type: "plane" }; planeAnchoring: { alignment: "horizontal" | "vertical" | "any" } } | undefined;
@@ -8,6 +10,8 @@ export interface USDZExporterOptions {
8
10
  }
9
11
 
10
12
  export class USDZExporter {
13
+ textureUtils: typeof WebGLTextureUtils | typeof WebGPUTextureUtils | null;
14
+
11
15
  constructor();
12
16
 
13
17
  parse(
@@ -1,10 +1,16 @@
1
1
  import { BufferGeometry, Euler, Mesh, Vector3 } from "three";
2
2
 
3
- export class DecalGeometry extends BufferGeometry {
3
+ declare class DecalGeometry extends BufferGeometry {
4
4
  constructor(mesh: Mesh, position: Vector3, orientation: Euler, size: Vector3);
5
5
  }
6
6
 
7
- export class DecalVertex {
8
- constructor(position: Vector3, normal: Vector3);
7
+ declare class DecalVertex {
8
+ position: Vector3;
9
+ normal: Vector3 | null;
10
+
11
+ constructor(position: Vector3, normal?: Vector3 | null);
12
+
9
13
  clone(): this;
10
14
  }
15
+
16
+ export { DecalGeometry, DecalVertex };
@@ -1,9 +1,9 @@
1
1
  import { BufferGeometry } from "three";
2
2
 
3
3
  /**
4
- * {@link TeapotGeometry} tesselates the famous Utah teapot database by Martin Newell.
4
+ * TeapotGeometry tessellates the famous Utah teapot database by Martin Newell.
5
5
  *
6
- * {@link TeapotGeometry} is an add-on, and must be imported explicitly. See
6
+ * TeapotGeometry is an add-on, and must be imported explicitly. See
7
7
  * [Installation / Addons]{@link https://threejs.org/docs/#manual/en/introduction/Installation}.
8
8
  *
9
9
  * @example