@types/three 0.182.0 → 0.183.1

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 (313) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +0 -3
  3. three/examples/jsm/controls/OrbitControls.d.ts +39 -0
  4. three/examples/jsm/effects/AnaglyphEffect.d.ts +4 -0
  5. three/examples/jsm/environments/ColorEnvironment.d.ts +9 -0
  6. three/examples/jsm/gpgpu/BitonicSort.d.ts +5 -5
  7. three/examples/jsm/helpers/AnimationPathHelper.d.ts +38 -0
  8. three/examples/jsm/helpers/ViewHelper.d.ts +4 -1
  9. three/examples/jsm/inspector/tabs/Parameters.d.ts +3 -0
  10. three/examples/jsm/inspector/ui/Item.d.ts +5 -0
  11. three/examples/jsm/libs/meshopt_decoder.module.d.ts +1 -1
  12. three/examples/jsm/lights/LightProbeGenerator.d.ts +11 -5
  13. three/examples/jsm/loaders/ColladaLoader.d.ts +27 -4
  14. three/examples/jsm/objects/SkyMesh.d.ts +11 -6
  15. three/examples/jsm/objects/Water2Mesh.d.ts +7 -7
  16. three/examples/jsm/objects/WaterMesh.d.ts +6 -6
  17. three/examples/jsm/postprocessing/EffectComposer.d.ts +9 -10
  18. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +4 -9
  19. three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +30 -0
  20. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +1 -1
  21. three/examples/jsm/tsl/display/BilateralBlurNode.d.ts +27 -0
  22. three/examples/jsm/tsl/display/BloomNode.d.ts +5 -5
  23. three/examples/jsm/tsl/display/CRT.d.ts +22 -0
  24. three/examples/jsm/tsl/display/DenoiseNode.d.ts +5 -5
  25. three/examples/jsm/tsl/display/DotScreenNode.d.ts +4 -6
  26. three/examples/jsm/tsl/display/GTAONode.d.ts +8 -8
  27. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +4 -2
  28. three/examples/jsm/tsl/display/GodraysNode.d.ts +20 -0
  29. three/examples/jsm/tsl/display/LensflareNode.d.ts +6 -6
  30. three/examples/jsm/tsl/display/Lut3DNode.d.ts +5 -5
  31. three/examples/jsm/tsl/display/MotionBlur.d.ts +1 -1
  32. three/examples/jsm/tsl/display/OutlineNode.d.ts +6 -6
  33. three/examples/jsm/tsl/display/PixelationPassNode.d.ts +10 -10
  34. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -2
  35. three/examples/jsm/tsl/display/RetroPassNode.d.ts +17 -0
  36. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +1 -1
  37. three/examples/jsm/tsl/display/SSGINode.d.ts +11 -11
  38. three/examples/jsm/tsl/display/SSRNode.d.ts +6 -6
  39. three/examples/jsm/tsl/display/SSSNode.d.ts +5 -5
  40. three/examples/jsm/tsl/display/Shape.d.ts +3 -0
  41. three/examples/jsm/tsl/display/TransitionNode.d.ts +3 -3
  42. three/examples/jsm/tsl/display/boxBlur.d.ts +1 -1
  43. three/examples/jsm/tsl/display/depthAwareBlend.d.ts +15 -0
  44. three/examples/jsm/tsl/display/hashBlur.d.ts +1 -1
  45. three/examples/jsm/tsl/math/Bayer.d.ts +2 -0
  46. three/examples/jsm/tsl/utils/Raymarching.d.ts +2 -2
  47. three/package.json +3 -3
  48. three/src/Three.Core.d.ts +1 -1
  49. three/src/Three.TSL.d.ts +6 -11
  50. three/src/Three.WebGPU.Nodes.d.ts +2 -0
  51. three/src/Three.WebGPU.d.ts +3 -0
  52. three/src/Three.d.ts +2 -2
  53. three/src/animation/AnimationClip.d.ts +1 -1
  54. three/src/animation/KeyframeTrack.d.ts +19 -5
  55. three/src/animation/PropertyMixer.d.ts +5 -4
  56. three/src/audio/Audio.d.ts +224 -157
  57. three/src/audio/AudioAnalyser.d.ts +32 -27
  58. three/src/audio/AudioContext.d.ts +12 -12
  59. three/src/audio/AudioListener.d.ts +44 -65
  60. three/src/audio/PositionalAudio.d.ts +69 -62
  61. three/src/cameras/ArrayCamera.d.ts +21 -24
  62. three/src/cameras/Camera.d.ts +14 -53
  63. three/src/cameras/CubeCamera.d.ts +32 -28
  64. three/src/cameras/OrthographicCamera.d.ts +70 -100
  65. three/src/cameras/PerspectiveCamera.d.ts +133 -146
  66. three/src/cameras/StereoCamera.d.ts +24 -30
  67. three/src/constants.d.ts +14 -2
  68. three/src/core/Clock.d.ts +3 -0
  69. three/src/core/Object3D.d.ts +31 -7
  70. three/src/geometries/TorusGeometry.d.ts +22 -3
  71. three/src/helpers/ArrowHelper.d.ts +34 -50
  72. three/src/helpers/AxesHelper.d.ts +22 -36
  73. three/src/helpers/Box3Helper.d.ts +14 -25
  74. three/src/helpers/BoxHelper.d.ts +28 -39
  75. three/src/helpers/CameraHelper.d.ts +31 -52
  76. three/src/helpers/DirectionalLightHelper.d.ts +32 -53
  77. three/src/helpers/GridHelper.d.ts +15 -29
  78. three/src/helpers/HemisphereLightHelper.d.ts +26 -49
  79. three/src/helpers/PlaneHelper.d.ts +21 -33
  80. three/src/helpers/PointLightHelper.d.ts +25 -50
  81. three/src/helpers/PolarGridHelper.d.ts +19 -32
  82. three/src/helpers/SkeletonHelper.d.ts +26 -50
  83. three/src/helpers/SpotLightHelper.d.ts +28 -55
  84. three/src/lights/AmbientLight.d.ts +15 -23
  85. three/src/lights/DirectionalLight.d.ts +40 -82
  86. three/src/lights/DirectionalLightShadow.d.ts +6 -61
  87. three/src/lights/HemisphereLight.d.ts +20 -47
  88. three/src/lights/Light.d.ts +18 -48
  89. three/src/lights/LightProbe.d.ts +24 -29
  90. three/src/lights/LightShadow.d.ts +107 -91
  91. three/src/lights/PointLight.d.ts +36 -77
  92. three/src/lights/PointLightShadow.d.ts +9 -6
  93. three/src/lights/RectAreaLight.d.ts +39 -59
  94. three/src/lights/SpotLight.d.ts +62 -116
  95. three/src/lights/SpotLightShadow.d.ts +17 -59
  96. three/src/lights/webgpu/IESSpotLight.d.ts +13 -1
  97. three/src/lights/webgpu/ProjectorLight.d.ts +9 -10
  98. three/src/materials/MeshLambertMaterial.d.ts +6 -0
  99. three/src/materials/MeshPhongMaterial.d.ts +6 -0
  100. three/src/materials/nodes/Line2NodeMaterial.d.ts +0 -6
  101. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +0 -4
  102. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -2
  103. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +0 -2
  104. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +0 -2
  105. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +5 -8
  106. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +0 -4
  107. three/src/materials/nodes/NodeMaterial.d.ts +9 -3
  108. three/src/materials/nodes/SpriteNodeMaterial.d.ts +0 -3
  109. three/src/materials/nodes/VolumeNodeMaterial.d.ts +0 -2
  110. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +39 -93
  111. three/src/math/Color.d.ts +1 -0
  112. three/src/math/Vector3.d.ts +2 -2
  113. three/src/math/interpolants/BezierInterpolant.d.ts +7 -0
  114. three/src/nodes/Nodes.d.ts +55 -35
  115. three/src/nodes/TSL.d.ts +2 -5
  116. three/src/nodes/accessors/Arrays.d.ts +19 -10
  117. three/src/nodes/accessors/BufferAttributeNode.d.ts +99 -33
  118. three/src/nodes/accessors/BufferNode.d.ts +21 -7
  119. three/src/nodes/accessors/Camera.d.ts +10 -10
  120. three/src/nodes/accessors/CubeTextureNode.d.ts +1 -1
  121. three/src/nodes/accessors/InstanceNode.d.ts +6 -0
  122. three/src/nodes/accessors/Lights.d.ts +9 -6
  123. three/src/nodes/accessors/MaterialNode.d.ts +1 -3
  124. three/src/nodes/accessors/MaterialProperties.d.ts +4 -4
  125. three/src/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  126. three/src/nodes/accessors/ModelNode.d.ts +34 -17
  127. three/src/nodes/accessors/MorphNode.d.ts +1 -1
  128. three/src/nodes/accessors/Normal.d.ts +13 -15
  129. three/src/nodes/accessors/Object3DNode.d.ts +35 -16
  130. three/src/nodes/accessors/Position.d.ts +9 -7
  131. three/src/nodes/accessors/ReferenceNode.d.ts +16 -7
  132. three/src/nodes/accessors/ReflectVector.d.ts +4 -5
  133. three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
  134. three/src/nodes/accessors/SceneProperties.d.ts +5 -0
  135. three/src/nodes/accessors/SkinningNode.d.ts +5 -3
  136. three/src/nodes/accessors/StorageBufferNode.d.ts +49 -22
  137. three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
  138. three/src/nodes/accessors/Tangent.d.ts +5 -7
  139. three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
  140. three/src/nodes/accessors/TextureBicubic.d.ts +3 -2
  141. three/src/nodes/accessors/TextureNode.d.ts +19 -18
  142. three/src/nodes/accessors/UV.d.ts +1 -1
  143. three/src/nodes/accessors/UniformArrayNode.d.ts +10 -8
  144. three/src/nodes/accessors/UserDataNode.d.ts +1 -1
  145. three/src/nodes/accessors/VelocityNode.d.ts +3 -3
  146. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  147. three/src/nodes/code/FunctionCallNode.d.ts +0 -1
  148. three/src/nodes/code/FunctionNode.d.ts +7 -3
  149. three/src/nodes/core/ArrayNode.d.ts +2 -3
  150. three/src/nodes/core/AttributeNode.d.ts +12 -6
  151. three/src/nodes/core/BypassNode.d.ts +2 -3
  152. three/src/nodes/core/ConstNode.d.ts +10 -3
  153. three/src/nodes/core/ContextNode.d.ts +23 -28
  154. three/src/nodes/core/IndexNode.d.ts +1 -1
  155. three/src/nodes/core/InputNode.d.ts +12 -4
  156. three/src/nodes/core/InspectorNode.d.ts +2 -3
  157. three/src/nodes/core/IsolateNode.d.ts +2 -7
  158. three/src/nodes/core/MRTNode.d.ts +7 -0
  159. three/src/nodes/core/Node.d.ts +258 -39
  160. three/src/nodes/core/NodeAttribute.d.ts +30 -5
  161. three/src/nodes/core/NodeBuilder.d.ts +5 -3
  162. three/src/nodes/core/NodeCache.d.ts +24 -48
  163. three/src/nodes/core/NodeError.d.ts +9 -0
  164. three/src/nodes/core/NodeParser.d.ts +2 -0
  165. three/src/nodes/core/NodeUniform.d.ts +33 -9
  166. three/src/nodes/core/NodeVar.d.ts +33 -5
  167. three/src/nodes/core/NodeVarying.d.ts +32 -4
  168. three/src/nodes/core/ParameterNode.d.ts +11 -4
  169. three/src/nodes/core/PropertyNode.d.ts +45 -35
  170. three/src/nodes/core/StackTrace.d.ts +9 -0
  171. three/src/nodes/core/StructType.d.ts +3 -1
  172. three/src/nodes/core/StructTypeNode.d.ts +19 -5
  173. three/src/nodes/core/TempNode.d.ts +9 -3
  174. three/src/nodes/core/UniformNode.d.ts +53 -15
  175. three/src/nodes/core/VarNode.d.ts +15 -14
  176. three/src/nodes/core/VaryingNode.d.ts +14 -19
  177. three/src/nodes/core/constants.d.ts +9 -4
  178. three/src/nodes/display/BlendModes.d.ts +7 -27
  179. three/src/nodes/display/ColorAdjustment.d.ts +8 -9
  180. three/src/nodes/display/ColorSpaceNode.d.ts +2 -8
  181. three/src/nodes/display/FrontFacingNode.d.ts +1 -1
  182. three/src/nodes/display/PassNode.d.ts +9 -5
  183. three/src/nodes/display/RenderOutputNode.d.ts +3 -7
  184. three/src/nodes/display/ScreenNode.d.ts +25 -17
  185. three/src/nodes/display/ToneMappingNode.d.ts +3 -7
  186. three/src/nodes/display/ViewportDepthNode.d.ts +11 -7
  187. three/src/nodes/display/ViewportTextureNode.d.ts +2 -0
  188. three/src/nodes/fog/Fog.d.ts +5 -3
  189. three/src/nodes/geometry/RangeNode.d.ts +51 -9
  190. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +2 -0
  191. three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
  192. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -7
  193. three/src/nodes/lighting/AnalyticLightNode.d.ts +1 -1
  194. three/src/nodes/lighting/HemisphereLightNode.d.ts +3 -2
  195. three/src/nodes/lighting/LightProbeNode.d.ts +1 -1
  196. three/src/nodes/lighting/LightUtils.d.ts +1 -1
  197. three/src/nodes/lighting/LightingContextNode.d.ts +1 -1
  198. three/src/nodes/lighting/SpotLightNode.d.ts +0 -6
  199. three/src/nodes/materialx/MaterialXNodes.d.ts +11 -11
  200. three/src/nodes/math/BitcountNode.d.ts +2 -0
  201. three/src/nodes/math/ConditionalNode.d.ts +43 -22
  202. three/src/nodes/math/Hash.d.ts +1 -1
  203. three/src/nodes/math/MathNode.d.ts +603 -267
  204. three/src/nodes/math/MathUtils.d.ts +9 -5
  205. three/src/nodes/math/OperatorNode.d.ts +490 -227
  206. three/src/nodes/math/TriNoise3D.d.ts +3 -3
  207. three/src/nodes/pmrem/PMREMNode.d.ts +1 -1
  208. three/src/nodes/procedural/Checker.d.ts +1 -1
  209. three/src/nodes/tsl/TSLCore.d.ts +1683 -224
  210. three/src/nodes/utils/ArrayElementNode.d.ts +9 -4
  211. three/src/nodes/utils/DebugNode.d.ts +2 -5
  212. three/src/nodes/utils/Discard.d.ts +2 -3
  213. three/src/nodes/utils/FlipNode.d.ts +11 -0
  214. three/src/nodes/utils/LoopNode.d.ts +17 -13
  215. three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
  216. three/src/nodes/utils/Oscillators.d.ts +4 -4
  217. three/src/nodes/utils/Packing.d.ts +3 -3
  218. three/src/nodes/utils/PostProcessingUtils.d.ts +5 -5
  219. three/src/nodes/utils/RemapNode.d.ts +33 -39
  220. three/src/nodes/utils/RotateNode.d.ts +17 -8
  221. three/src/nodes/utils/SplitNode.d.ts +1 -2
  222. three/src/nodes/utils/SpriteSheetUV.d.ts +7 -0
  223. three/src/nodes/utils/StorageArrayElementNode.d.ts +18 -9
  224. three/src/nodes/utils/Timer.d.ts +4 -4
  225. three/src/nodes/utils/TriplanarTextures.d.ts +2 -2
  226. three/src/nodes/utils/UVUtils.d.ts +6 -4
  227. three/src/objects/BatchedMesh.d.ts +6 -4
  228. three/src/objects/InstancedMesh.d.ts +32 -24
  229. three/src/renderers/WebGLRenderer.d.ts +4 -93
  230. three/src/renderers/common/Animation.d.ts +46 -9
  231. three/src/renderers/common/Attributes.d.ts +11 -13
  232. three/src/renderers/common/Backend.d.ts +0 -2
  233. three/src/renderers/common/Background.d.ts +17 -15
  234. three/src/renderers/common/BindGroup.d.ts +27 -13
  235. three/src/renderers/common/Binding.d.ts +15 -3
  236. three/src/renderers/common/Bindings.d.ts +41 -17
  237. three/src/renderers/common/BlendMode.d.ts +22 -0
  238. three/src/renderers/common/Buffer.d.ts +35 -11
  239. three/src/renderers/common/BufferUtils.d.ts +3 -4
  240. three/src/renderers/common/BundleGroup.d.ts +16 -6
  241. three/src/renderers/common/CanvasTarget.d.ts +76 -13
  242. three/src/renderers/common/ChainMap.d.ts +12 -9
  243. three/src/renderers/common/ClippingContext.d.ts +61 -10
  244. three/src/renderers/common/Color4.d.ts +10 -5
  245. three/src/renderers/common/ComputePipeline.d.ts +16 -2
  246. three/src/renderers/common/Constants.d.ts +5 -3
  247. three/src/renderers/common/CubeRenderTarget.d.ts +24 -7
  248. three/src/renderers/common/DataMap.d.ts +10 -18
  249. three/src/renderers/common/Geometries.d.ts +39 -20
  250. three/src/renderers/common/Info.d.ts +62 -9
  251. three/src/renderers/common/InspectorBase.d.ts +19 -7
  252. three/src/renderers/common/Lighting.d.ts +2 -6
  253. three/src/renderers/common/Pipeline.d.ts +14 -2
  254. three/src/renderers/common/Pipelines.d.ts +58 -60
  255. three/src/renderers/common/PostProcessing.d.ts +14 -17
  256. three/src/renderers/common/ProgrammableStage.d.ts +48 -8
  257. three/src/renderers/common/RenderBundle.d.ts +4 -2
  258. three/src/renderers/common/RenderBundles.d.ts +6 -3
  259. three/src/renderers/common/RenderContext.d.ts +175 -7
  260. three/src/renderers/common/RenderContexts.d.ts +20 -25
  261. three/src/renderers/common/RenderList.d.ts +77 -11
  262. three/src/renderers/common/RenderLists.d.ts +16 -4
  263. three/src/renderers/common/RenderObject.d.ts +223 -47
  264. three/src/renderers/common/RenderObjectPipeline.d.ts +33 -0
  265. three/src/renderers/common/RenderObjects.d.ts +55 -22
  266. three/src/renderers/common/RenderPipeline.d.ts +20 -17
  267. three/src/renderers/common/Renderer.d.ts +625 -207
  268. three/src/renderers/common/Textures.d.ts +24 -46
  269. three/src/renderers/common/TimestampQueryPool.d.ts +62 -8
  270. three/src/renderers/common/Uniform.d.ts +143 -58
  271. three/src/renderers/common/UniformBuffer.d.ts +7 -5
  272. three/src/renderers/common/UniformsGroup.d.ts +50 -35
  273. three/src/renderers/common/XRManager.d.ts +321 -83
  274. three/src/renderers/common/XRRenderTarget.d.ts +49 -6
  275. three/src/renderers/common/nodes/NodeBuilderState.d.ts +75 -15
  276. three/src/renderers/common/nodes/NodeLibrary.d.ts +25 -5
  277. three/src/renderers/common/nodes/{Nodes.d.ts → NodeManager.d.ts} +54 -73
  278. three/src/renderers/common/nodes/NodeUniform.d.ts +60 -70
  279. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +23 -4
  280. three/src/renderers/shaders/UniformsLib.d.ts +0 -3
  281. three/src/renderers/webgl/WebGLAttributes.d.ts +9 -7
  282. three/src/renderers/webgl/WebGLEnvironments.d.ts +8 -0
  283. three/src/renderers/webgl/WebGLExtensions.d.ts +1 -1
  284. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +9 -5
  285. three/src/renderers/webgl/WebGLLights.d.ts +19 -18
  286. three/src/renderers/webgl/WebGLObjects.d.ts +15 -2
  287. three/src/renderers/webgl/WebGLProgram.d.ts +2 -10
  288. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -2
  289. three/src/renderers/webgl/WebGLRenderLists.d.ts +1 -3
  290. three/src/renderers/webgl/WebGLShadowMap.d.ts +0 -5
  291. three/src/renderers/webgl/WebGLState.d.ts +305 -28
  292. three/src/renderers/webgl/WebGLTextures.d.ts +10 -9
  293. three/src/renderers/webgl/WebGLUniforms.d.ts +0 -7
  294. three/src/renderers/webgpu/WebGPUBackend.d.ts +0 -1
  295. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +2 -4
  296. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +15 -4
  297. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +1 -1
  298. three/src/scenes/Fog.d.ts +31 -37
  299. three/src/scenes/FogExp2.d.ts +26 -31
  300. three/src/scenes/Scene.d.ts +51 -65
  301. three/src/textures/CompressedArrayTexture.d.ts +1 -1
  302. three/src/textures/DataArrayTexture.d.ts +1 -1
  303. three/src/utils.d.ts +5 -0
  304. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -18
  305. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +0 -13
  306. three/examples/jsm/shaders/GodRaysShader.d.ts +0 -44
  307. three/src/nodes/accessors/SceneNode.d.ts +0 -21
  308. three/src/nodes/code/ScriptableNode.d.ts +0 -21
  309. three/src/nodes/code/ScriptableValueNode.d.ts +0 -9
  310. three/src/nodes/display/PosterizeNode.d.ts +0 -13
  311. three/src/nodes/utils/SpriteSheetUVNode.d.ts +0 -15
  312. three/src/renderers/webgl/WebGLCubeMaps.d.ts +0 -8
  313. three/src/renderers/webgl/WebGLCubeUVMaps.d.ts +0 -9
