@gnsx/three 0.185.15 → 0.186.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/build/three.cjs +10 -82600
- package/build/three.core.js +1303 -728
- package/build/three.module.js +439 -338
- package/build/three.tsl.js +74 -44
- package/build/three.webgpu.js +6036 -2184
- package/build/three.webgpu.nodes.js +6020 -2184
- package/examples/jsm/Addons.js +6 -6
- package/examples/jsm/controls/ArcballControls.js +1 -1
- package/examples/jsm/controls/FirstPersonControls.js +44 -20
- package/examples/jsm/controls/OrbitControls.js +9 -0
- package/examples/jsm/controls/TrackballControls.js +109 -4
- package/examples/jsm/csm/CSMShadowNode.js +13 -0
- package/examples/jsm/exporters/GLTFExporter.js +23 -7
- package/examples/jsm/exporters/USDZExporter.js +2 -2
- package/examples/jsm/generators/CityGenerator.js +377 -45
- package/examples/jsm/generators/ForestGenerator.js +12 -12
- package/examples/jsm/generators/TerrainGenerator.js +49 -37
- package/examples/jsm/generators/TreeGenerator.js +70 -76
- package/examples/jsm/generators/city/BenchGenerator.js +127 -0
- package/examples/jsm/generators/city/CarGenerator.js +479 -0
- package/examples/jsm/generators/city/CityGeneratorUtils.js +31 -0
- package/examples/jsm/generators/city/HydrantGenerator.js +106 -0
- package/examples/jsm/generators/city/InstancedMeshGenerator.js +86 -0
- package/examples/jsm/generators/city/PersonGenerator.js +447 -0
- package/examples/jsm/generators/city/SidewalkGenerator.js +33 -38
- package/examples/jsm/generators/city/SkyscraperGenerator.js +448 -48
- package/examples/jsm/generators/city/StreetTreeGenerator.js +231 -0
- package/examples/jsm/generators/city/StreetlightGenerator.js +100 -0
- package/examples/jsm/generators/city/TrafficlightGenerator.js +106 -0
- package/examples/jsm/generators/city/TrashcanGenerator.js +100 -0
- package/examples/jsm/geometries/BoxLineGeometry.js +1 -1
- package/examples/jsm/geometries/ParametricGeometry.js +1 -1
- package/examples/jsm/geometries/RoundedBoxGeometry.js +1 -1
- package/examples/jsm/gpgpu/CountingSort.js +271 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +60 -239
- package/examples/jsm/helpers/LightProbeGridHelperWebGL.js +221 -0
- package/examples/jsm/inspector/Extension.js +94 -0
- package/examples/jsm/inspector/Inspector.js +145 -41
- package/examples/jsm/inspector/RendererInspector.js +100 -52
- package/examples/jsm/inspector/extensions/color-grading/ColorGrading.js +2609 -0
- package/examples/jsm/inspector/extensions/color-grading/ColorWheel.js +352 -0
- package/examples/jsm/inspector/extensions/color-grading/CurveEditor.js +599 -0
- package/examples/jsm/inspector/extensions/color-grading/LUT3DStyle.js +1201 -0
- package/examples/jsm/inspector/extensions/color-grading/LUTMath.js +788 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/BrightnessModule.js +72 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/ColorWheelModule.js +112 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/ContrastModule.js +82 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/CurvesModule.js +109 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/ExposureHueModule.js +110 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/ExposureModule.js +73 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/HueModule.js +78 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/ImportedCubeModule.js +89 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/Module.js +285 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/OutputModule.js +101 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/RendererModule.js +225 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/SatVibranceModule.js +102 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/SaturationModule.js +76 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/VibranceModule.js +76 -0
- package/examples/jsm/inspector/extensions/color-grading/modules/WhiteBalanceModule.js +86 -0
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +26 -31
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +1 -0
- package/examples/jsm/inspector/tabs/Memory.js +0 -2
- package/examples/jsm/inspector/tabs/Settings.js +4 -0
- package/examples/jsm/inspector/tabs/Timeline.js +223 -171
- package/examples/jsm/inspector/tabs/Viewer.js +515 -21
- package/examples/jsm/inspector/ui/List.js +15 -9
- package/examples/jsm/inspector/ui/Profiler.js +170 -14
- package/examples/jsm/inspector/ui/Style.js +269 -23
- package/examples/jsm/inspector/ui/Tab.js +2 -0
- package/examples/jsm/inspector/ui/Values.js +14 -2
- package/examples/jsm/interactive/HTMLMesh.js +19 -3
- package/examples/jsm/lighting/LightProbeGrid.js +484 -889
- package/examples/jsm/lighting/LightProbeGridUtils.js +107 -0
- package/examples/jsm/lighting/LightProbeGridWebGL.js +841 -0
- package/examples/jsm/lighting/vxgi/VXGIConeTracer.js +194 -0
- package/examples/jsm/lighting/vxgi/VXGINode.js +660 -0
- package/examples/jsm/lighting/vxgi/VXGISceneCollector.js +478 -0
- package/examples/jsm/lighting/vxgi/VXGIVolume.js +1430 -0
- package/examples/jsm/lights/SunLight.js +95 -0
- package/examples/jsm/lights/SunLightNode.js +56 -0
- package/examples/jsm/lights/SunLightShadow.js +319 -0
- package/examples/jsm/lights/SunShadowNode.js +312 -0
- package/examples/jsm/loaders/3DMLoader.js +150 -49
- package/examples/jsm/loaders/3MFLoader.js +202 -1
- package/examples/jsm/loaders/FBXLoader.js +81 -5
- package/examples/jsm/loaders/GLTFGaussianSplatLoaderExtension.js +330 -0
- package/examples/jsm/loaders/GLTFLoader.js +79 -14
- package/examples/jsm/loaders/GaussianSplatPLYLoader.js +386 -0
- package/examples/jsm/loaders/KSPLATLoader.js +463 -0
- package/examples/jsm/loaders/MaterialXLoader.js +111 -1010
- package/examples/jsm/loaders/PCDLoader.js +1 -1
- package/examples/jsm/loaders/SPLATLoader.js +139 -0
- package/examples/jsm/loaders/SPZLoader.js +561 -0
- package/examples/jsm/loaders/materialx/MaterialXArchive.js +108 -0
- package/examples/jsm/loaders/materialx/MaterialXDocument.js +878 -0
- package/examples/jsm/loaders/materialx/MaterialXHextile.js +183 -0
- package/examples/jsm/loaders/materialx/MaterialXInterfaceValidation.js +376 -0
- package/examples/jsm/loaders/materialx/MaterialXLog.js +75 -0
- package/examples/jsm/loaders/materialx/MaterialXNodeInterfaceRegistry.js +4 -0
- package/examples/jsm/loaders/materialx/MaterialXNodeLibrary.js +1021 -0
- package/examples/jsm/loaders/materialx/MaterialXSurfaceMappings.js +661 -0
- package/examples/jsm/loaders/materialx/MaterialXUtils.js +57 -0
- package/examples/jsm/loaders/materialx/compile/MaterialXCompileRegistry.js +997 -0
- package/examples/jsm/loaders/materialx/parse/MaterialXParser.js +28 -0
- package/examples/jsm/loaders/usd/USDAParser.js +15 -2
- package/examples/jsm/loaders/usd/USDCParser.js +1 -4
- package/examples/jsm/loaders/usd/USDComposer.js +80 -42
- package/examples/jsm/materials/WoodNodeMaterial.js +6 -108
- package/examples/jsm/misc/RollerCoaster.js +2 -2
- package/examples/jsm/misc/SculptGL.LICENSE.txt +21 -0
- package/examples/jsm/misc/Sculptor.js +1679 -0
- package/examples/jsm/misc/SculptorMesh.js +1504 -0
- package/examples/jsm/misc/SculptorTools.js +1180 -0
- package/examples/jsm/misc/SculptorUtils.js +345 -0
- package/examples/jsm/misc/TubePainter.js +28 -16
- package/examples/jsm/misc/VolumeSlice.js +24 -24
- package/examples/jsm/modifiers/SimplifyModifier.js +63 -556
- package/examples/jsm/objects/GaussianSplat.js +1039 -0
- package/examples/jsm/objects/Sky.js +66 -45
- package/examples/jsm/objects/SkyMesh.js +70 -51
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/postprocessing/AfterimagePass.js +4 -2
- package/examples/jsm/postprocessing/BloomPass.js +2 -2
- package/examples/jsm/postprocessing/GTAOPass.js +1 -1
- package/examples/jsm/postprocessing/OutlinePass.js +5 -5
- package/examples/jsm/postprocessing/SAOPass.js +1 -1
- package/examples/jsm/postprocessing/SSAOPass.js +1 -1
- package/examples/jsm/postprocessing/SSRPass.js +4 -2
- package/examples/jsm/postprocessing/SavePass.js +1 -1
- package/examples/jsm/postprocessing/TAARenderPass.js +1 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +30 -13
- package/examples/jsm/renderers/CSS2DRenderer.js +29 -5
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +4 -1
- package/examples/jsm/shaders/ExposureShader.js +1 -1
- package/examples/jsm/shaders/FilmShader.js +2 -1
- package/examples/jsm/transpiler/AST.js +21 -2
- package/examples/jsm/transpiler/GLSLDecoder.js +498 -8
- package/examples/jsm/transpiler/TSLEncoder.js +82 -10
- package/examples/jsm/transpiler/WGSLEncoder.js +33 -4
- package/examples/jsm/tsl/WebGLNodesHandler.js +29 -39
- package/examples/jsm/tsl/display/AfterImageNode.js +2 -0
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +3 -2
- package/examples/jsm/tsl/display/BilateralBlurNode.js +5 -2
- package/examples/jsm/tsl/display/BloomNode.js +55 -30
- package/examples/jsm/tsl/display/DenoiseNode.js +21 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +24 -6
- package/examples/jsm/tsl/display/DotScreenNode.js +11 -11
- package/examples/jsm/tsl/display/FSR1Node.js +8 -4
- package/examples/jsm/tsl/display/GTAONode.js +199 -86
- package/examples/jsm/tsl/display/GaussianBlurNode.js +65 -52
- package/examples/jsm/tsl/display/GodraysNode.js +5 -2
- package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +2 -2
- package/examples/jsm/tsl/display/LensflareNode.js +5 -2
- package/examples/jsm/tsl/display/OITPassNode.js +352 -0
- package/examples/jsm/tsl/display/OutlineNode.js +2 -0
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +3 -2
- package/examples/jsm/tsl/display/RGBShiftNode.js +9 -9
- package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +7 -4
- package/examples/jsm/tsl/display/RetroPassNode.js +1 -1
- package/examples/jsm/tsl/display/SMAANode.js +22 -61
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -4
- package/examples/jsm/tsl/display/SSAONode.js +436 -0
- package/examples/jsm/tsl/display/SSGINode.js +5 -2
- package/examples/jsm/tsl/display/SSRNode.js +7 -2
- package/examples/jsm/tsl/display/SSSNode.js +5 -2
- package/examples/jsm/tsl/display/SharpenNode.js +5 -4
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +1 -3
- package/examples/jsm/tsl/display/StereoPassNode.js +1 -3
- package/examples/jsm/tsl/display/TAAUNode.js +22 -125
- package/examples/jsm/tsl/display/TRAANode.js +16 -142
- package/examples/jsm/tsl/display/TemporalReprojectNode.js +21 -15
- package/examples/jsm/tsl/display/depthAwareBlur.js +63 -0
- package/examples/jsm/tsl/display/hashBlur.js +3 -2
- package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +38 -27
- package/examples/jsm/tsl/lighting/LightProbeGridNode.js +136 -0
- package/examples/jsm/tsl/math/voronoiNoise.js +112 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +4 -6
- package/examples/jsm/tsl/utils/Raymarching.js +5 -5
- package/examples/jsm/tsl/utils/SoftParticles.js +60 -0
- package/examples/jsm/tsl/utils/TAAUtils.js +195 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +14 -14
- package/examples/jsm/utils/GaussianSplatUtils.js +229 -0
- package/examples/jsm/utils/WebGLTextureUtils.js +1 -1
- package/examples/jsm/utils/WebGPUTextureUtils.js +1 -1
- package/examples/jsm/webxr/WebGLXRFallback.js +2 -16
- package/examples/jsm/webxr/XRControllerModelFactory.js +16 -4
- package/package.json +9 -16
- package/src/Three.Core.js +2 -1
- package/src/Three.TSL.js +73 -43
- package/src/Three.WebGPU.Nodes.js +1 -0
- package/src/Three.WebGPU.js +1 -0
- package/src/animation/AnimationClip.js +15 -2
- package/src/animation/AnimationObjectGroup.js +18 -6
- package/src/animation/AnimationUtils.js +26 -0
- package/src/animation/KeyframeTrack.js +37 -0
- package/src/constants.js +23 -1
- package/src/core/BufferAttribute.js +3 -2
- package/src/core/BufferGeometry.js +1 -1
- package/src/core/InterleavedBuffer.js +5 -1
- package/src/core/Object3D.js +40 -12
- package/src/core/Raycaster.js +4 -0
- package/src/core/RenderTarget.js +99 -9
- package/src/core/RenderTarget3D.js +12 -8
- package/src/extras/Controls.js +0 -8
- package/src/extras/PMREMGenerator.js +99 -205
- package/src/geometries/TorusGeometry.js +1 -1
- package/src/helpers/ArrowHelper.js +2 -0
- package/src/helpers/AxesHelper.js +2 -0
- package/src/helpers/Box3Helper.js +2 -0
- package/src/helpers/BoxHelper.js +2 -0
- package/src/helpers/CameraHelper.js +2 -0
- package/src/helpers/DirectionalLightHelper.js +2 -0
- package/src/helpers/GridHelper.js +2 -0
- package/src/helpers/HemisphereLightHelper.js +2 -0
- package/src/helpers/PlaneHelper.js +2 -0
- package/src/helpers/PointLightHelper.js +2 -0
- package/src/helpers/PolarGridHelper.js +2 -0
- package/src/helpers/SkeletonHelper.js +2 -0
- package/src/helpers/SpotLightHelper.js +2 -0
- package/src/lights/Light.js +0 -10
- package/src/lights/LightShadow.js +43 -12
- package/src/lights/SpotLightShadow.js +18 -0
- package/src/loaders/BufferGeometryLoader.js +5 -0
- package/src/loaders/ImageBitmapLoader.js +3 -1
- package/src/loaders/ObjectLoader.js +8 -5
- package/src/materials/Material.js +80 -57
- package/src/materials/MeshPhysicalMaterial.js +32 -0
- package/src/materials/nodes/Line2NodeMaterial.js +17 -8
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +42 -5
- package/src/materials/nodes/NodeMaterial.js +19 -13
- package/src/materials/nodes/PointsNodeMaterial.js +2 -1
- package/src/materials/nodes/manager/NodeMaterialObserver.js +282 -55
- package/src/math/Frustum.js +9 -0
- package/src/math/FrustumArray.js +1 -1
- package/src/math/MathUtils.js +5 -3
- package/src/math/Matrix4.js +2 -9
- package/src/math/Plane.js +30 -1
- package/src/math/Quaternion.js +0 -10
- package/src/math/Ray.js +95 -45
- package/src/math/Triangle.js +0 -2
- package/src/math/Vector3.js +2 -2
- package/src/math/Vector4.js +0 -4
- package/src/math/interpolants/BezierInterpolant.js +36 -23
- package/src/nodes/Nodes.js +2 -0
- package/src/nodes/TSL.js +11 -3
- package/src/nodes/accessors/Batch.js +85 -13
- package/src/nodes/accessors/BufferAttributeNode.js +1 -1
- package/src/nodes/accessors/BuiltinNode.js +1 -1
- package/src/nodes/accessors/Instance.js +19 -18
- package/src/nodes/accessors/MaterialNode.js +9 -0
- package/src/nodes/accessors/ModelNode.js +85 -9
- package/src/nodes/accessors/ReferenceBaseNode.js +1 -70
- package/src/nodes/accessors/ReferenceElementNode.js +72 -0
- package/src/nodes/accessors/ReferenceNode.js +1 -70
- package/src/nodes/accessors/Skinning.js +124 -12
- package/src/nodes/accessors/StorageTextureNode.js +7 -3
- package/src/nodes/accessors/Texture3DNode.js +1 -1
- package/src/nodes/accessors/TextureNode.js +51 -21
- package/src/nodes/accessors/TextureSizeNode.js +4 -2
- package/src/nodes/accessors/UniformArrayNode.js +30 -5
- package/src/nodes/code/CodeNode.js +1 -1
- package/src/nodes/code/FunctionNode.js +12 -2
- package/src/nodes/core/ArrayNode.js +2 -2
- package/src/nodes/core/ContextNode.js +57 -4
- package/src/nodes/core/IndexNode.js +69 -4
- package/src/nodes/core/InspectorNode.js +2 -2
- package/src/nodes/core/MRTNode.js +44 -2
- package/src/nodes/core/Node.js +6 -3
- package/src/nodes/core/NodeBuilder.js +65 -50
- package/src/nodes/core/NodeFrame.js +11 -3
- package/src/nodes/core/NodeUtils.js +88 -0
- package/src/nodes/core/PropertyNode.js +8 -0
- package/src/nodes/core/StackNode.js +0 -1
- package/src/nodes/core/StructNode.js +4 -3
- package/src/nodes/core/UniformGroupNode.js +3 -2
- package/src/nodes/core/UniformNode.js +26 -12
- package/src/nodes/core/VarNode.js +0 -1
- package/src/nodes/display/BumpMapNode.js +2 -2
- package/src/nodes/display/ColorAdjustment.js +1 -1
- package/src/nodes/display/PassNode.js +76 -15
- package/src/nodes/display/ScreenNode.js +22 -65
- package/src/nodes/fog/Fog.js +4 -4
- package/src/nodes/functions/BSDF/BRDF_GGX.js +6 -6
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +1 -1
- package/src/nodes/functions/BSDF/DFGLUT.js +2 -1
- package/src/nodes/functions/BSDF/LTC.js +1 -1
- package/src/nodes/functions/PhongLightingModel.js +1 -1
- package/src/nodes/functions/PhysicalLightingModel.js +83 -25
- package/src/nodes/functions/ToonLightingModel.js +2 -2
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +3 -3
- package/src/nodes/gpgpu/AtomicFunctionNode.js +64 -13
- package/src/nodes/gpgpu/BarrierNode.js +13 -4
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +20 -17
- package/src/nodes/gpgpu/SubgroupFunctionNode.js +165 -37
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +44 -6
- package/src/nodes/lighting/EnvironmentNode.js +40 -4
- package/src/nodes/lighting/LightsNode.js +20 -4
- package/src/nodes/lighting/ShadowBaseNode.js +158 -1
- package/src/nodes/lighting/ShadowFilterNode.js +2 -106
- package/src/nodes/lighting/ShadowNode.js +22 -91
- package/src/nodes/materialx/{lib/mx_hsv.js → MaterialXColor.js} +3 -6
- package/src/nodes/materialx/{lib/mx_transform_color.js → MaterialXColorTransform.js} +3 -6
- package/src/nodes/materialx/MaterialXCore.js +37 -0
- package/src/nodes/materialx/MaterialXNodes.js +64 -72
- package/src/nodes/materialx/{lib/mx_noise.js → MaterialXNoise.js} +426 -197
- package/src/nodes/math/BitcountNode.js +24 -4
- package/src/nodes/math/MathNode.js +4 -4
- package/src/nodes/math/MathUtils.js +15 -4
- package/src/nodes/math/OperatorNode.js +2 -2
- package/src/nodes/math/PackFloatNode.js +29 -1
- package/src/nodes/math/Packed4x8IntegerNode.js +433 -0
- package/src/nodes/math/UnpackFloatNode.js +30 -2
- package/src/nodes/parsers/GLSLNodeFunction.js +1 -1
- package/src/nodes/pmrem/PMREMNode.js +1 -1
- package/src/nodes/pmrem/PMREMUtils.js +31 -74
- package/src/nodes/shapes/Shapes.js +1 -1
- package/src/nodes/tsl/TSLCore.js +1 -31
- package/src/nodes/utils/EventNode.js +75 -0
- package/src/nodes/utils/LoopNode.js +54 -13
- package/src/nodes/utils/PostProcessingUtils.js +23 -2
- package/src/nodes/utils/RTTNode.js +97 -32
- package/src/nodes/utils/ReflectorNode.js +8 -4
- package/src/nodes/utils/RotateNode.js +85 -8
- package/src/nodes/utils/SpriteUtils.js +58 -23
- package/src/objects/BatchedMesh.js +6 -0
- package/src/objects/InstancedMesh.js +1 -1
- package/src/objects/LOD.js +1 -1
- package/src/objects/Line.js +12 -0
- package/src/objects/Mesh.js +12 -0
- package/src/objects/Points.js +12 -0
- package/src/objects/Sprite.js +12 -0
- package/src/renderers/WebGLRenderer.js +93 -27
- package/src/renderers/common/Animation.js +12 -2
- package/src/renderers/common/Backend.js +38 -10
- package/src/renderers/common/BindGroup.js +0 -1
- package/src/renderers/common/Bindings.js +50 -4
- package/src/renderers/common/BundleGroup.js +4 -0
- package/src/renderers/common/ClippingContext.js +11 -1
- package/src/renderers/common/Color4.js +9 -0
- package/src/renderers/common/Constants.js +0 -5
- package/src/renderers/common/DirectRenderPipeline.js +233 -0
- package/src/renderers/common/Geometries.js +24 -3
- package/src/renderers/common/Info.js +3 -3
- package/src/renderers/common/InspectorBase.js +37 -8
- package/src/renderers/common/Lighting.js +11 -4
- package/src/renderers/common/Pipelines.js +6 -4
- package/src/renderers/common/QuadMesh.js +16 -2
- package/src/renderers/common/RenderContext.js +8 -0
- package/src/renderers/common/RenderList.js +53 -19
- package/src/renderers/common/RenderLists.js +58 -11
- package/src/renderers/common/RenderObject.js +14 -0
- package/src/renderers/common/RenderObjects.js +14 -9
- package/src/renderers/common/RenderPipeline.js +52 -44
- package/src/renderers/common/Renderer.js +226 -55
- package/src/renderers/common/Storage3DTexture.js +16 -0
- package/src/renderers/common/Textures.js +3 -3
- package/src/renderers/common/XRManager.js +79 -72
- package/src/renderers/common/extras/PMREMGenerator.js +76 -144
- package/src/renderers/common/nodes/NodeManager.js +144 -6
- package/src/renderers/common/nodes/NodeStorageBuffer.js +3 -1
- package/src/renderers/common/nodes/NodeUniformBuffer.js +3 -1
- package/src/renderers/shaders/DFGLUTData.js +2 -1
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +4 -2
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +48 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +53 -4
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +20 -2
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +20 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +61 -57
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +82 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +9 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +8 -1
- package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +15 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +4 -0
- package/src/renderers/shaders/ShaderLib.js +1 -0
- package/src/renderers/shaders/UniformsLib.js +16 -0
- package/src/renderers/webgl/WebGLAnimation.js +2 -2
- package/src/renderers/webgl/WebGLCapabilities.js +2 -2
- package/src/renderers/webgl/WebGLLights.js +74 -4
- package/src/renderers/webgl/WebGLMaterials.js +6 -0
- package/src/renderers/webgl/WebGLOutput.js +36 -24
- package/src/renderers/webgl/WebGLProgram.js +3 -0
- package/src/renderers/webgl/WebGLPrograms.js +8 -0
- package/src/renderers/webgl/WebGLRenderLists.js +6 -10
- package/src/renderers/webgl/WebGLShadowMap.js +47 -44
- package/src/renderers/webgl/WebGLTextures.js +7 -7
- package/src/renderers/webgl-fallback/WebGLBackend.js +153 -45
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +83 -29
- package/src/renderers/webgl-fallback/utils/WebGLState.js +163 -17
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +32 -5
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +11 -4
- package/src/renderers/webgpu/WebGPUBackend.js +513 -145
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +99 -20
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +2 -1
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +3 -12
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +24 -14
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +80 -14
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +62 -7
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +9 -3
- package/src/renderers/webgpu/utils/WebGPUUtils.js +16 -4
- package/src/renderers/webxr/WebXRManager.js +25 -2
- package/src/scenes/Scene.js +3 -3
- package/src/textures/CompressedArrayTexture.js +16 -0
- package/src/textures/Data3DTexture.js +16 -0
- package/src/textures/DataArrayTexture.js +16 -0
- package/src/textures/DepthTexture.js +3 -3
- package/src/textures/Texture.js +3 -3
- package/src/textures/{Source.js → TextureSource.js} +39 -8
- package/build/three.core.min.js +0 -6
- package/build/three.module.min.js +0 -6
- package/build/three.tsl.min.js +0 -6
- package/build/three.webgpu.min.js +0 -6
- package/build/three.webgpu.nodes.min.js +0 -6
- package/examples/jsm/libs/ecsy.module.js +0 -1792
- package/examples/jsm/loaders/LottieLoader.js +0 -130
- package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +0 -52
package/build/three.core.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2010-2026 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
*/
|
|
6
|
-
const REVISION = '
|
|
6
|
+
const REVISION = '186';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -75,6 +75,7 @@ const PCFShadowMap = 1;
|
|
|
75
75
|
*
|
|
76
76
|
* @type {number}
|
|
77
77
|
* @constant
|
|
78
|
+
* @deprecated since r186. Use `PCFShadowMap` instead.
|
|
78
79
|
*/
|
|
79
80
|
const PCFSoftShadowMap = 2;
|
|
80
81
|
|
|
@@ -1714,6 +1715,18 @@ const Compatibility = {
|
|
|
1714
1715
|
TEXTURE_COMPARE: 'depthTextureCompare'
|
|
1715
1716
|
};
|
|
1716
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* Represents the refresh types of render objects.
|
|
1720
|
+
*
|
|
1721
|
+
* @type {ConstantsRenderObjectRefreshType}
|
|
1722
|
+
* @constant
|
|
1723
|
+
*/
|
|
1724
|
+
const RenderObjectRefreshType = {
|
|
1725
|
+
NONE: 0,
|
|
1726
|
+
SHARED: 1,
|
|
1727
|
+
FULL: 2
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1717
1730
|
/**
|
|
1718
1731
|
* This type represents mouse buttons and interaction types in context of controls.
|
|
1719
1732
|
*
|
|
@@ -1764,6 +1777,15 @@ const Compatibility = {
|
|
|
1764
1777
|
* @property {string} EITHER - Flat interpolation using either vertex.
|
|
1765
1778
|
*/
|
|
1766
1779
|
|
|
1780
|
+
/**
|
|
1781
|
+
* Represents the refresh types of render objects.
|
|
1782
|
+
*
|
|
1783
|
+
* @typedef {Object} ConstantsRenderObjectRefreshType
|
|
1784
|
+
* @property {number} NONE - No refresh required.
|
|
1785
|
+
* @property {number} SHARED - Only shared uniform buffers require an update.
|
|
1786
|
+
* @property {number} FULL - The render object requires a full refresh.
|
|
1787
|
+
*/
|
|
1788
|
+
|
|
1767
1789
|
/**
|
|
1768
1790
|
* Checks if an array contains values that require Uint32 representation.
|
|
1769
1791
|
*
|
|
@@ -2558,14 +2580,14 @@ function radToDeg( radians ) {
|
|
|
2558
2580
|
}
|
|
2559
2581
|
|
|
2560
2582
|
/**
|
|
2561
|
-
* Returns `true` if the given
|
|
2583
|
+
* Returns `true` if the given integer is a power of two.
|
|
2562
2584
|
*
|
|
2563
2585
|
* @param {number} value - The value to check.
|
|
2564
|
-
* @return {boolean} Whether the given
|
|
2586
|
+
* @return {boolean} Whether the given integer is a power of two or not.
|
|
2565
2587
|
*/
|
|
2566
2588
|
function isPowerOfTwo( value ) {
|
|
2567
2589
|
|
|
2568
|
-
return ( value
|
|
2590
|
+
return value > 0 && Number.isInteger( value ) && 2 ** Math.round( Math.log2( value ) ) === value;
|
|
2569
2591
|
|
|
2570
2592
|
}
|
|
2571
2593
|
|
|
@@ -2680,6 +2702,7 @@ function denormalize( value, array ) {
|
|
|
2680
2702
|
return value / 65535.0;
|
|
2681
2703
|
|
|
2682
2704
|
case Uint8Array:
|
|
2705
|
+
case Uint8ClampedArray:
|
|
2683
2706
|
|
|
2684
2707
|
return value / 255.0;
|
|
2685
2708
|
|
|
@@ -2727,6 +2750,7 @@ function normalize( value, array ) {
|
|
|
2727
2750
|
return Math.round( value * 65535.0 );
|
|
2728
2751
|
|
|
2729
2752
|
case Uint8Array:
|
|
2753
|
+
case Uint8ClampedArray:
|
|
2730
2754
|
|
|
2731
2755
|
return Math.round( value * 255.0 );
|
|
2732
2756
|
|
|
@@ -4168,10 +4192,6 @@ class Quaternion {
|
|
|
4168
4192
|
|
|
4169
4193
|
const x = euler._x, y = euler._y, z = euler._z, order = euler._order;
|
|
4170
4194
|
|
|
4171
|
-
// http://www.mathworks.com/matlabcentral/fileexchange/
|
|
4172
|
-
// 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/
|
|
4173
|
-
// content/SpinCalc.m
|
|
4174
|
-
|
|
4175
4195
|
const cos = Math.cos;
|
|
4176
4196
|
const sin = Math.sin;
|
|
4177
4197
|
|
|
@@ -4247,8 +4267,6 @@ class Quaternion {
|
|
|
4247
4267
|
*/
|
|
4248
4268
|
setFromAxisAngle( axis, angle ) {
|
|
4249
4269
|
|
|
4250
|
-
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm
|
|
4251
|
-
|
|
4252
4270
|
const halfAngle = angle / 2, s = Math.sin( halfAngle );
|
|
4253
4271
|
|
|
4254
4272
|
this._x = axis.x * s;
|
|
@@ -4270,8 +4288,6 @@ class Quaternion {
|
|
|
4270
4288
|
*/
|
|
4271
4289
|
setFromRotationMatrix( m ) {
|
|
4272
4290
|
|
|
4273
|
-
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
|
|
4274
|
-
|
|
4275
4291
|
// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
|
|
4276
4292
|
|
|
4277
4293
|
const te = m.elements,
|
|
@@ -4559,8 +4575,6 @@ class Quaternion {
|
|
|
4559
4575
|
*/
|
|
4560
4576
|
multiplyQuaternions( a, b ) {
|
|
4561
4577
|
|
|
4562
|
-
// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
|
|
4563
|
-
|
|
4564
4578
|
const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;
|
|
4565
4579
|
const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;
|
|
4566
4580
|
|
|
@@ -5296,8 +5310,8 @@ class Vector3 {
|
|
|
5296
5310
|
}
|
|
5297
5311
|
|
|
5298
5312
|
/**
|
|
5299
|
-
* Transforms
|
|
5300
|
-
*
|
|
5313
|
+
* Transforms this vector by the upper left 3x3 sub-matrix of the given 4x4 matrix,
|
|
5314
|
+
* and normalizes the result.
|
|
5301
5315
|
*
|
|
5302
5316
|
* @param {Matrix4} m - The matrix.
|
|
5303
5317
|
* @return {Vector3} A reference to this vector.
|
|
@@ -7018,10 +7032,10 @@ let _sourceId = 0;
|
|
|
7018
7032
|
* The main purpose of this class is to decouple the data definition from the texture
|
|
7019
7033
|
* definition so the same data can be used with multiple texture instances.
|
|
7020
7034
|
*/
|
|
7021
|
-
class
|
|
7035
|
+
class TextureSource {
|
|
7022
7036
|
|
|
7023
7037
|
/**
|
|
7024
|
-
* Constructs a new
|
|
7038
|
+
* Constructs a new texture source.
|
|
7025
7039
|
*
|
|
7026
7040
|
* @param {any} [data=null] - The data definition of a texture.
|
|
7027
7041
|
*/
|
|
@@ -7034,12 +7048,12 @@ class Source {
|
|
|
7034
7048
|
* @readonly
|
|
7035
7049
|
* @default true
|
|
7036
7050
|
*/
|
|
7037
|
-
this.
|
|
7051
|
+
this.isTextureSource = true;
|
|
7038
7052
|
|
|
7039
7053
|
/**
|
|
7040
7054
|
* The ID of the source.
|
|
7041
7055
|
*
|
|
7042
|
-
* @name
|
|
7056
|
+
* @name TextureSource#id
|
|
7043
7057
|
* @type {number}
|
|
7044
7058
|
* @readonly
|
|
7045
7059
|
*/
|
|
@@ -7061,7 +7075,7 @@ class Source {
|
|
|
7061
7075
|
this.data = data;
|
|
7062
7076
|
|
|
7063
7077
|
/**
|
|
7064
|
-
* This property is only relevant when {@link
|
|
7078
|
+
* This property is only relevant when {@link TextureSource#needsUpdate} is set to `true` and
|
|
7065
7079
|
* provides more control on how texture data should be processed. When `dataReady` is set
|
|
7066
7080
|
* to `false`, the engine performs the memory allocation (if necessary) but does not transfer
|
|
7067
7081
|
* the data into the GPU memory.
|
|
@@ -7072,7 +7086,7 @@ class Source {
|
|
|
7072
7086
|
this.dataReady = true;
|
|
7073
7087
|
|
|
7074
7088
|
/**
|
|
7075
|
-
* This starts at `0` and counts how many times {@link
|
|
7089
|
+
* This starts at `0` and counts how many times {@link TextureSource#needsUpdate} is set to `true`.
|
|
7076
7090
|
*
|
|
7077
7091
|
* @type {number}
|
|
7078
7092
|
* @readonly
|
|
@@ -7235,6 +7249,37 @@ function serializeImage( image ) {
|
|
|
7235
7249
|
|
|
7236
7250
|
}
|
|
7237
7251
|
|
|
7252
|
+
/**
|
|
7253
|
+
* @deprecated since r186. Use {@link TextureSource} instead. `Source` has been renamed to `TextureSource`.
|
|
7254
|
+
*/
|
|
7255
|
+
class Source extends TextureSource {
|
|
7256
|
+
|
|
7257
|
+
/**
|
|
7258
|
+
* Constructs a new texture source.
|
|
7259
|
+
*
|
|
7260
|
+
* @param {any} [data=null] - The data definition of a texture.
|
|
7261
|
+
* @deprecated since r186. Use {@link TextureSource} instead.
|
|
7262
|
+
*/
|
|
7263
|
+
constructor( data = null ) {
|
|
7264
|
+
|
|
7265
|
+
warnOnce( 'Source: "Source" has been renamed to "TextureSource". Please update your code to use "THREE.TextureSource" instead.' ); // @deprecated, r186
|
|
7266
|
+
|
|
7267
|
+
super( data );
|
|
7268
|
+
|
|
7269
|
+
/**
|
|
7270
|
+
* This flag can be used for type testing.
|
|
7271
|
+
*
|
|
7272
|
+
* @deprecated since r186. Use {@link TextureSource#isTextureSource} instead.
|
|
7273
|
+
* @type {boolean}
|
|
7274
|
+
* @readonly
|
|
7275
|
+
* @default true
|
|
7276
|
+
*/
|
|
7277
|
+
this.isSource = true;
|
|
7278
|
+
|
|
7279
|
+
}
|
|
7280
|
+
|
|
7281
|
+
}
|
|
7282
|
+
|
|
7238
7283
|
let _textureId = 0;
|
|
7239
7284
|
|
|
7240
7285
|
const _tempVec3 = /*@__PURE__*/ new Vector3();
|
|
@@ -7306,9 +7351,9 @@ class Texture extends EventDispatcher {
|
|
|
7306
7351
|
* where multiple textures render the same data but with different texture
|
|
7307
7352
|
* transformations.
|
|
7308
7353
|
*
|
|
7309
|
-
* @type {
|
|
7354
|
+
* @type {TextureSource}
|
|
7310
7355
|
*/
|
|
7311
|
-
this.source = new
|
|
7356
|
+
this.source = new TextureSource( image );
|
|
7312
7357
|
|
|
7313
7358
|
/**
|
|
7314
7359
|
* An array holding user-defined mipmaps.
|
|
@@ -8520,8 +8565,6 @@ class Vector4 {
|
|
|
8520
8565
|
*/
|
|
8521
8566
|
setAxisAngleFromQuaternion( q ) {
|
|
8522
8567
|
|
|
8523
|
-
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
|
|
8524
|
-
|
|
8525
8568
|
// q is assumed to be normalized
|
|
8526
8569
|
|
|
8527
8570
|
this.w = 2 * Math.acos( q.w );
|
|
@@ -8555,8 +8598,6 @@ class Vector4 {
|
|
|
8555
8598
|
*/
|
|
8556
8599
|
setAxisAngleFromRotationMatrix( m ) {
|
|
8557
8600
|
|
|
8558
|
-
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
|
|
8559
|
-
|
|
8560
8601
|
// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
|
|
8561
8602
|
|
|
8562
8603
|
let angle, x, y, z; // variables for result
|
|
@@ -9117,8 +9158,12 @@ class RenderTarget extends EventDispatcher {
|
|
|
9117
9158
|
* @property {string} [colorSpace=NoColorSpace] - The texture's color space.
|
|
9118
9159
|
* @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not.
|
|
9119
9160
|
* @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not.
|
|
9120
|
-
* @property {boolean} [
|
|
9121
|
-
* @property {boolean} [
|
|
9161
|
+
* @property {boolean} [resolveColorBuffer=true] - Whether to resolve the color buffer or not. Only relevant for multisampled render targets.
|
|
9162
|
+
* @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not. Only relevant for multisampled render targets.
|
|
9163
|
+
* @property {boolean} [resolveStencilBuffer=true] - Whether to resolve the stencil buffer or not. Only relevant for multisampled render targets.
|
|
9164
|
+
* @property {boolean} [storeMultisampledColorBuffer=true] - Whether to store the multisampled color buffer or not. Setting to `false` saves memory bandwidth when the multisampled data are not needed after a render pass.
|
|
9165
|
+
* @property {boolean} [storeMultisampledDepthBuffer=true] - Whether to store the multisampled depth buffer or not. Setting to `false` saves memory bandwidth when the multisampled data are not needed after a render pass.
|
|
9166
|
+
* @property {boolean} [storeMultisampledStencilBuffer=true] - Whether to store the multisampled stencil buffer or not. Setting to `false` saves memory bandwidth when the multisampled data are not needed after a render pass.
|
|
9122
9167
|
* @property {?Texture} [depthTexture=null] - Reference to a depth texture.
|
|
9123
9168
|
* @property {number} [samples=0] - The MSAA samples count.
|
|
9124
9169
|
* @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.
|
|
@@ -9144,8 +9189,12 @@ class RenderTarget extends EventDispatcher {
|
|
|
9144
9189
|
minFilter: LinearFilter,
|
|
9145
9190
|
depthBuffer: true,
|
|
9146
9191
|
stencilBuffer: false,
|
|
9192
|
+
resolveColorBuffer: true,
|
|
9147
9193
|
resolveDepthBuffer: true,
|
|
9148
9194
|
resolveStencilBuffer: true,
|
|
9195
|
+
storeMultisampledColorBuffer: true,
|
|
9196
|
+
storeMultisampledDepthBuffer: true,
|
|
9197
|
+
storeMultisampledStencilBuffer: true,
|
|
9149
9198
|
depthTexture: null,
|
|
9150
9199
|
samples: 0,
|
|
9151
9200
|
count: 1,
|
|
@@ -9252,7 +9301,28 @@ class RenderTarget extends EventDispatcher {
|
|
|
9252
9301
|
this.stencilBuffer = options.stencilBuffer;
|
|
9253
9302
|
|
|
9254
9303
|
/**
|
|
9255
|
-
* Whether to resolve the
|
|
9304
|
+
* Whether to resolve the color buffer or not. When set to `false`, the color
|
|
9305
|
+
* attachments do not receive the resolved (single-sampled) output of a render
|
|
9306
|
+
* pass and the render target's textures are left untouched. The rendered
|
|
9307
|
+
* content is then only accessible within the render pass itself.
|
|
9308
|
+
*
|
|
9309
|
+
* Only relevant for multisampled render targets.
|
|
9310
|
+
*
|
|
9311
|
+
* @type {boolean}
|
|
9312
|
+
* @default true
|
|
9313
|
+
*/
|
|
9314
|
+
this.resolveColorBuffer = options.resolveColorBuffer;
|
|
9315
|
+
|
|
9316
|
+
/**
|
|
9317
|
+
* Whether to resolve the depth buffer or not. When set to `false`, the depth
|
|
9318
|
+
* texture does not receive the resolved depth output of a render pass which
|
|
9319
|
+
* saves memory bandwidth. Use this setting when the depth data of a render
|
|
9320
|
+
* pass are not required afterwards.
|
|
9321
|
+
*
|
|
9322
|
+
* Only relevant for multisampled render targets in WebGL. WebGPU does not
|
|
9323
|
+
* support depth resolves; sampling the depth texture of a multisampled render
|
|
9324
|
+
* target accesses the multisampled data directly, see
|
|
9325
|
+
* {@link RenderTarget#storeMultisampledDepthBuffer}.
|
|
9256
9326
|
*
|
|
9257
9327
|
* @type {boolean}
|
|
9258
9328
|
* @default true
|
|
@@ -9260,13 +9330,54 @@ class RenderTarget extends EventDispatcher {
|
|
|
9260
9330
|
this.resolveDepthBuffer = options.resolveDepthBuffer;
|
|
9261
9331
|
|
|
9262
9332
|
/**
|
|
9263
|
-
* Whether to resolve the stencil buffer or not.
|
|
9333
|
+
* Whether to resolve the stencil buffer or not. Analogous to
|
|
9334
|
+
* {@link RenderTarget#resolveDepthBuffer} but for the stencil aspect.
|
|
9264
9335
|
*
|
|
9265
9336
|
* @type {boolean}
|
|
9266
9337
|
* @default true
|
|
9267
9338
|
*/
|
|
9268
9339
|
this.resolveStencilBuffer = options.resolveStencilBuffer;
|
|
9269
9340
|
|
|
9341
|
+
/**
|
|
9342
|
+
* Whether to store the multisampled color buffer or not. When set to `false`,
|
|
9343
|
+
* the multisampled data are discarded at the end of a render pass, right after
|
|
9344
|
+
* they have been resolved. This saves memory bandwidth, especially on tile-based
|
|
9345
|
+
* GPUs, and is the recommended setting for render targets that are fully redrawn
|
|
9346
|
+
* each frame and whose output is only accessed via the resolved textures (e.g.
|
|
9347
|
+
* scene passes in post-processing chains).
|
|
9348
|
+
*
|
|
9349
|
+
* Must be kept `true` when the multisampled data are needed after the render
|
|
9350
|
+
* pass ends, e.g. when rendering into the target without clearing or when the
|
|
9351
|
+
* scene contains transmissive objects which require a mid-pass framebuffer copy.
|
|
9352
|
+
*
|
|
9353
|
+
* @type {boolean}
|
|
9354
|
+
* @default true
|
|
9355
|
+
*/
|
|
9356
|
+
this.storeMultisampledColorBuffer = options.storeMultisampledColorBuffer;
|
|
9357
|
+
|
|
9358
|
+
/**
|
|
9359
|
+
* Whether to store the multisampled depth buffer or not. When set to `false`,
|
|
9360
|
+
* the multisampled depth data are discarded at the end of a render pass which
|
|
9361
|
+
* saves memory bandwidth.
|
|
9362
|
+
*
|
|
9363
|
+
* Must be kept `true` in WebGPU when the depth texture of a multisampled render
|
|
9364
|
+
* target is sampled (e.g. by depth-based post-processing effects) since depth
|
|
9365
|
+
* is read directly from the multisampled data.
|
|
9366
|
+
*
|
|
9367
|
+
* @type {boolean}
|
|
9368
|
+
* @default true
|
|
9369
|
+
*/
|
|
9370
|
+
this.storeMultisampledDepthBuffer = options.storeMultisampledDepthBuffer;
|
|
9371
|
+
|
|
9372
|
+
/**
|
|
9373
|
+
* Whether to store the multisampled stencil buffer or not. Analogous to
|
|
9374
|
+
* {@link RenderTarget#storeMultisampledDepthBuffer} but for the stencil aspect.
|
|
9375
|
+
*
|
|
9376
|
+
* @type {boolean}
|
|
9377
|
+
* @default true
|
|
9378
|
+
*/
|
|
9379
|
+
this.storeMultisampledStencilBuffer = options.storeMultisampledStencilBuffer;
|
|
9380
|
+
|
|
9270
9381
|
this._depthTexture = null;
|
|
9271
9382
|
this.depthTexture = options.depthTexture;
|
|
9272
9383
|
|
|
@@ -9351,8 +9462,8 @@ class RenderTarget extends EventDispatcher {
|
|
|
9351
9462
|
|
|
9352
9463
|
set depthTexture( current ) {
|
|
9353
9464
|
|
|
9354
|
-
if ( this._depthTexture !== null ) this._depthTexture.renderTarget = null;
|
|
9355
|
-
if ( current !== null ) current.renderTarget = this;
|
|
9465
|
+
if ( this._depthTexture !== null && this._depthTexture.renderTarget === this ) this._depthTexture.renderTarget = null;
|
|
9466
|
+
if ( current !== null && current.renderTarget === null ) current.renderTarget = this;
|
|
9356
9467
|
|
|
9357
9468
|
this._depthTexture = current;
|
|
9358
9469
|
|
|
@@ -9455,17 +9566,37 @@ class RenderTarget extends EventDispatcher {
|
|
|
9455
9566
|
// ensure image object is not shared, see #20328
|
|
9456
9567
|
|
|
9457
9568
|
const image = Object.assign( {}, source.textures[ i ].image );
|
|
9458
|
-
this.textures[ i ].source = new
|
|
9569
|
+
this.textures[ i ].source = new TextureSource( image );
|
|
9459
9570
|
|
|
9460
9571
|
}
|
|
9461
9572
|
|
|
9462
9573
|
this.depthBuffer = source.depthBuffer;
|
|
9463
9574
|
this.stencilBuffer = source.stencilBuffer;
|
|
9464
9575
|
|
|
9576
|
+
this.resolveColorBuffer = source.resolveColorBuffer;
|
|
9465
9577
|
this.resolveDepthBuffer = source.resolveDepthBuffer;
|
|
9466
9578
|
this.resolveStencilBuffer = source.resolveStencilBuffer;
|
|
9467
9579
|
|
|
9468
|
-
|
|
9580
|
+
this.storeMultisampledColorBuffer = source.storeMultisampledColorBuffer;
|
|
9581
|
+
this.storeMultisampledDepthBuffer = source.storeMultisampledDepthBuffer;
|
|
9582
|
+
this.storeMultisampledStencilBuffer = source.storeMultisampledStencilBuffer;
|
|
9583
|
+
|
|
9584
|
+
if ( source.depthTexture !== null ) {
|
|
9585
|
+
|
|
9586
|
+
if ( source.depthTexture.renderTarget === source ) {
|
|
9587
|
+
|
|
9588
|
+
const depthTexture = source.depthTexture.clone();
|
|
9589
|
+
depthTexture.renderTarget = null;
|
|
9590
|
+
|
|
9591
|
+
this.depthTexture = depthTexture;
|
|
9592
|
+
|
|
9593
|
+
} else {
|
|
9594
|
+
|
|
9595
|
+
this.depthTexture = source.depthTexture;
|
|
9596
|
+
|
|
9597
|
+
}
|
|
9598
|
+
|
|
9599
|
+
}
|
|
9469
9600
|
|
|
9470
9601
|
this.samples = source.samples;
|
|
9471
9602
|
this.multiview = source.multiview;
|
|
@@ -9624,6 +9755,22 @@ class DataArrayTexture extends Texture {
|
|
|
9624
9755
|
|
|
9625
9756
|
}
|
|
9626
9757
|
|
|
9758
|
+
/**
|
|
9759
|
+
* Copies the values of the given texture to this instance.
|
|
9760
|
+
*
|
|
9761
|
+
* @param {DataArrayTexture} source - The texture to copy.
|
|
9762
|
+
* @return {DataArrayTexture} A reference to this instance.
|
|
9763
|
+
*/
|
|
9764
|
+
copy( source ) {
|
|
9765
|
+
|
|
9766
|
+
super.copy( source );
|
|
9767
|
+
|
|
9768
|
+
this.wrapR = source.wrapR;
|
|
9769
|
+
|
|
9770
|
+
return this;
|
|
9771
|
+
|
|
9772
|
+
}
|
|
9773
|
+
|
|
9627
9774
|
/**
|
|
9628
9775
|
* Describes that a specific layer of the texture needs to be updated.
|
|
9629
9776
|
* Normally when {@link Texture#needsUpdate} is set to `true`, the
|
|
@@ -9800,6 +9947,22 @@ class Data3DTexture extends Texture {
|
|
|
9800
9947
|
|
|
9801
9948
|
}
|
|
9802
9949
|
|
|
9950
|
+
/**
|
|
9951
|
+
* Copies the values of the given texture to this instance.
|
|
9952
|
+
*
|
|
9953
|
+
* @param {Data3DTexture} source - The texture to copy.
|
|
9954
|
+
* @return {Data3DTexture} A reference to this instance.
|
|
9955
|
+
*/
|
|
9956
|
+
copy( source ) {
|
|
9957
|
+
|
|
9958
|
+
super.copy( source );
|
|
9959
|
+
|
|
9960
|
+
this.wrapR = source.wrapR;
|
|
9961
|
+
|
|
9962
|
+
return this;
|
|
9963
|
+
|
|
9964
|
+
}
|
|
9965
|
+
|
|
9803
9966
|
}
|
|
9804
9967
|
|
|
9805
9968
|
/**
|
|
@@ -10074,7 +10237,7 @@ class Matrix4 {
|
|
|
10074
10237
|
}
|
|
10075
10238
|
|
|
10076
10239
|
/**
|
|
10077
|
-
* Extracts the basis of this matrix into the three
|
|
10240
|
+
* Extracts the basis vectors of this matrix into the three vectors provided.
|
|
10078
10241
|
*
|
|
10079
10242
|
* @param {Vector3} xAxis - The basis's x axis.
|
|
10080
10243
|
* @param {Vector3} yAxis - The basis's y axis.
|
|
@@ -10466,8 +10629,6 @@ class Matrix4 {
|
|
|
10466
10629
|
/**
|
|
10467
10630
|
* Computes and returns the determinant of this matrix.
|
|
10468
10631
|
*
|
|
10469
|
-
* Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).
|
|
10470
|
-
*
|
|
10471
10632
|
* @return {number} The determinant.
|
|
10472
10633
|
*/
|
|
10473
10634
|
determinant() {
|
|
@@ -10633,7 +10794,7 @@ class Matrix4 {
|
|
|
10633
10794
|
}
|
|
10634
10795
|
|
|
10635
10796
|
/**
|
|
10636
|
-
*
|
|
10797
|
+
* Scales each of the first three columns of this matrix by the corresponding component of the given vector.
|
|
10637
10798
|
*
|
|
10638
10799
|
* @param {Vector3} v - The scale vector.
|
|
10639
10800
|
* @return {Matrix4} A reference to this matrix.
|
|
@@ -10783,17 +10944,12 @@ class Matrix4 {
|
|
|
10783
10944
|
* Sets this matrix as a rotational transformation around the given axis by
|
|
10784
10945
|
* the given angle.
|
|
10785
10946
|
*
|
|
10786
|
-
* This is a somewhat controversial but mathematically sound alternative to
|
|
10787
|
-
* rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).
|
|
10788
|
-
*
|
|
10789
10947
|
* @param {Vector3} axis - The normalized rotation axis.
|
|
10790
10948
|
* @param {number} angle - The rotation in radians.
|
|
10791
10949
|
* @return {Matrix4} A reference to this matrix.
|
|
10792
10950
|
*/
|
|
10793
10951
|
makeRotationAxis( axis, angle ) {
|
|
10794
10952
|
|
|
10795
|
-
// Based on http://www.gamedev.net/reference/articles/article1199.asp
|
|
10796
|
-
|
|
10797
10953
|
const c = Math.cos( angle );
|
|
10798
10954
|
const s = Math.sin( angle );
|
|
10799
10955
|
const t = 1 - c;
|
|
@@ -13464,6 +13620,17 @@ class Object3D extends EventDispatcher {
|
|
|
13464
13620
|
*/
|
|
13465
13621
|
raycast( /* raycaster, intersects */ ) {}
|
|
13466
13622
|
|
|
13623
|
+
/**
|
|
13624
|
+
* Abstract method to test whether this 3D object intersects the given frustum.
|
|
13625
|
+
* Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points}
|
|
13626
|
+
* implement this method in order to use frustum culling.
|
|
13627
|
+
*
|
|
13628
|
+
* @abstract
|
|
13629
|
+
* @param {Frustum|FrustumArray} frustum - The frustum to test.
|
|
13630
|
+
* @return {boolean|undefined} Whether this 3D object intersects the given frustum or not.
|
|
13631
|
+
*/
|
|
13632
|
+
intersectsFrustum( /* frustum */ ) {}
|
|
13633
|
+
|
|
13467
13634
|
/**
|
|
13468
13635
|
* Executes the callback on this 3D object and all descendants.
|
|
13469
13636
|
*
|
|
@@ -13713,20 +13880,18 @@ class Object3D extends EventDispatcher {
|
|
|
13713
13880
|
object.uuid = this.uuid;
|
|
13714
13881
|
object.type = this.type;
|
|
13715
13882
|
|
|
13883
|
+
object.name = this.name;
|
|
13884
|
+
object.castShadow = this.castShadow;
|
|
13885
|
+
object.receiveShadow = this.receiveShadow;
|
|
13886
|
+
object.visible = this.visible;
|
|
13887
|
+
object.frustumCulled = this.frustumCulled;
|
|
13888
|
+
object.renderOrder = this.renderOrder;
|
|
13889
|
+
object.static = this.static;
|
|
13890
|
+
object.matrixAutoUpdate = this.matrixAutoUpdate;
|
|
13716
13891
|
// WITH_GENESYS
|
|
13717
13892
|
object.nodeId = this.nodeId;
|
|
13718
|
-
// !WITH_GENESYS
|
|
13719
|
-
|
|
13720
|
-
if ( this.name !== '' ) object.name = this.name;
|
|
13721
|
-
if ( this.castShadow === true ) object.castShadow = true;
|
|
13722
|
-
if ( this.receiveShadow === true ) object.receiveShadow = true;
|
|
13723
|
-
if ( this.visible === false ) object.visible = false;
|
|
13724
|
-
// WITH_GENESYS
|
|
13725
13893
|
if ( this.selfHidden === true ) object.selfHidden = true;
|
|
13726
13894
|
// !WITH_GENESYS
|
|
13727
|
-
if ( this.frustumCulled === false ) object.frustumCulled = false;
|
|
13728
|
-
if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;
|
|
13729
|
-
if ( this.static !== false ) object.static = this.static;
|
|
13730
13895
|
if ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData;
|
|
13731
13896
|
|
|
13732
13897
|
object.layers = this.layers.mask;
|
|
@@ -13735,8 +13900,6 @@ class Object3D extends EventDispatcher {
|
|
|
13735
13900
|
|
|
13736
13901
|
if ( this.pivot !== null ) object.pivot = this.pivot.toArray();
|
|
13737
13902
|
|
|
13738
|
-
if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
|
|
13739
|
-
|
|
13740
13903
|
if ( this.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, this.morphTargetDictionary );
|
|
13741
13904
|
if ( this.morphTargetInfluences !== undefined ) object.morphTargetInfluences = this.morphTargetInfluences.slice();
|
|
13742
13905
|
|
|
@@ -14058,6 +14221,27 @@ class Object3D extends EventDispatcher {
|
|
|
14058
14221
|
|
|
14059
14222
|
}
|
|
14060
14223
|
|
|
14224
|
+
/**
|
|
14225
|
+
* Frees the GPU-related resources allocated by this instance. Call this
|
|
14226
|
+
* method whenever this instance is no longer used in your app.
|
|
14227
|
+
*
|
|
14228
|
+
* Geometries, materials and textures are potentially shared with other
|
|
14229
|
+
* 3D objects and must be disposed of separately.
|
|
14230
|
+
*
|
|
14231
|
+
* @fires Object3D#dispose
|
|
14232
|
+
*/
|
|
14233
|
+
dispose() {
|
|
14234
|
+
|
|
14235
|
+
/**
|
|
14236
|
+
* Fires when the 3D object has been disposed of.
|
|
14237
|
+
*
|
|
14238
|
+
* @event Object3D#dispose
|
|
14239
|
+
* @type {Object}
|
|
14240
|
+
*/
|
|
14241
|
+
this.dispatchEvent( { type: 'dispose' } );
|
|
14242
|
+
|
|
14243
|
+
}
|
|
14244
|
+
|
|
14061
14245
|
}
|
|
14062
14246
|
|
|
14063
14247
|
/**
|
|
@@ -15850,11 +16034,11 @@ class Scene extends Object3D {
|
|
|
15850
16034
|
|
|
15851
16035
|
if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
|
|
15852
16036
|
|
|
15853
|
-
|
|
15854
|
-
|
|
16037
|
+
data.object.backgroundBlurriness = this.backgroundBlurriness;
|
|
16038
|
+
data.object.backgroundIntensity = this.backgroundIntensity;
|
|
15855
16039
|
data.object.backgroundRotation = this.backgroundRotation.toArray();
|
|
15856
16040
|
|
|
15857
|
-
|
|
16041
|
+
data.object.environmentIntensity = this.environmentIntensity;
|
|
15858
16042
|
data.object.environmentRotation = this.environmentRotation.toArray();
|
|
15859
16043
|
|
|
15860
16044
|
return data;
|
|
@@ -15955,8 +16139,6 @@ class Triangle {
|
|
|
15955
16139
|
*/
|
|
15956
16140
|
static getBarycoord( point, a, b, c, target ) {
|
|
15957
16141
|
|
|
15958
|
-
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
|
|
15959
|
-
|
|
15960
16142
|
_v0$2.subVectors( c, a );
|
|
15961
16143
|
_v1$5.subVectors( b, a );
|
|
15962
16144
|
_v2$4.subVectors( point, a );
|
|
@@ -18079,8 +18261,9 @@ class BufferAttribute extends EventDispatcher {
|
|
|
18079
18261
|
normalized: this.normalized
|
|
18080
18262
|
};
|
|
18081
18263
|
|
|
18082
|
-
|
|
18083
|
-
|
|
18264
|
+
data.name = this.name;
|
|
18265
|
+
data.usage = this.usage;
|
|
18266
|
+
data.gpuType = this.gpuType;
|
|
18084
18267
|
|
|
18085
18268
|
return data;
|
|
18086
18269
|
|
|
@@ -20096,7 +20279,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20096
20279
|
|
|
20097
20280
|
data.uuid = this.uuid;
|
|
20098
20281
|
data.type = ( this.parameters !== undefined && this._transformed === true ) ? 'BufferGeometry' : this.type;
|
|
20099
|
-
|
|
20282
|
+
data.name = this.name;
|
|
20100
20283
|
if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;
|
|
20101
20284
|
|
|
20102
20285
|
if ( this.parameters !== undefined && this._transformed !== true ) {
|
|
@@ -20608,13 +20791,17 @@ class InterleavedBuffer {
|
|
|
20608
20791
|
|
|
20609
20792
|
//
|
|
20610
20793
|
|
|
20611
|
-
|
|
20794
|
+
const json = {
|
|
20612
20795
|
uuid: this.uuid,
|
|
20613
20796
|
buffer: this.array.buffer._uuid,
|
|
20614
20797
|
type: this.array.constructor.name,
|
|
20615
20798
|
stride: this.stride
|
|
20616
20799
|
};
|
|
20617
20800
|
|
|
20801
|
+
json.usage = this.usage;
|
|
20802
|
+
|
|
20803
|
+
return json;
|
|
20804
|
+
|
|
20618
20805
|
}
|
|
20619
20806
|
|
|
20620
20807
|
}
|
|
@@ -21161,6 +21348,399 @@ class InterleavedBufferAttribute {
|
|
|
21161
21348
|
|
|
21162
21349
|
}
|
|
21163
21350
|
|
|
21351
|
+
const _vector1 = /*@__PURE__*/ new Vector3();
|
|
21352
|
+
const _vector2 = /*@__PURE__*/ new Vector3();
|
|
21353
|
+
const _normalMatrix = /*@__PURE__*/ new Matrix3();
|
|
21354
|
+
|
|
21355
|
+
/**
|
|
21356
|
+
* A two dimensional surface that extends infinitely in 3D space, represented
|
|
21357
|
+
* in [Hessian normal form](https://mathworld.wolfram.com/HessianNormalForm.html)
|
|
21358
|
+
* by a unit length normal vector and a constant.
|
|
21359
|
+
*/
|
|
21360
|
+
class Plane {
|
|
21361
|
+
|
|
21362
|
+
/**
|
|
21363
|
+
* Constructs a new plane.
|
|
21364
|
+
*
|
|
21365
|
+
* @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane.
|
|
21366
|
+
* @param {number} [constant=0] - The signed distance from the origin to the plane.
|
|
21367
|
+
*/
|
|
21368
|
+
constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {
|
|
21369
|
+
|
|
21370
|
+
/**
|
|
21371
|
+
* This flag can be used for type testing.
|
|
21372
|
+
*
|
|
21373
|
+
* @type {boolean}
|
|
21374
|
+
* @readonly
|
|
21375
|
+
* @default true
|
|
21376
|
+
*/
|
|
21377
|
+
this.isPlane = true;
|
|
21378
|
+
|
|
21379
|
+
/**
|
|
21380
|
+
* A unit length vector defining the normal of the plane.
|
|
21381
|
+
*
|
|
21382
|
+
* @type {Vector3}
|
|
21383
|
+
*/
|
|
21384
|
+
this.normal = normal;
|
|
21385
|
+
|
|
21386
|
+
/**
|
|
21387
|
+
* The signed distance from the origin to the plane.
|
|
21388
|
+
*
|
|
21389
|
+
* @type {number}
|
|
21390
|
+
* @default 0
|
|
21391
|
+
*/
|
|
21392
|
+
this.constant = constant;
|
|
21393
|
+
|
|
21394
|
+
}
|
|
21395
|
+
|
|
21396
|
+
/**
|
|
21397
|
+
* Sets the plane components by copying the given values.
|
|
21398
|
+
*
|
|
21399
|
+
* @param {Vector3} normal - The normal.
|
|
21400
|
+
* @param {number} constant - The constant.
|
|
21401
|
+
* @return {Plane} A reference to this plane.
|
|
21402
|
+
*/
|
|
21403
|
+
set( normal, constant ) {
|
|
21404
|
+
|
|
21405
|
+
this.normal.copy( normal );
|
|
21406
|
+
this.constant = constant;
|
|
21407
|
+
|
|
21408
|
+
return this;
|
|
21409
|
+
|
|
21410
|
+
}
|
|
21411
|
+
|
|
21412
|
+
/**
|
|
21413
|
+
* Sets the plane components by defining `x`, `y`, `z` as the
|
|
21414
|
+
* plane normal and `w` as the constant.
|
|
21415
|
+
*
|
|
21416
|
+
* @param {number} x - The value for the normal's x component.
|
|
21417
|
+
* @param {number} y - The value for the normal's y component.
|
|
21418
|
+
* @param {number} z - The value for the normal's z component.
|
|
21419
|
+
* @param {number} w - The constant value.
|
|
21420
|
+
* @return {Plane} A reference to this plane.
|
|
21421
|
+
*/
|
|
21422
|
+
setComponents( x, y, z, w ) {
|
|
21423
|
+
|
|
21424
|
+
this.normal.set( x, y, z );
|
|
21425
|
+
this.constant = w;
|
|
21426
|
+
|
|
21427
|
+
return this;
|
|
21428
|
+
|
|
21429
|
+
}
|
|
21430
|
+
|
|
21431
|
+
/**
|
|
21432
|
+
* Sets the plane from the given normal and coplanar point (that is a point
|
|
21433
|
+
* that lies onto the plane).
|
|
21434
|
+
*
|
|
21435
|
+
* @param {Vector3} normal - The normal.
|
|
21436
|
+
* @param {Vector3} point - A coplanar point.
|
|
21437
|
+
* @return {Plane} A reference to this plane.
|
|
21438
|
+
*/
|
|
21439
|
+
setFromNormalAndCoplanarPoint( normal, point ) {
|
|
21440
|
+
|
|
21441
|
+
this.normal.copy( normal );
|
|
21442
|
+
this.constant = - point.dot( this.normal );
|
|
21443
|
+
|
|
21444
|
+
return this;
|
|
21445
|
+
|
|
21446
|
+
}
|
|
21447
|
+
|
|
21448
|
+
/**
|
|
21449
|
+
* Sets the plane from three coplanar points. The winding order is
|
|
21450
|
+
* assumed to be counter-clockwise, and determines the direction of
|
|
21451
|
+
* the plane normal.
|
|
21452
|
+
*
|
|
21453
|
+
* @param {Vector3} a - The first coplanar point.
|
|
21454
|
+
* @param {Vector3} b - The second coplanar point.
|
|
21455
|
+
* @param {Vector3} c - The third coplanar point.
|
|
21456
|
+
* @return {Plane} A reference to this plane.
|
|
21457
|
+
*/
|
|
21458
|
+
setFromCoplanarPoints( a, b, c ) {
|
|
21459
|
+
|
|
21460
|
+
const normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();
|
|
21461
|
+
|
|
21462
|
+
// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
|
|
21463
|
+
|
|
21464
|
+
this.setFromNormalAndCoplanarPoint( normal, a );
|
|
21465
|
+
|
|
21466
|
+
return this;
|
|
21467
|
+
|
|
21468
|
+
}
|
|
21469
|
+
|
|
21470
|
+
/**
|
|
21471
|
+
* Copies the values of the given plane to this instance.
|
|
21472
|
+
*
|
|
21473
|
+
* @param {Plane} plane - The plane to copy.
|
|
21474
|
+
* @return {Plane} A reference to this plane.
|
|
21475
|
+
*/
|
|
21476
|
+
copy( plane ) {
|
|
21477
|
+
|
|
21478
|
+
this.normal.copy( plane.normal );
|
|
21479
|
+
this.constant = plane.constant;
|
|
21480
|
+
|
|
21481
|
+
return this;
|
|
21482
|
+
|
|
21483
|
+
}
|
|
21484
|
+
|
|
21485
|
+
/**
|
|
21486
|
+
* Normalizes the plane normal and adjusts the constant accordingly.
|
|
21487
|
+
*
|
|
21488
|
+
* @return {Plane} A reference to this plane.
|
|
21489
|
+
*/
|
|
21490
|
+
normalize() {
|
|
21491
|
+
|
|
21492
|
+
// Note: will lead to a divide by zero if the plane is invalid.
|
|
21493
|
+
|
|
21494
|
+
const inverseNormalLength = 1.0 / this.normal.length();
|
|
21495
|
+
this.normal.multiplyScalar( inverseNormalLength );
|
|
21496
|
+
this.constant *= inverseNormalLength;
|
|
21497
|
+
|
|
21498
|
+
return this;
|
|
21499
|
+
|
|
21500
|
+
}
|
|
21501
|
+
|
|
21502
|
+
/**
|
|
21503
|
+
* Negates both the plane normal and the constant.
|
|
21504
|
+
*
|
|
21505
|
+
* @return {Plane} A reference to this plane.
|
|
21506
|
+
*/
|
|
21507
|
+
negate() {
|
|
21508
|
+
|
|
21509
|
+
this.constant *= -1;
|
|
21510
|
+
this.normal.negate();
|
|
21511
|
+
|
|
21512
|
+
return this;
|
|
21513
|
+
|
|
21514
|
+
}
|
|
21515
|
+
|
|
21516
|
+
/**
|
|
21517
|
+
* Returns the signed distance from the given point to this plane.
|
|
21518
|
+
*
|
|
21519
|
+
* @param {Vector3} point - The point to compute the distance for.
|
|
21520
|
+
* @return {number} The signed distance.
|
|
21521
|
+
*/
|
|
21522
|
+
distanceToPoint( point ) {
|
|
21523
|
+
|
|
21524
|
+
return this.normal.dot( point ) + this.constant;
|
|
21525
|
+
|
|
21526
|
+
}
|
|
21527
|
+
|
|
21528
|
+
/**
|
|
21529
|
+
* Returns the signed distance from the given sphere to this plane.
|
|
21530
|
+
*
|
|
21531
|
+
* @param {Sphere} sphere - The sphere to compute the distance for.
|
|
21532
|
+
* @return {number} The signed distance.
|
|
21533
|
+
*/
|
|
21534
|
+
distanceToSphere( sphere ) {
|
|
21535
|
+
|
|
21536
|
+
return this.distanceToPoint( sphere.center ) - sphere.radius;
|
|
21537
|
+
|
|
21538
|
+
}
|
|
21539
|
+
|
|
21540
|
+
/**
|
|
21541
|
+
* Projects a the given point onto the plane.
|
|
21542
|
+
*
|
|
21543
|
+
* @param {Vector3} point - The point to project.
|
|
21544
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
21545
|
+
* @return {Vector3} The projected point on the plane.
|
|
21546
|
+
*/
|
|
21547
|
+
projectPoint( point, target ) {
|
|
21548
|
+
|
|
21549
|
+
return target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );
|
|
21550
|
+
|
|
21551
|
+
}
|
|
21552
|
+
|
|
21553
|
+
/**
|
|
21554
|
+
* Returns the intersection point of the passed line and the plane. Returns
|
|
21555
|
+
* `null` if the line does not intersect. Returns the line's starting point if
|
|
21556
|
+
* the line is coplanar with the plane.
|
|
21557
|
+
*
|
|
21558
|
+
* @param {Line3} line - The line to compute the intersection for.
|
|
21559
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
21560
|
+
* @param {boolean} [clampToLine=true] - Whether to clamp the intersection to the line segment.
|
|
21561
|
+
* @return {?Vector3} The intersection point. Returns `null` if no intersection is detected.
|
|
21562
|
+
*/
|
|
21563
|
+
intersectLine( line, target, clampToLine = true ) {
|
|
21564
|
+
|
|
21565
|
+
const direction = line.delta( _vector1 );
|
|
21566
|
+
|
|
21567
|
+
const denominator = this.normal.dot( direction );
|
|
21568
|
+
|
|
21569
|
+
if ( denominator === 0 ) {
|
|
21570
|
+
|
|
21571
|
+
// line is coplanar, return origin
|
|
21572
|
+
if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
21573
|
+
|
|
21574
|
+
return target.copy( line.start );
|
|
21575
|
+
|
|
21576
|
+
}
|
|
21577
|
+
|
|
21578
|
+
// Unsure if this is the correct method to handle this case.
|
|
21579
|
+
return null;
|
|
21580
|
+
|
|
21581
|
+
}
|
|
21582
|
+
|
|
21583
|
+
const t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;
|
|
21584
|
+
|
|
21585
|
+
if ( ( clampToLine === true ) && ( t < 0 || t > 1 ) ) {
|
|
21586
|
+
|
|
21587
|
+
return null;
|
|
21588
|
+
|
|
21589
|
+
}
|
|
21590
|
+
|
|
21591
|
+
return target.copy( line.start ).addScaledVector( direction, t );
|
|
21592
|
+
|
|
21593
|
+
}
|
|
21594
|
+
|
|
21595
|
+
/**
|
|
21596
|
+
* Returns `true` if the given line segment intersects with (passes through) the plane.
|
|
21597
|
+
*
|
|
21598
|
+
* @param {Line3} line - The line to test.
|
|
21599
|
+
* @return {boolean} Whether the given line segment intersects with the plane or not.
|
|
21600
|
+
*/
|
|
21601
|
+
intersectsLine( line ) {
|
|
21602
|
+
|
|
21603
|
+
// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.
|
|
21604
|
+
|
|
21605
|
+
const startSign = this.distanceToPoint( line.start );
|
|
21606
|
+
const endSign = this.distanceToPoint( line.end );
|
|
21607
|
+
|
|
21608
|
+
return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );
|
|
21609
|
+
|
|
21610
|
+
}
|
|
21611
|
+
|
|
21612
|
+
/**
|
|
21613
|
+
* Returns `true` if the given bounding box intersects with the plane.
|
|
21614
|
+
*
|
|
21615
|
+
* @param {Box3} box - The bounding box to test.
|
|
21616
|
+
* @return {boolean} Whether the given bounding box intersects with the plane or not.
|
|
21617
|
+
*/
|
|
21618
|
+
intersectsBox( box ) {
|
|
21619
|
+
|
|
21620
|
+
return box.intersectsPlane( this );
|
|
21621
|
+
|
|
21622
|
+
}
|
|
21623
|
+
|
|
21624
|
+
/**
|
|
21625
|
+
* Returns `true` if the given bounding sphere intersects with the plane.
|
|
21626
|
+
*
|
|
21627
|
+
* @param {Sphere} sphere - The bounding sphere to test.
|
|
21628
|
+
* @return {boolean} Whether the given bounding sphere intersects with the plane or not.
|
|
21629
|
+
*/
|
|
21630
|
+
intersectsSphere( sphere ) {
|
|
21631
|
+
|
|
21632
|
+
return sphere.intersectsPlane( this );
|
|
21633
|
+
|
|
21634
|
+
}
|
|
21635
|
+
|
|
21636
|
+
/**
|
|
21637
|
+
* Returns a coplanar vector to the plane, by calculating the
|
|
21638
|
+
* projection of the normal at the origin onto the plane.
|
|
21639
|
+
*
|
|
21640
|
+
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
21641
|
+
* @return {Vector3} The coplanar point.
|
|
21642
|
+
*/
|
|
21643
|
+
coplanarPoint( target ) {
|
|
21644
|
+
|
|
21645
|
+
return target.copy( this.normal ).multiplyScalar( - this.constant );
|
|
21646
|
+
|
|
21647
|
+
}
|
|
21648
|
+
|
|
21649
|
+
/**
|
|
21650
|
+
* Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform.
|
|
21651
|
+
*
|
|
21652
|
+
* The optional normal matrix can be pre-computed like so:
|
|
21653
|
+
* ```js
|
|
21654
|
+
* const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
|
|
21655
|
+
* ```
|
|
21656
|
+
*
|
|
21657
|
+
* @param {Matrix4} matrix - The transformation matrix.
|
|
21658
|
+
* @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix.
|
|
21659
|
+
* @return {Plane} A reference to this plane.
|
|
21660
|
+
*/
|
|
21661
|
+
applyMatrix4( matrix, optionalNormalMatrix ) {
|
|
21662
|
+
|
|
21663
|
+
const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );
|
|
21664
|
+
|
|
21665
|
+
const referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );
|
|
21666
|
+
|
|
21667
|
+
const normal = this.normal.applyMatrix3( normalMatrix ).normalize();
|
|
21668
|
+
|
|
21669
|
+
this.constant = - referencePoint.dot( normal );
|
|
21670
|
+
|
|
21671
|
+
return this;
|
|
21672
|
+
|
|
21673
|
+
}
|
|
21674
|
+
|
|
21675
|
+
/**
|
|
21676
|
+
* Translates the plane by the distance defined by the given offset vector.
|
|
21677
|
+
* Note that this only affects the plane constant and will not affect the normal vector.
|
|
21678
|
+
*
|
|
21679
|
+
* @param {Vector3} offset - The offset vector.
|
|
21680
|
+
* @return {Plane} A reference to this plane.
|
|
21681
|
+
*/
|
|
21682
|
+
translate( offset ) {
|
|
21683
|
+
|
|
21684
|
+
this.constant -= offset.dot( this.normal );
|
|
21685
|
+
|
|
21686
|
+
return this;
|
|
21687
|
+
|
|
21688
|
+
}
|
|
21689
|
+
|
|
21690
|
+
/**
|
|
21691
|
+
* Returns `true` if this plane is equal with the given one.
|
|
21692
|
+
*
|
|
21693
|
+
* @param {Plane} plane - The plane to test for equality.
|
|
21694
|
+
* @return {boolean} Whether this plane is equal with the given one.
|
|
21695
|
+
*/
|
|
21696
|
+
equals( plane ) {
|
|
21697
|
+
|
|
21698
|
+
return plane.normal.equals( this.normal ) && ( plane.constant === this.constant );
|
|
21699
|
+
|
|
21700
|
+
}
|
|
21701
|
+
|
|
21702
|
+
/**
|
|
21703
|
+
* Returns a new plane with copied values from this instance.
|
|
21704
|
+
*
|
|
21705
|
+
* @return {Plane} A clone of this instance.
|
|
21706
|
+
*/
|
|
21707
|
+
clone() {
|
|
21708
|
+
|
|
21709
|
+
return new this.constructor().copy( this );
|
|
21710
|
+
|
|
21711
|
+
}
|
|
21712
|
+
|
|
21713
|
+
/**
|
|
21714
|
+
* Returns a serialized structure of the plane.
|
|
21715
|
+
*
|
|
21716
|
+
* @return {Object} Serialized structure with fields representing the object state.
|
|
21717
|
+
*/
|
|
21718
|
+
toJSON() {
|
|
21719
|
+
|
|
21720
|
+
return {
|
|
21721
|
+
normal: this.normal.toArray(),
|
|
21722
|
+
constant: this.constant
|
|
21723
|
+
};
|
|
21724
|
+
|
|
21725
|
+
}
|
|
21726
|
+
|
|
21727
|
+
/**
|
|
21728
|
+
* Sets the plane properties from the given JSON.
|
|
21729
|
+
*
|
|
21730
|
+
* @param {Object} json - The serialized json to set the plane from.
|
|
21731
|
+
* @return {Plane} A reference to this plane.
|
|
21732
|
+
*/
|
|
21733
|
+
fromJSON( json ) {
|
|
21734
|
+
|
|
21735
|
+
this.normal.fromArray( json.normal );
|
|
21736
|
+
this.constant = json.constant;
|
|
21737
|
+
|
|
21738
|
+
return this;
|
|
21739
|
+
|
|
21740
|
+
}
|
|
21741
|
+
|
|
21742
|
+
}
|
|
21743
|
+
|
|
21164
21744
|
let _materialId = 0;
|
|
21165
21745
|
|
|
21166
21746
|
/**
|
|
@@ -21784,10 +22364,61 @@ class Material extends EventDispatcher {
|
|
|
21784
22364
|
};
|
|
21785
22365
|
|
|
21786
22366
|
// standard Material serialization
|
|
22367
|
+
|
|
21787
22368
|
data.uuid = this.uuid;
|
|
21788
22369
|
data.type = this.type;
|
|
21789
22370
|
|
|
21790
|
-
|
|
22371
|
+
data.blending = this.blending;
|
|
22372
|
+
data.side = this.side;
|
|
22373
|
+
data.shadowSide = this.shadowSide;
|
|
22374
|
+
data.vertexColors = this.vertexColors;
|
|
22375
|
+
|
|
22376
|
+
data.opacity = this.opacity;
|
|
22377
|
+
data.transparent = this.transparent;
|
|
22378
|
+
|
|
22379
|
+
data.blendSrc = this.blendSrc;
|
|
22380
|
+
data.blendDst = this.blendDst;
|
|
22381
|
+
data.blendEquation = this.blendEquation;
|
|
22382
|
+
data.blendSrcAlpha = this.blendSrcAlpha;
|
|
22383
|
+
data.blendDstAlpha = this.blendDstAlpha;
|
|
22384
|
+
data.blendEquationAlpha = this.blendEquationAlpha;
|
|
22385
|
+
data.blendColor = this.blendColor.getHex();
|
|
22386
|
+
data.blendAlpha = this.blendAlpha;
|
|
22387
|
+
|
|
22388
|
+
data.depthFunc = this.depthFunc;
|
|
22389
|
+
data.depthTest = this.depthTest;
|
|
22390
|
+
data.depthWrite = this.depthWrite;
|
|
22391
|
+
data.colorWrite = this.colorWrite;
|
|
22392
|
+
|
|
22393
|
+
data.clipIntersection = this.clipIntersection;
|
|
22394
|
+
data.clipShadows = this.clipShadows;
|
|
22395
|
+
|
|
22396
|
+
data.stencilWriteMask = this.stencilWriteMask;
|
|
22397
|
+
data.stencilFunc = this.stencilFunc;
|
|
22398
|
+
data.stencilRef = this.stencilRef;
|
|
22399
|
+
data.stencilFuncMask = this.stencilFuncMask;
|
|
22400
|
+
data.stencilFail = this.stencilFail;
|
|
22401
|
+
data.stencilZFail = this.stencilZFail;
|
|
22402
|
+
data.stencilZPass = this.stencilZPass;
|
|
22403
|
+
data.stencilWrite = this.stencilWrite;
|
|
22404
|
+
|
|
22405
|
+
data.polygonOffset = this.polygonOffset;
|
|
22406
|
+
data.polygonOffsetFactor = this.polygonOffsetFactor;
|
|
22407
|
+
data.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
22408
|
+
|
|
22409
|
+
data.dithering = this.dithering;
|
|
22410
|
+
|
|
22411
|
+
data.alphaTest = this.alphaTest;
|
|
22412
|
+
data.alphaHash = this.alphaHash;
|
|
22413
|
+
data.alphaToCoverage = this.alphaToCoverage;
|
|
22414
|
+
data.premultipliedAlpha = this.premultipliedAlpha;
|
|
22415
|
+
data.forceSinglePass = this.forceSinglePass;
|
|
22416
|
+
data.allowOverride = this.allowOverride;
|
|
22417
|
+
|
|
22418
|
+
data.visible = this.visible;
|
|
22419
|
+
data.toneMapped = this.toneMapped;
|
|
22420
|
+
|
|
22421
|
+
data.name = this.name;
|
|
21791
22422
|
|
|
21792
22423
|
if ( this.color && this.color.isColor ) data.color = this.color.getHex();
|
|
21793
22424
|
|
|
@@ -21798,7 +22429,7 @@ class Material extends EventDispatcher {
|
|
|
21798
22429
|
if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();
|
|
21799
22430
|
if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;
|
|
21800
22431
|
if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();
|
|
21801
|
-
if ( this.emissiveIntensity !== undefined
|
|
22432
|
+
if ( this.emissiveIntensity !== undefined ) data.emissiveIntensity = this.emissiveIntensity;
|
|
21802
22433
|
|
|
21803
22434
|
if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();
|
|
21804
22435
|
if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;
|
|
@@ -21839,6 +22470,7 @@ class Material extends EventDispatcher {
|
|
|
21839
22470
|
}
|
|
21840
22471
|
|
|
21841
22472
|
if ( this.dispersion !== undefined ) data.dispersion = this.dispersion;
|
|
22473
|
+
if ( this.retroreflectivity !== undefined ) data.retroreflectivity = this.retroreflectivity;
|
|
21842
22474
|
|
|
21843
22475
|
if ( this.iridescence !== undefined ) data.iridescence = this.iridescence;
|
|
21844
22476
|
if ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;
|
|
@@ -21937,76 +22569,39 @@ class Material extends EventDispatcher {
|
|
|
21937
22569
|
if ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;
|
|
21938
22570
|
if ( this.thickness !== undefined ) data.thickness = this.thickness;
|
|
21939
22571
|
if ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;
|
|
21940
|
-
if ( this.attenuationDistance !== undefined
|
|
22572
|
+
if ( this.attenuationDistance !== undefined ) data.attenuationDistance = this.attenuationDistance;
|
|
21941
22573
|
if ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();
|
|
21942
22574
|
|
|
21943
22575
|
if ( this.size !== undefined ) data.size = this.size;
|
|
21944
|
-
if ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;
|
|
21945
22576
|
if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;
|
|
21946
22577
|
|
|
21947
|
-
if ( this.
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
if ( this.transparent === true ) data.transparent = true;
|
|
21953
|
-
|
|
21954
|
-
if ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;
|
|
21955
|
-
if ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;
|
|
21956
|
-
if ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;
|
|
21957
|
-
if ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;
|
|
21958
|
-
if ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;
|
|
21959
|
-
if ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;
|
|
21960
|
-
if ( this.blendColor && this.blendColor.isColor ) data.blendColor = this.blendColor.getHex();
|
|
21961
|
-
if ( this.blendAlpha !== 0 ) data.blendAlpha = this.blendAlpha;
|
|
21962
|
-
|
|
21963
|
-
if ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;
|
|
21964
|
-
if ( this.depthTest === false ) data.depthTest = this.depthTest;
|
|
21965
|
-
if ( this.depthWrite === false ) data.depthWrite = this.depthWrite;
|
|
21966
|
-
if ( this.colorWrite === false ) data.colorWrite = this.colorWrite;
|
|
21967
|
-
|
|
21968
|
-
if ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;
|
|
21969
|
-
if ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;
|
|
21970
|
-
if ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;
|
|
21971
|
-
if ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;
|
|
21972
|
-
if ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;
|
|
21973
|
-
if ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;
|
|
21974
|
-
if ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;
|
|
21975
|
-
if ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;
|
|
22578
|
+
if ( Array.isArray( this.clippingPlanes ) && this.clippingPlanes.length > 0 ) {
|
|
22579
|
+
|
|
22580
|
+
data.clippingPlanes = this.clippingPlanes.map( plane => plane.toJSON() );
|
|
22581
|
+
|
|
22582
|
+
}
|
|
21976
22583
|
|
|
21977
22584
|
// rotation (SpriteMaterial)
|
|
21978
|
-
if ( this.rotation !== undefined
|
|
22585
|
+
if ( this.rotation !== undefined ) data.rotation = this.rotation;
|
|
21979
22586
|
|
|
21980
|
-
|
|
21981
|
-
if ( this.
|
|
21982
|
-
if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;
|
|
22587
|
+
// depthPacking (MeshDepthMaterial)
|
|
22588
|
+
if ( this.depthPacking !== undefined ) data.depthPacking = this.depthPacking;
|
|
21983
22589
|
|
|
21984
|
-
if ( this.linewidth !== undefined
|
|
22590
|
+
if ( this.linewidth !== undefined ) data.linewidth = this.linewidth;
|
|
22591
|
+
if ( this.linecap !== undefined ) data.linecap = this.linecap;
|
|
22592
|
+
if ( this.linejoin !== undefined ) data.linejoin = this.linejoin;
|
|
21985
22593
|
if ( this.dashSize !== undefined ) data.dashSize = this.dashSize;
|
|
21986
22594
|
if ( this.gapSize !== undefined ) data.gapSize = this.gapSize;
|
|
21987
22595
|
if ( this.scale !== undefined ) data.scale = this.scale;
|
|
21988
22596
|
|
|
21989
|
-
if ( this.
|
|
21990
|
-
|
|
21991
|
-
if ( this.
|
|
21992
|
-
if ( this.
|
|
21993
|
-
if ( this.alphaToCoverage === true ) data.alphaToCoverage = true;
|
|
21994
|
-
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = true;
|
|
21995
|
-
if ( this.forceSinglePass === true ) data.forceSinglePass = true;
|
|
21996
|
-
if ( this.allowOverride === false ) data.allowOverride = false;
|
|
22597
|
+
if ( this.wireframe !== undefined ) data.wireframe = this.wireframe;
|
|
22598
|
+
if ( this.wireframeLinewidth !== undefined ) data.wireframeLinewidth = this.wireframeLinewidth;
|
|
22599
|
+
if ( this.wireframeLinecap !== undefined ) data.wireframeLinecap = this.wireframeLinecap;
|
|
22600
|
+
if ( this.wireframeLinejoin !== undefined ) data.wireframeLinejoin = this.wireframeLinejoin;
|
|
21997
22601
|
|
|
21998
|
-
if ( this.
|
|
21999
|
-
if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;
|
|
22000
|
-
if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;
|
|
22001
|
-
if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;
|
|
22602
|
+
if ( this.flatShading !== undefined ) data.flatShading = this.flatShading;
|
|
22002
22603
|
|
|
22003
|
-
if ( this.
|
|
22004
|
-
|
|
22005
|
-
if ( this.visible === false ) data.visible = false;
|
|
22006
|
-
|
|
22007
|
-
if ( this.toneMapped === false ) data.toneMapped = false;
|
|
22008
|
-
|
|
22009
|
-
if ( this.fog === false ) data.fog = false;
|
|
22604
|
+
if ( this.fog !== undefined ) data.fog = this.fog;
|
|
22010
22605
|
|
|
22011
22606
|
if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;
|
|
22012
22607
|
|
|
@@ -22067,6 +22662,7 @@ class Material extends EventDispatcher {
|
|
|
22067
22662
|
if ( json.clearcoat !== undefined ) this.clearcoat = json.clearcoat;
|
|
22068
22663
|
if ( json.clearcoatRoughness !== undefined ) this.clearcoatRoughness = json.clearcoatRoughness;
|
|
22069
22664
|
if ( json.dispersion !== undefined ) this.dispersion = json.dispersion;
|
|
22665
|
+
if ( json.retroreflectivity !== undefined ) this.retroreflectivity = json.retroreflectivity;
|
|
22070
22666
|
if ( json.iridescence !== undefined ) this.iridescence = json.iridescence;
|
|
22071
22667
|
if ( json.iridescenceIOR !== undefined ) this.iridescenceIOR = json.iridescenceIOR;
|
|
22072
22668
|
if ( json.iridescenceThicknessRange !== undefined ) this.iridescenceThicknessRange = json.iridescenceThicknessRange;
|
|
@@ -22090,6 +22686,10 @@ class Material extends EventDispatcher {
|
|
|
22090
22686
|
if ( json.depthTest !== undefined ) this.depthTest = json.depthTest;
|
|
22091
22687
|
if ( json.depthWrite !== undefined ) this.depthWrite = json.depthWrite;
|
|
22092
22688
|
if ( json.colorWrite !== undefined ) this.colorWrite = json.colorWrite;
|
|
22689
|
+
if ( json.clippingPlanes !== undefined ) this.clippingPlanes = json.clippingPlanes.map( plane => new Plane().fromJSON( plane ) );
|
|
22690
|
+
if ( json.clipIntersection !== undefined ) this.clipIntersection = json.clipIntersection;
|
|
22691
|
+
if ( json.clipShadows !== undefined ) this.clipShadows = json.clipShadows;
|
|
22692
|
+
if ( json.depthPacking !== undefined ) this.depthPacking = json.depthPacking;
|
|
22093
22693
|
if ( json.blendSrc !== undefined ) this.blendSrc = json.blendSrc;
|
|
22094
22694
|
if ( json.blendDst !== undefined ) this.blendDst = json.blendDst;
|
|
22095
22695
|
if ( json.blendEquation !== undefined ) this.blendEquation = json.blendEquation;
|
|
@@ -22115,6 +22715,8 @@ class Material extends EventDispatcher {
|
|
|
22115
22715
|
if ( json.rotation !== undefined ) this.rotation = json.rotation;
|
|
22116
22716
|
|
|
22117
22717
|
if ( json.linewidth !== undefined ) this.linewidth = json.linewidth;
|
|
22718
|
+
if ( json.linecap !== undefined ) this.linecap = json.linecap;
|
|
22719
|
+
if ( json.linejoin !== undefined ) this.linejoin = json.linejoin;
|
|
22118
22720
|
if ( json.dashSize !== undefined ) this.dashSize = json.dashSize;
|
|
22119
22721
|
if ( json.gapSize !== undefined ) this.gapSize = json.gapSize;
|
|
22120
22722
|
if ( json.scale !== undefined ) this.scale = json.scale;
|
|
@@ -22615,6 +23217,18 @@ class Sprite extends Object3D {
|
|
|
22615
23217
|
|
|
22616
23218
|
}
|
|
22617
23219
|
|
|
23220
|
+
/**
|
|
23221
|
+
* Returns `true` if this sprite intersects the given frustum.
|
|
23222
|
+
*
|
|
23223
|
+
* @param {Frustum|FrustumArray} frustum - The frustum to test.
|
|
23224
|
+
* @return {boolean} Whether this sprite intersects the given frustum or not.
|
|
23225
|
+
*/
|
|
23226
|
+
intersectsFrustum( frustum ) {
|
|
23227
|
+
|
|
23228
|
+
return frustum.intersectsSprite( this );
|
|
23229
|
+
|
|
23230
|
+
}
|
|
23231
|
+
|
|
22618
23232
|
/**
|
|
22619
23233
|
* Computes intersection points between a casted ray and this sprite.
|
|
22620
23234
|
*
|
|
@@ -23037,7 +23651,7 @@ class LOD extends Object3D {
|
|
|
23037
23651
|
|
|
23038
23652
|
const data = super.toJSON( meta );
|
|
23039
23653
|
|
|
23040
|
-
|
|
23654
|
+
data.object.autoUpdate = this.autoUpdate;
|
|
23041
23655
|
|
|
23042
23656
|
data.object.levels = [];
|
|
23043
23657
|
|
|
@@ -23066,10 +23680,6 @@ const _segCenter = /*@__PURE__*/ new Vector3();
|
|
|
23066
23680
|
const _segDir = /*@__PURE__*/ new Vector3();
|
|
23067
23681
|
const _diff = /*@__PURE__*/ new Vector3();
|
|
23068
23682
|
|
|
23069
|
-
const _edge1 = /*@__PURE__*/ new Vector3();
|
|
23070
|
-
const _edge2 = /*@__PURE__*/ new Vector3();
|
|
23071
|
-
const _normal$1 = /*@__PURE__*/ new Vector3();
|
|
23072
|
-
|
|
23073
23683
|
/**
|
|
23074
23684
|
* A ray that emits from an origin in a certain direction. The class is used by
|
|
23075
23685
|
* {@link Raycaster} to assist with raycasting. Raycasting is used for
|
|
@@ -23371,6 +23981,8 @@ class Ray {
|
|
|
23371
23981
|
*/
|
|
23372
23982
|
intersectSphere( sphere, target ) {
|
|
23373
23983
|
|
|
23984
|
+
if ( sphere.radius < 0 ) return null; // handle empty spheres, see #31187
|
|
23985
|
+
|
|
23374
23986
|
_vector$7.subVectors( sphere.center, this.origin );
|
|
23375
23987
|
const tca = _vector$7.dot( this.direction );
|
|
23376
23988
|
const d2 = _vector$7.dot( _vector$7 ) - tca * tca;
|
|
@@ -23600,76 +24212,128 @@ class Ray {
|
|
|
23600
24212
|
*/
|
|
23601
24213
|
intersectTriangle( a, b, c, backfaceCulling, target ) {
|
|
23602
24214
|
|
|
23603
|
-
//
|
|
24215
|
+
// Watertight ray/triangle intersection. Reference: Woop, Benthin, Wald,
|
|
24216
|
+
// "Watertight Ray/Triangle Intersection", JCGT vol. 2 no. 1 (2013), Appendix A.
|
|
24217
|
+
// https://jcgt.org/published/0002/01/05/
|
|
24218
|
+
|
|
24219
|
+
const origin = this.origin;
|
|
24220
|
+
const direction = this.direction;
|
|
24221
|
+
|
|
24222
|
+
const dx = direction.x;
|
|
24223
|
+
const dy = direction.y;
|
|
24224
|
+
const dz = direction.z;
|
|
24225
|
+
|
|
24226
|
+
// triangle vertices relative to the ray origin
|
|
24227
|
+
|
|
24228
|
+
const aox = a.x - origin.x, aoy = a.y - origin.y, aoz = a.z - origin.z;
|
|
24229
|
+
const box = b.x - origin.x, boy = b.y - origin.y, boz = b.z - origin.z;
|
|
24230
|
+
const cox = c.x - origin.x, coy = c.y - origin.y, coz = c.z - origin.z;
|
|
24231
|
+
|
|
24232
|
+
// Use the dimension where the ray direction is maximal as the projection
|
|
24233
|
+
// axis (kz) and read every component already permuted into (kx, ky, kz).
|
|
24234
|
+
// kx and ky are swapped when the direction's kz component is negative, to
|
|
24235
|
+
// preserve the winding order of triangles.
|
|
23604
24236
|
|
|
23605
|
-
|
|
24237
|
+
const adx = Math.abs( dx ), ady = Math.abs( dy ), adz = Math.abs( dz );
|
|
23606
24238
|
|
|
23607
|
-
|
|
23608
|
-
|
|
23609
|
-
_normal$1.crossVectors( _edge1, _edge2 );
|
|
24239
|
+
let dkx, dky, dkz;
|
|
24240
|
+
let akx, aky, akz, bkx, bky, bkz, ckx, cky, ckz;
|
|
23610
24241
|
|
|
23611
|
-
|
|
23612
|
-
// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by
|
|
23613
|
-
// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))
|
|
23614
|
-
// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))
|
|
23615
|
-
// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)
|
|
23616
|
-
let DdN = this.direction.dot( _normal$1 );
|
|
23617
|
-
let sign;
|
|
24242
|
+
if ( adx >= ady && adx >= adz ) {
|
|
23618
24243
|
|
|
23619
|
-
|
|
24244
|
+
dkz = dx; akz = aox; bkz = box; ckz = cox;
|
|
23620
24245
|
|
|
23621
|
-
if (
|
|
23622
|
-
sign = 1;
|
|
24246
|
+
if ( dx >= 0 ) {
|
|
23623
24247
|
|
|
23624
|
-
|
|
24248
|
+
dkx = dy; dky = dz;
|
|
24249
|
+
akx = aoy; aky = aoz; bkx = boy; bky = boz; ckx = coy; cky = coz;
|
|
23625
24250
|
|
|
23626
|
-
|
|
23627
|
-
|
|
24251
|
+
} else {
|
|
24252
|
+
|
|
24253
|
+
dkx = dz; dky = dy;
|
|
24254
|
+
akx = aoz; aky = aoy; bkx = boz; bky = boy; ckx = coz; cky = coy;
|
|
24255
|
+
|
|
24256
|
+
}
|
|
24257
|
+
|
|
24258
|
+
} else if ( ady >= adz ) {
|
|
24259
|
+
|
|
24260
|
+
dkz = dy; akz = aoy; bkz = boy; ckz = coy;
|
|
24261
|
+
|
|
24262
|
+
if ( dy >= 0 ) {
|
|
24263
|
+
|
|
24264
|
+
dkx = dz; dky = dx;
|
|
24265
|
+
akx = aoz; aky = aox; bkx = boz; bky = box; ckx = coz; cky = cox;
|
|
24266
|
+
|
|
24267
|
+
} else {
|
|
24268
|
+
|
|
24269
|
+
dkx = dx; dky = dz;
|
|
24270
|
+
akx = aox; aky = aoz; bkx = box; bky = boz; ckx = cox; cky = coz;
|
|
24271
|
+
|
|
24272
|
+
}
|
|
23628
24273
|
|
|
23629
24274
|
} else {
|
|
23630
24275
|
|
|
23631
|
-
|
|
24276
|
+
dkz = dz; akz = aoz; bkz = boz; ckz = coz;
|
|
23632
24277
|
|
|
23633
|
-
|
|
24278
|
+
if ( dz >= 0 ) {
|
|
23634
24279
|
|
|
23635
|
-
|
|
23636
|
-
|
|
24280
|
+
dkx = dx; dky = dy;
|
|
24281
|
+
akx = aox; aky = aoy; bkx = box; bky = boy; ckx = cox; cky = coy;
|
|
23637
24282
|
|
|
23638
|
-
|
|
23639
|
-
if ( DdQxE2 < 0 ) {
|
|
24283
|
+
} else {
|
|
23640
24284
|
|
|
23641
|
-
|
|
24285
|
+
dkx = dy; dky = dx;
|
|
24286
|
+
akx = aoy; aky = aox; bkx = boy; bky = box; ckx = coy; cky = cox;
|
|
24287
|
+
|
|
24288
|
+
}
|
|
23642
24289
|
|
|
23643
24290
|
}
|
|
23644
24291
|
|
|
23645
|
-
|
|
24292
|
+
// a zero direction has no maximal axis and cannot intersect
|
|
23646
24293
|
|
|
23647
|
-
|
|
23648
|
-
if ( DdE1xQ < 0 ) {
|
|
24294
|
+
if ( dkz === 0 ) return null;
|
|
23649
24295
|
|
|
23650
|
-
|
|
24296
|
+
// shear constants that align the ray with the +kz axis
|
|
23651
24297
|
|
|
23652
|
-
|
|
24298
|
+
const sx = dkx / dkz, sy = dky / dkz, sz = 1 / dkz;
|
|
23653
24299
|
|
|
23654
|
-
//
|
|
23655
|
-
if ( DdQxE2 + DdE1xQ > DdN ) {
|
|
24300
|
+
// sheared and scaled vertices
|
|
23656
24301
|
|
|
23657
|
-
|
|
24302
|
+
const ax = akx - sx * akz, ay = aky - sy * akz;
|
|
24303
|
+
const bx = bkx - sx * bkz, by = bky - sy * bkz;
|
|
24304
|
+
const cx = ckx - sx * ckz, cy = cky - sy * ckz;
|
|
23658
24305
|
|
|
23659
|
-
|
|
24306
|
+
// scaled barycentric coordinates (signed edge functions); the shear makes a
|
|
24307
|
+
// shared edge evaluate identically for both adjacent triangles, so the ray
|
|
24308
|
+
// can never fall between them
|
|
23660
24309
|
|
|
23661
|
-
|
|
23662
|
-
const
|
|
24310
|
+
const u = cx * by - cy * bx;
|
|
24311
|
+
const v = ax * cy - ay * cx;
|
|
24312
|
+
const w = bx * ay - by * ax;
|
|
23663
24313
|
|
|
23664
|
-
|
|
23665
|
-
if ( QdN < 0 ) {
|
|
24314
|
+
if ( backfaceCulling ) {
|
|
23666
24315
|
|
|
23667
|
-
return null;
|
|
24316
|
+
if ( u < 0 || v < 0 || w < 0 ) return null;
|
|
24317
|
+
|
|
24318
|
+
} else {
|
|
24319
|
+
|
|
24320
|
+
if ( ( u < 0 || v < 0 || w < 0 ) && ( u > 0 || v > 0 || w > 0 ) ) return null;
|
|
23668
24321
|
|
|
23669
24322
|
}
|
|
23670
24323
|
|
|
23671
|
-
|
|
23672
|
-
|
|
24324
|
+
const det = u + v + w;
|
|
24325
|
+
|
|
24326
|
+
// ray is co-planar with the triangle
|
|
24327
|
+
|
|
24328
|
+
if ( det === 0 ) return null;
|
|
24329
|
+
|
|
24330
|
+
// scaled hit distance; t = tScaled / det must lie in front of the origin
|
|
24331
|
+
|
|
24332
|
+
const tScaled = sz * ( u * akz + v * bkz + w * ckz );
|
|
24333
|
+
|
|
24334
|
+
if ( det > 0 ? tScaled < 0 : tScaled > 0 ) return null;
|
|
24335
|
+
|
|
24336
|
+
return this.at( tScaled / det, target );
|
|
23673
24337
|
|
|
23674
24338
|
}
|
|
23675
24339
|
|
|
@@ -24189,6 +24853,18 @@ class Mesh extends Object3D {
|
|
|
24189
24853
|
|
|
24190
24854
|
}
|
|
24191
24855
|
|
|
24856
|
+
/**
|
|
24857
|
+
* Returns `true` if this mesh intersects the given frustum.
|
|
24858
|
+
*
|
|
24859
|
+
* @param {Frustum|FrustumArray} frustum - The frustum to test.
|
|
24860
|
+
* @return {boolean} Whether this mesh intersects the given frustum or not.
|
|
24861
|
+
*/
|
|
24862
|
+
intersectsFrustum( frustum ) {
|
|
24863
|
+
|
|
24864
|
+
return frustum.intersectsObject( this );
|
|
24865
|
+
|
|
24866
|
+
}
|
|
24867
|
+
|
|
24192
24868
|
/**
|
|
24193
24869
|
* Computes intersection points between a casted ray and this line.
|
|
24194
24870
|
*
|
|
@@ -25555,594 +26231,230 @@ class InstancedMesh extends Mesh {
|
|
|
25555
26231
|
|
|
25556
26232
|
}
|
|
25557
26233
|
|
|
25558
|
-
copy( source, recursive ) {
|
|
25559
|
-
|
|
25560
|
-
super.copy( source, recursive );
|
|
25561
|
-
|
|
25562
|
-
this.instanceMatrix.copy( source.instanceMatrix );
|
|
25563
|
-
|
|
25564
|
-
if ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();
|
|
25565
|
-
if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
|
|
25566
|
-
|
|
25567
|
-
this.count = source.count;
|
|
25568
|
-
|
|
25569
|
-
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
25570
|
-
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
25571
|
-
|
|
25572
|
-
return this;
|
|
25573
|
-
|
|
25574
|
-
}
|
|
25575
|
-
|
|
25576
|
-
/**
|
|
25577
|
-
* Gets the color of the defined instance.
|
|
25578
|
-
*
|
|
25579
|
-
* @param {number} index - The instance index.
|
|
25580
|
-
* @param {Color} color - The target object that is used to store the method's result.
|
|
25581
|
-
* @return {Color} A reference to the target color.
|
|
25582
|
-
*/
|
|
25583
|
-
getColorAt( index, color ) {
|
|
25584
|
-
|
|
25585
|
-
if ( this.instanceColor === null ) {
|
|
25586
|
-
|
|
25587
|
-
return color.setRGB( 1, 1, 1 );
|
|
25588
|
-
|
|
25589
|
-
} else {
|
|
25590
|
-
|
|
25591
|
-
return color.fromArray( this.instanceColor.array, index * 3 );
|
|
25592
|
-
|
|
25593
|
-
}
|
|
25594
|
-
|
|
25595
|
-
}
|
|
25596
|
-
|
|
25597
|
-
/**
|
|
25598
|
-
* Gets the local transformation matrix of the defined instance.
|
|
25599
|
-
*
|
|
25600
|
-
* @param {number} index - The instance index.
|
|
25601
|
-
* @param {Matrix4} matrix - The target object that is used to store the method's result.
|
|
25602
|
-
* @return {Matrix4} A reference to the target matrix.
|
|
25603
|
-
*/
|
|
25604
|
-
getMatrixAt( index, matrix ) {
|
|
25605
|
-
|
|
25606
|
-
return matrix.fromArray( this.instanceMatrix.array, index * 16 );
|
|
25607
|
-
|
|
25608
|
-
}
|
|
25609
|
-
|
|
25610
|
-
/**
|
|
25611
|
-
* Gets the morph target weights of the defined instance.
|
|
25612
|
-
*
|
|
25613
|
-
* @param {number} index - The instance index.
|
|
25614
|
-
* @param {Mesh} object - The target object that is used to store the method's result.
|
|
25615
|
-
*/
|
|
25616
|
-
getMorphAt( index, object ) {
|
|
25617
|
-
|
|
25618
|
-
const objectInfluences = object.morphTargetInfluences;
|
|
25619
|
-
|
|
25620
|
-
const array = this.morphTexture.source.data.data;
|
|
25621
|
-
|
|
25622
|
-
const len = objectInfluences.length + 1; // All influences + the baseInfluenceSum
|
|
25623
|
-
|
|
25624
|
-
const dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning
|
|
25625
|
-
|
|
25626
|
-
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
25627
|
-
|
|
25628
|
-
objectInfluences[ i ] = array[ dataIndex + i ];
|
|
25629
|
-
|
|
25630
|
-
}
|
|
25631
|
-
|
|
25632
|
-
}
|
|
25633
|
-
|
|
25634
|
-
raycast( raycaster, intersects ) {
|
|
25635
|
-
|
|
25636
|
-
const matrixWorld = this.matrixWorld;
|
|
25637
|
-
const raycastTimes = this.count;
|
|
25638
|
-
|
|
25639
|
-
_mesh$1.geometry = this.geometry;
|
|
25640
|
-
_mesh$1.material = this.material;
|
|
25641
|
-
|
|
25642
|
-
if ( _mesh$1.material === undefined ) return;
|
|
25643
|
-
|
|
25644
|
-
// test with bounding sphere first
|
|
25645
|
-
|
|
25646
|
-
if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
25647
|
-
|
|
25648
|
-
_sphere$4.copy( this.boundingSphere );
|
|
25649
|
-
_sphere$4.applyMatrix4( matrixWorld );
|
|
25650
|
-
|
|
25651
|
-
if ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;
|
|
25652
|
-
|
|
25653
|
-
// now test each instance
|
|
25654
|
-
|
|
25655
|
-
for ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {
|
|
25656
|
-
|
|
25657
|
-
// calculate the world matrix for each instance
|
|
25658
|
-
|
|
25659
|
-
this.getMatrixAt( instanceId, _instanceLocalMatrix );
|
|
25660
|
-
|
|
25661
|
-
_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );
|
|
25662
|
-
|
|
25663
|
-
// the mesh represents this single instance
|
|
25664
|
-
|
|
25665
|
-
_mesh$1.matrixWorld = _instanceWorldMatrix;
|
|
25666
|
-
|
|
25667
|
-
_mesh$1.raycast( raycaster, _instanceIntersects );
|
|
25668
|
-
|
|
25669
|
-
// process the result of raycast
|
|
25670
|
-
|
|
25671
|
-
for ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {
|
|
25672
|
-
|
|
25673
|
-
const intersect = _instanceIntersects[ i ];
|
|
25674
|
-
intersect.instanceId = instanceId;
|
|
25675
|
-
intersect.object = this;
|
|
25676
|
-
intersects.push( intersect );
|
|
25677
|
-
|
|
25678
|
-
}
|
|
25679
|
-
|
|
25680
|
-
_instanceIntersects.length = 0;
|
|
25681
|
-
|
|
25682
|
-
}
|
|
25683
|
-
|
|
25684
|
-
}
|
|
25685
|
-
|
|
25686
|
-
/**
|
|
25687
|
-
* Sets the given color to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
25688
|
-
* {@link InstancedMesh#instanceColor} to `true` after updating all the colors.
|
|
25689
|
-
*
|
|
25690
|
-
* @param {number} index - The instance index.
|
|
25691
|
-
* @param {Color} color - The instance color.
|
|
25692
|
-
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
25693
|
-
*/
|
|
25694
|
-
setColorAt( index, color ) {
|
|
25695
|
-
|
|
25696
|
-
if ( this.instanceColor === null ) {
|
|
25697
|
-
|
|
25698
|
-
this.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ).fill( 1 ), 3 );
|
|
25699
|
-
|
|
25700
|
-
}
|
|
25701
|
-
|
|
25702
|
-
color.toArray( this.instanceColor.array, index * 3 );
|
|
25703
|
-
return this;
|
|
25704
|
-
|
|
25705
|
-
}
|
|
25706
|
-
|
|
25707
|
-
/**
|
|
25708
|
-
* Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
25709
|
-
* {@link InstancedMesh#instanceMatrix} to `true` after updating all the matrices.
|
|
25710
|
-
*
|
|
25711
|
-
* @param {number} index - The instance index.
|
|
25712
|
-
* @param {Matrix4} matrix - The local transformation.
|
|
25713
|
-
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
25714
|
-
*/
|
|
25715
|
-
setMatrixAt( index, matrix ) {
|
|
25716
|
-
|
|
25717
|
-
matrix.toArray( this.instanceMatrix.array, index * 16 );
|
|
25718
|
-
return this;
|
|
25719
|
-
|
|
25720
|
-
}
|
|
25721
|
-
|
|
25722
|
-
/**
|
|
25723
|
-
* Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
25724
|
-
* {@link InstancedMesh#morphTexture} to `true` after updating all the influences.
|
|
25725
|
-
*
|
|
25726
|
-
* @param {number} index - The instance index.
|
|
25727
|
-
* @param {Mesh} object - A mesh which `morphTargetInfluences` property containing the morph target weights
|
|
25728
|
-
* of a single instance.
|
|
25729
|
-
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
25730
|
-
*/
|
|
25731
|
-
setMorphAt( index, object ) {
|
|
25732
|
-
|
|
25733
|
-
const objectInfluences = object.morphTargetInfluences;
|
|
25734
|
-
|
|
25735
|
-
const len = objectInfluences.length + 1; // morphBaseInfluence + all influences
|
|
25736
|
-
|
|
25737
|
-
if ( this.morphTexture === null ) {
|
|
25738
|
-
|
|
25739
|
-
this.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );
|
|
25740
|
-
|
|
25741
|
-
}
|
|
25742
|
-
|
|
25743
|
-
const array = this.morphTexture.source.data.data;
|
|
25744
|
-
|
|
25745
|
-
let morphInfluencesSum = 0;
|
|
25746
|
-
|
|
25747
|
-
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
25748
|
-
|
|
25749
|
-
morphInfluencesSum += objectInfluences[ i ];
|
|
25750
|
-
|
|
25751
|
-
}
|
|
25752
|
-
|
|
25753
|
-
const morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
|
|
25754
|
-
|
|
25755
|
-
const dataIndex = len * index;
|
|
25756
|
-
|
|
25757
|
-
array[ dataIndex ] = morphBaseInfluence;
|
|
25758
|
-
|
|
25759
|
-
array.set( objectInfluences, dataIndex + 1 );
|
|
25760
|
-
return this;
|
|
25761
|
-
|
|
25762
|
-
}
|
|
25763
|
-
|
|
25764
|
-
updateMorphTargets() {
|
|
25765
|
-
|
|
25766
|
-
}
|
|
25767
|
-
|
|
25768
|
-
/**
|
|
25769
|
-
* Frees the GPU-related resources allocated by this instance. Call this
|
|
25770
|
-
* method whenever this instance is no longer used in your app.
|
|
25771
|
-
*/
|
|
25772
|
-
dispose() {
|
|
25773
|
-
|
|
25774
|
-
this.dispatchEvent( { type: 'dispose' } );
|
|
25775
|
-
|
|
25776
|
-
if ( this.morphTexture !== null ) {
|
|
25777
|
-
|
|
25778
|
-
this.morphTexture.dispose();
|
|
25779
|
-
this.morphTexture = null;
|
|
25780
|
-
|
|
25781
|
-
}
|
|
25782
|
-
|
|
25783
|
-
}
|
|
25784
|
-
|
|
25785
|
-
}
|
|
25786
|
-
|
|
25787
|
-
const _vector1 = /*@__PURE__*/ new Vector3();
|
|
25788
|
-
const _vector2 = /*@__PURE__*/ new Vector3();
|
|
25789
|
-
const _normalMatrix = /*@__PURE__*/ new Matrix3();
|
|
25790
|
-
|
|
25791
|
-
/**
|
|
25792
|
-
* A two dimensional surface that extends infinitely in 3D space, represented
|
|
25793
|
-
* in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html)
|
|
25794
|
-
* by a unit length normal vector and a constant.
|
|
25795
|
-
*/
|
|
25796
|
-
class Plane {
|
|
25797
|
-
|
|
25798
|
-
/**
|
|
25799
|
-
* Constructs a new plane.
|
|
25800
|
-
*
|
|
25801
|
-
* @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane.
|
|
25802
|
-
* @param {number} [constant=0] - The signed distance from the origin to the plane.
|
|
25803
|
-
*/
|
|
25804
|
-
constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {
|
|
25805
|
-
|
|
25806
|
-
/**
|
|
25807
|
-
* This flag can be used for type testing.
|
|
25808
|
-
*
|
|
25809
|
-
* @type {boolean}
|
|
25810
|
-
* @readonly
|
|
25811
|
-
* @default true
|
|
25812
|
-
*/
|
|
25813
|
-
this.isPlane = true;
|
|
25814
|
-
|
|
25815
|
-
/**
|
|
25816
|
-
* A unit length vector defining the normal of the plane.
|
|
25817
|
-
*
|
|
25818
|
-
* @type {Vector3}
|
|
25819
|
-
*/
|
|
25820
|
-
this.normal = normal;
|
|
25821
|
-
|
|
25822
|
-
/**
|
|
25823
|
-
* The signed distance from the origin to the plane.
|
|
25824
|
-
*
|
|
25825
|
-
* @type {number}
|
|
25826
|
-
* @default 0
|
|
25827
|
-
*/
|
|
25828
|
-
this.constant = constant;
|
|
25829
|
-
|
|
25830
|
-
}
|
|
25831
|
-
|
|
25832
|
-
/**
|
|
25833
|
-
* Sets the plane components by copying the given values.
|
|
25834
|
-
*
|
|
25835
|
-
* @param {Vector3} normal - The normal.
|
|
25836
|
-
* @param {number} constant - The constant.
|
|
25837
|
-
* @return {Plane} A reference to this plane.
|
|
25838
|
-
*/
|
|
25839
|
-
set( normal, constant ) {
|
|
25840
|
-
|
|
25841
|
-
this.normal.copy( normal );
|
|
25842
|
-
this.constant = constant;
|
|
25843
|
-
|
|
25844
|
-
return this;
|
|
25845
|
-
|
|
25846
|
-
}
|
|
25847
|
-
|
|
25848
|
-
/**
|
|
25849
|
-
* Sets the plane components by defining `x`, `y`, `z` as the
|
|
25850
|
-
* plane normal and `w` as the constant.
|
|
25851
|
-
*
|
|
25852
|
-
* @param {number} x - The value for the normal's x component.
|
|
25853
|
-
* @param {number} y - The value for the normal's y component.
|
|
25854
|
-
* @param {number} z - The value for the normal's z component.
|
|
25855
|
-
* @param {number} w - The constant value.
|
|
25856
|
-
* @return {Plane} A reference to this plane.
|
|
25857
|
-
*/
|
|
25858
|
-
setComponents( x, y, z, w ) {
|
|
25859
|
-
|
|
25860
|
-
this.normal.set( x, y, z );
|
|
25861
|
-
this.constant = w;
|
|
26234
|
+
copy( source, recursive ) {
|
|
25862
26235
|
|
|
25863
|
-
|
|
26236
|
+
super.copy( source, recursive );
|
|
25864
26237
|
|
|
25865
|
-
|
|
26238
|
+
this.instanceMatrix.copy( source.instanceMatrix );
|
|
25866
26239
|
|
|
25867
|
-
|
|
25868
|
-
|
|
25869
|
-
* that lies onto the plane).
|
|
25870
|
-
*
|
|
25871
|
-
* @param {Vector3} normal - The normal.
|
|
25872
|
-
* @param {Vector3} point - A coplanar point.
|
|
25873
|
-
* @return {Plane} A reference to this plane.
|
|
25874
|
-
*/
|
|
25875
|
-
setFromNormalAndCoplanarPoint( normal, point ) {
|
|
26240
|
+
if ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();
|
|
26241
|
+
if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
|
|
25876
26242
|
|
|
25877
|
-
this.
|
|
25878
|
-
|
|
26243
|
+
this.count = source.count;
|
|
26244
|
+
|
|
26245
|
+
if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
|
|
26246
|
+
if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
|
|
25879
26247
|
|
|
25880
26248
|
return this;
|
|
25881
26249
|
|
|
25882
26250
|
}
|
|
25883
26251
|
|
|
25884
26252
|
/**
|
|
25885
|
-
*
|
|
25886
|
-
* assumed to be counter-clockwise, and determines the direction of
|
|
25887
|
-
* the plane normal.
|
|
26253
|
+
* Gets the color of the defined instance.
|
|
25888
26254
|
*
|
|
25889
|
-
* @param {
|
|
25890
|
-
* @param {
|
|
25891
|
-
* @
|
|
25892
|
-
* @return {Plane} A reference to this plane.
|
|
26255
|
+
* @param {number} index - The instance index.
|
|
26256
|
+
* @param {Color} color - The target object that is used to store the method's result.
|
|
26257
|
+
* @return {Color} A reference to the target color.
|
|
25893
26258
|
*/
|
|
25894
|
-
|
|
26259
|
+
getColorAt( index, color ) {
|
|
25895
26260
|
|
|
25896
|
-
|
|
26261
|
+
if ( this.instanceColor === null ) {
|
|
25897
26262
|
|
|
25898
|
-
|
|
26263
|
+
return color.setRGB( 1, 1, 1 );
|
|
25899
26264
|
|
|
25900
|
-
|
|
26265
|
+
} else {
|
|
25901
26266
|
|
|
25902
|
-
|
|
26267
|
+
return color.fromArray( this.instanceColor.array, index * 3 );
|
|
26268
|
+
|
|
26269
|
+
}
|
|
25903
26270
|
|
|
25904
26271
|
}
|
|
25905
26272
|
|
|
25906
26273
|
/**
|
|
25907
|
-
*
|
|
26274
|
+
* Gets the local transformation matrix of the defined instance.
|
|
25908
26275
|
*
|
|
25909
|
-
* @param {
|
|
25910
|
-
* @
|
|
26276
|
+
* @param {number} index - The instance index.
|
|
26277
|
+
* @param {Matrix4} matrix - The target object that is used to store the method's result.
|
|
26278
|
+
* @return {Matrix4} A reference to the target matrix.
|
|
25911
26279
|
*/
|
|
25912
|
-
|
|
25913
|
-
|
|
25914
|
-
this.normal.copy( plane.normal );
|
|
25915
|
-
this.constant = plane.constant;
|
|
26280
|
+
getMatrixAt( index, matrix ) {
|
|
25916
26281
|
|
|
25917
|
-
return this;
|
|
26282
|
+
return matrix.fromArray( this.instanceMatrix.array, index * 16 );
|
|
25918
26283
|
|
|
25919
26284
|
}
|
|
25920
26285
|
|
|
25921
26286
|
/**
|
|
25922
|
-
*
|
|
26287
|
+
* Gets the morph target weights of the defined instance.
|
|
25923
26288
|
*
|
|
25924
|
-
* @
|
|
26289
|
+
* @param {number} index - The instance index.
|
|
26290
|
+
* @param {Mesh} object - The target object that is used to store the method's result.
|
|
25925
26291
|
*/
|
|
25926
|
-
|
|
26292
|
+
getMorphAt( index, object ) {
|
|
25927
26293
|
|
|
25928
|
-
|
|
26294
|
+
const objectInfluences = object.morphTargetInfluences;
|
|
25929
26295
|
|
|
25930
|
-
const
|
|
25931
|
-
this.normal.multiplyScalar( inverseNormalLength );
|
|
25932
|
-
this.constant *= inverseNormalLength;
|
|
26296
|
+
const array = this.morphTexture.source.data.data;
|
|
25933
26297
|
|
|
25934
|
-
|
|
26298
|
+
const len = objectInfluences.length + 1; // All influences + the baseInfluenceSum
|
|
25935
26299
|
|
|
25936
|
-
|
|
26300
|
+
const dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning
|
|
25937
26301
|
|
|
25938
|
-
|
|
25939
|
-
* Negates both the plane normal and the constant.
|
|
25940
|
-
*
|
|
25941
|
-
* @return {Plane} A reference to this plane.
|
|
25942
|
-
*/
|
|
25943
|
-
negate() {
|
|
26302
|
+
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
25944
26303
|
|
|
25945
|
-
|
|
25946
|
-
this.normal.negate();
|
|
26304
|
+
objectInfluences[ i ] = array[ dataIndex + i ];
|
|
25947
26305
|
|
|
25948
|
-
|
|
26306
|
+
}
|
|
25949
26307
|
|
|
25950
26308
|
}
|
|
25951
26309
|
|
|
25952
|
-
|
|
25953
|
-
* Returns the signed distance from the given point to this plane.
|
|
25954
|
-
*
|
|
25955
|
-
* @param {Vector3} point - The point to compute the distance for.
|
|
25956
|
-
* @return {number} The signed distance.
|
|
25957
|
-
*/
|
|
25958
|
-
distanceToPoint( point ) {
|
|
26310
|
+
raycast( raycaster, intersects ) {
|
|
25959
26311
|
|
|
25960
|
-
|
|
26312
|
+
const matrixWorld = this.matrixWorld;
|
|
26313
|
+
const raycastTimes = this.count;
|
|
25961
26314
|
|
|
25962
|
-
|
|
26315
|
+
_mesh$1.geometry = this.geometry;
|
|
26316
|
+
_mesh$1.material = this.material;
|
|
25963
26317
|
|
|
25964
|
-
|
|
25965
|
-
* Returns the signed distance from the given sphere to this plane.
|
|
25966
|
-
*
|
|
25967
|
-
* @param {Sphere} sphere - The sphere to compute the distance for.
|
|
25968
|
-
* @return {number} The signed distance.
|
|
25969
|
-
*/
|
|
25970
|
-
distanceToSphere( sphere ) {
|
|
26318
|
+
if ( _mesh$1.material === undefined ) return;
|
|
25971
26319
|
|
|
25972
|
-
|
|
26320
|
+
// test with bounding sphere first
|
|
25973
26321
|
|
|
25974
|
-
|
|
26322
|
+
if ( this.boundingSphere === null ) this.computeBoundingSphere();
|
|
25975
26323
|
|
|
25976
|
-
|
|
25977
|
-
|
|
25978
|
-
*
|
|
25979
|
-
* @param {Vector3} point - The point to project.
|
|
25980
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
25981
|
-
* @return {Vector3} The projected point on the plane.
|
|
25982
|
-
*/
|
|
25983
|
-
projectPoint( point, target ) {
|
|
26324
|
+
_sphere$4.copy( this.boundingSphere );
|
|
26325
|
+
_sphere$4.applyMatrix4( matrixWorld );
|
|
25984
26326
|
|
|
25985
|
-
|
|
26327
|
+
if ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;
|
|
25986
26328
|
|
|
25987
|
-
|
|
26329
|
+
// now test each instance
|
|
25988
26330
|
|
|
25989
|
-
|
|
25990
|
-
* Returns the intersection point of the passed line and the plane. Returns
|
|
25991
|
-
* `null` if the line does not intersect. Returns the line's starting point if
|
|
25992
|
-
* the line is coplanar with the plane.
|
|
25993
|
-
*
|
|
25994
|
-
* @param {Line3} line - The line to compute the intersection for.
|
|
25995
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
25996
|
-
* @param {boolean} [clampToLine=true] - Whether to clamp the intersection to the line segment.
|
|
25997
|
-
* @return {?Vector3} The intersection point. Returns `null` if no intersection is detected.
|
|
25998
|
-
*/
|
|
25999
|
-
intersectLine( line, target, clampToLine = true ) {
|
|
26331
|
+
for ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {
|
|
26000
26332
|
|
|
26001
|
-
|
|
26333
|
+
// calculate the world matrix for each instance
|
|
26002
26334
|
|
|
26003
|
-
|
|
26335
|
+
this.getMatrixAt( instanceId, _instanceLocalMatrix );
|
|
26004
26336
|
|
|
26005
|
-
|
|
26337
|
+
_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );
|
|
26006
26338
|
|
|
26007
|
-
//
|
|
26008
|
-
if ( this.distanceToPoint( line.start ) === 0 ) {
|
|
26339
|
+
// the mesh represents this single instance
|
|
26009
26340
|
|
|
26010
|
-
|
|
26341
|
+
_mesh$1.matrixWorld = _instanceWorldMatrix;
|
|
26011
26342
|
|
|
26012
|
-
|
|
26343
|
+
_mesh$1.raycast( raycaster, _instanceIntersects );
|
|
26013
26344
|
|
|
26014
|
-
//
|
|
26015
|
-
return null;
|
|
26345
|
+
// process the result of raycast
|
|
26016
26346
|
|
|
26017
|
-
|
|
26347
|
+
for ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {
|
|
26018
26348
|
|
|
26019
|
-
|
|
26349
|
+
const intersect = _instanceIntersects[ i ];
|
|
26350
|
+
intersect.instanceId = instanceId;
|
|
26351
|
+
intersect.object = this;
|
|
26352
|
+
intersects.push( intersect );
|
|
26020
26353
|
|
|
26021
|
-
|
|
26354
|
+
}
|
|
26022
26355
|
|
|
26023
|
-
|
|
26356
|
+
_instanceIntersects.length = 0;
|
|
26024
26357
|
|
|
26025
26358
|
}
|
|
26026
26359
|
|
|
26027
|
-
return target.copy( line.start ).addScaledVector( direction, t );
|
|
26028
|
-
|
|
26029
26360
|
}
|
|
26030
26361
|
|
|
26031
26362
|
/**
|
|
26032
|
-
*
|
|
26363
|
+
* Sets the given color to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
26364
|
+
* {@link InstancedMesh#instanceColor} to `true` after updating all the colors.
|
|
26033
26365
|
*
|
|
26034
|
-
* @param {
|
|
26035
|
-
* @
|
|
26366
|
+
* @param {number} index - The instance index.
|
|
26367
|
+
* @param {Color} color - The instance color.
|
|
26368
|
+
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
26036
26369
|
*/
|
|
26037
|
-
|
|
26370
|
+
setColorAt( index, color ) {
|
|
26038
26371
|
|
|
26039
|
-
|
|
26372
|
+
if ( this.instanceColor === null ) {
|
|
26040
26373
|
|
|
26041
|
-
|
|
26042
|
-
const endSign = this.distanceToPoint( line.end );
|
|
26374
|
+
this.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ).fill( 1 ), 3 );
|
|
26043
26375
|
|
|
26044
|
-
|
|
26376
|
+
}
|
|
26377
|
+
|
|
26378
|
+
color.toArray( this.instanceColor.array, index * 3 );
|
|
26379
|
+
return this;
|
|
26045
26380
|
|
|
26046
26381
|
}
|
|
26047
26382
|
|
|
26048
26383
|
/**
|
|
26049
|
-
*
|
|
26384
|
+
* Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
26385
|
+
* {@link InstancedMesh#instanceMatrix} to `true` after updating all the matrices.
|
|
26050
26386
|
*
|
|
26051
|
-
* @param {
|
|
26052
|
-
* @
|
|
26387
|
+
* @param {number} index - The instance index.
|
|
26388
|
+
* @param {Matrix4} matrix - The local transformation.
|
|
26389
|
+
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
26053
26390
|
*/
|
|
26054
|
-
|
|
26391
|
+
setMatrixAt( index, matrix ) {
|
|
26055
26392
|
|
|
26056
|
-
|
|
26393
|
+
matrix.toArray( this.instanceMatrix.array, index * 16 );
|
|
26394
|
+
return this;
|
|
26057
26395
|
|
|
26058
26396
|
}
|
|
26059
26397
|
|
|
26060
26398
|
/**
|
|
26061
|
-
*
|
|
26399
|
+
* Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of
|
|
26400
|
+
* {@link InstancedMesh#morphTexture} to `true` after updating all the influences.
|
|
26062
26401
|
*
|
|
26063
|
-
* @param {
|
|
26064
|
-
* @
|
|
26402
|
+
* @param {number} index - The instance index.
|
|
26403
|
+
* @param {Mesh} object - A mesh which `morphTargetInfluences` property containing the morph target weights
|
|
26404
|
+
* of a single instance.
|
|
26405
|
+
* @return {InstancedMesh} A reference to this instanced mesh.
|
|
26065
26406
|
*/
|
|
26066
|
-
|
|
26067
|
-
|
|
26068
|
-
return sphere.intersectsPlane( this );
|
|
26407
|
+
setMorphAt( index, object ) {
|
|
26069
26408
|
|
|
26070
|
-
|
|
26409
|
+
const objectInfluences = object.morphTargetInfluences;
|
|
26071
26410
|
|
|
26072
|
-
|
|
26073
|
-
* Returns a coplanar vector to the plane, by calculating the
|
|
26074
|
-
* projection of the normal at the origin onto the plane.
|
|
26075
|
-
*
|
|
26076
|
-
* @param {Vector3} target - The target vector that is used to store the method's result.
|
|
26077
|
-
* @return {Vector3} The coplanar point.
|
|
26078
|
-
*/
|
|
26079
|
-
coplanarPoint( target ) {
|
|
26411
|
+
const len = objectInfluences.length + 1; // morphBaseInfluence + all influences
|
|
26080
26412
|
|
|
26081
|
-
|
|
26413
|
+
if ( this.morphTexture === null ) {
|
|
26082
26414
|
|
|
26083
|
-
|
|
26415
|
+
this.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );
|
|
26084
26416
|
|
|
26085
|
-
|
|
26086
|
-
* Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform.
|
|
26087
|
-
*
|
|
26088
|
-
* The optional normal matrix can be pre-computed like so:
|
|
26089
|
-
* ```js
|
|
26090
|
-
* const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
|
|
26091
|
-
* ```
|
|
26092
|
-
*
|
|
26093
|
-
* @param {Matrix4} matrix - The transformation matrix.
|
|
26094
|
-
* @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix.
|
|
26095
|
-
* @return {Plane} A reference to this plane.
|
|
26096
|
-
*/
|
|
26097
|
-
applyMatrix4( matrix, optionalNormalMatrix ) {
|
|
26417
|
+
}
|
|
26098
26418
|
|
|
26099
|
-
const
|
|
26419
|
+
const array = this.morphTexture.source.data.data;
|
|
26100
26420
|
|
|
26101
|
-
|
|
26421
|
+
let morphInfluencesSum = 0;
|
|
26102
26422
|
|
|
26103
|
-
|
|
26423
|
+
for ( let i = 0; i < objectInfluences.length; i ++ ) {
|
|
26104
26424
|
|
|
26105
|
-
|
|
26425
|
+
morphInfluencesSum += objectInfluences[ i ];
|
|
26106
26426
|
|
|
26107
|
-
|
|
26427
|
+
}
|
|
26108
26428
|
|
|
26109
|
-
|
|
26429
|
+
const morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
|
|
26110
26430
|
|
|
26111
|
-
|
|
26112
|
-
* Translates the plane by the distance defined by the given offset vector.
|
|
26113
|
-
* Note that this only affects the plane constant and will not affect the normal vector.
|
|
26114
|
-
*
|
|
26115
|
-
* @param {Vector3} offset - The offset vector.
|
|
26116
|
-
* @return {Plane} A reference to this plane.
|
|
26117
|
-
*/
|
|
26118
|
-
translate( offset ) {
|
|
26431
|
+
const dataIndex = len * index;
|
|
26119
26432
|
|
|
26120
|
-
|
|
26433
|
+
array[ dataIndex ] = morphBaseInfluence;
|
|
26121
26434
|
|
|
26435
|
+
array.set( objectInfluences, dataIndex + 1 );
|
|
26122
26436
|
return this;
|
|
26123
26437
|
|
|
26124
26438
|
}
|
|
26125
26439
|
|
|
26126
|
-
|
|
26127
|
-
* Returns `true` if this plane is equal with the given one.
|
|
26128
|
-
*
|
|
26129
|
-
* @param {Plane} plane - The plane to test for equality.
|
|
26130
|
-
* @return {boolean} Whether this plane is equal with the given one.
|
|
26131
|
-
*/
|
|
26132
|
-
equals( plane ) {
|
|
26133
|
-
|
|
26134
|
-
return plane.normal.equals( this.normal ) && ( plane.constant === this.constant );
|
|
26440
|
+
updateMorphTargets() {
|
|
26135
26441
|
|
|
26136
26442
|
}
|
|
26137
26443
|
|
|
26138
26444
|
/**
|
|
26139
|
-
*
|
|
26140
|
-
*
|
|
26141
|
-
* @return {Plane} A clone of this instance.
|
|
26445
|
+
* Frees the GPU-related resources allocated by this instance. Call this
|
|
26446
|
+
* method whenever this instance is no longer used in your app.
|
|
26142
26447
|
*/
|
|
26143
|
-
|
|
26448
|
+
dispose() {
|
|
26144
26449
|
|
|
26145
|
-
|
|
26450
|
+
super.dispose();
|
|
26451
|
+
|
|
26452
|
+
if ( this.morphTexture !== null ) {
|
|
26453
|
+
|
|
26454
|
+
this.morphTexture.dispose();
|
|
26455
|
+
this.morphTexture = null;
|
|
26456
|
+
|
|
26457
|
+
}
|
|
26146
26458
|
|
|
26147
26459
|
}
|
|
26148
26460
|
|
|
@@ -26331,6 +26643,10 @@ class Frustum {
|
|
|
26331
26643
|
/**
|
|
26332
26644
|
* Returns `true` if the given bounding sphere is intersecting this frustum.
|
|
26333
26645
|
*
|
|
26646
|
+
* This is a fast, conservative test that favors performance over precision. It can
|
|
26647
|
+
* report false positives for spheres that lie outside the frustum but are not separated
|
|
26648
|
+
* by a single frustum plane. It never reports false negatives, so it is safe for culling.
|
|
26649
|
+
*
|
|
26334
26650
|
* @param {Sphere} sphere - The bounding sphere to test.
|
|
26335
26651
|
* @return {boolean} Whether the bounding sphere is intersecting this frustum or not.
|
|
26336
26652
|
*/
|
|
@@ -26359,6 +26675,11 @@ class Frustum {
|
|
|
26359
26675
|
/**
|
|
26360
26676
|
* Returns `true` if the given bounding box is intersecting this frustum.
|
|
26361
26677
|
*
|
|
26678
|
+
* This is a fast, conservative test that favors performance over precision. It can
|
|
26679
|
+
* report false positives for large boxes that lie outside the frustum but are not
|
|
26680
|
+
* separated by a single frustum plane. It never reports false negatives, so it is
|
|
26681
|
+
* safe for culling.
|
|
26682
|
+
*
|
|
26362
26683
|
* @param {Box3} box - The bounding box to test.
|
|
26363
26684
|
* @return {boolean} Whether the bounding box is intersecting this frustum or not.
|
|
26364
26685
|
*/
|
|
@@ -26611,7 +26932,7 @@ class FrustumArray {
|
|
|
26611
26932
|
/**
|
|
26612
26933
|
* Copies the values of the given frustum array to this instance.
|
|
26613
26934
|
*
|
|
26614
|
-
* @param {FrustumArray}
|
|
26935
|
+
* @param {FrustumArray} source - The frustum array to copy.
|
|
26615
26936
|
* @return {FrustumArray} A reference to this frustum array.
|
|
26616
26937
|
*/
|
|
26617
26938
|
copy( source ) {
|
|
@@ -26908,6 +27229,7 @@ class BatchedMesh extends Mesh {
|
|
|
26908
27229
|
this._multiDrawCounts = new Int32Array( maxInstanceCount );
|
|
26909
27230
|
this._multiDrawStarts = new Int32Array( maxInstanceCount );
|
|
26910
27231
|
this._multiDrawCount = 0;
|
|
27232
|
+
this._multiDrawBytesPerElement = 1;
|
|
26911
27233
|
|
|
26912
27234
|
// Local matrix per geometry by using data texture
|
|
26913
27235
|
this._matricesTexture = null;
|
|
@@ -27839,6 +28161,7 @@ class BatchedMesh extends Mesh {
|
|
|
27839
28161
|
this.validateGeometryId( geometryId );
|
|
27840
28162
|
|
|
27841
28163
|
this._instanceInfo[ instanceId ].geometryIndex = geometryId;
|
|
28164
|
+
this._visibilityChanged = true;
|
|
27842
28165
|
|
|
27843
28166
|
return this;
|
|
27844
28167
|
|
|
@@ -28109,6 +28432,7 @@ class BatchedMesh extends Mesh {
|
|
|
28109
28432
|
this._geometryInitialized = source._geometryInitialized;
|
|
28110
28433
|
this._multiDrawCounts = source._multiDrawCounts.slice();
|
|
28111
28434
|
this._multiDrawStarts = source._multiDrawStarts.slice();
|
|
28435
|
+
this._multiDrawBytesPerElement = source._multiDrawBytesPerElement;
|
|
28112
28436
|
|
|
28113
28437
|
this._indirectTexture = source._indirectTexture.clone();
|
|
28114
28438
|
this._indirectTexture.image.data = this._indirectTexture.image.data.slice();
|
|
@@ -28133,6 +28457,8 @@ class BatchedMesh extends Mesh {
|
|
|
28133
28457
|
*/
|
|
28134
28458
|
dispose() {
|
|
28135
28459
|
|
|
28460
|
+
super.dispose();
|
|
28461
|
+
|
|
28136
28462
|
// Assuming the geometry is not shared with other meshes
|
|
28137
28463
|
this.geometry.dispose();
|
|
28138
28464
|
|
|
@@ -28311,6 +28637,7 @@ class BatchedMesh extends Mesh {
|
|
|
28311
28637
|
|
|
28312
28638
|
indirectTexture.needsUpdate = true;
|
|
28313
28639
|
this._multiDrawCount = multiDrawCount;
|
|
28640
|
+
this._multiDrawBytesPerElement = bytesPerElement;
|
|
28314
28641
|
this._visibilityChanged = false;
|
|
28315
28642
|
|
|
28316
28643
|
}
|
|
@@ -28588,6 +28915,18 @@ class Line extends Object3D {
|
|
|
28588
28915
|
|
|
28589
28916
|
}
|
|
28590
28917
|
|
|
28918
|
+
/**
|
|
28919
|
+
* Returns `true` if this line intersects the given frustum.
|
|
28920
|
+
*
|
|
28921
|
+
* @param {Frustum|FrustumArray} frustum - The frustum to test.
|
|
28922
|
+
* @return {boolean} Whether this line intersects the given frustum or not.
|
|
28923
|
+
*/
|
|
28924
|
+
intersectsFrustum( frustum ) {
|
|
28925
|
+
|
|
28926
|
+
return frustum.intersectsObject( this );
|
|
28927
|
+
|
|
28928
|
+
}
|
|
28929
|
+
|
|
28591
28930
|
/**
|
|
28592
28931
|
* Computes intersection points between a casted ray and this line.
|
|
28593
28932
|
*
|
|
@@ -29090,6 +29429,18 @@ class Points extends Object3D {
|
|
|
29090
29429
|
|
|
29091
29430
|
}
|
|
29092
29431
|
|
|
29432
|
+
/**
|
|
29433
|
+
* Returns `true` if this point cloud intersects the given frustum.
|
|
29434
|
+
*
|
|
29435
|
+
* @param {Frustum|FrustumArray} frustum - The frustum to test.
|
|
29436
|
+
* @return {boolean} Whether this point cloud intersects the given frustum or not.
|
|
29437
|
+
*/
|
|
29438
|
+
intersectsFrustum( frustum ) {
|
|
29439
|
+
|
|
29440
|
+
return frustum.intersectsObject( this );
|
|
29441
|
+
|
|
29442
|
+
}
|
|
29443
|
+
|
|
29093
29444
|
/**
|
|
29094
29445
|
* Computes intersection points between a casted ray and this point cloud.
|
|
29095
29446
|
*
|
|
@@ -29641,6 +29992,22 @@ class CompressedArrayTexture extends CompressedTexture {
|
|
|
29641
29992
|
|
|
29642
29993
|
}
|
|
29643
29994
|
|
|
29995
|
+
/**
|
|
29996
|
+
* Copies the values of the given texture to this instance.
|
|
29997
|
+
*
|
|
29998
|
+
* @param {CompressedArrayTexture} source - The texture to copy.
|
|
29999
|
+
* @return {CompressedArrayTexture} A reference to this instance.
|
|
30000
|
+
*/
|
|
30001
|
+
copy( source ) {
|
|
30002
|
+
|
|
30003
|
+
super.copy( source );
|
|
30004
|
+
|
|
30005
|
+
this.wrapR = source.wrapR;
|
|
30006
|
+
|
|
30007
|
+
return this;
|
|
30008
|
+
|
|
30009
|
+
}
|
|
30010
|
+
|
|
29644
30011
|
/**
|
|
29645
30012
|
* Describes that a specific layer of the texture needs to be updated.
|
|
29646
30013
|
* Normally when {@link Texture#needsUpdate} is set to `true`, the
|
|
@@ -29981,7 +30348,7 @@ class DepthTexture extends Texture {
|
|
|
29981
30348
|
|
|
29982
30349
|
super.copy( source );
|
|
29983
30350
|
|
|
29984
|
-
this.source = new
|
|
30351
|
+
this.source = new TextureSource( Object.assign( {}, source.image ) ); // see #30540
|
|
29985
30352
|
this.compareFunction = source.compareFunction;
|
|
29986
30353
|
|
|
29987
30354
|
return this;
|
|
@@ -29992,7 +30359,7 @@ class DepthTexture extends Texture {
|
|
|
29992
30359
|
|
|
29993
30360
|
const data = super.toJSON( meta );
|
|
29994
30361
|
|
|
29995
|
-
|
|
30362
|
+
data.compareFunction = this.compareFunction;
|
|
29996
30363
|
|
|
29997
30364
|
return data;
|
|
29998
30365
|
|
|
@@ -37514,7 +37881,7 @@ class TorusGeometry extends BufferGeometry {
|
|
|
37514
37881
|
*/
|
|
37515
37882
|
static fromJSON( data ) {
|
|
37516
37883
|
|
|
37517
|
-
return new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );
|
|
37884
|
+
return new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc, data.thetaStart, data.thetaLength );
|
|
37518
37885
|
|
|
37519
37886
|
}
|
|
37520
37887
|
|
|
@@ -39394,6 +39761,8 @@ class MeshStandardMaterial extends Material {
|
|
|
39394
39761
|
* transparent materials are less reflective. Physically-based transmission provides a more
|
|
39395
39762
|
* realistic option for thin, transparent surfaces like glass.
|
|
39396
39763
|
* - Advanced reflectivity: More flexible reflectivity for non-metallic materials.
|
|
39764
|
+
* - Retroreflection: Redirects specular light back toward the light source for
|
|
39765
|
+
* safety materials like road markings and reflective tape.
|
|
39397
39766
|
* - Sheen: Can be used for representing cloth and fabric materials.
|
|
39398
39767
|
*
|
|
39399
39768
|
* As a result of these complex shading features, `MeshPhysicalMaterial` has a
|
|
@@ -39729,6 +40098,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39729
40098
|
this._clearcoat = 0;
|
|
39730
40099
|
this._dispersion = 0;
|
|
39731
40100
|
this._iridescence = 0;
|
|
40101
|
+
this._retroreflectivity = 0;
|
|
39732
40102
|
this._sheen = 0.0;
|
|
39733
40103
|
this._transmission = 0;
|
|
39734
40104
|
|
|
@@ -39836,6 +40206,33 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39836
40206
|
|
|
39837
40207
|
}
|
|
39838
40208
|
|
|
40209
|
+
/**
|
|
40210
|
+
* The strength of retroreflection, from `0.0` to `1.0`. A value of `1.0`
|
|
40211
|
+
* evaluates the material's microfacet reflection with the view direction
|
|
40212
|
+
* reflected about the surface normal, redirecting the specular lobe back
|
|
40213
|
+
* toward the light source.
|
|
40214
|
+
*
|
|
40215
|
+
* @type {number}
|
|
40216
|
+
* @default 0
|
|
40217
|
+
*/
|
|
40218
|
+
get retroreflectivity() {
|
|
40219
|
+
|
|
40220
|
+
return this._retroreflectivity;
|
|
40221
|
+
|
|
40222
|
+
}
|
|
40223
|
+
|
|
40224
|
+
set retroreflectivity( value ) {
|
|
40225
|
+
|
|
40226
|
+
if ( this._retroreflectivity > 0 !== value > 0 ) {
|
|
40227
|
+
|
|
40228
|
+
this.version ++;
|
|
40229
|
+
|
|
40230
|
+
}
|
|
40231
|
+
|
|
40232
|
+
this._retroreflectivity = value;
|
|
40233
|
+
|
|
40234
|
+
}
|
|
40235
|
+
|
|
39839
40236
|
/**
|
|
39840
40237
|
* The intensity of the sheen layer, from `0.0` to `1.0`.
|
|
39841
40238
|
*
|
|
@@ -39921,6 +40318,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
39921
40318
|
this.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];
|
|
39922
40319
|
this.iridescenceThicknessMap = source.iridescenceThicknessMap;
|
|
39923
40320
|
|
|
40321
|
+
this.retroreflectivity = source.retroreflectivity;
|
|
40322
|
+
|
|
39924
40323
|
this.sheen = source.sheen;
|
|
39925
40324
|
this.sheenColor.copy( source.sheenColor );
|
|
39926
40325
|
this.sheenColorMap = source.sheenColorMap;
|
|
@@ -42006,6 +42405,18 @@ function convertArray( array, type ) {
|
|
|
42006
42405
|
|
|
42007
42406
|
}
|
|
42008
42407
|
|
|
42408
|
+
/**
|
|
42409
|
+
* Returns `true` if the given keyframe track settings hold Bezier tangent data.
|
|
42410
|
+
*
|
|
42411
|
+
* @param {?Object} settings - The settings of a keyframe track.
|
|
42412
|
+
* @return {boolean} Whether both tangent arrays are defined or not.
|
|
42413
|
+
*/
|
|
42414
|
+
function hasTangents( settings ) {
|
|
42415
|
+
|
|
42416
|
+
return settings !== undefined && settings.inTangents !== undefined && settings.outTangents !== undefined;
|
|
42417
|
+
|
|
42418
|
+
}
|
|
42419
|
+
|
|
42009
42420
|
/**
|
|
42010
42421
|
* Returns an array by which times and values can be sorted.
|
|
42011
42422
|
*
|
|
@@ -42388,6 +42799,19 @@ class AnimationUtils {
|
|
|
42388
42799
|
|
|
42389
42800
|
}
|
|
42390
42801
|
|
|
42802
|
+
/**
|
|
42803
|
+
* Returns `true` if the given keyframe track settings hold Bezier tangent data.
|
|
42804
|
+
*
|
|
42805
|
+
* @static
|
|
42806
|
+
* @param {?Object} settings - The settings of a keyframe track.
|
|
42807
|
+
* @return {boolean} Whether both tangent arrays are defined or not.
|
|
42808
|
+
*/
|
|
42809
|
+
static hasTangents( settings ) {
|
|
42810
|
+
|
|
42811
|
+
return hasTangents( settings );
|
|
42812
|
+
|
|
42813
|
+
}
|
|
42814
|
+
|
|
42391
42815
|
/**
|
|
42392
42816
|
* Returns an array by which times and values can be sorted.
|
|
42393
42817
|
*
|
|
@@ -43082,42 +43506,55 @@ class BezierInterpolant extends Interpolant {
|
|
|
43082
43506
|
const c1x = inTangents[ inTangentOffset ];
|
|
43083
43507
|
const c1y = inTangents[ inTangentOffset + 1 ];
|
|
43084
43508
|
|
|
43085
|
-
//
|
|
43086
|
-
|
|
43087
|
-
let s2, s3, oneMinusS, oneMinusS2, oneMinusS3;
|
|
43509
|
+
// Find the curve parameter s where the Bezier X(s) matches t, then evaluate Y(s)
|
|
43510
|
+
const s = solveBezierParameter( t, t0, c0x, c1x, t1 );
|
|
43088
43511
|
|
|
43089
|
-
|
|
43512
|
+
result[ i ] = cubicBezier( s, v0, c0y, c1y, v1 );
|
|
43090
43513
|
|
|
43091
|
-
|
|
43092
|
-
s3 = s2 * s;
|
|
43093
|
-
oneMinusS = 1 - s;
|
|
43094
|
-
oneMinusS2 = oneMinusS * oneMinusS;
|
|
43095
|
-
oneMinusS3 = oneMinusS2 * oneMinusS;
|
|
43514
|
+
}
|
|
43096
43515
|
|
|
43097
|
-
|
|
43098
|
-
const bx = oneMinusS3 * t0 + 3 * oneMinusS2 * s * c0x + 3 * oneMinusS * s2 * c1x + s3 * t1;
|
|
43516
|
+
return result;
|
|
43099
43517
|
|
|
43100
|
-
|
|
43101
|
-
if ( Math.abs( error ) < 1e-10 ) break;
|
|
43518
|
+
}
|
|
43102
43519
|
|
|
43103
|
-
|
|
43104
|
-
const dbx = 3 * oneMinusS2 * ( c0x - t0 ) + 6 * oneMinusS * s * ( c1x - c0x ) + 3 * s2 * ( t1 - c1x );
|
|
43105
|
-
if ( Math.abs( dbx ) < 1e-10 ) break;
|
|
43520
|
+
}
|
|
43106
43521
|
|
|
43107
|
-
|
|
43108
|
-
s = Math.max( 0, Math.min( 1, s ) );
|
|
43522
|
+
function cubicBezier( s, p0, p1, p2, p3 ) {
|
|
43109
43523
|
|
|
43110
|
-
|
|
43524
|
+
const k = 1 - s;
|
|
43111
43525
|
|
|
43112
|
-
|
|
43113
|
-
result[ i ] = oneMinusS3 * v0 + 3 * oneMinusS2 * s * c0y + 3 * oneMinusS * s2 * c1y + s3 * v1;
|
|
43526
|
+
return k * k * k * p0 + 3 * k * k * s * p1 + 3 * k * s * s * p2 + s * s * s * p3;
|
|
43114
43527
|
|
|
43115
|
-
|
|
43528
|
+
}
|
|
43116
43529
|
|
|
43117
|
-
|
|
43530
|
+
function cubicBezierSlope( s, p0, p1, p2, p3 ) {
|
|
43531
|
+
|
|
43532
|
+
const k = 1 - s;
|
|
43533
|
+
|
|
43534
|
+
return 3 * k * k * ( p1 - p0 ) + 6 * k * s * ( p2 - p1 ) + 3 * s * s * ( p3 - p2 );
|
|
43535
|
+
|
|
43536
|
+
}
|
|
43537
|
+
|
|
43538
|
+
// Solves cubicBezier( s, x0, x1, x2, x3 ) = x for s in [0,1] using Newton-Raphson
|
|
43539
|
+
|
|
43540
|
+
function solveBezierParameter( x, x0, x1, x2, x3 ) {
|
|
43541
|
+
|
|
43542
|
+
let s = ( x - x0 ) / ( x3 - x0 );
|
|
43543
|
+
|
|
43544
|
+
for ( let i = 0; i < 8; i ++ ) {
|
|
43545
|
+
|
|
43546
|
+
const error = cubicBezier( s, x0, x1, x2, x3 ) - x;
|
|
43547
|
+
if ( Math.abs( error ) < 1e-10 ) break;
|
|
43548
|
+
|
|
43549
|
+
const slope = cubicBezierSlope( s, x0, x1, x2, x3 );
|
|
43550
|
+
if ( Math.abs( slope ) < 1e-10 ) break;
|
|
43551
|
+
|
|
43552
|
+
s = Math.max( 0, Math.min( 1, s - error / slope ) );
|
|
43118
43553
|
|
|
43119
43554
|
}
|
|
43120
43555
|
|
|
43556
|
+
return s;
|
|
43557
|
+
|
|
43121
43558
|
}
|
|
43122
43559
|
|
|
43123
43560
|
/**
|
|
@@ -43204,6 +43641,15 @@ class KeyframeTrack {
|
|
|
43204
43641
|
|
|
43205
43642
|
}
|
|
43206
43643
|
|
|
43644
|
+
if ( hasTangents( track.settings ) ) {
|
|
43645
|
+
|
|
43646
|
+
json.settings = {
|
|
43647
|
+
inTangents: convertArray( track.settings.inTangents, Array ),
|
|
43648
|
+
outTangents: convertArray( track.settings.outTangents, Array )
|
|
43649
|
+
};
|
|
43650
|
+
|
|
43651
|
+
}
|
|
43652
|
+
|
|
43207
43653
|
}
|
|
43208
43654
|
|
|
43209
43655
|
json.type = track.ValueTypeName; // mandatory
|
|
@@ -43429,6 +43875,13 @@ class KeyframeTrack {
|
|
|
43429
43875
|
|
|
43430
43876
|
}
|
|
43431
43877
|
|
|
43878
|
+
if ( hasTangents( this.settings ) ) {
|
|
43879
|
+
|
|
43880
|
+
scaleTangentTimes( this.settings.inTangents, timeScale );
|
|
43881
|
+
scaleTangentTimes( this.settings.outTangents, timeScale );
|
|
43882
|
+
|
|
43883
|
+
}
|
|
43884
|
+
|
|
43432
43885
|
}
|
|
43433
43886
|
|
|
43434
43887
|
return this;
|
|
@@ -43704,12 +44157,33 @@ class KeyframeTrack {
|
|
|
43704
44157
|
// Interpolant argument to constructor is not saved, so copy the factory method directly.
|
|
43705
44158
|
track.createInterpolant = this.createInterpolant;
|
|
43706
44159
|
|
|
44160
|
+
if ( hasTangents( this.settings ) ) {
|
|
44161
|
+
|
|
44162
|
+
track.settings = {
|
|
44163
|
+
inTangents: this.settings.inTangents.slice(),
|
|
44164
|
+
outTangents: this.settings.outTangents.slice()
|
|
44165
|
+
};
|
|
44166
|
+
|
|
44167
|
+
}
|
|
44168
|
+
|
|
43707
44169
|
return track;
|
|
43708
44170
|
|
|
43709
44171
|
}
|
|
43710
44172
|
|
|
43711
44173
|
}
|
|
43712
44174
|
|
|
44175
|
+
function scaleTangentTimes( tangents, timeScale ) {
|
|
44176
|
+
|
|
44177
|
+
// tangents are [ time, value ] pairs, so only every second entry is a time
|
|
44178
|
+
|
|
44179
|
+
for ( let i = 0, n = tangents.length; i !== n; i += 2 ) {
|
|
44180
|
+
|
|
44181
|
+
tangents[ i ] *= timeScale;
|
|
44182
|
+
|
|
44183
|
+
}
|
|
44184
|
+
|
|
44185
|
+
}
|
|
44186
|
+
|
|
43713
44187
|
/**
|
|
43714
44188
|
* The value type name.
|
|
43715
44189
|
*
|
|
@@ -44490,18 +44964,31 @@ function parseKeyframeTrack( json ) {
|
|
|
44490
44964
|
|
|
44491
44965
|
}
|
|
44492
44966
|
|
|
44967
|
+
let track;
|
|
44968
|
+
|
|
44493
44969
|
// derived classes can define a static parse method
|
|
44494
44970
|
if ( trackType.parse !== undefined ) {
|
|
44495
44971
|
|
|
44496
|
-
|
|
44972
|
+
track = trackType.parse( json );
|
|
44497
44973
|
|
|
44498
44974
|
} else {
|
|
44499
44975
|
|
|
44500
44976
|
// by default, we assume a constructor compatible with the base
|
|
44501
|
-
|
|
44977
|
+
track = new trackType( json.name, json.times, json.values, json.interpolation );
|
|
44978
|
+
|
|
44979
|
+
}
|
|
44980
|
+
|
|
44981
|
+
if ( hasTangents( json.settings ) ) {
|
|
44982
|
+
|
|
44983
|
+
track.settings = {
|
|
44984
|
+
inTangents: convertArray( json.settings.inTangents, Float32Array ),
|
|
44985
|
+
outTangents: convertArray( json.settings.outTangents, Float32Array )
|
|
44986
|
+
};
|
|
44502
44987
|
|
|
44503
44988
|
}
|
|
44504
44989
|
|
|
44990
|
+
return track;
|
|
44991
|
+
|
|
44505
44992
|
}
|
|
44506
44993
|
|
|
44507
44994
|
/**
|
|
@@ -46320,16 +46807,6 @@ class Light extends Object3D {
|
|
|
46320
46807
|
|
|
46321
46808
|
}
|
|
46322
46809
|
|
|
46323
|
-
/**
|
|
46324
|
-
* Frees the GPU-related resources allocated by this instance. Call this
|
|
46325
|
-
* method whenever this instance is no longer used in your app.
|
|
46326
|
-
*/
|
|
46327
|
-
dispose() {
|
|
46328
|
-
|
|
46329
|
-
this.dispatchEvent( { type: 'dispose' } );
|
|
46330
|
-
|
|
46331
|
-
}
|
|
46332
|
-
|
|
46333
46810
|
copy( source, recursive ) {
|
|
46334
46811
|
|
|
46335
46812
|
super.copy( source, recursive );
|
|
@@ -46602,6 +47079,18 @@ class LightShadow {
|
|
|
46602
47079
|
|
|
46603
47080
|
}
|
|
46604
47081
|
|
|
47082
|
+
/**
|
|
47083
|
+
* Used internally by the renderer to get the camera that renders the given viewport.
|
|
47084
|
+
*
|
|
47085
|
+
* @param {number} [viewportIndex=0] - The viewport index.
|
|
47086
|
+
* @return {Camera} The shadow camera.
|
|
47087
|
+
*/
|
|
47088
|
+
getCamera( /* viewportIndex */ ) {
|
|
47089
|
+
|
|
47090
|
+
return this.camera;
|
|
47091
|
+
|
|
47092
|
+
}
|
|
47093
|
+
|
|
46605
47094
|
/**
|
|
46606
47095
|
* Gets the shadow cameras frustum. Used internally by the renderer to cull objects.
|
|
46607
47096
|
*
|
|
@@ -46621,23 +47110,41 @@ class LightShadow {
|
|
|
46621
47110
|
updateMatrices( light ) {
|
|
46622
47111
|
|
|
46623
47112
|
const shadowCamera = this.camera;
|
|
46624
|
-
const shadowMatrix = this.matrix;
|
|
46625
|
-
|
|
46626
47113
|
_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
|
|
46627
47114
|
shadowCamera.position.copy( _lightPositionWorld );
|
|
46628
47115
|
|
|
46629
47116
|
_lookTarget.setFromMatrixPosition( light.target.matrixWorld );
|
|
46630
47117
|
shadowCamera.lookAt( _lookTarget );
|
|
46631
47118
|
shadowCamera.updateMatrixWorld();
|
|
47119
|
+
this._updateMatrix( shadowCamera, this.matrix, this._frustum );
|
|
47120
|
+
|
|
47121
|
+
}
|
|
47122
|
+
|
|
47123
|
+
/**
|
|
47124
|
+
* Updates a shadow projection matrix and its corresponding frustum.
|
|
47125
|
+
*
|
|
47126
|
+
* @private
|
|
47127
|
+
* @param {Camera} shadowCamera - The shadow camera.
|
|
47128
|
+
* @param {Matrix4} shadowMatrix - The target shadow matrix.
|
|
47129
|
+
* @param {Frustum} frustum - The target frustum.
|
|
47130
|
+
* @param {Vector4} [viewport] - The viewport within the shadow atlas.
|
|
47131
|
+
*/
|
|
47132
|
+
_updateMatrix( shadowCamera, shadowMatrix, frustum, viewport ) {
|
|
46632
47133
|
|
|
46633
47134
|
_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
|
|
46634
|
-
|
|
47135
|
+
frustum.setFromProjectionMatrix( _projScreenMatrix, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );
|
|
47136
|
+
|
|
47137
|
+
const frameExtents = this._frameExtents;
|
|
47138
|
+
const scaleX = viewport ? viewport.z / frameExtents.x : 1;
|
|
47139
|
+
const scaleY = viewport ? viewport.w / frameExtents.y : 1;
|
|
47140
|
+
const offsetX = viewport ? viewport.x / frameExtents.x : 0;
|
|
47141
|
+
const offsetY = viewport ? viewport.y / frameExtents.y : 0;
|
|
46635
47142
|
|
|
46636
47143
|
if ( shadowCamera.coordinateSystem === WebGPUCoordinateSystem || shadowCamera.reversedDepth ) {
|
|
46637
47144
|
|
|
46638
47145
|
shadowMatrix.set(
|
|
46639
|
-
0.5, 0.0, 0.0, 0.5,
|
|
46640
|
-
0.0, 0.5, 0.0, 0.5,
|
|
47146
|
+
0.5 * scaleX, 0.0, 0.0, 0.5 * scaleX + offsetX,
|
|
47147
|
+
0.0, 0.5 * scaleY, 0.0, 0.5 * scaleY + offsetY,
|
|
46641
47148
|
0.0, 0.0, 1.0, 0.0, // Identity Z (preserving the correct [0, 1] range from the projection matrix)
|
|
46642
47149
|
0.0, 0.0, 0.0, 1.0
|
|
46643
47150
|
);
|
|
@@ -46645,8 +47152,8 @@ class LightShadow {
|
|
|
46645
47152
|
} else {
|
|
46646
47153
|
|
|
46647
47154
|
shadowMatrix.set(
|
|
46648
|
-
0.5, 0.0, 0.0, 0.5,
|
|
46649
|
-
0.0, 0.5, 0.0, 0.5,
|
|
47155
|
+
0.5 * scaleX, 0.0, 0.0, 0.5 * scaleX + offsetX,
|
|
47156
|
+
0.0, 0.5 * scaleY, 0.0, 0.5 * scaleY + offsetY,
|
|
46650
47157
|
0.0, 0.0, 0.5, 0.5,
|
|
46651
47158
|
0.0, 0.0, 0.0, 1.0
|
|
46652
47159
|
);
|
|
@@ -46749,11 +47256,12 @@ class LightShadow {
|
|
|
46749
47256
|
|
|
46750
47257
|
const object = {};
|
|
46751
47258
|
|
|
46752
|
-
|
|
46753
|
-
|
|
46754
|
-
|
|
46755
|
-
|
|
46756
|
-
|
|
47259
|
+
object.intensity = this.intensity;
|
|
47260
|
+
object.bias = this.bias;
|
|
47261
|
+
object.normalBias = this.normalBias;
|
|
47262
|
+
object.radius = this.radius;
|
|
47263
|
+
object.blurSamples = this.blurSamples;
|
|
47264
|
+
object.mapSize = this.mapSize.toArray();
|
|
46757
47265
|
|
|
46758
47266
|
object.camera = this.camera.toJSON( false ).object;
|
|
46759
47267
|
delete object.camera.matrix;
|
|
@@ -47386,11 +47894,29 @@ class SpotLightShadow extends LightShadow {
|
|
|
47386
47894
|
super.copy( source );
|
|
47387
47895
|
|
|
47388
47896
|
this.focus = source.focus;
|
|
47897
|
+
this.aspect = source.aspect;
|
|
47389
47898
|
|
|
47390
47899
|
return this;
|
|
47391
47900
|
|
|
47392
47901
|
}
|
|
47393
47902
|
|
|
47903
|
+
/**
|
|
47904
|
+
* Serializes the light shadow into JSON.
|
|
47905
|
+
*
|
|
47906
|
+
* @return {Object} A JSON object representing the serialized light shadow.
|
|
47907
|
+
* @see {@link ObjectLoader#parse}
|
|
47908
|
+
*/
|
|
47909
|
+
toJSON() {
|
|
47910
|
+
|
|
47911
|
+
const object = super.toJSON();
|
|
47912
|
+
|
|
47913
|
+
object.focus = this.focus;
|
|
47914
|
+
object.aspect = this.aspect;
|
|
47915
|
+
|
|
47916
|
+
return object;
|
|
47917
|
+
|
|
47918
|
+
}
|
|
47919
|
+
|
|
47394
47920
|
}
|
|
47395
47921
|
|
|
47396
47922
|
/**
|
|
@@ -49066,6 +49592,8 @@ class BufferGeometryLoader extends Loader {
|
|
|
49066
49592
|
const ib = new InterleavedBuffer( array, interleavedBuffer.stride );
|
|
49067
49593
|
ib.uuid = interleavedBuffer.uuid;
|
|
49068
49594
|
|
|
49595
|
+
if ( interleavedBuffer.usage !== undefined ) ib.setUsage( interleavedBuffer.usage );
|
|
49596
|
+
|
|
49069
49597
|
interleavedBufferMap[ uuid ] = ib;
|
|
49070
49598
|
|
|
49071
49599
|
return ib;
|
|
@@ -49120,6 +49648,7 @@ class BufferGeometryLoader extends Loader {
|
|
|
49120
49648
|
|
|
49121
49649
|
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
|
|
49122
49650
|
if ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );
|
|
49651
|
+
if ( attribute.gpuType !== undefined ) bufferAttribute.gpuType = attribute.gpuType;
|
|
49123
49652
|
|
|
49124
49653
|
geometry.setAttribute( key, bufferAttribute );
|
|
49125
49654
|
|
|
@@ -49153,6 +49682,8 @@ class BufferGeometryLoader extends Loader {
|
|
|
49153
49682
|
}
|
|
49154
49683
|
|
|
49155
49684
|
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
|
|
49685
|
+
if ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );
|
|
49686
|
+
if ( attribute.gpuType !== undefined ) bufferAttribute.gpuType = attribute.gpuType;
|
|
49156
49687
|
array.push( bufferAttribute );
|
|
49157
49688
|
|
|
49158
49689
|
}
|
|
@@ -49685,14 +50216,14 @@ class ObjectLoader extends Loader {
|
|
|
49685
50216
|
|
|
49686
50217
|
}
|
|
49687
50218
|
|
|
49688
|
-
images[ image.uuid ] = new
|
|
50219
|
+
images[ image.uuid ] = new TextureSource( imageArray );
|
|
49689
50220
|
|
|
49690
50221
|
} else {
|
|
49691
50222
|
|
|
49692
50223
|
// load single image
|
|
49693
50224
|
|
|
49694
50225
|
const deserializedImage = deserializeImage( image.url );
|
|
49695
|
-
images[ image.uuid ] = new
|
|
50226
|
+
images[ image.uuid ] = new TextureSource( deserializedImage );
|
|
49696
50227
|
|
|
49697
50228
|
|
|
49698
50229
|
}
|
|
@@ -49782,14 +50313,14 @@ class ObjectLoader extends Loader {
|
|
|
49782
50313
|
|
|
49783
50314
|
}
|
|
49784
50315
|
|
|
49785
|
-
images[ image.uuid ] = new
|
|
50316
|
+
images[ image.uuid ] = new TextureSource( imageArray );
|
|
49786
50317
|
|
|
49787
50318
|
} else {
|
|
49788
50319
|
|
|
49789
50320
|
// load single image
|
|
49790
50321
|
|
|
49791
50322
|
const deserializedImage = await deserializeImage( image.url );
|
|
49792
|
-
images[ image.uuid ] = new
|
|
50323
|
+
images[ image.uuid ] = new TextureSource( deserializedImage );
|
|
49793
50324
|
|
|
49794
50325
|
}
|
|
49795
50326
|
|
|
@@ -50303,6 +50834,9 @@ class ObjectLoader extends Loader {
|
|
|
50303
50834
|
if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;
|
|
50304
50835
|
if ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;
|
|
50305
50836
|
if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;
|
|
50837
|
+
if ( data.shadow.blurSamples !== undefined ) object.shadow.blurSamples = data.shadow.blurSamples;
|
|
50838
|
+
if ( data.shadow.focus !== undefined ) object.shadow.focus = data.shadow.focus;
|
|
50839
|
+
if ( data.shadow.aspect !== undefined ) object.shadow.aspect = data.shadow.aspect;
|
|
50306
50840
|
if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );
|
|
50307
50841
|
if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );
|
|
50308
50842
|
|
|
@@ -50621,7 +51155,7 @@ class ImageBitmapLoader extends Loader {
|
|
|
50621
51155
|
|
|
50622
51156
|
} ).then( function ( blob ) {
|
|
50623
51157
|
|
|
50624
|
-
return createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );
|
|
51158
|
+
return createImageBitmap( blob, Object.assign( {}, scope.options, { colorSpaceConversion: 'none' } ) );
|
|
50625
51159
|
|
|
50626
51160
|
} ).then( function ( imageBitmap ) {
|
|
50627
51161
|
|
|
@@ -50631,6 +51165,8 @@ class ImageBitmapLoader extends Loader {
|
|
|
50631
51165
|
|
|
50632
51166
|
scope.manager.itemEnd( url );
|
|
50633
51167
|
|
|
51168
|
+
return imageBitmap; // see #34150
|
|
51169
|
+
|
|
50634
51170
|
} ).catch( function ( e ) {
|
|
50635
51171
|
|
|
50636
51172
|
if ( onError ) onError( e );
|
|
@@ -54211,12 +54747,24 @@ class AnimationObjectGroup {
|
|
|
54211
54747
|
lastIndex = -- nObjects,
|
|
54212
54748
|
lastObject = objects[ lastIndex ];
|
|
54213
54749
|
|
|
54214
|
-
|
|
54215
|
-
|
|
54750
|
+
if ( index !== firstActiveIndex ) {
|
|
54751
|
+
|
|
54752
|
+
// last cached object takes this object's place
|
|
54753
|
+
|
|
54754
|
+
indicesByUUID[ lastCachedObject.uuid ] = index;
|
|
54755
|
+
|
|
54756
|
+
}
|
|
54757
|
+
|
|
54216
54758
|
objects[ index ] = lastCachedObject;
|
|
54217
54759
|
|
|
54218
|
-
|
|
54219
|
-
|
|
54760
|
+
if ( firstActiveIndex !== lastIndex ) {
|
|
54761
|
+
|
|
54762
|
+
// last object goes to the activated slot and pop
|
|
54763
|
+
|
|
54764
|
+
indicesByUUID[ lastObject.uuid ] = firstActiveIndex;
|
|
54765
|
+
|
|
54766
|
+
}
|
|
54767
|
+
|
|
54220
54768
|
objects[ firstActiveIndex ] = lastObject;
|
|
54221
54769
|
objects.pop();
|
|
54222
54770
|
|
|
@@ -54241,7 +54789,7 @@ class AnimationObjectGroup {
|
|
|
54241
54789
|
const lastIndex = -- nObjects,
|
|
54242
54790
|
lastObject = objects[ lastIndex ];
|
|
54243
54791
|
|
|
54244
|
-
if (
|
|
54792
|
+
if ( index !== lastIndex ) {
|
|
54245
54793
|
|
|
54246
54794
|
indicesByUUID[ lastObject.uuid ] = index;
|
|
54247
54795
|
|
|
@@ -54325,7 +54873,7 @@ class AnimationObjectGroup {
|
|
|
54325
54873
|
bindings = this._bindings,
|
|
54326
54874
|
lastBindingsIndex = bindings.length - 1,
|
|
54327
54875
|
lastBindings = bindings[ lastBindingsIndex ],
|
|
54328
|
-
lastBindingsPath =
|
|
54876
|
+
lastBindingsPath = paths[ lastBindingsIndex ];
|
|
54329
54877
|
|
|
54330
54878
|
indicesByPath[ lastBindingsPath ] = index;
|
|
54331
54879
|
|
|
@@ -56167,15 +56715,19 @@ class RenderTarget3D extends RenderTarget {
|
|
|
56167
56715
|
|
|
56168
56716
|
this.depth = depth;
|
|
56169
56717
|
|
|
56170
|
-
|
|
56171
|
-
* Overwritten with a different texture type.
|
|
56172
|
-
*
|
|
56173
|
-
* @type {Data3DTexture}
|
|
56174
|
-
*/
|
|
56175
|
-
this.texture = new Data3DTexture( null, width, height, depth );
|
|
56176
|
-
this._setTextureOptions( options );
|
|
56718
|
+
// overwrite attachments with 3D textures
|
|
56177
56719
|
|
|
56178
|
-
this.
|
|
56720
|
+
for ( let i = 0; i < this.textures.length; i ++ ) {
|
|
56721
|
+
|
|
56722
|
+
const texture = new Data3DTexture( null, width, height, depth );
|
|
56723
|
+
texture.isRenderTargetTexture = true;
|
|
56724
|
+
texture.renderTarget = this;
|
|
56725
|
+
|
|
56726
|
+
this.textures[ i ] = texture;
|
|
56727
|
+
|
|
56728
|
+
}
|
|
56729
|
+
|
|
56730
|
+
this._setTextureOptions( options );
|
|
56179
56731
|
|
|
56180
56732
|
}
|
|
56181
56733
|
|
|
@@ -56825,6 +57377,10 @@ class Raycaster {
|
|
|
56825
57377
|
* be detected. To raycast against both faces of an object, you'll want to set {@link Material#side}
|
|
56826
57378
|
* to `THREE.DoubleSide`.
|
|
56827
57379
|
*
|
|
57380
|
+
* Note that a ray hitting a triangle mesh exactly along an edge shared by two faces may be
|
|
57381
|
+
* reported by both faces, resulting in two coincident intersections (identical point and
|
|
57382
|
+
* distance) in the returned array.
|
|
57383
|
+
*
|
|
56828
57384
|
* @param {Object3D} object - The 3D object to check for intersection with the ray.
|
|
56829
57385
|
* @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.
|
|
56830
57386
|
* Otherwise it only checks intersection with the object.
|
|
@@ -58224,6 +58780,8 @@ class SpotLightHelper extends Object3D {
|
|
|
58224
58780
|
*/
|
|
58225
58781
|
dispose() {
|
|
58226
58782
|
|
|
58783
|
+
super.dispose();
|
|
58784
|
+
|
|
58227
58785
|
this.cone.geometry.dispose();
|
|
58228
58786
|
this.cone.material.dispose();
|
|
58229
58787
|
|
|
@@ -58435,6 +58993,8 @@ class SkeletonHelper extends LineSegments {
|
|
|
58435
58993
|
*/
|
|
58436
58994
|
dispose() {
|
|
58437
58995
|
|
|
58996
|
+
super.dispose();
|
|
58997
|
+
|
|
58438
58998
|
this.geometry.dispose();
|
|
58439
58999
|
this.material.dispose();
|
|
58440
59000
|
|
|
@@ -58526,6 +59086,8 @@ class PointLightHelper extends Mesh {
|
|
|
58526
59086
|
*/
|
|
58527
59087
|
dispose() {
|
|
58528
59088
|
|
|
59089
|
+
super.dispose();
|
|
59090
|
+
|
|
58529
59091
|
this.geometry.dispose();
|
|
58530
59092
|
this.material.dispose();
|
|
58531
59093
|
|
|
@@ -58646,6 +59208,8 @@ class HemisphereLightHelper extends Object3D {
|
|
|
58646
59208
|
*/
|
|
58647
59209
|
dispose() {
|
|
58648
59210
|
|
|
59211
|
+
super.dispose();
|
|
59212
|
+
|
|
58649
59213
|
this.children[ 0 ].geometry.dispose();
|
|
58650
59214
|
this.children[ 0 ].material.dispose();
|
|
58651
59215
|
|
|
@@ -58759,6 +59323,8 @@ class GridHelper extends LineSegments {
|
|
|
58759
59323
|
*/
|
|
58760
59324
|
dispose() {
|
|
58761
59325
|
|
|
59326
|
+
super.dispose();
|
|
59327
|
+
|
|
58762
59328
|
this.geometry.dispose();
|
|
58763
59329
|
this.material.dispose();
|
|
58764
59330
|
|
|
@@ -58877,6 +59443,8 @@ class PolarGridHelper extends LineSegments {
|
|
|
58877
59443
|
*/
|
|
58878
59444
|
dispose() {
|
|
58879
59445
|
|
|
59446
|
+
super.dispose();
|
|
59447
|
+
|
|
58880
59448
|
this.geometry.dispose();
|
|
58881
59449
|
this.material.dispose();
|
|
58882
59450
|
|
|
@@ -58982,6 +59550,8 @@ class DirectionalLightHelper extends Object3D {
|
|
|
58982
59550
|
*/
|
|
58983
59551
|
dispose() {
|
|
58984
59552
|
|
|
59553
|
+
super.dispose();
|
|
59554
|
+
|
|
58985
59555
|
this.lightPlane.geometry.dispose();
|
|
58986
59556
|
this.lightPlane.material.dispose();
|
|
58987
59557
|
this.targetLine.geometry.dispose();
|
|
@@ -59332,6 +59902,8 @@ class CameraHelper extends LineSegments {
|
|
|
59332
59902
|
*/
|
|
59333
59903
|
dispose() {
|
|
59334
59904
|
|
|
59905
|
+
super.dispose();
|
|
59906
|
+
|
|
59335
59907
|
this.geometry.dispose();
|
|
59336
59908
|
this.material.dispose();
|
|
59337
59909
|
|
|
@@ -59494,6 +60066,8 @@ class BoxHelper extends LineSegments {
|
|
|
59494
60066
|
*/
|
|
59495
60067
|
dispose() {
|
|
59496
60068
|
|
|
60069
|
+
super.dispose();
|
|
60070
|
+
|
|
59497
60071
|
this.geometry.dispose();
|
|
59498
60072
|
this.material.dispose();
|
|
59499
60073
|
|
|
@@ -59571,6 +60145,8 @@ class Box3Helper extends LineSegments {
|
|
|
59571
60145
|
*/
|
|
59572
60146
|
dispose() {
|
|
59573
60147
|
|
|
60148
|
+
super.dispose();
|
|
60149
|
+
|
|
59574
60150
|
this.geometry.dispose();
|
|
59575
60151
|
this.material.dispose();
|
|
59576
60152
|
|
|
@@ -59657,6 +60233,8 @@ class PlaneHelper extends Line {
|
|
|
59657
60233
|
*/
|
|
59658
60234
|
dispose() {
|
|
59659
60235
|
|
|
60236
|
+
super.dispose();
|
|
60237
|
+
|
|
59660
60238
|
this.geometry.dispose();
|
|
59661
60239
|
this.material.dispose();
|
|
59662
60240
|
this.children[ 0 ].geometry.dispose();
|
|
@@ -59817,6 +60395,8 @@ class ArrowHelper extends Object3D {
|
|
|
59817
60395
|
*/
|
|
59818
60396
|
dispose() {
|
|
59819
60397
|
|
|
60398
|
+
super.dispose();
|
|
60399
|
+
|
|
59820
60400
|
this.line.geometry.dispose();
|
|
59821
60401
|
this.line.material.dispose();
|
|
59822
60402
|
this.cone.geometry.dispose();
|
|
@@ -59907,6 +60487,8 @@ class AxesHelper extends LineSegments {
|
|
|
59907
60487
|
*/
|
|
59908
60488
|
dispose() {
|
|
59909
60489
|
|
|
60490
|
+
super.dispose();
|
|
60491
|
+
|
|
59910
60492
|
this.geometry.dispose();
|
|
59911
60493
|
this.material.dispose();
|
|
59912
60494
|
|
|
@@ -60342,13 +60924,6 @@ class Controls extends EventDispatcher {
|
|
|
60342
60924
|
*/
|
|
60343
60925
|
connect( element ) {
|
|
60344
60926
|
|
|
60345
|
-
if ( element === undefined ) {
|
|
60346
|
-
|
|
60347
|
-
warn( 'Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185
|
|
60348
|
-
return;
|
|
60349
|
-
|
|
60350
|
-
}
|
|
60351
|
-
|
|
60352
60927
|
if ( this.domElement !== null ) this.disconnect();
|
|
60353
60928
|
|
|
60354
60929
|
this.domElement = element;
|
|
@@ -62399,4 +62974,4 @@ if ( typeof window !== 'undefined' ) {
|
|
|
62399
62974
|
|
|
62400
62975
|
}
|
|
62401
62976
|
|
|
62402
|
-
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, BezierInterpolant, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, Compatibility, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeDepthTexture, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HTMLTexture, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateBezier, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialBlending, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoNormalPacking, NoToneMapping, NodePath, NormalAnimationBlendMode, NormalBlending, NormalGAPacking, NormalRGPacking, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, ProfilerService, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, R11_EAC_Format, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RG11_EAC_Format, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, ReversedDepthFuncs, RingGeometry, SIGNED_R11_EAC_Format, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SIGNED_RG11_EAC_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, XorShift32, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, allocateNodeId, cloneUniforms, collectSiblingNodeIds, configureNodeIdSeed, createCanvasElement, createElementNS, ensureUniqueNodeIdAmongParentChildren, error, generateNodeId, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, hashStringToUint32, isTypedArray, isValidNodeId, log, mergeUniforms, nodeIdFromKey, nodeIdFromString, nodeIdToString, probeAsync, profile, profileClass, randomSeedUint32, setConsoleFunction, warn, warnOnce, xorshift32, yieldToMain };
|
|
62977
|
+
export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, BezierInterpolant, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, Compatibility, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeDepthTexture, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HTMLTexture, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateBezier, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialBlending, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoNormalPacking, NoToneMapping, NodePath, NormalAnimationBlendMode, NormalBlending, NormalGAPacking, NormalRGPacking, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, ProfilerService, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, R11_EAC_Format, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RG11_EAC_Format, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderObjectRefreshType, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, ReversedDepthFuncs, RingGeometry, SIGNED_R11_EAC_Format, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SIGNED_RG11_EAC_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureSource, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, XorShift32, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, allocateNodeId, cloneUniforms, collectSiblingNodeIds, configureNodeIdSeed, createCanvasElement, createElementNS, ensureUniqueNodeIdAmongParentChildren, error, generateNodeId, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, hashStringToUint32, isTypedArray, isValidNodeId, log, mergeUniforms, nodeIdFromKey, nodeIdFromString, nodeIdToString, probeAsync, profile, profileClass, randomSeedUint32, setConsoleFunction, warn, warnOnce, xorshift32, yieldToMain };
|