super-three 0.177.0 → 0.181.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 (501) hide show
  1. package/README.md +1 -1
  2. package/build/three.cjs +1994 -749
  3. package/build/three.core.js +1358 -506
  4. package/build/three.core.min.js +1 -1
  5. package/build/three.module.js +631 -247
  6. package/build/three.module.min.js +1 -1
  7. package/build/three.tsl.js +113 -33
  8. package/build/three.tsl.min.js +1 -1
  9. package/build/three.webgpu.js +9571 -3424
  10. package/build/three.webgpu.min.js +1 -1
  11. package/build/three.webgpu.nodes.js +9397 -3426
  12. package/build/three.webgpu.nodes.min.js +1 -1
  13. package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
  14. package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
  15. package/examples/jsm/Addons.js +2 -3
  16. package/examples/jsm/animation/CCDIKSolver.js +1 -1
  17. package/examples/jsm/capabilities/WebGL.js +0 -27
  18. package/examples/jsm/capabilities/WebGPU.js +1 -1
  19. package/examples/jsm/controls/ArcballControls.js +9 -9
  20. package/examples/jsm/controls/DragControls.js +7 -57
  21. package/examples/jsm/controls/FirstPersonControls.js +3 -3
  22. package/examples/jsm/controls/FlyControls.js +1 -1
  23. package/examples/jsm/controls/OrbitControls.js +2 -2
  24. package/examples/jsm/controls/PointerLockControls.js +2 -10
  25. package/examples/jsm/controls/TrackballControls.js +1 -1
  26. package/examples/jsm/controls/TransformControls.js +62 -15
  27. package/examples/jsm/csm/CSMShadowNode.js +4 -4
  28. package/examples/jsm/effects/AsciiEffect.js +8 -8
  29. package/examples/jsm/environments/RoomEnvironment.js +8 -3
  30. package/examples/jsm/exporters/DRACOExporter.js +2 -2
  31. package/examples/jsm/exporters/EXRExporter.js +1 -1
  32. package/examples/jsm/exporters/GLTFExporter.js +33 -25
  33. package/examples/jsm/exporters/KTX2Exporter.js +4 -2
  34. package/examples/jsm/exporters/PLYExporter.js +1 -1
  35. package/examples/jsm/exporters/USDZExporter.js +683 -299
  36. package/examples/jsm/geometries/DecalGeometry.js +2 -2
  37. package/examples/jsm/geometries/ParametricGeometry.js +1 -1
  38. package/examples/jsm/geometries/RoundedBoxGeometry.js +47 -8
  39. package/examples/jsm/geometries/TeapotGeometry.js +2 -2
  40. package/examples/jsm/geometries/TextGeometry.js +3 -2
  41. package/examples/jsm/gpgpu/BitonicSort.js +715 -0
  42. package/examples/jsm/helpers/ViewHelper.js +43 -5
  43. package/examples/jsm/inspector/Inspector.js +427 -0
  44. package/examples/jsm/inspector/RendererInspector.js +415 -0
  45. package/examples/jsm/inspector/tabs/Console.js +204 -0
  46. package/examples/jsm/inspector/tabs/Parameters.js +332 -0
  47. package/examples/jsm/inspector/tabs/Performance.js +268 -0
  48. package/examples/jsm/inspector/tabs/Viewer.js +166 -0
  49. package/examples/jsm/inspector/ui/Graph.js +95 -0
  50. package/examples/jsm/inspector/ui/Item.js +170 -0
  51. package/examples/jsm/inspector/ui/List.js +75 -0
  52. package/examples/jsm/inspector/ui/Profiler.js +170 -0
  53. package/examples/jsm/inspector/ui/Style.js +654 -0
  54. package/examples/jsm/inspector/ui/Tab.js +46 -0
  55. package/examples/jsm/inspector/ui/Values.js +423 -0
  56. package/examples/jsm/inspector/ui/utils.js +56 -0
  57. package/examples/jsm/interactive/HTMLMesh.js +11 -13
  58. package/examples/jsm/interactive/InteractiveGroup.js +1 -1
  59. package/examples/jsm/interactive/SelectionBox.js +30 -0
  60. package/examples/jsm/libs/ktx-parse.module.js +1 -1
  61. package/examples/jsm/libs/meshopt_decoder.module.js +75 -58
  62. package/examples/jsm/lights/LightProbeGenerator.js +14 -3
  63. package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
  64. package/examples/jsm/lines/Line2.js +3 -3
  65. package/examples/jsm/lines/LineGeometry.js +1 -1
  66. package/examples/jsm/lines/LineSegments2.js +2 -2
  67. package/examples/jsm/lines/Wireframe.js +2 -2
  68. package/examples/jsm/lines/WireframeGeometry2.js +1 -1
  69. package/examples/jsm/lines/webgpu/LineSegments2.js +1 -1
  70. package/examples/jsm/lines/webgpu/Wireframe.js +1 -1
  71. package/examples/jsm/loaders/3MFLoader.js +1 -1
  72. package/examples/jsm/loaders/ColladaLoader.js +4 -4
  73. package/examples/jsm/loaders/DDSLoader.js +1 -1
  74. package/examples/jsm/loaders/DRACOLoader.js +73 -22
  75. package/examples/jsm/loaders/EXRLoader.js +210 -22
  76. package/examples/jsm/loaders/FBXLoader.js +4 -4
  77. package/examples/jsm/loaders/FontLoader.js +23 -5
  78. package/examples/jsm/loaders/GLTFLoader.js +14 -8
  79. package/examples/jsm/loaders/HDRCubeTextureLoader.js +5 -5
  80. package/examples/jsm/loaders/HDRLoader.js +486 -0
  81. package/examples/jsm/loaders/KTX2Loader.js +136 -49
  82. package/examples/jsm/loaders/KTXLoader.js +2 -2
  83. package/examples/jsm/loaders/LDrawLoader.js +1 -1
  84. package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
  85. package/examples/jsm/loaders/LUTCubeLoader.js +1 -1
  86. package/examples/jsm/loaders/LWOLoader.js +2 -2
  87. package/examples/jsm/loaders/MaterialXLoader.js +233 -34
  88. package/examples/jsm/loaders/OBJLoader.js +1 -1
  89. package/examples/jsm/loaders/PDBLoader.js +1 -1
  90. package/examples/jsm/loaders/RGBELoader.js +7 -473
  91. package/examples/jsm/loaders/SVGLoader.js +2 -2
  92. package/examples/jsm/loaders/TTFLoader.js +13 -1
  93. package/examples/jsm/loaders/USDLoader.js +219 -0
  94. package/examples/jsm/loaders/USDZLoader.js +4 -892
  95. package/examples/jsm/loaders/UltraHDRLoader.js +2 -2
  96. package/examples/jsm/loaders/lwo/IFFParser.js +1 -1
  97. package/examples/jsm/loaders/usd/USDAParser.js +741 -0
  98. package/examples/jsm/loaders/usd/USDCParser.js +17 -0
  99. package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
  100. package/examples/jsm/math/ColorSpaces.js +19 -1
  101. package/examples/jsm/math/ConvexHull.js +3 -3
  102. package/examples/jsm/math/ImprovedNoise.js +1 -1
  103. package/examples/jsm/math/Lut.js +2 -2
  104. package/examples/jsm/math/SimplexNoise.js +1 -1
  105. package/examples/jsm/misc/MD2CharacterComplex.js +1 -1
  106. package/examples/jsm/misc/ProgressiveLightMap.js +9 -3
  107. package/examples/jsm/misc/ProgressiveLightMapGPU.js +7 -1
  108. package/examples/jsm/misc/TubePainter.js +383 -40
  109. package/examples/jsm/misc/Volume.js +1 -1
  110. package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
  111. package/examples/jsm/objects/LensflareMesh.js +3 -3
  112. package/examples/jsm/objects/ReflectorForSSRPass.js +1 -0
  113. package/examples/jsm/objects/Sky.js +1 -1
  114. package/examples/jsm/objects/SkyMesh.js +3 -3
  115. package/examples/jsm/objects/Water.js +3 -3
  116. package/examples/jsm/objects/WaterMesh.js +6 -6
  117. package/examples/jsm/physics/RapierPhysics.js +95 -16
  118. package/examples/jsm/postprocessing/GTAOPass.js +10 -9
  119. package/examples/jsm/postprocessing/GlitchPass.js +2 -2
  120. package/examples/jsm/postprocessing/OutlinePass.js +17 -17
  121. package/examples/jsm/postprocessing/SSAOPass.js +10 -9
  122. package/examples/jsm/postprocessing/SSRPass.js +37 -8
  123. package/examples/jsm/postprocessing/UnrealBloomPass.js +8 -6
  124. package/examples/jsm/renderers/CSS2DRenderer.js +16 -5
  125. package/examples/jsm/renderers/CSS3DRenderer.js +7 -6
  126. package/examples/jsm/renderers/SVGRenderer.js +1 -1
  127. package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +1 -1
  128. package/examples/jsm/shaders/AfterimageShader.js +1 -1
  129. package/examples/jsm/shaders/BleachBypassShader.js +1 -1
  130. package/examples/jsm/shaders/BokehShader.js +1 -1
  131. package/examples/jsm/shaders/BokehShader2.js +1 -1
  132. package/examples/jsm/shaders/DotScreenShader.js +1 -1
  133. package/examples/jsm/shaders/FocusShader.js +1 -1
  134. package/examples/jsm/shaders/GTAOShader.js +2 -2
  135. package/examples/jsm/shaders/GodRaysShader.js +1 -1
  136. package/examples/jsm/shaders/KaleidoShader.js +1 -1
  137. package/examples/jsm/shaders/PoissonDenoiseShader.js +2 -2
  138. package/examples/jsm/shaders/SSRShader.js +1 -1
  139. package/examples/jsm/shaders/SepiaShader.js +1 -1
  140. package/examples/jsm/shaders/SubsurfaceScatteringShader.js +1 -1
  141. package/examples/jsm/shaders/TriangleBlurShader.js +1 -1
  142. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +11 -2
  143. package/examples/jsm/shaders/VignetteShader.js +1 -1
  144. package/examples/jsm/transpiler/AST.js +381 -30
  145. package/examples/jsm/transpiler/GLSLDecoder.js +247 -104
  146. package/examples/jsm/transpiler/Linker.js +327 -0
  147. package/examples/jsm/transpiler/TSLEncoder.js +196 -92
  148. package/examples/jsm/transpiler/Transpiler.js +17 -1
  149. package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
  150. package/examples/jsm/transpiler/WGSLEncoder.js +812 -0
  151. package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
  152. package/examples/jsm/tsl/display/AnamorphicNode.js +28 -4
  153. package/examples/jsm/tsl/display/BloomNode.js +11 -6
  154. package/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
  155. package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
  156. package/examples/jsm/tsl/display/DepthOfFieldNode.js +446 -90
  157. package/examples/jsm/tsl/display/GTAONode.js +53 -5
  158. package/examples/jsm/tsl/display/GaussianBlurNode.js +55 -43
  159. package/examples/jsm/tsl/display/OutlineNode.js +13 -2
  160. package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
  161. package/examples/jsm/tsl/display/SSGINode.js +654 -0
  162. package/examples/jsm/tsl/display/SSRNode.js +182 -65
  163. package/examples/jsm/tsl/display/SSSNode.js +488 -0
  164. package/examples/jsm/tsl/display/TRAANode.js +578 -0
  165. package/examples/jsm/tsl/display/boxBlur.js +65 -0
  166. package/examples/jsm/tsl/display/hashBlur.js +18 -20
  167. package/examples/jsm/tsl/lighting/TiledLightsNode.js +22 -2
  168. package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
  169. package/examples/jsm/utils/ShadowMapViewerGPU.js +12 -5
  170. package/examples/jsm/webxr/OculusHandModel.js +1 -1
  171. package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
  172. package/examples/jsm/webxr/XRHandModelFactory.js +2 -6
  173. package/package.json +5 -10
  174. package/src/Three.Core.js +5 -2
  175. package/src/Three.TSL.js +112 -32
  176. package/src/Three.WebGPU.Nodes.js +2 -0
  177. package/src/Three.WebGPU.js +4 -0
  178. package/src/animation/AnimationClip.js +20 -4
  179. package/src/animation/AnimationMixer.js +3 -3
  180. package/src/animation/AnimationObjectGroup.js +2 -1
  181. package/src/animation/KeyframeTrack.js +8 -7
  182. package/src/animation/PropertyBinding.js +12 -11
  183. package/src/animation/tracks/BooleanKeyframeTrack.js +1 -1
  184. package/src/animation/tracks/StringKeyframeTrack.js +1 -1
  185. package/src/audio/Audio.js +10 -9
  186. package/src/audio/PositionalAudio.js +1 -1
  187. package/src/cameras/Camera.js +14 -0
  188. package/src/cameras/OrthographicCamera.js +2 -2
  189. package/src/cameras/PerspectiveCamera.js +2 -2
  190. package/src/cameras/StereoCamera.js +2 -2
  191. package/src/constants.js +13 -5
  192. package/src/core/BufferAttribute.js +3 -3
  193. package/src/core/BufferGeometry.js +10 -10
  194. package/src/core/Clock.js +2 -8
  195. package/src/core/EventDispatcher.js +1 -1
  196. package/src/core/GLBufferAttribute.js +13 -1
  197. package/src/core/InterleavedBuffer.js +1 -1
  198. package/src/core/InterleavedBufferAttribute.js +3 -2
  199. package/src/core/Object3D.js +4 -3
  200. package/src/core/Raycaster.js +2 -1
  201. package/src/core/RenderTarget.js +10 -1
  202. package/{examples/jsm/misc → src/core}/Timer.js +4 -42
  203. package/src/extras/Controls.js +5 -4
  204. package/src/extras/DataUtils.js +2 -1
  205. package/src/extras/Earcut.js +6 -0
  206. package/src/extras/ImageUtils.js +2 -2
  207. package/src/extras/PMREMGenerator.js +279 -55
  208. package/src/extras/TextureUtils.js +2 -1
  209. package/src/extras/core/Curve.js +2 -1
  210. package/src/extras/core/Interpolations.js +7 -1
  211. package/src/extras/core/Path.js +22 -22
  212. package/src/extras/core/ShapePath.js +4 -4
  213. package/src/extras/lib/earcut.js +8 -8
  214. package/src/geometries/BoxGeometry.js +1 -0
  215. package/src/geometries/CapsuleGeometry.js +1 -0
  216. package/src/geometries/CircleGeometry.js +1 -0
  217. package/src/geometries/ConeGeometry.js +1 -0
  218. package/src/geometries/CylinderGeometry.js +1 -0
  219. package/src/geometries/DodecahedronGeometry.js +1 -0
  220. package/src/geometries/ExtrudeGeometry.js +8 -6
  221. package/src/geometries/IcosahedronGeometry.js +1 -0
  222. package/src/geometries/LatheGeometry.js +1 -0
  223. package/src/geometries/OctahedronGeometry.js +1 -0
  224. package/src/geometries/PlaneGeometry.js +1 -0
  225. package/src/geometries/RingGeometry.js +1 -0
  226. package/src/geometries/ShapeGeometry.js +1 -0
  227. package/src/geometries/SphereGeometry.js +1 -0
  228. package/src/geometries/TetrahedronGeometry.js +1 -0
  229. package/src/geometries/TorusGeometry.js +1 -0
  230. package/src/geometries/TorusKnotGeometry.js +1 -0
  231. package/src/geometries/TubeGeometry.js +1 -0
  232. package/src/helpers/CameraHelper.js +42 -12
  233. package/src/helpers/SkeletonHelper.js +35 -6
  234. package/src/lights/LightShadow.js +21 -8
  235. package/src/lights/PointLightShadow.js +1 -1
  236. package/src/lights/webgpu/ProjectorLight.js +1 -1
  237. package/src/loaders/AnimationLoader.js +2 -1
  238. package/src/loaders/AudioLoader.js +2 -1
  239. package/src/loaders/BufferGeometryLoader.js +2 -2
  240. package/src/loaders/Cache.js +2 -2
  241. package/src/loaders/DataTextureLoader.js +1 -1
  242. package/src/loaders/FileLoader.js +29 -5
  243. package/src/loaders/ImageBitmapLoader.js +32 -8
  244. package/src/loaders/ImageLoader.js +56 -9
  245. package/src/loaders/Loader.js +17 -3
  246. package/src/loaders/LoadingManager.js +45 -0
  247. package/src/loaders/MaterialLoader.js +3 -2
  248. package/src/loaders/ObjectLoader.js +13 -13
  249. package/src/loaders/TextureLoader.js +1 -1
  250. package/src/loaders/nodes/NodeLoader.js +3 -2
  251. package/src/materials/Material.js +16 -3
  252. package/src/materials/MeshBasicMaterial.js +2 -1
  253. package/src/materials/MeshDepthMaterial.js +1 -0
  254. package/src/materials/MeshDistanceMaterial.js +1 -1
  255. package/src/materials/MeshLambertMaterial.js +2 -1
  256. package/src/materials/MeshMatcapMaterial.js +22 -0
  257. package/src/materials/MeshNormalMaterial.js +1 -0
  258. package/src/materials/MeshPhongMaterial.js +2 -1
  259. package/src/materials/MeshPhysicalMaterial.js +2 -1
  260. package/src/materials/MeshStandardMaterial.js +8 -7
  261. package/src/materials/MeshToonMaterial.js +1 -0
  262. package/src/materials/PointsMaterial.js +1 -1
  263. package/src/materials/ShaderMaterial.js +2 -2
  264. package/src/materials/nodes/Line2NodeMaterial.js +2 -10
  265. package/src/materials/nodes/MeshBasicNodeMaterial.js +4 -3
  266. package/src/materials/nodes/MeshMatcapNodeMaterial.js +1 -1
  267. package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
  268. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -1
  269. package/src/materials/nodes/MeshSSSNodeMaterial.js +3 -3
  270. package/src/materials/nodes/NodeMaterial.js +90 -27
  271. package/src/materials/nodes/PointsNodeMaterial.js +86 -28
  272. package/src/materials/nodes/SpriteNodeMaterial.js +3 -15
  273. package/src/materials/nodes/manager/NodeMaterialObserver.js +89 -3
  274. package/src/math/Color.js +6 -5
  275. package/src/math/ColorManagement.js +9 -3
  276. package/src/math/Cylindrical.js +1 -1
  277. package/src/math/Euler.js +2 -1
  278. package/src/math/Frustum.js +25 -9
  279. package/src/math/FrustumArray.js +10 -5
  280. package/src/math/Line3.js +129 -2
  281. package/src/math/MathUtils.js +13 -11
  282. package/src/math/Matrix2.js +1 -1
  283. package/src/math/Matrix3.js +2 -2
  284. package/src/math/Matrix4.js +55 -34
  285. package/src/math/Plane.js +1 -1
  286. package/src/math/Quaternion.js +69 -67
  287. package/src/math/Spherical.js +3 -3
  288. package/src/nodes/Nodes.js +6 -4
  289. package/src/nodes/TSL.js +9 -4
  290. package/src/nodes/accessors/AccessorsUtils.js +7 -8
  291. package/src/nodes/accessors/Bitangent.js +31 -25
  292. package/src/nodes/accessors/BufferNode.js +1 -1
  293. package/src/nodes/accessors/Camera.js +142 -16
  294. package/src/nodes/accessors/ClippingNode.js +6 -5
  295. package/src/nodes/accessors/CubeTextureNode.js +5 -4
  296. package/src/nodes/accessors/InstanceNode.js +25 -5
  297. package/src/nodes/accessors/Lights.js +10 -0
  298. package/src/nodes/accessors/Normal.js +97 -30
  299. package/src/nodes/accessors/Object3DNode.js +2 -2
  300. package/src/nodes/accessors/Position.js +25 -9
  301. package/src/nodes/accessors/ReferenceBaseNode.js +1 -1
  302. package/src/nodes/accessors/ReferenceNode.js +20 -4
  303. package/src/nodes/accessors/ReflectVector.js +3 -3
  304. package/src/nodes/accessors/SceneNode.js +3 -2
  305. package/src/nodes/accessors/StorageBufferNode.js +2 -1
  306. package/src/nodes/accessors/StorageTextureNode.js +23 -1
  307. package/src/nodes/accessors/Tangent.js +25 -17
  308. package/src/nodes/accessors/TangentUtils.js +46 -0
  309. package/src/nodes/accessors/Texture3DNode.js +14 -1
  310. package/src/nodes/accessors/TextureBicubic.js +21 -3
  311. package/src/nodes/accessors/TextureNode.js +142 -44
  312. package/src/nodes/accessors/UniformArrayNode.js +0 -16
  313. package/src/nodes/code/FunctionCallNode.js +24 -4
  314. package/src/nodes/code/FunctionNode.js +23 -0
  315. package/src/nodes/core/ArrayNode.js +13 -0
  316. package/src/nodes/core/AssignNode.js +6 -2
  317. package/src/nodes/core/AttributeNode.js +2 -1
  318. package/src/nodes/core/ContextNode.js +48 -10
  319. package/src/nodes/core/IndexNode.js +2 -2
  320. package/src/nodes/core/InputNode.js +2 -1
  321. package/src/nodes/core/InspectorNode.js +128 -0
  322. package/src/nodes/core/{CacheNode.js → IsolateNode.js} +36 -17
  323. package/src/nodes/core/Node.js +167 -34
  324. package/src/nodes/core/NodeBuilder.js +404 -120
  325. package/src/nodes/core/NodeFrame.js +21 -21
  326. package/src/nodes/core/NodeFunction.js +2 -1
  327. package/src/nodes/core/NodeParser.js +2 -1
  328. package/src/nodes/core/NodeUniform.js +1 -1
  329. package/src/nodes/core/NodeUtils.js +17 -88
  330. package/src/nodes/core/ParameterNode.js +31 -0
  331. package/src/nodes/core/PropertyNode.js +7 -0
  332. package/src/nodes/core/StackNode.js +77 -30
  333. package/src/nodes/core/StructNode.js +5 -5
  334. package/src/nodes/core/StructTypeNode.js +1 -0
  335. package/src/nodes/core/SubBuildNode.js +89 -0
  336. package/src/nodes/core/UniformNode.js +80 -14
  337. package/src/nodes/core/VarNode.js +142 -16
  338. package/src/nodes/core/VaryingNode.js +9 -6
  339. package/src/nodes/display/BlendModes.js +7 -6
  340. package/src/nodes/display/BumpMapNode.js +1 -1
  341. package/src/nodes/display/ColorAdjustment.js +1 -1
  342. package/src/nodes/display/FrontFacingNode.js +35 -7
  343. package/src/nodes/display/NormalMapNode.js +20 -50
  344. package/src/nodes/display/PassNode.js +206 -17
  345. package/src/nodes/display/RenderOutputNode.js +28 -2
  346. package/src/nodes/display/ScreenNode.js +44 -40
  347. package/src/nodes/display/ToneMappingNode.js +31 -4
  348. package/src/nodes/display/ToonOutlinePassNode.js +8 -0
  349. package/src/nodes/display/ViewportDepthTextureNode.js +16 -4
  350. package/src/nodes/display/ViewportSharedTextureNode.js +12 -0
  351. package/src/nodes/display/ViewportTextureNode.js +94 -4
  352. package/src/nodes/fog/Fog.js +3 -2
  353. package/src/nodes/functions/BSDF/BRDF_GGX.js +2 -6
  354. package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
  355. package/src/nodes/functions/BSDF/BRDF_Sheen.js +4 -4
  356. package/src/nodes/functions/BSDF/DFGApprox.js +60 -19
  357. package/src/nodes/functions/BasicLightingModel.js +2 -1
  358. package/src/nodes/functions/PhongLightingModel.js +3 -3
  359. package/src/nodes/functions/PhysicalLightingModel.js +19 -18
  360. package/src/nodes/functions/VolumetricLightingModel.js +5 -5
  361. package/src/nodes/functions/material/getGeometryRoughness.js +2 -2
  362. package/src/nodes/geometry/RangeNode.js +40 -4
  363. package/src/nodes/gpgpu/AtomicFunctionNode.js +1 -1
  364. package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -1
  365. package/src/nodes/gpgpu/ComputeNode.js +81 -25
  366. package/src/nodes/gpgpu/SubgroupFunctionNode.js +455 -0
  367. package/src/nodes/gpgpu/WorkgroupInfoNode.js +29 -3
  368. package/src/nodes/lighting/EnvironmentNode.js +11 -11
  369. package/src/nodes/lighting/LightsNode.js +7 -8
  370. package/src/nodes/lighting/PointShadowNode.js +6 -0
  371. package/src/nodes/lighting/ProjectorLightNode.js +19 -6
  372. package/src/nodes/lighting/ShadowFilterNode.js +3 -1
  373. package/src/nodes/lighting/ShadowNode.js +77 -10
  374. package/src/nodes/materialx/MaterialXNodes.js +131 -2
  375. package/src/nodes/materialx/lib/mx_noise.js +165 -1
  376. package/src/nodes/math/BitcastNode.js +156 -0
  377. package/src/nodes/math/ConditionalNode.js +25 -27
  378. package/src/nodes/math/MathNode.js +106 -65
  379. package/src/nodes/math/OperatorNode.js +28 -43
  380. package/src/nodes/pmrem/PMREMUtils.js +117 -2
  381. package/src/nodes/shapes/Shapes.js +1 -1
  382. package/src/nodes/tsl/TSLBase.js +6 -2
  383. package/src/nodes/tsl/TSLCore.js +546 -186
  384. package/src/nodes/utils/DebugNode.js +3 -2
  385. package/src/nodes/utils/EquirectUV.js +27 -0
  386. package/src/nodes/utils/EventNode.js +119 -0
  387. package/src/nodes/utils/FunctionOverloadingNode.js +37 -19
  388. package/src/nodes/utils/JoinNode.js +6 -3
  389. package/src/nodes/utils/LoopNode.js +20 -41
  390. package/src/nodes/utils/MatcapUV.js +22 -0
  391. package/src/nodes/utils/MemberNode.js +59 -7
  392. package/src/nodes/utils/PostProcessingUtils.js +28 -1
  393. package/src/nodes/utils/RTTNode.js +33 -6
  394. package/src/nodes/utils/ReflectorNode.js +68 -10
  395. package/src/nodes/utils/SampleNode.js +91 -0
  396. package/src/nodes/utils/SplitNode.js +11 -0
  397. package/src/nodes/utils/Timer.js +0 -47
  398. package/src/nodes/utils/TriplanarTextures.js +65 -0
  399. package/src/objects/BatchedMesh.js +6 -4
  400. package/src/objects/LOD.js +1 -1
  401. package/src/objects/Line.js +2 -1
  402. package/src/objects/LineSegments.js +2 -1
  403. package/src/objects/Skeleton.js +3 -2
  404. package/src/objects/SkinnedMesh.js +3 -1
  405. package/src/objects/Sprite.js +4 -3
  406. package/src/renderers/WebGLRenderer.js +77 -66
  407. package/src/renderers/common/Animation.js +13 -1
  408. package/src/renderers/common/Attributes.js +1 -1
  409. package/src/renderers/common/Backend.js +108 -27
  410. package/src/renderers/common/Background.js +4 -3
  411. package/src/renderers/common/Bindings.js +76 -19
  412. package/src/renderers/common/CanvasTarget.js +341 -0
  413. package/src/renderers/common/ChainMap.js +1 -1
  414. package/src/renderers/common/Color4.js +2 -2
  415. package/src/renderers/common/CubeRenderTarget.js +1 -1
  416. package/src/renderers/common/DataMap.js +1 -1
  417. package/src/renderers/common/Geometries.js +26 -0
  418. package/src/renderers/common/Info.js +4 -2
  419. package/src/renderers/common/InspectorBase.js +146 -0
  420. package/src/renderers/common/Pipelines.js +1 -1
  421. package/src/renderers/common/PostProcessing.js +61 -25
  422. package/src/renderers/common/QuadMesh.js +7 -1
  423. package/src/renderers/common/RenderContext.js +2 -2
  424. package/src/renderers/common/RenderList.js +7 -3
  425. package/src/renderers/common/RenderObject.js +84 -5
  426. package/src/renderers/common/RenderObjects.js +1 -1
  427. package/src/renderers/common/Renderer.js +486 -255
  428. package/src/renderers/common/RendererUtils.js +9 -0
  429. package/src/renderers/common/SampledTexture.js +8 -68
  430. package/src/renderers/common/Sampler.js +117 -0
  431. package/src/renderers/common/Storage3DTexture.js +100 -0
  432. package/src/renderers/common/StorageArrayTexture.js +84 -0
  433. package/src/renderers/common/StorageTexture.js +27 -0
  434. package/src/renderers/common/Textures.js +138 -46
  435. package/src/renderers/common/TimestampQueryPool.js +65 -3
  436. package/src/renderers/common/UniformsGroup.js +2 -1
  437. package/src/renderers/common/XRManager.js +63 -24
  438. package/src/renderers/common/XRRenderTarget.js +21 -4
  439. package/src/renderers/common/extras/PMREMGenerator.js +161 -66
  440. package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
  441. package/src/renderers/common/nodes/NodeLibrary.js +9 -7
  442. package/src/renderers/common/nodes/NodeSampledTexture.js +0 -12
  443. package/src/renderers/common/nodes/NodeSampler.js +13 -1
  444. package/src/renderers/common/nodes/Nodes.js +38 -16
  445. package/src/renderers/shaders/DFGLUTData.js +64 -0
  446. package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
  447. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
  448. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
  449. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -18
  450. package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +1 -1
  451. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +1 -1
  452. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +1 -1
  453. package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +1 -1
  454. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +21 -11
  455. package/src/renderers/shaders/ShaderLib/depth.glsl.js +11 -2
  456. package/src/renderers/shaders/UniformsLib.js +1 -0
  457. package/src/renderers/shaders/UniformsUtils.js +25 -4
  458. package/src/renderers/webgl/WebGLAttributes.js +4 -0
  459. package/src/renderers/webgl/WebGLCapabilities.js +4 -3
  460. package/src/renderers/webgl/WebGLExtensions.js +2 -25
  461. package/src/renderers/webgl/WebGLInfo.js +3 -1
  462. package/src/renderers/webgl/WebGLProgram.js +25 -18
  463. package/src/renderers/webgl/WebGLPrograms.js +9 -6
  464. package/src/renderers/webgl/WebGLShadowMap.js +13 -2
  465. package/src/renderers/webgl/WebGLState.js +17 -16
  466. package/src/renderers/webgl/WebGLTextures.js +38 -21
  467. package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
  468. package/src/renderers/webgl/WebGLUtils.js +3 -2
  469. package/src/renderers/webgl-fallback/WebGLBackend.js +245 -182
  470. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +184 -30
  471. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +4 -0
  472. package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
  473. package/src/renderers/webgl-fallback/utils/WebGLState.js +9 -8
  474. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +171 -19
  475. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +51 -22
  476. package/src/renderers/webgl-fallback/utils/WebGLUtils.js +3 -2
  477. package/src/renderers/webgpu/WebGPUBackend.js +205 -128
  478. package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
  479. package/src/renderers/webgpu/WebGPURenderer.js +3 -2
  480. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +198 -121
  481. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +8 -1
  482. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +49 -33
  483. package/src/renderers/webgpu/utils/WebGPUConstants.js +14 -3
  484. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +56 -37
  485. package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
  486. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +266 -158
  487. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +32 -9
  488. package/src/renderers/webgpu/utils/WebGPUUtils.js +24 -19
  489. package/src/renderers/webxr/WebXRDepthSensing.js +6 -10
  490. package/src/renderers/webxr/WebXRManager.js +89 -13
  491. package/src/textures/ExternalTexture.js +56 -0
  492. package/src/textures/FramebufferTexture.js +2 -2
  493. package/src/textures/Source.js +14 -3
  494. package/src/textures/Texture.js +3 -2
  495. package/src/textures/VideoTexture.js +29 -2
  496. package/src/utils.js +67 -3
  497. package/examples/jsm/loaders/RGBMLoader.js +0 -1148
  498. package/examples/jsm/tsl/display/TRAAPassNode.js +0 -452
  499. package/src/nodes/utils/EquirectUVNode.js +0 -65
  500. package/src/nodes/utils/MatcapUVNode.js +0 -49
  501. package/src/nodes/utils/TriplanarTexturesNode.js +0 -148