@@ -1,96 +1,75 @@
1
1
  import { Object3D } from "../core/Object3D.js";
2
- import { AudioContext } from "./AudioContext.js";
3
2
 
4
3
  /**
5
- * The {@link AudioListener} represents a virtual {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioListener | listener} of the all positional and non-positional audio effects in the scene.
6
- * A three.js application usually creates a single instance of {@link AudioListener} * @remarks
7
- * It is a mandatory constructor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}.
8
- * In most cases, the listener object is a child of the camera
9
- * So the 3D transformation of the camera represents the 3D transformation of the listener.
10
- * @example
11
- * ```typescript
12
- * // create an {@link AudioListener} and add it to the camera
13
- * const listener = new THREE.AudioListener();
14
- * camera.add(listener);
15
- * // create a global audio source
16
- * const sound = new THREE.Audio(listener);
17
- * // load a sound and set it as the Audio object's buffer
18
- * const audioLoader = new THREE.AudioLoader();
19
- * audioLoader.load('sounds/ambient.ogg', function (buffer) {
20
- * sound.setBuffer(buffer);
21
- * sound.setLoop(true);
22
- * sound.setVolume(0.5);
23
- * sound.play();
24
- * });
25
- * ```
26
- * @see Example: {@link https://threejs.org/examples/#webaudio_sandbox | webaudio / sandbox }
27
- * @see Example: {@link https://threejs.org/examples/#webaudio_timing | webaudio / timing }
28
- * @see Example: {@link https://threejs.org/examples/#webaudio_visualizer | webaudio / visualizer }
29
- * @see {@link https://threejs.org/docs/index.html#api/en/audio/AudioListener | Official Documentation}
30
- * @see {@link https://github.com/mrdoob/three.js/blob/master/src/audio/AudioListener.js | Source}
4
+ * The class represents a virtual listener of the all positional and non-positional audio effects
5
+ * in the scene. A three.js application usually creates a single listener. It is a mandatory
6
+ * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}.
7
+ *
8
+ * In most cases, the listener object is a child of the camera. So the 3D transformation of the
9
+ * camera represents the 3D transformation of the listener.
31
10
  */
