three-stdlib 2.35.5 → 2.35.6
Sign up to get free protection for your applications and to get access to all the features.
- package/_polyfill/CapsuleGeometry.cjs +20 -17
- package/_polyfill/CapsuleGeometry.cjs.map +1 -1
- package/_polyfill/CapsuleGeometry.js +20 -17
- package/_polyfill/CapsuleGeometry.js.map +1 -1
- package/_polyfill/constants.cjs +1 -1
- package/_polyfill/constants.cjs.map +1 -1
- package/_polyfill/constants.js +1 -1
- package/_polyfill/constants.js.map +1 -1
- package/animation/AnimationClipCreator.cjs +13 -13
- package/animation/AnimationClipCreator.cjs.map +1 -1
- package/animation/AnimationClipCreator.js +13 -13
- package/animation/AnimationClipCreator.js.map +1 -1
- package/animation/CCDIKSolver.cjs +11 -11
- package/animation/CCDIKSolver.cjs.map +1 -1
- package/animation/CCDIKSolver.js +12 -12
- package/animation/CCDIKSolver.js.map +1 -1
- package/animation/MMDAnimationHelper.cjs +1 -1
- package/animation/MMDAnimationHelper.cjs.map +1 -1
- package/animation/MMDAnimationHelper.js +1 -1
- package/animation/MMDAnimationHelper.js.map +1 -1
- package/animation/MMDPhysics.cjs +4 -4
- package/animation/MMDPhysics.cjs.map +1 -1
- package/animation/MMDPhysics.js +4 -4
- package/animation/MMDPhysics.js.map +1 -1
- package/controls/ArcballControls.cjs +2 -2
- package/controls/ArcballControls.cjs.map +1 -1
- package/controls/ArcballControls.js +3 -3
- package/controls/ArcballControls.js.map +1 -1
- package/controls/FirstPersonControls.cjs +1 -1
- package/controls/FirstPersonControls.cjs.map +1 -1
- package/controls/FirstPersonControls.js +1 -1
- package/controls/FirstPersonControls.js.map +1 -1
- package/controls/OrbitControls.cjs +2 -2
- package/controls/OrbitControls.cjs.map +1 -1
- package/controls/OrbitControls.js +3 -3
- package/controls/OrbitControls.js.map +1 -1
- package/controls/PointerLockControls.cjs +2 -2
- package/controls/PointerLockControls.cjs.map +1 -1
- package/controls/PointerLockControls.js +3 -3
- package/controls/PointerLockControls.js.map +1 -1
- package/csm/CSM.cjs +4 -4
- package/csm/CSM.cjs.map +1 -1
- package/csm/CSM.js +5 -5
- package/csm/CSM.js.map +1 -1
- package/csm/CSMFrustum.cjs +1 -1
- package/csm/CSMFrustum.cjs.map +1 -1
- package/csm/CSMFrustum.js +2 -2
- package/csm/CSMFrustum.js.map +1 -1
- package/deprecated/Geometry.cjs +722 -715
- package/deprecated/Geometry.cjs.map +1 -1
- package/deprecated/Geometry.js +723 -716
- package/deprecated/Geometry.js.map +1 -1
- package/effects/AnaglyphEffect.cjs +2 -1
- package/effects/AnaglyphEffect.cjs.map +1 -1
- package/effects/AnaglyphEffect.js +3 -2
- package/effects/AnaglyphEffect.js.map +1 -1
- package/effects/OutlineEffect.cjs +2 -1
- package/effects/OutlineEffect.cjs.map +1 -1
- package/effects/OutlineEffect.js +3 -2
- package/effects/OutlineEffect.js.map +1 -1
- package/effects/ParallaxBarrierEffect.cjs +2 -1
- package/effects/ParallaxBarrierEffect.cjs.map +1 -1
- package/effects/ParallaxBarrierEffect.js +3 -2
- package/effects/ParallaxBarrierEffect.js.map +1 -1
- package/exporters/DRACOExporter.cjs +133 -122
- package/exporters/DRACOExporter.cjs.map +1 -1
- package/exporters/DRACOExporter.d.ts +34 -21
- package/exporters/DRACOExporter.js +133 -122
- package/exporters/DRACOExporter.js.map +1 -1
- package/exporters/GLTFExporter.cjs +170 -167
- package/exporters/GLTFExporter.cjs.map +1 -1
- package/exporters/GLTFExporter.js +170 -167
- package/exporters/GLTFExporter.js.map +1 -1
- package/geometries/LightningStrike.cjs +524 -515
- package/geometries/LightningStrike.cjs.map +1 -1
- package/geometries/LightningStrike.js +524 -515
- package/geometries/LightningStrike.js.map +1 -1
- package/geometries/RoundedBoxGeometry.cjs +1 -1
- package/geometries/RoundedBoxGeometry.cjs.map +1 -1
- package/geometries/RoundedBoxGeometry.js +2 -2
- package/geometries/RoundedBoxGeometry.js.map +1 -1
- package/helpers/RaycasterHelper.cjs +2 -2
- package/helpers/RaycasterHelper.cjs.map +1 -1
- package/helpers/RaycasterHelper.js +3 -3
- package/helpers/RaycasterHelper.js.map +1 -1
- package/helpers/VertexNormalsHelper.cjs +3 -3
- package/helpers/VertexNormalsHelper.cjs.map +1 -1
- package/helpers/VertexNormalsHelper.js +4 -4
- package/helpers/VertexNormalsHelper.js.map +1 -1
- package/helpers/VertexTangentsHelper.cjs +2 -2
- package/helpers/VertexTangentsHelper.cjs.map +1 -1
- package/helpers/VertexTangentsHelper.js +3 -3
- package/helpers/VertexTangentsHelper.js.map +1 -1
- package/interactive/InteractiveGroup.cjs +1 -1
- package/interactive/InteractiveGroup.cjs.map +1 -1
- package/interactive/InteractiveGroup.js +2 -2
- package/interactive/InteractiveGroup.js.map +1 -1
- package/interactive/SelectionBox.cjs +15 -15
- package/interactive/SelectionBox.cjs.map +1 -1
- package/interactive/SelectionBox.js +16 -16
- package/interactive/SelectionBox.js.map +1 -1
- package/libs/chevrotain.cjs +1 -1
- package/libs/chevrotain.cjs.map +1 -1
- package/libs/chevrotain.js +1 -1
- package/libs/chevrotain.js.map +1 -1
- package/libs/lottie.cjs +1 -1
- package/libs/lottie.cjs.map +1 -1
- package/libs/lottie.js +1 -1
- package/libs/lottie.js.map +1 -1
- package/libs/opentype.cjs +1 -1
- package/libs/opentype.cjs.map +1 -1
- package/libs/opentype.js +1 -1
- package/libs/opentype.js.map +1 -1
- package/lights/LightProbeGenerator.cjs +5 -5
- package/lights/LightProbeGenerator.cjs.map +1 -1
- package/lights/LightProbeGenerator.js +5 -5
- package/lights/LightProbeGenerator.js.map +1 -1
- package/lights/RectAreaLightUniformsLib.cjs +3 -3
- package/lights/RectAreaLightUniformsLib.cjs.map +1 -1
- package/lights/RectAreaLightUniformsLib.js +3 -3
- package/lights/RectAreaLightUniformsLib.js.map +1 -1
- package/lines/LineMaterial.cjs +2 -1
- package/lines/LineMaterial.cjs.map +1 -1
- package/lines/LineMaterial.js +3 -2
- package/lines/LineMaterial.js.map +1 -1
- package/lines/LineSegments2.cjs +13 -13
- package/lines/LineSegments2.cjs.map +1 -1
- package/lines/LineSegments2.js +14 -14
- package/lines/LineSegments2.js.map +1 -1
- package/lines/LineSegmentsGeometry.cjs +2 -2
- package/lines/LineSegmentsGeometry.cjs.map +1 -1
- package/lines/LineSegmentsGeometry.js +3 -3
- package/lines/LineSegmentsGeometry.js.map +1 -1
- package/lines/Wireframe.cjs +3 -3
- package/lines/Wireframe.cjs.map +1 -1
- package/lines/Wireframe.js +4 -4
- package/lines/Wireframe.js.map +1 -1
- package/loaders/BasisTextureLoader.cjs +441 -435
- package/loaders/BasisTextureLoader.cjs.map +1 -1
- package/loaders/BasisTextureLoader.js +441 -435
- package/loaders/BasisTextureLoader.js.map +1 -1
- package/loaders/EXRLoader.cjs +2 -1
- package/loaders/EXRLoader.cjs.map +1 -1
- package/loaders/EXRLoader.js +3 -2
- package/loaders/EXRLoader.js.map +1 -1
- package/loaders/FBXLoader.cjs +2 -2
- package/loaders/FBXLoader.cjs.map +1 -1
- package/loaders/FBXLoader.js +2 -2
- package/loaders/FBXLoader.js.map +1 -1
- package/loaders/FontLoader.cjs +2 -2
- package/loaders/FontLoader.cjs.map +1 -1
- package/loaders/FontLoader.d.ts +2 -2
- package/loaders/FontLoader.js +2 -2
- package/loaders/FontLoader.js.map +1 -1
- package/loaders/GLTFLoader.cjs +2 -2
- package/loaders/GLTFLoader.cjs.map +1 -1
- package/loaders/GLTFLoader.js +2 -2
- package/loaders/GLTFLoader.js.map +1 -1
- package/loaders/KTX2Loader.cjs +377 -374
- package/loaders/KTX2Loader.cjs.map +1 -1
- package/loaders/KTX2Loader.js +377 -374
- package/loaders/KTX2Loader.js.map +1 -1
- package/loaders/LDrawLoader.cjs +5 -4
- package/loaders/LDrawLoader.cjs.map +1 -1
- package/loaders/LDrawLoader.js +6 -5
- package/loaders/LDrawLoader.js.map +1 -1
- package/loaders/OBJLoader.cjs +5 -5
- package/loaders/OBJLoader.cjs.map +1 -1
- package/loaders/OBJLoader.js +6 -6
- package/loaders/OBJLoader.js.map +1 -1
- package/loaders/PRWMLoader.cjs +46 -43
- package/loaders/PRWMLoader.cjs.map +1 -1
- package/loaders/PRWMLoader.js +46 -43
- package/loaders/PRWMLoader.js.map +1 -1
- package/loaders/SVGLoader.cjs +1694 -1688
- package/loaders/SVGLoader.cjs.map +1 -1
- package/loaders/SVGLoader.js +1694 -1688
- package/loaders/SVGLoader.js.map +1 -1
- package/loaders/XLoader.cjs +1 -1
- package/loaders/XLoader.cjs.map +1 -1
- package/loaders/XLoader.js +1 -1
- package/loaders/XLoader.js.map +1 -1
- package/math/Capsule.cjs +3 -3
- package/math/Capsule.cjs.map +1 -1
- package/math/Capsule.js +3 -3
- package/math/Capsule.js.map +1 -1
- package/math/ColorConverter.cjs +9 -9
- package/math/ColorConverter.cjs.map +1 -1
- package/math/ColorConverter.js +9 -9
- package/math/ColorConverter.js.map +1 -1
- package/math/ConvexHull.cjs +53 -50
- package/math/ConvexHull.cjs.map +1 -1
- package/math/ConvexHull.js +53 -50
- package/math/ConvexHull.js.map +1 -1
- package/math/ImprovedNoise.cjs +1 -1
- package/math/ImprovedNoise.cjs.map +1 -1
- package/math/ImprovedNoise.js +1 -1
- package/math/ImprovedNoise.js.map +1 -1
- package/math/MeshSurfaceSampler.cjs +2 -2
- package/math/MeshSurfaceSampler.cjs.map +1 -1
- package/math/MeshSurfaceSampler.js +2 -2
- package/math/MeshSurfaceSampler.js.map +1 -1
- package/math/OBB.cjs +14 -14
- package/math/OBB.cjs.map +1 -1
- package/math/OBB.js +15 -15
- package/math/OBB.js.map +1 -1
- package/math/Octree.cjs +7 -7
- package/math/Octree.cjs.map +1 -1
- package/math/Octree.js +8 -8
- package/math/Octree.js.map +1 -1
- package/misc/ConvexObjectBreaker.cjs +271 -268
- package/misc/ConvexObjectBreaker.cjs.map +1 -1
- package/misc/ConvexObjectBreaker.js +272 -269
- package/misc/ConvexObjectBreaker.js.map +1 -1
- package/misc/Gyroscope.cjs +6 -6
- package/misc/Gyroscope.cjs.map +1 -1
- package/misc/Gyroscope.js +7 -7
- package/misc/Gyroscope.js.map +1 -1
- package/modifiers/CurveModifier.cjs +1 -1
- package/modifiers/CurveModifier.cjs.map +1 -1
- package/modifiers/CurveModifier.js +2 -2
- package/modifiers/CurveModifier.js.map +1 -1
- package/modifiers/SimplifyModifier.cjs +2 -2
- package/modifiers/SimplifyModifier.cjs.map +1 -1
- package/modifiers/SimplifyModifier.js +2 -2
- package/modifiers/SimplifyModifier.js.map +1 -1
- package/objects/BatchedMesh.cjs +2 -2
- package/objects/BatchedMesh.cjs.map +1 -1
- package/objects/BatchedMesh.js +3 -3
- package/objects/BatchedMesh.js.map +1 -1
- package/objects/GroundProjectedEnv.cjs +2 -1
- package/objects/GroundProjectedEnv.cjs.map +1 -1
- package/objects/GroundProjectedEnv.js +3 -2
- package/objects/GroundProjectedEnv.js.map +1 -1
- package/objects/Lensflare.cjs +209 -206
- package/objects/Lensflare.cjs.map +1 -1
- package/objects/Lensflare.js +209 -206
- package/objects/Lensflare.js.map +1 -1
- package/objects/Reflector.cjs +154 -146
- package/objects/Reflector.cjs.map +1 -1
- package/objects/Reflector.js +154 -146
- package/objects/Reflector.js.map +1 -1
- package/objects/ReflectorForSSRPass.cjs +183 -180
- package/objects/ReflectorForSSRPass.cjs.map +1 -1
- package/objects/ReflectorForSSRPass.js +183 -180
- package/objects/ReflectorForSSRPass.js.map +1 -1
- package/objects/Refractor.cjs +164 -161
- package/objects/Refractor.cjs.map +1 -1
- package/objects/Refractor.js +164 -161
- package/objects/Refractor.js.map +1 -1
- package/objects/ShadowMesh.cjs +1 -1
- package/objects/ShadowMesh.cjs.map +1 -1
- package/objects/ShadowMesh.js +2 -2
- package/objects/ShadowMesh.js.map +1 -1
- package/objects/Sky.cjs +35 -32
- package/objects/Sky.cjs.map +1 -1
- package/objects/Sky.d.ts +17 -42
- package/objects/Sky.js +35 -32
- package/objects/Sky.js.map +1 -1
- package/objects/Water.cjs +2 -1
- package/objects/Water.cjs.map +1 -1
- package/objects/Water.js +3 -2
- package/objects/Water.js.map +1 -1
- package/objects/Water2.cjs +143 -140
- package/objects/Water2.cjs.map +1 -1
- package/objects/Water2.js +143 -140
- package/objects/Water2.js.map +1 -1
- package/package.json +1 -1
- package/postprocessing/SAOPass.cjs +267 -264
- package/postprocessing/SAOPass.cjs.map +1 -1
- package/postprocessing/SAOPass.js +267 -264
- package/postprocessing/SAOPass.js.map +1 -1
- package/postprocessing/SSAOPass.cjs +253 -250
- package/postprocessing/SSAOPass.cjs.map +1 -1
- package/postprocessing/SSAOPass.js +253 -250
- package/postprocessing/SSAOPass.js.map +1 -1
- package/postprocessing/SSRPass.cjs +379 -376
- package/postprocessing/SSRPass.cjs.map +1 -1
- package/postprocessing/SSRPass.js +379 -376
- package/postprocessing/SSRPass.js.map +1 -1
- package/postprocessing/UnrealBloomPass.cjs +205 -202
- package/postprocessing/UnrealBloomPass.cjs.map +1 -1
- package/postprocessing/UnrealBloomPass.js +205 -202
- package/postprocessing/UnrealBloomPass.js.map +1 -1
- package/renderers/CSS2DRenderer.cjs +5 -5
- package/renderers/CSS2DRenderer.cjs.map +1 -1
- package/renderers/CSS2DRenderer.js +5 -5
- package/renderers/CSS2DRenderer.js.map +1 -1
- package/renderers/CSS3DRenderer.cjs +5 -5
- package/renderers/CSS3DRenderer.cjs.map +1 -1
- package/renderers/CSS3DRenderer.js +6 -6
- package/renderers/CSS3DRenderer.js.map +1 -1
- package/shaders/ACESFilmicToneMappingShader.cjs +71 -46
- package/shaders/ACESFilmicToneMappingShader.cjs.map +1 -1
- package/shaders/ACESFilmicToneMappingShader.js +71 -46
- package/shaders/ACESFilmicToneMappingShader.js.map +1 -1
- package/shaders/AfterimageShader.cjs +41 -22
- package/shaders/AfterimageShader.cjs.map +1 -1
- package/shaders/AfterimageShader.js +41 -22
- package/shaders/AfterimageShader.js.map +1 -1
- package/shaders/BasicShader.cjs +20 -6
- package/shaders/BasicShader.cjs.map +1 -1
- package/shaders/BasicShader.js +20 -6
- package/shaders/BasicShader.js.map +1 -1
- package/shaders/BleachBypassShader.cjs +46 -26
- package/shaders/BleachBypassShader.cjs.map +1 -1
- package/shaders/BleachBypassShader.js +46 -26
- package/shaders/BleachBypassShader.js.map +1 -1
- package/shaders/BlendShader.cjs +33 -19
- package/shaders/BlendShader.cjs.map +1 -1
- package/shaders/BlendShader.js +33 -19
- package/shaders/BlendShader.js.map +1 -1
- package/shaders/BokehShader.cjs +117 -90
- package/shaders/BokehShader.cjs.map +1 -1
- package/shaders/BokehShader.js +117 -90
- package/shaders/BokehShader.js.map +1 -1
- package/shaders/BokehShader2.cjs +333 -232
- package/shaders/BokehShader2.cjs.map +1 -1
- package/shaders/BokehShader2.js +333 -232
- package/shaders/BokehShader2.js.map +1 -1
- package/shaders/BrightnessContrastShader.cjs +38 -22
- package/shaders/BrightnessContrastShader.cjs.map +1 -1
- package/shaders/BrightnessContrastShader.js +38 -22
- package/shaders/BrightnessContrastShader.js.map +1 -1
- package/shaders/ColorCorrectionShader.cjs +35 -21
- package/shaders/ColorCorrectionShader.cjs.map +1 -1
- package/shaders/ColorCorrectionShader.js +35 -21
- package/shaders/ColorCorrectionShader.js.map +1 -1
- package/shaders/ColorifyShader.cjs +34 -19
- package/shaders/ColorifyShader.cjs.map +1 -1
- package/shaders/ColorifyShader.js +34 -19
- package/shaders/ColorifyShader.js.map +1 -1
- package/shaders/ConvolutionShader.cjs +43 -24
- package/shaders/ConvolutionShader.cjs.map +1 -1
- package/shaders/ConvolutionShader.js +43 -24
- package/shaders/ConvolutionShader.js.map +1 -1
- package/shaders/CopyShader.cjs +30 -16
- package/shaders/CopyShader.cjs.map +1 -1
- package/shaders/CopyShader.js +30 -16
- package/shaders/CopyShader.js.map +1 -1
- package/shaders/DOFMipMapShader.cjs +38 -21
- package/shaders/DOFMipMapShader.cjs.map +1 -1
- package/shaders/DOFMipMapShader.js +38 -21
- package/shaders/DOFMipMapShader.js.map +1 -1
- package/shaders/DepthLimitedBlurShader.cjs +98 -69
- package/shaders/DepthLimitedBlurShader.cjs.map +1 -1
- package/shaders/DepthLimitedBlurShader.js +98 -69
- package/shaders/DepthLimitedBlurShader.js.map +1 -1
- package/shaders/DigitalGlitch.cjs +70 -59
- package/shaders/DigitalGlitch.cjs.map +1 -1
- package/shaders/DigitalGlitch.js +70 -59
- package/shaders/DigitalGlitch.js.map +1 -1
- package/shaders/DotScreenShader.cjs +49 -28
- package/shaders/DotScreenShader.cjs.map +1 -1
- package/shaders/DotScreenShader.js +49 -28
- package/shaders/DotScreenShader.js.map +1 -1
- package/shaders/FXAAShader.cjs +1098 -1089
- package/shaders/FXAAShader.cjs.map +1 -1
- package/shaders/FXAAShader.js +1098 -1089
- package/shaders/FXAAShader.js.map +1 -1
- package/shaders/FilmShader.cjs +57 -29
- package/shaders/FilmShader.cjs.map +1 -1
- package/shaders/FilmShader.js +57 -29
- package/shaders/FilmShader.js.map +1 -1
- package/shaders/FocusShader.cjs +70 -43
- package/shaders/FocusShader.cjs.map +1 -1
- package/shaders/FocusShader.js +70 -43
- package/shaders/FocusShader.js.map +1 -1
- package/shaders/FreiChenShader.cjs +74 -53
- package/shaders/FreiChenShader.cjs.map +1 -1
- package/shaders/FreiChenShader.js +74 -53
- package/shaders/FreiChenShader.js.map +1 -1
- package/shaders/FresnelShader.cjs +55 -35
- package/shaders/FresnelShader.cjs.map +1 -1
- package/shaders/FresnelShader.js +55 -35
- package/shaders/FresnelShader.js.map +1 -1
- package/shaders/GammaCorrectionShader.cjs +33 -19
- package/shaders/GammaCorrectionShader.cjs.map +1 -1
- package/shaders/GammaCorrectionShader.js +33 -19
- package/shaders/GammaCorrectionShader.js.map +1 -1
- package/shaders/GodRaysShader.cjs +193 -116
- package/shaders/GodRaysShader.cjs.map +1 -1
- package/shaders/GodRaysShader.js +193 -116
- package/shaders/GodRaysShader.js.map +1 -1
- package/shaders/HalftoneShader.cjs +270 -192
- package/shaders/HalftoneShader.cjs.map +1 -1
- package/shaders/HalftoneShader.js +270 -192
- package/shaders/HalftoneShader.js.map +1 -1
- package/shaders/HorizontalTiltShiftShader.cjs +43 -27
- package/shaders/HorizontalTiltShiftShader.cjs.map +1 -1
- package/shaders/HorizontalTiltShiftShader.js +43 -27
- package/shaders/HorizontalTiltShiftShader.js.map +1 -1
- package/shaders/HueSaturationShader.cjs +47 -31
- package/shaders/HueSaturationShader.cjs.map +1 -1
- package/shaders/HueSaturationShader.js +47 -31
- package/shaders/HueSaturationShader.js.map +1 -1
- package/shaders/KaleidoShader.cjs +37 -24
- package/shaders/KaleidoShader.cjs.map +1 -1
- package/shaders/KaleidoShader.js +37 -24
- package/shaders/KaleidoShader.js.map +1 -1
- package/shaders/LuminosityHighPassShader.cjs +43 -24
- package/shaders/LuminosityHighPassShader.cjs.map +1 -1
- package/shaders/LuminosityHighPassShader.js +43 -24
- package/shaders/LuminosityHighPassShader.js.map +1 -1
- package/shaders/LuminosityShader.cjs +34 -17
- package/shaders/LuminosityShader.cjs.map +1 -1
- package/shaders/LuminosityShader.js +34 -17
- package/shaders/LuminosityShader.js.map +1 -1
- package/shaders/MirrorShader.cjs +39 -26
- package/shaders/MirrorShader.cjs.map +1 -1
- package/shaders/MirrorShader.js +39 -26
- package/shaders/MirrorShader.js.map +1 -1
- package/shaders/NormalMapShader.cjs +36 -21
- package/shaders/NormalMapShader.cjs.map +1 -1
- package/shaders/NormalMapShader.js +36 -21
- package/shaders/NormalMapShader.js.map +1 -1
- package/shaders/ParallaxShader.cjs +147 -97
- package/shaders/ParallaxShader.cjs.map +1 -1
- package/shaders/ParallaxShader.js +147 -97
- package/shaders/ParallaxShader.js.map +1 -1
- package/shaders/PixelShader.cjs +31 -18
- package/shaders/PixelShader.cjs.map +1 -1
- package/shaders/PixelShader.js +31 -18
- package/shaders/PixelShader.js.map +1 -1
- package/shaders/RGBShiftShader.cjs +33 -20
- package/shaders/RGBShiftShader.cjs.map +1 -1
- package/shaders/RGBShiftShader.js +33 -20
- package/shaders/RGBShiftShader.js.map +1 -1
- package/shaders/SAOShader.cjs +154 -117
- package/shaders/SAOShader.cjs.map +1 -1
- package/shaders/SAOShader.js +154 -117
- package/shaders/SAOShader.js.map +1 -1
- package/shaders/SMAAShader.cjs +358 -270
- package/shaders/SMAAShader.cjs.map +1 -1
- package/shaders/SMAAShader.js +358 -270
- package/shaders/SMAAShader.js.map +1 -1
- package/shaders/SSAOShader.cjs +236 -142
- package/shaders/SSAOShader.cjs.map +1 -1
- package/shaders/SSAOShader.js +236 -142
- package/shaders/SSAOShader.js.map +1 -1
- package/shaders/SSRShader.cjs +4 -4
- package/shaders/SSRShader.cjs.map +1 -1
- package/shaders/SSRShader.js +4 -4
- package/shaders/SSRShader.js.map +1 -1
- package/shaders/SepiaShader.cjs +36 -20
- package/shaders/SepiaShader.cjs.map +1 -1
- package/shaders/SepiaShader.js +36 -20
- package/shaders/SepiaShader.js.map +1 -1
- package/shaders/SobelOperatorShader.cjs +64 -37
- package/shaders/SobelOperatorShader.cjs.map +1 -1
- package/shaders/SobelOperatorShader.js +64 -37
- package/shaders/SobelOperatorShader.js.map +1 -1
- package/shaders/TechnicolorShader.cjs +29 -16
- package/shaders/TechnicolorShader.cjs.map +1 -1
- package/shaders/TechnicolorShader.js +29 -16
- package/shaders/TechnicolorShader.js.map +1 -1
- package/shaders/ToneMapShader.cjs +55 -35
- package/shaders/ToneMapShader.cjs.map +1 -1
- package/shaders/ToneMapShader.js +55 -35
- package/shaders/ToneMapShader.js.map +1 -1
- package/shaders/ToonShader.cjs +275 -165
- package/shaders/ToonShader.cjs.map +1 -1
- package/shaders/ToonShader.js +275 -165
- package/shaders/ToonShader.js.map +1 -1
- package/shaders/TriangleBlurShader.cjs +50 -27
- package/shaders/TriangleBlurShader.cjs.map +1 -1
- package/shaders/TriangleBlurShader.js +50 -27
- package/shaders/TriangleBlurShader.js.map +1 -1
- package/shaders/UnpackDepthRGBAShader.cjs +32 -17
- package/shaders/UnpackDepthRGBAShader.cjs.map +1 -1
- package/shaders/UnpackDepthRGBAShader.js +32 -17
- package/shaders/UnpackDepthRGBAShader.js.map +1 -1
- package/shaders/VerticalTiltShiftShader.cjs +43 -27
- package/shaders/VerticalTiltShiftShader.cjs.map +1 -1
- package/shaders/VerticalTiltShiftShader.js +43 -27
- package/shaders/VerticalTiltShiftShader.js.map +1 -1
- package/shaders/VignetteShader.cjs +43 -27
- package/shaders/VignetteShader.cjs.map +1 -1
- package/shaders/VignetteShader.js +43 -27
- package/shaders/VignetteShader.js.map +1 -1
- package/shaders/VolumeShader.cjs +264 -213
- package/shaders/VolumeShader.cjs.map +1 -1
- package/shaders/VolumeShader.js +264 -213
- package/shaders/VolumeShader.js.map +1 -1
- package/shaders/WaterRefractionShader.cjs +63 -35
- package/shaders/WaterRefractionShader.cjs.map +1 -1
- package/shaders/WaterRefractionShader.js +63 -35
- package/shaders/WaterRefractionShader.js.map +1 -1
- package/utils/GeometryCompressionUtils.cjs +2 -1
- package/utils/GeometryCompressionUtils.cjs.map +1 -1
- package/utils/GeometryCompressionUtils.js +3 -2
- package/utils/GeometryCompressionUtils.js.map +1 -1
- package/utils/RoughnessMipmapper.cjs +3 -3
- package/utils/RoughnessMipmapper.cjs.map +1 -1
- package/utils/RoughnessMipmapper.js +4 -4
- package/utils/RoughnessMipmapper.js.map +1 -1
- package/webxr/ARButton.cjs +3 -3
- package/webxr/ARButton.cjs.map +1 -1
- package/webxr/ARButton.d.ts +3 -3
- package/webxr/ARButton.js +3 -3
- package/webxr/ARButton.js.map +1 -1
- package/webxr/OculusHandPointerModel.cjs +2 -2
- package/webxr/OculusHandPointerModel.cjs.map +1 -1
- package/webxr/OculusHandPointerModel.js +2 -2
- package/webxr/OculusHandPointerModel.js.map +1 -1
- package/webxr/VRButton.cjs +98 -95
- package/webxr/VRButton.cjs.map +1 -1
- package/webxr/VRButton.d.ts +9 -6
- package/webxr/VRButton.js +98 -95
- package/webxr/VRButton.js.map +1 -1
- package/webxr/XRHandPrimitiveModel.cjs +2 -2
- package/webxr/XRHandPrimitiveModel.cjs.map +1 -1
- package/webxr/XRHandPrimitiveModel.js +3 -3
- package/webxr/XRHandPrimitiveModel.js.map +1 -1
@@ -5,137 +5,148 @@ var __publicField = (obj, key, value) => {
|
|
5
5
|
return value;
|
6
6
|
};
|
7
7
|
import { BufferGeometry, Mesh, Points } from "three";
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if (DracoEncoderModule === void 0) {
|
22
|
-
throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");
|
23
|
-
}
|
24
|
-
const geometry = object.geometry;
|
25
|
-
const dracoEncoder = DracoEncoderModule();
|
26
|
-
const encoder = new dracoEncoder.Encoder();
|
27
|
-
let builder;
|
28
|
-
let dracoObject;
|
29
|
-
if (!geometry.isBufferGeometry) {
|
30
|
-
throw new Error("THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.");
|
31
|
-
}
|
32
|
-
if (object instanceof Mesh && object.isMesh) {
|
33
|
-
builder = new dracoEncoder.MeshBuilder();
|
34
|
-
dracoObject = new dracoEncoder.Mesh();
|
35
|
-
const vertices = geometry.getAttribute("position");
|
36
|
-
builder.AddFloatAttributeToMesh(
|
37
|
-
dracoObject,
|
38
|
-
dracoEncoder.POSITION,
|
39
|
-
vertices.count,
|
40
|
-
vertices.itemSize,
|
41
|
-
vertices.array
|
42
|
-
);
|
43
|
-
const faces = geometry.getIndex();
|
44
|
-
if (faces !== null) {
|
45
|
-
builder.AddFacesToMesh(dracoObject, faces.count / 3, faces.array);
|
46
|
-
} else {
|
47
|
-
const faces2 = new (vertices.count > 65535 ? Uint32Array : Uint16Array)(vertices.count);
|
48
|
-
for (let i = 0; i < faces2.length; i++) {
|
49
|
-
faces2[i] = i;
|
50
|
-
}
|
51
|
-
builder.AddFacesToMesh(dracoObject, vertices.count, faces2);
|
8
|
+
const DRACOExporter = /* @__PURE__ */ (() => {
|
9
|
+
const _DRACOExporter = class {
|
10
|
+
parse(object, options = {
|
11
|
+
decodeSpeed: 5,
|
12
|
+
encodeSpeed: 5,
|
13
|
+
encoderMethod: _DRACOExporter.MESH_EDGEBREAKER_ENCODING,
|
14
|
+
quantization: [16, 8, 8, 8, 8],
|
15
|
+
exportUvs: true,
|
16
|
+
exportNormals: true,
|
17
|
+
exportColor: false
|
18
|
+
}) {
|
19
|
+
if (object instanceof BufferGeometry && object.isBufferGeometry) {
|
20
|
+
throw new Error("DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.");
|
52
21
|
}
|
53
|
-
if (
|
54
|
-
|
55
|
-
if (normals !== void 0) {
|
56
|
-
builder.AddFloatAttributeToMesh(
|
57
|
-
dracoObject,
|
58
|
-
dracoEncoder.NORMAL,
|
59
|
-
normals.count,
|
60
|
-
normals.itemSize,
|
61
|
-
normals.array
|
62
|
-
);
|
63
|
-
}
|
22
|
+
if (DracoEncoderModule === void 0) {
|
23
|
+
throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");
|
64
24
|
}
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
25
|
+
const geometry = object.geometry;
|
26
|
+
const dracoEncoder = DracoEncoderModule();
|
27
|
+
const encoder = new dracoEncoder.Encoder();
|
28
|
+
let builder;
|
29
|
+
let dracoObject;
|
30
|
+
if (!geometry.isBufferGeometry) {
|
31
|
+
throw new Error(
|
32
|
+
"THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance."
|
33
|
+
);
|
70
34
|
}
|
71
|
-
if (
|
72
|
-
|
73
|
-
|
74
|
-
|
35
|
+
if (object instanceof Mesh && object.isMesh) {
|
36
|
+
builder = new dracoEncoder.MeshBuilder();
|
37
|
+
dracoObject = new dracoEncoder.Mesh();
|
38
|
+
const vertices = geometry.getAttribute("position");
|
39
|
+
builder.AddFloatAttributeToMesh(
|
40
|
+
dracoObject,
|
41
|
+
dracoEncoder.POSITION,
|
42
|
+
vertices.count,
|
43
|
+
vertices.itemSize,
|
44
|
+
vertices.array
|
45
|
+
);
|
46
|
+
const faces = geometry.getIndex();
|
47
|
+
if (faces !== null) {
|
48
|
+
builder.AddFacesToMesh(dracoObject, faces.count / 3, faces.array);
|
49
|
+
} else {
|
50
|
+
const faces2 = new (vertices.count > 65535 ? Uint32Array : Uint16Array)(vertices.count);
|
51
|
+
for (let i = 0; i < faces2.length; i++) {
|
52
|
+
faces2[i] = i;
|
53
|
+
}
|
54
|
+
builder.AddFacesToMesh(dracoObject, vertices.count, faces2);
|
75
55
|
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
56
|
+
if (options.exportNormals) {
|
57
|
+
const normals = geometry.getAttribute("normal");
|
58
|
+
if (normals !== void 0) {
|
59
|
+
builder.AddFloatAttributeToMesh(
|
60
|
+
dracoObject,
|
61
|
+
dracoEncoder.NORMAL,
|
62
|
+
normals.count,
|
63
|
+
normals.itemSize,
|
64
|
+
normals.array
|
65
|
+
);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
if (options.exportUvs) {
|
69
|
+
const uvs = geometry.getAttribute("uv");
|
70
|
+
if (uvs !== void 0) {
|
71
|
+
builder.AddFloatAttributeToMesh(dracoObject, dracoEncoder.TEX_COORD, uvs.count, uvs.itemSize, uvs.array);
|
72
|
+
}
|
86
73
|
}
|
74
|
+
if (options.exportColor) {
|
75
|
+
const colors = geometry.getAttribute("color");
|
76
|
+
if (colors !== void 0) {
|
77
|
+
builder.AddFloatAttributeToMesh(
|
78
|
+
dracoObject,
|
79
|
+
dracoEncoder.COLOR,
|
80
|
+
colors.count,
|
81
|
+
colors.itemSize,
|
82
|
+
colors.array
|
83
|
+
);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
} else if (object instanceof Points && object.isPoints) {
|
87
|
+
builder = new dracoEncoder.PointCloudBuilder();
|
88
|
+
dracoObject = new dracoEncoder.PointCloud();
|
89
|
+
const vertices = geometry.getAttribute("position");
|
90
|
+
builder.AddFloatAttribute(dracoObject, dracoEncoder.POSITION, vertices.count, vertices.itemSize, vertices.array);
|
91
|
+
if (options.exportColor) {
|
92
|
+
const colors = geometry.getAttribute("color");
|
93
|
+
if (colors !== void 0) {
|
94
|
+
builder.AddFloatAttribute(dracoObject, dracoEncoder.COLOR, colors.count, colors.itemSize, colors.array);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
} else {
|
98
|
+
throw new Error("DRACOExporter: Unsupported object type.");
|
87
99
|
}
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
if (options.quantization[i] !== void 0) {
|
101
|
-
encoder.SetAttributeQuantization(i, options.quantization[i]);
|
100
|
+
const encodedData = new dracoEncoder.DracoInt8Array();
|
101
|
+
const encodeSpeed = options.encodeSpeed !== void 0 ? options.encodeSpeed : 5;
|
102
|
+
const decodeSpeed = options.decodeSpeed !== void 0 ? options.decodeSpeed : 5;
|
103
|
+
encoder.SetSpeedOptions(encodeSpeed, decodeSpeed);
|
104
|
+
if (options.encoderMethod !== void 0) {
|
105
|
+
encoder.SetEncodingMethod(options.encoderMethod);
|
106
|
+
}
|
107
|
+
if (options.quantization !== void 0) {
|
108
|
+
for (let i = 0; i < 5; i++) {
|
109
|
+
if (options.quantization[i] !== void 0) {
|
110
|
+
encoder.SetAttributeQuantization(i, options.quantization[i]);
|
111
|
+
}
|
102
112
|
}
|
103
113
|
}
|
114
|
+
let length;
|
115
|
+
if (object instanceof Mesh && object.isMesh) {
|
116
|
+
length = encoder.EncodeMeshToDracoBuffer(dracoObject, encodedData);
|
117
|
+
} else {
|
118
|
+
length = encoder.EncodePointCloudToDracoBuffer(dracoObject, true, encodedData);
|
119
|
+
}
|
120
|
+
dracoEncoder.destroy(dracoObject);
|
121
|
+
if (length === 0) {
|
122
|
+
throw new Error("THREE.DRACOExporter: Draco encoding failed.");
|
123
|
+
}
|
124
|
+
const outputData = new Int8Array(new ArrayBuffer(length));
|
125
|
+
for (let i = 0; i < length; i++) {
|
126
|
+
outputData[i] = encodedData.GetValue(i);
|
127
|
+
}
|
128
|
+
dracoEncoder.destroy(encodedData);
|
129
|
+
dracoEncoder.destroy(encoder);
|
130
|
+
dracoEncoder.destroy(builder);
|
131
|
+
return outputData;
|
104
132
|
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
return outputData;
|
123
|
-
}
|
124
|
-
};
|
125
|
-
let DRACOExporter = _DRACOExporter;
|
126
|
-
// Encoder methods
|
127
|
-
__publicField(DRACOExporter, "MESH_EDGEBREAKER_ENCODING", 1);
|
128
|
-
__publicField(DRACOExporter, "MESH_SEQUENTIAL_ENCODING", 0);
|
129
|
-
// Geometry type
|
130
|
-
__publicField(DRACOExporter, "POINT_CLOUD", 0);
|
131
|
-
__publicField(DRACOExporter, "TRIANGULAR_MESH", 1);
|
132
|
-
// Attribute type
|
133
|
-
__publicField(DRACOExporter, "INVALID", -1);
|
134
|
-
__publicField(DRACOExporter, "POSITION", 0);
|
135
|
-
__publicField(DRACOExporter, "NORMAL", 1);
|
136
|
-
__publicField(DRACOExporter, "COLOR", 2);
|
137
|
-
__publicField(DRACOExporter, "TEX_COORD", 3);
|
138
|
-
__publicField(DRACOExporter, "GENERIC", 4);
|
133
|
+
};
|
134
|
+
let DRACOExporter2 = _DRACOExporter;
|
135
|
+
// Encoder methods
|
136
|
+
__publicField(DRACOExporter2, "MESH_EDGEBREAKER_ENCODING", 1);
|
137
|
+
__publicField(DRACOExporter2, "MESH_SEQUENTIAL_ENCODING", 0);
|
138
|
+
// Geometry type
|
139
|
+
__publicField(DRACOExporter2, "POINT_CLOUD", 0);
|
140
|
+
__publicField(DRACOExporter2, "TRIANGULAR_MESH", 1);
|
141
|
+
// Attribute type
|
142
|
+
__publicField(DRACOExporter2, "INVALID", -1);
|
143
|
+
__publicField(DRACOExporter2, "POSITION", 0);
|
144
|
+
__publicField(DRACOExporter2, "NORMAL", 1);
|
145
|
+
__publicField(DRACOExporter2, "COLOR", 2);
|
146
|
+
__publicField(DRACOExporter2, "TEX_COORD", 3);
|
147
|
+
__publicField(DRACOExporter2, "GENERIC", 4);
|
148
|
+
return DRACOExporter2;
|
149
|
+
})();
|
139
150
|
export {
|
140
151
|
DRACOExporter
|
141
152
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DRACOExporter.js","sources":["../../src/exporters/DRACOExporter.ts"],"sourcesContent":["import type { EncoderModule } from 'draco3d'\nimport { BufferGeometry, Mesh, Points } from 'three'\n\n/**\n * Export draco compressed files from threejs geometry objects.\n *\n * Draco files are compressed and usually are smaller than conventional 3D file formats.\n *\n * The exporter receives a options object containing\n * - decodeSpeed, indicates how to tune the encoder regarding decode speed (0 gives better speed but worst quality)\n * - encodeSpeed, indicates how to tune the encoder parameters (0 gives better speed but worst quality)\n * - encoderMethod\n * - quantization, indicates the presision of each type of data stored in the draco file in the order (POSITION, NORMAL, COLOR, TEX_COORD, GENERIC)\n * - exportUvs\n * - exportNormals\n */\n\ndeclare const DracoEncoderModule: () => EncoderModule\n\nclass DRACOExporter {\n // Encoder methods\n\n public static MESH_EDGEBREAKER_ENCODING = 1\n public static MESH_SEQUENTIAL_ENCODING = 0\n\n // Geometry type\n\n public static POINT_CLOUD = 0\n public static TRIANGULAR_MESH = 1\n\n // Attribute type\n public static INVALID = -1\n public static POSITION = 0\n public static NORMAL = 1\n public static COLOR = 2\n public static TEX_COORD = 3\n public static GENERIC = 4\n\n public parse(\n object: Mesh | Points,\n options = {\n decodeSpeed: 5,\n encodeSpeed: 5,\n encoderMethod: DRACOExporter.MESH_EDGEBREAKER_ENCODING,\n quantization: [16, 8, 8, 8, 8],\n exportUvs: true,\n exportNormals: true,\n exportColor: false,\n },\n ): Int8Array {\n if (object instanceof BufferGeometry && object.isBufferGeometry) {\n throw new Error('DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.')\n }\n\n if (DracoEncoderModule === undefined) {\n throw new Error('THREE.DRACOExporter: required the draco_encoder to work.')\n }\n\n const geometry = object.geometry\n\n const dracoEncoder = DracoEncoderModule()\n const encoder = new dracoEncoder.Encoder()\n let builder\n let dracoObject\n\n if (!geometry.isBufferGeometry) {\n throw new Error('THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.')\n }\n\n if (object instanceof Mesh && object.isMesh) {\n builder = new dracoEncoder.MeshBuilder()\n dracoObject = new dracoEncoder.Mesh()\n\n const vertices = geometry.getAttribute('position')\n // @ts-ignore\n builder.AddFloatAttributeToMesh(\n dracoObject,\n dracoEncoder.POSITION,\n vertices.count,\n vertices.itemSize,\n vertices.array,\n )\n\n const faces = geometry.getIndex()\n\n if (faces !== null) {\n builder.AddFacesToMesh(dracoObject, faces.count / 3, faces.array as Uint16Array | Uint32Array)\n } else {\n const faces = new (vertices.count > 65535 ? Uint32Array : Uint16Array)(vertices.count)\n\n for (let i = 0; i < faces.length; i++) {\n faces[i] = i\n }\n\n builder.AddFacesToMesh(dracoObject, vertices.count, faces)\n }\n\n if (options.exportNormals) {\n const normals = geometry.getAttribute('normal')\n\n if (normals !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(\n dracoObject,\n dracoEncoder.NORMAL,\n normals.count,\n normals.itemSize,\n normals.array,\n )\n }\n }\n\n if (options.exportUvs) {\n const uvs = geometry.getAttribute('uv')\n\n if (uvs !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(dracoObject, dracoEncoder.TEX_COORD, uvs.count, uvs.itemSize, uvs.array)\n }\n }\n\n if (options.exportColor) {\n const colors = geometry.getAttribute('color')\n\n if (colors !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(dracoObject, dracoEncoder.COLOR, colors.count, colors.itemSize, colors.array)\n }\n }\n } else if (object instanceof Points && object.isPoints) {\n // @ts-ignore\n builder = new dracoEncoder.PointCloudBuilder()\n // @ts-ignore\n dracoObject = new dracoEncoder.PointCloud()\n\n const vertices = geometry.getAttribute('position')\n builder.AddFloatAttribute(dracoObject, dracoEncoder.POSITION, vertices.count, vertices.itemSize, vertices.array)\n\n if (options.exportColor) {\n const colors = geometry.getAttribute('color')\n\n if (colors !== undefined) {\n builder.AddFloatAttribute(dracoObject, dracoEncoder.COLOR, colors.count, colors.itemSize, colors.array)\n }\n }\n } else {\n throw new Error('DRACOExporter: Unsupported object type.')\n }\n\n //Compress using draco encoder\n\n const encodedData = new dracoEncoder.DracoInt8Array()\n\n //Sets the desired encoding and decoding speed for the given options from 0 (slowest speed, but the best compression) to 10 (fastest, but the worst compression).\n\n const encodeSpeed = options.encodeSpeed !== undefined ? options.encodeSpeed : 5\n const decodeSpeed = options.decodeSpeed !== undefined ? options.decodeSpeed : 5\n\n encoder.SetSpeedOptions(encodeSpeed, decodeSpeed)\n\n // Sets the desired encoding method for a given geometry.\n\n if (options.encoderMethod !== undefined) {\n encoder.SetEncodingMethod(options.encoderMethod)\n }\n\n // Sets the quantization (number of bits used to represent) compression options for a named attribute.\n // The attribute values will be quantized in a box defined by the maximum extent of the attribute values.\n if (options.quantization !== undefined) {\n for (let i = 0; i < 5; i++) {\n if (options.quantization[i] !== undefined) {\n encoder.SetAttributeQuantization(i, options.quantization[i])\n }\n }\n }\n\n let length\n\n if (object instanceof Mesh && object.isMesh) {\n length = encoder.EncodeMeshToDracoBuffer(dracoObject, encodedData)\n } else {\n // @ts-ignore\n length = encoder.EncodePointCloudToDracoBuffer(dracoObject, true, encodedData)\n }\n\n dracoEncoder.destroy(dracoObject)\n\n if (length === 0) {\n throw new Error('THREE.DRACOExporter: Draco encoding failed.')\n }\n\n //Copy encoded data to buffer.\n const outputData = new Int8Array(new ArrayBuffer(length))\n\n for (let i = 0; i < length; i++) {\n outputData[i] = encodedData.GetValue(i)\n }\n\n dracoEncoder.destroy(encodedData)\n dracoEncoder.destroy(encoder)\n dracoEncoder.destroy(builder)\n\n return outputData\n }\n}\n\nexport { DRACOExporter }\n"],"names":["faces"],"mappings":";;;;;;;AAmBA,MAAM,iBAAN,MAAoB;AAAA,EAmBX,MACL,QACA,UAAU;AAAA,IACR,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe,eAAc;AAAA,IAC7B,cAAc,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC;AAAA,IAC7B,WAAW;AAAA,IACX,eAAe;AAAA,IACf,aAAa;AAAA,EAAA,GAEJ;AACP,QAAA,kBAAkB,kBAAkB,OAAO,kBAAkB;AACzD,YAAA,IAAI,MAAM,qFAAqF;AAAA,IACvG;AAEA,QAAI,uBAAuB,QAAW;AAC9B,YAAA,IAAI,MAAM,0DAA0D;AAAA,IAC5E;AAEA,UAAM,WAAW,OAAO;AAExB,UAAM,eAAe;AACf,UAAA,UAAU,IAAI,aAAa;AAC7B,QAAA;AACA,QAAA;AAEA,QAAA,CAAC,SAAS,kBAAkB;AACxB,YAAA,IAAI,MAAM,gGAAgG;AAAA,IAClH;AAEI,QAAA,kBAAkB,QAAQ,OAAO,QAAQ;AACjC,gBAAA,IAAI,aAAa;AACb,oBAAA,IAAI,aAAa;AAEzB,YAAA,WAAW,SAAS,aAAa,UAAU;AAEzC,cAAA;AAAA,QACN;AAAA,QACA,aAAa;AAAA,QACb,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,MAAA;AAGL,YAAA,QAAQ,SAAS;AAEvB,UAAI,UAAU,MAAM;AAClB,gBAAQ,eAAe,aAAa,MAAM,QAAQ,GAAG,MAAM,KAAkC;AAAA,MAAA,OACxF;AACCA,cAAAA,SAAQ,KAAK,SAAS,QAAQ,QAAQ,cAAc,aAAa,SAAS,KAAK;AAErF,iBAAS,IAAI,GAAG,IAAIA,OAAM,QAAQ,KAAK;AACrCA,iBAAM,CAAC,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ACOExporter.js"],"sourcesContent":["import { BufferGeometry, Mesh, Points } from 'three'\n\n/**\n * Export draco compressed files from threejs geometry objects.\n *\n * Draco files are compressed and usually are smaller than conventional 3D file formats.\n *\n * The exporter receives a options object containing\n * - decodeSpeed, indicates how to tune the encoder regarding decode speed (0 gives better speed but worst quality)\n * - encodeSpeed, indicates how to tune the encoder parameters (0 gives better speed but worst quality)\n * - encoderMethod\n * - quantization, indicates the presision of each type of data stored in the draco file in the order (POSITION, NORMAL, COLOR, TEX_COORD, GENERIC)\n * - exportUvs\n * - exportNormals\n */\n\nconst DRACOExporter = /* @__PURE__ */ (() => {\n class DRACOExporter {\n // Encoder methods\n\n static MESH_EDGEBREAKER_ENCODING = 1\n static MESH_SEQUENTIAL_ENCODING = 0\n\n // Geometry type\n\n static POINT_CLOUD = 0\n static TRIANGULAR_MESH = 1\n\n // Attribute type\n static INVALID = -1\n static POSITION = 0\n static NORMAL = 1\n static COLOR = 2\n static TEX_COORD = 3\n static GENERIC = 4\n\n parse(\n object,\n options = {\n decodeSpeed: 5,\n encodeSpeed: 5,\n encoderMethod: DRACOExporter.MESH_EDGEBREAKER_ENCODING,\n quantization: [16, 8, 8, 8, 8],\n exportUvs: true,\n exportNormals: true,\n exportColor: false,\n },\n ) {\n if (object instanceof BufferGeometry && object.isBufferGeometry) {\n throw new Error('DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.')\n }\n\n if (DracoEncoderModule === undefined) {\n throw new Error('THREE.DRACOExporter: required the draco_encoder to work.')\n }\n\n const geometry = object.geometry\n\n const dracoEncoder = DracoEncoderModule()\n const encoder = new dracoEncoder.Encoder()\n let builder\n let dracoObject\n\n if (!geometry.isBufferGeometry) {\n throw new Error(\n 'THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.',\n )\n }\n\n if (object instanceof Mesh && object.isMesh) {\n builder = new dracoEncoder.MeshBuilder()\n dracoObject = new dracoEncoder.Mesh()\n\n const vertices = geometry.getAttribute('position')\n // @ts-ignore\n builder.AddFloatAttributeToMesh(\n dracoObject,\n dracoEncoder.POSITION,\n vertices.count,\n vertices.itemSize,\n vertices.array,\n )\n\n const faces = geometry.getIndex()\n\n if (faces !== null) {\n builder.AddFacesToMesh(dracoObject, faces.count / 3, faces.array)\n } else {\n const faces = new (vertices.count > 65535 ? Uint32Array : Uint16Array)(vertices.count)\n\n for (let i = 0; i < faces.length; i++) {\n faces[i] = i\n }\n\n builder.AddFacesToMesh(dracoObject, vertices.count, faces)\n }\n\n if (options.exportNormals) {\n const normals = geometry.getAttribute('normal')\n\n if (normals !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(\n dracoObject,\n dracoEncoder.NORMAL,\n normals.count,\n normals.itemSize,\n normals.array,\n )\n }\n }\n\n if (options.exportUvs) {\n const uvs = geometry.getAttribute('uv')\n\n if (uvs !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(dracoObject, dracoEncoder.TEX_COORD, uvs.count, uvs.itemSize, uvs.array)\n }\n }\n\n if (options.exportColor) {\n const colors = geometry.getAttribute('color')\n\n if (colors !== undefined) {\n // @ts-ignore\n builder.AddFloatAttributeToMesh(\n dracoObject,\n dracoEncoder.COLOR,\n colors.count,\n colors.itemSize,\n colors.array,\n )\n }\n }\n } else if (object instanceof Points && object.isPoints) {\n // @ts-ignore\n builder = new dracoEncoder.PointCloudBuilder()\n // @ts-ignore\n dracoObject = new dracoEncoder.PointCloud()\n\n const vertices = geometry.getAttribute('position')\n builder.AddFloatAttribute(dracoObject, dracoEncoder.POSITION, vertices.count, vertices.itemSize, vertices.array)\n\n if (options.exportColor) {\n const colors = geometry.getAttribute('color')\n\n if (colors !== undefined) {\n builder.AddFloatAttribute(dracoObject, dracoEncoder.COLOR, colors.count, colors.itemSize, colors.array)\n }\n }\n } else {\n throw new Error('DRACOExporter: Unsupported object type.')\n }\n\n //Compress using draco encoder\n\n const encodedData = new dracoEncoder.DracoInt8Array()\n\n //Sets the desired encoding and decoding speed for the given options from 0 (slowest speed, but the best compression) to 10 (fastest, but the worst compression).\n\n const encodeSpeed = options.encodeSpeed !== undefined ? options.encodeSpeed : 5\n const decodeSpeed = options.decodeSpeed !== undefined ? options.decodeSpeed : 5\n\n encoder.SetSpeedOptions(encodeSpeed, decodeSpeed)\n\n // Sets the desired encoding method for a given geometry.\n\n if (options.encoderMethod !== undefined) {\n encoder.SetEncodingMethod(options.encoderMethod)\n }\n\n // Sets the quantization (number of bits used to represent) compression options for a named attribute.\n // The attribute values will be quantized in a box defined by the maximum extent of the attribute values.\n if (options.quantization !== undefined) {\n for (let i = 0; i < 5; i++) {\n if (options.quantization[i] !== undefined) {\n encoder.SetAttributeQuantization(i, options.quantization[i])\n }\n }\n }\n\n let length\n\n if (object instanceof Mesh && object.isMesh) {\n length = encoder.EncodeMeshToDracoBuffer(dracoObject, encodedData)\n } else {\n // @ts-ignore\n length = encoder.EncodePointCloudToDracoBuffer(dracoObject, true, encodedData)\n }\n\n dracoEncoder.destroy(dracoObject)\n\n if (length === 0) {\n throw new Error('THREE.DRACOExporter: Draco encoding failed.')\n }\n\n //Copy encoded data to buffer.\n const outputData = new Int8Array(new ArrayBuffer(length))\n\n for (let i = 0; i < length; i++) {\n outputData[i] = encodedData.GetValue(i)\n }\n\n dracoEncoder.destroy(encodedData)\n dracoEncoder.destroy(encoder)\n dracoEncoder.destroy(builder)\n\n return outputData\n }\n }\n\n return DRACOExporter\n})()\n\nexport { DRACOExporter }\n"],"names":["faces","DRACOExporter"],"mappings":";;;;;;;AAgBK,MAAC,gBAAiC,uBAAM;AAC3C,QAAM,iBAAN,MAAoB;AAAA,IAmBlB,MACE,QACA,UAAU;AAAA,MACR,aAAa;AAAA,MACb,aAAa;AAAA,MACb,eAAe,eAAc;AAAA,MAC7B,cAAc,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC;AAAA,MAC7B,WAAW;AAAA,MACX,eAAe;AAAA,MACf,aAAa;AAAA,IACd,GACD;AACA,UAAI,kBAAkB,kBAAkB,O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