@@ -3,7 +3,7 @@
3
3
  * Copyright 2010-2025 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- const REVISION = '177';
6
+ const REVISION = '181';
7
7
 
8
8
  /**
9
9
  * Represents mouse buttons and interaction types in context of controls.
@@ -726,6 +726,14 @@ const UnsignedInt248Type = 1020;
726
726
  */
727
727
  const UnsignedInt5999Type = 35902;
728
728
 
729
+ /**
730
+ * An unsigned int 10_11_11 (packed) data type for textures.
731
+ *
732
+ * @type {number}
733
+ * @constant
734
+ */
735
+ const UnsignedInt101111Type = 35899;
736
+
729
737
  /**
730
738
  * Discards the red, green and blue components and reads just the alpha component.
731
739
  *
@@ -1617,8 +1625,8 @@ const InterpolationSamplingMode = {
1617
1625
  NORMAL: 'normal',
1618
1626
  CENTROID: 'centroid',
1619
1627
  SAMPLE: 'sample',
1620
- FLAT_FIRST: 'flat first',
1621
- FLAT_EITHER: 'flat either'
1628
+ FIRST: 'first',
1629
+ EITHER: 'either'
1622
1630
  };
1623
1631
 
1624
1632
  /**
@@ -1667,14 +1675,165 @@ const InterpolationSamplingMode = {
1667
1675
  * @property {string} NORMAL - Normal sampling mode.
1668
1676
  * @property {string} CENTROID - Centroid sampling mode.
1669
1677
  * @property {string} SAMPLE - Sample-specific sampling mode.
1670
- * @property {string} FLAT_FIRST - Flat interpolation using the first vertex.
1671
- * @property {string} FLAT_EITHER - Flat interpolation using either vertex.
1678
+ * @property {string} FIRST - Flat interpolation using the first vertex.
1679
+ * @property {string} EITHER - Flat interpolation using either vertex.
1672
1680
  */
1673
1681
 
1682
+ function arrayNeedsUint32( array ) {
1683
+
1684
+ // assumes larger values usually on last
1685
+
1686
+ for ( let i = array.length - 1; i >= 0; -- i ) {
1687
+
1688
+ if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
1689
+
1690
+ }
1691
+
1692
+ return false;
1693
+
1694
+ }
1695
+
1696
+ const TYPED_ARRAYS = {
1697
+ Int8Array: Int8Array,
1698
+ Uint8Array: Uint8Array,
1699
+ Uint8ClampedArray: Uint8ClampedArray,
1700
+ Int16Array: Int16Array,
1701
+ Uint16Array: Uint16Array,
1702
+ Int32Array: Int32Array,
1703
+ Uint32Array: Uint32Array,
1704
+ Float32Array: Float32Array,
1705
+ Float64Array: Float64Array
1706
+ };
1707
+
1708
+ function getTypedArray( type, buffer ) {
1709
+
1710
+ return new TYPED_ARRAYS[ type ]( buffer );
1711
+
1712
+ }
1713
+
1714
+ function createElementNS( name ) {
1715
+
1716
+ return document.createElementNS( 'http://www.w3.org/1999/xhtml', name );
1717
+
1718
+ }
1719
+
1720
+ function createCanvasElement() {
1721
+
1722
+ const canvas = createElementNS( 'canvas' );
1723
+ canvas.style.display = 'block';
1724
+ return canvas;
1725
+
1726
+ }
1727
+
1728
+ const _cache = {};
1729
+
1730
+ let _setConsoleFunction = null;
1731
+
1732
+ function setConsoleFunction( fn ) {
1733
+
1734
+ _setConsoleFunction = fn;
1735
+
1736
+ }
1737
+
1738
+ function getConsoleFunction() {
1739
+
1740
+ return _setConsoleFunction;
1741
+
1742
+ }
1743
+
1744
+ function log( ...params ) {
1745
+
1746
+ const message = 'THREE.' + params.shift();
1747
+
1748
+ if ( _setConsoleFunction ) {
1749
+
1750
+ _setConsoleFunction( 'log', message, ...params );
1751
+
1752
+ } else {
1753
+
1754
+ console.log( message, ...params );
1755
+
1756
+ }
1757
+
1758
+ }
1759
+
1760
+ function warn( ...params ) {
1761
+
1762
+ const message = 'THREE.' + params.shift();
1763
+
1764
+ if ( _setConsoleFunction ) {
1765
+
1766
+ _setConsoleFunction( 'warn', message, ...params );
1767
+
1768
+ } else {
1769
+
1770
+ console.warn( message, ...params );
1771
+
1772
+ }
1773
+
1774
+ }
1775
+
1776
+ function error( ...params ) {
1777
+
1778
+ const message = 'THREE.' + params.shift();
1779
+
1780
+ if ( _setConsoleFunction ) {
1781
+
1782
+ _setConsoleFunction( 'error', message, ...params );
1783
+
1784
+ } else {
1785
+
1786
+ console.error( message, ...params );
1787
+
1788
+ }
1789
+
1790
+ }
1791
+
1792
+ function warnOnce( ...params ) {
1793
+
1794
+ const message = params.join( ' ' );
1795
+
1796
+ if ( message in _cache ) return;
1797
+
1798
+ _cache[ message ] = true;
1799
+
1800
+ warn( ...params );
1801
+
1802
+ }
1803
+
1804
+ function probeAsync( gl, sync, interval ) {
1805
+
1806
+ return new Promise( function ( resolve, reject ) {
1807
+
1808
+ function probe() {
1809
+
1810
+ switch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {
1811
+
1812
+ case gl.WAIT_FAILED:
1813
+ reject();
1814
+ break;
1815
+
1816
+ case gl.TIMEOUT_EXPIRED:
1817
+ setTimeout( probe, interval );
1818
+ break;
1819
+
1820
+ default:
1821
+ resolve();
1822
+
1823
+ }
1824
+
1825
+ }
1826
+
1827
+ setTimeout( probe, interval );
1828
+
1829
+ } );
1830
+
1831
+ }
1832
+
1674
1833
  /**
1675
1834
  * This modules allows to dispatch event objects on custom JavaScript objects.
1676
1835
  *
1677
- * Main repository: [eventdispatcher.js]{@link https://github.com/mrdoob/eventdispatcher.js/}
1836
+ * Main repository: [eventdispatcher.js](https://github.com/mrdoob/eventdispatcher.js/)
1678
1837
  *
1679
1838
  * Code Example:
1680
1839
  * ```js
@@ -1809,7 +1968,7 @@ const DEG2RAD = Math.PI / 180;
1809
1968
  const RAD2DEG = 180 / Math.PI;
1810
1969
 
1811
1970
  /**
1812
- * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}
1971
+ * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
1813
1972
  * (universally unique identifier).
1814
1973
  *
1815
1974
  * @return {string} The UUID.
@@ -1922,7 +2081,7 @@ function lerp( x, y, t ) {
1922
2081
  /**
1923
2082
  * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta
1924
2083
  * time to maintain frame rate independent movement. For details, see
1925
- * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.
2084
+ * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).
1926
2085
  *
1927
2086
  * @param {number} x - The current point.
1928
2087
  * @param {number} y - The target point.
@@ -1957,7 +2116,7 @@ function pingpong( x, length = 1 ) {
1957
2116
  * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to
1958
2117
  * the `min` and `max`.
1959
2118
  *
1960
- * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.
2119
+ * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.
1961
2120
  *
1962
2121
  * @param {number} x - The value to evaluate based on its position between min and max.
1963
2122
  * @param {number} min - The min value. Any x value below min will be `0`.
@@ -1976,7 +2135,7 @@ function smoothstep( x, min, max ) {
1976
2135
  }
1977
2136
 
1978
2137
  /**
1979
- * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}
2138
+ * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)
1980
2139
  * that has zero 1st and 2nd order derivatives at x=0 and x=1.
1981
2140
  *
1982
2141
  * @param {number} x - The value to evaluate based on its position between min and max.
@@ -2116,7 +2275,7 @@ function floorPowerOfTwo( value ) {
2116
2275
  }
2117
2276
 
2118
2277
  /**
2119
- * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}
2278
+ * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)
2120
2279
  * defined by the given angles and order.
2121
2280
  *
2122
2281
  * Rotations are applied to the axes in the order specified by order:
@@ -2172,7 +2331,7 @@ function setQuaternionFromProperEuler( q, a, b, c, order ) {
2172
2331
  break;
2173
2332
 
2174
2333
  default:
2175
- console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );
2334
+ warn( 'MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );
2176
2335
 
2177
2336
  }
2178
2337
 
@@ -2281,7 +2440,7 @@ const MathUtils = {
2281
2440
  DEG2RAD: DEG2RAD,
2282
2441
  RAD2DEG: RAD2DEG,
2283
2442
  /**
2284
- * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}
2443
+ * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
2285
2444
  * (universally unique identifier).
2286
2445
  *
2287
2446
  * @static
@@ -2352,7 +2511,7 @@ const MathUtils = {
2352
2511
  /**
2353
2512
  * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta
2354
2513
  * time to maintain frame rate independent movement. For details, see
2355
- * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.
2514
+ * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).
2356
2515
  *
2357
2516
  * @static
2358
2517
  * @method
@@ -2379,7 +2538,7 @@ const MathUtils = {
2379
2538
  * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to
2380
2539
  * the `min` and `max`.
2381
2540
  *
2382
- * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.
2541
+ * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.
2383
2542
  *
2384
2543
  * @static
2385
2544
  * @method
@@ -2390,7 +2549,7 @@ const MathUtils = {
2390
2549
  */
2391
2550
  smoothstep: smoothstep,
2392
2551
  /**
2393
- * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}
2552
+ * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)
2394
2553
  * that has zero 1st and 2nd order derivatives at x=0 and x=1.
2395
2554
  *
2396
2555
  * @static
@@ -2485,7 +2644,7 @@ const MathUtils = {
2485
2644
  */
2486
2645
  floorPowerOfTwo: floorPowerOfTwo,
2487
2646
  /**
2488
- * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}
2647
+ * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)
2489
2648
  * defined by the given angles and order.
2490
2649
  *
2491
2650
  * Rotations are applied to the axes in the order specified by order:
@@ -3430,7 +3589,7 @@ class Quaternion {
3430
3589
 
3431
3590
  /**
3432
3591
  * Interpolates between two quaternions via SLERP. This implementation assumes the
3433
- * quaternion data are managed in flat arrays.
3592
+ * quaternion data are managed in flat arrays.
3434
3593
  *
3435
3594
  * @param {Array<number>} dst - The destination array.
3436
3595
  * @param {number} dstOffset - An offset into the destination array.
@@ -3443,65 +3602,78 @@ class Quaternion {
3443
3602
  */