32
11
  export class AudioListener extends Object3D {
33
12
  /**
34
- * Create a new AudioListener.
13
+ * The native audio context.
35
14
  */
36
- constructor();
37
-
15
+ readonly context: AudioContext;
38
16
  /**
39
- * A Read-only _string_ to check if `this` object type.
40
- * @remarks Sub-classes will update this value.
41
- * @defaultValue `AudioListener`
17
+ * The gain node used for volume control.
42
18
  */
43
- readonly type: string | "AudioListener";
44
-
19
+ readonly gain: GainNode;
45
20
  /**
46
- * The {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioContext | AudioContext} of the {@link {@link AudioListener} | listener} given in the constructor.
21
+ * An optional filter.
22
+ *
23
+ * Defined via {@link AudioListener#setFilter}.
24
+ *
25
+ * @default null
47
26
  */
48
- context: AudioContext;
49
-
27
+ readonly filter: AudioNode | null;
50
28
  /**
51
- * A {@link https://developer.mozilla.org/en-US/docs/Web/API/GainNode | GainNode} created using
52
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain | AudioContext.createGain()}.
29
+ * Time delta values required for `linearRampToValueAtTime()` usage.
30
+ *
31
+ * @default 0
53
32
  */
54
- gain: GainNode;
55
-
56
- /**
57
- * @defaultValue `null`
58
- */
59
- filter: AudioNode;
60
-
33
+ readonly timeDelta: number;
61
34
  /**
62
- * Time delta value for audio entities. Use in context of {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime | AudioParam.linearRampToValueAtTimeDefault()}.
63
- * @defaultValue `0`
64
- */
65
- timeDelta: number;
66
-
67
- /**
68
- * Return the {@link AudioListener.gain | gainNode}.
35
+ * Returns the listener's input node.
36
+ *
37
+ * This method is used by other audio nodes to connect to this listener.
38
+ *
39
+ * @return {GainNode} The input node.
69
40
  */
70
41
  getInput(): GainNode;
71
42
  /**
72
- * Set the {@link AudioListener.filter | filter} property to `null`.
43
+ * Removes the current filter from this listener.
44
+ *
45
+ * @return {AudioListener} A reference to this listener.
73
46
  */
74
47
  removeFilter(): this;
75
-
76
48
  /**
77
- * Returns the value of the {@link AudioListener.filter | filter} property.
49
+ * Returns the current set filter.
50
+ *
51
+ * @return {?AudioNode} The filter.
78
52
  */
79
- getFilter(): AudioNode;
53
+ getFilter(): AudioNode | null;
80
54
  /**
81
- * Set the {@link AudioListener.filter | filter} property to `value`.
82
- * @param value
55
+ * Sets the given filter to this listener.
56
+ *
57
+ * @param {AudioNode} value - The filter to set.
58
+ * @return {AudioListener} A reference to this listener.
83
59
  */
84
60
  setFilter(value: AudioNode): this;
85
-
86
61
  /**
87
- * Return the volume.
62
+ * Returns the applications master volume.
63
+ *
64
+ * @return {number} The master volume.
88
65
  */
89
66
  getMasterVolume(): number;
90
-
91
67
  /**
92
- * Set the volume.
93
- * @param value
68
+ * Sets the applications master volume. This volume setting affects
69
+ * all audio nodes in the scene.
70
+ *
71
+ * @param {number} value - The master volume to set.
72
+ * @return {AudioListener} A reference to this listener.
94
73
  */
95
74
  setMasterVolume(value: number): this;
96
75
  }
