vc-spaces365-threejs 0.180.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.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/build/three.cjs +77750 -0
- package/build/three.core.js +58846 -0
- package/build/three.core.min.js +6 -0
- package/build/three.module.js +18484 -0
- package/build/three.module.min.js +6 -0
- package/build/three.tsl.js +636 -0
- package/build/three.tsl.min.js +6 -0
- package/build/three.webgpu.js +77332 -0
- package/build/three.webgpu.min.js +6 -0
- package/build/three.webgpu.nodes.js +77103 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/fonts/LICENSE +13 -0
- package/examples/fonts/README.md +11 -0
- package/examples/fonts/droid/NOTICE +190 -0
- package/examples/fonts/droid/README.txt +18 -0
- package/examples/fonts/droid/droid_sans_bold.typeface.json +1 -0
- package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +1 -0
- package/examples/fonts/droid/droid_sans_regular.typeface.json +1 -0
- package/examples/fonts/droid/droid_serif_bold.typeface.json +1 -0
- package/examples/fonts/droid/droid_serif_regular.typeface.json +1 -0
- package/examples/fonts/gentilis_bold.typeface.json +1 -0
- package/examples/fonts/gentilis_regular.typeface.json +1 -0
- package/examples/fonts/helvetiker_bold.typeface.json +1 -0
- package/examples/fonts/helvetiker_regular.typeface.json +1 -0
- package/examples/fonts/optimer_bold.typeface.json +1 -0
- package/examples/fonts/optimer_regular.typeface.json +1 -0
- package/examples/fonts/ttf/README.md +9 -0
- package/examples/fonts/ttf/kenpixel.ttf +0 -0
- package/examples/jsm/Addons.js +285 -0
- package/examples/jsm/animation/AnimationClipCreator.js +168 -0
- package/examples/jsm/animation/CCDIKSolver.js +591 -0
- package/examples/jsm/capabilities/WebGL.js +113 -0
- package/examples/jsm/capabilities/WebGPU.js +59 -0
- package/examples/jsm/controls/ArcballControls.js +3536 -0
- package/examples/jsm/controls/DragControls.js +452 -0
- package/examples/jsm/controls/FirstPersonControls.js +447 -0
- package/examples/jsm/controls/FlyControls.js +380 -0
- package/examples/jsm/controls/MapControls.js +62 -0
- package/examples/jsm/controls/OrbitControls.js +1860 -0
- package/examples/jsm/controls/PointerLockControls.js +264 -0
- package/examples/jsm/controls/TrackballControls.js +1001 -0
- package/examples/jsm/controls/TransformControls.js +1918 -0
- package/examples/jsm/csm/CSM.js +597 -0
- package/examples/jsm/csm/CSMFrustum.js +209 -0
- package/examples/jsm/csm/CSMHelper.js +243 -0
- package/examples/jsm/csm/CSMShader.js +307 -0
- package/examples/jsm/csm/CSMShadowNode.js +599 -0
- package/examples/jsm/curves/CurveExtras.js +694 -0
- package/examples/jsm/curves/NURBSCurve.js +155 -0
- package/examples/jsm/curves/NURBSSurface.js +98 -0
- package/examples/jsm/curves/NURBSUtils.js +532 -0
- package/examples/jsm/curves/NURBSVolume.js +82 -0
- package/examples/jsm/effects/AnaglyphEffect.js +179 -0
- package/examples/jsm/effects/AsciiEffect.js +310 -0
- package/examples/jsm/effects/OutlineEffect.js +489 -0
- package/examples/jsm/effects/ParallaxBarrierEffect.js +155 -0
- package/examples/jsm/effects/StereoEffect.js +91 -0
- package/examples/jsm/environments/DebugEnvironment.js +102 -0
- package/examples/jsm/environments/RoomEnvironment.js +182 -0
- package/examples/jsm/exporters/DRACOExporter.js +311 -0
- package/examples/jsm/exporters/EXRExporter.js +618 -0
- package/examples/jsm/exporters/GLTFExporter.js +3595 -0
- package/examples/jsm/exporters/KTX2Exporter.js +347 -0
- package/examples/jsm/exporters/OBJExporter.js +308 -0
- package/examples/jsm/exporters/PLYExporter.js +562 -0
- package/examples/jsm/exporters/STLExporter.js +221 -0
- package/examples/jsm/exporters/USDZExporter.js +1228 -0
- package/examples/jsm/geometries/BoxLineGeometry.js +92 -0
- package/examples/jsm/geometries/ConvexGeometry.js +72 -0
- package/examples/jsm/geometries/DecalGeometry.js +420 -0
- package/examples/jsm/geometries/ParametricFunctions.js +100 -0
- package/examples/jsm/geometries/ParametricGeometry.js +172 -0
- package/examples/jsm/geometries/RoundedBoxGeometry.js +216 -0
- package/examples/jsm/geometries/TeapotGeometry.js +689 -0
- package/examples/jsm/geometries/TextGeometry.js +83 -0
- package/examples/jsm/helpers/LightProbeHelper.js +165 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +102 -0
- package/examples/jsm/helpers/OctreeHelper.js +109 -0
- package/examples/jsm/helpers/PositionalAudioHelper.js +169 -0
- package/examples/jsm/helpers/RapierHelper.js +59 -0
- package/examples/jsm/helpers/RectAreaLightHelper.js +118 -0
- package/examples/jsm/helpers/TextureHelper.js +265 -0
- package/examples/jsm/helpers/TextureHelperGPU.js +214 -0
- package/examples/jsm/helpers/VertexNormalsHelper.js +155 -0
- package/examples/jsm/helpers/VertexTangentsHelper.js +133 -0
- package/examples/jsm/helpers/ViewHelper.js +422 -0
- package/examples/jsm/interactive/HTMLMesh.js +605 -0
- package/examples/jsm/interactive/InteractiveGroup.js +224 -0
- package/examples/jsm/interactive/SelectionBox.js +294 -0
- package/examples/jsm/interactive/SelectionHelper.js +150 -0
- package/examples/jsm/libs/ammo.wasm.js +822 -0
- package/examples/jsm/libs/ammo.wasm.wasm +0 -0
- package/examples/jsm/libs/basis/README.md +46 -0
- package/examples/jsm/libs/basis/basis_transcoder.js +19 -0
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/chevrotain.module.min.js +141 -0
- package/examples/jsm/libs/demuxer_mp4.js +109 -0
- package/examples/jsm/libs/draco/README.md +32 -0
- package/examples/jsm/libs/draco/draco_decoder.js +34 -0
- package/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
- package/examples/jsm/libs/draco/draco_encoder.js +33 -0
- package/examples/jsm/libs/draco/draco_wasm_wrapper.js +117 -0
- package/examples/jsm/libs/draco/gltf/draco_decoder.js +33 -0
- package/examples/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/examples/jsm/libs/draco/gltf/draco_encoder.js +33 -0
- package/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/examples/jsm/libs/ecsy.module.js +1792 -0
- package/examples/jsm/libs/fflate.module.js +2672 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -0
- package/examples/jsm/libs/lil-gui.module.min.js +8 -0
- package/examples/jsm/libs/lottie_canvas.module.js +14849 -0
- package/examples/jsm/libs/meshopt_decoder.module.js +195 -0
- package/examples/jsm/libs/mikktspace.module.js +128 -0
- package/examples/jsm/libs/motion-controllers.module.js +397 -0
- package/examples/jsm/libs/opentype.module.js +14506 -0
- package/examples/jsm/libs/potpack.module.js +125 -0
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +21 -0
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +16 -0
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/libs/stats.module.js +167 -0
- package/examples/jsm/libs/surfaceNet.js +201 -0
- package/examples/jsm/libs/tween.module.js +876 -0
- package/examples/jsm/libs/utif.module.js +1665 -0
- package/examples/jsm/libs/zstddec.module.js +1 -0
- package/examples/jsm/lighting/TiledLighting.js +42 -0
- package/examples/jsm/lights/LightProbeGenerator.js +337 -0
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +127 -0
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +40 -0
- package/examples/jsm/lines/Line2.js +56 -0
- package/examples/jsm/lines/LineGeometry.js +157 -0
- package/examples/jsm/lines/LineMaterial.js +697 -0
- package/examples/jsm/lines/LineSegments2.js +426 -0
- package/examples/jsm/lines/LineSegmentsGeometry.js +298 -0
- package/examples/jsm/lines/Wireframe.js +108 -0
- package/examples/jsm/lines/WireframeGeometry2.js +49 -0
- package/examples/jsm/lines/webgpu/Line2.js +46 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +411 -0
- package/examples/jsm/lines/webgpu/Wireframe.js +86 -0
- package/examples/jsm/loaders/3DMLoader.js +1835 -0
- package/examples/jsm/loaders/3MFLoader.js +1621 -0
- package/examples/jsm/loaders/AMFLoader.js +541 -0
- package/examples/jsm/loaders/BVHLoader.js +484 -0
- package/examples/jsm/loaders/ColladaLoader.js +4155 -0
- package/examples/jsm/loaders/DDSLoader.js +385 -0
- package/examples/jsm/loaders/DRACOLoader.js +688 -0
- package/examples/jsm/loaders/EXRLoader.js +2784 -0
- package/examples/jsm/loaders/FBXLoader.js +4382 -0
- package/examples/jsm/loaders/FontLoader.js +242 -0
- package/examples/jsm/loaders/GCodeLoader.js +292 -0
- package/examples/jsm/loaders/GLTFLoader.js +4890 -0
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +164 -0
- package/examples/jsm/loaders/HDRLoader.js +486 -0
- package/examples/jsm/loaders/IESLoader.js +379 -0
- package/examples/jsm/loaders/KMZLoader.js +163 -0
- package/examples/jsm/loaders/KTX2Loader.js +1228 -0
- package/examples/jsm/loaders/KTXLoader.js +197 -0
- package/examples/jsm/loaders/LDrawLoader.js +2519 -0
- package/examples/jsm/loaders/LUT3dlLoader.js +205 -0
- package/examples/jsm/loaders/LUTCubeLoader.js +190 -0
- package/examples/jsm/loaders/LUTImageLoader.js +190 -0
- package/examples/jsm/loaders/LWOLoader.js +1079 -0
- package/examples/jsm/loaders/LottieLoader.js +130 -0
- package/examples/jsm/loaders/MD2Loader.js +435 -0
- package/examples/jsm/loaders/MDDLoader.js +147 -0
- package/examples/jsm/loaders/MTLLoader.js +593 -0
- package/examples/jsm/loaders/MaterialXLoader.js +1087 -0
- package/examples/jsm/loaders/NRRDLoader.js +718 -0
- package/examples/jsm/loaders/OBJLoader.js +955 -0
- package/examples/jsm/loaders/PCDLoader.js +618 -0
- package/examples/jsm/loaders/PDBLoader.js +272 -0
- package/examples/jsm/loaders/PLYLoader.js +805 -0
- package/examples/jsm/loaders/PVRLoader.js +270 -0
- package/examples/jsm/loaders/RGBELoader.js +18 -0
- package/examples/jsm/loaders/STLLoader.js +421 -0
- package/examples/jsm/loaders/SVGLoader.js +3267 -0
- package/examples/jsm/loaders/TDSLoader.js +1144 -0
- package/examples/jsm/loaders/TGALoader.js +540 -0
- package/examples/jsm/loaders/TIFFLoader.js +59 -0
- package/examples/jsm/loaders/TTFLoader.js +261 -0
- package/examples/jsm/loaders/USDLoader.js +219 -0
- package/examples/jsm/loaders/USDZLoader.js +16 -0
- package/examples/jsm/loaders/UltraHDRLoader.js +630 -0
- package/examples/jsm/loaders/VOXLoader.js +376 -0
- package/examples/jsm/loaders/VRMLLoader.js +3569 -0
- package/examples/jsm/loaders/VTKLoader.js +1276 -0
- package/examples/jsm/loaders/XYZLoader.js +143 -0
- package/examples/jsm/loaders/lwo/IFFParser.js +1217 -0
- package/examples/jsm/loaders/lwo/LWO2Parser.js +414 -0
- package/examples/jsm/loaders/lwo/LWO3Parser.js +373 -0
- package/examples/jsm/loaders/usd/USDAParser.js +741 -0
- package/examples/jsm/loaders/usd/USDCParser.js +17 -0
- package/examples/jsm/materials/LDrawConditionalLineMaterial.js +183 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +154 -0
- package/examples/jsm/materials/MeshGouraudMaterial.js +434 -0
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +167 -0
- package/examples/jsm/materials/WoodNodeMaterial.js +533 -0
- package/examples/jsm/math/Capsule.js +159 -0
- package/examples/jsm/math/ColorConverter.js +58 -0
- package/examples/jsm/math/ColorSpaces.js +147 -0
- package/examples/jsm/math/ConvexHull.js +1695 -0
- package/examples/jsm/math/ImprovedNoise.js +88 -0
- package/examples/jsm/math/Lut.js +317 -0
- package/examples/jsm/math/MeshSurfaceSampler.js +315 -0
- package/examples/jsm/math/OBB.js +535 -0
- package/examples/jsm/math/Octree.js +692 -0
- package/examples/jsm/math/SimplexNoise.js +470 -0
- package/examples/jsm/misc/ConvexObjectBreaker.js +539 -0
- package/examples/jsm/misc/GPUComputationRenderer.js +506 -0
- package/examples/jsm/misc/Gyroscope.js +78 -0
- package/examples/jsm/misc/MD2Character.js +391 -0
- package/examples/jsm/misc/MD2CharacterComplex.js +740 -0
- package/examples/jsm/misc/MorphAnimMesh.js +119 -0
- package/examples/jsm/misc/MorphBlendMesh.js +425 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +370 -0
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +322 -0
- package/examples/jsm/misc/RollerCoaster.js +623 -0
- package/examples/jsm/misc/TubePainter.js +256 -0
- package/examples/jsm/misc/Volume.js +521 -0
- package/examples/jsm/misc/VolumeSlice.js +276 -0
- package/examples/jsm/modifiers/CurveModifier.js +374 -0
- package/examples/jsm/modifiers/CurveModifierGPU.js +256 -0
- package/examples/jsm/modifiers/EdgeSplitModifier.js +299 -0
- package/examples/jsm/modifiers/SimplifyModifier.js +632 -0
- package/examples/jsm/modifiers/TessellateModifier.js +340 -0
- package/examples/jsm/objects/GroundedSkybox.js +69 -0
- package/examples/jsm/objects/Lensflare.js +489 -0
- package/examples/jsm/objects/LensflareMesh.js +376 -0
- package/examples/jsm/objects/MarchingCubes.js +1261 -0
- package/examples/jsm/objects/Reflector.js +338 -0
- package/examples/jsm/objects/ReflectorForSSRPass.js +393 -0
- package/examples/jsm/objects/Refractor.js +389 -0
- package/examples/jsm/objects/ShadowMesh.js +130 -0
- package/examples/jsm/objects/Sky.js +237 -0
- package/examples/jsm/objects/SkyMesh.js +243 -0
- package/examples/jsm/objects/Water.js +373 -0
- package/examples/jsm/objects/Water2.js +401 -0
- package/examples/jsm/objects/Water2Mesh.js +199 -0
- package/examples/jsm/objects/WaterMesh.js +196 -0
- package/examples/jsm/offscreen/jank.js +45 -0
- package/examples/jsm/offscreen/offscreen.js +8 -0
- package/examples/jsm/offscreen/scene.js +86 -0
- package/examples/jsm/physics/AmmoPhysics.js +354 -0
- package/examples/jsm/physics/JoltPhysics.js +330 -0
- package/examples/jsm/physics/RapierPhysics.js +432 -0
- package/examples/jsm/postprocessing/AfterimagePass.js +185 -0
- package/examples/jsm/postprocessing/BloomPass.js +274 -0
- package/examples/jsm/postprocessing/BokehPass.js +218 -0
- package/examples/jsm/postprocessing/ClearPass.js +97 -0
- package/examples/jsm/postprocessing/CubeTexturePass.js +146 -0
- package/examples/jsm/postprocessing/DotScreenPass.js +114 -0
- package/examples/jsm/postprocessing/EffectComposer.js +363 -0
- package/examples/jsm/postprocessing/FXAAPass.js +40 -0
- package/examples/jsm/postprocessing/FilmPass.js +113 -0
- package/examples/jsm/postprocessing/GTAOPass.js +727 -0
- package/examples/jsm/postprocessing/GlitchPass.js +177 -0
- package/examples/jsm/postprocessing/HalftonePass.js +134 -0
- package/examples/jsm/postprocessing/LUTPass.js +138 -0
- package/examples/jsm/postprocessing/MaskPass.js +195 -0
- package/examples/jsm/postprocessing/OutlinePass.js +776 -0
- package/examples/jsm/postprocessing/OutputPass.js +139 -0
- package/examples/jsm/postprocessing/Pass.js +191 -0
- package/examples/jsm/postprocessing/RenderPass.js +183 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +314 -0
- package/examples/jsm/postprocessing/RenderTransitionPass.js +267 -0
- package/examples/jsm/postprocessing/SAOPass.js +407 -0
- package/examples/jsm/postprocessing/SMAAPass.js +230 -0
- package/examples/jsm/postprocessing/SSAARenderPass.js +313 -0
- package/examples/jsm/postprocessing/SSAOPass.js +527 -0
- package/examples/jsm/postprocessing/SSRPass.js +856 -0
- package/examples/jsm/postprocessing/SavePass.js +132 -0
- package/examples/jsm/postprocessing/ShaderPass.js +135 -0
- package/examples/jsm/postprocessing/TAARenderPass.js +243 -0
- package/examples/jsm/postprocessing/TexturePass.js +131 -0
- package/examples/jsm/postprocessing/UnrealBloomPass.js +492 -0
- package/examples/jsm/renderers/CSS2DRenderer.js +317 -0
- package/examples/jsm/renderers/CSS3DRenderer.js +453 -0
- package/examples/jsm/renderers/Projector.js +936 -0
- package/examples/jsm/renderers/SVGRenderer.js +685 -0
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +96 -0
- package/examples/jsm/shaders/AfterimageShader.js +63 -0
- package/examples/jsm/shaders/BasicShader.js +36 -0
- package/examples/jsm/shaders/BleachBypassShader.js +68 -0
- package/examples/jsm/shaders/BlendShader.js +56 -0
- package/examples/jsm/shaders/BokehShader.js +151 -0
- package/examples/jsm/shaders/BokehShader2.js +404 -0
- package/examples/jsm/shaders/BrightnessContrastShader.js +62 -0
- package/examples/jsm/shaders/ColorCorrectionShader.js +59 -0
- package/examples/jsm/shaders/ColorifyShader.js +57 -0
- package/examples/jsm/shaders/ConvolutionShader.js +74 -0
- package/examples/jsm/shaders/CopyShader.js +52 -0
- package/examples/jsm/shaders/DOFMipMapShader.js +63 -0
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +180 -0
- package/examples/jsm/shaders/DigitalGlitch.js +104 -0
- package/examples/jsm/shaders/DotScreenShader.js +75 -0
- package/examples/jsm/shaders/ExposureShader.js +51 -0
- package/examples/jsm/shaders/FXAAShader.js +298 -0
- package/examples/jsm/shaders/FilmShader.js +72 -0
- package/examples/jsm/shaders/FocusShader.js +94 -0
- package/examples/jsm/shaders/FreiChenShader.js +103 -0
- package/examples/jsm/shaders/GTAOShader.js +421 -0
- package/examples/jsm/shaders/GammaCorrectionShader.js +52 -0
- package/examples/jsm/shaders/GodRaysShader.js +333 -0
- package/examples/jsm/shaders/HalftoneShader.js +321 -0
- package/examples/jsm/shaders/HorizontalBlurShader.js +68 -0
- package/examples/jsm/shaders/HorizontalTiltShiftShader.js +70 -0
- package/examples/jsm/shaders/HueSaturationShader.js +74 -0
- package/examples/jsm/shaders/KaleidoShader.js +65 -0
- package/examples/jsm/shaders/LuminosityHighPassShader.js +68 -0
- package/examples/jsm/shaders/LuminosityShader.js +54 -0
- package/examples/jsm/shaders/MirrorShader.js +62 -0
- package/examples/jsm/shaders/NormalMapShader.js +60 -0
- package/examples/jsm/shaders/OutputShader.js +103 -0
- package/examples/jsm/shaders/PoissonDenoiseShader.js +235 -0
- package/examples/jsm/shaders/RGBShiftShader.js +61 -0
- package/examples/jsm/shaders/SAOShader.js +188 -0
- package/examples/jsm/shaders/SMAAShader.js +489 -0
- package/examples/jsm/shaders/SSAOShader.js +321 -0
- package/examples/jsm/shaders/SSRShader.js +395 -0
- package/examples/jsm/shaders/SepiaShader.js +57 -0
- package/examples/jsm/shaders/SobelOperatorShader.js +98 -0
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +95 -0
- package/examples/jsm/shaders/TechnicolorShader.js +51 -0
- package/examples/jsm/shaders/ToonShader.js +349 -0
- package/examples/jsm/shaders/TriangleBlurShader.js +79 -0
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +62 -0
- package/examples/jsm/shaders/VelocityShader.js +137 -0
- package/examples/jsm/shaders/VerticalBlurShader.js +66 -0
- package/examples/jsm/shaders/VerticalTiltShiftShader.js +70 -0
- package/examples/jsm/shaders/VignetteShader.js +56 -0
- package/examples/jsm/shaders/VolumeShader.js +298 -0
- package/examples/jsm/shaders/WaterRefractionShader.js +106 -0
- package/examples/jsm/textures/FlakesTexture.js +54 -0
- package/examples/jsm/textures/IESTexture.js +101 -0
- package/examples/jsm/transpiler/AST.js +631 -0
- package/examples/jsm/transpiler/GLSLDecoder.js +1171 -0
- package/examples/jsm/transpiler/Linker.js +327 -0
- package/examples/jsm/transpiler/ShaderToyDecoder.js +49 -0
- package/examples/jsm/transpiler/TSLEncoder.js +933 -0
- package/examples/jsm/transpiler/Transpiler.js +67 -0
- package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
- package/examples/jsm/transpiler/WGSLEncoder.js +812 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +242 -0
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +107 -0
- package/examples/jsm/tsl/display/AnamorphicNode.js +281 -0
- package/examples/jsm/tsl/display/BleachBypass.js +33 -0
- package/examples/jsm/tsl/display/BloomNode.js +520 -0
- package/examples/jsm/tsl/display/ChromaticAberrationNode.js +207 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +332 -0
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +547 -0
- package/examples/jsm/tsl/display/DotScreenNode.js +104 -0
- package/examples/jsm/tsl/display/FXAANode.js +365 -0
- package/examples/jsm/tsl/display/FilmNode.js +101 -0
- package/examples/jsm/tsl/display/GTAONode.js +530 -0
- package/examples/jsm/tsl/display/GaussianBlurNode.js +378 -0
- package/examples/jsm/tsl/display/LensflareNode.js +279 -0
- package/examples/jsm/tsl/display/Lut3DNode.js +109 -0
- package/examples/jsm/tsl/display/MotionBlur.js +33 -0
- package/examples/jsm/tsl/display/OutlineNode.js +751 -0
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +89 -0
- package/examples/jsm/tsl/display/PixelationPassNode.js +334 -0
- package/examples/jsm/tsl/display/RGBShiftNode.js +96 -0
- package/examples/jsm/tsl/display/SMAANode.js +768 -0
- package/examples/jsm/tsl/display/SSAAPassNode.js +358 -0
- package/examples/jsm/tsl/display/SSGINode.js +650 -0
- package/examples/jsm/tsl/display/SSRNode.js +654 -0
- package/examples/jsm/tsl/display/Sepia.js +24 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +168 -0
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +185 -0
- package/examples/jsm/tsl/display/StereoPassNode.js +120 -0
- package/examples/jsm/tsl/display/TRAANode.js +461 -0
- package/examples/jsm/tsl/display/TransitionNode.js +141 -0
- package/examples/jsm/tsl/display/boxBlur.js +64 -0
- package/examples/jsm/tsl/display/hashBlur.js +53 -0
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +422 -0
- package/examples/jsm/tsl/math/Bayer.js +34 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +456 -0
- package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +212 -0
- package/examples/jsm/tsl/utils/Raymarching.js +70 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +1435 -0
- package/examples/jsm/utils/CameraUtils.js +82 -0
- package/examples/jsm/utils/GeometryCompressionUtils.js +547 -0
- package/examples/jsm/utils/GeometryUtils.js +226 -0
- package/examples/jsm/utils/LDrawUtils.js +211 -0
- package/examples/jsm/utils/SceneOptimizer.js +458 -0
- package/examples/jsm/utils/SceneUtils.js +363 -0
- package/examples/jsm/utils/ShadowMapViewer.js +230 -0
- package/examples/jsm/utils/ShadowMapViewerGPU.js +233 -0
- package/examples/jsm/utils/SkeletonUtils.js +490 -0
- package/examples/jsm/utils/SortUtils.js +175 -0
- package/examples/jsm/utils/UVsDebug.js +173 -0
- package/examples/jsm/utils/WebGLTextureUtils.js +115 -0
- package/examples/jsm/utils/WebGPUTextureUtils.js +81 -0
- package/examples/jsm/utils/WorkerPool.js +167 -0
- package/examples/jsm/webxr/ARButton.js +251 -0
- package/examples/jsm/webxr/OculusHandModel.js +194 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +539 -0
- package/examples/jsm/webxr/Text2D.js +52 -0
- package/examples/jsm/webxr/VRButton.js +264 -0
- package/examples/jsm/webxr/XRButton.js +246 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +403 -0
- package/examples/jsm/webxr/XREstimatedLight.js +254 -0
- package/examples/jsm/webxr/XRHandMeshModel.js +151 -0
- package/examples/jsm/webxr/XRHandModelFactory.js +197 -0
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +147 -0
- package/examples/jsm/webxr/XRPlanes.js +118 -0
- package/package.json +134 -0
- package/src/Three.Core.js +185 -0
- package/src/Three.Legacy.js +0 -0
- package/src/Three.TSL.js +629 -0
- package/src/Three.WebGPU.Nodes.js +24 -0
- package/src/Three.WebGPU.js +26 -0
- package/src/Three.js +9 -0
- package/src/animation/AnimationAction.js +932 -0
- package/src/animation/AnimationClip.js +628 -0
- package/src/animation/AnimationMixer.js +854 -0
- package/src/animation/AnimationObjectGroup.js +411 -0
- package/src/animation/AnimationUtils.js +506 -0
- package/src/animation/KeyframeTrack.js +597 -0
- package/src/animation/PropertyBinding.js +794 -0
- package/src/animation/PropertyMixer.js +385 -0
- package/src/animation/tracks/BooleanKeyframeTrack.js +55 -0
- package/src/animation/tracks/ColorKeyframeTrack.js +36 -0
- package/src/animation/tracks/NumberKeyframeTrack.js +36 -0
- package/src/animation/tracks/QuaternionKeyframeTrack.js +51 -0
- package/src/animation/tracks/StringKeyframeTrack.js +55 -0
- package/src/animation/tracks/VectorKeyframeTrack.js +36 -0
- package/src/audio/Audio.js +778 -0
- package/src/audio/AudioAnalyser.js +97 -0
- package/src/audio/AudioContext.js +40 -0
- package/src/audio/AudioListener.js +216 -0
- package/src/audio/PositionalAudio.js +253 -0
- package/src/cameras/ArrayCamera.js +54 -0
- package/src/cameras/Camera.js +130 -0
- package/src/cameras/CubeCamera.js +239 -0
- package/src/cameras/OrthographicCamera.js +245 -0
- package/src/cameras/PerspectiveCamera.js +407 -0
- package/src/cameras/StereoCamera.js +146 -0
- package/src/constants.js +1675 -0
- package/src/core/BufferAttribute.js +1044 -0
- package/src/core/BufferGeometry.js +1446 -0
- package/src/core/Clock.js +128 -0
- package/src/core/EventDispatcher.js +131 -0
- package/src/core/GLBufferAttribute.js +171 -0
- package/src/core/InstancedBufferAttribute.js +68 -0
- package/src/core/InstancedBufferGeometry.js +60 -0
- package/src/core/InstancedInterleavedBuffer.js +74 -0
- package/src/core/InterleavedBuffer.js +291 -0
- package/src/core/InterleavedBufferAttribute.js +549 -0
- package/src/core/Layers.js +121 -0
- package/src/core/Object3D.js +1619 -0
- package/src/core/Raycaster.js +262 -0
- package/src/core/RenderTarget.js +392 -0
- package/src/core/RenderTarget3D.js +48 -0
- package/src/core/Timer.js +184 -0
- package/src/core/Uniform.js +46 -0
- package/src/core/UniformsGroup.js +180 -0
- package/src/extras/Controls.js +120 -0
- package/src/extras/DataUtils.js +217 -0
- package/src/extras/Earcut.js +22 -0
- package/src/extras/ImageUtils.js +137 -0
- package/src/extras/PMREMGenerator.js +966 -0
- package/src/extras/ShapeUtils.js +114 -0
- package/src/extras/TextureUtils.js +293 -0
- package/src/extras/core/Curve.js +517 -0
- package/src/extras/core/CurvePath.js +296 -0
- package/src/extras/core/Interpolations.js +105 -0
- package/src/extras/core/Path.js +329 -0
- package/src/extras/core/Shape.js +165 -0
- package/src/extras/core/ShapePath.js +367 -0
- package/src/extras/curves/ArcCurve.js +39 -0
- package/src/extras/curves/CatmullRomCurve3.js +326 -0
- package/src/extras/curves/CubicBezierCurve.js +145 -0
- package/src/extras/curves/CubicBezierCurve3.js +129 -0
- package/src/extras/curves/Curves.js +10 -0
- package/src/extras/curves/EllipseCurve.js +258 -0
- package/src/extras/curves/LineCurve.js +128 -0
- package/src/extras/curves/LineCurve3.js +128 -0
- package/src/extras/curves/QuadraticBezierCurve.js +133 -0
- package/src/extras/curves/QuadraticBezierCurve3.js +118 -0
- package/src/extras/curves/SplineCurve.js +145 -0
- package/src/extras/lib/earcut.js +685 -0
- package/src/geometries/BoxGeometry.js +218 -0
- package/src/geometries/CapsuleGeometry.js +217 -0
- package/src/geometries/CircleGeometry.js +141 -0
- package/src/geometries/ConeGeometry.js +69 -0
- package/src/geometries/CylinderGeometry.js +332 -0
- package/src/geometries/DodecahedronGeometry.js +98 -0
- package/src/geometries/EdgesGeometry.js +180 -0
- package/src/geometries/ExtrudeGeometry.js +909 -0
- package/src/geometries/Geometries.js +21 -0
- package/src/geometries/IcosahedronGeometry.js +74 -0
- package/src/geometries/LatheGeometry.js +229 -0
- package/src/geometries/OctahedronGeometry.js +69 -0
- package/src/geometries/PlaneGeometry.js +132 -0
- package/src/geometries/PolyhedronGeometry.js +348 -0
- package/src/geometries/RingGeometry.js +164 -0
- package/src/geometries/ShapeGeometry.js +232 -0
- package/src/geometries/SphereGeometry.js +174 -0
- package/src/geometries/TetrahedronGeometry.js +66 -0
- package/src/geometries/TorusGeometry.js +155 -0
- package/src/geometries/TorusKnotGeometry.js +205 -0
- package/src/geometries/TubeGeometry.js +252 -0
- package/src/geometries/WireframeGeometry.js +179 -0
- package/src/helpers/ArrowHelper.js +171 -0
- package/src/helpers/AxesHelper.js +96 -0
- package/src/helpers/Box3Helper.js +83 -0
- package/src/helpers/BoxHelper.js +149 -0
- package/src/helpers/CameraHelper.js +342 -0
- package/src/helpers/DirectionalLightHelper.js +145 -0
- package/src/helpers/GridHelper.js +82 -0
- package/src/helpers/HemisphereLightHelper.js +127 -0
- package/src/helpers/PlaneHelper.js +96 -0
- package/src/helpers/PointLightHelper.js +135 -0
- package/src/helpers/PolarGridHelper.js +126 -0
- package/src/helpers/SkeletonHelper.js +194 -0
- package/src/helpers/SpotLightHelper.js +151 -0
- package/src/lights/AmbientLight.js +42 -0
- package/src/lights/DirectionalLight.js +100 -0
- package/src/lights/DirectionalLightShadow.js +31 -0
- package/src/lights/HemisphereLight.js +66 -0
- package/src/lights/Light.js +95 -0
- package/src/lights/LightProbe.js +90 -0
- package/src/lights/LightShadow.js +338 -0
- package/src/lights/PointLight.js +116 -0
- package/src/lights/PointLightShadow.js +117 -0
- package/src/lights/RectAreaLight.js +115 -0
- package/src/lights/SpotLight.js +173 -0
- package/src/lights/SpotLightShadow.js +80 -0
- package/src/lights/webgpu/IESSpotLight.js +46 -0
- package/src/lights/webgpu/ProjectorLight.js +46 -0
- package/src/loaders/AnimationLoader.js +98 -0
- package/src/loaders/AudioLoader.js +98 -0
- package/src/loaders/BufferGeometryLoader.js +242 -0
- package/src/loaders/Cache.js +87 -0
- package/src/loaders/CompressedTextureLoader.js +167 -0
- package/src/loaders/CubeTextureLoader.js +103 -0
- package/src/loaders/DataTextureLoader.js +172 -0
- package/src/loaders/FileLoader.js +368 -0
- package/src/loaders/IESLoader.js +327 -0
- package/src/loaders/ImageBitmapLoader.js +220 -0
- package/src/loaders/ImageLoader.js +168 -0
- package/src/loaders/Loader.js +216 -0
- package/src/loaders/LoaderUtils.js +59 -0
- package/src/loaders/LoadingManager.js +307 -0
- package/src/loaders/MaterialLoader.js +438 -0
- package/src/loaders/ObjectLoader.js +1264 -0
- package/src/loaders/TextureLoader.js +74 -0
- package/src/loaders/nodes/NodeLoader.js +194 -0
- package/src/loaders/nodes/NodeMaterialLoader.js +108 -0
- package/src/loaders/nodes/NodeObjectLoader.js +151 -0
- package/src/materials/LineBasicMaterial.js +122 -0
- package/src/materials/LineDashedMaterial.js +86 -0
- package/src/materials/Material.js +1015 -0
- package/src/materials/Materials.js +39 -0
- package/src/materials/MeshBasicMaterial.js +249 -0
- package/src/materials/MeshDepthMaterial.js +147 -0
- package/src/materials/MeshDistanceMaterial.js +119 -0
- package/src/materials/MeshLambertMaterial.js +392 -0
- package/src/materials/MeshMatcapMaterial.js +223 -0
- package/src/materials/MeshNormalMaterial.js +174 -0
- package/src/materials/MeshPhongMaterial.js +411 -0
- package/src/materials/MeshPhysicalMaterial.js +535 -0
- package/src/materials/MeshStandardMaterial.js +424 -0
- package/src/materials/MeshToonMaterial.js +320 -0
- package/src/materials/PointsMaterial.js +139 -0
- package/src/materials/RawShaderMaterial.js +42 -0
- package/src/materials/ShaderMaterial.js +394 -0
- package/src/materials/ShadowMaterial.js +91 -0
- package/src/materials/SpriteMaterial.js +136 -0
- package/src/materials/nodes/Line2NodeMaterial.js +542 -0
- package/src/materials/nodes/LineBasicNodeMaterial.js +46 -0
- package/src/materials/nodes/LineDashedNodeMaterial.js +132 -0
- package/src/materials/nodes/MeshBasicNodeMaterial.js +134 -0
- package/src/materials/nodes/MeshLambertNodeMaterial.js +82 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +77 -0
- package/src/materials/nodes/MeshNormalNodeMaterial.js +67 -0
- package/src/materials/nodes/MeshPhongNodeMaterial.js +141 -0
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +518 -0
- package/src/materials/nodes/MeshSSSNodeMaterial.js +175 -0
- package/src/materials/nodes/MeshStandardNodeMaterial.js +186 -0
- package/src/materials/nodes/MeshToonNodeMaterial.js +66 -0
- package/src/materials/nodes/NodeMaterial.js +1271 -0
- package/src/materials/nodes/NodeMaterials.js +21 -0
- package/src/materials/nodes/PointsNodeMaterial.js +211 -0
- package/src/materials/nodes/ShadowNodeMaterial.js +76 -0
- package/src/materials/nodes/SpriteNodeMaterial.js +186 -0
- package/src/materials/nodes/VolumeNodeMaterial.js +81 -0
- package/src/materials/nodes/manager/NodeMaterialObserver.js +612 -0
- package/src/math/Box2.js +381 -0
- package/src/math/Box3.js +805 -0
- package/src/math/Color.js +967 -0
- package/src/math/ColorManagement.js +215 -0
- package/src/math/Cylindrical.js +120 -0
- package/src/math/Euler.js +449 -0
- package/src/math/Frustum.js +285 -0
- package/src/math/FrustumArray.js +258 -0
- package/src/math/Interpolant.js +320 -0
- package/src/math/Line3.js +336 -0
- package/src/math/MathUtils.js +751 -0
- package/src/math/Matrix2.js +124 -0
- package/src/math/Matrix3.js +613 -0
- package/src/math/Matrix4.js +1301 -0
- package/src/math/Plane.js +367 -0
- package/src/math/Quaternion.js +943 -0
- package/src/math/Ray.js +655 -0
- package/src/math/Sphere.js +420 -0
- package/src/math/Spherical.js +147 -0
- package/src/math/SphericalHarmonics3.js +341 -0
- package/src/math/Triangle.js +539 -0
- package/src/math/Vector2.js +866 -0
- package/src/math/Vector3.js +1261 -0
- package/src/math/Vector4.js +1063 -0
- package/src/math/interpolants/CubicInterpolant.js +159 -0
- package/src/math/interpolants/DiscreteInterpolant.js +34 -0
- package/src/math/interpolants/LinearInterpolant.js +51 -0
- package/src/math/interpolants/QuaternionLinearInterpolant.js +48 -0
- package/src/nodes/Nodes.js +148 -0
- package/src/nodes/TSL.js +173 -0
- package/src/nodes/accessors/AccessorsUtils.js +53 -0
- package/src/nodes/accessors/Arrays.js +68 -0
- package/src/nodes/accessors/BatchNode.js +163 -0
- package/src/nodes/accessors/Bitangent.js +82 -0
- package/src/nodes/accessors/BufferAttributeNode.js +340 -0
- package/src/nodes/accessors/BufferNode.js +101 -0
- package/src/nodes/accessors/BuiltinNode.js +63 -0
- package/src/nodes/accessors/Camera.js +282 -0
- package/src/nodes/accessors/ClippingNode.js +255 -0
- package/src/nodes/accessors/CubeTextureNode.js +190 -0
- package/src/nodes/accessors/InstanceNode.js +244 -0
- package/src/nodes/accessors/InstancedMeshNode.js +50 -0
- package/src/nodes/accessors/Lights.js +129 -0
- package/src/nodes/accessors/MaterialNode.js +775 -0
- package/src/nodes/accessors/MaterialProperties.js +59 -0
- package/src/nodes/accessors/MaterialReferenceNode.js +85 -0
- package/src/nodes/accessors/ModelNode.js +184 -0
- package/src/nodes/accessors/ModelViewProjectionNode.js +13 -0
- package/src/nodes/accessors/MorphNode.js +310 -0
- package/src/nodes/accessors/Normal.js +243 -0
- package/src/nodes/accessors/Object3DNode.js +268 -0
- package/src/nodes/accessors/PointUVNode.js +55 -0
- package/src/nodes/accessors/Position.js +74 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +357 -0
- package/src/nodes/accessors/ReferenceNode.js +424 -0
- package/src/nodes/accessors/ReflectVector.js +36 -0
- package/src/nodes/accessors/RendererReferenceNode.js +79 -0
- package/src/nodes/accessors/SceneNode.js +145 -0
- package/src/nodes/accessors/SkinningNode.js +327 -0
- package/src/nodes/accessors/StorageBufferNode.js +416 -0
- package/src/nodes/accessors/StorageTextureNode.js +242 -0
- package/src/nodes/accessors/Tangent.js +70 -0
- package/src/nodes/accessors/TangentUtils.js +46 -0
- package/src/nodes/accessors/Texture3DNode.js +199 -0
- package/src/nodes/accessors/TextureBicubic.js +92 -0
- package/src/nodes/accessors/TextureNode.js +894 -0
- package/src/nodes/accessors/TextureSizeNode.js +77 -0
- package/src/nodes/accessors/UV.js +11 -0
- package/src/nodes/accessors/UniformArrayNode.js +348 -0
- package/src/nodes/accessors/UserDataNode.js +77 -0
- package/src/nodes/accessors/VelocityNode.js +224 -0
- package/src/nodes/accessors/VertexColorNode.js +110 -0
- package/src/nodes/code/CodeNode.js +181 -0
- package/src/nodes/code/ExpressionNode.js +68 -0
- package/src/nodes/code/FunctionCallNode.js +187 -0
- package/src/nodes/code/FunctionNode.js +183 -0
- package/src/nodes/code/ScriptableNode.js +726 -0
- package/src/nodes/code/ScriptableValueNode.js +253 -0
- package/src/nodes/core/ArrayNode.js +154 -0
- package/src/nodes/core/AssignNode.js +202 -0
- package/src/nodes/core/AttributeNode.js +168 -0
- package/src/nodes/core/BypassNode.js +93 -0
- package/src/nodes/core/CacheNode.js +100 -0
- package/src/nodes/core/ConstNode.js +67 -0
- package/src/nodes/core/ContextNode.js +190 -0
- package/src/nodes/core/IndexNode.js +164 -0
- package/src/nodes/core/InputNode.js +136 -0
- package/src/nodes/core/LightingModel.js +77 -0
- package/src/nodes/core/MRTNode.js +150 -0
- package/src/nodes/core/Node.js +959 -0
- package/src/nodes/core/NodeAttribute.js +53 -0
- package/src/nodes/core/NodeBuilder.js +2968 -0
- package/src/nodes/core/NodeCache.js +75 -0
- package/src/nodes/core/NodeCode.js +46 -0
- package/src/nodes/core/NodeFrame.js +306 -0
- package/src/nodes/core/NodeFunction.js +69 -0
- package/src/nodes/core/NodeFunctionInput.js +61 -0
- package/src/nodes/core/NodeParser.js +23 -0
- package/src/nodes/core/NodeUniform.js +91 -0
- package/src/nodes/core/NodeUtils.js +480 -0
- package/src/nodes/core/NodeVar.js +60 -0
- package/src/nodes/core/NodeVarying.js +63 -0
- package/src/nodes/core/OutputStructNode.js +103 -0
- package/src/nodes/core/ParameterNode.js +94 -0
- package/src/nodes/core/PropertyNode.js +344 -0
- package/src/nodes/core/StackNode.js +376 -0
- package/src/nodes/core/StructNode.js +120 -0
- package/src/nodes/core/StructType.js +13 -0
- package/src/nodes/core/StructTypeNode.js +154 -0
- package/src/nodes/core/SubBuildNode.js +89 -0
- package/src/nodes/core/TempNode.js +88 -0
- package/src/nodes/core/UniformGroupNode.js +137 -0
- package/src/nodes/core/UniformNode.js +243 -0
- package/src/nodes/core/VarNode.js +284 -0
- package/src/nodes/core/VaryingNode.js +227 -0
- package/src/nodes/core/constants.js +68 -0
- package/src/nodes/display/BlendModes.js +235 -0
- package/src/nodes/display/BumpMapNode.js +117 -0
- package/src/nodes/display/ColorAdjustment.js +141 -0
- package/src/nodes/display/ColorSpaceFunctions.js +54 -0
- package/src/nodes/display/ColorSpaceNode.js +164 -0
- package/src/nodes/display/FrontFacingNode.js +102 -0
- package/src/nodes/display/NormalMapNode.js +118 -0
- package/src/nodes/display/PassNode.js +905 -0
- package/src/nodes/display/PosterizeNode.js +65 -0
- package/src/nodes/display/RenderOutputNode.js +124 -0
- package/src/nodes/display/ScreenNode.js +290 -0
- package/src/nodes/display/ToneMappingFunctions.js +242 -0
- package/src/nodes/display/ToneMappingNode.js +121 -0
- package/src/nodes/display/ToonOutlinePassNode.js +183 -0
- package/src/nodes/display/ViewportDepthNode.js +294 -0
- package/src/nodes/display/ViewportDepthTextureNode.js +67 -0
- package/src/nodes/display/ViewportSharedTextureNode.js +73 -0
- package/src/nodes/display/ViewportTextureNode.js +228 -0
- package/src/nodes/fog/Fog.js +114 -0
- package/src/nodes/functions/BSDF/BRDF_GGX.js +55 -0
- package/src/nodes/functions/BSDF/BRDF_Lambert.js +9 -0
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +57 -0
- package/src/nodes/functions/BSDF/DFGApprox.js +30 -0
- package/src/nodes/functions/BSDF/D_GGX.js +23 -0
- package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +13 -0
- package/src/nodes/functions/BSDF/F_Schlick.js +16 -0
- package/src/nodes/functions/BSDF/LTC.js +175 -0
- package/src/nodes/functions/BSDF/Schlick_to_F0.js +21 -0
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +26 -0
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
- package/src/nodes/functions/BasicLightingModel.js +100 -0
- package/src/nodes/functions/PhongLightingModel.js +99 -0
- package/src/nodes/functions/PhysicalLightingModel.js +796 -0
- package/src/nodes/functions/ShadowMaskModel.js +58 -0
- package/src/nodes/functions/ToonLightingModel.js +70 -0
- package/src/nodes/functions/VolumetricLightingModel.js +183 -0
- package/src/nodes/functions/material/getAlphaHashThreshold.js +68 -0
- package/src/nodes/functions/material/getGeometryRoughness.js +19 -0
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +37 -0
- package/src/nodes/functions/material/getRoughness.js +18 -0
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +172 -0
- package/src/nodes/gpgpu/AtomicFunctionNode.js +274 -0
- package/src/nodes/gpgpu/BarrierNode.js +89 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +228 -0
- package/src/nodes/gpgpu/ComputeNode.js +273 -0
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +430 -0
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +234 -0
- package/src/nodes/lighting/AONode.js +45 -0
- package/src/nodes/lighting/AmbientLightNode.js +35 -0
- package/src/nodes/lighting/AnalyticLightNode.js +256 -0
- package/src/nodes/lighting/BasicEnvironmentNode.js +49 -0
- package/src/nodes/lighting/BasicLightMapNode.js +49 -0
- package/src/nodes/lighting/DirectionalLightNode.js +39 -0
- package/src/nodes/lighting/EnvironmentNode.js +153 -0
- package/src/nodes/lighting/HemisphereLightNode.js +87 -0
- package/src/nodes/lighting/IESSpotLightNode.js +49 -0
- package/src/nodes/lighting/IrradianceNode.js +44 -0
- package/src/nodes/lighting/LightProbeNode.js +73 -0
- package/src/nodes/lighting/LightUtils.js +25 -0
- package/src/nodes/lighting/LightingContextNode.js +115 -0
- package/src/nodes/lighting/LightingNode.js +36 -0
- package/src/nodes/lighting/LightsNode.js +455 -0
- package/src/nodes/lighting/PointLightNode.js +102 -0
- package/src/nodes/lighting/PointShadowNode.js +306 -0
- package/src/nodes/lighting/ProjectorLightNode.js +91 -0
- package/src/nodes/lighting/RectAreaLightNode.js +133 -0
- package/src/nodes/lighting/ShadowBaseNode.js +81 -0
- package/src/nodes/lighting/ShadowFilterNode.js +274 -0
- package/src/nodes/lighting/ShadowNode.js +745 -0
- package/src/nodes/lighting/SpotLightNode.js +168 -0
- package/src/nodes/materialx/DISCLAIMER.md +199 -0
- package/src/nodes/materialx/MaterialXNodes.js +197 -0
- package/src/nodes/materialx/lib/mx_hsv.js +127 -0
- package/src/nodes/materialx/lib/mx_noise.js +1491 -0
- package/src/nodes/materialx/lib/mx_transform_color.js +23 -0
- package/src/nodes/math/BitcastNode.js +156 -0
- package/src/nodes/math/ConditionalNode.js +245 -0
- package/src/nodes/math/Hash.js +21 -0
- package/src/nodes/math/MathNode.js +1167 -0
- package/src/nodes/math/MathUtils.js +54 -0
- package/src/nodes/math/OperatorNode.js +751 -0
- package/src/nodes/math/TriNoise3D.js +71 -0
- package/src/nodes/parsers/GLSLNodeFunction.js +168 -0
- package/src/nodes/parsers/GLSLNodeParser.js +25 -0
- package/src/nodes/pmrem/PMREMNode.js +397 -0
- package/src/nodes/pmrem/PMREMUtils.js +288 -0
- package/src/nodes/procedural/Checker.js +22 -0
- package/src/nodes/shapes/Shapes.js +33 -0
- package/src/nodes/tsl/TSLBase.js +35 -0
- package/src/nodes/tsl/TSLCore.js +1209 -0
- package/src/nodes/utils/ArrayElementNode.js +77 -0
- package/src/nodes/utils/ConvertNode.js +100 -0
- package/src/nodes/utils/CubeMapNode.js +237 -0
- package/src/nodes/utils/DebugNode.js +83 -0
- package/src/nodes/utils/Discard.js +24 -0
- package/src/nodes/utils/EquirectUV.js +27 -0
- package/src/nodes/utils/EventNode.js +83 -0
- package/src/nodes/utils/FlipNode.js +106 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +152 -0
- package/src/nodes/utils/JoinNode.js +117 -0
- package/src/nodes/utils/LoopNode.js +354 -0
- package/src/nodes/utils/MatcapUV.js +22 -0
- package/src/nodes/utils/MaxMipLevelNode.js +103 -0
- package/src/nodes/utils/MemberNode.js +120 -0
- package/src/nodes/utils/Oscillators.js +41 -0
- package/src/nodes/utils/Packing.js +21 -0
- package/src/nodes/utils/PostProcessingUtils.js +95 -0
- package/src/nodes/utils/RTTNode.js +279 -0
- package/src/nodes/utils/ReflectorNode.js +623 -0
- package/src/nodes/utils/RemapNode.js +125 -0
- package/src/nodes/utils/RotateNode.js +103 -0
- package/src/nodes/utils/SampleNode.js +91 -0
- package/src/nodes/utils/SetNode.js +108 -0
- package/src/nodes/utils/SplitNode.js +179 -0
- package/src/nodes/utils/SpriteSheetUVNode.js +90 -0
- package/src/nodes/utils/SpriteUtils.js +63 -0
- package/src/nodes/utils/StorageArrayElementNode.js +143 -0
- package/src/nodes/utils/Timer.js +26 -0
- package/src/nodes/utils/TriplanarTextures.js +65 -0
- package/src/nodes/utils/UVUtils.js +39 -0
- package/src/nodes/utils/ViewportUtils.js +26 -0
- package/src/objects/BatchedMesh.js +1654 -0
- package/src/objects/Bone.js +41 -0
- package/src/objects/ClippingGroup.js +68 -0
- package/src/objects/Group.js +41 -0
- package/src/objects/InstancedMesh.js +395 -0
- package/src/objects/LOD.js +329 -0
- package/src/objects/Line.js +329 -0
- package/src/objects/LineLoop.js +37 -0
- package/src/objects/LineSegments.js +74 -0
- package/src/objects/Mesh.js +496 -0
- package/src/objects/Points.js +228 -0
- package/src/objects/Skeleton.js +383 -0
- package/src/objects/SkinnedMesh.js +352 -0
- package/src/objects/Sprite.js +245 -0
- package/src/renderers/WebGL3DRenderTarget.js +48 -0
- package/src/renderers/WebGLArrayRenderTarget.js +48 -0
- package/src/renderers/WebGLCubeRenderTarget.js +182 -0
- package/src/renderers/WebGLRenderTarget.js +34 -0
- package/src/renderers/WebGLRenderer.js +3508 -0
- package/src/renderers/common/Animation.js +147 -0
- package/src/renderers/common/Attributes.js +118 -0
- package/src/renderers/common/Backend.js +685 -0
- package/src/renderers/common/Background.js +212 -0
- package/src/renderers/common/BindGroup.js +61 -0
- package/src/renderers/common/Binding.js +60 -0
- package/src/renderers/common/Bindings.js +343 -0
- package/src/renderers/common/Buffer.js +87 -0
- package/src/renderers/common/BufferUtils.js +58 -0
- package/src/renderers/common/BundleGroup.js +83 -0
- package/src/renderers/common/ChainMap.js +98 -0
- package/src/renderers/common/ClippingContext.js +262 -0
- package/src/renderers/common/Color4.js +77 -0
- package/src/renderers/common/ComputePipeline.js +41 -0
- package/src/renderers/common/Constants.js +15 -0
- package/src/renderers/common/CubeRenderTarget.js +103 -0
- package/src/renderers/common/DataMap.js +90 -0
- package/src/renderers/common/Geometries.js +344 -0
- package/src/renderers/common/IndirectStorageBufferAttribute.js +38 -0
- package/src/renderers/common/Info.js +172 -0
- package/src/renderers/common/Lighting.js +73 -0
- package/src/renderers/common/Pipeline.js +35 -0
- package/src/renderers/common/Pipelines.js +465 -0
- package/src/renderers/common/PostProcessing.js +245 -0
- package/src/renderers/common/ProgrammableStage.js +78 -0
- package/src/renderers/common/QuadMesh.js +106 -0
- package/src/renderers/common/RenderBundle.js +24 -0
- package/src/renderers/common/RenderBundles.js +67 -0
- package/src/renderers/common/RenderContext.js +265 -0
- package/src/renderers/common/RenderContexts.js +116 -0
- package/src/renderers/common/RenderList.js +400 -0
- package/src/renderers/common/RenderLists.js +77 -0
- package/src/renderers/common/RenderObject.js +901 -0
- package/src/renderers/common/RenderObjects.js +202 -0
- package/src/renderers/common/RenderPipeline.js +40 -0
- package/src/renderers/common/Renderer.js +3125 -0
- package/src/renderers/common/RendererUtils.js +191 -0
- package/src/renderers/common/SampledTexture.js +144 -0
- package/src/renderers/common/Sampler.js +139 -0
- package/src/renderers/common/Storage3DTexture.js +100 -0
- package/src/renderers/common/StorageArrayTexture.js +84 -0
- package/src/renderers/common/StorageBuffer.js +41 -0
- package/src/renderers/common/StorageBufferAttribute.js +46 -0
- package/src/renderers/common/StorageInstancedBufferAttribute.js +46 -0
- package/src/renderers/common/StorageTexture.js +78 -0
- package/src/renderers/common/Textures.js +491 -0
- package/src/renderers/common/TimestampQueryPool.js +99 -0
- package/src/renderers/common/Uniform.js +367 -0
- package/src/renderers/common/UniformBuffer.js +34 -0
- package/src/renderers/common/UniformsGroup.js +487 -0
- package/src/renderers/common/XRManager.js +1676 -0
- package/src/renderers/common/XRRenderTarget.js +91 -0
- package/src/renderers/common/extras/PMREMGenerator.js +946 -0
- package/src/renderers/common/nodes/NodeBuilderState.js +152 -0
- package/src/renderers/common/nodes/NodeLibrary.js +196 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +140 -0
- package/src/renderers/common/nodes/NodeSampler.js +50 -0
- package/src/renderers/common/nodes/NodeStorageBuffer.js +61 -0
- package/src/renderers/common/nodes/NodeUniform.js +418 -0
- package/src/renderers/common/nodes/NodeUniformBuffer.js +53 -0
- package/src/renderers/common/nodes/NodeUniformsGroup.js +51 -0
- package/src/renderers/common/nodes/Nodes.js +819 -0
- package/src/renderers/shaders/ShaderChunk/alphahash_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/alphahash_pars_fragment.glsl.js +68 -0
- package/src/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js +16 -0
- package/src/renderers/shaders/ShaderChunk/alphatest_pars_fragment.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +26 -0
- package/src/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +49 -0
- package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js +33 -0
- package/src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +43 -0
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js +10 -0
- package/src/renderers/shaders/ShaderChunk/clearcoat_pars_fragment.glsl.js +21 -0
- package/src/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js +78 -0
- package/src/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +11 -0
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +11 -0
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +11 -0
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +31 -0
- package/src/renderers/shaders/ShaderChunk/colorspace_fragment.glsl.js +3 -0
- package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +15 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +137 -0
- package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +186 -0
- package/src/renderers/shaders/ShaderChunk/default_fragment.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/default_vertex.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +63 -0
- package/src/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js +20 -0
- package/src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +17 -0
- package/src/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +15 -0
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +62 -0
- package/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js +21 -0
- package/src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js +22 -0
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +69 -0
- package/src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +37 -0
- package/src/renderers/shaders/ShaderChunk/fog_fragment.glsl.js +17 -0
- package/src/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js +19 -0
- package/src/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/fog_vertex.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +27 -0
- package/src/renderers/shaders/ShaderChunk/iridescence_fragment.glsl.js +120 -0
- package/src/renderers/shaders/ShaderChunk/iridescence_pars_fragment.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +209 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +13 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +40 -0
- package/src/renderers/shaders/ShaderChunk/lights_lambert_fragment.glsl.js +5 -0
- package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +28 -0
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +254 -0
- package/src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +32 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +157 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +563 -0
- package/src/renderers/shaders/ShaderChunk/lights_toon_fragment.glsl.js +4 -0
- package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +26 -0
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +17 -0
- package/src/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js +27 -0
- package/src/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js +27 -0
- package/src/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js +12 -0
- package/src/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +24 -0
- package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +16 -0
- package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +26 -0
- package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +16 -0
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +76 -0
- package/src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +33 -0
- package/src/renderers/shaders/ShaderChunk/normal_pars_fragment.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/normal_pars_vertex.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/normal_vertex.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +43 -0
- package/src/renderers/shaders/ShaderChunk/opaque_fragment.glsl.js +11 -0
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +100 -0
- package/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +8 -0
- package/src/renderers/shaders/ShaderChunk/project_vertex.glsl.js +19 -0
- package/src/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js +12 -0
- package/src/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +337 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +71 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +68 -0
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +66 -0
- package/src/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js +10 -0
- package/src/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js +25 -0
- package/src/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js +15 -0
- package/src/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js +20 -0
- package/src/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js +14 -0
- package/src/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js +7 -0
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +200 -0
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +36 -0
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +235 -0
- package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +119 -0
- package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +145 -0
- package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +122 -0
- package/src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js +21 -0
- package/src/renderers/shaders/ShaderChunk.js +270 -0
- package/src/renderers/shaders/ShaderLib/background.glsl.js +40 -0
- package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +63 -0
- package/src/renderers/shaders/ShaderLib/cube.glsl.js +36 -0
- package/src/renderers/shaders/ShaderLib/depth.glsl.js +114 -0
- package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +78 -0
- package/src/renderers/shaders/ShaderLib/equirect.glsl.js +35 -0
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +76 -0
- package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +116 -0
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +125 -0
- package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +112 -0
- package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +87 -0
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +127 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +229 -0
- package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +119 -0
- package/src/renderers/shaders/ShaderLib/points.glsl.js +87 -0
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +58 -0
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +79 -0
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +53 -0
- package/src/renderers/shaders/ShaderLib.js +361 -0
- package/src/renderers/shaders/UniformsLib.js +235 -0
- package/src/renderers/shaders/UniformsUtils.js +112 -0
- package/src/renderers/webgl/WebGLAnimation.js +53 -0
- package/src/renderers/webgl/WebGLAttributes.js +237 -0
- package/src/renderers/webgl/WebGLBackground.js +303 -0
- package/src/renderers/webgl/WebGLBindingStates.js +594 -0
- package/src/renderers/webgl/WebGLBufferRenderer.js +89 -0
- package/src/renderers/webgl/WebGLCapabilities.js +145 -0
- package/src/renderers/webgl/WebGLClipping.js +171 -0
- package/src/renderers/webgl/WebGLCubeMaps.js +99 -0
- package/src/renderers/webgl/WebGLCubeUVMaps.js +134 -0
- package/src/renderers/webgl/WebGLExtensions.js +84 -0
- package/src/renderers/webgl/WebGLGeometries.js +183 -0
- package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +100 -0
- package/src/renderers/webgl/WebGLInfo.js +73 -0
- package/src/renderers/webgl/WebGLLights.js +571 -0
- package/src/renderers/webgl/WebGLMaterials.js +591 -0
- package/src/renderers/webgl/WebGLMorphtargets.js +168 -0
- package/src/renderers/webgl/WebGLObjects.js +92 -0
- package/src/renderers/webgl/WebGLProgram.js +1091 -0
- package/src/renderers/webgl/WebGLPrograms.js +667 -0
- package/src/renderers/webgl/WebGLProperties.js +55 -0
- package/src/renderers/webgl/WebGLRenderLists.js +238 -0
- package/src/renderers/webgl/WebGLRenderStates.js +116 -0
- package/src/renderers/webgl/WebGLShader.js +12 -0
- package/src/renderers/webgl/WebGLShaderCache.js +124 -0
- package/src/renderers/webgl/WebGLShadowMap.js +436 -0
- package/src/renderers/webgl/WebGLState.js +1332 -0
- package/src/renderers/webgl/WebGLTextures.js +2342 -0
- package/src/renderers/webgl/WebGLUniforms.js +1166 -0
- package/src/renderers/webgl/WebGLUniformsGroups.js +394 -0
- package/src/renderers/webgl/WebGLUtils.js +213 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +2633 -0
- package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +140 -0
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +1517 -0
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +325 -0
- package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +64 -0
- package/src/renderers/webgl-fallback/utils/WebGLConstants.js +14 -0
- package/src/renderers/webgl-fallback/utils/WebGLExtensions.js +83 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +1144 -0
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +1304 -0
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +366 -0
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +313 -0
- package/src/renderers/webgpu/WebGPUBackend.js +2456 -0
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +69 -0
- package/src/renderers/webgpu/WebGPURenderer.js +106 -0
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +66 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +100 -0
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +2248 -0
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +187 -0
- package/src/renderers/webgpu/nodes/WGSLNodeParser.js +25 -0
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +449 -0
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +484 -0
- package/src/renderers/webgpu/utils/WebGPUConstants.js +339 -0
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +781 -0
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +439 -0
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +1505 -0
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +287 -0
- package/src/renderers/webgpu/utils/WebGPUUtils.js +227 -0
- package/src/renderers/webxr/WebXRController.js +428 -0
- package/src/renderers/webxr/WebXRDepthSensing.js +155 -0
- package/src/renderers/webxr/WebXRManager.js +1103 -0
- package/src/scenes/Fog.js +98 -0
- package/src/scenes/FogExp2.js +86 -0
- package/src/scenes/Scene.js +165 -0
- package/src/textures/CanvasTexture.js +45 -0
- package/src/textures/CompressedArrayTexture.js +89 -0
- package/src/textures/CompressedCubeTexture.js +48 -0
- package/src/textures/CompressedTexture.js +86 -0
- package/src/textures/CubeTexture.js +81 -0
- package/src/textures/Data3DTexture.js +112 -0
- package/src/textures/DataArrayTexture.js +134 -0
- package/src/textures/DataTexture.js +87 -0
- package/src/textures/DepthTexture.js +104 -0
- package/src/textures/ExternalTexture.js +56 -0
- package/src/textures/FramebufferTexture.js +85 -0
- package/src/textures/Source.js +230 -0
- package/src/textures/Texture.js +801 -0
- package/src/textures/VideoFrameTexture.js +72 -0
- package/src/textures/VideoTexture.js +125 -0
- package/src/utils.js +216 -0
package/src/math/Box3.js
ADDED
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents an axis-aligned bounding box (AABB) in 3D space.
|
|
5
|
+
*/
|
|
6
|
+
class Box3 {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a new bounding box.
|
|
10
|
+
*
|
|
11
|
+
* @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box.
|
|
12
|
+
* @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box.
|
|
13
|
+
*/
|
|
14
|
+
constructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This flag can be used for type testing.
|
|
18
|
+
*
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
* @readonly
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
this.isBox3 = true;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The lower boundary of the box.
|
|
27
|
+
*
|
|
28
|
+
* @type {Vector3}
|
|
29
|
+
*/
|
|
30
|
+
this.min = min;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The upper boundary of the box.
|
|
34
|
+
*
|
|
35
|
+
* @type {Vector3}
|
|
36
|
+
*/
|
|
37
|
+
this.max = max;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Sets the lower and upper boundaries of this box.
|
|
43
|
+
* Please note that this method only copies the values from the given objects.
|
|
44
|
+
*
|
|
45
|
+
* @param {Vector3} min - The lower boundary of the box.
|
|
46
|
+
* @param {Vector3} max - The upper boundary of the box.
|
|
47
|
+
* @return {Box3} A reference to this bounding box.
|
|
48
|
+
*/
|
|
49
|
+
set( min, max ) {
|
|
50
|
+
|
|
51
|
+
this.min.copy( min );
|
|
52
|
+
this.max.copy( max );
|
|
53
|
+
|
|
54
|
+
return this;
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Sets the upper and lower bounds of this box so it encloses the position data
|
|
60
|
+
* in the given array.
|
|
61
|
+
*
|
|
62
|
+
* @param {Array<number>} array - An array holding 3D position data.
|
|
63
|
+
* @return {Box3} A reference to this bounding box.
|
|
64
|
+
*/
|
|
65
|
+
setFromArray( array ) {
|
|
66
|
+
|
|
67
|
+
this.makeEmpty();
|
|
68
|
+
|
|
69
|
+
for ( let i = 0, il = array.length; i < il; i += 3 ) {
|
|
70
|
+
|
|
71
|
+
this.expandByPoint( _vector.fromArray( array, i ) );
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return this;
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Sets the upper and lower bounds of this box so it encloses the position data
|
|
81
|
+
* in the given buffer attribute.
|
|
82
|
+
*
|
|
83
|
+
* @param {BufferAttribute} attribute - A buffer attribute holding 3D position data.
|
|
84
|
+
* @return {Box3} A reference to this bounding box.
|
|
85
|
+
*/
|
|
86
|
+
setFromBufferAttribute( attribute ) {
|
|
87
|
+
|
|
88
|
+
this.makeEmpty();
|
|
89
|
+
|
|
90
|
+
for ( let i = 0, il = attribute.count; i < il; i ++ ) {
|
|
91
|
+
|
|
92
|
+
this.expandByPoint( _vector.fromBufferAttribute( attribute, i ) );
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return this;
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Sets the upper and lower bounds of this box so it encloses the position data
|
|
102
|
+
* in the given array.
|
|
103
|
+
*
|
|
104
|
+
* @param {Array<Vector3>} points - An array holding 3D position data as instances of {@link Vector3}.
|
|
105
|
+
* @return {Box3} A reference to this bounding box.
|
|
106
|
+
*/
|
|
107
|
+
setFromPoints( points ) {
|
|
108
|
+
|
|
109
|
+
this.makeEmpty();
|
|
110
|
+
|
|
111
|
+
for ( let i = 0, il = points.length; i < il; i ++ ) {
|
|
112
|
+
|
|
113
|
+
this.expandByPoint( points[ i ] );
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return this;
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Centers this box on the given center vector and sets this box's width, height and
|
|
123
|
+
* depth to the given size values.
|
|
124
|
+
*
|
|
125
|
+
* @param {Vector3} center - The center of the box.
|
|
126
|
+
* @param {Vector3} size - The x, y and z dimensions of the box.
|
|
127
|
+
* @return {Box3} A reference to this bounding box.
|
|
128
|
+
*/
|
|
129
|
+
setFromCenterAndSize( center, size ) {
|
|
130
|
+
|
|
131
|
+
const halfSize = _vector.copy( size ).multiplyScalar( 0.5 );
|
|
132
|
+
|
|
133
|
+
this.min.copy( center ).sub( halfSize );
|
|
134
|
+
this.max.copy( center ).add( halfSize );
|
|
135
|
+
|
|
136
|
+
return this;
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Computes the world-axis-aligned bounding box for the given 3D object
|
|
142
|
+
* (including its children), accounting for the object's, and children's,
|
|
143
|
+
* world transforms. The function may result in a larger box than strictly necessary.
|
|
144
|
+
*
|
|
145
|
+
* @param {Object3D} object - The 3D object to compute the bounding box for.
|
|
146
|
+
* @param {boolean} [precise=false] - If set to `true`, the method computes the smallest
|
|
147
|
+
* world-axis-aligned bounding box at the expense of more computation.
|
|
148
|
+
* @return {Box3} A reference to this bounding box.
|
|
149
|
+
*/
|
|
150
|
+
setFromObject( object, precise = false ) {
|
|
151
|
+
|
|
152
|
+
this.makeEmpty();
|
|
153
|
+
|
|
154
|
+
return this.expandByObject( object, precise );
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns a new box with copied values from this instance.
|
|
160
|
+
*
|
|
161
|
+
* @return {Box3} A clone of this instance.
|
|
162
|
+
*/
|
|
163
|
+
clone() {
|
|
164
|
+
|
|
165
|
+
return new this.constructor().copy( this );
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Copies the values of the given box to this instance.
|
|
171
|
+
*
|
|
172
|
+
* @param {Box3} box - The box to copy.
|
|
173
|
+
* @return {Box3} A reference to this bounding box.
|
|
174
|
+
*/
|
|
175
|
+
copy( box ) {
|
|
176
|
+
|
|
177
|
+
this.min.copy( box.min );
|
|
178
|
+
this.max.copy( box.max );
|
|
179
|
+
|
|
180
|
+
return this;
|
|
181
|
+
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Makes this box empty which means in encloses a zero space in 3D.
|
|
186
|
+
*
|
|
187
|
+
* @return {Box3} A reference to this bounding box.
|
|
188
|
+
*/
|
|
189
|
+
makeEmpty() {
|
|
190
|
+
|
|
191
|
+
this.min.x = this.min.y = this.min.z = + Infinity;
|
|
192
|
+
this.max.x = this.max.y = this.max.z = - Infinity;
|
|
193
|
+
|
|
194
|
+
return this;
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns true if this box includes zero points within its bounds.
|
|
200
|
+
* Note that a box with equal lower and upper bounds still includes one
|
|
201
|
+
* point, the one both bounds share.
|
|
202
|
+
*
|
|
203
|
+
* @return {boolean} Whether this box is empty or not.
|
|
204
|
+
*/
|
|
205
|
+
isEmpty() {
|
|
206
|
+
|
|
207
|
+
// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes
|
|
208
|
+
|
|
209
|
+
return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Returns the center point of this box.
|
|
215
|
+
*
|
|
216
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
217
|
+
* @return {Vector3} The center point.
|
|
218
|
+
*/
|
|
219
|
+
getCenter( target ) {
|
|
220
|
+
|
|
221
|
+
return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Returns the dimensions of this box.
|
|
227
|
+
*
|
|
228
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
229
|
+
* @return {Vector3} The size.
|
|
230
|
+
*/
|
|
231
|
+
getSize( target ) {
|
|
232
|
+
|
|
233
|
+
return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Expands the boundaries of this box to include the given point.
|
|
239
|
+
*
|
|
240
|
+
* @param {Vector3} point - The point that should be included by the bounding box.
|
|
241
|
+
* @return {Box3} A reference to this bounding box.
|
|
242
|
+
*/
|
|
243
|
+
expandByPoint( point ) {
|
|
244
|
+
|
|
245
|
+
this.min.min( point );
|
|
246
|
+
this.max.max( point );
|
|
247
|
+
|
|
248
|
+
return this;
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Expands this box equilaterally by the given vector. The width of this
|
|
254
|
+
* box will be expanded by the x component of the vector in both
|
|
255
|
+
* directions. The height of this box will be expanded by the y component of
|
|
256
|
+
* the vector in both directions. The depth of this box will be
|
|
257
|
+
* expanded by the z component of the vector in both directions.
|
|
258
|
+
*
|
|
259
|
+
* @param {Vector3} vector - The vector that should expand the bounding box.
|
|
260
|
+
* @return {Box3} A reference to this bounding box.
|
|
261
|
+
*/
|
|
262
|
+
expandByVector( vector ) {
|
|
263
|
+
|
|
264
|
+
this.min.sub( vector );
|
|
265
|
+
this.max.add( vector );
|
|
266
|
+
|
|
267
|
+
return this;
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Expands each dimension of the box by the given scalar. If negative, the
|
|
273
|
+
* dimensions of the box will be contracted.
|
|
274
|
+
*
|
|
275
|
+
* @param {number} scalar - The scalar value that should expand the bounding box.
|
|
276
|
+
* @return {Box3} A reference to this bounding box.
|
|
277
|
+
*/
|
|
278
|
+
expandByScalar( scalar ) {
|
|
279
|
+
|
|
280
|
+
this.min.addScalar( - scalar );
|
|
281
|
+
this.max.addScalar( scalar );
|
|
282
|
+
|
|
283
|
+
return this;
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Expands the boundaries of this box to include the given 3D object and
|
|
289
|
+
* its children, accounting for the object's, and children's, world
|
|
290
|
+
* transforms. The function may result in a larger box than strictly
|
|
291
|
+
* necessary (unless the precise parameter is set to true).
|
|
292
|
+
*
|
|
293
|
+
* @param {Object3D} object - The 3D object that should expand the bounding box.
|
|
294
|
+
* @param {boolean} precise - If set to `true`, the method expands the bounding box
|
|
295
|
+
* as little as necessary at the expense of more computation.
|
|
296
|
+
* @return {Box3} A reference to this bounding box.
|
|
297
|
+
*/
|
|
298
|
+
expandByObject( object, precise = false ) {
|
|
299
|
+
|
|
300
|
+
// Computes the world-axis-aligned bounding box of an object (including its children),
|
|
301
|
+
// accounting for both the object's, and children's, world transforms
|
|
302
|
+
|
|
303
|
+
object.updateWorldMatrix( false, false );
|
|
304
|
+
|
|
305
|
+
const geometry = object.geometry;
|
|
306
|
+
|
|
307
|
+
if ( geometry !== undefined ) {
|
|
308
|
+
|
|
309
|
+
const positionAttribute = geometry.getAttribute( 'position' );
|
|
310
|
+
|
|
311
|
+
// precise AABB computation based on vertex data requires at least a position attribute.
|
|
312
|
+
// instancing isn't supported so far and uses the normal (conservative) code path.
|
|
313
|
+
|
|
314
|
+
if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {
|
|
315
|
+
|
|
316
|
+
for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
|
|
317
|
+
|
|
318
|
+
if ( object.isMesh === true ) {
|
|
319
|
+
|
|
320
|
+
object.getVertexPosition( i, _vector );
|
|
321
|
+
|
|
322
|
+
} else {
|
|
323
|
+
|
|
324
|
+
_vector.fromBufferAttribute( positionAttribute, i );
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
_vector.applyMatrix4( object.matrixWorld );
|
|
329
|
+
this.expandByPoint( _vector );
|
|
330
|
+
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
} else {
|
|
334
|
+
|
|
335
|
+
if ( object.boundingBox !== undefined ) {
|
|
336
|
+
|
|
337
|
+
// object-level bounding box
|
|
338
|
+
|
|
339
|
+
if ( object.boundingBox === null ) {
|
|
340
|
+
|
|
341
|
+
object.computeBoundingBox();
|
|
342
|
+
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
_box.copy( object.boundingBox );
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
} else {
|
|
349
|
+
|
|
350
|
+
// geometry-level bounding box
|
|
351
|
+
|
|
352
|
+
if ( geometry.boundingBox === null ) {
|
|
353
|
+
|
|
354
|
+
geometry.computeBoundingBox();
|
|
355
|
+
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
_box.copy( geometry.boundingBox );
|
|
359
|
+
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
_box.applyMatrix4( object.matrixWorld );
|
|
363
|
+
|
|
364
|
+
this.union( _box );
|
|
365
|
+
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const children = object.children;
|
|
371
|
+
|
|
372
|
+
for ( let i = 0, l = children.length; i < l; i ++ ) {
|
|
373
|
+
|
|
374
|
+
this.expandByObject( children[ i ], precise );
|
|
375
|
+
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return this;
|
|
379
|
+
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Returns `true` if the given point lies within or on the boundaries of this box.
|
|
384
|
+
*
|
|
385
|
+
* @param {Vector3} point - The point to test.
|
|
386
|
+
* @return {boolean} Whether the bounding box contains the given point or not.
|
|
387
|
+
*/
|
|
388
|
+
containsPoint( point ) {
|
|
389
|
+
|
|
390
|
+
return point.x >= this.min.x && point.x <= this.max.x &&
|
|
391
|
+
point.y >= this.min.y && point.y <= this.max.y &&
|
|
392
|
+
point.z >= this.min.z && point.z <= this.max.z;
|
|
393
|
+
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Returns `true` if this bounding box includes the entirety of the given bounding box.
|
|
398
|
+
* If this box and the given one are identical, this function also returns `true`.
|
|
399
|
+
*
|
|
400
|
+
* @param {Box3} box - The bounding box to test.
|
|
401
|
+
* @return {boolean} Whether the bounding box contains the given bounding box or not.
|
|
402
|
+
*/
|
|
403
|
+
containsBox( box ) {
|
|
404
|
+
|
|
405
|
+
return this.min.x <= box.min.x && box.max.x <= this.max.x &&
|
|
406
|
+
this.min.y <= box.min.y && box.max.y <= this.max.y &&
|
|
407
|
+
this.min.z <= box.min.z && box.max.z <= this.max.z;
|
|
408
|
+
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Returns a point as a proportion of this box's width, height and depth.
|
|
413
|
+
*
|
|
414
|
+
* @param {Vector3} point - A point in 3D space.
|
|
415
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
416
|
+
* @return {Vector3} A point as a proportion of this box's width, height and depth.
|
|
417
|
+
*/
|
|
418
|
+
getParameter( point, target ) {
|
|
419
|
+
|
|
420
|
+
// This can potentially have a divide by zero if the box
|
|
421
|
+
// has a size dimension of 0.
|
|
422
|
+
|
|
423
|
+
return target.set(
|
|
424
|
+
( point.x - this.min.x ) / ( this.max.x - this.min.x ),
|
|
425
|
+
( point.y - this.min.y ) / ( this.max.y - this.min.y ),
|
|
426
|
+
( point.z - this.min.z ) / ( this.max.z - this.min.z )
|
|
427
|
+
);
|
|
428
|
+
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Returns `true` if the given bounding box intersects with this bounding box.
|
|
433
|
+
*
|
|
434
|
+
* @param {Box3} box - The bounding box to test.
|
|
435
|
+
* @return {boolean} Whether the given bounding box intersects with this bounding box.
|
|
436
|
+
*/
|
|
437
|
+
intersectsBox( box ) {
|
|
438
|
+
|
|
439
|
+
// using 6 splitting planes to rule out intersections.
|
|
440
|
+
return box.max.x >= this.min.x && box.min.x <= this.max.x &&
|
|
441
|
+
box.max.y >= this.min.y && box.min.y <= this.max.y &&
|
|
442
|
+
box.max.z >= this.min.z && box.min.z <= this.max.z;
|
|
443
|
+
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Returns `true` if the given bounding sphere intersects with this bounding box.
|
|
448
|
+
*
|
|
449
|
+
* @param {Sphere} sphere - The bounding sphere to test.
|
|
450
|
+
* @return {boolean} Whether the given bounding sphere intersects with this bounding box.
|
|
451
|
+
*/
|
|
452
|
+
intersectsSphere( sphere ) {
|
|
453
|
+
|
|
454
|
+
// Find the point on the AABB closest to the sphere center.
|
|
455
|
+
this.clampPoint( sphere.center, _vector );
|
|
456
|
+
|
|
457
|
+
// If that point is inside the sphere, the AABB and sphere intersect.
|
|
458
|
+
return _vector.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );
|
|
459
|
+
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Returns `true` if the given plane intersects with this bounding box.
|
|
464
|
+
*
|
|
465
|
+
* @param {Plane} plane - The plane to test.
|
|
466
|
+
* @return {boolean} Whether the given plane intersects with this bounding box.
|
|
467
|
+
*/
|
|
468
|
+
intersectsPlane( plane ) {
|
|
469
|
+
|
|
470
|
+
// We compute the minimum and maximum dot product values. If those values
|
|
471
|
+
// are on the same side (back or front) of the plane, then there is no intersection.
|
|
472
|
+
|
|
473
|
+
let min, max;
|
|
474
|
+
|
|
475
|
+
if ( plane.normal.x > 0 ) {
|
|
476
|
+
|
|
477
|
+
min = plane.normal.x * this.min.x;
|
|
478
|
+
max = plane.normal.x * this.max.x;
|
|
479
|
+
|
|
480
|
+
} else {
|
|
481
|
+
|
|
482
|
+
min = plane.normal.x * this.max.x;
|
|
483
|
+
max = plane.normal.x * this.min.x;
|
|
484
|
+
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if ( plane.normal.y > 0 ) {
|
|
488
|
+
|
|
489
|
+
min += plane.normal.y * this.min.y;
|
|
490
|
+
max += plane.normal.y * this.max.y;
|
|
491
|
+
|
|
492
|
+
} else {
|
|
493
|
+
|
|
494
|
+
min += plane.normal.y * this.max.y;
|
|
495
|
+
max += plane.normal.y * this.min.y;
|
|
496
|
+
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if ( plane.normal.z > 0 ) {
|
|
500
|
+
|
|
501
|
+
min += plane.normal.z * this.min.z;
|
|
502
|
+
max += plane.normal.z * this.max.z;
|
|
503
|
+
|
|
504
|
+
} else {
|
|
505
|
+
|
|
506
|
+
min += plane.normal.z * this.max.z;
|
|
507
|
+
max += plane.normal.z * this.min.z;
|
|
508
|
+
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return ( min <= - plane.constant && max >= - plane.constant );
|
|
512
|
+
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Returns `true` if the given triangle intersects with this bounding box.
|
|
517
|
+
*
|
|
518
|
+
* @param {Triangle} triangle - The triangle to test.
|
|
519
|
+
* @return {boolean} Whether the given triangle intersects with this bounding box.
|
|
520
|
+
*/
|
|
521
|
+
intersectsTriangle( triangle ) {
|
|
522
|
+
|
|
523
|
+
if ( this.isEmpty() ) {
|
|
524
|
+
|
|
525
|
+
return false;
|
|
526
|
+
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// compute box center and extents
|
|
530
|
+
this.getCenter( _center );
|
|
531
|
+
_extents.subVectors( this.max, _center );
|
|
532
|
+
|
|
533
|
+
// translate triangle to aabb origin
|
|
534
|
+
_v0.subVectors( triangle.a, _center );
|
|
535
|
+
_v1.subVectors( triangle.b, _center );
|
|
536
|
+
_v2.subVectors( triangle.c, _center );
|
|
537
|
+
|
|
538
|
+
// compute edge vectors for triangle
|
|
539
|
+
_f0.subVectors( _v1, _v0 );
|
|
540
|
+
_f1.subVectors( _v2, _v1 );
|
|
541
|
+
_f2.subVectors( _v0, _v2 );
|
|
542
|
+
|
|
543
|
+
// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb
|
|
544
|
+
// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation
|
|
545
|
+
// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)
|
|
546
|
+
let axes = [
|
|
547
|
+
0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,
|
|
548
|
+
_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,
|
|
549
|
+
- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0
|
|
550
|
+
];
|
|
551
|
+
if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) {
|
|
552
|
+
|
|
553
|
+
return false;
|
|
554
|
+
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// test 3 face normals from the aabb
|
|
558
|
+
axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];
|
|
559
|
+
if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) {
|
|
560
|
+
|
|
561
|
+
return false;
|
|
562
|
+
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// finally testing the face normal of the triangle
|
|
566
|
+
// use already existing triangle edge vectors here
|
|
567
|
+
_triangleNormal.crossVectors( _f0, _f1 );
|
|
568
|
+
axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];
|
|
569
|
+
|
|
570
|
+
return satForAxes( axes, _v0, _v1, _v2, _extents );
|
|
571
|
+
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Clamps the given point within the bounds of this box.
|
|
576
|
+
*
|
|
577
|
+
* @param {Vector3} point - The point to clamp.
|
|
578
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
579
|
+
* @return {Vector3} The clamped point.
|
|
580
|
+
*/
|
|
581
|
+
clampPoint( point, target ) {
|
|
582
|
+
|
|
583
|
+
return target.copy( point ).clamp( this.min, this.max );
|
|
584
|
+
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Returns the euclidean distance from any edge of this box to the specified point. If
|
|
589
|
+
* the given point lies inside of this box, the distance will be `0`.
|
|
590
|
+
*
|
|
591
|
+
* @param {Vector3} point - The point to compute the distance to.
|
|
592
|
+
* @return {number} The euclidean distance.
|
|
593
|
+
*/
|
|
594
|
+
distanceToPoint( point ) {
|
|
595
|
+
|
|
596
|
+
return this.clampPoint( point, _vector ).distanceTo( point );
|
|
597
|
+
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Returns a bounding sphere that encloses this bounding box.
|
|
602
|
+
*
|
|
603
|
+
* @param {Sphere} target - The target sphere that is used to store the method's result.
|
|
604
|
+
* @return {Sphere} The bounding sphere that encloses this bounding box.
|
|
605
|
+
*/
|
|
606
|
+
getBoundingSphere( target ) {
|
|
607
|
+
|
|
608
|
+
if ( this.isEmpty() ) {
|
|
609
|
+
|
|
610
|
+
target.makeEmpty();
|
|
611
|
+
|
|
612
|
+
} else {
|
|
613
|
+
|
|
614
|
+
this.getCenter( target.center );
|
|
615
|
+
|
|
616
|
+
target.radius = this.getSize( _vector ).length() * 0.5;
|
|
617
|
+
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
return target;
|
|
621
|
+
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Computes the intersection of this bounding box and the given one, setting the upper
|
|
626
|
+
* bound of this box to the lesser of the two boxes' upper bounds and the
|
|
627
|
+
* lower bound of this box to the greater of the two boxes' lower bounds. If
|
|
628
|
+
* there's no overlap, makes this box empty.
|
|
629
|
+
*
|
|
630
|
+
* @param {Box3} box - The bounding box to intersect with.
|
|
631
|
+
* @return {Box3} A reference to this bounding box.
|
|
632
|
+
*/
|
|
633
|
+
intersect( box ) {
|
|
634
|
+
|
|
635
|
+
this.min.max( box.min );
|
|
636
|
+
this.max.min( box.max );
|
|
637
|
+
|
|
638
|
+
// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.
|
|
639
|
+
if ( this.isEmpty() ) this.makeEmpty();
|
|
640
|
+
|
|
641
|
+
return this;
|
|
642
|
+
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Computes the union of this box and another and the given one, setting the upper
|
|
647
|
+
* bound of this box to the greater of the two boxes' upper bounds and the
|
|
648
|
+
* lower bound of this box to the lesser of the two boxes' lower bounds.
|
|
649
|
+
*
|
|
650
|
+
* @param {Box3} box - The bounding box that will be unioned with this instance.
|
|
651
|
+
* @return {Box3} A reference to this bounding box.
|
|
652
|
+
*/
|
|
653
|
+
union( box ) {
|
|
654
|
+
|
|
655
|
+
this.min.min( box.min );
|
|
656
|
+
this.max.max( box.max );
|
|
657
|
+
|
|
658
|
+
return this;
|
|
659
|
+
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Transforms this bounding box by the given 4x4 transformation matrix.
|
|
664
|
+
*
|
|
665
|
+
* @param {Matrix4} matrix - The transformation matrix.
|
|
666
|
+
* @return {Box3} A reference to this bounding box.
|
|
667
|
+
*/
|
|
668
|
+
applyMatrix4( matrix ) {
|
|
669
|
+
|
|
670
|
+
// transform of empty box is an empty box.
|
|
671
|
+
if ( this.isEmpty() ) return this;
|
|
672
|
+
|
|
673
|
+
// NOTE: I am using a binary pattern to specify all 2^3 combinations below
|
|
674
|
+
_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000
|
|
675
|
+
_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001
|
|
676
|
+
_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010
|
|
677
|
+
_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011
|
|
678
|
+
_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100
|
|
679
|
+
_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101
|
|
680
|
+
_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110
|
|
681
|
+
_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111
|
|
682
|
+
|
|
683
|
+
this.setFromPoints( _points );
|
|
684
|
+
|
|
685
|
+
return this;
|
|
686
|
+
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Adds the given offset to both the upper and lower bounds of this bounding box,
|
|
691
|
+
* effectively moving it in 3D space.
|
|
692
|
+
*
|
|
693
|
+
* @param {Vector3} offset - The offset that should be used to translate the bounding box.
|
|
694
|
+
* @return {Box3} A reference to this bounding box.
|
|
695
|
+
*/
|
|
696
|
+
translate( offset ) {
|
|
697
|
+
|
|
698
|
+
this.min.add( offset );
|
|
699
|
+
this.max.add( offset );
|
|
700
|
+
|
|
701
|
+
return this;
|
|
702
|
+
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Returns `true` if this bounding box is equal with the given one.
|
|
707
|
+
*
|
|
708
|
+
* @param {Box3} box - The box to test for equality.
|
|
709
|
+
* @return {boolean} Whether this bounding box is equal with the given one.
|
|
710
|
+
*/
|
|
711
|
+
equals( box ) {
|
|
712
|
+
|
|
713
|
+
return box.min.equals( this.min ) && box.max.equals( this.max );
|
|
714
|
+
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* Returns a serialized structure of the bounding box.
|
|
719
|
+
*
|
|
720
|
+
* @return {Object} Serialized structure with fields representing the object state.
|
|
721
|
+
*/
|
|
722
|
+
toJSON() {
|
|
723
|
+
|
|
724
|
+
return {
|
|
725
|
+
min: this.min.toArray(),
|
|
726
|
+
max: this.max.toArray()
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Returns a serialized structure of the bounding box.
|
|
733
|
+
*
|
|
734
|
+
* @param {Object} json - The serialized json to set the box from.
|
|
735
|
+
* @return {Box3} A reference to this bounding box.
|
|
736
|
+
*/
|
|
737
|
+
fromJSON( json ) {
|
|
738
|
+
|
|
739
|
+
this.min.fromArray( json.min );
|
|
740
|
+
this.max.fromArray( json.max );
|
|
741
|
+
return this;
|
|
742
|
+
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const _points = [
|
|
748
|
+
/*@__PURE__*/ new Vector3(),
|
|
749
|
+
/*@__PURE__*/ new Vector3(),
|
|
750
|
+
/*@__PURE__*/ new Vector3(),
|
|
751
|
+
/*@__PURE__*/ new Vector3(),
|
|
752
|
+
/*@__PURE__*/ new Vector3(),
|
|
753
|
+
/*@__PURE__*/ new Vector3(),
|
|
754
|
+
/*@__PURE__*/ new Vector3(),
|
|
755
|
+
/*@__PURE__*/ new Vector3()
|
|
756
|
+
];
|
|
757
|
+
|
|
758
|
+
const _vector = /*@__PURE__*/ new Vector3();
|
|
759
|
+
|
|
760
|
+
const _box = /*@__PURE__*/ new Box3();
|
|
761
|
+
|
|
762
|
+
// triangle centered vertices
|
|
763
|
+
|
|
764
|
+
const _v0 = /*@__PURE__*/ new Vector3();
|
|
765
|
+
const _v1 = /*@__PURE__*/ new Vector3();
|
|
766
|
+
const _v2 = /*@__PURE__*/ new Vector3();
|
|
767
|
+
|
|
768
|
+
// triangle edge vectors
|
|
769
|
+
|
|
770
|
+
const _f0 = /*@__PURE__*/ new Vector3();
|
|
771
|
+
const _f1 = /*@__PURE__*/ new Vector3();
|
|
772
|
+
const _f2 = /*@__PURE__*/ new Vector3();
|
|
773
|
+
|
|
774
|
+
const _center = /*@__PURE__*/ new Vector3();
|
|
775
|
+
const _extents = /*@__PURE__*/ new Vector3();
|
|
776
|
+
const _triangleNormal = /*@__PURE__*/ new Vector3();
|
|
777
|
+
const _testAxis = /*@__PURE__*/ new Vector3();
|
|
778
|
+
|
|
779
|
+
function satForAxes( axes, v0, v1, v2, extents ) {
|
|
780
|
+
|
|
781
|
+
for ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) {
|
|
782
|
+
|
|
783
|
+
_testAxis.fromArray( axes, i );
|
|
784
|
+
// project the aabb onto the separating axis
|
|
785
|
+
const r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );
|
|
786
|
+
// project all 3 vertices of the triangle onto the separating axis
|
|
787
|
+
const p0 = v0.dot( _testAxis );
|
|
788
|
+
const p1 = v1.dot( _testAxis );
|
|
789
|
+
const p2 = v2.dot( _testAxis );
|
|
790
|
+
// actual test, basically see if either of the most extreme of the triangle points intersects r
|
|
791
|
+
if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) {
|
|
792
|
+
|
|
793
|
+
// points of the projected triangle are outside the projected half-length of the aabb
|
|
794
|
+
// the axis is separating and we can exit
|
|
795
|
+
return false;
|
|
796
|
+
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
return true;
|
|
802
|
+
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export { Box3 };
|