3444
3603
  static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {
3445
3604
 
3446
- // fuzz-free, array-based Quaternion SLERP operation
3447
-
3448
3605
  let x0 = src0[ srcOffset0 + 0 ],
3449
3606
  y0 = src0[ srcOffset0 + 1 ],
3450
3607
  z0 = src0[ srcOffset0 + 2 ],
3451
3608
  w0 = src0[ srcOffset0 + 3 ];
3452
3609
 
3453
- const x1 = src1[ srcOffset1 + 0 ],
3610
+ let x1 = src1[ srcOffset1 + 0 ],
3454
3611
  y1 = src1[ srcOffset1 + 1 ],
3455
3612
  z1 = src1[ srcOffset1 + 2 ],
3456
3613
  w1 = src1[ srcOffset1 + 3 ];
3457
3614
 
3458
- if ( t === 0 ) {
3615
+ if ( t <= 0 ) {
3459
3616
 
3460
3617
  dst[ dstOffset + 0 ] = x0;
3461
3618
  dst[ dstOffset + 1 ] = y0;
3462
3619
  dst[ dstOffset + 2 ] = z0;
3463
3620
  dst[ dstOffset + 3 ] = w0;
3621
+
3464
3622
  return;
3465
3623
 
3466
3624
  }
3467
3625
 
3468
- if ( t === 1 ) {
3626
+ if ( t >= 1 ) {
3469
3627
 
3470
3628
  dst[ dstOffset + 0 ] = x1;
3471
3629
  dst[ dstOffset + 1 ] = y1;
3472
3630
  dst[ dstOffset + 2 ] = z1;
3473
3631
  dst[ dstOffset + 3 ] = w1;
3632
+
3474
3633
  return;
3475
3634
 
3476
3635
  }
3477
3636
 
3478
3637
  if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {
3479
3638
 
3480
- let s = 1 - t;
3481
- const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,
3482
- dir = ( cos >= 0 ? 1 : -1 ),
3483
- sqrSin = 1 - cos * cos;
3639
+ let dot = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1;
3484
3640
 
3485
- // Skip the Slerp for tiny steps to avoid numeric problems:
3486
- if ( sqrSin > Number.EPSILON ) {
3641
+ if ( dot < 0 ) {
3487
3642
 
3488
- const sin = Math.sqrt( sqrSin ),
3489
- len = Math.atan2( sin, cos * dir );
3643
+ x1 = - x1;
3644
+ y1 = - y1;
3645
+ z1 = - z1;
3646
+ w1 = - w1;
3490
3647
 
3491
- s = Math.sin( s * len ) / sin;
3492
- t = Math.sin( t * len ) / sin;
3648
+ dot = - dot;
3493
3649
 
3494
3650
  }
3495
3651
 
3496
- const tDir = t * dir;
3652
+ let s = 1 - t;
3497
3653
 
3498
- x0 = x0 * s + x1 * tDir;
3499
- y0 = y0 * s + y1 * tDir;
3500
- z0 = z0 * s + z1 * tDir;
3501
- w0 = w0 * s + w1 * tDir;
3654
+ if ( dot < 0.9995 ) {
3502
3655
 
3503
- // Normalize in case we just did a lerp:
3504
- if ( s === 1 - t ) {
3656
+ // slerp
3657
+
3658
+ const theta = Math.acos( dot );
3659
+ const sin = Math.sin( theta );
3660
+
3661
+ s = Math.sin( s * theta ) / sin;
3662
+ t = Math.sin( t * theta ) / sin;
3663
+
3664
+ x0 = x0 * s + x1 * t;
3665
+ y0 = y0 * s + y1 * t;
3666
+ z0 = z0 * s + z1 * t;
3667
+ w0 = w0 * s + w1 * t;
3668
+
3669
+ } else {
3670
+
3671
+ // for small angles, lerp then normalize
3672
+
3673
+ x0 = x0 * s + x1 * t;
3674
+ y0 = y0 * s + y1 * t;
3675
+ z0 = z0 * s + z1 * t;
3676
+ w0 = w0 * s + w1 * t;
3505
3677
 
3506
3678
  const f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );
3507
3679
 
@@ -3755,7 +3927,7 @@ class Quaternion {
3755
3927
  break;
3756
3928
 
3757
3929
  default:
3758
- console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );
3930
+ warn( 'Quaternion: .setFromEuler() encountered an unknown order: ' + order );
3759
3931
 
3760
3932
  }
3761
3933
 
@@ -3867,7 +4039,7 @@ class Quaternion {
3867
4039
 
3868
4040
  let r = vFrom.dot( vTo ) + 1;
3869
4041
 
3870
- if ( r < Number.EPSILON ) {
4042
+ if ( r < 1e-8 ) { // the epsilon value has been discussed in #31286
3871
4043
 
3872
4044
  // vFrom and vTo point in opposite directions
3873
4045
 
@@ -4111,68 +4283,56 @@ class Quaternion {
4111
4283
  */
4112
4284
  slerp( qb, t ) {
4113
4285
 
4114
- if ( t === 0 ) return this;
4115
- if ( t === 1 ) return this.copy( qb );
4286
+ if ( t <= 0 ) return this;
4116
4287
 
4117
- const x = this._x, y = this._y, z = this._z, w = this._w;
4288
+ if ( t >= 1 ) return this.copy( qb ); // copy calls _onChangeCallback()
4118
4289
 
4119
- // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/
4290
+ let x = qb._x, y = qb._y, z = qb._z, w = qb._w;
4120
4291
 
4121
- let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;
4292
+ let dot = this.dot( qb );
4122
4293
 
4123
- if ( cosHalfTheta < 0 ) {
4294
+ if ( dot < 0 ) {
4124
4295
 
4125
- this._w = - qb._w;
4126
- this._x = - qb._x;
4127
- this._y = - qb._y;
4128
- this._z = - qb._z;
4296
+ x = - x;
4297
+ y = - y;
4298
+ z = - z;
4299
+ w = - w;
4129
4300
 
4130
- cosHalfTheta = - cosHalfTheta;
4131
-
4132
- } else {
4133
-
4134
- this.copy( qb );
4301
+ dot = - dot;
4135
4302
 
4136
4303
  }
4137
4304
 
4138
- if ( cosHalfTheta >= 1.0 ) {
4305
+ let s = 1 - t;
4139
4306
 
4140
- this._w = w;
4141
- this._x = x;
4142
- this._y = y;
4143
- this._z = z;
4144
-
4145
- return this;
4307
+ if ( dot < 0.9995 ) {
4146
4308
 
4147
- }
4309
+ // slerp
4148
4310
 
4149
- const sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;
4311
+ const theta = Math.acos( dot );
4312
+ const sin = Math.sin( theta );
4150
4313
 
4151
- if ( sqrSinHalfTheta <= Number.EPSILON ) {
4314
+ s = Math.sin( s * theta ) / sin;
4315
+ t = Math.sin( t * theta ) / sin;
4152
4316
 
4153
- const s = 1 - t;
4154
- this._w = s * w + t * this._w;
4155
- this._x = s * x + t * this._x;
4156
- this._y = s * y + t * this._y;
4157
- this._z = s * z + t * this._z;
4317
+ this._x = this._x * s + x * t;
4318
+ this._y = this._y * s + y * t;
4319
+ this._z = this._z * s + z * t;
4320
+ this._w = this._w * s + w * t;
4158
4321
 
4159
- this.normalize(); // normalize calls _onChangeCallback()
4322
+ this._onChangeCallback();
4160
4323
 
4161
- return this;
4324
+ } else {
4162
4325
 
4163
- }
4326
+ // for small angles, lerp then normalize
4164
4327
 
4165
- const sinHalfTheta = Math.sqrt( sqrSinHalfTheta );
4166
- const halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );
4167
- const ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,
4168
- ratioB = Math.sin( t * halfTheta ) / sinHalfTheta;
4328
+ this._x = this._x * s + x * t;
4329
+ this._y = this._y * s + y * t;
4330
+ this._z = this._z * s + z * t;
4331
+ this._w = this._w * s + w * t;
4169
4332
 
4170
- this._w = ( w * ratioA + this._w * ratioB );
4171
- this._x = ( x * ratioA + this._x * ratioB );
4172
- this._y = ( y * ratioA + this._y * ratioB );
4173
- this._z = ( z * ratioA + this._z * ratioB );
4333
+ this.normalize(); // normalize calls _onChangeCallback()
4174
4334
 
4175
- this._onChangeCallback();
4335
+ }
4176
4336
 
4177
4337
  return this;
4178
4338
 
@@ -5587,7 +5747,7 @@ const _quaternion$4 = /*@__PURE__*/ new Quaternion();
5587
5747
  * A Note on Row-Major and Column-Major Ordering:
5588
5748
  *
5589
5749
  * The constructor and {@link Matrix3#set} method take arguments in
5590
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
5750
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
5591
5751
  * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.
5592
5752
  * This means that calling:
5593
5753
  * ```js
@@ -5861,7 +6021,7 @@ class Matrix3 {
5861
6021
  }
5862
6022
 
5863
6023
  /**
5864
- * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
6024
+ * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
5865
6025
  * You can not invert with a determinant of zero. If you attempt this, the method produces
5866
6026
  * a zero matrix instead.
5867
6027
  *
@@ -6193,125 +6353,6 @@ class Matrix3 {
6193
6353
 
6194
6354
  const _m3 = /*@__PURE__*/ new Matrix3();
6195
6355
 
6196
- function arrayNeedsUint32( array ) {
6197
-
6198
- // assumes larger values usually on last
6199
-
6200
- for ( let i = array.length - 1; i >= 0; -- i ) {
6201
-
6202
- if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
6203
-
6204
- }
6205
-
6206
- return false;
6207
-
6208
- }
6209
-
6210
- const TYPED_ARRAYS = {
6211
- Int8Array: Int8Array,
6212
- Uint8Array: Uint8Array,
6213
- Uint8ClampedArray: Uint8ClampedArray,
6214
- Int16Array: Int16Array,
6215
- Uint16Array: Uint16Array,
6216
- Int32Array: Int32Array,
6217
- Uint32Array: Uint32Array,
6218
- Float32Array: Float32Array,
6219
- Float64Array: Float64Array
6220
- };
6221
-
6222
- function getTypedArray( type, buffer ) {
6223
-
6224
- return new TYPED_ARRAYS[ type ]( buffer );
6225
-
6226
- }
6227
-
6228
- function createElementNS( name ) {
6229
-
6230
- return document.createElementNS( 'http://www.w3.org/1999/xhtml', name );
6231
-
6232
- }
6233
-
6234
- function createCanvasElement() {
6235
-
6236
- const canvas = createElementNS( 'canvas' );
6237
- canvas.style.display = 'block';
6238
- return canvas;
6239
-
6240
- }
6241
-
6242
- const _cache = {};
6243
-
6244
- function warnOnce( message ) {
6245
-
6246
- if ( message in _cache ) return;
6247
-
6248
- _cache[ message ] = true;
6249
-
6250
- console.warn( message );
6251
-
6252
- }
6253
-
6254
- function probeAsync( gl, sync, interval ) {
6255
-
6256
- return new Promise( function ( resolve, reject ) {
6257
-
6258
- function probe() {
6259
-
6260
- switch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {
6261
-
6262
- case gl.WAIT_FAILED:
6263
- reject();
6264
- break;
6265
-
6266
- case gl.TIMEOUT_EXPIRED:
6267
- setTimeout( probe, interval );
6268
- break;
6269
-
6270
- default:
6271
- resolve();
6272
-
6273
- }
6274
-
6275
- }
6276
-
6277
- setTimeout( probe, interval );
6278
-
6279
- } );
6280
-
6281
- }
6282
-
6283
- function toNormalizedProjectionMatrix( projectionMatrix ) {
6284
-
6285
- const m = projectionMatrix.elements;
6286
-
6287
- // Convert [-1, 1] to [0, 1] projection matrix
6288
- m[ 2 ] = 0.5 * m[ 2 ] + 0.5 * m[ 3 ];
6289
- m[ 6 ] = 0.5 * m[ 6 ] + 0.5 * m[ 7 ];
6290
- m[ 10 ] = 0.5 * m[ 10 ] + 0.5 * m[ 11 ];
6291
- m[ 14 ] = 0.5 * m[ 14 ] + 0.5 * m[ 15 ];
6292
-
6293
- }
6294
-
6295
- function toReversedProjectionMatrix( projectionMatrix ) {
6296
-
6297
- const m = projectionMatrix.elements;
6298
- const isPerspectiveMatrix = m[ 11 ] === -1;
6299
-
6300
- // Reverse [0, 1] projection matrix
6301
- if ( isPerspectiveMatrix ) {
6302
-
6303
- m[ 10 ] = - m[ 10 ] - 1;
6304
- m[ 14 ] = - m[ 14 ];
6305
-
6306
- } else {
6307
-
6308
- m[ 10 ] = - m[ 10 ];
6309
- m[ 14 ] = - m[ 14 ] + 1;
6310
-
6311
- }
6312
-
6313
- }
6314
-
6315
6356
  const LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(
6316
6357
  0.4123908, 0.3575843, 0.1804808,
6317
6358
  0.2126390, 0.7151687, 0.0721923,
@@ -6344,7 +6385,7 @@ function createColorManagement() {
6344
6385
  * - luminanceCoefficients: RGB luminance coefficients
6345
6386
  *
6346
6387
  * Optional:
6347
- * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }
6388
+ * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }
6348
6389
  * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
6349
6390
  *
6350
6391
  * Reference:
@@ -6413,6 +6454,12 @@ function createColorManagement() {
6413
6454
 
6414
6455
  },
6415
6456
 
6457
+ getToneMappingMode: function ( colorSpace ) {
6458
+
6459
+ return this.spaces[ colorSpace ].outputColorSpaceConfig.toneMappingMode || 'standard';
6460
+
6461
+ },
6462
+
6416
6463
  getLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {
6417
6464
 
6418
6465
  return target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );
@@ -6451,7 +6498,7 @@ function createColorManagement() {
6451
6498
 
6452
6499
  fromWorkingColorSpace: function ( color, targetColorSpace ) {
6453
6500
 
6454
- warnOnce( 'THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177
6501
+ warnOnce( 'ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177
6455
6502
 
6456
6503
  return ColorManagement.workingToColorSpace( color, targetColorSpace );
6457
6504
 
@@ -6459,7 +6506,7 @@ function createColorManagement() {
6459
6506
 
6460
6507
  toWorkingColorSpace: function ( color, sourceColorSpace ) {
6461
6508
 
6462
- warnOnce( 'THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177
6509
+ warnOnce( 'ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177
6463
6510
 
6464
6511
  return ColorManagement.colorSpaceToWorking( color, sourceColorSpace );
6465
6512
 
@@ -6642,7 +6689,7 @@ class ImageUtils {
6642
6689
 
6643
6690
  } else {
6644
6691
 
6645
- console.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );
6692
+ warn( 'ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );
6646
6693
  return image;
6647
6694
 
6648
6695
  }
@@ -6723,13 +6770,23 @@ class Source {
6723
6770
 
6724
6771
  }
6725
6772
 
6773
+ /**
6774
+ * Returns the dimensions of the source into the given target vector.
6775
+ *
6776
+ * @param {(Vector2|Vector3)} target - The target object the result is written into.
6777
+ * @return {(Vector2|Vector3)} The dimensions of the source.
6778
+ */
6726
6779
  getSize( target ) {
6727
6780
 
6728
6781
  const data = this.data;
6729
6782
 
6730
- if ( data instanceof HTMLVideoElement ) {
6783
+ if ( ( typeof HTMLVideoElement !== 'undefined' ) && ( data instanceof HTMLVideoElement ) ) {
6784
+
6785
+ target.set( data.videoWidth, data.videoHeight, 0 );
6786
+
6787
+ } else if ( data instanceof VideoFrame ) {
6731
6788
 
6732
- target.set( data.videoWidth, data.videoHeight );
6789
+ target.set( data.displayHeight, data.displayWidth, 0 );
6733
6790
 
6734
6791
  } else if ( data !== null ) {
6735
6792
 
@@ -6857,7 +6914,7 @@ function serializeImage( image ) {
6857
6914
 
6858
6915
  } else {
6859
6916
 
6860
- console.warn( 'THREE.Texture: Unable to serialize Texture.' );
6917
+ warn( 'Texture: Unable to serialize Texture.' );
6861
6918
  return {};
6862
6919
 
6863
6920
  }
@@ -7371,7 +7428,7 @@ class Texture extends EventDispatcher {
7371
7428
 
7372
7429
  if ( newValue === undefined ) {
7373
7430
 
7374
- console.warn( `THREE.Texture.setValues(): parameter '${ key }' has value of undefined.` );
7431
+ warn( `Texture.setValues(): parameter '${ key }' has value of undefined.` );
7375
7432
  continue;
7376
7433
 
7377
7434
  }
@@ -7380,7 +7437,7 @@ class Texture extends EventDispatcher {
7380
7437
 
7381
7438
  if ( currentValue === undefined ) {
7382
7439
 
7383
- console.warn( `THREE.Texture.setValues(): property '${ key }' does not exist.` );
7440
+ warn( `Texture.setValues(): property '${ key }' does not exist.` );
7384
7441
  continue;
7385
7442
 
7386
7443
  }
@@ -8997,7 +9054,16 @@ class RenderTarget extends EventDispatcher {
8997
9054
  this.textures[ i ].image.width = width;
8998
9055
  this.textures[ i ].image.height = height;
8999
9056
  this.textures[ i ].image.depth = depth;
9000
- this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
9057
+
9058
+ if ( this.textures[ i ].isData3DTexture !== true ) { // Fix for #31693
9059
+
9060
+ // TODO: Reconsider setting isArrayTexture flag here and in the ctor of Texture.
9061
+ // Maybe a method `isArrayTexture()` or just a getter could replace a flag since
9062
+ // both are evaluated on each call?
9063
+
9064
+ this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
9065
+
9066
+ }
9001
9067
 
9002
9068
  }
9003
9069
 
@@ -11314,7 +11380,7 @@ class Ray {
11314
11380
  * Represents a 4x4 matrix.
11315
11381
  *
11316
11382
  * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.
11317
- * For an introduction to transformation matrices as used in WebGL, check out [this tutorial]{@link https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices}
11383
+ * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices)
11318
11384
  *
11319
11385
  * This allows a 3D vector representing a point in 3D space to undergo
11320
11386
  * transformations such as translation, rotation, shear, scale, reflection,
@@ -11324,7 +11390,7 @@ class Ray {
11324
11390
  * A Note on Row-Major and Column-Major Ordering:
11325
11391
  *
11326
11392
  * The constructor and {@link Matrix3#set} method take arguments in
11327
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
11393
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
11328
11394
  * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.
11329
11395
  * This means that calling:
11330
11396
  * ```js
@@ -11618,7 +11684,7 @@ class Matrix4 {
11618
11684
  * Sets the rotation component (the upper left 3x3 matrix) of this matrix to
11619
11685
  * the rotation specified by the given Euler angles. The rest of
11620
11686
  * the matrix is set to the identity. Depending on the {@link Euler#order},
11621
- * there are six possible outcomes. See [this page]{@link https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix}
11687
+ * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix)
11622
11688
  * for a complete list.
11623
11689
  *
11624
11690
  * @param {Euler} euler - The Euler angles.
@@ -11748,7 +11814,7 @@ class Matrix4 {
11748
11814
 
11749
11815
  /**
11750
11816
  * Sets the rotation component of this matrix to the rotation specified by
11751
- * the given Quaternion as outlined [here]{@link https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion}
11817
+ * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion)
11752
11818
  * The rest of the matrix is set to the identity.
11753
11819
  *
11754
11820
  * @param {Quaternion} q - The Quaternion.
@@ -11910,7 +11976,7 @@ class Matrix4 {
11910
11976
  /**
11911
11977
  * Computes and returns the determinant of this matrix.
11912
11978
  *
11913
- * Based on the method outlined [here]{@link http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html}.
11979
+ * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).
11914
11980
  *
11915
11981
  * @return {number} The determinant.
11916
11982
  */
@@ -12017,7 +12083,7 @@ class Matrix4 {
12017
12083
  }
12018
12084
 
12019
12085
  /**
12020
- * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
12086
+ * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
12021
12087
  * You can not invert with a determinant of zero. If you attempt this, the method produces
12022
12088
  * a zero matrix instead.
12023
12089
  *
@@ -12220,7 +12286,7 @@ class Matrix4 {
12220
12286
  * the given angle.
12221
12287
  *
12222
12288
  * This is a somewhat controversial but mathematically sound alternative to
12223
- * rotating via Quaternions. See the discussion [here]{@link https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199}.
12289
+ * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).
12224
12290
  *
12225
12291
  * @param {Vector3} axis - The normalized rotation axis.
12226
12292
  * @param {number} angle - The rotation in radians.
@@ -12412,11 +12478,13 @@ class Matrix4 {
12412
12478
  * @param {number} near - The distance from the camera to the near plane.
12413
12479
  * @param {number} far - The distance from the camera to the far plane.
12414
12480
  * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
12481
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
12415
12482
  * @return {Matrix4} A reference to this matrix.
12416
12483
  */
12417
- makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
12484
+ makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
12418
12485
 
12419
12486
  const te = this.elements;
12487
+
12420
12488
  const x = 2 * near / ( right - left );
12421
12489
  const y = 2 * near / ( top - bottom );
12422
12490
 
@@ -12425,19 +12493,28 @@ class Matrix4 {
12425
12493
 
12426
12494
  let c, d;
12427
12495
 
12428
- if ( coordinateSystem === WebGLCoordinateSystem ) {
12496
+ if ( reversedDepth ) {
12429
12497
 
12430
- c = - ( far + near ) / ( far - near );
12431
- d = ( -2 * far * near ) / ( far - near );
12498
+ c = near / ( far - near );
12499
+ d = ( far * near ) / ( far - near );
12432
12500
 
12433
- } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
12501
+ } else {
12434
12502
 
12435
- c = - far / ( far - near );
12436
- d = ( - far * near ) / ( far - near );
12503
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
12437
12504
 
12438
- } else {
12505
+ c = - ( far + near ) / ( far - near );
12506
+ d = ( -2 * far * near ) / ( far - near );
12507
+
12508
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
12439
12509
 
12440
- throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
12510
+ c = - far / ( far - near );
12511
+ d = ( - far * near ) / ( far - near );
12512
+
12513
+ } else {
12514
+
12515
+ throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
12516
+
12517
+ }
12441
12518
 
12442
12519
  }
12443
12520
 
@@ -12461,39 +12538,49 @@ class Matrix4 {
12461
12538
  * @param {number} near - The distance from the camera to the near plane.
12462
12539
  * @param {number} far - The distance from the camera to the far plane.
12463
12540
  * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.
12541
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
12464
12542
  * @return {Matrix4} A reference to this matrix.
12465
12543
  */
12466
- makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
12544
+ makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
12467
12545
 
12468
12546
  const te = this.elements;
12469
- const w = 1.0 / ( right - left );
12470
- const h = 1.0 / ( top - bottom );
12471
- const p = 1.0 / ( far - near );
12472
12547
 
12473
- const x = ( right + left ) * w;
12474
- const y = ( top + bottom ) * h;
12548
+ const x = 2 / ( right - left );
12549
+ const y = 2 / ( top - bottom );
12475
12550
 
12476
- let z, zInv;
12551
+ const a = - ( right + left ) / ( right - left );
12552
+ const b = - ( top + bottom ) / ( top - bottom );
12477
12553
 
12478
- if ( coordinateSystem === WebGLCoordinateSystem ) {
12479
-
12480
- z = ( far + near ) * p;
12481
- zInv = -2 * p;
12554
+ let c, d;
12482
12555
 
12483
- } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
12556
+ if ( reversedDepth ) {
12484
12557
 
12485
- z = near * p;
12486
- zInv = -1 * p;
12558
+ c = 1 / ( far - near );
12559
+ d = far / ( far - near );
12487
12560
 
12488
12561
  } else {
12489
12562
 
12490
- throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
12563
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
12564
+
12565
+ c = -2 / ( far - near );
12566
+ d = - ( far + near ) / ( far - near );
12567
+
12568
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
12569
+
12570
+ c = -1 / ( far - near );
12571
+ d = - near / ( far - near );
12572
+
12573
+ } else {
12574
+
12575
+ throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
12576
+
12577
+ }
12491
12578
 
12492
12579
  }
12493
12580
 
12494
- te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
12495
- te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
12496
- te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z;
12581
+ te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = a;
12582
+ te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = 0; te[ 13 ] = b;
12583
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
12497
12584
  te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
12498
12585
 
12499
12586
  return this;
@@ -12888,7 +12975,7 @@ class Euler {
12888
12975
 
12889
12976
  default:
12890
12977
 
12891
- console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );
12978
+ warn( 'Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );
12892
12979
 
12893
12980
  }
12894
12981
 
@@ -13188,7 +13275,7 @@ const _removedEvent = { type: 'removed' };
13188
13275
  const _childaddedEvent = { type: 'childadded', child: null };
13189
13276
 
13190
13277
  /**
13191
- * Fires when a new child object has been added.
13278
+ * Fires when a child object has been removed.
13192
13279
  *
13193
13280
  * @event Object3D#childremoved
13194
13281
  * @type {Object}
@@ -13874,7 +13961,7 @@ class Object3D extends EventDispatcher {
13874
13961
 
13875
13962
  if ( object === this ) {
13876
13963
 
13877
- console.error( 'THREE.Object3D.add: object can\'t be added as a child of itself.', object );
13964
+ error( 'Object3D.add: object can\'t be added as a child of itself.', object );
13878
13965
  return this;
13879
13966
 
13880
13967
  }
@@ -13893,7 +13980,7 @@ class Object3D extends EventDispatcher {
13893
13980
 
13894
13981
  } else {
13895
13982
 
13896
- console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
13983
+ error( 'Object3D.add: object not an instance of THREE.Object3D.', object );
13897
13984
 
13898
13985
  }
13899
13986
 
@@ -15564,7 +15651,7 @@ class Color {
15564
15651
  /**
15565
15652
  * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,
15566
15653
  * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or
15567
- * any [X11 color name]{@link https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart} -
15654
+ * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) -
15568
15655
  * all 140 color names are supported).
15569
15656
  *
15570
15657
  * @param {string} style - Color as a CSS-style string.
@@ -15579,7 +15666,7 @@ class Color {
15579
15666
 
15580
15667
  if ( parseFloat( string ) < 1 ) {
15581
15668
 
15582
- console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );
15669
+ warn( 'Color: Alpha component of ' + style + ' will be ignored.' );
15583
15670
 
15584
15671
  }
15585
15672
 
@@ -15655,7 +15742,7 @@ class Color {
15655
15742
 
15656
15743
  default:
15657
15744
 
15658
- console.warn( 'THREE.Color: Unknown color model ' + style );
15745
+ warn( 'Color: Unknown color model ' + style );
15659
15746
 
15660
15747
  }
15661
15748
 
@@ -15683,7 +15770,7 @@ class Color {
15683
15770
 
15684
15771
  } else {
15685
15772
 
15686
- console.warn( 'THREE.Color: Invalid hex color ' + style );
15773
+ warn( 'Color: Invalid hex color ' + style );
15687
15774
 
15688
15775
  }
15689
15776
 
@@ -15723,7 +15810,7 @@ class Color {
15723
15810
  } else {
15724
15811
 
15725
15812
  // unknown color
15726
- console.warn( 'THREE.Color: Unknown color ' + style );
15813
+ warn( 'Color: Unknown color ' + style );
15727
15814
 
15728
15815
  }
15729
15816
 
@@ -16771,7 +16858,7 @@ class Material extends EventDispatcher {
16771
16858
  *
16772
16859
  * This method can only be used when rendering with {@link WebGLRenderer}. The
16773
16860
  * recommended approach when customizing materials is to use `WebGPURenderer` with the new
16774
- * Node Material system and [TSL]{@link https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language}.
16861
+ * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).
16775
16862
  *
16776
16863
  * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.
16777
16864
  * @param {WebGLRenderer} renderer - A reference to the renderer.
@@ -16810,7 +16897,7 @@ class Material extends EventDispatcher {
16810
16897
 
16811
16898
  if ( newValue === undefined ) {
16812
16899
 
16813
- console.warn( `THREE.Material: parameter '${ key }' has value of undefined.` );
16900
+ warn( `Material: parameter '${ key }' has value of undefined.` );
16814
16901
  continue;
16815
16902
 
16816
16903
  }
@@ -16819,7 +16906,7 @@ class Material extends EventDispatcher {
16819
16906
 
16820
16907
  if ( currentValue === undefined ) {
16821
16908
 
16822
- console.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` );
16909
+ warn( `Material: '${ key }' is not a property of THREE.${ this.type }.` );
16823
16910
  continue;
16824
16911
 
16825
16912
  }
@@ -16913,6 +17000,18 @@ class Material extends EventDispatcher {
16913
17000
 
16914
17001
  }
16915
17002
 
17003
+ if ( this.sheenColorMap && this.sheenColorMap.isTexture ) {
17004
+
17005
+ data.sheenColorMap = this.sheenColorMap.toJSON( meta ).uuid;
17006
+
17007
+ }
17008
+
17009
+ if ( this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture ) {
17010
+
17011
+ data.sheenRoughnessMap = this.sheenRoughnessMap.toJSON( meta ).uuid;
17012
+
17013
+ }
17014
+
16916
17015
  if ( this.dispersion !== undefined ) data.dispersion = this.dispersion;
16917
17016
 
16918
17017
  if ( this.iridescence !== undefined ) data.iridescence = this.iridescence;
@@ -17254,6 +17353,7 @@ class Material extends EventDispatcher {
17254
17353
  * This material is not affected by lights.
17255
17354
  *
17256
17355
  * @augments Material
17356
+ * @demo scenes/material-browser.html#MeshBasicMaterial
17257
17357
  */
17258
17358
  class MeshBasicMaterial extends Material {
17259
17359
 
@@ -17287,7 +17387,7 @@ class MeshBasicMaterial extends Material {
17287
17387
  * @type {Color}
17288
17388
  * @default (1,1,1)
17289
17389
  */
17290
- this.color = new Color( 0xffffff ); // emissive
17390
+ this.color = new Color( 0xffffff ); // diffuse
17291
17391
 
17292
17392
  /**
17293
17393
  * The color map. May optionally include an alpha channel, typically combined
@@ -17639,7 +17739,7 @@ function _generateTables() {
17639
17739
  */
17640
17740
  function toHalfFloat( val ) {
17641
17741
 
17642
- if ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' );
17742
+ if ( Math.abs( val ) > 65504 ) warn( 'DataUtils.toHalfFloat(): Value out of range.' );
17643
17743
 
17644
17744
  val = clamp( val, -65504, 65504 );
17645
17745
 
@@ -17784,7 +17884,7 @@ class BufferAttribute {
17784
17884
  /**
17785
17885
  * Applies to integer data only. Indicates how the underlying data in the buffer maps to
17786
17886
  * the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`,
17787
- * and `normalized` is `true`, the values `0 -+65535` in the array data will be mapped to
17887
+ * and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to
17788
17888
  * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted
17789
17889
  * to floats unmodified, i.e. `65535` becomes `65535.0f`.
17790
17890
  *
@@ -18537,8 +18637,8 @@ class Uint32BufferAttribute extends BufferAttribute {
18537
18637
  * Convenient class that can be used when creating a `Float16` buffer attribute with
18538
18638
  * a plain `Array` instance.
18539
18639
  *
18540
- * This class automatically converts to and from FP16 since `Float16Array` is not
18541
- * natively supported in JavaScript.
18640
+ * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`
18641
+ * browser support is still problematic.
18542
18642
  *
18543
18643
  * @augments BufferAttribute
18544
18644
  */
@@ -18870,7 +18970,7 @@ class BufferGeometry extends EventDispatcher {
18870
18970
  /**
18871
18971
  * Bounding box for the geometry which can be calculated with `computeBoundingBox()`.
18872
18972
  *
18873
- * @type {Box3}
18973
+ * @type {?Box3}
18874
18974
  * @default null
18875
18975
  */
18876
18976
  this.boundingBox = null;
@@ -18878,7 +18978,7 @@ class BufferGeometry extends EventDispatcher {
18878
18978
  /**
18879
18979
  * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`.
18880
18980
  *
18881
- * @type {Sphere}
18981
+ * @type {?Sphere}
18882
18982
  * @default null
18883
18983
  */
18884
18984
  this.boundingSphere = null;
@@ -19310,7 +19410,7 @@ class BufferGeometry extends EventDispatcher {
19310
19410
 
19311
19411
  if ( points.length > positionAttribute.count ) {
19312
19412
 
19313
- console.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );
19413
+ warn( 'BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );
19314
19414
 
19315
19415
  }
19316
19416
 
@@ -19340,7 +19440,7 @@ class BufferGeometry extends EventDispatcher {
19340
19440
 
19341
19441
  if ( position && position.isGLBufferAttribute ) {
19342
19442
 
19343
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
19443
+ error( 'BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
19344
19444
 
19345
19445
  this.boundingBox.set(
19346
19446
  new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -19391,7 +19491,7 @@ class BufferGeometry extends EventDispatcher {
19391
19491
 
19392
19492
  if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
19393
19493
 
19394
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
19494
+ error( 'BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
19395
19495
 
19396
19496
  }
19397
19497
 
@@ -19415,7 +19515,7 @@ class BufferGeometry extends EventDispatcher {
19415
19515
 
19416
19516
  if ( position && position.isGLBufferAttribute ) {
19417
19517
 
19418
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
19518
+ error( 'BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
19419
19519
 
19420
19520
  this.boundingSphere.set( new Vector3(), Infinity );
19421
19521
 
@@ -19506,7 +19606,7 @@ class BufferGeometry extends EventDispatcher {
19506
19606
 
19507
19607
  if ( isNaN( this.boundingSphere.radius ) ) {
19508
19608
 
19509
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
19609
+ error( 'BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
19510
19610
 
19511
19611
  }
19512
19612
 
@@ -19534,7 +19634,7 @@ class BufferGeometry extends EventDispatcher {
19534
19634
  attributes.normal === undefined ||
19535
19635
  attributes.uv === undefined ) {
19536
19636
 
19537
- console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );
19637
+ error( 'BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );
19538
19638
  return;
19539
19639
 
19540
19640
  }
@@ -19844,7 +19944,7 @@ class BufferGeometry extends EventDispatcher {
19844
19944
 
19845
19945
  if ( this.index === null ) {
19846
19946
 
19847
- console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );
19947
+ warn( 'BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );
19848
19948
  return this;
19849
19949
 
19850
19950
  }
@@ -20654,6 +20754,7 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
20654
20754
  * ```
20655
20755
  *
20656
20756
  * @augments BufferGeometry
20757
+ * @demo scenes/geometry-browser.html#BoxGeometry
20657
20758
  */
20658
20759
  class BoxGeometry extends BufferGeometry {
20659
20760
 
@@ -20854,8 +20955,20 @@ class BoxGeometry extends BufferGeometry {
20854
20955
 
20855
20956
  }
20856
20957
 
20857
- // Uniform Utilities
20958
+ /**
20959
+ * Provides utility functions for managing uniforms.
20960
+ *
20961
+ * @module UniformsUtils
20962
+ */
20858
20963
 
20964
+ /**
20965
+ * Clones the given uniform definitions by performing a deep-copy. That means
20966
+ * if the value of a uniform refers to an object like a Vector3 or Texture,
20967
+ * the cloned uniform will refer to a new object reference.
20968
+ *
20969
+ * @param {Object} src - An object representing uniform definitions.
20970
+ * @return {Object} The cloned uniforms.
20971
+ */
20859
20972
  function cloneUniforms( src ) {
20860
20973
 
20861
20974
  const dst = {};
@@ -20875,7 +20988,7 @@ function cloneUniforms( src ) {
20875
20988
 
20876
20989
  if ( property.isRenderTargetTexture ) {
20877
20990
 
20878
- console.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );
20991
+ warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );
20879
20992
  dst[ u ][ p ] = null;
20880
20993
 
20881
20994
  } else {
@@ -20902,6 +21015,14 @@ function cloneUniforms( src ) {
20902
21015
 
20903
21016
  }
20904
21017
 
21018
+ /**
21019
+ * Merges the given uniform definitions into a single object. Since the
21020
+ * method internally uses cloneUniforms(), it performs a deep-copy when
21021
+ * producing the merged uniform definitions.
21022
+ *
21023
+ * @param {Array} uniforms - An array of objects containing uniform definitions.
21024
+ * @return {Object} The merged uniforms.
21025
+ */
20905
21026
  function mergeUniforms( uniforms ) {
20906
21027
 
20907
21028
  const merged = {};
@@ -20979,7 +21100,7 @@ var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0
20979
21100
  * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end`
20980
21101
  * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has
20981
21102
  * to be placed right above the loop. The loop formatting has to correspond to a defined standard.
20982
- * - The loop has to be [normalized]{@link https://en.wikipedia.org/wiki/Normalized_loop}.
21103
+ * - The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop).
20983
21104
  * - The loop variable has to be *i*.
20984
21105
  * - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly
20985
21106
  * value of *i* for the given iteration and can be used in preprocessor
@@ -21185,7 +21306,7 @@ class ShaderMaterial extends Material {
21185
21306
  };
21186
21307
 
21187
21308
  /**
21188
- * If set, this calls [gl.bindAttribLocation]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation}
21309
+ * If set, this calls [gl.bindAttribLocation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation)
21189
21310
  * to bind a generic vertex index to an attribute variable.
21190
21311
  *
21191
21312
  * @type {string|undefined}
@@ -21397,6 +21518,20 @@ class Camera extends Object3D {
21397
21518
  */
21398
21519
  this.coordinateSystem = WebGLCoordinateSystem;
21399
21520
 
21521
+ this._reversedDepth = false;
21522
+
21523
+ }
21524
+
21525
+ /**
21526
+ * The flag that indicates whether the camera uses a reversed depth buffer.
21527
+ *
21528
+ * @type {boolean}
21529
+ * @default false
21530
+ */
21531
+ get reversedDepth() {
21532
+
21533
+ return this._reversedDepth;
21534
+
21400
21535
  }
21401
21536
 
21402
21537
  copy( source, recursive ) {
@@ -21458,7 +21593,7 @@ const _minTarget = /*@__PURE__*/ new Vector2();
21458
21593
  const _maxTarget = /*@__PURE__*/ new Vector2();
21459
21594
 
21460
21595
  /**
21461
- * Camera that uses [perspective projection]{@link https://en.wikipedia.org/wiki/Perspective_(graphical)}.
21596
+ * Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)).
21462
21597
  *
21463
21598
  * This projection mode is designed to mimic the way the human eye sees. It
21464
21599
  * is the most common projection mode used for rendering a 3D scene.
@@ -21824,7 +21959,7 @@ class PerspectiveCamera extends Camera {
21824
21959
  const skew = this.filmOffset;
21825
21960
  if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
21826
21961
 
21827
- this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
21962
+ this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );
21828
21963
 
21829
21964
  this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
21830
21965
 
@@ -23141,7 +23276,7 @@ class Scene extends Object3D {
23141
23276
  * "Interleaved" means that multiple attributes, possibly of different types,
23142
23277
  * (e.g., position, normal, uv, color) are packed into a single array buffer.
23143
23278
  *
23144
- * An introduction into interleaved arrays can be found here: [Interleaved array basics]{@link https://blog.tojicode.com/2011/05/interleaved-array-basics.html}
23279
+ * An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html)
23145
23280
  */
23146
23281
  class InterleavedBuffer {
23147
23282
 
@@ -23861,7 +23996,7 @@ class InterleavedBufferAttribute {
23861
23996
 
23862
23997
  if ( data === undefined ) {
23863
23998
 
23864
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
23999
+ log( 'InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
23865
24000
 
23866
24001
  const array = [];
23867
24002
 
@@ -23911,7 +24046,7 @@ class InterleavedBufferAttribute {
23911
24046
 
23912
24047
  if ( data === undefined ) {
23913
24048
 
23914
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
24049
+ log( 'InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
23915
24050
 
23916
24051
  const array = [];
23917
24052
 
@@ -24138,7 +24273,7 @@ class Sprite extends Object3D {
24138
24273
  /**
24139
24274
  * Constructs a new sprite.
24140
24275
  *
24141
- * @param {SpriteMaterial} [material] - The sprite material.
24276
+ * @param {(SpriteMaterial|SpriteNodeMaterial)} [material] - The sprite material.
24142
24277
  */
24143
24278
  constructor( material = new SpriteMaterial() ) {
24144
24279
 
@@ -24184,7 +24319,7 @@ class Sprite extends Object3D {
24184
24319
  /**
24185
24320
  * The sprite material.
24186
24321
  *
24187
- * @type {SpriteMaterial}
24322
+ * @type {(SpriteMaterial|SpriteNodeMaterial)}
24188
24323
  */
24189
24324
  this.material = material;
24190
24325
 
@@ -24219,7 +24354,7 @@ class Sprite extends Object3D {
24219
24354
 
24220
24355
  if ( raycaster.camera === null ) {
24221
24356
 
24222
- console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
24357
+ error( 'Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
24223
24358
 
24224
24359
  }
24225
24360
 
@@ -24513,7 +24648,7 @@ class LOD extends Object3D {
24513
24648
  * the given distance.
24514
24649
  *
24515
24650
  * @param {number} distance - The LOD distance.
24516
- * @return {Object3D|null} The found 3D object. `null` if no 3D object has been found.
24651
+ * @return {?Object3D} The found 3D object. `null` if no 3D object has been found.
24517
24652
  */
24518
24653
  getObjectForDistance( distance ) {
24519
24654
 
@@ -24680,6 +24815,7 @@ const _ray$2 = /*@__PURE__*/ new Ray();
24680
24815
  * or {@link FBXLoader } import respective models.
24681
24816
  *
24682
24817
  * @augments Mesh
24818
+ * @demo scenes/bones-browser.html
24683
24819
  */
24684
24820
  class SkinnedMesh extends Mesh {
24685
24821
 
@@ -24947,7 +25083,7 @@ class SkinnedMesh extends Mesh {
24947
25083
 
24948
25084
  } else {
24949
25085
 
24950
- console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );
25086
+ warn( 'SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );
24951
25087
 
24952
25088
  }
24953
25089
 
@@ -25216,7 +25352,7 @@ class Skeleton {
25216
25352
 
25217
25353
  if ( bones.length !== boneInverses.length ) {
25218
25354
 
25219
- console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );
25355
+ warn( 'Skeleton: Number of inverse bone matrices does not match amount of bones.' );
25220
25356
 
25221
25357
  this.boneInverses = [];
25222
25358
 
@@ -25434,7 +25570,7 @@ class Skeleton {
25434
25570
 
25435
25571
  if ( bone === undefined ) {
25436
25572
 
25437
- console.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );
25573
+ warn( 'Skeleton: No bone found with UUID:', uuid );
25438
25574
  bone = new Bone();
25439
25575
 
25440
25576
  }
@@ -25946,7 +26082,7 @@ const _normalMatrix = /*@__PURE__*/ new Matrix3();
25946
26082
 
25947
26083
  /**
25948
26084
  * A two dimensional surface that extends infinitely in 3D space, represented
25949
- * in [Hessian normal form]{@link http://mathworld.wolfram.com/HessianNormalForm.html}
26085
+ * in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html)
25950
26086
  * by a unit length normal vector and a constant.
25951
26087
  */
25952
26088
  class Plane {
@@ -26304,6 +26440,7 @@ class Plane {
26304
26440
  }
26305
26441
 
26306
26442
  const _sphere$3 = /*@__PURE__*/ new Sphere();
26443
+ const _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );
26307
26444
  const _vector$6 = /*@__PURE__*/ new Vector3();
26308
26445
 
26309
26446
  /**
@@ -26387,9 +26524,10 @@ class Frustum {
26387
26524
  *
26388
26525
  * @param {Matrix4} m - The projection matrix.
26389
26526
  * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.
26527
+ * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
26390
26528
  * @return {Frustum} A reference to this frustum.
26391
26529
  */
26392
- setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {
26530
+ setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {
26393
26531
 
26394
26532
  const planes = this.planes;
26395
26533
  const me = m.elements;
@@ -26402,19 +26540,29 @@ class Frustum {
26402
26540
  planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();
26403
26541
  planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();
26404
26542
  planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();
26405
- planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();
26406
26543
 
26407
- if ( coordinateSystem === WebGLCoordinateSystem ) {
26544
+ if ( reversedDepth ) {
26408
26545
 
26409
- planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();
26546
+ planes[ 4 ].setComponents( me2, me6, me10, me14 ).normalize(); // far
26547
+ planes[ 5 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // near
26410
26548
 
26411
- } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
26549
+ } else {
26412
26550
 
26413
- planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();
26551
+ planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // far
26414
26552
 
26415
- } else {
26553
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
26554
+
26555
+ planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); // near
26416
26556
 
26417
- throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
26557
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
26558
+
26559
+ planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); // near
26560
+
26561
+ } else {
26562
+
26563
+ throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
26564
+
26565
+ }
26418
26566
 
26419
26567
  }
26420
26568
 
@@ -26461,7 +26609,10 @@ class Frustum {
26461
26609
  intersectsSprite( sprite ) {
26462
26610
 
26463
26611
  _sphere$3.center.set( 0, 0, 0 );
26464
- _sphere$3.radius = 0.7071067811865476;
26612
+
26613
+ const offset = _defaultSpriteCenter.distanceTo( sprite.center );
26614
+
26615
+ _sphere$3.radius = 0.7071067811865476 + offset;
26465
26616
  _sphere$3.applyMatrix4( sprite.matrixWorld );
26466
26617
 
26467
26618
  return this.intersectsSphere( _sphere$3 );
@@ -26617,7 +26768,8 @@ class FrustumArray {
26617
26768
 
26618
26769
  _frustum$1.setFromProjectionMatrix(
26619
26770
  _projScreenMatrix$2,
26620
- this.coordinateSystem
26771
+ camera.coordinateSystem,
26772
+ camera.reversedDepth
26621
26773
  );
26622
26774
 
26623
26775
  if ( _frustum$1.intersectsObject( object ) ) {
@@ -26659,7 +26811,8 @@ class FrustumArray {
26659
26811
 
26660
26812
  _frustum$1.setFromProjectionMatrix(
26661
26813
  _projScreenMatrix$2,
26662
- this.coordinateSystem
26814
+ camera.coordinateSystem,
26815
+ camera.reversedDepth
26663
26816
  );
26664
26817
 
26665
26818
  if ( _frustum$1.intersectsSprite( sprite ) ) {
@@ -26701,7 +26854,8 @@ class FrustumArray {
26701
26854
 
26702
26855
  _frustum$1.setFromProjectionMatrix(
26703
26856
  _projScreenMatrix$2,
26704
- this.coordinateSystem
26857
+ camera.coordinateSystem,
26858
+ camera.reversedDepth
26705
26859
  );
26706
26860
 
26707
26861
  if ( _frustum$1.intersectsSphere( sphere ) ) {
@@ -26743,7 +26897,8 @@ class FrustumArray {
26743
26897
 
26744
26898
  _frustum$1.setFromProjectionMatrix(
26745
26899
  _projScreenMatrix$2,
26746
- this.coordinateSystem
26900
+ camera.coordinateSystem,
26901
+ camera.reversedDepth
26747
26902
  );
26748
26903
 
26749
26904
  if ( _frustum$1.intersectsBox( box ) ) {
@@ -26785,7 +26940,8 @@ class FrustumArray {
26785
26940
 
26786
26941
  _frustum$1.setFromProjectionMatrix(
26787
26942
  _projScreenMatrix$2,
26788
- this.coordinateSystem
26943
+ camera.coordinateSystem,
26944
+ camera.reversedDepth
26789
26945
  );
26790
26946
 
26791
26947
  if ( _frustum$1.containsPoint( point ) ) {
@@ -27772,7 +27928,7 @@ class BatchedMesh extends Mesh {
27772
27928
  *
27773
27929
  * @param {number} geometryId - The ID of the geometry to return the bounding box for.
27774
27930
  * @param {Box3} target - The target object that is used to store the method's result.
27775
- * @return {Box3|null} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
27931
+ * @return {?Box3} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.
27776
27932
  */
27777
27933
  getBoundingBoxAt( geometryId, target ) {
27778
27934
 
@@ -27817,7 +27973,7 @@ class BatchedMesh extends Mesh {
27817
27973
  *
27818
27974
  * @param {number} geometryId - The ID of the geometry to return the bounding sphere for.
27819
27975
  * @param {Sphere} target - The target object that is used to store the method's result.
27820
- * @return {Sphere|null} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
27976
+ * @return {?Sphere} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.
27821
27977
  */
27822
27978
  getBoundingSphereAt( geometryId, target ) {
27823
27979
 
@@ -28052,7 +28208,7 @@ class BatchedMesh extends Mesh {
28052
28208
  const availableInstanceIds = this._availableInstanceIds;
28053
28209
  const instanceInfo = this._instanceInfo;
28054
28210
  availableInstanceIds.sort( ascIdSort );
28055
- while ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length ) {
28211
+ while ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length - 1 ) {
28056
28212
 
28057
28213
  instanceInfo.pop();
28058
28214
  availableInstanceIds.pop();
@@ -28330,9 +28486,11 @@ class BatchedMesh extends Mesh {
28330
28486
  _matrix$1
28331
28487
  .multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )
28332
28488
  .multiply( this.matrixWorld );
28489
+
28333
28490
  _frustum.setFromProjectionMatrix(
28334
28491
  _matrix$1,
28335
- renderer.coordinateSystem
28492
+ camera.coordinateSystem,
28493
+ camera.reversedDepth
28336
28494
  );
28337
28495
 
28338
28496
  }
@@ -28703,7 +28861,7 @@ class Line extends Object3D {
28703
28861
 
28704
28862
  } else {
28705
28863
 
28706
- console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
28864
+ warn( 'Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
28707
28865
 
28708
28866
  }
28709
28867
 
@@ -28944,7 +29102,7 @@ class LineSegments extends Line {
28944
29102
 
28945
29103
  } else {
28946
29104
 
28947
- console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
29105
+ warn( 'LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
28948
29106
 
28949
29107
  }
28950
29108
 
@@ -29075,7 +29233,7 @@ class PointsMaterial extends Material {
29075
29233
  /**
29076
29234
  * Defines the size of the points in pixels.
29077
29235
  *
29078
- * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete}.
29236
+ * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete).
29079
29237
  *
29080
29238
  * @type {number}
29081
29239
  * @default 1
@@ -29351,6 +29509,9 @@ function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, inte
29351
29509
  * const texture = new THREE.VideoTexture( video );
29352
29510
  * ```
29353
29511
  *
29512
+ * Note: When using video textures with {@link WebGPURenderer}, {@link Texture#colorSpace} must be
29513
+ * set to THREE.SRGBColorSpace.
29514
+ *
29354
29515
  * Note: After the initial use of a texture, its dimensions, format, and type
29355
29516
  * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.
29356
29517
  *
@@ -29394,18 +29555,28 @@ class VideoTexture extends Texture {
29394
29555
  */
29395
29556
  this.generateMipmaps = false;
29396
29557
 
29558
+ /**
29559
+ * The video frame request callback identifier, which is a positive integer.
29560
+ *
29561
+ * Value of 0 represents no scheduled rVFC.
29562
+ *
29563
+ * @private
29564
+ * @type {number}
29565
+ */
29566
+ this._requestVideoFrameCallbackId = 0;
29567
+
29397
29568
  const scope = this;
29398
29569
 
29399
29570
  function updateVideo() {
29400
29571
 
29401
29572
  scope.needsUpdate = true;
29402
- video.requestVideoFrameCallback( updateVideo );
29573
+ scope._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );
29403
29574
 
29404
29575
  }
29405
29576
 
29406
29577
  if ( 'requestVideoFrameCallback' in video ) {
29407
29578
 
29408
- video.requestVideoFrameCallback( updateVideo );
29579
+ this._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );
29409
29580
 
29410
29581
  }
29411
29582
 
@@ -29436,6 +29607,20 @@ class VideoTexture extends Texture {
29436
29607
 
29437
29608
  }
29438
29609
 
29610
+ dispose() {
29611
+
29612
+ if ( this._requestVideoFrameCallbackId !== 0 ) {
29613
+
29614
+ this.source.data.cancelVideoFrameCallback( this._requestVideoFrameCallbackId );
29615
+
29616
+ this._requestVideoFrameCallbackId = 0;
29617
+
29618
+ }
29619
+
29620
+ super.dispose();
29621
+
29622
+ }
29623
+
29439
29624
  }
29440
29625
 
29441
29626
  /**
@@ -29536,8 +29721,8 @@ class FramebufferTexture extends Texture {
29536
29721
  /**
29537
29722
  * Constructs a new framebuffer texture.
29538
29723
  *
29539
- * @param {number} width - The width of the texture.
29540
- * @param {number} height - The height of the texture.
29724
+ * @param {number} [width] - The width of the texture.
29725
+ * @param {number} [height] - The height of the texture.
29541
29726
  */
29542
29727
  constructor( width, height ) {
29543
29728
 
@@ -29941,6 +30126,59 @@ class DepthTexture extends Texture {
29941
30126
 
29942
30127
  }
29943
30128
 
30129
+ /**
30130
+ * Represents a texture created externally with the same renderer context.
30131
+ *
30132
+ * This may be a texture from a protected media stream, device camera feed,
30133
+ * or other data feeds like a depth sensor.
30134
+ *
30135
+ * Note that this class is only supported in {@link WebGLRenderer}, and in
30136
+ * the {@link WebGPURenderer} WebGPU backend.
30137
+ *
30138
+ * @augments Texture
30139
+ */
30140
+ class ExternalTexture extends Texture {
30141
+
30142
+ /**
30143
+ * Creates a new raw texture.
30144
+ *
30145
+ * @param {?(WebGLTexture|GPUTexture)} [sourceTexture=null] - The external texture.
30146
+ */
30147
+ constructor( sourceTexture = null ) {
30148
+
30149
+ super();
30150
+
30151
+ /**
30152
+ * The external source texture.
30153
+ *
30154
+ * @type {?(WebGLTexture|GPUTexture)}
30155
+ * @default null
30156
+ */
30157
+ this.sourceTexture = sourceTexture;
30158
+
30159
+ /**
30160
+ * This flag can be used for type testing.
30161
+ *
30162
+ * @type {boolean}
30163
+ * @readonly
30164
+ * @default true
30165
+ */
30166
+ this.isExternalTexture = true;
30167
+
30168
+ }
30169
+
30170
+ copy( source ) {
30171
+
30172
+ super.copy( source );
30173
+
30174
+ this.sourceTexture = source.sourceTexture;
30175
+
30176
+ return this;
30177
+
30178
+ }
30179
+
30180
+ }
30181
+
29944
30182
  /**
29945
30183
  * A geometry class for representing a capsule.
29946
30184
  *
@@ -29952,6 +30190,7 @@ class DepthTexture extends Texture {
29952
30190
  * ```
29953
30191
  *
29954
30192
  * @augments BufferGeometry
30193
+ * @demo scenes/geometry-browser.html#CapsuleGeometry
29955
30194
  */
29956
30195
  class CapsuleGeometry extends BufferGeometry {
29957
30196
 
@@ -30169,6 +30408,7 @@ class CapsuleGeometry extends BufferGeometry {
30169
30408
  * ```
30170
30409
  *
30171
30410
  * @augments BufferGeometry
30411
+ * @demo scenes/geometry-browser.html#CircleGeometry
30172
30412
  */
30173
30413
  class CircleGeometry extends BufferGeometry {
30174
30414
 
@@ -30298,6 +30538,7 @@ class CircleGeometry extends BufferGeometry {
30298
30538
  * ```
30299
30539
  *
30300
30540
  * @augments BufferGeometry
30541
+ * @demo scenes/geometry-browser.html#CylinderGeometry
30301
30542
  */
30302
30543
  class CylinderGeometry extends BufferGeometry {
30303
30544
 
@@ -30623,6 +30864,7 @@ class CylinderGeometry extends BufferGeometry {
30623
30864
  * ```
30624
30865
  *
30625
30866
  * @augments CylinderGeometry
30867
+ * @demo scenes/geometry-browser.html#ConeGeometry
30626
30868
  */
30627
30869
  class ConeGeometry extends CylinderGeometry {
30628
30870
 
@@ -31031,6 +31273,7 @@ class PolyhedronGeometry extends BufferGeometry {
31031
31273
  * ```
31032
31274
  *
31033
31275
  * @augments PolyhedronGeometry
31276
+ * @demo scenes/geometry-browser.html#DodecahedronGeometry
31034
31277
  */
31035
31278
  class DodecahedronGeometry extends PolyhedronGeometry {
31036
31279
 
@@ -31350,7 +31593,7 @@ class Curve {
31350
31593
  */
31351
31594
  getPoint( /* t, optionalTarget */ ) {
31352
31595
 
31353
- console.warn( 'THREE.Curve: .getPoint() not implemented.' );
31596
+ warn( 'Curve: .getPoint() not implemented.' );
31354
31597
 
31355
31598
  }
31356
31599
 
@@ -32408,7 +32651,13 @@ class CatmullRomCurve3 extends Curve {
32408
32651
 
32409
32652
  }
32410
32653
 
32411
- // Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
32654
+ /**
32655
+ * Interpolations contains spline and Bézier functions internally used by concrete curve classes.
32656
+ *
32657
+ * Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
32658
+ *
32659
+ * @module Interpolations
32660
+ */
32412
32661
 
32413
32662
  /**
32414
32663
  * Computes a point on a Catmull-Rom spline.
@@ -33894,11 +34143,11 @@ class Path extends CurvePath {
33894
34143
  * Adds an arc as an instance of {@link EllipseCurve} to the path, positioned relative
33895
34144
  * to the current point.
33896
34145
  *
33897
- * @param {number} aX - The x coordinate of the center of the arc offsetted from the previous curve.
33898
- * @param {number} aY - The y coordinate of the center of the arc offsetted from the previous curve.
33899
- * @param {number} aRadius - The radius of the arc.
33900
- * @param {number} aStartAngle - The start angle in radians.
33901
- * @param {number} aEndAngle - The end angle in radians.
34146
+ * @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve.
34147
+ * @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve.
34148
+ * @param {number} [aRadius=1] - The radius of the arc.
34149
+ * @param {number} [aStartAngle=0] - The start angle in radians.
34150
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
33902
34151
  * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
33903
34152
  * @return {Path} A reference to this path.
33904
34153
  */
@@ -33917,11 +34166,11 @@ class Path extends CurvePath {
33917
34166
  /**
33918
34167
  * Adds an absolutely positioned arc as an instance of {@link EllipseCurve} to the path.
33919
34168
  *
33920
- * @param {number} aX - The x coordinate of the center of the arc.
33921
- * @param {number} aY - The y coordinate of the center of the arc.
33922
- * @param {number} aRadius - The radius of the arc.
33923
- * @param {number} aStartAngle - The start angle in radians.
33924
- * @param {number} aEndAngle - The end angle in radians.
34169
+ * @param {number} [aX=0] - The x coordinate of the center of the arc.
34170
+ * @param {number} [aY=0] - The y coordinate of the center of the arc.
34171
+ * @param {number} [aRadius=1] - The radius of the arc.
34172
+ * @param {number} [aStartAngle=0] - The start angle in radians.
34173
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
33925
34174
  * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.
33926
34175
  * @return {Path} A reference to this path.
33927
34176
  */
@@ -33937,12 +34186,12 @@ class Path extends CurvePath {
33937
34186
  * Adds an ellipse as an instance of {@link EllipseCurve} to the path, positioned relative
33938
34187
  * to the current point
33939
34188
  *
33940
- * @param {number} aX - The x coordinate of the center of the ellipse offsetted from the previous curve.
33941
- * @param {number} aY - The y coordinate of the center of the ellipse offsetted from the previous curve.
33942
- * @param {number} xRadius - The radius of the ellipse in the x axis.
33943
- * @param {number} yRadius - The radius of the ellipse in the y axis.
33944
- * @param {number} aStartAngle - The start angle in radians.
33945
- * @param {number} aEndAngle - The end angle in radians.
34189
+ * @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve.
34190
+ * @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve.
34191
+ * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
34192
+ * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
34193
+ * @param {number} [aStartAngle=0] - The start angle in radians.
34194
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
33946
34195
  * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
33947
34196
  * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
33948
34197
  * @return {Path} A reference to this path.
@@ -33961,12 +34210,12 @@ class Path extends CurvePath {
33961
34210
  /**
33962
34211
  * Adds an absolutely positioned ellipse as an instance of {@link EllipseCurve} to the path.
33963
34212
  *
33964
- * @param {number} aX - The x coordinate of the absolute center of the ellipse.
33965
- * @param {number} aY - The y coordinate of the absolute center of the ellipse.
33966
- * @param {number} xRadius - The radius of the ellipse in the x axis.
33967
- * @param {number} yRadius - The radius of the ellipse in the y axis.
33968
- * @param {number} aStartAngle - The start angle in radians.
33969
- * @param {number} aEndAngle - The end angle in radians.
34213
+ * @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse.
34214
+ * @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse.
34215
+ * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.
34216
+ * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.
34217
+ * @param {number} [aStartAngle=0] - The start angle in radians.
34218
+ * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.
33970
34219
  * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.
33971
34220
  * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.
33972
34221
  * @return {Path} A reference to this path.
@@ -34190,8 +34439,8 @@ class Shape extends Path {
34190
34439
  }
34191
34440
 
34192
34441
  /* eslint-disable */
34193
- // copy of mapbox/earcut version 3.0.1
34194
- // https://github.com/mapbox/earcut/tree/v3.0.1
34442
+ // copy of mapbox/earcut version 3.0.2
34443
+ // https://github.com/mapbox/earcut/tree/v3.0.2
34195
34444
 
34196
34445
  function earcut(data, holeIndices, dim = 2) {
34197
34446
 
@@ -34208,10 +34457,10 @@ function earcut(data, holeIndices, dim = 2) {
34208
34457
 
34209
34458
  // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
34210
34459
  if (data.length > 80 * dim) {
34211
- minX = Infinity;
34212
- minY = Infinity;
34213
- let maxX = -Infinity;
34214
- let maxY = -Infinity;
34460
+ minX = data[0];
34461
+ minY = data[1];
34462
+ let maxX = minX;
34463
+ let maxY = minY;
34215
34464
 
34216
34465
  for (let i = dim; i < outerLen; i += dim) {
34217
34466
  const x = data[i];
@@ -34487,7 +34736,7 @@ function compareXYSlope(a, b) {
34487
34736
  return result;
34488
34737
  }
34489
34738
 
34490
- // find a bridge between vertices that connects hole with an outer ring and and link it
34739
+ // find a bridge between vertices that connects hole with an outer ring and link it
34491
34740
  function eliminateHole(hole, outerNode) {
34492
34741
  const bridge = findHoleBridge(hole, outerNode);
34493
34742
  if (!bridge) {
@@ -34678,7 +34927,7 @@ function pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {
34678
34927
 
34679
34928
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
34680
34929
  function isValidDiagonal(a, b) {
34681
- return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
34930
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges
34682
34931
  (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
34683
34932
  (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
34684
34933
  equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
@@ -34825,6 +35074,12 @@ function signedArea(data, start, end, dim) {
34825
35074
  return sum;
34826
35075
  }
34827
35076
 
35077
+ /**
35078
+ * An implementation of the earcut polygon triangulation algorithm.
35079
+ * The code is a port of [mapbox/earcut](https://github.com/mapbox/earcut).
35080
+ *
35081
+ * @see https://github.com/mapbox/earcut
35082
+ */
34828
35083
  class Earcut {
34829
35084
 
34830
35085
  /**
@@ -34975,6 +35230,7 @@ function addContour( vertices, contour ) {
34975
35230
  * ```
34976
35231
  *
34977
35232
  * @augments BufferGeometry
35233
+ * @demo scenes/geometry-browser.html#ExtrudeGeometry
34978
35234
  */
34979
35235
  class ExtrudeGeometry extends BufferGeometry {
34980
35236
 
@@ -35063,7 +35319,7 @@ class ExtrudeGeometry extends BufferGeometry {
35063
35319
 
35064
35320
  splineTube = extrudePath.computeFrenetFrames( steps, false );
35065
35321
 
35066
- // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);
35322
+ // log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);
35067
35323
 
35068
35324
  binormal = new Vector3();
35069
35325
  normal = new Vector3();
@@ -35168,7 +35424,7 @@ class ExtrudeGeometry extends BufferGeometry {
35168
35424
 
35169
35425
  function scalePt2( pt, vec, size ) {
35170
35426
 
35171
- if ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );
35427
+ if ( ! vec ) error( 'ExtrudeGeometry: vec does not exist' );
35172
35428
 
35173
35429
  return pt.clone().addScaledVector( vec, size );
35174
35430
 
@@ -35283,14 +35539,14 @@ class ExtrudeGeometry extends BufferGeometry {
35283
35539
 
35284
35540
  if ( direction_eq ) {
35285
35541
 
35286
- // console.log("Warning: lines are a straight sequence");
35542
+ // log("Warning: lines are a straight sequence");
35287
35543
  v_trans_x = - v_prev_y;
35288
35544
  v_trans_y = v_prev_x;
35289
35545
  shrink_by = Math.sqrt( v_prev_lensq );
35290
35546
 
35291
35547
  } else {
35292
35548
 
35293
- // console.log("Warning: lines are a straight spike");
35549
+ // log("Warning: lines are a straight spike");
35294
35550
  v_trans_x = v_prev_x;
35295
35551
  v_trans_y = v_prev_y;
35296
35552
  shrink_by = Math.sqrt( v_prev_lensq / 2 );
@@ -35312,7 +35568,7 @@ class ExtrudeGeometry extends BufferGeometry {
35312
35568
  if ( k === il ) k = 0;
35313
35569
 
35314
35570
  // (j)---(i)---(k)
35315
- // console.log('i,j,k', i, j , k)
35571
+ // log('i,j,k', i, j , k)
35316
35572
 
35317
35573
  contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );
35318
35574
 
@@ -35609,7 +35865,7 @@ class ExtrudeGeometry extends BufferGeometry {
35609
35865
  let k = i - 1;
35610
35866
  if ( k < 0 ) k = contour.length - 1;
35611
35867
 
35612
- //console.log('b', i,j, i-1, k,vertices.length);
35868
+ //log('b', i,j, i-1, k,vertices.length);
35613
35869
 
35614
35870
  for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {
35615
35871
 
@@ -35849,6 +36105,7 @@ function toJSON$1( shapes, options, data ) {
35849
36105
  * ```
35850
36106
  *
35851
36107
  * @augments PolyhedronGeometry
36108
+ * @demo scenes/geometry-browser.html#IcosahedronGeometry
35852
36109
  */
35853
36110
  class IcosahedronGeometry extends PolyhedronGeometry {
35854
36111
 
@@ -35923,6 +36180,7 @@ class IcosahedronGeometry extends PolyhedronGeometry {
35923
36180
  * ```
35924
36181
  *
35925
36182
  * @augments BufferGeometry
36183
+ * @demo scenes/geometry-browser.html#LatheGeometry
35926
36184
  */
35927
36185
  class LatheGeometry extends BufferGeometry {
35928
36186
 
@@ -36140,6 +36398,7 @@ class LatheGeometry extends BufferGeometry {
36140
36398
  * ```
36141
36399
  *
36142
36400
  * @augments PolyhedronGeometry
36401
+ * @demo scenes/geometry-browser.html#OctahedronGeometry
36143
36402
  */
36144
36403
  class OctahedronGeometry extends PolyhedronGeometry {
36145
36404
 
@@ -36206,6 +36465,7 @@ class OctahedronGeometry extends PolyhedronGeometry {
36206
36465
  * ```
36207
36466
  *
36208
36467
  * @augments BufferGeometry
36468
+ * @demo scenes/geometry-browser.html#PlaneGeometry
36209
36469
  */
36210
36470
  class PlaneGeometry extends BufferGeometry {
36211
36471
 
@@ -36334,6 +36594,7 @@ class PlaneGeometry extends BufferGeometry {
36334
36594
  * ```
36335
36595
  *
36336
36596
  * @augments BufferGeometry
36597
+ * @demo scenes/geometry-browser.html#RingGeometry
36337
36598
  */
36338
36599
  class RingGeometry extends BufferGeometry {
36339
36600
 
@@ -36495,6 +36756,7 @@ class RingGeometry extends BufferGeometry {
36495
36756
  * ```
36496
36757
  *
36497
36758
  * @augments BufferGeometry
36759
+ * @demo scenes/geometry-browser.html#ShapeGeometry
36498
36760
  */
36499
36761
  class ShapeGeometry extends BufferGeometry {
36500
36762
 
@@ -36716,6 +36978,7 @@ function toJSON( shapes, data ) {
36716
36978
  * ```
36717
36979
  *
36718
36980
  * @augments BufferGeometry
36981
+ * @demo scenes/geometry-browser.html#SphereGeometry
36719
36982
  */
36720
36983
  class SphereGeometry extends BufferGeometry {
36721
36984
 
@@ -36885,6 +37148,7 @@ class SphereGeometry extends BufferGeometry {
36885
37148
  * ```
36886
37149
  *
36887
37150
  * @augments PolyhedronGeometry
37151
+ * @demo scenes/geometry-browser.html#TetrahedronGeometry
36888
37152
  */
36889
37153
  class TetrahedronGeometry extends PolyhedronGeometry {
36890
37154
 
@@ -36948,6 +37212,7 @@ class TetrahedronGeometry extends PolyhedronGeometry {
36948
37212
  * ```
36949
37213
  *
36950
37214
  * @augments BufferGeometry
37215
+ * @demo scenes/geometry-browser.html#TorusGeometry
36951
37216
  */
36952
37217
  class TorusGeometry extends BufferGeometry {
36953
37218
 
@@ -37100,6 +37365,7 @@ class TorusGeometry extends BufferGeometry {
37100
37365
  * ```
37101
37366
  *
37102
37367
  * @augments BufferGeometry
37368
+ * @demo scenes/geometry-browser.html#TorusKnotGeometry
37103
37369
  */
37104
37370
  class TorusKnotGeometry extends BufferGeometry {
37105
37371
 
@@ -37312,6 +37578,7 @@ class TorusKnotGeometry extends BufferGeometry {
37312
37578
  * ```
37313
37579
  *
37314
37580
  * @augments BufferGeometry
37581
+ * @demo scenes/geometry-browser.html#TubeGeometry
37315
37582
  */
37316
37583
  class TubeGeometry extends BufferGeometry {
37317
37584
 
@@ -37859,9 +38126,9 @@ class RawShaderMaterial extends ShaderMaterial {
37859
38126
  * A standard physically based material, using Metallic-Roughness workflow.
37860
38127
  *
37861
38128
  * Physically based rendering (PBR) has recently become the standard in many
37862
- * 3D applications, such as [Unity]{@link https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/},
37863
- * [Unreal]{@link https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/} and
37864
- * [3D Studio Max]{@link http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017}.
38129
+ * 3D applications, such as [Unity](https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/),
38130
+ * [Unreal](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/) and
38131
+ * [3D Studio Max](http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017).
37865
38132
  *
37866
38133
  * This approach differs from older approaches in that instead of using
37867
38134
  * approximations for the way in which light interacts with a surface, a
@@ -37877,16 +38144,17 @@ class RawShaderMaterial extends ShaderMaterial {
37877
38144
  * Note that for best results you should always specify an environment map when using this material.
37878
38145
  *
37879
38146
  * For a non-technical introduction to the concept of PBR and how to set up a
37880
- * PBR material, check out these articles by the people at [marmoset]{@link https://www.marmoset.co}:
38147
+ * PBR material, check out these articles by the people at [marmoset](https://www.marmoset.co):
37881
38148
  *
37882
- * - [Basic Theory of Physically Based Rendering]{@link https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/}
37883
- * - [Physically Based Rendering and You Can Too]{@link https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/}
38149
+ * - [Basic Theory of Physically Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/)
38150
+ * - [Physically Based Rendering and You Can Too](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/)
37884
38151
  *
37885
38152
  * Technical details of the approach used in three.js (and most other PBR systems) can be found is this
37886
- * [paper from Disney]{@link https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf}
38153
+ * [paper from Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf)
37887
38154
  * (pdf), by Brent Burley.
37888
38155
  *
37889
38156
  * @augments Material
38157
+ * @demo scenes/material-browser.html#MeshStandardMaterial
37890
38158
  */
37891
38159
  class MeshStandardMaterial extends Material {
37892
38160
 
@@ -38296,6 +38564,7 @@ class MeshStandardMaterial extends Material {
38296
38564
  * best results, always specify an environment map when using this material.
38297
38565
  *
38298
38566
  * @augments MeshStandardMaterial
38567
+ * @demo scenes/material-browser.html#MeshPhysicalMaterial
38299
38568
  */
38300
38569
  class MeshPhysicalMaterial extends MeshStandardMaterial {
38301
38570
 
@@ -38592,7 +38861,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38592
38861
  }
38593
38862
 
38594
38863
  /**
38595
- * The anisotropy strength.
38864
+ * The anisotropy strength, from `0.0` to `1.0`.
38596
38865
  *
38597
38866
  * @type {number}
38598
38867
  * @default 0
@@ -38804,7 +39073,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38804
39073
  /**
38805
39074
  * A material for shiny surfaces with specular highlights.
38806
39075
  *
38807
- * The material uses a non-physically based [Blinn-Phong]{@link https://en.wikipedia.org/wiki/Blinn-Phong_shading_model}
39076
+ * The material uses a non-physically based [Blinn-Phong](https://en.wikipedia.org/wiki/Blinn-Phong_shading_model)
38808
39077
  * model for calculating reflectance. Unlike the Lambertian model used in the
38809
39078
  * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular
38810
39079
  * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading.
@@ -38814,6 +39083,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38814
39083
  * some graphical accuracy.
38815
39084
  *
38816
39085
  * @augments Material
39086
+ * @demo scenes/material-browser.html#MeshPhongMaterial
38817
39087
  */
38818
39088
  class MeshPhongMaterial extends Material {
38819
39089
 
@@ -39209,6 +39479,7 @@ class MeshPhongMaterial extends Material {
39209
39479
  * A material implementing toon shading.
39210
39480
  *
39211
39481
  * @augments Material
39482
+ * @demo scenes/material-browser.html#MeshToonMaterial
39212
39483
  */
39213
39484
  class MeshToonMaterial extends Material {
39214
39485
 
@@ -39523,6 +39794,7 @@ class MeshToonMaterial extends Material {
39523
39794
  * A material that maps the normal vectors to RGB colors.
39524
39795
  *
39525
39796
  * @augments Material
39797
+ * @demo scenes/material-browser.html#MeshNormalMaterial
39526
39798
  */
39527
39799
  class MeshNormalMaterial extends Material {
39528
39800
 
@@ -39691,7 +39963,7 @@ class MeshNormalMaterial extends Material {
39691
39963
  /**
39692
39964
  * A material for non-shiny surfaces, without specular highlights.
39693
39965
  *
39694
- * The material uses a non-physically based [Lambertian]{@link https://en.wikipedia.org/wiki/Lambertian_reflectance}
39966
+ * The material uses a non-physically based [Lambertian](https://en.wikipedia.org/wiki/Lambertian_reflectance)
39695
39967
  * model for calculating reflectance. This can simulate some surfaces (such
39696
39968
  * as untreated wood or stone) well, but cannot simulate shiny surfaces with
39697
39969
  * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment
@@ -39703,6 +39975,7 @@ class MeshNormalMaterial extends Material {
39703
39975
  * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy.
39704
39976
  *
39705
39977
  * @augments Material
39978
+ * @demo scenes/material-browser.html#MeshLambertMaterial
39706
39979
  */
39707
39980
  class MeshLambertMaterial extends Material {
39708
39981
 
@@ -40078,6 +40351,7 @@ class MeshLambertMaterial extends Material {
40078
40351
  * near and far plane. White is nearest, black is farthest.
40079
40352
  *
40080
40353
  * @augments Material
40354
+ * @demo scenes/material-browser.html#MeshDepthMaterial
40081
40355
  */
40082
40356
  class MeshDepthMaterial extends Material {
40083
40357
 
@@ -40223,7 +40497,7 @@ class MeshDepthMaterial extends Material {
40223
40497
  * Can also be used to customize the shadow casting of an object by assigning
40224
40498
  * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}.
40225
40499
  * The following examples demonstrates this approach in order to ensure
40226
- * transparent parts of objects do no cast shadows.
40500
+ * transparent parts of objects do not cast shadows.
40227
40501
  *
40228
40502
  * @augments Material
40229
40503
  */
@@ -40342,6 +40616,7 @@ class MeshDistanceMaterial extends Material {
40342
40616
  * shadows.
40343
40617
  *
40344
40618
  * @augments Material
40619
+ * @demo scenes/material-browser.html#MeshMatcapMaterial
40345
40620
  */
40346
40621
  class MeshMatcapMaterial extends Material {
40347
40622
 
@@ -40493,6 +40768,24 @@ class MeshMatcapMaterial extends Material {
40493
40768
  */
40494
40769
  this.alphaMap = null;
40495
40770
 
40771
+ /**
40772
+ * Renders the geometry as a wireframe.
40773
+ *
40774
+ * @type {boolean}
40775
+ * @default false
40776
+ */
40777
+ this.wireframe = false;
40778
+
40779
+ /**
40780
+ * Controls the thickness of the wireframe.
40781
+ *
40782
+ * Can only be used with {@link SVGRenderer}.
40783
+ *
40784
+ * @type {number}
40785
+ * @default 1
40786
+ */
40787
+ this.wireframeLinewidth = 1;
40788
+
40496
40789
  /**
40497
40790
  * Whether the material is rendered with flat shading or not.
40498
40791
  *
@@ -40539,6 +40832,9 @@ class MeshMatcapMaterial extends Material {
40539
40832
 
40540
40833
  this.alphaMap = source.alphaMap;
40541
40834
 
40835
+ this.wireframe = source.wireframe;
40836
+ this.wireframeLinewidth = source.wireframeLinewidth;
40837
+
40542
40838
  this.flatShading = source.flatShading;
40543
40839
 
40544
40840
  this.fog = source.fog;
@@ -41688,7 +41984,7 @@ class KeyframeTrack {
41688
41984
  *
41689
41985
  * @param {string} name - The keyframe track's name.
41690
41986
  * @param {Array<number>} times - A list of keyframe times.
41691
- * @param {Array<number>} values - A list of keyframe values.
41987
+ * @param {Array<number|string|boolean>} values - A list of keyframe values.
41692
41988
  * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
41693
41989
  */
41694
41990
  constructor( name, times, values, interpolation ) {
@@ -41859,7 +42155,7 @@ class KeyframeTrack {
41859
42155
 
41860
42156
  }
41861
42157
 
41862
- console.warn( 'THREE.KeyframeTrack:', message );
42158
+ warn( 'KeyframeTrack:', message );
41863
42159
  return this;
41864
42160
 
41865
42161
  }
@@ -42019,7 +42315,7 @@ class KeyframeTrack {
42019
42315
  const valueSize = this.getValueSize();
42020
42316
  if ( valueSize - Math.floor( valueSize ) !== 0 ) {
42021
42317
 
42022
- console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );
42318
+ error( 'KeyframeTrack: Invalid value size in track.', this );
42023
42319
  valid = false;
42024
42320
 
42025
42321
  }
@@ -42031,7 +42327,7 @@ class KeyframeTrack {
42031
42327
 
42032
42328
  if ( nKeys === 0 ) {
42033
42329
 
42034
- console.error( 'THREE.KeyframeTrack: Track is empty.', this );
42330
+ error( 'KeyframeTrack: Track is empty.', this );
42035
42331
  valid = false;
42036
42332
 
42037
42333
  }
@@ -42044,7 +42340,7 @@ class KeyframeTrack {
42044
42340
 
42045
42341
  if ( typeof currTime === 'number' && isNaN( currTime ) ) {
42046
42342
 
42047
- console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );
42343
+ error( 'KeyframeTrack: Time is not a valid number.', this, i, currTime );
42048
42344
  valid = false;
42049
42345
  break;
42050
42346
 
@@ -42052,7 +42348,7 @@ class KeyframeTrack {
42052
42348
 
42053
42349
  if ( prevTime !== null && prevTime > currTime ) {
42054
42350
 
42055
- console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
42351
+ error( 'KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
42056
42352
  valid = false;
42057
42353
  break;
42058
42354
 
@@ -42072,7 +42368,7 @@ class KeyframeTrack {
42072
42368
 
42073
42369
  if ( isNaN( value ) ) {
42074
42370
 
42075
- console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );
42371
+ error( 'KeyframeTrack: Value is not a valid number.', this, i, value );
42076
42372
  valid = false;
42077
42373
  break;
42078
42374
 
@@ -42276,7 +42572,7 @@ class BooleanKeyframeTrack extends KeyframeTrack {
42276
42572
  *
42277
42573
  * @param {string} name - The keyframe track's name.
42278
42574
  * @param {Array<number>} times - A list of keyframe times.
42279
- * @param {Array<number>} values - A list of keyframe values.
42575
+ * @param {Array<boolean>} values - A list of keyframe values.
42280
42576
  */
42281
42577
  constructor( name, times, values ) {
42282
42578
 
@@ -42479,7 +42775,7 @@ class StringKeyframeTrack extends KeyframeTrack {
42479
42775
  *
42480
42776
  * @param {string} name - The keyframe track's name.
42481
42777
  * @param {Array<number>} times - A list of keyframe times.
42482
- * @param {Array<number>} values - A list of keyframe values.
42778
+ * @param {Array<string>} values - A list of keyframe values.
42483
42779
  */
42484
42780
  constructor( name, times, values ) {
42485
42781
 
@@ -42604,6 +42900,14 @@ class AnimationClip {
42604
42900
  */
42605
42901
  this.uuid = generateUUID();
42606
42902
 
42903
+ /**
42904
+ * An object that can be used to store custom data about the animation clip.
42905
+ * It should not hold references to functions as these will not be cloned.
42906
+ *
42907
+ * @type {Object}
42908
+ */
42909
+ this.userData = {};
42910
+
42607
42911
  // this means it should figure out its duration by scanning the tracks
42608
42912
  if ( this.duration < 0 ) {
42609
42913
 
@@ -42635,6 +42939,8 @@ class AnimationClip {
42635
42939
  const clip = new this( json.name, json.duration, tracks, json.blendMode );
42636
42940
  clip.uuid = json.uuid;
42637
42941
 
42942
+ clip.userData = JSON.parse( json.userData || '{}' );
42943
+
42638
42944
  return clip;
42639
42945
 
42640
42946
  }
@@ -42657,7 +42963,8 @@ class AnimationClip {
42657
42963
  'duration': clip.duration,
42658
42964
  'tracks': tracks,
42659
42965
  'uuid': clip.uuid,
42660
- 'blendMode': clip.blendMode
42966
+ 'blendMode': clip.blendMode,
42967
+ 'userData': JSON.stringify( clip.userData ),
42661
42968
 
42662
42969
  };
42663
42970
 
@@ -42831,11 +43138,11 @@ class AnimationClip {
42831
43138
  */
42832
43139
  static parseAnimation( animation, bones ) {
42833
43140
 
42834
- console.warn( 'THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185' );
43141
+ warn( 'AnimationClip: parseAnimation() is deprecated and will be removed with r185' );
42835
43142
 
42836
43143
  if ( ! animation ) {
42837
43144
 
42838
- console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );
43145
+ error( 'AnimationClip: No animation in JSONLoader data.' );
42839
43146
  return null;
42840
43147
 
42841
43148
  }
@@ -43052,7 +43359,11 @@ class AnimationClip {
43052
43359
 
43053
43360
  }
43054
43361
 
43055
- return new this.constructor( this.name, this.duration, tracks, this.blendMode );
43362
+ const clip = new this.constructor( this.name, this.duration, tracks, this.blendMode );
43363
+
43364
+ clip.userData = JSON.parse( JSON.stringify( this.userData ) );
43365
+
43366
+ return clip;
43056
43367
 
43057
43368
  }
43058
43369
 
@@ -43183,7 +43494,7 @@ const Cache = {
43183
43494
 
43184
43495
  if ( this.enabled === false ) return;
43185
43496
 
43186
- // console.log( 'THREE.Cache', 'Adding key:', key );
43497
+ // log( 'Cache', 'Adding key:', key );
43187
43498
 
43188
43499
  this.files[ key ] = file;
43189
43500
 
@@ -43200,7 +43511,7 @@ const Cache = {
43200
43511
 
43201
43512
  if ( this.enabled === false ) return;
43202
43513
 
43203
- // console.log( 'THREE.Cache', 'Checking key:', key );
43514
+ // log( 'Cache', 'Checking key:', key );
43204
43515
 
43205
43516
  return this.files[ key ];
43206
43517
 
@@ -43302,6 +43613,14 @@ class LoadingManager {
43302
43613
  */
43303
43614
  this.onError = onError;
43304
43615
 
43616
+ /**
43617
+ * Used for aborting ongoing requests in loaders using this manager.
43618
+ *
43619
+ * @private
43620
+ * @type {AbortController | null}
43621
+ */
43622
+ this._abortController = null;
43623
+
43305
43624
  /**
43306
43625
  * This should be called by any loader using the manager when the loader
43307
43626
  * starts loading an item.
@@ -43502,6 +43821,43 @@ class LoadingManager {
43502
43821
 
43503
43822
  };
43504
43823
 
43824
+ /**
43825
+ * Can be used to abort ongoing loading requests in loaders using this manager.
43826
+ * The abort only works if the loaders implement {@link Loader#abort} and `AbortSignal.any()`
43827
+ * is supported in the browser.
43828
+ *
43829
+ * @return {LoadingManager} A reference to this loading manager.
43830
+ */
43831
+ this.abort = function () {
43832
+
43833
+
43834
+ this.abortController.abort();
43835
+ this._abortController = null;
43836
+
43837
+ return this;
43838
+
43839
+ };
43840
+
43841
+ }
43842
+
43843
+ // TODO: Revert this back to a single member variable once this issue has been fixed
43844
+ // https://github.com/cloudflare/workerd/issues/3657
43845
+
43846
+ /**
43847
+ * Used for aborting ongoing requests in loaders using this manager.
43848
+ *
43849
+ * @type {AbortController}
43850
+ */
43851
+ get abortController() {
43852
+
43853
+ if ( ! this._abortController ) {
43854
+
43855
+ this._abortController = new AbortController();
43856
+
43857
+ }
43858
+
43859
+ return this._abortController;
43860
+
43505
43861
  }
43506
43862
 
43507
43863
  }
@@ -43568,7 +43924,7 @@ class Loader {
43568
43924
  this.resourcePath = '';
43569
43925
 
43570
43926
  /**
43571
- * The [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}
43927
+ * The [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)
43572
43928
  * used in HTTP request.
43573
43929
  *
43574
43930
  * @type {Object<string, any>}
@@ -43581,6 +43937,7 @@ class Loader {
43581
43937
  * This method needs to be implemented by all concrete loaders. It holds the
43582
43938
  * logic for loading assets from the backend.
43583
43939
  *
43940
+ * @abstract
43584
43941
  * @param {string} url - The path/URL of the file to be loaded.
43585
43942
  * @param {Function} onLoad - Executed when the loading process has been finished.
43586
43943
  * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
@@ -43611,6 +43968,7 @@ class Loader {
43611
43968
  * This method needs to be implemented by all concrete loaders. It holds the
43612
43969
  * logic for parsing the asset into three.js entities.
43613
43970
  *
43971
+ * @abstract
43614
43972
  * @param {any} data - The data to parse.
43615
43973
  */
43616
43974
  parse( /* data */ ) {}
@@ -43631,7 +43989,7 @@ class Loader {
43631
43989
 
43632
43990
  /**
43633
43991
  * Whether the XMLHttpRequest uses credentials such as cookies, authorization
43634
- * headers or TLS client certificates, see [XMLHttpRequest.withCredentials]{@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials}.
43992
+ * headers or TLS client certificates, see [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials).
43635
43993
  *
43636
43994
  * Note: This setting has no effect if you are loading files locally or from the same domain.
43637
43995
  *
@@ -43674,7 +44032,7 @@ class Loader {
43674
44032
  /**
43675
44033
  * Sets the given request header.
43676
44034
  *
43677
- * @param {Object} requestHeader - A [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}
44035
+ * @param {Object} requestHeader - A [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)
43678
44036
  * for configuring the HTTP request.
43679
44037
  * @return {Loader} A reference to this instance.
43680
44038
  */
@@ -43685,6 +44043,18 @@ class Loader {
43685
44043
 
43686
44044
  }
43687
44045
 
44046
+ /**
44047
+ * This method can be implemented in loaders for aborting ongoing requests.
44048
+ *
44049
+ * @abstract
44050
+ * @return {Loader} A reference to this instance.
44051
+ */
44052
+ abort() {
44053
+
44054
+ return this;
44055
+
44056
+ }
44057
+
43688
44058
  }
43689
44059
 
43690
44060
  /**
@@ -43753,7 +44123,8 @@ class FileLoader extends Loader {
43753
44123
  super( manager );
43754
44124
 
43755
44125
  /**
43756
- * The expected mime type.
44126
+ * The expected mime type. Valid values can be found
44127
+ * [here](hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype)
43757
44128
  *
43758
44129
  * @type {string}
43759
44130
  */
@@ -43767,6 +44138,14 @@ class FileLoader extends Loader {
43767
44138
  */
43768
44139
  this.responseType = '';
43769
44140
 
44141
+ /**
44142
+ * Used for aborting requests.
44143
+ *
44144
+ * @private
44145
+ * @type {AbortController}
44146
+ */
44147
+ this._abortController = new AbortController();
44148
+
43770
44149
  }
43771
44150
 
43772
44151
  /**
@@ -43786,7 +44165,7 @@ class FileLoader extends Loader {
43786
44165
 
43787
44166
  url = this.manager.resolveURL( url );
43788
44167
 
43789
- const cached = Cache.get( url );
44168
+ const cached = Cache.get( `file:${url}` );
43790
44169
 
43791
44170
  if ( cached !== undefined ) {
43792
44171
 
@@ -43833,7 +44212,7 @@ class FileLoader extends Loader {
43833
44212
  const req = new Request( url, {
43834
44213
  headers: new Headers( this.requestHeader ),
43835
44214
  credentials: this.withCredentials ? 'include' : 'same-origin',
43836
- // An abort controller could be added within a future PR
44215
+ signal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal
43837
44216
  } );
43838
44217
 
43839
44218
  // record states ( avoid data race )
@@ -43851,7 +44230,7 @@ class FileLoader extends Loader {
43851
44230
 
43852
44231
  if ( response.status === 0 ) {
43853
44232
 
43854
- console.warn( 'THREE.FileLoader: HTTP Status 0 received.' );
44233
+ warn( 'FileLoader: HTTP Status 0 received.' );
43855
44234
 
43856
44235
  }
43857
44236
 
@@ -43975,7 +44354,7 @@ class FileLoader extends Loader {
43975
44354
 
43976
44355
  // Add to cache only on HTTP success, so that we do not cache
43977
44356
  // error response bodies as proper responses to requests.
43978
- Cache.add( url, data );
44357
+ Cache.add( `file:${url}`, data );
43979
44358
 
43980
44359
  const callbacks = loading[ url ];
43981
44360
  delete loading[ url ];
@@ -44050,6 +44429,20 @@ class FileLoader extends Loader {
44050
44429
 
44051
44430
  }
44052
44431
 
44432
+ /**
44433
+ * Aborts ongoing fetch requests.
44434
+ *
44435
+ * @return {FileLoader} A reference to this instance.
44436
+ */
44437
+ abort() {
44438
+
44439
+ this._abortController.abort();
44440
+ this._abortController = new AbortController();
44441
+
44442
+ return this;
44443
+
44444
+ }
44445
+
44053
44446
  }
44054
44447
 
44055
44448
  /**
@@ -44107,7 +44500,7 @@ class AnimationLoader extends Loader {
44107
44500
 
44108
44501
  } else {
44109
44502
 
44110
- console.error( e );
44503
+ error( e );
44111
44504
 
44112
44505
  }
44113
44506
 
@@ -44291,6 +44684,8 @@ class CompressedTextureLoader extends Loader {
44291
44684
 
44292
44685
  }
44293
44686
 
44687
+ const _loading = new WeakMap();
44688
+
44294
44689
  /**
44295
44690
  * A loader for loading images. The class loads images with the HTML `Image` API.
44296
44691
  *
@@ -44300,7 +44695,7 @@ class CompressedTextureLoader extends Loader {
44300
44695
  * ```
44301
44696
  * Please note that `ImageLoader` has dropped support for progress
44302
44697
  * events in `r84`. For an `ImageLoader` that supports progress events, see
44303
- * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639}.
44698
+ * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639).
44304
44699
  *
44305
44700
  * @augments Loader
44306
44701
  */
@@ -44337,19 +44732,36 @@ class ImageLoader extends Loader {
44337
44732
 
44338
44733
  const scope = this;
44339
44734
 
44340
- const cached = Cache.get( url );
44735
+ const cached = Cache.get( `image:${url}` );
44341
44736
 
44342
44737
  if ( cached !== undefined ) {
44343
44738
 
44344
- scope.manager.itemStart( url );
44739
+ if ( cached.complete === true ) {
44345
44740
 
44346
- setTimeout( function () {
44741
+ scope.manager.itemStart( url );
44347
44742
 
44348
- if ( onLoad ) onLoad( cached );
44743
+ setTimeout( function () {
44349
44744
 
44350
- scope.manager.itemEnd( url );
44745
+ if ( onLoad ) onLoad( cached );
44351
44746
 
44352
- }, 0 );
44747
+ scope.manager.itemEnd( url );
44748
+
44749
+ }, 0 );
44750
+
44751
+ } else {
44752
+
44753
+ let arr = _loading.get( cached );
44754
+
44755
+ if ( arr === undefined ) {
44756
+
44757
+ arr = [];
44758
+ _loading.set( cached, arr );
44759
+
44760
+ }
44761
+
44762
+ arr.push( { onLoad, onError } );
44763
+
44764
+ }
44353
44765
 
44354
44766
  return cached;
44355
44767
 
@@ -44361,10 +44773,21 @@ class ImageLoader extends Loader {
44361
44773
 
44362
44774
  removeEventListeners();
44363
44775
 
44364
- Cache.add( url, this );
44365
-
44366
44776
  if ( onLoad ) onLoad( this );
44367
44777
 
44778
+ //
44779
+
44780
+ const callbacks = _loading.get( this ) || [];
44781
+
44782
+ for ( let i = 0; i < callbacks.length; i ++ ) {
44783
+
44784
+ const callback = callbacks[ i ];
44785
+ if ( callback.onLoad ) callback.onLoad( this );
44786
+
44787
+ }
44788
+
44789
+ _loading.delete( this );
44790
+
44368
44791
  scope.manager.itemEnd( url );
44369
44792
 
44370
44793
  }
@@ -44375,6 +44798,22 @@ class ImageLoader extends Loader {
44375
44798
 
44376
44799
  if ( onError ) onError( event );
44377
44800
 
44801
+ Cache.remove( `image:${url}` );
44802
+
44803
+ //
44804
+
44805
+ const callbacks = _loading.get( this ) || [];
44806
+
44807
+ for ( let i = 0; i < callbacks.length; i ++ ) {
44808
+
44809
+ const callback = callbacks[ i ];
44810
+ if ( callback.onError ) callback.onError( event );
44811
+
44812
+ }
44813
+
44814
+ _loading.delete( this );
44815
+
44816
+
44378
44817
  scope.manager.itemError( url );
44379
44818
  scope.manager.itemEnd( url );
44380
44819
 
@@ -44396,6 +44835,7 @@ class ImageLoader extends Loader {
44396
44835
 
44397
44836
  }
44398
44837
 
44838
+ Cache.add( `image:${url}`, image );
44399
44839
  scope.manager.itemStart( url );
44400
44840
 
44401
44841
  image.src = url;
@@ -44564,7 +45004,7 @@ class DataTextureLoader extends Loader {
44564
45004
 
44565
45005
  } else {
44566
45006
 
44567
- console.error( error );
45007
+ error( error );
44568
45008
  return;
44569
45009
 
44570
45010
  }
@@ -44659,7 +45099,7 @@ class DataTextureLoader extends Loader {
44659
45099
  * ```
44660
45100
  * Please note that `TextureLoader` has dropped support for progress
44661
45101
  * events in `r84`. For a `TextureLoader` that supports progress events, see
44662
- * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145}.
45102
+ * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145).
44663
45103
  *
44664
45104
  * @augments Loader
44665
45105
  */
@@ -45066,14 +45506,27 @@ class LightShadow {
45066
45506
  shadowCamera.updateMatrixWorld();
45067
45507
 
45068
45508
  _projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
45069
- this._frustum.setFromProjectionMatrix( _projScreenMatrix$1 );
45509
+ this._frustum.setFromProjectionMatrix( _projScreenMatrix$1, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
45070
45510
 
45071
- shadowMatrix.set(
45072
- 0.5, 0.0, 0.0, 0.5,
45073
- 0.0, 0.5, 0.0, 0.5,
45074
- 0.0, 0.0, 0.5, 0.5,
45075
- 0.0, 0.0, 0.0, 1.0
45076
- );
45511
+ if ( shadowCamera.reversedDepth ) {
45512
+
45513
+ shadowMatrix.set(
45514
+ 0.5, 0.0, 0.0, 0.5,
45515
+ 0.0, 0.5, 0.0, 0.5,
45516
+ 0.0, 0.0, 1.0, 0.0,
45517
+ 0.0, 0.0, 0.0, 1.0
45518
+ );
45519
+
45520
+ } else {
45521
+
45522
+ shadowMatrix.set(
45523
+ 0.5, 0.0, 0.0, 0.5,
45524
+ 0.0, 0.5, 0.0, 0.5,
45525
+ 0.0, 0.0, 0.5, 0.5,
45526
+ 0.0, 0.0, 0.0, 1.0
45527
+ );
45528
+
45529
+ }
45077
45530
 
45078
45531
  shadowMatrix.multiply( _projScreenMatrix$1 );
45079
45532
 
@@ -45530,7 +45983,7 @@ class PointLightShadow extends LightShadow {
45530
45983
  shadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );
45531
45984
 
45532
45985
  _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
45533
- this._frustum.setFromProjectionMatrix( _projScreenMatrix );
45986
+ this._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );
45534
45987
 
45535
45988
  }
45536
45989
 
@@ -45649,7 +46102,7 @@ class PointLight extends Light {
45649
46102
  }
45650
46103
 
45651
46104
  /**
45652
- * Camera that uses [orthographic projection]{@link https://en.wikipedia.org/wiki/Orthographic_projection}.
46105
+ * Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection).
45653
46106
  *
45654
46107
  * In this projection mode, an object's size in the rendered image stays
45655
46108
  * constant regardless of its distance from the camera. This can be useful
@@ -45864,7 +46317,7 @@ class OrthographicCamera extends Camera {
45864
46317
 
45865
46318
  }
45866
46319
 
45867
- this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
46320
+ this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );
45868
46321
 
45869
46322
  this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
45870
46323
 
@@ -46649,7 +47102,7 @@ class MaterialLoader extends Loader {
46649
47102
 
46650
47103
  } else {
46651
47104
 
46652
- console.error( e );
47105
+ error( e );
46653
47106
 
46654
47107
  }
46655
47108
 
@@ -46675,7 +47128,7 @@ class MaterialLoader extends Loader {
46675
47128
 
46676
47129
  if ( textures[ name ] === undefined ) {
46677
47130
 
46678
- console.warn( 'THREE.MaterialLoader: Undefined texture', name );
47131
+ warn( 'MaterialLoader: Undefined texture', name );
46679
47132
 
46680
47133
  }
46681
47134
 
@@ -47167,7 +47620,7 @@ class BufferGeometryLoader extends Loader {
47167
47620
 
47168
47621
  } else {
47169
47622
 
47170
- console.error( e );
47623
+ error( e );
47171
47624
 
47172
47625
  }
47173
47626
 
@@ -47340,7 +47793,7 @@ class BufferGeometryLoader extends Loader {
47340
47793
  }
47341
47794
 
47342
47795
  /**
47343
- * A loader for loading a JSON resource in the [JSON Object/Scene format]{@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4}.
47796
+ * A loader for loading a JSON resource in the [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).
47344
47797
  * The files are internally loaded via {@link FileLoader}.
47345
47798
  *
47346
47799
  * ```js
@@ -47399,7 +47852,7 @@ class ObjectLoader extends Loader {
47399
47852
 
47400
47853
  if ( onError !== undefined ) onError( error );
47401
47854
 
47402
- console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message );
47855
+ error( 'ObjectLoader: Can\'t parse ' + url + '.', error.message );
47403
47856
 
47404
47857
  return;
47405
47858
 
@@ -47411,7 +47864,7 @@ class ObjectLoader extends Loader {
47411
47864
 
47412
47865
  if ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\'t load ' + url ) );
47413
47866
 
47414
- console.error( 'THREE.ObjectLoader: Can\'t load ' + url );
47867
+ error( 'ObjectLoader: Can\'t load ' + url );
47415
47868
  return;
47416
47869
 
47417
47870
  }
@@ -47636,7 +48089,7 @@ class ObjectLoader extends Loader {
47636
48089
 
47637
48090
  } else {
47638
48091
 
47639
- console.warn( `THREE.ObjectLoader: Unsupported geometry type "${ data.type }"` );
48092
+ warn( `ObjectLoader: Unsupported geometry type "${ data.type }"` );
47640
48093
 
47641
48094
  }
47642
48095
 
@@ -47927,7 +48380,7 @@ class ObjectLoader extends Loader {
47927
48380
 
47928
48381
  if ( typeof value === 'number' ) return value;
47929
48382
 
47930
- console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );
48383
+ warn( 'ObjectLoader.parseTexture: Constant should be in numeric form.', value );
47931
48384
 
47932
48385
  return type[ value ];
47933
48386
 
@@ -47943,13 +48396,13 @@ class ObjectLoader extends Loader {
47943
48396
 
47944
48397
  if ( data.image === undefined ) {
47945
48398
 
47946
- console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid );
48399
+ warn( 'ObjectLoader: No "image" specified for', data.uuid );
47947
48400
 
47948
48401
  }
47949
48402
 
47950
48403
  if ( images[ data.image ] === undefined ) {
47951
48404
 
47952
- console.warn( 'THREE.ObjectLoader: Undefined image', data.image );
48405
+ warn( 'ObjectLoader: Undefined image', data.image );
47953
48406
 
47954
48407
  }
47955
48408
 
@@ -48037,7 +48490,7 @@ class ObjectLoader extends Loader {
48037
48490
 
48038
48491
  if ( geometries[ name ] === undefined ) {
48039
48492
 
48040
- console.warn( 'THREE.ObjectLoader: Undefined geometry', name );
48493
+ warn( 'ObjectLoader: Undefined geometry', name );
48041
48494
 
48042
48495
  }
48043
48496
 
@@ -48059,7 +48512,7 @@ class ObjectLoader extends Loader {
48059
48512
 
48060
48513
  if ( materials[ uuid ] === undefined ) {
48061
48514
 
48062
- console.warn( 'THREE.ObjectLoader: Undefined material', uuid );
48515
+ warn( 'ObjectLoader: Undefined material', uuid );
48063
48516
 
48064
48517
  }
48065
48518
 
@@ -48073,7 +48526,7 @@ class ObjectLoader extends Loader {
48073
48526
 
48074
48527
  if ( materials[ name ] === undefined ) {
48075
48528
 
48076
- console.warn( 'THREE.ObjectLoader: Undefined material', name );
48529
+ warn( 'ObjectLoader: Undefined material', name );
48077
48530
 
48078
48531
  }
48079
48532
 
@@ -48085,7 +48538,7 @@ class ObjectLoader extends Loader {
48085
48538
 
48086
48539
  if ( textures[ uuid ] === undefined ) {
48087
48540
 
48088
- console.warn( 'THREE.ObjectLoader: Undefined texture', uuid );
48541
+ warn( 'ObjectLoader: Undefined texture', uuid );
48089
48542
 
48090
48543
  }
48091
48544
 
@@ -48486,7 +48939,7 @@ class ObjectLoader extends Loader {
48486
48939
 
48487
48940
  if ( skeleton === undefined ) {
48488
48941
 
48489
- console.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );
48942
+ warn( 'ObjectLoader: No skeleton found with UUID:', child.skeleton );
48490
48943
 
48491
48944
  } else {
48492
48945
 
@@ -48555,7 +49008,7 @@ const TEXTURE_FILTER = {
48555
49008
  const _errorMap = new WeakMap();
48556
49009
 
48557
49010
  /**
48558
- * A loader for loading images as an [ImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap}.
49011
+ * A loader for loading images as an [ImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap).
48559
49012
  * An `ImageBitmap` provides an asynchronous and resource efficient pathway to prepare
48560
49013
  * textures for rendering.
48561
49014
  *
@@ -48599,13 +49052,13 @@ class ImageBitmapLoader extends Loader {
48599
49052
 
48600
49053
  if ( typeof createImageBitmap === 'undefined' ) {
48601
49054
 
48602
- console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );
49055
+ warn( 'ImageBitmapLoader: createImageBitmap() not supported.' );
48603
49056
 
48604
49057
  }
48605
49058
 
48606
49059
  if ( typeof fetch === 'undefined' ) {
48607
49060
 
48608
- console.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );
49061
+ warn( 'ImageBitmapLoader: fetch() not supported.' );
48609
49062
 
48610
49063
  }
48611
49064
 
@@ -48617,11 +49070,19 @@ class ImageBitmapLoader extends Loader {
48617
49070
  */
48618
49071
  this.options = { premultiplyAlpha: 'none' };
48619
49072
 
49073
+ /**
49074
+ * Used for aborting requests.
49075
+ *
49076
+ * @private
49077
+ * @type {AbortController}
49078
+ */
49079
+ this._abortController = new AbortController();
49080
+
48620
49081
  }
48621
49082
 
48622
49083
  /**
48623
49084
  * Sets the given loader options. The structure of the object must match the `options` parameter of
48624
- * [createImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap}.
49085
+ * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
48625
49086
  *
48626
49087
  * @param {Object} options - The loader options to set.
48627
49088
  * @return {ImageBitmapLoader} A reference to this image bitmap loader.
@@ -48653,7 +49114,7 @@ class ImageBitmapLoader extends Loader {
48653
49114
 
48654
49115
  const scope = this;
48655
49116
 
48656
- const cached = Cache.get( url );
49117
+ const cached = Cache.get( `image-bitmap:${url}` );
48657
49118
 
48658
49119
  if ( cached !== undefined ) {
48659
49120
 
@@ -48705,6 +49166,7 @@ class ImageBitmapLoader extends Loader {
48705
49166
  const fetchOptions = {};
48706
49167
  fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
48707
49168
  fetchOptions.headers = this.requestHeader;
49169
+ fetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;
48708
49170
 
48709
49171
  const promise = fetch( url, fetchOptions ).then( function ( res ) {
48710
49172
 
@@ -48716,7 +49178,7 @@ class ImageBitmapLoader extends Loader {
48716
49178
 
48717
49179
  } ).then( function ( imageBitmap ) {
48718
49180
 
48719
- Cache.add( url, imageBitmap );
49181
+ Cache.add( `image-bitmap:${url}`, imageBitmap );
48720
49182
 
48721
49183
  if ( onLoad ) onLoad( imageBitmap );
48722
49184
 
@@ -48730,18 +49192,32 @@ class ImageBitmapLoader extends Loader {
48730
49192
 
48731
49193
  _errorMap.set( promise, e );
48732
49194
 
48733
- Cache.remove( url );
49195
+ Cache.remove( `image-bitmap:${url}` );
48734
49196
 
48735
49197
  scope.manager.itemError( url );
48736
49198
  scope.manager.itemEnd( url );
48737
49199
 
48738
49200
  } );
48739
49201
 
48740
- Cache.add( url, promise );
49202
+ Cache.add( `image-bitmap:${url}`, promise );
48741
49203
  scope.manager.itemStart( url );
48742
49204
 
48743
49205
  }
48744
49206
 
49207
+ /**
49208
+ * Aborts ongoing fetch requests.
49209
+ *
49210
+ * @return {ImageBitmapLoader} A reference to this instance.
49211
+ */
49212
+ abort() {
49213
+
49214
+ this._abortController.abort();
49215
+ this._abortController = new AbortController();
49216
+
49217
+ return this;
49218
+
49219
+ }
49220
+
48745
49221
  }
48746
49222
 
48747
49223
  let _context;
@@ -48862,7 +49338,7 @@ class AudioLoader extends Loader {
48862
49338
 
48863
49339
  } else {
48864
49340
 
48865
- console.error( e );
49341
+ error( e );
48866
49342
 
48867
49343
  }
48868
49344
 
@@ -48881,8 +49357,8 @@ const _projectionMatrix = /*@__PURE__*/ new Matrix4();
48881
49357
  /**
48882
49358
  * A special type of camera that uses two perspective cameras with
48883
49359
  * stereoscopic projection. Can be used for rendering stereo effects
48884
- * like [3D Anaglyph]{@link https://en.wikipedia.org/wiki/Anaglyph_3D} or
48885
- * [Parallax Barrier]{@link https://en.wikipedia.org/wiki/parallax_barrier}.
49360
+ * like [3D Anaglyph](https://en.wikipedia.org/wiki/Anaglyph_3D) or
49361
+ * [Parallax Barrier](https://en.wikipedia.org/wiki/parallax_barrier).
48886
49362
  */
48887
49363
  class StereoCamera {
48888
49364
 
@@ -49129,7 +49605,7 @@ class Clock {
49129
49605
  */
49130
49606
  start() {
49131
49607
 
49132
- this.startTime = now();
49608
+ this.startTime = performance.now();
49133
49609
 
49134
49610
  this.oldTime = this.startTime;
49135
49611
  this.elapsedTime = 0;
@@ -49178,7 +49654,7 @@ class Clock {
49178
49654
 
49179
49655
  if ( this.running ) {
49180
49656
 
49181
- const newTime = now();
49657
+ const newTime = performance.now();
49182
49658
 
49183
49659
  diff = ( newTime - this.oldTime ) / 1000;
49184
49660
  this.oldTime = newTime;
@@ -49193,12 +49669,6 @@ class Clock {
49193
49669
 
49194
49670
  }
49195
49671
 
49196
- function now() {
49197
-
49198
- return performance.now();
49199
-
49200
- }
49201
-
49202
49672
  const _position$1 = /*@__PURE__*/ new Vector3();
49203
49673
  const _quaternion$1 = /*@__PURE__*/ new Quaternion();
49204
49674
  const _scale$1 = /*@__PURE__*/ new Vector3();
@@ -49411,7 +49881,7 @@ class AudioListener extends Object3D {
49411
49881
  /**
49412
49882
  * Represents a non-positional ( global ) audio object.
49413
49883
  *
49414
- * This and related audio modules make use of the [Web Audio API]{@link https://www.w3.org/TR/webaudio-1.1/}.
49884
+ * This and related audio modules make use of the [Web Audio API](https://www.w3.org/TR/webaudio-1.1/).
49415
49885
  *
49416
49886
  * ```js
49417
49887
  * // create an AudioListener and add it to the camera
@@ -49722,14 +50192,14 @@ class Audio extends Object3D {
49722
50192
 
49723
50193
  if ( this.isPlaying === true ) {
49724
50194
 
49725
- console.warn( 'THREE.Audio: Audio is already playing.' );
50195
+ warn( 'Audio: Audio is already playing.' );
49726
50196
  return;
49727
50197
 
49728
50198
  }
49729
50199
 
49730
50200
  if ( this.hasPlaybackControl === false ) {
49731
50201
 
49732
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50202
+ warn( 'Audio: this Audio has no playback control.' );
49733
50203
  return;
49734
50204
 
49735
50205
  }
@@ -49766,7 +50236,7 @@ class Audio extends Object3D {
49766
50236
 
49767
50237
  if ( this.hasPlaybackControl === false ) {
49768
50238
 
49769
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50239
+ warn( 'Audio: this Audio has no playback control.' );
49770
50240
  return;
49771
50241
 
49772
50242
  }
@@ -49808,7 +50278,7 @@ class Audio extends Object3D {
49808
50278
 
49809
50279
  if ( this.hasPlaybackControl === false ) {
49810
50280
 
49811
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50281
+ warn( 'Audio: this Audio has no playback control.' );
49812
50282
  return;
49813
50283
 
49814
50284
  }
@@ -50001,7 +50471,7 @@ class Audio extends Object3D {
50001
50471
 
50002
50472
  if ( this.hasPlaybackControl === false ) {
50003
50473
 
50004
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50474
+ warn( 'Audio: this Audio has no playback control.' );
50005
50475
  return;
50006
50476
 
50007
50477
  }
@@ -50050,7 +50520,7 @@ class Audio extends Object3D {
50050
50520
 
50051
50521
  if ( this.hasPlaybackControl === false ) {
50052
50522
 
50053
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50523
+ warn( 'Audio: this Audio has no playback control.' );
50054
50524
  return false;
50055
50525
 
50056
50526
  }
@@ -50071,7 +50541,7 @@ class Audio extends Object3D {
50071
50541
 
50072
50542
  if ( this.hasPlaybackControl === false ) {
50073
50543
 
50074
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50544
+ warn( 'Audio: this Audio has no playback control.' );
50075
50545
  return;
50076
50546
 
50077
50547
  }
@@ -50149,7 +50619,7 @@ class Audio extends Object3D {
50149
50619
 
50150
50620
  if ( source.sourceType !== 'buffer' ) {
50151
50621
 
50152
- console.warn( 'THREE.Audio: Audio source type cannot be copied.' );
50622
+ warn( 'Audio: Audio source type cannot be copied.' );
50153
50623
 
50154
50624
  return this;
50155
50625
 
@@ -50334,7 +50804,7 @@ class PositionalAudio extends Audio {
50334
50804
  * Defines which algorithm to use to reduce the volume of the audio source
50335
50805
  * as it moves away from the listener.
50336
50806
  *
50337
- * Read [the spec]{@link https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype}
50807
+ * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype)
50338
50808
  * for more details.
50339
50809
  *
50340
50810
  * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.
@@ -51416,7 +51886,7 @@ class PropertyBinding {
51416
51886
  // ensure there is a value node
51417
51887
  if ( ! targetObject ) {
51418
51888
 
51419
- console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );
51889
+ warn( 'PropertyBinding: No target node found for track: ' + this.path + '.' );
51420
51890
  return;
51421
51891
 
51422
51892
  }
@@ -51432,14 +51902,14 @@ class PropertyBinding {
51432
51902
 
51433
51903
  if ( ! targetObject.material ) {
51434
51904
 
51435
- console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );
51905
+ error( 'PropertyBinding: Can not bind to material as node does not have a material.', this );
51436
51906
  return;
51437
51907
 
51438
51908
  }
51439
51909
 
51440
51910
  if ( ! targetObject.material.materials ) {
51441
51911
 
51442
- console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );
51912
+ error( 'PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );
51443
51913
  return;
51444
51914
 
51445
51915
  }
@@ -51452,7 +51922,7 @@ class PropertyBinding {
51452
51922
 
51453
51923
  if ( ! targetObject.skeleton ) {
51454
51924
 
51455
- console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );
51925
+ error( 'PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );
51456
51926
  return;
51457
51927
 
51458
51928
  }
@@ -51487,14 +51957,14 @@ class PropertyBinding {
51487
51957
 
51488
51958
  if ( ! targetObject.material ) {
51489
51959
 
51490
- console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );
51960
+ error( 'PropertyBinding: Can not bind to material as node does not have a material.', this );
51491
51961
  return;
51492
51962
 
51493
51963
  }
51494
51964
 
51495
51965
  if ( ! targetObject.material.map ) {
51496
51966
 
51497
- console.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );
51967
+ error( 'PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );
51498
51968
  return;
51499
51969
 
51500
51970
  }
@@ -51506,7 +51976,7 @@ class PropertyBinding {
51506
51976
 
51507
51977
  if ( targetObject[ objectName ] === undefined ) {
51508
51978
 
51509
- console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );
51979
+ error( 'PropertyBinding: Can not bind to objectName of node undefined.', this );
51510
51980
  return;
51511
51981
 
51512
51982
  }
@@ -51520,7 +51990,7 @@ class PropertyBinding {
51520
51990
 
51521
51991
  if ( targetObject[ objectIndex ] === undefined ) {
51522
51992
 
51523
- console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );
51993
+ error( 'PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );
51524
51994
  return;
51525
51995
 
51526
51996
  }
@@ -51538,7 +52008,7 @@ class PropertyBinding {
51538
52008
 
51539
52009
  const nodeName = parsedPath.nodeName;
51540
52010
 
51541
- console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +
52011
+ error( 'PropertyBinding: Trying to update property for track: ' + nodeName +
51542
52012
  '.' + propertyName + ' but it wasn\'t found.', targetObject );
51543
52013
  return;
51544
52014
 
@@ -51573,14 +52043,14 @@ class PropertyBinding {
51573
52043
  // support resolving morphTarget names into indices.
51574
52044
  if ( ! targetObject.geometry ) {
51575
52045
 
51576
- console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );
52046
+ error( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );
51577
52047
  return;
51578
52048
 
51579
52049
  }
51580
52050
 
51581
52051
  if ( ! targetObject.geometry.morphAttributes ) {
51582
52052
 
51583
- console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );
52053
+ error( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );
51584
52054
  return;
51585
52055
 
51586
52056
  }
@@ -51872,7 +52342,7 @@ class AnimationObjectGroup {
51872
52342
 
51873
52343
  } else if ( objects[ index ] !== knownObject ) {
51874
52344
 
51875
- console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +
52345
+ error( 'AnimationObjectGroup: Different objects with the same UUID ' +
51876
52346
  'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );
51877
52347
 
51878
52348
  } // else the object is already where we want it to be
@@ -53667,7 +54137,7 @@ class AnimationMixer extends EventDispatcher {
53667
54137
  /**
53668
54138
  * Deactivates all previously scheduled actions on this mixer.
53669
54139
  *
53670
- * @return {AnimationMixer} A reference to thi animation mixer.
54140
+ * @return {AnimationMixer} A reference to this animation mixer.
53671
54141
  */
53672
54142
  stopAllAction() {
53673
54143
 
@@ -53691,7 +54161,7 @@ class AnimationMixer extends EventDispatcher {
53691
54161
  * time from {@link Clock} or {@link Timer}.
53692
54162
  *
53693
54163
  * @param {number} deltaTime - The delta time in seconds.
53694
- * @return {AnimationMixer} A reference to thi animation mixer.
54164
+ * @return {AnimationMixer} A reference to this animation mixer.
53695
54165
  */
53696
54166
  update( deltaTime ) {
53697
54167
 
@@ -53737,7 +54207,7 @@ class AnimationMixer extends EventDispatcher {
53737
54207
  * input parameter will be scaled by {@link AnimationMixer#timeScale}
53738
54208
  *
53739
54209
  * @param {number} time - The time to set in seconds.
53740
- * @return {AnimationMixer} A reference to thi animation mixer.
54210
+ * @return {AnimationMixer} A reference to this animation mixer.
53741
54211
  */
53742
54212
  setTime( time ) {
53743
54213
 
@@ -54234,8 +54704,9 @@ class GLBufferAttribute {
54234
54704
  * @param {number} itemSize - The item size.
54235
54705
  * @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.
54236
54706
  * @param {number} count - The expected number of vertices in VBO.
54707
+ * @param {boolean} [normalized=false] - Whether the data are normalized or not.
54237
54708
  */
54238
- constructor( buffer, type, itemSize, elementSize, count ) {
54709
+ constructor( buffer, type, itemSize, elementSize, count, normalized = false ) {
54239
54710
 
54240
54711
  /**
54241
54712
  * This flag can be used for type testing.
@@ -54288,6 +54759,17 @@ class GLBufferAttribute {
54288
54759
  */
54289
54760
  this.count = count;
54290
54761
 
54762
+ /**
54763
+ * Applies to integer data only. Indicates how the underlying data in the buffer maps to
54764
+ * the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`,
54765
+ * and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to
54766
+ * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted
54767
+ * to floats unmodified, i.e. `65535` becomes `65535.0f`.
54768
+ *
54769
+ * @type {boolean}
54770
+ */
54771
+ this.normalized = normalized;
54772
+
54291
54773
  /**
54292
54774
  * A version number, incremented every time the `needsUpdate` is set to `true`.
54293
54775
  *
@@ -54500,7 +54982,7 @@ class Raycaster {
54500
54982
 
54501
54983
  } else {
54502
54984
 
54503
- console.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );
54985
+ error( 'Raycaster: Unsupported camera type: ' + camera.type );
54504
54986
 
54505
54987
  }
54506
54988
 
@@ -54627,9 +55109,192 @@ function intersect( object, raycaster, intersects, recursive ) {
54627
55109
 
54628
55110
  }
54629
55111
 
55112
+ /**
55113
+ * This class is an alternative to {@link Clock} with a different API design and behavior.
55114
+ * The goal is to avoid the conceptual flaws that became apparent in `Clock` over time.
55115
+ *
55116
+ * - `Timer` has an `update()` method that updates its internal state. That makes it possible to
55117
+ * call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values.
55118
+ * - The class can make use of the Page Visibility API to avoid large time delta values when the app
55119
+ * is inactive (e.g. tab switched or browser hidden).
55120
+ *
55121
+ * ```js
55122
+ * const timer = new Timer();
55123
+ * timer.connect( document ); // use Page Visibility API
55124
+ * ```
55125
+ */
55126
+ class Timer {
55127
+
55128
+ /**
55129
+ * Constructs a new timer.
55130
+ */
55131
+ constructor() {
55132
+
55133
+ this._previousTime = 0;
55134
+ this._currentTime = 0;
55135
+ this._startTime = performance.now();
55136
+
55137
+ this._delta = 0;
55138
+ this._elapsed = 0;
55139
+
55140
+ this._timescale = 1;
55141
+
55142
+ this._document = null;
55143
+ this._pageVisibilityHandler = null;
55144
+
55145
+ }
55146
+
55147
+ /**
55148
+ * Connect the timer to the given document.Calling this method is not mandatory to
55149
+ * use the timer but enables the usage of the Page Visibility API to avoid large time
55150
+ * delta values.
55151
+ *
55152
+ * @param {Document} document - The document.
55153
+ */
55154
+ connect( document ) {
55155
+
55156
+ this._document = document;
55157
+
55158
+ // use Page Visibility API to avoid large time delta values
55159
+
55160
+ if ( document.hidden !== undefined ) {
55161
+
55162
+ this._pageVisibilityHandler = handleVisibilityChange.bind( this );
55163
+
55164
+ document.addEventListener( 'visibilitychange', this._pageVisibilityHandler, false );
55165
+
55166
+ }
55167
+
55168
+ }
55169
+
55170
+ /**
55171
+ * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
55172
+ */
55173
+ disconnect() {
55174
+
55175
+ if ( this._pageVisibilityHandler !== null ) {
55176
+
55177
+ this._document.removeEventListener( 'visibilitychange', this._pageVisibilityHandler );
55178
+ this._pageVisibilityHandler = null;
55179
+
55180
+ }
55181
+
55182
+ this._document = null;
55183
+
55184
+ }
55185
+
55186
+ /**
55187
+ * Returns the time delta in seconds.
55188
+ *
55189
+ * @return {number} The time delta in second.
55190
+ */
55191
+ getDelta() {
55192
+
55193
+ return this._delta / 1000;
55194
+
55195
+ }
55196
+
55197
+ /**
55198
+ * Returns the elapsed time in seconds.
55199
+ *
55200
+ * @return {number} The elapsed time in second.
55201
+ */
55202
+ getElapsed() {
55203
+
55204
+ return this._elapsed / 1000;
55205
+
55206
+ }
55207
+
55208
+ /**
55209
+ * Returns the timescale.
55210
+ *
55211
+ * @return {number} The timescale.
55212
+ */
55213
+ getTimescale() {
55214
+
55215
+ return this._timescale;
55216
+
55217
+ }
55218
+
55219
+ /**
55220
+ * Sets the given timescale which scale the time delta computation
55221
+ * in `update()`.
55222
+ *
55223
+ * @param {number} timescale - The timescale to set.
55224
+ * @return {Timer} A reference to this timer.
55225
+ */
55226
+ setTimescale( timescale ) {
55227
+
55228
+ this._timescale = timescale;
55229
+
55230
+ return this;
55231
+
55232
+ }
55233
+
55234
+ /**
55235
+ * Resets the time computation for the current simulation step.
55236
+ *
55237
+ * @return {Timer} A reference to this timer.
55238
+ */
55239
+ reset() {
55240
+
55241
+ this._currentTime = performance.now() - this._startTime;
55242
+
55243
+ return this;
55244
+
55245
+ }
55246
+
55247
+ /**
55248
+ * Can be used to free all internal resources. Usually called when
55249
+ * the timer instance isn't required anymore.
55250
+ */
55251
+ dispose() {
55252
+
55253
+ this.disconnect();
55254
+
55255
+ }
55256
+
55257
+ /**
55258
+ * Updates the internal state of the timer. This method should be called
55259
+ * once per simulation step and before you perform queries against the timer
55260
+ * (e.g. via `getDelta()`).
55261
+ *
55262
+ * @param {number} timestamp - The current time in milliseconds. Can be obtained
55263
+ * from the `requestAnimationFrame` callback argument. If not provided, the current
55264
+ * time will be determined with `performance.now`.
55265
+ * @return {Timer} A reference to this timer.
55266
+ */
55267
+ update( timestamp ) {
55268
+
55269
+ if ( this._pageVisibilityHandler !== null && this._document.hidden === true ) {
55270
+
55271
+ this._delta = 0;
55272
+
55273
+ } else {
55274
+
55275
+ this._previousTime = this._currentTime;
55276
+ this._currentTime = ( timestamp !== undefined ? timestamp : performance.now() ) - this._startTime;
55277
+
55278
+ this._delta = ( this._currentTime - this._previousTime ) * this._timescale;
55279
+ this._elapsed += this._delta; // _elapsed is the accumulation of all previous deltas
55280
+
55281
+ }
55282
+
55283
+ return this;
55284
+
55285
+ }
55286
+
55287
+ }
55288
+
55289
+ function handleVisibilityChange() {
55290
+
55291
+ if ( this._document.hidden === false ) this.reset();
55292
+
55293
+ }
55294
+
54630
55295
  /**
54631
55296
  * This class can be used to represent points in 3D space as
54632
- * [Spherical coordinates]{@link https://en.wikipedia.org/wiki/Spherical_coordinate_system}.
55297
+ * [Spherical coordinates](https://en.wikipedia.org/wiki/Spherical_coordinate_system).
54633
55298
  */
54634
55299
  class Spherical {
54635
55300
 
@@ -54734,8 +55399,8 @@ class Spherical {
54734
55399
  * Sets the spherical components from the given Cartesian coordinates.
54735
55400
  *
54736
55401
  * @param {number} x - The x value.
54737
- * @param {number} y - The x value.
54738
- * @param {number} z - The x value.
55402
+ * @param {number} y - The y value.
55403
+ * @param {number} z - The z value.
54739
55404
  * @return {Spherical} A reference to this spherical.
54740
55405
  */
54741
55406
  setFromCartesianCoords( x, y, z ) {
@@ -54773,7 +55438,7 @@ class Spherical {
54773
55438
 
54774
55439
  /**
54775
55440
  * This class can be used to represent points in 3D space as
54776
- * [Cylindrical coordinates]{@link https://en.wikipedia.org/wiki/Cylindrical_coordinate_system}.
55441
+ * [Cylindrical coordinates](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system).
54777
55442
  */
54778
55443
  class Cylindrical {
54779
55444
 
@@ -54896,7 +55561,7 @@ class Cylindrical {
54896
55561
  * A Note on Row-Major and Column-Major Ordering:
54897
55562
  *
54898
55563
  * The constructor and {@link Matrix2#set} method take arguments in
54899
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
55564
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
54900
55565
  * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order.
54901
55566
  * This means that calling:
54902
55567
  * ```js
@@ -55396,6 +56061,12 @@ class Box2 {
55396
56061
  const _startP = /*@__PURE__*/ new Vector3();
55397
56062
  const _startEnd = /*@__PURE__*/ new Vector3();
55398
56063
 
56064
+ const _d1 = /*@__PURE__*/ new Vector3();
56065
+ const _d2 = /*@__PURE__*/ new Vector3();
56066
+ const _r = /*@__PURE__*/ new Vector3();
56067
+ const _c1 = /*@__PURE__*/ new Vector3();
56068
+ const _c2 = /*@__PURE__*/ new Vector3();
56069
+
55399
56070
  /**
55400
56071
  * An analytical line segment in 3D space represented by a start and end point.
55401
56072
  */
@@ -55543,11 +56214,11 @@ class Line3 {
55543
56214
  }
55544
56215
 
55545
56216
  /**
55546
- * Returns the closets point on the line for a given point.
56217
+ * Returns the closest point on the line for a given point.
55547
56218
  *
55548
56219
  * @param {Vector3} point - The point to compute the closest point on the line for.
55549
56220
  * @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.
55550
- * @param {Vector3} target - The target vector that is used to store the method's result.
56221
+ * @param {Vector3} target - The target vector that is used to store the method's result.
55551
56222
  * @return {Vector3} The closest point on the line.
55552
56223
  */
55553
56224
  closestPointToPoint( point, clampToLine, target ) {
@@ -55558,6 +56229,127 @@ class Line3 {
55558
56229
 
55559
56230
  }
55560
56231
 
56232
+ /**
56233
+ * Returns the closest squared distance between this line segment and the given one.
56234
+ *
56235
+ * @param {Line3} line - The line segment to compute the closest squared distance to.
56236
+ * @param {Vector3} [c1] - The closest point on this line segment.
56237
+ * @param {Vector3} [c2] - The closest point on the given line segment.
56238
+ * @return {number} The squared distance between this line segment and the given one.
56239
+ */
56240
+ distanceSqToLine3( line, c1 = _c1, c2 = _c2 ) {
56241
+
56242
+ // from Real-Time Collision Detection by Christer Ericson, chapter 5.1.9
56243
+
56244
+ // Computes closest points C1 and C2 of S1(s)=P1+s*(Q1-P1) and
56245
+ // S2(t)=P2+t*(Q2-P2), returning s and t. Function result is squared
56246
+ // distance between between S1(s) and S2(t)
56247
+
56248
+ const EPSILON = 1e-8 * 1e-8; // must be squared since we compare squared length
56249
+ let s, t;
56250
+
56251
+ const p1 = this.start;
56252
+ const p2 = line.start;
56253
+ const q1 = this.end;
56254
+ const q2 = line.end;
56255
+
56256
+ _d1.subVectors( q1, p1 ); // Direction vector of segment S1
56257
+ _d2.subVectors( q2, p2 ); // Direction vector of segment S2
56258
+ _r.subVectors( p1, p2 );
56259
+
56260
+ const a = _d1.dot( _d1 ); // Squared length of segment S1, always nonnegative
56261
+ const e = _d2.dot( _d2 ); // Squared length of segment S2, always nonnegative
56262
+ const f = _d2.dot( _r );
56263
+
56264
+ // Check if either or both segments degenerate into points
56265
+
56266
+ if ( a <= EPSILON && e <= EPSILON ) {
56267
+
56268
+ // Both segments degenerate into points
56269
+
56270
+ c1.copy( p1 );
56271
+ c2.copy( p2 );
56272
+
56273
+ c1.sub( c2 );
56274
+
56275
+ return c1.dot( c1 );
56276
+
56277
+ }
56278
+
56279
+ if ( a <= EPSILON ) {
56280
+
56281
+ // First segment degenerates into a point
56282
+
56283
+ s = 0;
56284
+ t = f / e; // s = 0 => t = (b*s + f) / e = f / e
56285
+ t = clamp( t, 0, 1 );
56286
+
56287
+
56288
+ } else {
56289
+
56290
+ const c = _d1.dot( _r );
56291
+
56292
+ if ( e <= EPSILON ) {
56293
+
56294
+ // Second segment degenerates into a point
56295
+
56296
+ t = 0;
56297
+ s = clamp( - c / a, 0, 1 ); // t = 0 => s = (b*t - c) / a = -c / a
56298
+
56299
+ } else {
56300
+
56301
+ // The general nondegenerate case starts here
56302
+
56303
+ const b = _d1.dot( _d2 );
56304
+ const denom = a * e - b * b; // Always nonnegative
56305
+
56306
+ // If segments not parallel, compute closest point on L1 to L2 and
56307
+ // clamp to segment S1. Else pick arbitrary s (here 0)
56308
+
56309
+ if ( denom !== 0 ) {
56310
+
56311
+ s = clamp( ( b * f - c * e ) / denom, 0, 1 );
56312
+
56313
+ } else {
56314
+
56315
+ s = 0;
56316
+
56317
+ }
56318
+
56319
+ // Compute point on L2 closest to S1(s) using
56320
+ // t = Dot((P1 + D1*s) - P2,D2) / Dot(D2,D2) = (b*s + f) / e
56321
+
56322
+ t = ( b * s + f ) / e;
56323
+
56324
+ // If t in [0,1] done. Else clamp t, recompute s for the new value
56325
+ // of t using s = Dot((P2 + D2*t) - P1,D1) / Dot(D1,D1)= (t*b - c) / a
56326
+ // and clamp s to [0, 1]
56327
+
56328
+ if ( t < 0 ) {
56329
+
56330
+ t = 0.;
56331
+ s = clamp( - c / a, 0, 1 );
56332
+
56333
+ } else if ( t > 1 ) {
56334
+
56335
+ t = 1;
56336
+ s = clamp( ( b - c ) / a, 0, 1 );
56337
+
56338
+ }
56339
+
56340
+ }
56341
+
56342
+ }
56343
+
56344
+ c1.copy( p1 ).add( _d1.multiplyScalar( s ) );
56345
+ c2.copy( p2 ).add( _d2.multiplyScalar( t ) );
56346
+
56347
+ c1.sub( c2 );
56348
+
56349
+ return c1.dot( c1 );
56350
+
56351
+ }
56352
+
55561
56353
  /**
55562
56354
  * Applies a 4x4 transformation matrix to this line segment.
55563
56355
  *
@@ -55757,7 +56549,7 @@ const _matrixWorldInv = /*@__PURE__*/ new Matrix4();
55757
56549
  class SkeletonHelper extends LineSegments {
55758
56550
 
55759
56551
  /**
55760
- * Constructs a new hemisphere light helper.
56552
+ * Constructs a new skeleton helper.
55761
56553
  *
55762
56554
  * @param {Object3D} object - Usually an instance of {@link SkinnedMesh}. However, any 3D object
55763
56555
  * can be used if it represents a hierarchy of bones (see {@link Bone}).
@@ -55771,9 +56563,6 @@ class SkeletonHelper extends LineSegments {
55771
56563
  const vertices = [];
55772
56564
  const colors = [];
55773
56565
 
55774
- const color1 = new Color( 0, 0, 1 );
55775
- const color2 = new Color( 0, 1, 0 );
55776
-
55777
56566
  for ( let i = 0; i < bones.length; i ++ ) {
55778
56567
 
55779
56568
  const bone = bones[ i ];
@@ -55782,8 +56571,8 @@ class SkeletonHelper extends LineSegments {
55782
56571
 
55783
56572
  vertices.push( 0, 0, 0 );
55784
56573
  vertices.push( 0, 0, 0 );
55785
- colors.push( color1.r, color1.g, color1.b );
55786
- colors.push( color2.r, color2.g, color2.b );
56574
+ colors.push( 0, 0, 0 );
56575
+ colors.push( 0, 0, 0 );
55787
56576
 
55788
56577
  }
55789
56578
 
@@ -55824,6 +56613,13 @@ class SkeletonHelper extends LineSegments {
55824
56613
  this.matrix = object.matrixWorld;
55825
56614
  this.matrixAutoUpdate = false;
55826
56615
 
56616
+ // colors
56617
+
56618
+ const color1 = new Color( 0x0000ff );
56619
+ const color2 = new Color( 0x00ff00 );
56620
+
56621
+ this.setColors( color1, color2 );
56622
+
55827
56623
  }
55828
56624
 
55829
56625
  updateMatrixWorld( force ) {
@@ -55861,6 +56657,31 @@ class SkeletonHelper extends LineSegments {
55861
56657
 
55862
56658
  }
55863
56659
 
56660
+ /**
56661
+ * Defines the colors of the helper.
56662
+ *
56663
+ * @param {Color} color1 - The first line color for each bone.
56664
+ * @param {Color} color2 - The second line color for each bone.
56665
+ * @return {SkeletonHelper} A reference to this helper.
56666
+ */
56667
+ setColors( color1, color2 ) {
56668
+
56669
+ const geometry = this.geometry;
56670
+ const colorAttribute = geometry.getAttribute( 'color' );
56671
+
56672
+ for ( let i = 0; i < colorAttribute.count; i += 2 ) {
56673
+
56674
+ colorAttribute.setXYZ( i, color1.r, color1.g, color1.b );
56675
+ colorAttribute.setXYZ( i + 1, color2.r, color2.g, color2.b );
56676
+
56677
+ }
56678
+
56679
+ colorAttribute.needsUpdate = true;
56680
+
56681
+ return this;
56682
+
56683
+ }
56684
+
55864
56685
  /**
55865
56686
  * Frees the GPU-related resources allocated by this instance. Call this
55866
56687
  * method whenever this instance is no longer used in your app.
@@ -56476,7 +57297,7 @@ const _camera = /*@__PURE__*/ new Camera();
56476
57297
  * This helps with visualizing what a camera contains in its frustum. It
56477
57298
  * visualizes the frustum of a camera using a line segments.
56478
57299
  *
56479
- * Based on frustum visualization in [lightgl.js shadowmap example]{@link https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html}.
57300
+ * Based on frustum visualization in [lightgl.js shadowmap example](https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html).
56480
57301
  *
56481
57302
  * `CameraHelper` must be a child of the scene.
56482
57303
  *
@@ -56621,6 +57442,7 @@ class CameraHelper extends LineSegments {
56621
57442
  * @param {Color} up - The up line color.
56622
57443
  * @param {Color} target - The target line color.
56623
57444
  * @param {Color} cross - The cross line color.
57445
+ * @return {CameraHelper} A reference to this helper.
56624
57446
  */
56625
57447
  setColors( frustum, cone, up, target, cross ) {
56626
57448
 
@@ -56677,6 +57499,8 @@ class CameraHelper extends LineSegments {
56677
57499
 
56678
57500
  colorAttribute.needsUpdate = true;
56679
57501
 
57502
+ return this;
57503
+
56680
57504
  }
56681
57505
 
56682
57506
  /**
@@ -56689,17 +57513,44 @@ class CameraHelper extends LineSegments {
56689
57513
 
56690
57514
  const w = 1, h = 1;
56691
57515
 
57516
+ let nearZ, farZ;
57517
+
56692
57518
  // we need just camera projection matrix inverse
56693
57519
  // world matrix must be identity
56694
57520
 
56695
57521
  _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );
56696
57522
 
56697
57523
  // Adjust z values based on coordinate system
56698
- const nearZ = this.camera.coordinateSystem === WebGLCoordinateSystem ? -1 : 0;
57524
+
57525
+ if ( this.camera.reversedDepth === true ) {
57526
+
57527
+ nearZ = 1;
57528
+ farZ = 0;
57529
+
57530
+ } else {
57531
+
57532
+ if ( this.camera.coordinateSystem === WebGLCoordinateSystem ) {
57533
+
57534
+ nearZ = -1;
57535
+ farZ = 1;
57536
+
57537
+ } else if ( this.camera.coordinateSystem === WebGPUCoordinateSystem ) {
57538
+
57539
+ nearZ = 0;
57540
+ farZ = 1;
57541
+
57542
+ } else {
57543
+
57544
+ throw new Error( 'THREE.CameraHelper.update(): Invalid coordinate system: ' + this.camera.coordinateSystem );
57545
+
57546
+ }
57547
+
57548
+ }
57549
+
56699
57550
 
56700
57551
  // center / target
56701
57552
  setPoint( 'c', pointMap, geometry, _camera, 0, 0, nearZ );
56702
- setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 );
57553
+ setPoint( 't', pointMap, geometry, _camera, 0, 0, farZ );
56703
57554
 
56704
57555
  // near
56705
57556
 
@@ -56710,10 +57561,10 @@ class CameraHelper extends LineSegments {
56710
57561
 
56711
57562
  // far
56712
57563
 
56713
- setPoint( 'f1', pointMap, geometry, _camera, -1, -1, 1 );
56714
- setPoint( 'f2', pointMap, geometry, _camera, w, -1, 1 );
56715
- setPoint( 'f3', pointMap, geometry, _camera, -1, h, 1 );
56716
- setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 );
57564
+ setPoint( 'f1', pointMap, geometry, _camera, -1, -1, farZ );
57565
+ setPoint( 'f2', pointMap, geometry, _camera, w, -1, farZ );
57566
+ setPoint( 'f3', pointMap, geometry, _camera, -1, h, farZ );
57567
+ setPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );
56717
57568
 
56718
57569
  // up
56719
57570
 
@@ -56723,10 +57574,10 @@ class CameraHelper extends LineSegments {
56723
57574
 
56724
57575
  // cross
56725
57576
 
56726
- setPoint( 'cf1', pointMap, geometry, _camera, -1, 0, 1 );
56727
- setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 );
56728
- setPoint( 'cf3', pointMap, geometry, _camera, 0, -1, 1 );
56729
- setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 );
57577
+ setPoint( 'cf1', pointMap, geometry, _camera, -1, 0, farZ );
57578
+ setPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );
57579
+ setPoint( 'cf3', pointMap, geometry, _camera, 0, -1, farZ );
57580
+ setPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );
56730
57581
 
56731
57582
  setPoint( 'cn1', pointMap, geometry, _camera, -1, 0, nearZ );
56732
57583
  setPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );
@@ -57558,7 +58409,7 @@ class ShapePath {
57558
58409
  let holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );
57559
58410
  holesFirst = isCCW ? ! holesFirst : holesFirst;
57560
58411
 
57561
- // console.log("Holes first", holesFirst);
58412
+ // log("Holes first", holesFirst);
57562
58413
 
57563
58414
  const betterShapeHoles = [];
57564
58415
  const newShapes = [];
@@ -57586,13 +58437,13 @@ class ShapePath {
57586
58437
  if ( holesFirst ) mainIdx ++;
57587
58438
  newShapeHoles[ mainIdx ] = [];
57588
58439
 
57589
- //console.log('cw', i);
58440
+ //log('cw', i);
57590
58441
 
57591
58442
  } else {
57592
58443
 
57593
58444
  newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );
57594
58445
 
57595
- //console.log('ccw', i);
58446
+ //log('ccw', i);
57596
58447
 
57597
58448
  }
57598
58449
 
@@ -57677,7 +58528,7 @@ class ShapePath {
57677
58528
 
57678
58529
  }
57679
58530
 
57680
- //console.log("shape", shapes);
58531
+ //log("shape", shapes);
57681
58532
 
57682
58533
  return shapes;
57683
58534
 
@@ -57697,7 +58548,7 @@ class Controls extends EventDispatcher {
57697
58548
  * Constructs a new controls instance.
57698
58549
  *
57699
58550
  * @param {Object3D} object - The object that is managed by the controls.
57700
- * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
58551
+ * @param {?HTMLElement} domElement - The HTML element used for event listeners.
57701
58552
  */
57702
58553
  constructor( object, domElement = null ) {
57703
58554
 
@@ -57713,7 +58564,7 @@ class Controls extends EventDispatcher {
57713
58564
  /**
57714
58565
  * The HTML element used for event listeners.
57715
58566
  *
57716
- * @type {?HTMLDOMElement}
58567
+ * @type {?HTMLElement}
57717
58568
  * @default null
57718
58569
  */
57719
58570
  this.domElement = domElement;
@@ -57763,13 +58614,13 @@ class Controls extends EventDispatcher {
57763
58614
  * Connects the controls to the DOM. This method has so called "side effects" since
57764
58615
  * it adds the module's event listeners to the DOM.
57765
58616
  *
57766
- * @param {HTMLDOMElement} element - The DOM element to connect to.
58617
+ * @param {HTMLElement} element - The DOM element to connect to.
57767
58618
  */
57768
58619
  connect( element ) {
57769
58620
 
57770
58621
  if ( element === undefined ) {
57771
58622
 
57772
- console.warn( 'THREE.Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185
58623
+ warn( 'Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185
57773
58624
  return;
57774
58625
 
57775
58626
  }
@@ -58016,6 +58867,7 @@ function getTextureTypeByteLength( type ) {
58016
58867
  case FloatType:
58017
58868
  return { byteLength: 4, components: 1 };
58018
58869
  case UnsignedInt5999Type:
58870
+ case UnsignedInt101111Type:
58019
58871
  return { byteLength: 4, components: 3 };
58020
58872
 
58021
58873
  }
@@ -58102,7 +58954,7 @@ if ( typeof window !== 'undefined' ) {
58102
58954
 
58103
58955
  if ( window.__THREE__ ) {
58104
58956
 
58105
- console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
58957
+ warn( 'WARNING: Multiple instances of Three.js being imported.' );
58106
58958
 
58107
58959
  } else {
58108
58960
 
@@ -58112,4 +58964,4 @@ if ( typeof window !== 'undefined' ) {
58112
58964
 
58113
58965
  }
58114
58966
 
58115
- export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, getByteLength, getUnlitUniformColorSpace, mergeUniforms, probeAsync, toNormalizedProjectionMatrix, toReversedProjectionMatrix, warnOnce };
58967
+ export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, error, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, log, mergeUniforms, probeAsync, setConsoleFunction, warn, warnOnce };