@@ -1,101 +1,108 @@
1
1
  import { Audio } from "./Audio.js";
2
- import { AudioListener } from "./AudioListener.js";
3
2
 
4
3
  /**
5
- * Create a positional audio object.
6
- * This uses the {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API | Web Audio API}.
7
- * @example
8
- * ```typescript
4
+ * Represents a positional audio object.
5
+ *
6
+ * ```js
9
7
  * // create an AudioListener and add it to the camera
10
8
  * const listener = new THREE.AudioListener();
11
- * camera.add(listener);
12
- * // create the {@link PositionalAudio} object (passing in the listener)
13
- * const sound = new THREE.PositionalAudio(listener);
14
- * // load a sound and set it as the {@link PositionalAudio} object's buffer
9
+ * camera.add( listener );
10
+ *
11
+ * // create the PositionalAudio object (passing in the listener)
12
+ * const sound = new THREE.PositionalAudio( listener );
13
+ *
14
+ * // load a sound and set it as the PositionalAudio object's buffer
15
15
  * const audioLoader = new THREE.AudioLoader();
16
- * audioLoader.load('sounds/song.ogg', function (buffer) {
17
- * sound.setBuffer(buffer);
18
- * sound.setRefDistance(20);
19
- * sound.play();
16
+ * audioLoader.load( 'sounds/song.ogg', function( buffer ) {
17
+ * sound.setBuffer( buffer );
18
+ * sound.setRefDistance( 20 );
19
+ * sound.play();
20
20
  * });
21
+ *
21
22
  * // create an object for the sound to play from
22
- * const sphere = new THREE.SphereGeometry(20, 32, 16);
23
- * const material = new THREE.MeshPhongMaterial({
24
- * color: 0xff2200
25
- * });
26
- * const mesh = new THREE.Mesh(sphere, material);
27
- * scene.add(mesh);
23
+ * const sphere = new THREE.SphereGeometry( 20, 32, 16 );
24
+ * const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } );
25
+ * const mesh = new THREE.Mesh( sphere, material );
26
+ * scene.add( mesh );
27
+ *
28
28
  * // finally add the sound to the mesh
29
- * mesh.add(sound);
30
- * ```
31
- * @see Example: {@link https://threejs.org/examples/#webaudio_orientation | webaudio / orientation }
32
- * @see Example: {@link https://threejs.org/examples/#webaudio_sandbox | webaudio / sandbox }
33
- * @see Example: {@link https://threejs.org/examples/#webaudio_timing | webaudio / timing }
34
- * @see {@link https://threejs.org/docs/index.html#api/en/audio/PositionalAudio | Official Documentation}
35
- * @see {@link https://github.com/mrdoob/three.js/blob/master/src/audio/PositionalAudio.js | Source}
29
+ * mesh.add( sound );
36
30
  */
