@types/three 0.157.1 → 0.158.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 (246) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +290 -0
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +30 -0
  4. three/examples/jsm/animation/MMDAnimationHelper.d.ts +105 -0
  5. three/examples/jsm/animation/MMDPhysics.d.ts +124 -0
  6. three/examples/jsm/cameras/CinematicCamera.d.ts +41 -0
  7. three/examples/jsm/capabilities/WebGL.d.ts +9 -0
  8. three/examples/jsm/controls/OrbitControls.d.ts +304 -0
  9. three/examples/jsm/controls/TrackballControls.d.ts +58 -0
  10. three/examples/jsm/effects/OutlineEffect.d.ts +36 -0
  11. three/examples/jsm/environments/RoomEnvironment.d.ts +6 -0
  12. three/examples/jsm/exporters/PLYExporter.d.ts +30 -0
  13. three/examples/jsm/exporters/STLExporter.d.ts +21 -0
  14. three/examples/jsm/helpers/RectAreaLightHelper.d.ts +10 -0
  15. three/examples/jsm/helpers/ViewHelper.d.ts +15 -0
  16. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  17. three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -0
  18. three/examples/jsm/libs/tween.module.d.ts +219 -0
  19. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +3 -0
  20. three/examples/jsm/lines/Line2.d.ts +11 -0
  21. three/examples/jsm/lines/LineGeometry.d.ts +10 -0
  22. three/examples/jsm/lines/LineMaterial.d.ts +31 -0
  23. three/examples/jsm/lines/LineSegments2.d.ts +14 -0
  24. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +23 -0
  25. three/examples/jsm/loaders/DDSLoader.d.ts +16 -0
  26. three/examples/jsm/loaders/DRACOLoader.d.ts +19 -0
  27. three/examples/jsm/loaders/GLTFLoader.d.ts +147 -0
  28. three/examples/jsm/loaders/KTX2Loader.d.ts +17 -0
  29. three/examples/jsm/loaders/LDrawLoader.d.ts +19 -0
  30. three/examples/jsm/loaders/LogLuvLoader.d.ts +1 -1
  31. three/examples/jsm/loaders/MMDLoader.d.ts +56 -0
  32. three/examples/jsm/loaders/MTLLoader.d.ts +104 -0
  33. three/examples/jsm/loaders/OBJLoader.d.ts +10 -0
  34. three/examples/jsm/loaders/PCDLoader.d.ts +8 -0
  35. three/examples/jsm/loaders/RGBELoader.d.ts +19 -0
  36. three/examples/jsm/loaders/SVGLoader.d.ts +68 -0
  37. three/examples/jsm/loaders/TGALoader.d.ts +7 -0
  38. three/examples/jsm/loaders/TTFLoader.d.ts +8 -0
  39. three/examples/jsm/loaders/USDZLoader.d.ts +11 -0
  40. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
  41. three/examples/jsm/math/Capsule.d.ts +0 -1
  42. three/examples/jsm/misc/MD2CharacterComplex.d.ts +9 -1
  43. three/examples/jsm/nodes/Nodes.d.ts +149 -0
  44. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  45. three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
  46. three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
  47. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +13 -0
  48. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
  49. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
  50. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
  51. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
  52. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
  53. three/examples/jsm/nodes/accessors/NormalNode.d.ts +12 -0
  54. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
  55. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
  56. three/examples/jsm/nodes/accessors/PositionNode.d.ts +21 -0
  57. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
  58. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
  59. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
  60. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
  61. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  62. three/examples/jsm/nodes/accessors/TextureNode.d.ts +14 -0
  63. three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
  64. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  65. three/examples/jsm/nodes/code/CodeNode.d.ts +15 -0
  66. three/examples/jsm/nodes/code/ExpressionNode.d.ts +7 -0
  67. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -0
  68. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  69. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
  70. three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
  71. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  72. three/examples/jsm/nodes/core/CacheNode.d.ts +10 -0
  73. three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
  74. three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
  75. three/examples/jsm/nodes/core/InputNode.d.ts +16 -0
  76. three/examples/jsm/nodes/core/Node.d.ts +31 -0
  77. three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
  78. three/examples/jsm/nodes/core/NodeBuilder.d.ts +138 -0
  79. three/examples/jsm/nodes/core/NodeCache.d.ts +9 -0
  80. three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
  81. three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
  82. three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
  83. three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
  84. three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
  85. three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
  86. three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
  87. three/examples/jsm/nodes/core/NodeUtils.d.ts +13 -0
  88. three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
  89. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  90. three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
  91. three/examples/jsm/nodes/core/StackNode.d.ts +11 -0
  92. three/examples/jsm/nodes/core/TempNode.d.ts +11 -0
  93. three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
  94. three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
  95. three/examples/jsm/nodes/core/VaryingNode.d.ts +8 -0
  96. three/examples/jsm/nodes/core/constants.d.ts +78 -0
  97. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  98. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
  99. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +18 -0
  100. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
  101. three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
  102. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  103. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
  104. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  105. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  106. three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
  107. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
  108. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
  109. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  110. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
  111. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  112. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  113. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
  114. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
  115. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  116. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
  117. three/examples/jsm/nodes/geometry/RangeNode.d.ts +13 -0
  118. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
  119. three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
  120. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
  121. three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
  122. three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
  123. three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
  124. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
  125. three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
  126. three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
  127. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  128. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  129. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +14 -0
  130. three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
  131. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +9 -0
  132. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +9 -0
  133. three/examples/jsm/nodes/materials/Materials.d.ts +17 -0
  134. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +10 -0
  135. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
  136. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +18 -0
  137. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +38 -0
  138. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
  139. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
  140. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  141. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +4 -0
  142. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +6 -0
  143. three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
  144. three/examples/jsm/nodes/math/MathNode.d.ts +115 -0
  145. three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
  146. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  147. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +156 -0
  148. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +310 -0
  149. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +166 -0
  150. three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
  151. three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
  152. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  153. three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
  154. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
  155. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +11 -0
  156. three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
  157. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  158. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
  159. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +8 -0
  160. three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
  161. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
  162. three/examples/jsm/nodes/utils/TimerNode.d.ts +19 -0
  163. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  164. three/examples/jsm/objects/Reflector.d.ts +29 -0
  165. three/examples/jsm/objects/ReflectorForSSRPass.d.ts +1 -0
  166. three/examples/jsm/objects/Refractor.d.ts +2 -1
  167. three/examples/jsm/physics/AmmoPhysics.d.ts +2 -1
  168. three/examples/jsm/physics/RapierPhysics.d.ts +2 -1
  169. three/examples/jsm/postprocessing/EffectComposer.d.ts +31 -0
  170. three/examples/jsm/postprocessing/Pass.d.ts +31 -0
  171. three/examples/jsm/postprocessing/SavePass.d.ts +12 -0
  172. three/examples/jsm/postprocessing/ShaderPass.d.ts +11 -0
  173. three/examples/jsm/renderers/CSS3DRenderer.d.ts +26 -0
  174. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -1
  175. three/examples/jsm/renderers/common/Backend.d.ts +15 -0
  176. three/examples/jsm/renderers/common/Info.d.ts +15 -0
  177. three/examples/jsm/renderers/common/Renderer.d.ts +42 -0
  178. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +17 -0
  179. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +37 -0
  180. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
  181. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +9 -0
  182. three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +11 -0
  183. three/examples/jsm/shaders/AfterimageShader.d.ts +1 -0
  184. three/examples/jsm/shaders/BasicShader.d.ts +1 -0
  185. three/examples/jsm/shaders/BlendShader.d.ts +1 -0
  186. three/examples/jsm/shaders/BokehShader.d.ts +1 -0
  187. three/examples/jsm/shaders/BokehShader2.d.ts +44 -0
  188. three/examples/jsm/shaders/BrightnessContrastShader.d.ts +1 -0
  189. three/examples/jsm/shaders/ColorCorrectionShader.d.ts +1 -0
  190. three/examples/jsm/shaders/DOFMipMapShader.d.ts +1 -0
  191. three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +1 -0
  192. three/examples/jsm/shaders/FXAAShader.d.ts +1 -0
  193. three/examples/jsm/shaders/FocusShader.d.ts +1 -0
  194. three/examples/jsm/shaders/FreiChenShader.d.ts +1 -0
  195. three/examples/jsm/shaders/GodRaysShader.d.ts +4 -0
  196. three/examples/jsm/shaders/HalftoneShader.d.ts +1 -0
  197. three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +1 -0
  198. three/examples/jsm/shaders/HueSaturationShader.d.ts +1 -0
  199. three/examples/jsm/shaders/KaleidoShader.d.ts +1 -0
  200. three/examples/jsm/shaders/LuminosityHighPassShader.d.ts +1 -0
  201. three/examples/jsm/shaders/LuminosityShader.d.ts +1 -0
  202. three/examples/jsm/shaders/MirrorShader.d.ts +1 -0
  203. three/examples/jsm/shaders/NormalMapShader.d.ts +1 -0
  204. three/examples/jsm/shaders/OutputShader.d.ts +1 -0
  205. three/examples/jsm/shaders/SAOShader.d.ts +1 -0
  206. three/examples/jsm/shaders/SMAAShader.d.ts +3 -0
  207. three/examples/jsm/shaders/SSAOShader.d.ts +3 -0
  208. three/examples/jsm/shaders/SSRShader.d.ts +3 -0
  209. three/examples/jsm/shaders/SobelOperatorShader.d.ts +1 -0
  210. three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +1 -0
  211. three/examples/jsm/shaders/TechnicolorShader.d.ts +1 -0
  212. three/examples/jsm/shaders/TriangleBlurShader.d.ts +1 -0
  213. three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +1 -0
  214. three/examples/jsm/shaders/VelocityShader.d.ts +14 -0
  215. three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +1 -0
  216. three/examples/jsm/shaders/WaterRefractionShader.d.ts +1 -0
  217. three/examples/jsm/utils/GPUStatsPanel.d.ts +12 -0
  218. three/examples/jsm/utils/GeometryUtils.d.ts +25 -0
  219. three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  220. three/examples/jsm/webxr/VRButton.d.ts +5 -0
  221. three/examples/jsm/webxr/XRButton.d.ts +6 -0
  222. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +21 -0
  223. three/examples/jsm/webxr/XREstimatedLight.d.ts +32 -0
  224. three/examples/jsm/webxr/XRHandMeshModel.d.ts +11 -0
  225. three/examples/jsm/webxr/XRHandModelFactory.d.ts +25 -0
  226. three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
  227. three/package.json +3 -2
  228. three/src/cameras/CubeCamera.d.ts +1 -2
  229. three/src/constants.d.ts +21 -10
  230. three/src/core/Object3D.d.ts +4 -4
  231. three/src/core/Raycaster.d.ts +1 -0
  232. three/src/extras/Earcut.d.ts +15 -0
  233. three/src/extras/core/Curve.d.ts +1 -1
  234. three/src/geometries/CapsuleGeometry.d.ts +1 -1
  235. three/src/helpers/AxesHelper.d.ts +2 -2
  236. three/src/helpers/Box3Helper.d.ts +2 -2
  237. three/src/lights/Light.d.ts +1 -2
  238. three/src/materials/Material.d.ts +20 -2
  239. three/src/materials/MeshPhysicalMaterial.d.ts +8 -6
  240. three/src/math/ColorManagement.d.ts +1 -1
  241. three/src/math/Matrix4.d.ts +2 -1
  242. three/src/objects/SkinnedMesh.d.ts +9 -8
  243. three/src/renderers/WebGLRenderer.d.ts +12 -2
  244. three/src/scenes/Scene.d.ts +2 -2
  245. three/src/textures/DepthTexture.d.ts +3 -3
  246. three/src/textures/Texture.d.ts +2 -2
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const SSAOShader: {
4
+ name: string;
4
5
  defines: {
5
6
  PERSPECTIVE_CAMERA: number;
6
7
  KERNEL_SIZE: number;
@@ -24,6 +25,7 @@ export const SSAOShader: {
24
25
  };
25
26
 
26
27
  export const SSAODepthShader: {
28
+ name: string;
27
29
  defines: {
28
30
  PERSPECTIVE_CAMERA: number;
29
31
  };
@@ -37,6 +39,7 @@ export const SSAODepthShader: {
37
39
  };
38
40
 
39
41
  export const SSAOBlurShader: {
42
+ name: string;
40
43
  uniforms: {
41
44
  tDiffuse: IUniform;
42
45
  resolution: IUniform;
@@ -6,6 +6,7 @@ import { Matrix4, Vector2, Texture, IUniform } from '../../../src/Three.js';
6
6
 
7
7
  export const SSRShader: SSRShader;
8
8
  export interface SSRShader {
9
+ name: string;
9
10
  defines: {
10
11
  MAX_STEP: number;
11
12
  isPerspectiveCamera: boolean;
@@ -35,6 +36,7 @@ export interface SSRShader {
35
36
 
36
37
  export const SSRDepthShader: SSRDepthShader;
37
38
  export interface SSRDepthShader {
39
+ name: string;
38
40
  defines: {
39
41
  PERSPECTIVE_CAMERA: number;
40
42
  };
@@ -49,6 +51,7 @@ export interface SSRDepthShader {
49
51
 
50
52
  export const SSRBlurShader: SSRBlurShader;
51
53
  export interface SSRBlurShader {
54
+ name: string;
52
55
  uniforms: {
53
56
  tDiffuse: IUniform<Texture | null>;
54
57
  resolution: IUniform<Vector2>;
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const SobelOperatorShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  tDiffuse: IUniform;
6
7
  resolution: IUniform;
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const SubsurfaceScatteringShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  alphaMap: IUniform;
6
7
  ambientLightColor: IUniform;
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const TechnicolorShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  tDiffuse: IUniform;
6
7
  };
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const TriangleBlurShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  texture: IUniform;
6
7
  delta: IUniform;
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const UnpackDepthRGBAShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  tDiffuse: IUniform;
6
7
  opacity: IUniform;
@@ -0,0 +1,14 @@
1
+ import { IUniform, UniformsLib } from '../../../src/Three.js';
2
+
3
+ export const VelocityShader: {
4
+ name: string;
5
+ uniforms: (typeof UniformsLib)['common'] &
6
+ (typeof UniformsLib)['displacementmap'] & {
7
+ modelMatrixPrev: IUniform;
8
+ currentProjectionViewMatrix: IUniform;
9
+ previousProjectionViewMatrix: IUniform;
10
+ };
11
+
12
+ fragmentShader: string;
13
+ vertexShader: string;
14
+ };
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const VerticalTiltShiftShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  tDiffuse: IUniform;
6
7
  v: IUniform;
@@ -1,6 +1,7 @@
1
1
  import { IUniform } from '../../../src/Three.js';
2
2
 
3
3
  export const WaterRefractionShader: {
4
+ name: string;
4
5
  uniforms: {
5
6
  color: IUniform;
6
7
  time: IUniform;
@@ -0,0 +1,12 @@
1
+ import Stats from '../libs/stats.module.js';
2
+
3
+ export class GPUStatsPanel extends Stats.Panel {
4
+ context: WebGLRenderingContext | WebGL2RenderingContext;
5
+ extension: unknown;
6
+ maxTime: number;
7
+ activeQueries: number;
8
+ startQuery: () => void;
9
+ endQuery: () => void;
10
+
11
+ constructor(context: WebGLRenderingContext | WebGL2RenderingContext, name?: string);
12
+ }
@@ -0,0 +1,25 @@
1
+ import { Vector3 } from '../../../src/Three.js';
2
+
3
+ export function hilbert2D(
4
+ center?: Vector3,
5
+ size?: number,
6
+ iterations?: number,
7
+ v0?: number,
8
+ v1?: number,
9
+ v2?: number,
10
+ v3?: number,
11
+ ): Vector3[];
12
+ export function hilbert3D(
13
+ center?: Vector3,
14
+ size?: number,
15
+ iterations?: number,
16
+ v0?: number,
17
+ v1?: number,
18
+ v2?: number,
19
+ v3?: number,
20
+ v4?: number,
21
+ v5?: number,
22
+ v6?: number,
23
+ v7?: number,
24
+ ): Vector3[];
25
+ export function gosper(size?: number): number[];
@@ -0,0 +1,5 @@
1
+ import { Group, Object3D } from '../../../src/Three.js';
2
+
3
+ export namespace LDrawUtils {
4
+ function mergeObject(object: Object3D): Group;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { WebGLRenderer } from '../../../src/Three.js';
2
+
3
+ export namespace VRButton {
4
+ function createButton(renderer: WebGLRenderer): HTMLElement;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { WebGLRenderer } from '../../../src/Three.js';
2
+
3
+ // tslint:disable-next-line:no-unnecessary-class
4
+ export class XRButton {
5
+ static createButton(renderer: WebGLRenderer, sessionInit?: XRSessionInit): HTMLElement;
6
+ }
@@ -0,0 +1,21 @@
1
+ import { Group, Object3D, Texture } from '../../../src/Three.js';
2
+
3
+ import { GLTFLoader } from '../loaders/GLTFLoader.js';
4
+
5
+ export class XRControllerModel extends Object3D {
6
+ constructor();
7
+
8
+ motionController: any;
9
+
10
+ envMap: Texture;
11
+
12
+ setEnvironmentMap(envMap: Texture): XRControllerModel;
13
+ }
14
+
15
+ export class XRControllerModelFactory {
16
+ constructor(gltfLoader?: GLTFLoader);
17
+ gltfLoader: GLTFLoader | null;
18
+ path: string;
19
+
20
+ createControllerModel(controller: Group): XRControllerModel;
21
+ }
@@ -24,14 +24,46 @@ export class SessionLightProbe {
24
24
  }
25
25
 
26
26
  export interface XREstimatedLightEventMap extends Object3DEventMap {
27
+ /**
28
+ * Fires when the estimated lighting values start being updated.
29
+ */
27
30
  estimationstart: {};
31
+ /**
32
+ * Fires when the estimated lighting values stop being updated.
33
+ */
28
34
  estimationend: {};
29
35
  }
30
36
 
37
+ /**
38
+ * XREstimatedLight uses WebXR's light estimation to create a light probe, a directional light, and (optionally) an
39
+ * environment map that model the user's real-world environment and lighting.
40
+ * As WebXR updates the light and environment estimation, XREstimatedLight automatically updates the light probe,
41
+ * directional light, and environment map.
42
+ *
43
+ * It's important to specify `light-estimation` as an optional or required feature when creating the WebXR session,
44
+ * otherwise the light estimation can't work.
45
+ *
46
+ * See {@link https://developer.mozilla.org/en-US/docs/Web/API/XRLightProbe#browser_compatibility here} for browser
47
+ * compatibility information, as this is still an experimental feature in WebXR.
48
+ *
49
+ * To use this, as with all files in the /examples directory, you will have to include the file separately in your HTML.
50
+ */
31
51
  export class XREstimatedLight extends Group<XREstimatedLightEventMap> {
32
52
  lightProbe: LightProbe;
53
+
33
54
  directionalLight: DirectionalLight;
55
+
56
+ /**
57
+ * The environment map estimated by WebXR. This is only available if environmentEstimation is `true`.
58
+ *
59
+ * It can be used as the {@link Scene.environment}, for {@link MeshStandardMaterial.envMap}, or as the
60
+ * {@link Scene.background}.
61
+ */
34
62
  environment: Texture;
35
63
 
64
+ /**
65
+ * @param renderer The renderer used to render the Scene. Mainly used to interact with WebXRManager.
66
+ * @param environmentEstimation If `true`, use WebXR to estimate an environment map.
67
+ */
36
68
  constructor(renderer: WebGLRenderer, environmentEstimation?: boolean);
37
69
  }
@@ -0,0 +1,11 @@
1
+ import { Object3D } from '../../../src/Three.js';
2
+
3
+ export class XRHandMeshModel {
4
+ controller: Object3D;
5
+ handModel: Object3D;
6
+ bones: Object3D[];
7
+
8
+ constructor(handModel: Object3D, controller: Object3D, path: string, handedness: string);
9
+
10
+ updateMesh(): void;
11
+ }
@@ -0,0 +1,25 @@
1
+ import { Group, Object3D } from '../../../src/Three.js';
2
+
3
+ import { XRHandPrimitiveModel, XRHandPrimitiveModelOptions } from './XRHandPrimitiveModel.js';
4
+ import { XRHandMeshModel } from './XRHandMeshModel.js';
5
+
6
+ export type XRHandModelHandedness = 'left' | 'right';
7
+
8
+ export class XRHandModel extends Object3D {
9
+ constructor();
10
+
11
+ motionController: XRHandPrimitiveModel | XRHandMeshModel;
12
+ }
13
+
14
+ export class XRHandModelFactory {
15
+ constructor();
16
+ path: string;
17
+
18
+ setPath(path: string): XRHandModelFactory;
19
+
20
+ createHandModel(
21
+ controller: Group,
22
+ profile?: 'spheres' | 'boxes' | 'mesh',
23
+ options?: XRHandPrimitiveModelOptions,
24
+ ): XRHandModel;
25
+ }
@@ -0,0 +1,24 @@
1
+ import { Group, Texture } from '../../../src/Three.js';
2
+
3
+ import { XRHandModel, XRHandModelHandedness } from './XRHandModelFactory.js';
4
+
5
+ export interface XRHandPrimitiveModelOptions {
6
+ primitive?: 'sphere' | 'box' | undefined;
7
+ }
8
+
9
+ export class XRHandPrimitiveModel {
10
+ controller: Group;
11
+ handModel: XRHandModel;
12
+ envMap: Texture | null;
13
+ handMesh: Group;
14
+
15
+ constructor(
16
+ handModel: XRHandModel,
17
+ controller: Group,
18
+ path: string,
19
+ handedness: XRHandModelHandedness,
20
+ options: XRHandPrimitiveModelOptions,
21
+ );
22
+
23
+ updateMesh: () => void;
24
+ }
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.157.1",
3
+ "version": "0.158.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -26,6 +26,7 @@
26
26
  },
27
27
  "./examples/fonts/*": "./examples/fonts/*",
28
28
  "./examples/jsm/*": "./examples/jsm/*",
29
+ "./addons": "./examples/jsm/Addons.js",
29
30
  "./addons/*": "./examples/jsm/*",
30
31
  "./src/*": "./src/*",
31
32
  "./nodes": "./examples/jsm/nodes/Nodes.js",
@@ -43,6 +44,6 @@
43
44
  "fflate": "~0.6.10",
44
45
  "meshoptimizer": "~0.18.1"
45
46
  },
46
- "typesPublisherContentHash": "d9388a18bbcf88aa18fface6fb06534b21e5cbb2b9d6df028f4c585cfc72e00c",
47
+ "typesPublisherContentHash": "255a6a1803d2017678c3abe305771d2dc7b3a2db590cb731e2a0f99e04dfcc14",
47
48
  "typeScriptVersion": "4.5"
48
49
  }
@@ -1,5 +1,4 @@
1
1
  import { WebGLCubeRenderTarget } from '../renderers/WebGLCubeRenderTarget.js';
2
- import { Scene } from '../scenes/Scene.js';
3
2
  import { WebGLRenderer } from '../renderers/WebGLRenderer.js';
4
3
  import { Object3D } from '../core/Object3D.js';
5
4
  import { CoordinateSystem } from '../constants.js';
@@ -65,5 +64,5 @@ export class CubeCamera extends Object3D {
65
64
  * @param renderer The current WebGL renderer
66
65
  * @param scene The current scene
67
66
  */
68
- update(renderer: WebGLRenderer, scene: Scene): void;
67
+ update(renderer: WebGLRenderer, scene: Object3D): void;
69
68
  }
three/src/constants.d.ts CHANGED
@@ -74,7 +74,7 @@ export type BlendingEquation =
74
74
  | typeof MinEquation
75
75
  | typeof MaxEquation;
76
76
 
77
- // custom blending destination factors
77
+ // custom blending factors
78
78
  export const ZeroFactor: 200;
79
79
  export const OneFactor: 201;
80
80
  export const SrcColorFactor: 202;
@@ -85,6 +85,11 @@ export const DstAlphaFactor: 206;
85
85
  export const OneMinusDstAlphaFactor: 207;
86
86
  export const DstColorFactor: 208;
87
87
  export const OneMinusDstColorFactor: 209;
88
+ export const SrcAlphaSaturateFactor: 210;
89
+ export const ConstantColorFactor: 211;
90
+ export const OneMinusConstantColorFactor: 212;
91
+ export const ConstantAlphaFactor: 213;
92
+ export const OneMinusConstantAlphaFactor: 214;
88
93
  export type BlendingDstFactor =
89
94
  | typeof ZeroFactor
90
95
  | typeof OneFactor
@@ -95,11 +100,12 @@ export type BlendingDstFactor =
95
100
  | typeof DstAlphaFactor
96
101
  | typeof OneMinusDstAlphaFactor
97
102
  | typeof DstColorFactor
98
- | typeof OneMinusDstColorFactor;
99
-
100
- // custom blending src factors
101
- export const SrcAlphaSaturateFactor: 210;
102
- export type BlendingSrcFactor = typeof SrcAlphaSaturateFactor;
103
+ | typeof OneMinusDstColorFactor
104
+ | typeof ConstantColorFactor
105
+ | typeof OneMinusConstantColorFactor
106
+ | typeof ConstantAlphaFactor
107
+ | typeof OneMinusConstantAlphaFactor;
108
+ export type BlendingSrcFactor = BlendingDstFactor | typeof SrcAlphaSaturateFactor;
103
109
 
104
110
  // depth modes
105
111
  export const NeverDepth: 0;
@@ -142,6 +148,11 @@ export type ToneMapping =
142
148
  | typeof ACESFilmicToneMapping
143
149
  | typeof CustomToneMapping;
144
150
 
151
+ // Bind modes
152
+ export const AttachedBindMode: 'attached';
153
+ export const DetachedBindMode: 'detached';
154
+ export type BindMode = typeof AttachedBindMode | typeof DetachedBindMode;
155
+
145
156
  ///////////////////////////////////////////////////////////////////////////////
146
157
  ///////////////////////////////////////////////////////////////////////////////
147
158
  ///////////////////////////////////////////////////////////////////////////////
@@ -462,11 +473,11 @@ export type WebGL2PixelFormat =
462
473
  export type PixelFormat = WebGL1PixelFormat | WebGL2PixelFormat;
463
474
 
464
475
  /**
465
- * All Texture Pixel Formats Modes for {@link THREE.DeepTexture}.
476
+ * All Texture Pixel Formats Modes for {@link THREE.DepthTexture}.
466
477
  * @see {@link WebGLRenderingContext.texImage2D} for details.
467
478
  * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
468
479
  */
469
- export type DeepTexturePixelFormat = typeof DepthFormat | typeof DepthStencilFormat;
480
+ export type DepthTexturePixelFormat = typeof DepthFormat | typeof DepthStencilFormat;
470
481
 
471
482
  ///////////////////////////////////////////////////////////////////////////////
472
483
  // Compressed texture formats
@@ -649,10 +660,10 @@ export type CompressedPixelFormat =
649
660
  * All Possible Texture Pixel Formats Modes. For any Type or SubType of Textures.
650
661
  * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
651
662
  * @see {@link WebGLRenderingContext.texImage2D} for details.
652
- * @see {@link PixelFormat} and {@link DeepTexturePixelFormat} and {@link CompressedPixelFormat}
663
+ * @see {@link PixelFormat} and {@link DepthTexturePixelFormat} and {@link CompressedPixelFormat}
653
664
  * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
654
665
  */
655
- export type AnyPixelFormat = PixelFormat | DeepTexturePixelFormat | CompressedPixelFormat;
666
+ export type AnyPixelFormat = PixelFormat | DepthTexturePixelFormat | CompressedPixelFormat;
656
667
 
657
668
  ///////////////////////////////////////////////////////////////////////////////
658
669
  // Loop styles for AnimationAction
@@ -235,14 +235,14 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
235
235
  * are not renderable and thus this callback is not executed for such objects.
236
236
  * @defaultValue `() => {}`
237
237
  */
238
- onBeforeRender: (
238
+ onBeforeRender(
239
239
  renderer: WebGLRenderer,
240
240
  scene: Scene,
241
241
  camera: Camera,
242
242
  geometry: BufferGeometry,
243
243
  material: Material,
244
244
  group: Group,
245
- ) => void;
245
+ ): void;
246
246
 
247
247
  /**
248
248
  * An optional callback that is executed immediately after a 3D object is rendered.
@@ -254,14 +254,14 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
254
254
  * are not renderable and thus this callback is not executed for such objects.
255
255
  * @defaultValue `() => {}`
256
256
  */
257
- onAfterRender: (
257
+ onAfterRender(
258
258
  renderer: WebGLRenderer,
259
259
  scene: Scene,
260
260
  camera: Camera,
261
261
  geometry: BufferGeometry,
262
262
  material: Material,
263
263
  group: Group,
264
- ) => void;
264
+ ): void;
265
265
 
266
266
  /**
267
267
  * The default {@link up} direction for objects, also used as the default position for {@link THREE.DirectionalLight | DirectionalLight},
@@ -31,6 +31,7 @@ export interface Intersection<TIntersected extends Object3D = Object3D> {
31
31
  normal?: Vector3;
32
32
  /** The index number of the instance where the ray intersects the {@link THREE.InstancedMesh | InstancedMesh } */
33
33
  instanceId?: number | undefined;
34
+ pointOnLine?: Vector3;
34
35
  }
35
36
 
36
37
  export interface RaycasterParameters {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * An implementation of the {@link Earcut} polygon triangulation algorithm
3
+ * @remarks
4
+ * The code is a port of {@link https://github.com/mapbox/earcut | mapbox/earcut}.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
7
+ */
8
+ export const Earcut: {
9
+ /**
10
+ * Triangulates the given shape definition by returning an array of triangles
11
+ * @remarks
12
+ * A triangle is defined by three consecutive integers representing vertex indices.
13
+ */
14
+ triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
+ };
@@ -82,7 +82,7 @@ export abstract class Curve<T extends Vector> {
82
82
  getLengths(divisions?: number): number[];
83
83
 
84
84
  /**
85
- * Update the cumlative segment distance cache
85
+ * Update the cumulative segment distance cache
86
86
  * @remarks
87
87
  * The method must be called every time {@link Curve} parameters are changed
88
88
  * If an updated {@link Curve} is part of a composed {@link Curve} like {@link THREE.CurvePath | CurvePath},
@@ -20,7 +20,7 @@ export class CapsuleGeometry extends BufferGeometry {
20
20
  * Create a new instance of {@link CapsuleGeometry}
21
21
  * @param radius Radius of the capsule. Expects a `Float`. Default `1`
22
22
  * @param length Length of the middle section. Expects a `Float`. Default `1`
23
- * @param capSubdivisions Number of curve segments used to build the caps. Expects a `Integer`. Default `4`
23
+ * @param capSegments Number of curve segments used to build the caps. Expects a `Integer`. Default `4`
24
24
  * @param radialSegments Number of segmented faces around the circumference of the capsule. Expects a `Integer`. Default `8`
25
25
  */
26
26
  constructor(radius?: number, length?: number, capSegments?: number, radialSegments?: number);
@@ -1,4 +1,4 @@
1
- import { Color } from '../math/Color.js';
1
+ import { ColorRepresentation } from '../math/Color.js';
2
2
  import { LineSegments } from './../objects/LineSegments.js';
3
3
 
4
4
  /**
@@ -39,7 +39,7 @@ export class AxesHelper extends LineSegments {
39
39
  * @param yAxisColor
40
40
  * @param zAxisColor
41
41
  */
42
- setColors(xAxisColor: Color, yAxisColor: Color, zAxisColor: Color): this;
42
+ setColors(xAxisColor: ColorRepresentation, yAxisColor: ColorRepresentation, zAxisColor: ColorRepresentation): this;
43
43
 
44
44
  /**
45
45
  * Frees the GPU-related resources allocated by this instance
@@ -1,5 +1,5 @@
1
1
  import { Box3 } from './../math/Box3.js';
2
- import { Color } from './../math/Color.js';
2
+ import { ColorRepresentation } from './../math/Color.js';
3
3
  import { LineSegments } from './../objects/LineSegments.js';
4
4
 
5
5
  /**
@@ -20,7 +20,7 @@ export class Box3Helper extends LineSegments {
20
20
  * @param box The Box3 to show.
21
21
  * @param color The box's color. Default `0xffff00`
22
22
  */
23
- constructor(box: Box3, color?: Color);
23
+ constructor(box: Box3, color?: ColorRepresentation);
24
24
 
25
25
  /**
26
26
  * A Read-only _string_ to check if `this` object type.
@@ -38,8 +38,7 @@ export abstract class Light<TShadowSupport extends LightShadow | undefined = Lig
38
38
 
39
39
  /**
40
40
  * The light's intensity, or strength.
41
- * When {@link THREE.WebGLRenderer.useLegacyLights | legacy lighting mode} is disabled, the units of intensity depend on the type of light.
42
- * @remarks Expects a `Float`
41
+ * The units of intensity depend on the type of light.
43
42
  * @defaultValue `1`
44
43
  */
45
44
  intensity: number;
@@ -13,11 +13,14 @@ import {
13
13
  StencilOp,
14
14
  PixelFormat,
15
15
  } from '../constants.js';
16
+ import { Color, ColorRepresentation } from '../math/Color.js';
16
17
 
17
18
  export interface MaterialParameters {
18
19
  alphaHash?: boolean | undefined;
19
20
  alphaTest?: number | undefined;
20
21
  alphaToCoverage?: boolean | undefined;
22
+ blendAlpha?: number | undefined;
23
+ blendColor?: ColorRepresentation | undefined;
21
24
  blendDst?: BlendingDstFactor | undefined;
22
25
  blendDstAlpha?: number | undefined;
23
26
  blendEquation?: BlendingEquation | undefined;
@@ -86,6 +89,20 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
86
89
  */
87
90
  alphaToCoverage: boolean;
88
91
 
92
+ /**
93
+ * Represents the alpha value of the constant blend color. This property has only an effect when using custom
94
+ * blending with {@link ConstantAlphaFactor} or {@link OneMinusConstantAlphaFactor}.
95
+ * @default 0
96
+ */
97
+ blendAlpha: number;
98
+
99
+ /**
100
+ * Represent the RGB values of the constant blend color. This property has only an effect when using custom
101
+ * blending with {@link ConstantColorFactor} or {@link OneMinusConstantColorFactor}.
102
+ * @default 0x000000
103
+ */
104
+ blendColor: Color;
105
+
89
106
  /**
90
107
  * Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}.
91
108
  * @default THREE.OneMinusSrcAlphaFactor
@@ -141,7 +158,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
141
158
  * See the WebGL / clipping /intersection example. Default is null.
142
159
  * @default null
143
160
  */
144
- clippingPlanes: Plane[];
161
+ clippingPlanes: Plane[] | null;
145
162
 
146
163
  /**
147
164
  * Defines whether to clip shadows according to the clipping planes specified on this material. Default is false.
@@ -169,7 +186,8 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
169
186
  depthFunc: DepthModes;
170
187
 
171
188
  /**
172
- * Whether to have depth test enabled when rendering this material. Default is true.
189
+ * Whether to have depth test enabled when rendering this material. When the depth test is disabled, the depth write
190
+ * will also be implicitly disabled.
173
191
  * @default true
174
192
  */
175
193
  depthTest: boolean;