three-stdlib 2.22.10 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_polyfill/CompressedArrayTexture.cjs +12 -0
- package/dist/_polyfill/CompressedArrayTexture.js +6 -6
- package/dist/_polyfill/Data3DTexture.cjs +17 -0
- package/dist/_polyfill/Data3DTexture.js +8 -8
- package/dist/animation/{AnimationClipCreator.mjs → AnimationClipCreator.cjs} +18 -18
- package/dist/animation/AnimationClipCreator.js +18 -18
- package/dist/animation/{CCDIKSolver.mjs → CCDIKSolver.cjs} +32 -32
- package/dist/animation/CCDIKSolver.js +32 -32
- package/dist/animation/{MMDAnimationHelper.mjs → MMDAnimationHelper.cjs} +17 -17
- package/dist/animation/MMDAnimationHelper.js +17 -17
- package/dist/animation/{MMDPhysics.mjs → MMDPhysics.cjs} +25 -25
- package/dist/animation/MMDPhysics.js +25 -25
- package/dist/cameras/{CinematicCamera.mjs → CinematicCamera.cjs} +17 -17
- package/dist/cameras/CinematicCamera.js +17 -17
- package/dist/controls/{ArcballControls.mjs → ArcballControls.cjs} +102 -102
- package/dist/controls/ArcballControls.js +102 -102
- package/dist/controls/{DeviceOrientationControls.mjs → DeviceOrientationControls.cjs} +14 -14
- package/dist/controls/DeviceOrientationControls.js +14 -14
- package/dist/controls/{DragControls.mjs → DragControls.cjs} +12 -12
- package/dist/controls/DragControls.js +12 -12
- package/dist/controls/{FirstPersonControls.mjs → FirstPersonControls.cjs} +16 -16
- package/dist/controls/FirstPersonControls.js +16 -16
- package/dist/controls/{FlyControls.mjs → FlyControls.cjs} +10 -10
- package/dist/controls/FlyControls.js +10 -10
- package/dist/controls/{OrbitControls.mjs → OrbitControls.cjs} +52 -54
- package/dist/controls/OrbitControls.d.ts +4 -4
- package/dist/controls/OrbitControls.js +52 -54
- package/dist/controls/{PointerLockControls.mjs → PointerLockControls.cjs} +8 -8
- package/dist/controls/PointerLockControls.js +8 -8
- package/dist/controls/{TrackballControls.mjs → TrackballControls.cjs} +32 -32
- package/dist/controls/TrackballControls.d.ts +2 -2
- package/dist/controls/TrackballControls.js +32 -32
- package/dist/controls/{TransformControls.mjs → TransformControls.cjs} +169 -169
- package/dist/controls/TransformControls.js +169 -169
- package/dist/controls/experimental/{CameraControls.mjs → CameraControls.cjs} +59 -59
- package/dist/controls/experimental/CameraControls.js +59 -59
- package/dist/csm/{CSM.mjs → CSM.cjs} +17 -17
- package/dist/csm/CSM.js +17 -17
- package/dist/csm/{CSMFrustum.mjs → CSMFrustum.cjs} +7 -7
- package/dist/csm/CSMFrustum.js +7 -7
- package/dist/csm/{CSMHelper.mjs → CSMHelper.cjs} +14 -14
- package/dist/csm/CSMHelper.js +14 -14
- package/dist/csm/{CSMShader.mjs → CSMShader.cjs} +5 -5
- package/dist/csm/CSMShader.js +5 -5
- package/dist/curves/{CurveExtras.mjs → CurveExtras.cjs} +45 -45
- package/dist/curves/CurveExtras.js +45 -45
- package/dist/curves/{NURBSCurve.mjs → NURBSCurve.cjs} +11 -11
- package/dist/curves/NURBSCurve.js +11 -11
- package/dist/curves/{NURBSSurface.mjs → NURBSSurface.cjs} +7 -7
- package/dist/curves/NURBSSurface.js +7 -7
- package/dist/curves/{NURBSUtils.mjs → NURBSUtils.cjs} +17 -17
- package/dist/curves/NURBSUtils.js +17 -17
- package/dist/deprecated/{Geometry.mjs → Geometry.cjs} +51 -51
- package/dist/deprecated/Geometry.js +51 -51
- package/dist/effects/{AnaglyphEffect.mjs → AnaglyphEffect.cjs} +14 -14
- package/dist/effects/AnaglyphEffect.js +14 -14
- package/dist/effects/{AsciiEffect.mjs → AsciiEffect.cjs} +3 -3
- package/dist/effects/AsciiEffect.js +3 -3
- package/dist/effects/{OutlineEffect.mjs → OutlineEffect.cjs} +8 -8
- package/dist/effects/OutlineEffect.js +8 -8
- package/dist/effects/{ParallaxBarrierEffect.mjs → ParallaxBarrierEffect.cjs} +12 -12
- package/dist/effects/ParallaxBarrierEffect.js +12 -12
- package/dist/effects/{PeppersGhostEffect.mjs → PeppersGhostEffect.cjs} +11 -11
- package/dist/effects/PeppersGhostEffect.js +11 -11
- package/dist/effects/{StereoEffect.mjs → StereoEffect.cjs} +6 -6
- package/dist/effects/StereoEffect.js +6 -6
- package/dist/environments/RoomEnvironment.cjs +95 -0
- package/dist/environments/RoomEnvironment.js +23 -40
- package/dist/exporters/{ColladaExporter.mjs → ColladaExporter.cjs} +16 -16
- package/dist/exporters/ColladaExporter.js +16 -16
- package/dist/exporters/{DRACOExporter.mjs → DRACOExporter.cjs} +8 -8
- package/dist/exporters/DRACOExporter.js +8 -8
- package/dist/exporters/{GLTFExporter.mjs → GLTFExporter.cjs} +52 -49
- package/dist/exporters/GLTFExporter.js +52 -49
- package/dist/exporters/{MMDExporter.mjs → MMDExporter.cjs} +10 -10
- package/dist/exporters/MMDExporter.js +10 -10
- package/dist/exporters/{OBJExporter.mjs → OBJExporter.cjs} +13 -13
- package/dist/exporters/OBJExporter.js +13 -13
- package/dist/exporters/{PLYExporter.mjs → PLYExporter.cjs} +8 -8
- package/dist/exporters/PLYExporter.js +8 -8
- package/dist/exporters/{STLExporter.mjs → STLExporter.cjs} +12 -12
- package/dist/exporters/STLExporter.js +12 -12
- package/dist/exporters/{USDZExporter.mjs → USDZExporter.cjs} +10 -10
- package/dist/exporters/USDZExporter.js +10 -10
- package/dist/geometries/{BoxLineGeometry.mjs → BoxLineGeometry.cjs} +6 -6
- package/dist/geometries/BoxLineGeometry.js +6 -6
- package/dist/geometries/ConvexGeometry.cjs +26 -0
- package/dist/geometries/ConvexGeometry.js +9 -9
- package/dist/geometries/{DecalGeometry.mjs → DecalGeometry.cjs} +16 -16
- package/dist/geometries/DecalGeometry.js +16 -16
- package/dist/geometries/{LightningStrike.mjs → LightningStrike.cjs} +45 -45
- package/dist/geometries/LightningStrike.js +45 -45
- package/dist/geometries/{ParametricGeometries.mjs → ParametricGeometries.cjs} +11 -11
- package/dist/geometries/ParametricGeometries.js +11 -11
- package/dist/geometries/{ParametricGeometry.mjs → ParametricGeometry.cjs} +11 -11
- package/dist/geometries/ParametricGeometry.js +11 -11
- package/dist/geometries/{RoundedBoxGeometry.mjs → RoundedBoxGeometry.cjs} +10 -10
- package/dist/geometries/RoundedBoxGeometry.js +10 -10
- package/dist/geometries/{TeapotGeometry.mjs → TeapotGeometry.cjs} +21 -21
- package/dist/geometries/TeapotGeometry.js +21 -21
- package/dist/geometries/{TextGeometry.mjs → TextGeometry.cjs} +6 -6
- package/dist/geometries/TextGeometry.js +6 -6
- package/dist/helpers/{LightProbeHelper.mjs → LightProbeHelper.cjs} +7 -7
- package/dist/helpers/LightProbeHelper.js +7 -7
- package/dist/helpers/{PositionalAudioHelper.mjs → PositionalAudioHelper.cjs} +11 -11
- package/dist/helpers/PositionalAudioHelper.js +11 -11
- package/dist/helpers/{RectAreaLightHelper.mjs → RectAreaLightHelper.cjs} +11 -11
- package/dist/helpers/RectAreaLightHelper.js +11 -11
- package/dist/helpers/{VertexNormalsHelper.mjs → VertexNormalsHelper.cjs} +11 -11
- package/dist/helpers/VertexNormalsHelper.js +11 -11
- package/dist/helpers/{VertexTangentsHelper.mjs → VertexTangentsHelper.cjs} +10 -10
- package/dist/helpers/VertexTangentsHelper.js +10 -10
- package/dist/index.cjs +613 -0
- package/dist/index.js +613 -613
- package/dist/interactive/{HTMLMesh.mjs → HTMLMesh.cjs} +11 -11
- package/dist/interactive/HTMLMesh.js +11 -11
- package/dist/interactive/{InteractiveGroup.mjs → InteractiveGroup.cjs} +8 -8
- package/dist/interactive/InteractiveGroup.js +8 -8
- package/dist/interactive/{SelectionBox.mjs → SelectionBox.cjs} +21 -21
- package/dist/interactive/SelectionBox.js +21 -21
- package/dist/interactive/{SelectionHelper.mjs → SelectionHelper.cjs} +7 -7
- package/dist/interactive/SelectionHelper.js +7 -7
- package/dist/libs/{MeshoptDecoder.mjs → MeshoptDecoder.cjs} +3 -3
- package/dist/libs/MeshoptDecoder.js +3 -3
- package/dist/libs/{MotionControllers.mjs → MotionControllers.cjs} +6 -6
- package/dist/libs/MotionControllers.js +6 -6
- package/dist/lights/{LightProbeGenerator.mjs → LightProbeGenerator.cjs} +16 -16
- package/dist/lights/LightProbeGenerator.js +16 -16
- package/dist/lights/{RectAreaLightUniformsLib.mjs → RectAreaLightUniformsLib.cjs} +42 -42
- package/dist/lights/RectAreaLightUniformsLib.js +42 -42
- package/dist/lines/Line2.cjs +13 -0
- package/dist/lines/Line2.js +8 -8
- package/dist/lines/{LineGeometry.mjs → LineGeometry.cjs} +5 -5
- package/dist/lines/LineGeometry.js +5 -5
- package/dist/lines/{LineMaterial.mjs → LineMaterial.cjs} +10 -10
- package/dist/lines/LineMaterial.js +10 -10
- package/dist/lines/{LineSegments2.mjs → LineSegments2.cjs} +28 -28
- package/dist/lines/LineSegments2.js +28 -28
- package/dist/lines/{LineSegmentsGeometry.mjs → LineSegmentsGeometry.cjs} +18 -18
- package/dist/lines/LineSegmentsGeometry.js +18 -18
- package/dist/lines/Wireframe.cjs +32 -0
- package/dist/lines/Wireframe.js +13 -13
- package/dist/lines/WireframeGeometry2.cjs +13 -0
- package/dist/lines/WireframeGeometry2.js +7 -7
- package/dist/loaders/{3DMLoader.mjs → 3DMLoader.cjs} +37 -37
- package/dist/loaders/3DMLoader.js +37 -37
- package/dist/loaders/{3MFLoader.mjs → 3MFLoader.cjs} +53 -53
- package/dist/loaders/3MFLoader.js +53 -53
- package/dist/loaders/{AMFLoader.mjs → AMFLoader.cjs} +19 -19
- package/dist/loaders/AMFLoader.js +19 -19
- package/dist/loaders/{AssimpLoader.mjs → AssimpLoader.cjs} +41 -41
- package/dist/loaders/AssimpLoader.js +41 -41
- package/dist/loaders/{BVHLoader.mjs → BVHLoader.cjs} +18 -18
- package/dist/loaders/BVHLoader.js +18 -18
- package/dist/loaders/{BasisTextureLoader.mjs → BasisTextureLoader.cjs} +22 -22
- package/dist/loaders/BasisTextureLoader.js +22 -22
- package/dist/loaders/{ColladaLoader.mjs → ColladaLoader.cjs} +76 -76
- package/dist/loaders/ColladaLoader.js +76 -76
- package/dist/loaders/{DDSLoader.mjs → DDSLoader.cjs} +10 -10
- package/dist/loaders/DDSLoader.js +10 -10
- package/dist/loaders/{DRACOLoader.mjs → DRACOLoader.cjs} +12 -12
- package/dist/loaders/DRACOLoader.js +12 -12
- package/dist/loaders/{EXRLoader.mjs → EXRLoader.cjs} +23 -23
- package/dist/loaders/EXRLoader.js +23 -23
- package/dist/loaders/{FBXLoader.mjs → FBXLoader.cjs} +116 -116
- package/dist/loaders/FBXLoader.js +116 -116
- package/dist/loaders/{FontLoader.mjs → FontLoader.cjs} +9 -9
- package/dist/loaders/FontLoader.js +9 -9
- package/dist/loaders/{GCodeLoader.mjs → GCodeLoader.cjs} +13 -13
- package/dist/loaders/GCodeLoader.js +13 -13
- package/dist/loaders/{GLTFLoader.mjs → GLTFLoader.cjs} +112 -112
- package/dist/loaders/GLTFLoader.js +112 -112
- package/dist/loaders/{HDRCubeTextureLoader.mjs → HDRCubeTextureLoader.cjs} +15 -15
- package/dist/loaders/HDRCubeTextureLoader.js +15 -15
- package/dist/loaders/{KMZLoader.mjs → KMZLoader.cjs} +13 -13
- package/dist/loaders/KMZLoader.js +13 -13
- package/dist/loaders/{KTX2Loader.mjs → KTX2Loader.cjs} +65 -65
- package/dist/loaders/KTX2Loader.js +65 -65
- package/dist/loaders/{KTXLoader.mjs → KTXLoader.cjs} +5 -5
- package/dist/loaders/KTXLoader.js +5 -5
- package/dist/loaders/{LDrawLoader.mjs → LDrawLoader.cjs} +39 -39
- package/dist/loaders/LDrawLoader.js +39 -39
- package/dist/loaders/{LUT3dlLoader.mjs → LUT3dlLoader.cjs} +22 -22
- package/dist/loaders/LUT3dlLoader.js +22 -22
- package/dist/loaders/{LUTCubeLoader.mjs → LUTCubeLoader.cjs} +22 -22
- package/dist/loaders/LUTCubeLoader.js +22 -22
- package/dist/loaders/{LWOLoader.mjs → LWOLoader.cjs} +42 -42
- package/dist/loaders/LWOLoader.js +42 -42
- package/dist/loaders/{LottieLoader.mjs → LottieLoader.cjs} +8 -8
- package/dist/loaders/LottieLoader.js +8 -8
- package/dist/loaders/{MD2Loader.mjs → MD2Loader.cjs} +15 -15
- package/dist/loaders/MD2Loader.js +15 -15
- package/dist/loaders/{MDDLoader.mjs → MDDLoader.cjs} +9 -9
- package/dist/loaders/MDDLoader.js +9 -9
- package/dist/loaders/{MMDLoader.mjs → MMDLoader.cjs} +59 -59
- package/dist/loaders/MMDLoader.js +59 -59
- package/dist/loaders/{MTLLoader.mjs → MTLLoader.cjs} +17 -17
- package/dist/loaders/MTLLoader.js +17 -17
- package/dist/loaders/{NRRDLoader.mjs → NRRDLoader.cjs} +17 -17
- package/dist/loaders/NRRDLoader.js +17 -17
- package/dist/loaders/{OBJLoader.mjs → OBJLoader.cjs} +37 -37
- package/dist/loaders/OBJLoader.js +37 -37
- package/dist/loaders/{PCDLoader.mjs → PCDLoader.cjs} +13 -13
- package/dist/loaders/PCDLoader.js +13 -13
- package/dist/loaders/{PDBLoader.mjs → PDBLoader.cjs} +11 -11
- package/dist/loaders/PDBLoader.js +11 -11
- package/dist/loaders/{PLYLoader.mjs → PLYLoader.cjs} +13 -13
- package/dist/loaders/PLYLoader.js +13 -13
- package/dist/loaders/{PRWMLoader.mjs → PRWMLoader.cjs} +9 -9
- package/dist/loaders/PRWMLoader.js +9 -9
- package/dist/loaders/{PVRLoader.mjs → PVRLoader.cjs} +11 -11
- package/dist/loaders/PVRLoader.js +11 -11
- package/dist/loaders/{RGBELoader.mjs → RGBELoader.cjs} +18 -18
- package/dist/loaders/RGBELoader.js +18 -18
- package/dist/loaders/{RGBMLoader.mjs → RGBMLoader.cjs} +16 -16
- package/dist/loaders/RGBMLoader.js +16 -16
- package/dist/loaders/{STLLoader.mjs → STLLoader.cjs} +15 -15
- package/dist/loaders/STLLoader.js +15 -15
- package/dist/loaders/{SVGLoader.mjs → SVGLoader.cjs} +55 -55
- package/dist/loaders/SVGLoader.js +55 -55
- package/dist/loaders/{TDSLoader.mjs → TDSLoader.cjs} +20 -20
- package/dist/loaders/TDSLoader.js +20 -20
- package/dist/loaders/{TGALoader.mjs → TGALoader.cjs} +6 -6
- package/dist/loaders/TGALoader.js +6 -6
- package/dist/loaders/{TTFLoader.mjs → TTFLoader.cjs} +9 -9
- package/dist/loaders/TTFLoader.js +9 -9
- package/dist/loaders/{TiltLoader.mjs → TiltLoader.cjs} +26 -26
- package/dist/loaders/TiltLoader.js +26 -26
- package/dist/loaders/{VOXLoader.mjs → VOXLoader.cjs} +18 -18
- package/dist/loaders/VOXLoader.js +18 -18
- package/dist/loaders/{VRMLLoader.mjs → VRMLLoader.cjs} +125 -125
- package/dist/loaders/VRMLLoader.js +125 -125
- package/dist/loaders/{VRMLoader.mjs → VRMLoader.cjs} +7 -7
- package/dist/loaders/VRMLoader.js +7 -7
- package/dist/loaders/{VTKLoader.mjs → VTKLoader.cjs} +24 -24
- package/dist/loaders/VTKLoader.js +24 -24
- package/dist/loaders/{XLoader.mjs → XLoader.cjs} +42 -42
- package/dist/loaders/XLoader.js +42 -42
- package/dist/loaders/{XYZLoader.mjs → XYZLoader.cjs} +9 -9
- package/dist/loaders/XYZLoader.js +9 -9
- package/dist/loaders/lwo/{IFFParser.mjs → IFFParser.cjs} +7 -7
- package/dist/loaders/lwo/IFFParser.js +7 -7
- package/dist/loaders/lwo/{LWO2Parser.mjs → LWO2Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO2Parser.js +3 -3
- package/dist/loaders/lwo/{LWO3Parser.mjs → LWO3Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO3Parser.js +3 -3
- package/dist/math/{Capsule.mjs → Capsule.cjs} +8 -8
- package/dist/math/Capsule.js +8 -8
- package/dist/math/{ColorConverter.mjs → ColorConverter.cjs} +7 -7
- package/dist/math/ColorConverter.js +7 -7
- package/dist/math/{ConvexHull.mjs → ConvexHull.cjs} +18 -18
- package/dist/math/ConvexHull.js +18 -18
- package/dist/math/{ImprovedNoise.mjs → ImprovedNoise.cjs} +3 -3
- package/dist/math/ImprovedNoise.js +3 -3
- package/dist/math/{Lut.mjs → Lut.cjs} +14 -14
- package/dist/math/Lut.js +14 -14
- package/dist/math/{MeshSurfaceSampler.mjs → MeshSurfaceSampler.cjs} +6 -6
- package/dist/math/MeshSurfaceSampler.js +6 -6
- package/dist/math/{OBB.mjs → OBB.cjs} +21 -21
- package/dist/math/OBB.js +21 -21
- package/dist/math/{Octree.mjs → Octree.cjs} +19 -19
- package/dist/math/Octree.js +19 -19
- package/dist/math/{SimplexNoise.mjs → SimplexNoise.cjs} +3 -3
- package/dist/math/SimplexNoise.js +3 -3
- package/dist/misc/{ConvexObjectBreaker.mjs → ConvexObjectBreaker.cjs} +25 -25
- package/dist/misc/ConvexObjectBreaker.js +25 -25
- package/dist/misc/{GPUComputationRenderer.mjs → GPUComputationRenderer.cjs} +19 -19
- package/dist/misc/GPUComputationRenderer.js +19 -19
- package/dist/misc/{Gyroscope.mjs → Gyroscope.cjs} +11 -11
- package/dist/misc/Gyroscope.js +11 -11
- package/dist/misc/{MD2Character.mjs → MD2Character.cjs} +14 -14
- package/dist/misc/MD2Character.js +14 -14
- package/dist/misc/{MD2CharacterComplex.mjs → MD2CharacterComplex.cjs} +20 -20
- package/dist/misc/MD2CharacterComplex.js +20 -20
- package/dist/misc/{MorphAnimMesh.mjs → MorphAnimMesh.cjs} +8 -8
- package/dist/misc/MorphAnimMesh.js +8 -8
- package/dist/misc/{MorphBlendMesh.mjs → MorphBlendMesh.cjs} +6 -6
- package/dist/misc/MorphBlendMesh.js +6 -6
- package/dist/misc/{ProgressiveLightmap.mjs → ProgressiveLightmap.cjs} +17 -17
- package/dist/misc/ProgressiveLightmap.js +17 -17
- package/dist/misc/{RollerCoaster.mjs → RollerCoaster.cjs} +77 -77
- package/dist/misc/RollerCoaster.js +77 -77
- package/dist/misc/{Timer.mjs → Timer.cjs} +3 -3
- package/dist/misc/Timer.js +3 -3
- package/dist/misc/{TubePainter.mjs → TubePainter.cjs} +24 -24
- package/dist/misc/TubePainter.js +24 -24
- package/dist/misc/{Volume.mjs → Volume.cjs} +18 -18
- package/dist/misc/Volume.js +18 -18
- package/dist/misc/{VolumeSlice.mjs → VolumeSlice.cjs} +10 -10
- package/dist/misc/VolumeSlice.js +10 -10
- package/dist/misc/{WebGL.mjs → WebGL.cjs} +7 -7
- package/dist/misc/WebGL.js +7 -7
- package/dist/modifiers/{CurveModifier.mjs → CurveModifier.cjs} +17 -17
- package/dist/modifiers/CurveModifier.js +17 -17
- package/dist/modifiers/{EdgeSplitModifier.mjs → EdgeSplitModifier.cjs} +12 -13
- package/dist/modifiers/EdgeSplitModifier.js +13 -12
- package/dist/modifiers/{SimplifyModifier.mjs → SimplifyModifier.cjs} +12 -12
- package/dist/modifiers/SimplifyModifier.js +12 -12
- package/dist/modifiers/{TessellateModifier.mjs → TessellateModifier.cjs} +30 -30
- package/dist/modifiers/TessellateModifier.js +30 -30
- package/dist/objects/{GroundProjectedEnv.mjs → GroundProjectedEnv.cjs} +8 -8
- package/dist/objects/GroundProjectedEnv.js +8 -8
- package/dist/objects/{Lensflare.mjs → Lensflare.cjs} +37 -37
- package/dist/objects/Lensflare.js +37 -37
- package/dist/objects/{LightningStorm.mjs → LightningStorm.cjs} +17 -17
- package/dist/objects/LightningStorm.js +17 -17
- package/dist/objects/{MarchingCubes.mjs → MarchingCubes.cjs} +21 -21
- package/dist/objects/MarchingCubes.js +21 -21
- package/dist/objects/{Reflector.mjs → Reflector.cjs} +23 -23
- package/dist/objects/Reflector.js +23 -23
- package/dist/objects/{ReflectorForSSRPass.mjs → ReflectorForSSRPass.cjs} +33 -33
- package/dist/objects/ReflectorForSSRPass.js +33 -33
- package/dist/objects/ReflectorRTT.cjs +10 -0
- package/dist/objects/ReflectorRTT.js +5 -5
- package/dist/objects/{Refractor.mjs → Refractor.cjs} +26 -26
- package/dist/objects/Refractor.js +26 -26
- package/dist/objects/{ShadowMesh.mjs → ShadowMesh.cjs} +9 -9
- package/dist/objects/ShadowMesh.js +9 -9
- package/dist/objects/{Sky.mjs → Sky.cjs} +11 -11
- package/dist/objects/Sky.js +11 -11
- package/dist/objects/{Water.mjs → Water.cjs} +33 -33
- package/dist/objects/Water.js +33 -33
- package/dist/objects/{Water2.mjs → Water2.cjs} +20 -20
- package/dist/objects/Water2.js +20 -20
- package/dist/physics/{AmmoPhysics.mjs → AmmoPhysics.cjs} +3 -3
- package/dist/physics/AmmoPhysics.js +3 -3
- package/dist/postprocessing/{AdaptiveToneMappingPass.mjs → AdaptiveToneMappingPass.cjs} +32 -32
- package/dist/postprocessing/AdaptiveToneMappingPass.js +32 -32
- package/dist/postprocessing/{AfterimagePass.mjs → AfterimagePass.cjs} +21 -21
- package/dist/postprocessing/AfterimagePass.js +21 -21
- package/dist/postprocessing/{BloomPass.mjs → BloomPass.cjs} +20 -20
- package/dist/postprocessing/BloomPass.js +20 -20
- package/dist/postprocessing/{BokehPass.mjs → BokehPass.cjs} +19 -19
- package/dist/postprocessing/BokehPass.js +19 -19
- package/dist/postprocessing/{ClearPass.mjs → ClearPass.cjs} +7 -7
- package/dist/postprocessing/ClearPass.js +7 -7
- package/dist/postprocessing/{CubeTexturePass.mjs → CubeTexturePass.cjs} +14 -14
- package/dist/postprocessing/CubeTexturePass.js +14 -14
- package/dist/postprocessing/{DotScreenPass.mjs → DotScreenPass.cjs} +12 -12
- package/dist/postprocessing/DotScreenPass.js +12 -12
- package/dist/postprocessing/{EffectComposer.mjs → EffectComposer.cjs} +20 -20
- package/dist/postprocessing/EffectComposer.js +20 -20
- package/dist/postprocessing/{FilmPass.mjs → FilmPass.cjs} +12 -12
- package/dist/postprocessing/FilmPass.js +12 -12
- package/dist/postprocessing/{GlitchPass.mjs → GlitchPass.cjs} +26 -26
- package/dist/postprocessing/GlitchPass.js +26 -26
- package/dist/postprocessing/{HalftonePass.mjs → HalftonePass.cjs} +13 -13
- package/dist/postprocessing/HalftonePass.js +13 -13
- package/dist/postprocessing/{LUTPass.mjs → LUTPass.cjs} +5 -5
- package/dist/postprocessing/LUTPass.js +5 -5
- package/dist/postprocessing/{MaskPass.mjs → MaskPass.cjs} +7 -7
- package/dist/postprocessing/MaskPass.js +7 -7
- package/dist/postprocessing/{OutlinePass.mjs → OutlinePass.cjs} +45 -45
- package/dist/postprocessing/OutlinePass.js +45 -45
- package/dist/postprocessing/{Pass.mjs → Pass.cjs} +8 -8
- package/dist/postprocessing/Pass.js +8 -8
- package/dist/postprocessing/{RenderPass.mjs → RenderPass.cjs} +7 -7
- package/dist/postprocessing/RenderPass.js +7 -7
- package/dist/postprocessing/{RenderPixelatedPass.mjs → RenderPixelatedPass.cjs} +18 -18
- package/dist/postprocessing/RenderPixelatedPass.js +18 -18
- package/dist/postprocessing/{SAOPass.mjs → SAOPass.cjs} +69 -69
- package/dist/postprocessing/SAOPass.js +69 -69
- package/dist/postprocessing/{SMAAPass.mjs → SMAAPass.cjs} +30 -30
- package/dist/postprocessing/SMAAPass.js +30 -30
- package/dist/postprocessing/{SSAARenderPass.mjs → SSAARenderPass.cjs} +19 -19
- package/dist/postprocessing/SSAARenderPass.js +19 -19
- package/dist/postprocessing/{SSAOPass.mjs → SSAOPass.cjs} +63 -63
- package/dist/postprocessing/SSAOPass.js +63 -63
- package/dist/postprocessing/{SSRPass.mjs → SSRPass.cjs} +86 -86
- package/dist/postprocessing/SSRPass.js +86 -86
- package/dist/postprocessing/{SavePass.mjs → SavePass.cjs} +13 -13
- package/dist/postprocessing/SavePass.js +13 -13
- package/dist/postprocessing/{ShaderPass.mjs → ShaderPass.cjs} +10 -10
- package/dist/postprocessing/ShaderPass.js +10 -10
- package/dist/postprocessing/{TAARenderPass.mjs → TAARenderPass.cjs} +8 -8
- package/dist/postprocessing/TAARenderPass.js +8 -8
- package/dist/postprocessing/{TexturePass.mjs → TexturePass.cjs} +11 -11
- package/dist/postprocessing/TexturePass.js +11 -11
- package/dist/postprocessing/{UnrealBloomPass.mjs → UnrealBloomPass.cjs} +36 -36
- package/dist/postprocessing/UnrealBloomPass.js +36 -36
- package/dist/postprocessing/{WaterPass.mjs → WaterPass.cjs} +10 -10
- package/dist/postprocessing/WaterPass.js +10 -10
- package/dist/renderers/{CSS2DRenderer.mjs → CSS2DRenderer.cjs} +12 -12
- package/dist/renderers/CSS2DRenderer.js +12 -12
- package/dist/renderers/{CSS3DRenderer.mjs → CSS3DRenderer.cjs} +12 -12
- package/dist/renderers/CSS3DRenderer.js +12 -12
- package/dist/renderers/{Projector.mjs → Projector.cjs} +21 -21
- package/dist/renderers/Projector.js +21 -21
- package/dist/renderers/{SVGRenderer.mjs → SVGRenderer.cjs} +12 -12
- package/dist/renderers/SVGRenderer.js +12 -12
- package/dist/shaders/{ACESFilmicToneMappingShader.mjs → ACESFilmicToneMappingShader.cjs} +3 -3
- package/dist/shaders/ACESFilmicToneMappingShader.js +3 -3
- package/dist/shaders/{AfterimageShader.mjs → AfterimageShader.cjs} +3 -3
- package/dist/shaders/AfterimageShader.js +3 -3
- package/dist/shaders/{BasicShader.mjs → BasicShader.cjs} +3 -3
- package/dist/shaders/BasicShader.js +3 -3
- package/dist/shaders/{BleachBypassShader.mjs → BleachBypassShader.cjs} +3 -3
- package/dist/shaders/BleachBypassShader.js +3 -3
- package/dist/shaders/{BlendShader.mjs → BlendShader.cjs} +3 -3
- package/dist/shaders/BlendShader.js +3 -3
- package/dist/shaders/{BokehShader.mjs → BokehShader.cjs} +3 -3
- package/dist/shaders/BokehShader.js +3 -3
- package/dist/shaders/{BokehShader2.mjs → BokehShader2.cjs} +6 -6
- package/dist/shaders/BokehShader2.js +6 -6
- package/dist/shaders/{BrightnessContrastShader.mjs → BrightnessContrastShader.cjs} +3 -3
- package/dist/shaders/BrightnessContrastShader.js +3 -3
- package/dist/shaders/{ColorCorrectionShader.mjs → ColorCorrectionShader.cjs} +7 -7
- package/dist/shaders/ColorCorrectionShader.js +7 -7
- package/dist/shaders/{ColorifyShader.mjs → ColorifyShader.cjs} +5 -5
- package/dist/shaders/ColorifyShader.js +5 -5
- package/dist/shaders/{ConvolutionShader.mjs → ConvolutionShader.cjs} +5 -5
- package/dist/shaders/ConvolutionShader.js +5 -5
- package/dist/shaders/{CopyShader.mjs → CopyShader.cjs} +3 -3
- package/dist/shaders/CopyShader.js +3 -3
- package/dist/shaders/{DOFMipMapShader.mjs → DOFMipMapShader.cjs} +3 -3
- package/dist/shaders/DOFMipMapShader.js +3 -3
- package/dist/shaders/{DepthLimitedBlurShader.mjs → DepthLimitedBlurShader.cjs} +7 -7
- package/dist/shaders/DepthLimitedBlurShader.js +7 -7
- package/dist/shaders/{DigitalGlitch.mjs → DigitalGlitch.cjs} +3 -3
- package/dist/shaders/DigitalGlitch.js +3 -3
- package/dist/shaders/{DotScreenShader.mjs → DotScreenShader.cjs} +6 -6
- package/dist/shaders/DotScreenShader.js +6 -6
- package/dist/shaders/{FXAAShader.mjs → FXAAShader.cjs} +5 -5
- package/dist/shaders/FXAAShader.js +5 -5
- package/dist/shaders/{FilmShader.mjs → FilmShader.cjs} +3 -3
- package/dist/shaders/FilmShader.js +3 -3
- package/dist/shaders/{FocusShader.mjs → FocusShader.cjs} +3 -3
- package/dist/shaders/FocusShader.js +3 -3
- package/dist/shaders/{FreiChenShader.mjs → FreiChenShader.cjs} +5 -5
- package/dist/shaders/FreiChenShader.js +5 -5
- package/dist/shaders/{FresnelShader.mjs → FresnelShader.cjs} +3 -3
- package/dist/shaders/FresnelShader.js +3 -3
- package/dist/shaders/{GammaCorrectionShader.mjs → GammaCorrectionShader.cjs} +3 -3
- package/dist/shaders/GammaCorrectionShader.js +3 -3
- package/dist/shaders/{GodRaysShader.mjs → GodRaysShader.cjs} +11 -11
- package/dist/shaders/GodRaysShader.js +11 -11
- package/dist/shaders/{HalftoneShader.mjs → HalftoneShader.cjs} +3 -3
- package/dist/shaders/HalftoneShader.js +3 -3
- package/dist/shaders/{HorizontalBlurShader.mjs → HorizontalBlurShader.cjs} +3 -3
- package/dist/shaders/HorizontalBlurShader.js +3 -3
- package/dist/shaders/{HorizontalTiltShiftShader.mjs → HorizontalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/HorizontalTiltShiftShader.js +3 -3
- package/dist/shaders/{HueSaturationShader.mjs → HueSaturationShader.cjs} +3 -3
- package/dist/shaders/HueSaturationShader.js +3 -3
- package/dist/shaders/{KaleidoShader.mjs → KaleidoShader.cjs} +3 -3
- package/dist/shaders/KaleidoShader.js +3 -3
- package/dist/shaders/{LuminosityHighPassShader.mjs → LuminosityHighPassShader.cjs} +5 -5
- package/dist/shaders/LuminosityHighPassShader.js +5 -5
- package/dist/shaders/{LuminosityShader.mjs → LuminosityShader.cjs} +3 -3
- package/dist/shaders/LuminosityShader.js +3 -3
- package/dist/shaders/{MirrorShader.mjs → MirrorShader.cjs} +3 -3
- package/dist/shaders/MirrorShader.js +3 -3
- package/dist/shaders/{NormalMapShader.mjs → NormalMapShader.cjs} +6 -6
- package/dist/shaders/NormalMapShader.js +6 -6
- package/dist/shaders/{ParallaxShader.mjs → ParallaxShader.cjs} +3 -3
- package/dist/shaders/ParallaxShader.js +3 -3
- package/dist/shaders/{PixelShader.mjs → PixelShader.cjs} +3 -3
- package/dist/shaders/PixelShader.js +3 -3
- package/dist/shaders/{RGBShiftShader.mjs → RGBShiftShader.cjs} +3 -3
- package/dist/shaders/RGBShiftShader.js +3 -3
- package/dist/shaders/{SAOShader.mjs → SAOShader.cjs} +7 -7
- package/dist/shaders/SAOShader.js +7 -7
- package/dist/shaders/{SMAAShader.mjs → SMAAShader.cjs} +9 -9
- package/dist/shaders/SMAAShader.js +9 -9
- package/dist/shaders/{SSAOShader.mjs → SSAOShader.cjs} +10 -10
- package/dist/shaders/SSAOShader.js +10 -10
- package/dist/shaders/{SSRShader.mjs → SSRShader.cjs} +10 -10
- package/dist/shaders/SSRShader.js +10 -10
- package/dist/shaders/{SepiaShader.mjs → SepiaShader.cjs} +3 -3
- package/dist/shaders/SepiaShader.js +3 -3
- package/dist/shaders/{SobelOperatorShader.mjs → SobelOperatorShader.cjs} +5 -5
- package/dist/shaders/SobelOperatorShader.js +5 -5
- package/dist/shaders/{SubsurfaceScatteringShader.mjs → SubsurfaceScatteringShader.cjs} +13 -13
- package/dist/shaders/SubsurfaceScatteringShader.js +13 -13
- package/dist/shaders/{TechnicolorShader.mjs → TechnicolorShader.cjs} +3 -3
- package/dist/shaders/TechnicolorShader.js +3 -3
- package/dist/shaders/{ToneMapShader.mjs → ToneMapShader.cjs} +3 -3
- package/dist/shaders/ToneMapShader.js +3 -3
- package/dist/shaders/{ToonShader.mjs → ToonShader.cjs} +32 -32
- package/dist/shaders/ToonShader.js +32 -32
- package/dist/shaders/{TriangleBlurShader.mjs → TriangleBlurShader.cjs} +5 -5
- package/dist/shaders/TriangleBlurShader.js +5 -5
- package/dist/shaders/{UnpackDepthRGBAShader.mjs → UnpackDepthRGBAShader.cjs} +3 -3
- package/dist/shaders/UnpackDepthRGBAShader.js +3 -3
- package/dist/shaders/{VerticalBlurShader.mjs → VerticalBlurShader.cjs} +3 -3
- package/dist/shaders/VerticalBlurShader.js +3 -3
- package/dist/shaders/{VerticalTiltShiftShader.mjs → VerticalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/VerticalTiltShiftShader.js +3 -3
- package/dist/shaders/{VignetteShader.mjs → VignetteShader.cjs} +3 -3
- package/dist/shaders/VignetteShader.js +3 -3
- package/dist/shaders/{VolumeShader.mjs → VolumeShader.cjs} +6 -6
- package/dist/shaders/VolumeShader.js +6 -6
- package/dist/shaders/{WaterRefractionShader.mjs → WaterRefractionShader.cjs} +3 -3
- package/dist/shaders/WaterRefractionShader.js +3 -3
- package/dist/shaders/types.cjs +1 -0
- package/dist/shaders/types.js +1 -1
- package/dist/textures/{FlakesTexture.mjs → FlakesTexture.cjs} +3 -3
- package/dist/textures/FlakesTexture.js +3 -3
- package/dist/types/Loader.cjs +26 -0
- package/dist/types/Loader.js +5 -22
- package/dist/types/helpers.cjs +4 -0
- package/dist/types/helpers.js +3 -3
- package/dist/utils/{BufferGeometryUtils.mjs → BufferGeometryUtils.cjs} +41 -41
- package/dist/utils/BufferGeometryUtils.js +41 -41
- package/dist/utils/{GeometryCompressionUtils.mjs → GeometryCompressionUtils.cjs} +94 -94
- package/dist/utils/GeometryCompressionUtils.js +94 -94
- package/dist/utils/{GeometryUtils.mjs → GeometryUtils.cjs} +18 -18
- package/dist/utils/GeometryUtils.js +18 -18
- package/dist/utils/{RoughnessMipmapper.mjs → RoughnessMipmapper.cjs} +13 -13
- package/dist/utils/RoughnessMipmapper.js +13 -13
- package/dist/utils/{SceneUtils.mjs → SceneUtils.cjs} +8 -8
- package/dist/utils/SceneUtils.js +8 -8
- package/dist/utils/{ShadowMapViewer.mjs → ShadowMapViewer.cjs} +18 -18
- package/dist/utils/ShadowMapViewer.js +18 -18
- package/dist/utils/{SkeletonUtils.mjs → SkeletonUtils.cjs} +10 -10
- package/dist/utils/SkeletonUtils.js +10 -10
- package/dist/utils/{UVsDebug.mjs → UVsDebug.cjs} +7 -7
- package/dist/utils/UVsDebug.js +7 -7
- package/dist/utils/{WorkerPool.mjs → WorkerPool.cjs} +3 -3
- package/dist/utils/WorkerPool.js +3 -3
- package/dist/webxr/{ARButton.mjs → ARButton.cjs} +3 -3
- package/dist/webxr/ARButton.js +3 -3
- package/dist/webxr/{OculusHandModel.mjs → OculusHandModel.cjs} +9 -9
- package/dist/webxr/OculusHandModel.js +9 -9
- package/dist/webxr/{OculusHandPointerModel.mjs → OculusHandPointerModel.cjs} +41 -24
- package/dist/webxr/OculusHandPointerModel.js +24 -41
- package/dist/webxr/Text2D.cjs +48 -0
- package/dist/webxr/Text2D.js +9 -26
- package/dist/webxr/{VRButton.mjs → VRButton.cjs} +3 -3
- package/dist/webxr/VRButton.js +3 -3
- package/dist/webxr/{XRControllerModelFactory.mjs → XRControllerModelFactory.cjs} +18 -18
- package/dist/webxr/XRControllerModelFactory.js +18 -18
- package/dist/webxr/{XREstimatedLight.mjs → XREstimatedLight.cjs} +8 -8
- package/dist/webxr/XREstimatedLight.js +8 -8
- package/dist/webxr/{XRHandMeshModel.mjs → XRHandMeshModel.cjs} +5 -5
- package/dist/webxr/XRHandMeshModel.js +5 -5
- package/dist/webxr/{XRHandModelFactory.mjs → XRHandModelFactory.cjs} +10 -10
- package/dist/webxr/XRHandModelFactory.js +10 -10
- package/dist/webxr/{XRHandPrimitiveModel.mjs → XRHandPrimitiveModel.cjs} +11 -11
- package/dist/webxr/XRHandPrimitiveModel.js +11 -11
- package/package.json +3 -3
- package/dist/_polyfill/CompressedArrayTexture.mjs +0 -12
- package/dist/_polyfill/Data3DTexture.mjs +0 -17
- package/dist/environments/RoomEnvironment.mjs +0 -78
- package/dist/geometries/ConvexGeometry.mjs +0 -26
- package/dist/index.mjs +0 -613
- package/dist/lines/Line2.mjs +0 -13
- package/dist/lines/Wireframe.mjs +0 -32
- package/dist/lines/WireframeGeometry2.mjs +0 -13
- package/dist/objects/ReflectorRTT.mjs +0 -10
- package/dist/shaders/types.mjs +0 -1
- package/dist/types/Loader.mjs +0 -9
- package/dist/types/helpers.mjs +0 -4
- package/dist/webxr/Text2D.mjs +0 -31
package/dist/math/ConvexHull.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const THREE = require("three");
|
|
1
|
+
import { Vector3, Line3, Plane, Triangle } from "three";
|
|
4
2
|
const Visible = 0;
|
|
5
3
|
const Deleted = 1;
|
|
6
|
-
const _v1 = /* @__PURE__ */ new
|
|
7
|
-
const _line3 = /* @__PURE__ */ new
|
|
8
|
-
const _plane = /* @__PURE__ */ new
|
|
9
|
-
const _closestPoint = /* @__PURE__ */ new
|
|
10
|
-
const _triangle = /* @__PURE__ */ new
|
|
4
|
+
const _v1 = /* @__PURE__ */ new Vector3();
|
|
5
|
+
const _line3 = /* @__PURE__ */ new Line3();
|
|
6
|
+
const _plane = /* @__PURE__ */ new Plane();
|
|
7
|
+
const _closestPoint = /* @__PURE__ */ new Vector3();
|
|
8
|
+
const _triangle = /* @__PURE__ */ new Triangle();
|
|
11
9
|
class ConvexHull {
|
|
12
10
|
constructor() {
|
|
13
11
|
this.tolerance = -1;
|
|
@@ -36,7 +34,7 @@ class ConvexHull {
|
|
|
36
34
|
const attribute = geometry.attributes.position;
|
|
37
35
|
if (attribute !== void 0) {
|
|
38
36
|
for (let i = 0, l = attribute.count; i < l; i++) {
|
|
39
|
-
const point = new
|
|
37
|
+
const point = new Vector3();
|
|
40
38
|
point.fromBufferAttribute(attribute, i).applyMatrix4(node.matrixWorld);
|
|
41
39
|
points.push(point);
|
|
42
40
|
}
|
|
@@ -180,8 +178,8 @@ class ConvexHull {
|
|
|
180
178
|
}
|
|
181
179
|
// Computes the extremes of a simplex which will be the initial hull
|
|
182
180
|
computeExtremes() {
|
|
183
|
-
const min = new
|
|
184
|
-
const max = new
|
|
181
|
+
const min = new Vector3();
|
|
182
|
+
const max = new Vector3();
|
|
185
183
|
const minVertices = [];
|
|
186
184
|
const maxVertices = [];
|
|
187
185
|
for (let i = 0; i < 3; i++) {
|
|
@@ -402,8 +400,8 @@ class ConvexHull {
|
|
|
402
400
|
}
|
|
403
401
|
class Face {
|
|
404
402
|
constructor() {
|
|
405
|
-
this.normal = new
|
|
406
|
-
this.midpoint = new
|
|
403
|
+
this.normal = new Vector3();
|
|
404
|
+
this.midpoint = new Vector3();
|
|
407
405
|
this.area = 0;
|
|
408
406
|
this.constant = 0;
|
|
409
407
|
this.outside = null;
|
|
@@ -589,8 +587,10 @@ class VertexList {
|
|
|
589
587
|
return this.head === null;
|
|
590
588
|
}
|
|
591
589
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
590
|
+
export {
|
|
591
|
+
ConvexHull,
|
|
592
|
+
Face,
|
|
593
|
+
HalfEdge,
|
|
594
|
+
VertexList,
|
|
595
|
+
VertexNode
|
|
596
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
3
|
function init() {
|
|
2
4
|
const _p2 = [
|
|
3
5
|
151,
|
|
@@ -299,6 +301,4 @@ class ImprovedNoise {
|
|
|
299
301
|
);
|
|
300
302
|
}
|
|
301
303
|
}
|
|
302
|
-
|
|
303
|
-
ImprovedNoise
|
|
304
|
-
};
|
|
304
|
+
exports.ImprovedNoise = ImprovedNoise;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
1
|
function init() {
|
|
4
2
|
const _p2 = [
|
|
5
3
|
151,
|
|
@@ -301,4 +299,6 @@ class ImprovedNoise {
|
|
|
301
299
|
);
|
|
302
300
|
}
|
|
303
301
|
}
|
|
304
|
-
|
|
302
|
+
export {
|
|
303
|
+
ImprovedNoise
|
|
304
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const THREE = require("three");
|
|
2
4
|
class Lut {
|
|
3
5
|
constructor(colormap, count = 32) {
|
|
4
6
|
this.isLut = true;
|
|
@@ -27,10 +29,10 @@ class Lut {
|
|
|
27
29
|
this.map = ColorMapKeywords[colormap] || ColorMapKeywords.rainbow;
|
|
28
30
|
this.n = count;
|
|
29
31
|
const step = 1 / this.n;
|
|
30
|
-
const minColor = new Color();
|
|
31
|
-
const maxColor = new Color();
|
|
32
|
+
const minColor = new THREE.Color();
|
|
33
|
+
const maxColor = new THREE.Color();
|
|
32
34
|
this.lut.length = 0;
|
|
33
|
-
this.lut.push(new Color(this.map[0][1]));
|
|
35
|
+
this.lut.push(new THREE.Color(this.map[0][1]));
|
|
34
36
|
for (let i = 1; i < count; i++) {
|
|
35
37
|
const alpha = i * step;
|
|
36
38
|
for (let j = 0; j < this.map.length - 1; j++) {
|
|
@@ -39,12 +41,12 @@ class Lut {
|
|
|
39
41
|
const max = this.map[j + 1][0];
|
|
40
42
|
minColor.setHex(this.map[j][1], "linear-srgb");
|
|
41
43
|
maxColor.setHex(this.map[j + 1][1], "linear-srgb");
|
|
42
|
-
const color = new Color().lerpColors(minColor, maxColor, (alpha - min) / (max - min));
|
|
44
|
+
const color = new THREE.Color().lerpColors(minColor, maxColor, (alpha - min) / (max - min));
|
|
43
45
|
this.lut.push(color);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
this.lut.push(new Color(this.map[this.map.length - 1][1]));
|
|
49
|
+
this.lut.push(new THREE.Color(this.map[this.map.length - 1][1]));
|
|
48
50
|
return this;
|
|
49
51
|
}
|
|
50
52
|
copy(lut) {
|
|
@@ -56,7 +58,7 @@ class Lut {
|
|
|
56
58
|
return this;
|
|
57
59
|
}
|
|
58
60
|
getColor(alpha) {
|
|
59
|
-
alpha = MathUtils.clamp(alpha, this.minV, this.maxV);
|
|
61
|
+
alpha = THREE.MathUtils.clamp(alpha, this.minV, this.maxV);
|
|
60
62
|
alpha = (alpha - this.minV) / (this.maxV - this.minV);
|
|
61
63
|
const colorPosition = Math.round(alpha * this.n);
|
|
62
64
|
return this.lut[colorPosition];
|
|
@@ -78,9 +80,9 @@ class Lut {
|
|
|
78
80
|
const data = imageData.data;
|
|
79
81
|
let k = 0;
|
|
80
82
|
const step = 1 / this.n;
|
|
81
|
-
const minColor = new Color();
|
|
82
|
-
const maxColor = new Color();
|
|
83
|
-
const finalColor = new Color();
|
|
83
|
+
const minColor = new THREE.Color();
|
|
84
|
+
const maxColor = new THREE.Color();
|
|
85
|
+
const finalColor = new THREE.Color();
|
|
84
86
|
for (let i = 1; i >= 0; i -= step) {
|
|
85
87
|
for (let j = this.map.length - 1; j >= 0; j--) {
|
|
86
88
|
if (i < this.map[j][0] && i >= this.map[j - 1][0]) {
|
|
@@ -131,7 +133,5 @@ const ColorMapKeywords = {
|
|
|
131
133
|
[1, 16777215]
|
|
132
134
|
]
|
|
133
135
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Lut
|
|
137
|
-
};
|
|
136
|
+
exports.ColorMapKeywords = ColorMapKeywords;
|
|
137
|
+
exports.Lut = Lut;
|
package/dist/math/Lut.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const THREE = require("three");
|
|
1
|
+
import { Color, MathUtils } from "three";
|
|
4
2
|
class Lut {
|
|
5
3
|
constructor(colormap, count = 32) {
|
|
6
4
|
this.isLut = true;
|
|
@@ -29,10 +27,10 @@ class Lut {
|
|
|
29
27
|
this.map = ColorMapKeywords[colormap] || ColorMapKeywords.rainbow;
|
|
30
28
|
this.n = count;
|
|
31
29
|
const step = 1 / this.n;
|
|
32
|
-
const minColor = new
|
|
33
|
-
const maxColor = new
|
|
30
|
+
const minColor = new Color();
|
|
31
|
+
const maxColor = new Color();
|
|
34
32
|
this.lut.length = 0;
|
|
35
|
-
this.lut.push(new
|
|
33
|
+
this.lut.push(new Color(this.map[0][1]));
|
|
36
34
|
for (let i = 1; i < count; i++) {
|
|
37
35
|
const alpha = i * step;
|
|
38
36
|
for (let j = 0; j < this.map.length - 1; j++) {
|
|
@@ -41,12 +39,12 @@ class Lut {
|
|
|
41
39
|
const max = this.map[j + 1][0];
|
|
42
40
|
minColor.setHex(this.map[j][1], "linear-srgb");
|
|
43
41
|
maxColor.setHex(this.map[j + 1][1], "linear-srgb");
|
|
44
|
-
const color = new
|
|
42
|
+
const color = new Color().lerpColors(minColor, maxColor, (alpha - min) / (max - min));
|
|
45
43
|
this.lut.push(color);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
|
-
this.lut.push(new
|
|
47
|
+
this.lut.push(new Color(this.map[this.map.length - 1][1]));
|
|
50
48
|
return this;
|
|
51
49
|
}
|
|
52
50
|
copy(lut) {
|
|
@@ -58,7 +56,7 @@ class Lut {
|
|
|
58
56
|
return this;
|
|
59
57
|
}
|
|
60
58
|
getColor(alpha) {
|
|
61
|
-
alpha =
|
|
59
|
+
alpha = MathUtils.clamp(alpha, this.minV, this.maxV);
|
|
62
60
|
alpha = (alpha - this.minV) / (this.maxV - this.minV);
|
|
63
61
|
const colorPosition = Math.round(alpha * this.n);
|
|
64
62
|
return this.lut[colorPosition];
|
|
@@ -80,9 +78,9 @@ class Lut {
|
|
|
80
78
|
const data = imageData.data;
|
|
81
79
|
let k = 0;
|
|
82
80
|
const step = 1 / this.n;
|
|
83
|
-
const minColor = new
|
|
84
|
-
const maxColor = new
|
|
85
|
-
const finalColor = new
|
|
81
|
+
const minColor = new Color();
|
|
82
|
+
const maxColor = new Color();
|
|
83
|
+
const finalColor = new Color();
|
|
86
84
|
for (let i = 1; i >= 0; i -= step) {
|
|
87
85
|
for (let j = this.map.length - 1; j >= 0; j--) {
|
|
88
86
|
if (i < this.map[j][0] && i >= this.map[j - 1][0]) {
|
|
@@ -133,5 +131,7 @@ const ColorMapKeywords = {
|
|
|
133
131
|
[1, 16777215]
|
|
134
132
|
]
|
|
135
133
|
};
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
export {
|
|
135
|
+
ColorMapKeywords,
|
|
136
|
+
Lut
|
|
137
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const THREE = require("three");
|
|
4
|
+
const _face = /* @__PURE__ */ new THREE.Triangle();
|
|
5
|
+
const _color = /* @__PURE__ */ new THREE.Vector3();
|
|
4
6
|
class MeshSurfaceSampler {
|
|
5
7
|
constructor(mesh) {
|
|
6
8
|
let geometry = mesh.geometry;
|
|
@@ -98,6 +100,4 @@ class MeshSurfaceSampler {
|
|
|
98
100
|
return this;
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
MeshSurfaceSampler
|
|
103
|
-
};
|
|
103
|
+
exports.MeshSurfaceSampler = MeshSurfaceSampler;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const _face = /* @__PURE__ */ new THREE.Triangle();
|
|
5
|
-
const _color = /* @__PURE__ */ new THREE.Vector3();
|
|
1
|
+
import { Triangle, Vector3 } from "three";
|
|
2
|
+
const _face = /* @__PURE__ */ new Triangle();
|
|
3
|
+
const _color = /* @__PURE__ */ new Vector3();
|
|
6
4
|
class MeshSurfaceSampler {
|
|
7
5
|
constructor(mesh) {
|
|
8
6
|
let geometry = mesh.geometry;
|
|
@@ -100,4 +98,6 @@ class MeshSurfaceSampler {
|
|
|
100
98
|
return this;
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
|
-
|
|
101
|
+
export {
|
|
102
|
+
MeshSurfaceSampler
|
|
103
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const THREE = require("three");
|
|
2
4
|
const a = {
|
|
3
5
|
c: null,
|
|
4
6
|
// center
|
|
5
|
-
u: [/* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3()],
|
|
7
|
+
u: [/* @__PURE__ */ new THREE.Vector3(), /* @__PURE__ */ new THREE.Vector3(), /* @__PURE__ */ new THREE.Vector3()],
|
|
6
8
|
// basis vectors
|
|
7
9
|
e: []
|
|
8
10
|
// half width
|
|
@@ -10,7 +12,7 @@ const a = {
|
|
|
10
12
|
const b = {
|
|
11
13
|
c: null,
|
|
12
14
|
// center
|
|
13
|
-
u: [/* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3()],
|
|
15
|
+
u: [/* @__PURE__ */ new THREE.Vector3(), /* @__PURE__ */ new THREE.Vector3(), /* @__PURE__ */ new THREE.Vector3()],
|
|
14
16
|
// basis vectors
|
|
15
17
|
e: []
|
|
16
18
|
// half width
|
|
@@ -18,19 +20,19 @@ const b = {
|
|
|
18
20
|
const R = [[], [], []];
|
|
19
21
|
const AbsR = [[], [], []];
|
|
20
22
|
const t = [];
|
|
21
|
-
const xAxis = /* @__PURE__ */ new Vector3();
|
|
22
|
-
const yAxis = /* @__PURE__ */ new Vector3();
|
|
23
|
-
const zAxis = /* @__PURE__ */ new Vector3();
|
|
24
|
-
const v1 = /* @__PURE__ */ new Vector3();
|
|
25
|
-
const size = /* @__PURE__ */ new Vector3();
|
|
26
|
-
const closestPoint = /* @__PURE__ */ new Vector3();
|
|
27
|
-
const rotationMatrix = /* @__PURE__ */ new Matrix3();
|
|
28
|
-
const aabb = /* @__PURE__ */ new Box3();
|
|
29
|
-
const matrix = /* @__PURE__ */ new Matrix4();
|
|
30
|
-
const inverse = /* @__PURE__ */ new Matrix4();
|
|
31
|
-
const localRay = /* @__PURE__ */ new Ray();
|
|
23
|
+
const xAxis = /* @__PURE__ */ new THREE.Vector3();
|
|
24
|
+
const yAxis = /* @__PURE__ */ new THREE.Vector3();
|
|
25
|
+
const zAxis = /* @__PURE__ */ new THREE.Vector3();
|
|
26
|
+
const v1 = /* @__PURE__ */ new THREE.Vector3();
|
|
27
|
+
const size = /* @__PURE__ */ new THREE.Vector3();
|
|
28
|
+
const closestPoint = /* @__PURE__ */ new THREE.Vector3();
|
|
29
|
+
const rotationMatrix = /* @__PURE__ */ new THREE.Matrix3();
|
|
30
|
+
const aabb = /* @__PURE__ */ new THREE.Box3();
|
|
31
|
+
const matrix = /* @__PURE__ */ new THREE.Matrix4();
|
|
32
|
+
const inverse = /* @__PURE__ */ new THREE.Matrix4();
|
|
33
|
+
const localRay = /* @__PURE__ */ new THREE.Ray();
|
|
32
34
|
class OBB {
|
|
33
|
-
constructor(center = new Vector3(), halfSize = new Vector3(), rotation = new Matrix3()) {
|
|
35
|
+
constructor(center = new THREE.Vector3(), halfSize = new THREE.Vector3(), rotation = new THREE.Matrix3()) {
|
|
34
36
|
this.center = center;
|
|
35
37
|
this.halfSize = halfSize;
|
|
36
38
|
this.rotation = rotation;
|
|
@@ -62,11 +64,11 @@ class OBB {
|
|
|
62
64
|
v1.subVectors(point, this.center);
|
|
63
65
|
this.rotation.extractBasis(xAxis, yAxis, zAxis);
|
|
64
66
|
result.copy(this.center);
|
|
65
|
-
const x = MathUtils.clamp(v1.dot(xAxis), -halfSize.x, halfSize.x);
|
|
67
|
+
const x = THREE.MathUtils.clamp(v1.dot(xAxis), -halfSize.x, halfSize.x);
|
|
66
68
|
result.add(xAxis.multiplyScalar(x));
|
|
67
|
-
const y = MathUtils.clamp(v1.dot(yAxis), -halfSize.y, halfSize.y);
|
|
69
|
+
const y = THREE.MathUtils.clamp(v1.dot(yAxis), -halfSize.y, halfSize.y);
|
|
68
70
|
result.add(yAxis.multiplyScalar(y));
|
|
69
|
-
const z = MathUtils.clamp(v1.dot(zAxis), -halfSize.z, halfSize.z);
|
|
71
|
+
const z = THREE.MathUtils.clamp(v1.dot(zAxis), -halfSize.z, halfSize.z);
|
|
70
72
|
result.add(zAxis.multiplyScalar(z));
|
|
71
73
|
return result;
|
|
72
74
|
}
|
|
@@ -237,6 +239,4 @@ class OBB {
|
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
const obb = /* @__PURE__ */ new OBB();
|
|
240
|
-
|
|
241
|
-
OBB
|
|
242
|
-
};
|
|
242
|
+
exports.OBB = OBB;
|
package/dist/math/OBB.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const THREE = require("three");
|
|
1
|
+
import { Vector3, Matrix3, Box3, Matrix4, Ray, MathUtils } from "three";
|
|
4
2
|
const a = {
|
|
5
3
|
c: null,
|
|
6
4
|
// center
|
|
7
|
-
u: [/* @__PURE__ */ new
|
|
5
|
+
u: [/* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3()],
|
|
8
6
|
// basis vectors
|
|
9
7
|
e: []
|
|
10
8
|
// half width
|
|
@@ -12,7 +10,7 @@ const a = {
|
|
|
12
10
|
const b = {
|
|
13
11
|
c: null,
|
|
14
12
|
// center
|
|
15
|
-
u: [/* @__PURE__ */ new
|
|
13
|
+
u: [/* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3(), /* @__PURE__ */ new Vector3()],
|
|
16
14
|
// basis vectors
|
|
17
15
|
e: []
|
|
18
16
|
// half width
|
|
@@ -20,19 +18,19 @@ const b = {
|
|
|
20
18
|
const R = [[], [], []];
|
|
21
19
|
const AbsR = [[], [], []];
|
|
22
20
|
const t = [];
|
|
23
|
-
const xAxis = /* @__PURE__ */ new
|
|
24
|
-
const yAxis = /* @__PURE__ */ new
|
|
25
|
-
const zAxis = /* @__PURE__ */ new
|
|
26
|
-
const v1 = /* @__PURE__ */ new
|
|
27
|
-
const size = /* @__PURE__ */ new
|
|
28
|
-
const closestPoint = /* @__PURE__ */ new
|
|
29
|
-
const rotationMatrix = /* @__PURE__ */ new
|
|
30
|
-
const aabb = /* @__PURE__ */ new
|
|
31
|
-
const matrix = /* @__PURE__ */ new
|
|
32
|
-
const inverse = /* @__PURE__ */ new
|
|
33
|
-
const localRay = /* @__PURE__ */ new
|
|
21
|
+
const xAxis = /* @__PURE__ */ new Vector3();
|
|
22
|
+
const yAxis = /* @__PURE__ */ new Vector3();
|
|
23
|
+
const zAxis = /* @__PURE__ */ new Vector3();
|
|
24
|
+
const v1 = /* @__PURE__ */ new Vector3();
|
|
25
|
+
const size = /* @__PURE__ */ new Vector3();
|
|
26
|
+
const closestPoint = /* @__PURE__ */ new Vector3();
|
|
27
|
+
const rotationMatrix = /* @__PURE__ */ new Matrix3();
|
|
28
|
+
const aabb = /* @__PURE__ */ new Box3();
|
|
29
|
+
const matrix = /* @__PURE__ */ new Matrix4();
|
|
30
|
+
const inverse = /* @__PURE__ */ new Matrix4();
|
|
31
|
+
const localRay = /* @__PURE__ */ new Ray();
|
|
34
32
|
class OBB {
|
|
35
|
-
constructor(center = new
|
|
33
|
+
constructor(center = new Vector3(), halfSize = new Vector3(), rotation = new Matrix3()) {
|
|
36
34
|
this.center = center;
|
|
37
35
|
this.halfSize = halfSize;
|
|
38
36
|
this.rotation = rotation;
|
|
@@ -64,11 +62,11 @@ class OBB {
|
|
|
64
62
|
v1.subVectors(point, this.center);
|
|
65
63
|
this.rotation.extractBasis(xAxis, yAxis, zAxis);
|
|
66
64
|
result.copy(this.center);
|
|
67
|
-
const x =
|
|
65
|
+
const x = MathUtils.clamp(v1.dot(xAxis), -halfSize.x, halfSize.x);
|
|
68
66
|
result.add(xAxis.multiplyScalar(x));
|
|
69
|
-
const y =
|
|
67
|
+
const y = MathUtils.clamp(v1.dot(yAxis), -halfSize.y, halfSize.y);
|
|
70
68
|
result.add(yAxis.multiplyScalar(y));
|
|
71
|
-
const z =
|
|
69
|
+
const z = MathUtils.clamp(v1.dot(zAxis), -halfSize.z, halfSize.z);
|
|
72
70
|
result.add(zAxis.multiplyScalar(z));
|
|
73
71
|
return result;
|
|
74
72
|
}
|
|
@@ -239,4 +237,6 @@ class OBB {
|
|
|
239
237
|
}
|
|
240
238
|
}
|
|
241
239
|
const obb = /* @__PURE__ */ new OBB();
|
|
242
|
-
|
|
240
|
+
export {
|
|
241
|
+
OBB
|
|
242
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const THREE = require("three");
|
|
4
|
+
const Capsule = require("./Capsule.cjs");
|
|
5
|
+
const _v1 = /* @__PURE__ */ new THREE.Vector3();
|
|
6
|
+
const _v2 = /* @__PURE__ */ new THREE.Vector3();
|
|
7
|
+
const _plane = /* @__PURE__ */ new THREE.Plane();
|
|
8
|
+
const _line1 = /* @__PURE__ */ new THREE.Line3();
|
|
9
|
+
const _line2 = /* @__PURE__ */ new THREE.Line3();
|
|
10
|
+
const _sphere = /* @__PURE__ */ new THREE.Sphere();
|
|
11
|
+
const _capsule = /* @__PURE__ */ new Capsule.Capsule();
|
|
10
12
|
class Octree {
|
|
11
13
|
constructor(box) {
|
|
12
14
|
this.triangles = [];
|
|
@@ -15,7 +17,7 @@ class Octree {
|
|
|
15
17
|
}
|
|
16
18
|
addTriangle(triangle) {
|
|
17
19
|
if (!this.bounds)
|
|
18
|
-
this.bounds = new Box3();
|
|
20
|
+
this.bounds = new THREE.Box3();
|
|
19
21
|
this.bounds.min.x = Math.min(this.bounds.min.x, triangle.a.x, triangle.b.x, triangle.c.x);
|
|
20
22
|
this.bounds.min.y = Math.min(this.bounds.min.y, triangle.a.y, triangle.b.y, triangle.c.y);
|
|
21
23
|
this.bounds.min.z = Math.min(this.bounds.min.z, triangle.a.z, triangle.b.z, triangle.c.z);
|
|
@@ -40,7 +42,7 @@ class Octree {
|
|
|
40
42
|
for (let x = 0; x < 2; x++) {
|
|
41
43
|
for (let y = 0; y < 2; y++) {
|
|
42
44
|
for (let z = 0; z < 2; z++) {
|
|
43
|
-
const box = new Box3();
|
|
45
|
+
const box = new THREE.Box3();
|
|
44
46
|
const v = _v1.set(x, y, z);
|
|
45
47
|
box.min.copy(this.box.min).add(v.multiply(halfsize));
|
|
46
48
|
box.max.copy(box.min).add(halfsize);
|
|
@@ -213,7 +215,7 @@ class Octree {
|
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
if (hit) {
|
|
216
|
-
const collisionVector = _capsule.getCenter(new Vector3()).sub(capsule.getCenter(_v1));
|
|
218
|
+
const collisionVector = _capsule.getCenter(new THREE.Vector3()).sub(capsule.getCenter(_v1));
|
|
217
219
|
const depth = collisionVector.length();
|
|
218
220
|
return { normal: collisionVector.normalize(), depth };
|
|
219
221
|
}
|
|
@@ -251,13 +253,13 @@ class Octree {
|
|
|
251
253
|
}
|
|
252
254
|
const positionAttribute = geometry.getAttribute("position");
|
|
253
255
|
for (let i = 0; i < positionAttribute.count; i += 3) {
|
|
254
|
-
const v1 = new Vector3().fromBufferAttribute(positionAttribute, i);
|
|
255
|
-
const v2 = new Vector3().fromBufferAttribute(positionAttribute, i + 1);
|
|
256
|
-
const v3 = new Vector3().fromBufferAttribute(positionAttribute, i + 2);
|
|
256
|
+
const v1 = new THREE.Vector3().fromBufferAttribute(positionAttribute, i);
|
|
257
|
+
const v2 = new THREE.Vector3().fromBufferAttribute(positionAttribute, i + 1);
|
|
258
|
+
const v3 = new THREE.Vector3().fromBufferAttribute(positionAttribute, i + 2);
|
|
257
259
|
v1.applyMatrix4(obj.matrixWorld);
|
|
258
260
|
v2.applyMatrix4(obj.matrixWorld);
|
|
259
261
|
v3.applyMatrix4(obj.matrixWorld);
|
|
260
|
-
this.addTriangle(new Triangle(v1, v2, v3));
|
|
262
|
+
this.addTriangle(new THREE.Triangle(v1, v2, v3));
|
|
261
263
|
}
|
|
262
264
|
if (isTemp) {
|
|
263
265
|
geometry.dispose();
|
|
@@ -268,6 +270,4 @@ class Octree {
|
|
|
268
270
|
return this;
|
|
269
271
|
}
|
|
270
272
|
}
|
|
271
|
-
|
|
272
|
-
Octree
|
|
273
|
-
};
|
|
273
|
+
exports.Octree = Octree;
|
package/dist/math/Octree.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const _sphere = /* @__PURE__ */ new THREE.Sphere();
|
|
11
|
-
const _capsule = /* @__PURE__ */ new Capsule.Capsule();
|
|
1
|
+
import { Vector3, Plane, Line3, Sphere, Box3, Triangle } from "three";
|
|
2
|
+
import { Capsule } from "./Capsule.js";
|
|
3
|
+
const _v1 = /* @__PURE__ */ new Vector3();
|
|
4
|
+
const _v2 = /* @__PURE__ */ new Vector3();
|
|
5
|
+
const _plane = /* @__PURE__ */ new Plane();
|
|
6
|
+
const _line1 = /* @__PURE__ */ new Line3();
|
|
7
|
+
const _line2 = /* @__PURE__ */ new Line3();
|
|
8
|
+
const _sphere = /* @__PURE__ */ new Sphere();
|
|
9
|
+
const _capsule = /* @__PURE__ */ new Capsule();
|
|
12
10
|
class Octree {
|
|
13
11
|
constructor(box) {
|
|
14
12
|
this.triangles = [];
|
|
@@ -17,7 +15,7 @@ class Octree {
|
|
|
17
15
|
}
|
|
18
16
|
addTriangle(triangle) {
|
|
19
17
|
if (!this.bounds)
|
|
20
|
-
this.bounds = new
|
|
18
|
+
this.bounds = new Box3();
|
|
21
19
|
this.bounds.min.x = Math.min(this.bounds.min.x, triangle.a.x, triangle.b.x, triangle.c.x);
|
|
22
20
|
this.bounds.min.y = Math.min(this.bounds.min.y, triangle.a.y, triangle.b.y, triangle.c.y);
|
|
23
21
|
this.bounds.min.z = Math.min(this.bounds.min.z, triangle.a.z, triangle.b.z, triangle.c.z);
|
|
@@ -42,7 +40,7 @@ class Octree {
|
|
|
42
40
|
for (let x = 0; x < 2; x++) {
|
|
43
41
|
for (let y = 0; y < 2; y++) {
|
|
44
42
|
for (let z = 0; z < 2; z++) {
|
|
45
|
-
const box = new
|
|
43
|
+
const box = new Box3();
|
|
46
44
|
const v = _v1.set(x, y, z);
|
|
47
45
|
box.min.copy(this.box.min).add(v.multiply(halfsize));
|
|
48
46
|
box.max.copy(box.min).add(halfsize);
|
|
@@ -215,7 +213,7 @@ class Octree {
|
|
|
215
213
|
}
|
|
216
214
|
}
|
|
217
215
|
if (hit) {
|
|
218
|
-
const collisionVector = _capsule.getCenter(new
|
|
216
|
+
const collisionVector = _capsule.getCenter(new Vector3()).sub(capsule.getCenter(_v1));
|
|
219
217
|
const depth = collisionVector.length();
|
|
220
218
|
return { normal: collisionVector.normalize(), depth };
|
|
221
219
|
}
|
|
@@ -253,13 +251,13 @@ class Octree {
|
|
|
253
251
|
}
|
|
254
252
|
const positionAttribute = geometry.getAttribute("position");
|
|
255
253
|
for (let i = 0; i < positionAttribute.count; i += 3) {
|
|
256
|
-
const v1 = new
|
|
257
|
-
const v2 = new
|
|
258
|
-
const v3 = new
|
|
254
|
+
const v1 = new Vector3().fromBufferAttribute(positionAttribute, i);
|
|
255
|
+
const v2 = new Vector3().fromBufferAttribute(positionAttribute, i + 1);
|
|
256
|
+
const v3 = new Vector3().fromBufferAttribute(positionAttribute, i + 2);
|
|
259
257
|
v1.applyMatrix4(obj.matrixWorld);
|
|
260
258
|
v2.applyMatrix4(obj.matrixWorld);
|
|
261
259
|
v3.applyMatrix4(obj.matrixWorld);
|
|
262
|
-
this.addTriangle(new
|
|
260
|
+
this.addTriangle(new Triangle(v1, v2, v3));
|
|
263
261
|
}
|
|
264
262
|
if (isTemp) {
|
|
265
263
|
geometry.dispose();
|
|
@@ -270,4 +268,6 @@ class Octree {
|
|
|
270
268
|
return this;
|
|
271
269
|
}
|
|
272
270
|
}
|
|
273
|
-
|
|
271
|
+
export {
|
|
272
|
+
Octree
|
|
273
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
4
|
var __publicField = (obj, key, value) => {
|
|
4
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
6
|
return value;
|
|
6
7
|
};
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
9
|
class SimplexNoise {
|
|
8
10
|
/**
|
|
9
11
|
* You can pass in a random number generator object if you like.
|
|
@@ -435,6 +437,4 @@ class SimplexNoise {
|
|
|
435
437
|
}
|
|
436
438
|
}
|
|
437
439
|
}
|
|
438
|
-
|
|
439
|
-
SimplexNoise
|
|
440
|
-
};
|
|
440
|
+
exports.SimplexNoise = SimplexNoise;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
3
|
var __publicField = (obj, key, value) => {
|
|
5
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
5
|
return value;
|
|
7
6
|
};
|
|
8
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
7
|
class SimplexNoise {
|
|
10
8
|
/**
|
|
11
9
|
* You can pass in a random number generator object if you like.
|
|
@@ -437,4 +435,6 @@ class SimplexNoise {
|
|
|
437
435
|
}
|
|
438
436
|
}
|
|
439
437
|
}
|
|
440
|
-
|
|
438
|
+
export {
|
|
439
|
+
SimplexNoise
|
|
440
|
+
};
|