37
31
  export class PositionalAudio extends Audio<PannerNode> {
38
32
  /**
39
- * Create a new instance of {@link PositionalAudio}
40
- * @param listener (required) {@link AudioListener | AudioListener} instance.
41
- */
42
- constructor(listener: AudioListener);
43
-
44
- /**
45
- * The PositionalAudio's {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode | PannerNode}.
46
- */
47
- panner: PannerNode;
48
-
49
- /**
50
- * Returns the {@link PositionalAudio.panner | panner}.
33
+ * The panner node represents the location, direction, and behavior of an audio
34
+ * source in 3D space.
51
35
  */
52
- getOutput(): PannerNode;
53
-
36
+ readonly panner: PannerNode;
37
+ disconnect(): this;
54
38
  /**
55
- * Returns the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance | panner.refDistance}.
39
+ * Returns the current reference distance.
40
+ *
41
+ * @return {number} The reference distance.
56
42
  */
57
43
  getRefDistance(): number;
58
44
  /**
59
- * Sets the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/refDistance | panner.refDistance}.
60
- * @param value Expects a `Float`
45
+ * Defines the reference distance for reducing volume as the audio source moves
46
+ * further from the listener – i.e. the distance at which the volume reduction
47
+ * starts taking effect.
48
+ *
49
+ * @param {number} value - The reference distance to set.
50
+ * @return {PositionalAudio} A reference to this instance.
61
51
  */
62
52
  setRefDistance(value: number): this;
63
-
64
53
  /**
65
- * Returns the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor | panner.rolloffFactor}.
54
+ * Returns the current rolloff factor.
55
+ *
56
+ * @return {number} The rolloff factor.
66
57
  */
67
58
  getRolloffFactor(): number;
68
59
  /**
69
- * Sets the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/rolloffFactor | panner.rolloffFactor}.
70
- * @param value Expects a `Float`
60
+ * Defines how quickly the volume is reduced as the source moves away from the listener.
61
+ *
62
+ * @param {number} value - The rolloff factor.
63
+ * @return {PositionalAudio} A reference to this instance.
71
64
  */
72
65
  setRolloffFactor(value: number): this;
73
-
74
66
  /**
75
- * Returns the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel | panner.distanceModel}.
67
+ * Returns the current distance model.
68
+ *
69
+ * @return {('linear'|'inverse'|'exponential')} The distance model.
76
70
  */
77
- getDistanceModel(): string;
71
+ getDistanceModel(): "linear" | "inverse" | "exponential";
78
72
  /**
79
- * Sets the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel | panner.distanceModel}.
80
- * @param value
73
+ * Defines which algorithm to use to reduce the volume of the audio source
74
+ * as it moves away from the listener.
75
+ *
76
+ * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype)
77
+ * for more details.
78
+ *
79
+ * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.
80
+ * @return {PositionalAudio} A reference to this instance.
81
81
  */
82
- setDistanceModel(value: string): this;
83
-
82
+ setDistanceModel(value: "linear" | "inverse" | "exponential"): this;
84
83
  /**
85
- * Returns the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance | panner.maxDistance}.
84
+ * Returns the current max distance.
85
+ *
86
+ * @return {number} The max distance.
86
87
  */
87
88
  getMaxDistance(): number;
88
89
  /**
89
- * Sets the value of {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/maxDistance | panner.maxDistance}.
90
- * @param value Expects a `Float`
90
+ * Defines the maximum distance between the audio source and the listener,
91
+ * after which the volume is not reduced any further.
92
+ *
93
+ * This value is used only by the `linear` distance model.
94
+ *
95
+ * @param {number} value - The max distance.
96
+ * @return {PositionalAudio} A reference to this instance.
91
97
  */
92
98
  setMaxDistance(value: number): this;
93
-
94
99
  /**
95
- * This method can be used in order to transform an omnidirectional sound into a {@link https://developer.mozilla.org/en-US/docs/Web/API/PannerNode | directional sound}.
96
- * @param coneInnerAngle Expects a `Float`
97
- * @param coneOuterAngle Expects a `Float`
98
- * @param coneOuterGain Expects a `Float`
100
+ * Sets the directional cone in which the audio can be listened.
101
+ *
102
+ * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction.
103
+ * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter.
104
+ * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard.
105
+ * @return {PositionalAudio} A reference to this instance.
99
106
  */
100
107
  setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): this;
101
108
  }
@@ -1,38 +1,35 @@
1
1
  import { PerspectiveCamera } from "./PerspectiveCamera.js";
2
2
 
3
3
  /**
4
- * {@link ArrayCamera} can be used in order to efficiently render a scene with a predefined set of cameras
5
- * @remarks
6
- * This is an important performance aspect for rendering VR scenes.
7
- * An instance of {@link ArrayCamera} always has an array of sub cameras
8
- * It's mandatory to define for each sub camera the `viewport` property which determines the part of the viewport that is rendered with this camera.
9
- * @see Example: {@link https://threejs.org/examples/#webgl_camera_array | camera / array }
10
- * @see {@link https://threejs.org/docs/index.html#api/en/cameras/ArrayCamera | Official Documentation}
11
- * @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/ArrayCamera.js | Source}
4
+ * This type of camera can be used in order to efficiently render a scene with a
5
+ * predefined set of cameras. This is an important performance aspect for
6
+ * rendering VR scenes.
7
+ *
8
+ * An instance of `ArrayCamera` always has an array of sub cameras. It's mandatory
9
+ * to define for each sub camera the `viewport` property which determines the
10
+ * part of the viewport that is rendered with this camera.
12
11
  */
13
12
  export class ArrayCamera extends PerspectiveCamera {
14
13
  /**
15
- * Read-only flag to check if a given object is of type {@link ArrayCamera}.
16
- * @remarks This is a _constant_ value
17
- * @defaultValue `true`
14
+ * Constructs a new array camera.
15
+ *
16
+ * @param {Array<PerspectiveCamera>} [array=[]] - An array of perspective sub cameras.
18
17
  */
19
- readonly isArrayCamera: true;
20
-
18
+ constructor(array?: PerspectiveCamera[]);
21
19
  /**
22
- * Whether this camera is used with multiview rendering or not.
20
+ * This flag can be used for type testing.
21
+ *
22
+ * @default true
23
23
  */
24
- isMultiViewCamera: boolean;
25
-
24
+ readonly isArrayCamera: boolean;
26
25
  /**
27
- * An array of cameras.
28
- * @defaultValue `[]`
26
+ * Whether this camera is used with multiview rendering or not.
27
+ *
28
+ * @default false
29
29
  */
30
- cameras: PerspectiveCamera[];
31
-
32
- index: number;
33
-
30
+ readonly isMultiViewCamera: boolean;
34
31
  /**
35
- * An array of cameras.
32
+ * An array of perspective sub cameras.
36
33
  */
37
- constructor(cameras?: PerspectiveCamera[]);
34
+ cameras: PerspectiveCamera[];
38
35
  }
@@ -1,81 +1,42 @@
1
1
  import { CoordinateSystem } from "../constants.js";
2
- import { Layers } from "../core/Layers.js";
3
2
  import { Object3D } from "../core/Object3D.js";
4
3
  import { Matrix4 } from "../math/Matrix4.js";
5
- import { Vector3 } from "../math/Vector3.js";
6
4
  import { Vector4 } from "../math/Vector4.js";
7
5
 
8
6
  /**
9
- * Abstract base class for cameras
10
- * @remarks
11
- * This class should always be inherited when you build a new camera.
12
- * @see {@link https://threejs.org/docs/index.html#api/en/cameras/Camera | Official Documentation}
13
- * @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/Camera.js | Source}
7
+ * Abstract base class for cameras. This class should always be inherited
8
+ * when you build a new camera.
14
9
  */
15
10
  export class Camera extends Object3D {
16
11
  /**
17
- * Read-only flag to check if a given object is of type {@link Camera}.
18
- * @remarks This is a _constant_ value
19
- * @defaultValue `true`
20
- */
21
- readonly isCamera: true;
22
-
23
- /**
24
- * @override
25
- * @defaultValue `Camera`
26
- */
27
- override readonly type: string | "Camera";
28
-
29
- /**
30
- * @override
31
- * The {@link Layers | layers} that the {@link Camera} is a member of.
32
- * @remarks Objects must share at least one layer with the {@link Camera} to be n when the camera's viewpoint is rendered.
33
- * @defaultValue `new THREE.Layers()`
12
+ * This flag can be used for type testing.
13
+ *
14
+ * @default true
34
15
  */
35
- override layers: Layers;
36
-
16
+ readonly isCamera: boolean;
37
17
  /**
38
- * This is the inverse of matrixWorld.
39
- * @remarks MatrixWorld contains the Matrix which has the world transform of the {@link Camera} .
40
- * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
18
+ * The inverse of the camera's world matrix.
41
19
  */
42
20
  matrixWorldInverse: Matrix4;
43
-
44
21
  /**
45
- * This is the matrix which contains the projection.
46
- * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
22
+ * The camera's projection matrix.
47
23
  */
48
24
  projectionMatrix: Matrix4;
49
-
50
25
  /**
51
- * This is the inverse of projectionMatrix.
52
- * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
26
+ * The inverse of the camera's projection matrix.
53
27
  */
54
28
  projectionMatrixInverse: Matrix4;
55
-
56
- coordinateSystem: CoordinateSystem;
57
-
58
- viewport?: Vector4;
59
-
60
29
  /**
61
- * @remarks
62
- * Note that this class is not intended to be called directly; you probably want a
63
- * {@link PerspectiveCamera | PerspectiveCamera} or
64
- * {@link OrthographicCamera | OrthographicCamera} instead.
30
+ * The coordinate system in which the camera is used.
65
31
  */
66
- constructor();
67
-
32
+ coordinateSystem: CoordinateSystem;
33
+ viewport?: Vector4;
68
34
  /**
69
35
  * The flag that indicates whether the camera uses a reversed depth buffer.
70
36
  *
71
37
  * @default false
72
38
  */
73
39
  get reversedDepth(): boolean;
74
-
75
- /**
76
- * Returns a {@link Vector3 | Vector3} representing the world space direction in which the {@link Camera} is looking.
77
- * @remarks Note: A {@link Camera} looks down its local, negative z-axis.
78
- * @param target The result will be copied into this Vector3.
79
- */
80
- getWorldDirection(target: Vector3): Vector3;
40
+ copy(source: Camera, recursive?: boolean): this;
41
+ clone(): this;
81
42
  }
@@ -1,6 +1,7 @@
1
1
  import { CoordinateSystem } from "../constants.js";
2
2
  import { Object3D } from "../core/Object3D.js";
3
3
  import { RenderTarget } from "../core/RenderTarget.js";
4
+ import CubeRenderTarget from "../renderers/common/CubeRenderTarget.js";
4
5
  import { WebGLCubeRenderTarget } from "../renderers/WebGLCubeRenderTarget.js";
5
6
  import { Camera } from "./Camera.js";
6
7
 
@@ -21,12 +22,13 @@ export interface CubeCameraRenderer {
21
22
  }
22
23
 
23
24
  /**
24
- * Creates **6** {@link THREE.PerspectiveCamera | cameras} that render to a {@link THREE.WebGLCubeRenderTarget | WebGLCubeRenderTarget}.
25
- * @remarks The cameras are added to the {@link children} array.
26
- * @example
27
- * ```typescript
25
+ * A special type of camera that is positioned in 3D space to render its surroundings into a
26
+ * cube render target. The render target can then be used as an environment map for rendering
27
+ * realtime reflections in your scene.
28
+ *
29
+ * ```js
28
30
  * // Create cube render target
29
- * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 128, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
31
+ * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 256, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );
30
32
  *
31
33
  * // Create cube camera
32
34
  * const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );
@@ -46,40 +48,42 @@ export interface CubeCameraRenderer {
46
48
  * car.visible = true;
47
49
  * renderer.render( scene, camera );
48
50
  * ```
49
- * @see Example: {@link https://threejs.org/examples/#webgl_materials_cubemap_dynamic | materials / cubemap / dynamic }
50
- * @see {@link https://threejs.org/docs/index.html#api/en/cameras/CubeCamera | Official Documentation}
51
- * @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/CubeCamera.js | Source}
52
51
  */
53
52
  export class CubeCamera extends Object3D {
54
53
  /**
55
- * Constructs a {@link CubeCamera} that contains 6 {@link PerspectiveCamera | PerspectiveCameras} that render to a {@link THREE.WebGLCubeRenderTarget | WebGLCubeRenderTarget}.
56
- * @param near The near clipping distance.
57
- * @param far The far clipping distance.
58
- * @param renderTarget The destination cube render target.
54
+ * Constructs a new cube camera.
55
+ *
56
+ * @param {number} near - The camera's near plane.
57
+ * @param {number} far - The camera's far plane.
58
+ * @param {WebGLCubeRenderTarget} renderTarget - The cube render target.
59
59
  */
60
- constructor(near: number, far: number, renderTarget: WebGLCubeRenderTarget);
61
-
60
+ constructor(near: number, far: number, renderTarget: WebGLCubeRenderTarget | CubeRenderTarget);
62
61
  /**
63
- * @override
64
- * @defaultValue `CubeCamera`
62
+ * A reference to the cube render target.
65
63
  */
66
- override readonly type: string | "CubeCamera";
67
-
64
+ renderTarget: WebGLCubeRenderTarget;
68
65
  /**
69
- * The destination cube render target.
66
+ * The current active coordinate system.
67
+ *
68
+ * @default null
69
+ */
70
+ coordinateSystem: CoordinateSystem | null;
71
+ /**
72
+ * The current active mipmap level
73
+ *
74
+ * @default 0
70
75
  */
71
- renderTarget: WebGLCubeRenderTarget;
72
-
73
- coordinateSystem: CoordinateSystem;
74
-
75
76
  activeMipmapLevel: number;
76
-
77
+ /**
78
+ * Must be called when the coordinate system of the cube camera is changed.
79
+ */
77
80
  updateCoordinateSystem(): void;
78
-
79
81
  /**
80
- * Call this to update the {@link CubeCamera.renderTarget | renderTarget}.
81
- * @param renderer The current WebGL renderer
82
- * @param scene The current scene
82
+ * Calling this method will render the given scene with the given renderer
83
+ * into the cube render target of the camera.
84
+ *
85
+ * @param {(Renderer|WebGLRenderer)} renderer - The renderer.
86
+ * @param {Scene} scene - The scene to render.
83
87
  */
84
88
  update(renderer: CubeCameraRenderer, scene: Object3D): void;
85
89
  }