From 50df75e888b186efdedc6746565b6d8aeb221136 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Wed, 17 Sep 2025 21:32:44 -0400 Subject: [PATCH 1/5] [WIP] New benchmarking tool --- .editorconfig | 16 - .github/workflows/compare.yml | 87 - .github/workflows/measure-all-cases.yml | 75 - .github/workflows/measure-date.yml | 85 - .github/workflows/measure-historic.yml | 78 - .../workflows/measure-many-random-missing.yml | 64 - .github/workflows/measure-random-missing.yml | 40 - .github/workflows/measure-single.yml | 43 - .github/workflows/verify-stability.yml | 111 - .gitignore | 15 +- .prettierignore | 2 + .prettierrc.cjs | 19 - LICENSE | 21 + README.md | 62 + addons/babel-env.js | 46 - addons/cpu-profile.js | 6 - addons/eval-source-map.js | 16 - addons/future-defaults.js | 5 - addons/hmr.js | 1 - addons/initial-persistent-cache.js | 6 - addons/memory-profile.js | 6 - addons/module-unsafe-cache.js | 5 - addons/no-cache.js | 4 - addons/no-concatenation.js | 5 - addons/no-exports-analysis.js | 11 - addons/no-minimize.js | 5 - addons/persistent-cache.js | 9 - addons/pnp.js | 23 - addons/resolve-unsafe-cache.js | 6 - addons/source-map.js | 16 - addons/swc-env-minimize.js | 60 - addons/swc-env.js | 51 - addons/swc-minimize.js | 17 - addons/thread-babel-env.js | 53 - addons/unsafe-cache.js | 8 - bin/compare-scenarios.js | 34 - bin/compare.js | 48 - bin/measure-mean-normalized.js | 51 - bin/measure-mean.js | 32 - bin/measure.js | 27 - bin/random-missing.js | 100 - bin/report.js | 73 - bin/upload.js | 98 - cases/all/package.json | 40 - cases/all/src/.gitignore | 2 - cases/all/src/babel-runtime.js | 331 -- cases/all/src/index.js | 93 - cases/all/src/rome.ts | 3 - cases/all/tsconfig.json | 25 - cases/all/webpack.config.js | 43 - cases/atlaskit-editor/package.json | 17 - cases/atlaskit-editor/src/index.js | 13 - cases/atlaskit-editor/webpack.config.js | 1 - cases/common-libs-chunks/package.json | 29 - cases/common-libs-chunks/src/babel-runtime.js | 331 -- cases/common-libs-chunks/src/index.js | 23 - cases/common-libs-chunks/webpack.config.js | 1 - cases/common-libs/package.json | 29 - cases/common-libs/src/babel-runtime.js | 331 -- cases/common-libs/src/index.js | 29 - cases/common-libs/webpack.config.js | 1 - cases/esbuild-three/package.json | 14 - cases/esbuild-three/src/.gitignore | 1 - .../esbuild-three/src/base/Three.Legacy.d.ts | 13 - cases/esbuild-three/src/base/Three.Legacy.js | 1943 ----------- cases/esbuild-three/src/base/Three.d.ts | 180 - cases/esbuild-three/src/base/Three.js | 160 - .../src/base/animation/AnimationAction.d.ts | 59 - .../src/base/animation/AnimationAction.js | 688 ---- .../src/base/animation/AnimationClip.d.ts | 39 - .../src/base/animation/AnimationClip.js | 468 --- .../src/base/animation/AnimationMixer.d.ts | 21 - .../src/base/animation/AnimationMixer.js | 759 ----- .../base/animation/AnimationObjectGroup.d.ts | 18 - .../base/animation/AnimationObjectGroup.js | 381 --- .../src/base/animation/AnimationUtils.d.ts | 17 - .../src/base/animation/AnimationUtils.js | 165 - .../src/base/animation/KeyframeTrack.d.ts | 43 - .../src/base/animation/KeyframeTrack.js | 469 --- .../src/base/animation/PropertyBinding.d.ts | 42 - .../src/base/animation/PropertyBinding.js | 714 ---- .../src/base/animation/PropertyMixer.d.ts | 17 - .../src/base/animation/PropertyMixer.js | 209 -- .../tracks/BooleanKeyframeTrack.d.ts | 7 - .../animation/tracks/BooleanKeyframeTrack.js | 38 - .../animation/tracks/ColorKeyframeTrack.d.ts | 13 - .../animation/tracks/ColorKeyframeTrack.js | 34 - .../animation/tracks/NumberKeyframeTrack.d.ts | 13 - .../animation/tracks/NumberKeyframeTrack.js | 30 - .../tracks/QuaternionKeyframeTrack.d.ts | 13 - .../tracks/QuaternionKeyframeTrack.js | 40 - .../animation/tracks/StringKeyframeTrack.d.ts | 13 - .../animation/tracks/StringKeyframeTrack.js | 35 - .../animation/tracks/VectorKeyframeTrack.d.ts | 13 - .../animation/tracks/VectorKeyframeTrack.js | 31 - cases/esbuild-three/src/base/audio/Audio.d.ts | 68 - cases/esbuild-three/src/base/audio/Audio.js | 346 -- .../src/base/audio/AudioAnalyser.d.ts | 16 - .../src/base/audio/AudioAnalyser.js | 42 - .../src/base/audio/AudioContext.d.ts | 1 - .../src/base/audio/AudioContext.js | 29 - .../src/base/audio/AudioListener.d.ts | 21 - .../src/base/audio/AudioListener.js | 143 - .../src/base/audio/PositionalAudio.d.ts | 24 - .../src/base/audio/PositionalAudio.js | 137 - .../src/base/cameras/ArrayCamera.d.ts | 10 - .../src/base/cameras/ArrayCamera.js | 24 - .../src/base/cameras/Camera.d.ts | 38 - .../esbuild-three/src/base/cameras/Camera.js | 76 - .../src/base/cameras/CubeCamera.d.ts | 18 - .../src/base/cameras/CubeCamera.js | 116 - .../src/base/cameras/OrthographicCamera.d.ts | 91 - .../src/base/cameras/OrthographicCamera.js | 147 - .../src/base/cameras/PerspectiveCamera.d.ts | 121 - .../src/base/cameras/PerspectiveCamera.js | 244 -- .../src/base/cameras/StereoCamera.d.ts | 17 - .../src/base/cameras/StereoCamera.js | 104 - cases/esbuild-three/src/base/constants.d.ts | 277 -- cases/esbuild-three/src/base/constants.js | 168 - .../src/base/core/BufferAttribute.d.ts | 236 -- .../src/base/core/BufferAttribute.js | 441 --- .../src/base/core/BufferGeometry.d.ts | 145 - .../src/base/core/BufferGeometry.js | 1217 ------- cases/esbuild-three/src/base/core/Clock.d.ts | 61 - cases/esbuild-three/src/base/core/Clock.js | 73 - .../src/base/core/DirectGeometry.d.ts | 52 - .../src/base/core/DirectGeometry.js | 286 -- .../src/base/core/EventDispatcher.d.ts | 42 - .../src/base/core/EventDispatcher.js | 86 - cases/esbuild-three/src/base/core/Face3.d.ts | 101 - cases/esbuild-three/src/base/core/Face3.js | 63 - .../esbuild-three/src/base/core/Geometry.d.ts | 261 -- cases/esbuild-three/src/base/core/Geometry.js | 1398 -------- .../base/core/InstancedBufferAttribute.d.ts | 49 - .../src/base/core/InstancedBufferAttribute.js | 57 - .../base/core/InstancedBufferGeometry.d.ts | 15 - .../src/base/core/InstancedBufferGeometry.js | 52 - .../base/core/InstancedInterleavedBuffer.d.ts | 16 - .../base/core/InstancedInterleavedBuffer.js | 33 - .../src/base/core/InterleavedBuffer.d.ts | 30 - .../src/base/core/InterleavedBuffer.js | 111 - .../base/core/InterleavedBufferAttribute.d.ts | 49 - .../base/core/InterleavedBufferAttribute.js | 139 - cases/esbuild-three/src/base/core/Layers.d.ts | 15 - cases/esbuild-three/src/base/core/Layers.js | 58 - .../esbuild-three/src/base/core/Object3D.d.ts | 351 -- cases/esbuild-three/src/base/core/Object3D.js | 858 ----- .../src/base/core/Raycaster.d.ts | 109 - .../esbuild-three/src/base/core/Raycaster.js | 137 - .../esbuild-three/src/base/core/Uniform.d.ts | 24 - cases/esbuild-three/src/base/core/Uniform.js | 24 - cases/esbuild-three/src/base/extras/Earcut.js | 760 ----- .../src/base/extras/ImageUtils.d.ts | 34 - .../src/base/extras/ImageUtils.js | 60 - .../src/base/extras/ShapeUtils.d.ts | 11 - .../src/base/extras/ShapeUtils.js | 96 - .../src/base/extras/core/Curve.d.ts | 79 - .../src/base/extras/core/Curve.js | 425 --- .../src/base/extras/core/CurvePath.d.ts | 35 - .../src/base/extras/core/CurvePath.js | 261 -- .../src/base/extras/core/Font.d.ts | 9 - .../src/base/extras/core/Font.js | 151 - .../src/base/extras/core/Interpolations.d.ts | 5 - .../src/base/extras/core/Interpolations.js | 81 - .../src/base/extras/core/Path.d.ts | 82 - .../src/base/extras/core/Path.js | 183 -- .../src/base/extras/core/Shape.d.ts | 37 - .../src/base/extras/core/Shape.js | 115 - .../src/base/extras/core/ShapePath.d.ts | 25 - .../src/base/extras/core/ShapePath.js | 286 -- .../src/base/extras/curves/ArcCurve.d.ts | 13 - .../src/base/extras/curves/ArcCurve.js | 18 - .../base/extras/curves/CatmullRomCurve3.d.ts | 48 - .../base/extras/curves/CatmullRomCurve3.js | 255 -- .../base/extras/curves/CubicBezierCurve.d.ts | 13 - .../base/extras/curves/CubicBezierCurve.js | 79 - .../base/extras/curves/CubicBezierCurve3.d.ts | 15 - .../base/extras/curves/CubicBezierCurve3.js | 80 - .../src/base/extras/curves/Curves.d.ts | 10 - .../src/base/extras/curves/Curves.js | 10 - .../src/base/extras/curves/EllipseCurve.d.ts | 26 - .../src/base/extras/curves/EllipseCurve.js | 158 - .../src/base/extras/curves/LineCurve.d.ts | 11 - .../src/base/extras/curves/LineCurve.js | 90 - .../src/base/extras/curves/LineCurve3.d.ts | 13 - .../src/base/extras/curves/LineCurve3.js | 82 - .../extras/curves/QuadraticBezierCurve.d.ts | 12 - .../extras/curves/QuadraticBezierCurve.js | 75 - .../extras/curves/QuadraticBezierCurve3.d.ts | 14 - .../extras/curves/QuadraticBezierCurve3.js | 76 - .../src/base/extras/curves/SplineCurve.d.ts | 10 - .../src/base/extras/curves/SplineCurve.js | 98 - .../extras/objects/ImmediateRenderObject.d.ts | 13 - .../extras/objects/ImmediateRenderObject.js | 22 - .../src/base/geometries/BoxGeometry.d.ts | 58 - .../src/base/geometries/BoxGeometry.js | 203 -- .../src/base/geometries/CircleGeometry.d.ts | 38 - .../src/base/geometries/CircleGeometry.js | 121 - .../src/base/geometries/ConeGeometry.d.ts | 30 - .../src/base/geometries/ConeGeometry.js | 55 - .../src/base/geometries/CylinderGeometry.d.ts | 62 - .../src/base/geometries/CylinderGeometry.js | 316 -- .../base/geometries/DodecahedronGeometry.d.ts | 19 - .../base/geometries/DodecahedronGeometry.js | 88 - .../src/base/geometries/EdgesGeometry.d.ts | 8 - .../src/base/geometries/EdgesGeometry.js | 113 - .../src/base/geometries/ExtrudeGeometry.d.ts | 60 - .../src/base/geometries/ExtrudeGeometry.js | 835 ----- .../src/base/geometries/Geometries.d.ts | 22 - .../src/base/geometries/Geometries.js | 22 - .../base/geometries/IcosahedronGeometry.d.ts | 16 - .../base/geometries/IcosahedronGeometry.js | 64 - .../src/base/geometries/LatheGeometry.d.ts | 39 - .../src/base/geometries/LatheGeometry.js | 186 -- .../base/geometries/OctahedronGeometry.d.ts | 16 - .../src/base/geometries/OctahedronGeometry.js | 60 - .../base/geometries/ParametricGeometry.d.ts | 35 - .../src/base/geometries/ParametricGeometry.js | 163 - .../src/base/geometries/PlaneGeometry.d.ts | 38 - .../src/base/geometries/PlaneGeometry.js | 126 - .../base/geometries/PolyhedronGeometry.d.ts | 40 - .../src/base/geometries/PolyhedronGeometry.js | 341 -- .../src/base/geometries/RingGeometry.d.ts | 46 - .../src/base/geometries/RingGeometry.js | 152 - .../src/base/geometries/ShapeGeometry.d.ts | 18 - .../src/base/geometries/ShapeGeometry.js | 220 -- .../src/base/geometries/SphereGeometry.d.ts | 64 - .../src/base/geometries/SphereGeometry.js | 166 - .../base/geometries/TetrahedronGeometry.d.ts | 13 - .../base/geometries/TetrahedronGeometry.js | 57 - .../src/base/geometries/TextGeometry.d.ts | 50 - .../src/base/geometries/TextGeometry.js | 82 - .../src/base/geometries/TorusGeometry.d.ts | 42 - .../src/base/geometries/TorusGeometry.js | 142 - .../base/geometries/TorusKnotGeometry.d.ts | 48 - .../src/base/geometries/TorusKnotGeometry.js | 194 -- .../src/base/geometries/TubeGeometry.d.ts | 50 - .../src/base/geometries/TubeGeometry.js | 232 -- .../base/geometries/WireframeGeometry.d.ts | 8 - .../src/base/geometries/WireframeGeometry.js | 179 - .../src/base/helpers/ArrowHelper.d.ts | 27 - .../src/base/helpers/ArrowHelper.js | 133 - .../src/base/helpers/AxesHelper.d.ts | 7 - .../src/base/helpers/AxesHelper.js | 42 - .../src/base/helpers/Box3Helper.d.ts | 11 - .../src/base/helpers/Box3Helper.js | 55 - .../src/base/helpers/BoxHelper.d.ts | 11 - .../src/base/helpers/BoxHelper.js | 117 - .../src/base/helpers/CameraHelper.d.ts | 13 - .../src/base/helpers/CameraHelper.js | 203 -- .../base/helpers/DirectionalLightHelper.d.ts | 25 - .../base/helpers/DirectionalLightHelper.js | 94 - .../src/base/helpers/FaceNormalsHelper.d.ts | 25 - .../src/base/helpers/FaceNormalsHelper.js | 114 - .../src/base/helpers/GridHelper.d.ts | 17 - .../src/base/helpers/GridHelper.js | 72 - .../base/helpers/HemisphereLightHelper.d.ts | 25 - .../src/base/helpers/HemisphereLightHelper.js | 91 - .../src/base/helpers/LightProbeHelper.js | 151 - .../src/base/helpers/PlaneHelper.d.ts | 13 - .../src/base/helpers/PlaneHelper.js | 63 - .../src/base/helpers/PointLightHelper.d.ts | 22 - .../src/base/helpers/PointLightHelper.js | 92 - .../src/base/helpers/PolarGridHelper.d.ts | 15 - .../src/base/helpers/PolarGridHelper.js | 95 - .../base/helpers/PositionalAudioHelper.d.ts | 16 - .../src/base/helpers/PositionalAudioHelper.js | 108 - .../src/base/helpers/RectAreaLightHelper.d.ts | 15 - .../src/base/helpers/RectAreaLightHelper.js | 85 - .../src/base/helpers/SkeletonHelper.d.ts | 15 - .../src/base/helpers/SkeletonHelper.js | 123 - .../src/base/helpers/SpotLightHelper.d.ts | 20 - .../src/base/helpers/SpotLightHelper.js | 97 - .../src/base/helpers/VertexNormalsHelper.d.ts | 18 - .../src/base/helpers/VertexNormalsHelper.js | 148 - .../src/base/lights/AmbientLight.d.ts | 19 - .../src/base/lights/AmbientLight.js | 26 - .../src/base/lights/AmbientLightProbe.d.ts | 10 - .../src/base/lights/AmbientLightProbe.js | 45 - .../src/base/lights/DirectionalLight.d.ts | 34 - .../src/base/lights/DirectionalLight.js | 46 - .../base/lights/DirectionalLightShadow.d.ts | 8 - .../src/base/lights/DirectionalLightShadow.js | 29 - .../src/base/lights/HemisphereLight.d.ts | 16 - .../src/base/lights/HemisphereLight.js | 43 - .../src/base/lights/HemisphereLightProbe.d.ts | 10 - .../src/base/lights/HemisphereLightProbe.js | 54 - .../esbuild-three/src/base/lights/Light.d.ts | 60 - cases/esbuild-three/src/base/lights/Light.js | 62 - .../src/base/lights/LightProbe.d.ts | 11 - .../src/base/lights/LightProbe.js | 47 - .../src/base/lights/LightShadow.d.ts | 28 - .../src/base/lights/LightShadow.js | 136 - .../src/base/lights/PointLight.d.ts | 45 - .../src/base/lights/PointLight.js | 61 - .../src/base/lights/PointLightShadow.d.ts | 8 - .../src/base/lights/PointLightShadow.js | 88 - .../src/base/lights/RectAreaLight.d.ts | 18 - .../src/base/lights/RectAreaLight.js | 48 - .../src/base/lights/SpotLight.d.ts | 55 - .../src/base/lights/SpotLight.js | 72 - .../src/base/lights/SpotLightShadow.d.ts | 8 - .../src/base/lights/SpotLightShadow.js | 45 - .../src/base/loaders/AnimationLoader.d.ts | 17 - .../src/base/loaders/AnimationLoader.js | 52 - .../src/base/loaders/AudioLoader.d.ts | 15 - .../src/base/loaders/AudioLoader.js | 44 - .../base/loaders/BufferGeometryLoader.d.ts | 17 - .../src/base/loaders/BufferGeometryLoader.js | 143 - .../esbuild-three/src/base/loaders/Cache.d.ts | 9 - cases/esbuild-three/src/base/loaders/Cache.js | 46 - .../base/loaders/CompressedTextureLoader.d.ts | 16 - .../base/loaders/CompressedTextureLoader.js | 136 - .../src/base/loaders/CubeTextureLoader.d.ts | 16 - .../src/base/loaders/CubeTextureLoader.js | 63 - .../src/base/loaders/DataTextureLoader.d.ts | 16 - .../src/base/loaders/DataTextureLoader.js | 97 - .../src/base/loaders/FileLoader.d.ts | 24 - .../src/base/loaders/FileLoader.js | 314 -- .../src/base/loaders/FontLoader.d.ts | 17 - .../src/base/loaders/FontLoader.js | 57 - .../src/base/loaders/ImageBitmapLoader.d.ts | 18 - .../src/base/loaders/ImageBitmapLoader.js | 109 - .../src/base/loaders/ImageLoader.d.ts | 19 - .../src/base/loaders/ImageLoader.js | 91 - .../src/base/loaders/Loader.d.ts | 35 - .../esbuild-three/src/base/loaders/Loader.js | 82 - .../src/base/loaders/LoaderUtils.d.ts | 8 - .../src/base/loaders/LoaderUtils.js | 53 - .../src/base/loaders/LoadingManager.d.ts | 53 - .../src/base/loaders/LoadingManager.js | 98 - .../src/base/loaders/MaterialLoader.d.ts | 21 - .../src/base/loaders/MaterialLoader.js | 255 -- .../src/base/loaders/ObjectLoader.d.ts | 33 - .../src/base/loaders/ObjectLoader.js | 1003 ------ .../src/base/loaders/TextureLoader.d.ts | 20 - .../src/base/loaders/TextureLoader.js | 53 - .../src/base/materials/LineBasicMaterial.d.ts | 22 - .../src/base/materials/LineBasicMaterial.js | 56 - .../base/materials/LineDashedMaterial.d.ts | 24 - .../src/base/materials/LineDashedMaterial.js | 50 - .../src/base/materials/Material.d.ts | 336 -- .../src/base/materials/Material.js | 424 --- .../src/base/materials/Materials.d.ts | 18 - .../src/base/materials/Materials.js | 18 - .../src/base/materials/MeshBasicMaterial.d.ts | 51 - .../src/base/materials/MeshBasicMaterial.js | 120 - .../src/base/materials/MeshDepthMaterial.d.ts | 27 - .../src/base/materials/MeshDepthMaterial.js | 86 - .../base/materials/MeshDistanceMaterial.d.ts | 27 - .../base/materials/MeshDistanceMaterial.js | 84 - .../base/materials/MeshLambertMaterial.d.ts | 60 - .../src/base/materials/MeshLambertMaterial.js | 131 - .../base/materials/MeshMatcapMaterial.d.ts | 48 - .../src/base/materials/MeshMatcapMaterial.js | 112 - .../base/materials/MeshNormalMaterial.d.ts | 43 - .../src/base/materials/MeshNormalMaterial.js | 95 - .../src/base/materials/MeshPhongMaterial.d.ts | 87 - .../src/base/materials/MeshPhongMaterial.js | 171 - .../base/materials/MeshPhysicalMaterial.d.ts | 35 - .../base/materials/MeshPhysicalMaterial.js | 82 - .../base/materials/MeshStandardMaterial.d.ts | 78 - .../base/materials/MeshStandardMaterial.js | 180 - .../src/base/materials/MeshToonMaterial.d.ts | 16 - .../src/base/materials/MeshToonMaterial.js | 41 - .../src/base/materials/PointsMaterial.d.ts | 44 - .../src/base/materials/PointsMaterial.js | 64 - .../src/base/materials/RawShaderMaterial.d.ts | 7 - .../src/base/materials/RawShaderMaterial.js | 21 - .../src/base/materials/ShaderMaterial.d.ts | 62 - .../src/base/materials/ShaderMaterial.js | 210 -- .../src/base/materials/ShadowMaterial.d.ts | 7 - .../src/base/materials/ShadowMaterial.js | 41 - .../src/base/materials/SpriteMaterial.d.ts | 25 - .../src/base/materials/SpriteMaterial.js | 55 - cases/esbuild-three/src/base/math/Box2.d.ts | 43 - cases/esbuild-three/src/base/math/Box2.js | 234 -- cases/esbuild-three/src/base/math/Box3.d.ts | 58 - cases/esbuild-three/src/base/math/Box3.js | 581 ---- cases/esbuild-three/src/base/math/Color.d.ts | 186 -- cases/esbuild-three/src/base/math/Color.js | 584 ---- .../src/base/math/Cylindrical.d.ts | 17 - .../src/base/math/Cylindrical.js | 65 - cases/esbuild-three/src/base/math/Euler.d.ts | 31 - cases/esbuild-three/src/base/math/Euler.js | 343 -- .../esbuild-three/src/base/math/Frustum.d.ts | 45 - cases/esbuild-three/src/base/math/Frustum.js | 177 - .../src/base/math/Interpolant.d.ts | 17 - .../src/base/math/Interpolant.js | 259 -- cases/esbuild-three/src/base/math/Line3.d.ts | 28 - cases/esbuild-three/src/base/math/Line3.js | 148 - cases/esbuild-three/src/base/math/Math.d.ts | 95 - cases/esbuild-three/src/base/math/Math.js | 149 - .../esbuild-three/src/base/math/Matrix3.d.ts | 172 - cases/esbuild-three/src/base/math/Matrix3.js | 384 --- .../esbuild-three/src/base/math/Matrix4.d.ts | 300 -- cases/esbuild-three/src/base/math/Matrix4.js | 922 ------ cases/esbuild-three/src/base/math/Plane.d.ts | 41 - cases/esbuild-three/src/base/math/Plane.js | 231 -- .../src/base/math/Quaternion.d.ts | 156 - .../esbuild-three/src/base/math/Quaternion.js | 636 ---- cases/esbuild-three/src/base/math/Ray.d.ts | 61 - cases/esbuild-three/src/base/math/Ray.js | 515 --- cases/esbuild-three/src/base/math/Sphere.d.ts | 29 - cases/esbuild-three/src/base/math/Sphere.js | 176 - .../src/base/math/Spherical.d.ts | 18 - .../esbuild-three/src/base/math/Spherical.js | 90 - .../src/base/math/SphericalHarmonics3.d.ts | 54 - .../src/base/math/SphericalHarmonics3.js | 244 -- .../esbuild-three/src/base/math/Triangle.d.ts | 77 - cases/esbuild-three/src/base/math/Triangle.js | 334 -- .../esbuild-three/src/base/math/Vector2.d.ts | 462 --- cases/esbuild-three/src/base/math/Vector2.js | 492 --- .../esbuild-three/src/base/math/Vector3.d.ts | 287 -- cases/esbuild-three/src/base/math/Vector3.js | 700 ---- .../esbuild-three/src/base/math/Vector4.d.ts | 213 -- cases/esbuild-three/src/base/math/Vector4.js | 654 ---- .../math/interpolants/CubicInterpolant.d.ts | 14 - .../math/interpolants/CubicInterpolant.js | 156 - .../interpolants/DiscreteInterpolant.d.ts | 14 - .../math/interpolants/DiscreteInterpolant.js | 30 - .../math/interpolants/LinearInterpolant.d.ts | 14 - .../math/interpolants/LinearInterpolant.js | 44 - .../QuaternionLinearInterpolant.d.ts | 14 - .../QuaternionLinearInterpolant.js | 43 - .../esbuild-three/src/base/objects/Bone.d.ts | 11 - cases/esbuild-three/src/base/objects/Bone.js | 26 - .../esbuild-three/src/base/objects/Group.d.ts | 9 - cases/esbuild-three/src/base/objects/Group.js | 24 - cases/esbuild-three/src/base/objects/LOD.d.ts | 25 - cases/esbuild-three/src/base/objects/LOD.js | 172 - .../esbuild-three/src/base/objects/Line.d.ts | 25 - cases/esbuild-three/src/base/objects/Line.js | 247 -- .../src/base/objects/LineLoop.d.ts | 16 - .../src/base/objects/LineLoop.js | 24 - .../src/base/objects/LineSegments.d.ts | 26 - .../src/base/objects/LineSegments.js | 81 - .../esbuild-three/src/base/objects/Mesh.d.ts | 28 - cases/esbuild-three/src/base/objects/Mesh.js | 463 --- .../src/base/objects/Points.d.ts | 42 - .../esbuild-three/src/base/objects/Points.js | 191 -- .../src/base/objects/Skeleton.d.ts | 33 - .../src/base/objects/Skeleton.js | 174 - .../src/base/objects/SkinnedMesh.d.ts | 26 - .../src/base/objects/SkinnedMesh.js | 120 - .../src/base/objects/Sprite.d.ts | 22 - .../esbuild-three/src/base/objects/Sprite.js | 192 -- cases/esbuild-three/src/base/polyfills.d.ts | 16 - cases/esbuild-three/src/base/polyfills.js | 94 - .../src/base/renderers/WebGL2Renderer.js | 191 -- .../WebGLMultisampleRenderTarget.d.ts | 14 - .../renderers/WebGLMultisampleRenderTarget.js | 35 - .../src/base/renderers/WebGLRenderTarget.d.ts | 83 - .../src/base/renderers/WebGLRenderTarget.js | 101 - .../base/renderers/WebGLRenderTargetCube.d.ts | 14 - .../base/renderers/WebGLRenderTargetCube.js | 119 - .../src/base/renderers/WebGLRenderer.d.ts | 464 --- .../src/base/renderers/WebGLRenderer.js | 2613 --------------- .../base/renderers/shaders/ShaderChunk.d.ts | 120 - .../src/base/renderers/shaders/ShaderChunk.js | 251 -- .../ShaderChunk/alphamap_fragment.glsl.js | 7 - .../alphamap_pars_fragment.glsl.js | 7 - .../ShaderChunk/alphatest_fragment.glsl.js | 7 - .../ShaderChunk/aomap_fragment.glsl.js | 18 - .../ShaderChunk/aomap_pars_fragment.glsl.js | 8 - .../shaders/ShaderChunk/begin_vertex.glsl.js | 3 - .../ShaderChunk/beginnormal_vertex.glsl.js | 9 - .../shaders/ShaderChunk/bsdfs.glsl.js | 370 --- .../ShaderChunk/bumpmap_pars_fragment.glsl.js | 46 - .../clearcoat_normal_fragment_begin.glsl.js | 7 - .../clearcoat_normal_fragment_maps.glsl.js | 18 - .../clearcoat_normalmap_pars_fragment.glsl.js | 8 - .../clipping_planes_fragment.glsl.js | 31 - .../clipping_planes_pars_fragment.glsl.js | 11 - .../clipping_planes_pars_vertex.glsl.js | 5 - .../clipping_planes_vertex.glsl.js | 5 - .../ShaderChunk/color_fragment.glsl.js | 7 - .../ShaderChunk/color_pars_fragment.glsl.js | 7 - .../ShaderChunk/color_pars_vertex.glsl.js | 7 - .../shaders/ShaderChunk/color_vertex.glsl.js | 7 - .../shaders/ShaderChunk/common.glsl.js | 110 - .../cube_uv_reflection_fragment.glsl.js | 130 - .../ShaderChunk/default_fragment.glsl.js | 5 - .../ShaderChunk/default_vertex.glsl.js | 5 - .../ShaderChunk/defaultnormal_vertex.glsl.js | 21 - .../displacementmap_pars_vertex.glsl.js | 9 - .../displacementmap_vertex.glsl.js | 7 - .../ShaderChunk/dithering_fragment.glsl.js | 7 - .../dithering_pars_fragment.glsl.js | 20 - .../ShaderChunk/emissivemap_fragment.glsl.js | 11 - .../emissivemap_pars_fragment.glsl.js | 7 - .../ShaderChunk/encodings_fragment.glsl.js | 3 - .../encodings_pars_fragment.glsl.js | 85 - .../envmap_common_pars_fragment.glsl.js | 15 - .../ShaderChunk/envmap_fragment.glsl.js | 74 - .../ShaderChunk/envmap_pars_fragment.glsl.js | 21 - .../ShaderChunk/envmap_pars_vertex.glsl.js | 22 - .../envmap_physical_pars_fragment.glsl.js | 141 - .../shaders/ShaderChunk/envmap_vertex.glsl.js | 27 - .../shaders/ShaderChunk/fog_fragment.glsl.js | 17 - .../ShaderChunk/fog_pars_fragment.glsl.js | 19 - .../ShaderChunk/fog_pars_vertex.glsl.js | 7 - .../shaders/ShaderChunk/fog_vertex.glsl.js | 7 - .../gradientmap_pars_fragment.glsl.js | 26 - .../ShaderChunk/lightmap_fragment.glsl.js | 7 - .../lightmap_pars_fragment.glsl.js | 8 - .../ShaderChunk/lights_fragment_begin.glsl.js | 135 - .../ShaderChunk/lights_fragment_end.glsl.js | 13 - .../ShaderChunk/lights_fragment_maps.glsl.js | 37 - .../ShaderChunk/lights_lambert_vertex.glsl.js | 119 - .../ShaderChunk/lights_pars_begin.glsl.js | 210 -- .../ShaderChunk/lights_phong_fragment.glsl.js | 7 - .../lights_phong_pars_fragment.glsl.js | 55 - .../lights_physical_fragment.glsl.js | 27 - .../lights_physical_pars_fragment.glsl.js | 171 - .../ShaderChunk/logdepthbuf_fragment.glsl.js | 7 - .../logdepthbuf_pars_fragment.glsl.js | 8 - .../logdepthbuf_pars_vertex.glsl.js | 15 - .../ShaderChunk/logdepthbuf_vertex.glsl.js | 17 - .../shaders/ShaderChunk/map_fragment.glsl.js | 10 - .../ShaderChunk/map_pars_fragment.glsl.js | 7 - .../ShaderChunk/map_particle_fragment.glsl.js | 9 - .../map_particle_pars_fragment.glsl.js | 8 - .../ShaderChunk/metalnessmap_fragment.glsl.js | 12 - .../metalnessmap_pars_fragment.glsl.js | 7 - .../ShaderChunk/morphnormal_vertex.glsl.js | 10 - .../morphtarget_pars_vertex.glsl.js | 15 - .../ShaderChunk/morphtarget_vertex.glsl.js | 19 - .../ShaderChunk/normal_fragment_begin.glsl.js | 40 - .../ShaderChunk/normal_fragment_maps.glsl.js | 41 - .../normalmap_pars_fragment.glsl.js | 63 - .../shaders/ShaderChunk/packing.glsl.js | 60 - .../premultiplied_alpha_fragment.glsl.js | 8 - .../ShaderChunk/project_vertex.glsl.js | 5 - .../ShaderChunk/roughnessmap_fragment.glsl.js | 12 - .../roughnessmap_pars_fragment.glsl.js | 7 - .../shadowmap_pars_fragment.glsl.js | 288 -- .../ShaderChunk/shadowmap_pars_vertex.glsl.js | 34 - .../ShaderChunk/shadowmap_vertex.glsl.js | 46 - .../shadowmask_pars_fragment.glsl.js | 63 - .../ShaderChunk/skinbase_vertex.glsl.js | 10 - .../ShaderChunk/skinning_pars_vertex.glsl.js | 48 - .../ShaderChunk/skinning_vertex.glsl.js | 15 - .../ShaderChunk/skinnormal_vertex.glsl.js | 20 - .../ShaderChunk/specularmap_fragment.glsl.js | 14 - .../specularmap_pars_fragment.glsl.js | 7 - .../ShaderChunk/tonemapping_fragment.glsl.js | 7 - .../tonemapping_pars_fragment.glsl.js | 51 - .../ShaderChunk/uv2_pars_fragment.glsl.js | 7 - .../ShaderChunk/uv2_pars_vertex.glsl.js | 8 - .../shaders/ShaderChunk/uv2_vertex.glsl.js | 7 - .../ShaderChunk/uv_pars_fragment.glsl.js | 7 - .../ShaderChunk/uv_pars_vertex.glsl.js | 8 - .../shaders/ShaderChunk/uv_vertex.glsl.js | 7 - .../ShaderChunk/worldpos_vertex.glsl.js | 7 - .../src/base/renderers/shaders/ShaderLib.d.ts | 27 - .../src/base/renderers/shaders/ShaderLib.js | 291 -- .../shaders/ShaderLib/background_frag.glsl.js | 16 - .../shaders/ShaderLib/background_vert.glsl.js | 12 - .../shaders/ShaderLib/cube_frag.glsl.js | 19 - .../shaders/ShaderLib/cube_vert.glsl.js | 16 - .../shaders/ShaderLib/depth_frag.glsl.js | 45 - .../shaders/ShaderLib/depth_vert.glsl.js | 33 - .../ShaderLib/distanceRGBA_frag.glsl.js | 33 - .../ShaderLib/distanceRGBA_vert.glsl.js | 38 - .../shaders/ShaderLib/equirect_frag.glsl.js | 26 - .../shaders/ShaderLib/equirect_vert.glsl.js | 14 - .../shaders/ShaderLib/linedashed_frag.glsl.js | 42 - .../shaders/ShaderLib/linedashed_vert.glsl.js | 27 - .../shaders/ShaderLib/meshbasic_frag.glsl.js | 69 - .../shaders/ShaderLib/meshbasic_vert.glsl.js | 41 - .../ShaderLib/meshlambert_frag.glsl.js | 97 - .../ShaderLib/meshlambert_vert.glsl.js | 51 - .../shaders/ShaderLib/meshmatcap_frag.glsl.js | 66 - .../shaders/ShaderLib/meshmatcap_vert.glsl.js | 51 - .../shaders/ShaderLib/meshphong_frag.glsl.js | 75 - .../shaders/ShaderLib/meshphong_vert.glsl.js | 59 - .../ShaderLib/meshphysical_frag.glsl.js | 121 - .../ShaderLib/meshphysical_vert.glsl.js | 71 - .../shaders/ShaderLib/normal_frag.glsl.js | 42 - .../shaders/ShaderLib/normal_vert.glsl.js | 68 - .../shaders/ShaderLib/points_frag.glsl.js | 34 - .../shaders/ShaderLib/points_vert.glsl.js | 35 - .../shaders/ShaderLib/shadow_frag.glsl.js | 20 - .../shaders/ShaderLib/shadow_vert.glsl.js | 14 - .../shaders/ShaderLib/sprite_frag.glsl.js | 32 - .../shaders/ShaderLib/sprite_vert.glsl.js | 44 - .../shaders/ShaderLib/vsm_frag.glsl.js | 42 - .../shaders/ShaderLib/vsm_vert.glsl.js | 9 - .../base/renderers/shaders/UniformsLib.d.ts | 136 - .../src/base/renderers/shaders/UniformsLib.js | 202 -- .../base/renderers/shaders/UniformsUtils.d.ts | 9 - .../base/renderers/shaders/UniformsUtils.js | 66 - .../base/renderers/webgl/WebGLAnimation.d.ts | 11 - .../base/renderers/webgl/WebGLAnimation.js | 56 - .../base/renderers/webgl/WebGLAttributes.d.ts | 11 - .../base/renderers/webgl/WebGLAttributes.js | 155 - .../base/renderers/webgl/WebGLBackground.d.ts | 19 - .../base/renderers/webgl/WebGLBackground.js | 223 -- .../renderers/webgl/WebGLBufferRenderer.d.ts | 10 - .../renderers/webgl/WebGLBufferRenderer.js | 61 - .../renderers/webgl/WebGLCapabilities.d.ts | 31 - .../base/renderers/webgl/WebGLCapabilities.js | 120 - .../base/renderers/webgl/WebGLClipping.d.ts | 19 - .../src/base/renderers/webgl/WebGLClipping.js | 164 - .../base/renderers/webgl/WebGLExtensions.d.ts | 7 - .../base/renderers/webgl/WebGLExtensions.js | 61 - .../base/renderers/webgl/WebGLGeometries.d.ts | 7 - .../base/renderers/webgl/WebGLGeometries.js | 216 -- .../webgl/WebGLIndexedBufferRenderer.d.ts | 10 - .../webgl/WebGLIndexedBufferRenderer.js | 71 - .../src/base/renderers/webgl/WebGLInfo.d.ts | 23 - .../src/base/renderers/webgl/WebGLInfo.js | 83 - .../src/base/renderers/webgl/WebGLLights.d.ts | 7 - .../src/base/renderers/webgl/WebGLLights.js | 409 --- .../renderers/webgl/WebGLMorphtargets.d.ts | 12 - .../base/renderers/webgl/WebGLMorphtargets.js | 111 - .../base/renderers/webgl/WebGLObjects.d.ts | 9 - .../src/base/renderers/webgl/WebGLObjects.js | 52 - .../base/renderers/webgl/WebGLProgram.d.ts | 39 - .../src/base/renderers/webgl/WebGLProgram.js | 779 ----- .../base/renderers/webgl/WebGLPrograms.d.ts | 28 - .../src/base/renderers/webgl/WebGLPrograms.js | 323 -- .../base/renderers/webgl/WebGLProperties.d.ts | 9 - .../base/renderers/webgl/WebGLProperties.js | 52 - .../renderers/webgl/WebGLRenderLists.d.ts | 53 - .../base/renderers/webgl/WebGLRenderLists.js | 209 -- .../renderers/webgl/WebGLRenderStates.d.ts | 25 - .../base/renderers/webgl/WebGLRenderStates.js | 116 - .../src/base/renderers/webgl/WebGLShader.d.ts | 5 - .../src/base/renderers/webgl/WebGLShader.js | 16 - .../base/renderers/webgl/WebGLShadowMap.d.ts | 27 - .../base/renderers/webgl/WebGLShadowMap.js | 443 --- .../src/base/renderers/webgl/WebGLState.d.ts | 127 - .../src/base/renderers/webgl/WebGLState.js | 991 ------ .../base/renderers/webgl/WebGLTextures.d.ts | 19 - .../src/base/renderers/webgl/WebGLTextures.js | 1197 ------- .../base/renderers/webgl/WebGLUniforms.d.ts | 16 - .../src/base/renderers/webgl/WebGLUniforms.js | 848 ----- .../src/base/renderers/webgl/WebGLUtils.d.ts | 7 - .../src/base/renderers/webgl/WebGLUtils.js | 168 - .../base/renderers/webvr/WebVRManager.d.ts | 25 - .../src/base/renderers/webvr/WebVRManager.js | 427 --- .../src/base/renderers/webvr/WebVRUtils.d.ts | 3 - .../src/base/renderers/webvr/WebVRUtils.js | 66 - .../base/renderers/webvr/WebXRManager.d.ts | 19 - .../src/base/renderers/webvr/WebXRManager.js | 331 -- cases/esbuild-three/src/base/scenes/Fog.d.ts | 38 - cases/esbuild-three/src/base/scenes/Fog.js | 42 - .../src/base/scenes/FogExp2.d.ts | 22 - .../esbuild-three/src/base/scenes/FogExp2.js | 39 - .../esbuild-three/src/base/scenes/Scene.d.ts | 32 - cases/esbuild-three/src/base/scenes/Scene.js | 69 - .../src/base/textures/CanvasTexture.d.ts | 24 - .../src/base/textures/CanvasTexture.js | 19 - .../src/base/textures/CompressedTexture.d.ts | 30 - .../src/base/textures/CompressedTexture.js | 32 - .../src/base/textures/CubeTexture.d.ts | 28 - .../src/base/textures/CubeTexture.js | 42 - .../src/base/textures/DataTexture.d.ts | 31 - .../src/base/textures/DataTexture.js | 29 - .../src/base/textures/DataTexture2DArray.d.ts | 13 - .../src/base/textures/DataTexture2DArray.js | 28 - .../src/base/textures/DataTexture3D.d.ts | 13 - .../src/base/textures/DataTexture3D.js | 36 - .../src/base/textures/DepthTexture.d.ts | 25 - .../src/base/textures/DepthTexture.js | 38 - .../src/base/textures/Texture.d.ts | 65 - .../src/base/textures/Texture.js | 332 -- .../src/base/textures/VideoTexture.d.ts | 24 - .../src/base/textures/VideoTexture.js | 42 - cases/esbuild-three/src/base/utils.js | 37 - cases/esbuild-three/src/index.js | 21 - cases/esbuild-three/webpack.config.js | 6 - cases/minimal/package.json | 10 - cases/minimal/src/index.js | 1 - cases/minimal/webpack.config.js | 1 - cases/rome/package.json | 16 - cases/rome/src/.gitignore | 1 - cases/rome/src/index.ts | 3 - cases/rome/tsconfig.json | 25 - cases/rome/webpack.config.js | 28 - eslint.config.mjs | 14 + fixtures/minimal/main.js | 70 + lib/build-plugin.cjs | 69 - lib/build.js | 115 - lib/compare.js | 49 - lib/custom-registry.js | 116 - lib/measure.js | 159 - lib/utils.js | 490 --- package.json | 45 +- scenarios/development-build.js | 3 - scenarios/development-rebuild.js | 3 - scenarios/production-build.js | 3 - src/bundlers/parcel.mjs | 47 + src/bundlers/vite.mjs | 39 + src/bundlers/webpack.mjs | 59 + src/core/cli.mjs | 34 + src/core/runner.mjs | 105 + src/core/utils/file.mjs | 40 + src/core/utils/formatting.mjs | 21 + src/metrics/build-time.mjs | 15 + src/metrics/size.mjs | 17 + src/reporters/console.mjs | 59 + yarn.lock | 2927 ++++++++++++++++- 705 files changed, 3561 insertions(+), 69315 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .github/workflows/compare.yml delete mode 100644 .github/workflows/measure-all-cases.yml delete mode 100644 .github/workflows/measure-date.yml delete mode 100644 .github/workflows/measure-historic.yml delete mode 100644 .github/workflows/measure-many-random-missing.yml delete mode 100644 .github/workflows/measure-random-missing.yml delete mode 100644 .github/workflows/measure-single.yml delete mode 100644 .github/workflows/verify-stability.yml create mode 100644 .prettierignore delete mode 100644 .prettierrc.cjs create mode 100644 LICENSE create mode 100644 README.md delete mode 100644 addons/babel-env.js delete mode 100644 addons/cpu-profile.js delete mode 100644 addons/eval-source-map.js delete mode 100644 addons/future-defaults.js delete mode 100644 addons/hmr.js delete mode 100644 addons/initial-persistent-cache.js delete mode 100644 addons/memory-profile.js delete mode 100644 addons/module-unsafe-cache.js delete mode 100644 addons/no-cache.js delete mode 100644 addons/no-concatenation.js delete mode 100644 addons/no-exports-analysis.js delete mode 100644 addons/no-minimize.js delete mode 100644 addons/persistent-cache.js delete mode 100644 addons/pnp.js delete mode 100644 addons/resolve-unsafe-cache.js delete mode 100644 addons/source-map.js delete mode 100644 addons/swc-env-minimize.js delete mode 100644 addons/swc-env.js delete mode 100644 addons/swc-minimize.js delete mode 100644 addons/thread-babel-env.js delete mode 100644 addons/unsafe-cache.js delete mode 100644 bin/compare-scenarios.js delete mode 100644 bin/compare.js delete mode 100644 bin/measure-mean-normalized.js delete mode 100644 bin/measure-mean.js delete mode 100644 bin/measure.js delete mode 100644 bin/random-missing.js delete mode 100644 bin/report.js delete mode 100644 bin/upload.js delete mode 100644 cases/all/package.json delete mode 100644 cases/all/src/.gitignore delete mode 100644 cases/all/src/babel-runtime.js delete mode 100644 cases/all/src/index.js delete mode 100644 cases/all/src/rome.ts delete mode 100644 cases/all/tsconfig.json delete mode 100644 cases/all/webpack.config.js delete mode 100644 cases/atlaskit-editor/package.json delete mode 100644 cases/atlaskit-editor/src/index.js delete mode 100644 cases/atlaskit-editor/webpack.config.js delete mode 100644 cases/common-libs-chunks/package.json delete mode 100644 cases/common-libs-chunks/src/babel-runtime.js delete mode 100644 cases/common-libs-chunks/src/index.js delete mode 100644 cases/common-libs-chunks/webpack.config.js delete mode 100644 cases/common-libs/package.json delete mode 100644 cases/common-libs/src/babel-runtime.js delete mode 100644 cases/common-libs/src/index.js delete mode 100644 cases/common-libs/webpack.config.js delete mode 100644 cases/esbuild-three/package.json delete mode 100644 cases/esbuild-three/src/.gitignore delete mode 100644 cases/esbuild-three/src/base/Three.Legacy.d.ts delete mode 100644 cases/esbuild-three/src/base/Three.Legacy.js delete mode 100644 cases/esbuild-three/src/base/Three.d.ts delete mode 100644 cases/esbuild-three/src/base/Three.js delete mode 100644 cases/esbuild-three/src/base/animation/AnimationAction.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/AnimationAction.js delete mode 100644 cases/esbuild-three/src/base/animation/AnimationClip.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/AnimationClip.js delete mode 100644 cases/esbuild-three/src/base/animation/AnimationMixer.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/AnimationMixer.js delete mode 100644 cases/esbuild-three/src/base/animation/AnimationObjectGroup.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/AnimationObjectGroup.js delete mode 100644 cases/esbuild-three/src/base/animation/AnimationUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/AnimationUtils.js delete mode 100644 cases/esbuild-three/src/base/animation/KeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/KeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/PropertyBinding.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/PropertyBinding.js delete mode 100644 cases/esbuild-three/src/base/animation/PropertyMixer.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/PropertyMixer.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.d.ts delete mode 100644 cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.js delete mode 100644 cases/esbuild-three/src/base/audio/Audio.d.ts delete mode 100644 cases/esbuild-three/src/base/audio/Audio.js delete mode 100644 cases/esbuild-three/src/base/audio/AudioAnalyser.d.ts delete mode 100644 cases/esbuild-three/src/base/audio/AudioAnalyser.js delete mode 100644 cases/esbuild-three/src/base/audio/AudioContext.d.ts delete mode 100644 cases/esbuild-three/src/base/audio/AudioContext.js delete mode 100644 cases/esbuild-three/src/base/audio/AudioListener.d.ts delete mode 100644 cases/esbuild-three/src/base/audio/AudioListener.js delete mode 100644 cases/esbuild-three/src/base/audio/PositionalAudio.d.ts delete mode 100644 cases/esbuild-three/src/base/audio/PositionalAudio.js delete mode 100644 cases/esbuild-three/src/base/cameras/ArrayCamera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/ArrayCamera.js delete mode 100644 cases/esbuild-three/src/base/cameras/Camera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/Camera.js delete mode 100644 cases/esbuild-three/src/base/cameras/CubeCamera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/CubeCamera.js delete mode 100644 cases/esbuild-three/src/base/cameras/OrthographicCamera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/OrthographicCamera.js delete mode 100644 cases/esbuild-three/src/base/cameras/PerspectiveCamera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/PerspectiveCamera.js delete mode 100644 cases/esbuild-three/src/base/cameras/StereoCamera.d.ts delete mode 100644 cases/esbuild-three/src/base/cameras/StereoCamera.js delete mode 100644 cases/esbuild-three/src/base/constants.d.ts delete mode 100644 cases/esbuild-three/src/base/constants.js delete mode 100644 cases/esbuild-three/src/base/core/BufferAttribute.d.ts delete mode 100644 cases/esbuild-three/src/base/core/BufferAttribute.js delete mode 100644 cases/esbuild-three/src/base/core/BufferGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/core/BufferGeometry.js delete mode 100644 cases/esbuild-three/src/base/core/Clock.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Clock.js delete mode 100644 cases/esbuild-three/src/base/core/DirectGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/core/DirectGeometry.js delete mode 100644 cases/esbuild-three/src/base/core/EventDispatcher.d.ts delete mode 100644 cases/esbuild-three/src/base/core/EventDispatcher.js delete mode 100644 cases/esbuild-three/src/base/core/Face3.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Face3.js delete mode 100644 cases/esbuild-three/src/base/core/Geometry.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Geometry.js delete mode 100644 cases/esbuild-three/src/base/core/InstancedBufferAttribute.d.ts delete mode 100644 cases/esbuild-three/src/base/core/InstancedBufferAttribute.js delete mode 100644 cases/esbuild-three/src/base/core/InstancedBufferGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/core/InstancedBufferGeometry.js delete mode 100644 cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.d.ts delete mode 100644 cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.js delete mode 100644 cases/esbuild-three/src/base/core/InterleavedBuffer.d.ts delete mode 100644 cases/esbuild-three/src/base/core/InterleavedBuffer.js delete mode 100644 cases/esbuild-three/src/base/core/InterleavedBufferAttribute.d.ts delete mode 100644 cases/esbuild-three/src/base/core/InterleavedBufferAttribute.js delete mode 100644 cases/esbuild-three/src/base/core/Layers.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Layers.js delete mode 100644 cases/esbuild-three/src/base/core/Object3D.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Object3D.js delete mode 100644 cases/esbuild-three/src/base/core/Raycaster.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Raycaster.js delete mode 100644 cases/esbuild-three/src/base/core/Uniform.d.ts delete mode 100644 cases/esbuild-three/src/base/core/Uniform.js delete mode 100644 cases/esbuild-three/src/base/extras/Earcut.js delete mode 100644 cases/esbuild-three/src/base/extras/ImageUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/ImageUtils.js delete mode 100644 cases/esbuild-three/src/base/extras/ShapeUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/ShapeUtils.js delete mode 100644 cases/esbuild-three/src/base/extras/core/Curve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/Curve.js delete mode 100644 cases/esbuild-three/src/base/extras/core/CurvePath.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/CurvePath.js delete mode 100644 cases/esbuild-three/src/base/extras/core/Font.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/Font.js delete mode 100644 cases/esbuild-three/src/base/extras/core/Interpolations.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/Interpolations.js delete mode 100644 cases/esbuild-three/src/base/extras/core/Path.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/Path.js delete mode 100644 cases/esbuild-three/src/base/extras/core/Shape.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/Shape.js delete mode 100644 cases/esbuild-three/src/base/extras/core/ShapePath.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/core/ShapePath.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/ArcCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/ArcCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/Curves.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/Curves.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/EllipseCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/EllipseCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/LineCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/LineCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/LineCurve3.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/LineCurve3.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.js delete mode 100644 cases/esbuild-three/src/base/extras/curves/SplineCurve.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/curves/SplineCurve.js delete mode 100644 cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.d.ts delete mode 100644 cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.js delete mode 100644 cases/esbuild-three/src/base/geometries/BoxGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/BoxGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/CircleGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/CircleGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/ConeGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/ConeGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/CylinderGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/CylinderGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/DodecahedronGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/DodecahedronGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/EdgesGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/EdgesGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/ExtrudeGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/ExtrudeGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/Geometries.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/Geometries.js delete mode 100644 cases/esbuild-three/src/base/geometries/IcosahedronGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/IcosahedronGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/LatheGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/LatheGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/OctahedronGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/OctahedronGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/ParametricGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/ParametricGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/PlaneGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/PlaneGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/PolyhedronGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/PolyhedronGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/RingGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/RingGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/ShapeGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/ShapeGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/SphereGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/SphereGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/TetrahedronGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/TetrahedronGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/TextGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/TextGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/TorusGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/TorusGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/TorusKnotGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/TorusKnotGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/TubeGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/TubeGeometry.js delete mode 100644 cases/esbuild-three/src/base/geometries/WireframeGeometry.d.ts delete mode 100644 cases/esbuild-three/src/base/geometries/WireframeGeometry.js delete mode 100644 cases/esbuild-three/src/base/helpers/ArrowHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/ArrowHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/AxesHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/AxesHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/Box3Helper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/Box3Helper.js delete mode 100644 cases/esbuild-three/src/base/helpers/BoxHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/BoxHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/CameraHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/CameraHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/DirectionalLightHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/DirectionalLightHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/FaceNormalsHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/FaceNormalsHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/GridHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/GridHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/HemisphereLightHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/HemisphereLightHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/LightProbeHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/PlaneHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/PlaneHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/PointLightHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/PointLightHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/PolarGridHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/PolarGridHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/PositionalAudioHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/PositionalAudioHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/RectAreaLightHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/RectAreaLightHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/SkeletonHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/SkeletonHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/SpotLightHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/SpotLightHelper.js delete mode 100644 cases/esbuild-three/src/base/helpers/VertexNormalsHelper.d.ts delete mode 100644 cases/esbuild-three/src/base/helpers/VertexNormalsHelper.js delete mode 100644 cases/esbuild-three/src/base/lights/AmbientLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/AmbientLight.js delete mode 100644 cases/esbuild-three/src/base/lights/AmbientLightProbe.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/AmbientLightProbe.js delete mode 100644 cases/esbuild-three/src/base/lights/DirectionalLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/DirectionalLight.js delete mode 100644 cases/esbuild-three/src/base/lights/DirectionalLightShadow.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/DirectionalLightShadow.js delete mode 100644 cases/esbuild-three/src/base/lights/HemisphereLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/HemisphereLight.js delete mode 100644 cases/esbuild-three/src/base/lights/HemisphereLightProbe.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/HemisphereLightProbe.js delete mode 100644 cases/esbuild-three/src/base/lights/Light.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/Light.js delete mode 100644 cases/esbuild-three/src/base/lights/LightProbe.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/LightProbe.js delete mode 100644 cases/esbuild-three/src/base/lights/LightShadow.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/LightShadow.js delete mode 100644 cases/esbuild-three/src/base/lights/PointLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/PointLight.js delete mode 100644 cases/esbuild-three/src/base/lights/PointLightShadow.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/PointLightShadow.js delete mode 100644 cases/esbuild-three/src/base/lights/RectAreaLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/RectAreaLight.js delete mode 100644 cases/esbuild-three/src/base/lights/SpotLight.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/SpotLight.js delete mode 100644 cases/esbuild-three/src/base/lights/SpotLightShadow.d.ts delete mode 100644 cases/esbuild-three/src/base/lights/SpotLightShadow.js delete mode 100644 cases/esbuild-three/src/base/loaders/AnimationLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/AnimationLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/AudioLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/AudioLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/BufferGeometryLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/BufferGeometryLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/Cache.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/Cache.js delete mode 100644 cases/esbuild-three/src/base/loaders/CompressedTextureLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/CompressedTextureLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/CubeTextureLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/CubeTextureLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/DataTextureLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/DataTextureLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/FileLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/FileLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/FontLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/FontLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/ImageBitmapLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/ImageBitmapLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/ImageLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/ImageLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/Loader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/Loader.js delete mode 100644 cases/esbuild-three/src/base/loaders/LoaderUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/LoaderUtils.js delete mode 100644 cases/esbuild-three/src/base/loaders/LoadingManager.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/LoadingManager.js delete mode 100644 cases/esbuild-three/src/base/loaders/MaterialLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/MaterialLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/ObjectLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/ObjectLoader.js delete mode 100644 cases/esbuild-three/src/base/loaders/TextureLoader.d.ts delete mode 100644 cases/esbuild-three/src/base/loaders/TextureLoader.js delete mode 100644 cases/esbuild-three/src/base/materials/LineBasicMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/LineBasicMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/LineDashedMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/LineDashedMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/Material.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/Material.js delete mode 100644 cases/esbuild-three/src/base/materials/Materials.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/Materials.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshBasicMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshBasicMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshDepthMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshDepthMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshDistanceMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshDistanceMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshLambertMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshLambertMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshMatcapMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshMatcapMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshNormalMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshNormalMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshPhongMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshPhongMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshStandardMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshStandardMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/MeshToonMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/MeshToonMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/PointsMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/PointsMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/RawShaderMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/RawShaderMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/ShaderMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/ShaderMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/ShadowMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/ShadowMaterial.js delete mode 100644 cases/esbuild-three/src/base/materials/SpriteMaterial.d.ts delete mode 100644 cases/esbuild-three/src/base/materials/SpriteMaterial.js delete mode 100644 cases/esbuild-three/src/base/math/Box2.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Box2.js delete mode 100644 cases/esbuild-three/src/base/math/Box3.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Box3.js delete mode 100644 cases/esbuild-three/src/base/math/Color.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Color.js delete mode 100644 cases/esbuild-three/src/base/math/Cylindrical.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Cylindrical.js delete mode 100644 cases/esbuild-three/src/base/math/Euler.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Euler.js delete mode 100644 cases/esbuild-three/src/base/math/Frustum.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Frustum.js delete mode 100644 cases/esbuild-three/src/base/math/Interpolant.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Interpolant.js delete mode 100644 cases/esbuild-three/src/base/math/Line3.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Line3.js delete mode 100644 cases/esbuild-three/src/base/math/Math.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Math.js delete mode 100644 cases/esbuild-three/src/base/math/Matrix3.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Matrix3.js delete mode 100644 cases/esbuild-three/src/base/math/Matrix4.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Matrix4.js delete mode 100644 cases/esbuild-three/src/base/math/Plane.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Plane.js delete mode 100644 cases/esbuild-three/src/base/math/Quaternion.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Quaternion.js delete mode 100644 cases/esbuild-three/src/base/math/Ray.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Ray.js delete mode 100644 cases/esbuild-three/src/base/math/Sphere.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Sphere.js delete mode 100644 cases/esbuild-three/src/base/math/Spherical.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Spherical.js delete mode 100644 cases/esbuild-three/src/base/math/SphericalHarmonics3.d.ts delete mode 100644 cases/esbuild-three/src/base/math/SphericalHarmonics3.js delete mode 100644 cases/esbuild-three/src/base/math/Triangle.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Triangle.js delete mode 100644 cases/esbuild-three/src/base/math/Vector2.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Vector2.js delete mode 100644 cases/esbuild-three/src/base/math/Vector3.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Vector3.js delete mode 100644 cases/esbuild-three/src/base/math/Vector4.d.ts delete mode 100644 cases/esbuild-three/src/base/math/Vector4.js delete mode 100644 cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.d.ts delete mode 100644 cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.js delete mode 100644 cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.d.ts delete mode 100644 cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.js delete mode 100644 cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.d.ts delete mode 100644 cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.js delete mode 100644 cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.d.ts delete mode 100644 cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.js delete mode 100644 cases/esbuild-three/src/base/objects/Bone.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Bone.js delete mode 100644 cases/esbuild-three/src/base/objects/Group.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Group.js delete mode 100644 cases/esbuild-three/src/base/objects/LOD.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/LOD.js delete mode 100644 cases/esbuild-three/src/base/objects/Line.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Line.js delete mode 100644 cases/esbuild-three/src/base/objects/LineLoop.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/LineLoop.js delete mode 100644 cases/esbuild-three/src/base/objects/LineSegments.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/LineSegments.js delete mode 100644 cases/esbuild-three/src/base/objects/Mesh.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Mesh.js delete mode 100644 cases/esbuild-three/src/base/objects/Points.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Points.js delete mode 100644 cases/esbuild-three/src/base/objects/Skeleton.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Skeleton.js delete mode 100644 cases/esbuild-three/src/base/objects/SkinnedMesh.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/SkinnedMesh.js delete mode 100644 cases/esbuild-three/src/base/objects/Sprite.d.ts delete mode 100644 cases/esbuild-three/src/base/objects/Sprite.js delete mode 100644 cases/esbuild-three/src/base/polyfills.d.ts delete mode 100644 cases/esbuild-three/src/base/polyfills.js delete mode 100644 cases/esbuild-three/src/base/renderers/WebGL2Renderer.js delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.js delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderTarget.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderTarget.js delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.js delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderer.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/WebGLRenderer.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/begin_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bsdfs.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normalmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/common.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/packing.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/project_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_frag.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_vert.glsl.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/UniformsLib.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/UniformsLib.js delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLLights.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLLights.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLShader.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLShader.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLState.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLState.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.js delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.js delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebVRManager.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebVRManager.js delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.js delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebXRManager.d.ts delete mode 100644 cases/esbuild-three/src/base/renderers/webvr/WebXRManager.js delete mode 100644 cases/esbuild-three/src/base/scenes/Fog.d.ts delete mode 100644 cases/esbuild-three/src/base/scenes/Fog.js delete mode 100644 cases/esbuild-three/src/base/scenes/FogExp2.d.ts delete mode 100644 cases/esbuild-three/src/base/scenes/FogExp2.js delete mode 100644 cases/esbuild-three/src/base/scenes/Scene.d.ts delete mode 100644 cases/esbuild-three/src/base/scenes/Scene.js delete mode 100644 cases/esbuild-three/src/base/textures/CanvasTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/CanvasTexture.js delete mode 100644 cases/esbuild-three/src/base/textures/CompressedTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/CompressedTexture.js delete mode 100644 cases/esbuild-three/src/base/textures/CubeTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/CubeTexture.js delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture.js delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture2DArray.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture2DArray.js delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture3D.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/DataTexture3D.js delete mode 100644 cases/esbuild-three/src/base/textures/DepthTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/DepthTexture.js delete mode 100644 cases/esbuild-three/src/base/textures/Texture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/Texture.js delete mode 100644 cases/esbuild-three/src/base/textures/VideoTexture.d.ts delete mode 100644 cases/esbuild-three/src/base/textures/VideoTexture.js delete mode 100644 cases/esbuild-three/src/base/utils.js delete mode 100644 cases/esbuild-three/src/index.js delete mode 100644 cases/esbuild-three/webpack.config.js delete mode 100644 cases/minimal/package.json delete mode 100644 cases/minimal/src/index.js delete mode 100644 cases/minimal/webpack.config.js delete mode 100644 cases/rome/package.json delete mode 100644 cases/rome/src/.gitignore delete mode 100644 cases/rome/src/index.ts delete mode 100644 cases/rome/tsconfig.json delete mode 100644 cases/rome/webpack.config.js create mode 100644 eslint.config.mjs create mode 100644 fixtures/minimal/main.js delete mode 100644 lib/build-plugin.cjs delete mode 100644 lib/build.js delete mode 100644 lib/compare.js delete mode 100644 lib/custom-registry.js delete mode 100644 lib/measure.js delete mode 100644 lib/utils.js delete mode 100644 scenarios/development-build.js delete mode 100644 scenarios/development-rebuild.js delete mode 100644 scenarios/production-build.js create mode 100644 src/bundlers/parcel.mjs create mode 100644 src/bundlers/vite.mjs create mode 100644 src/bundlers/webpack.mjs create mode 100644 src/core/cli.mjs create mode 100644 src/core/runner.mjs create mode 100644 src/core/utils/file.mjs create mode 100644 src/core/utils/formatting.mjs create mode 100644 src/metrics/build-time.mjs create mode 100644 src/metrics/size.mjs create mode 100644 src/reporters/console.mjs diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d87abc87c8..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 2 -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 80 - -[*.{yml,yaml,json}] -indent_style = space -indent_size = 2 - -[*.md] -trim_trailing_whitespace = false diff --git a/.github/workflows/compare.yml b/.github/workflows/compare.yml deleted file mode 100644 index ef54b5299b..0000000000 --- a/.github/workflows/compare.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Compare - -on: - workflow_dispatch: - inputs: - base: - description: "Base versions (dep@version, comma-separated) or date" - default: "webpack@webpack/webpack#master" - required: true - current: - description: "current versions (dep@version, comma-separated) or date" - default: "webpack@webpack/webpack#master" - required: true - -jobs: - bench: - strategy: - fail-fast: false - matrix: - base: - - "${{ github.event.inputs.base }}" - current: - - "${{ github.event.inputs.current }}" - case: - - common-libs - - esbuild-three - - rome - scenario: - - development-build - - development-build+initial-persistent-cache - - development-build+persistent-cache - - development-rebuild - - development-rebuild+unsafe-cache - - production-build - - production-build+source-map - - production-build+source-map+babel-env - - production-build+no-minimize - - production-build+persistent-cache - - production-build+initial-persistent-cache - - production-build+source-map+persistent-cache - - production-build+source-map+initial-persistent-cache - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.base }} vs ${{ github.event.inputs.current }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 25 - command: node bin/compare.js ${{ matrix.case }} ${{ matrix.scenario }} ${{ github.event.inputs.base }} ${{ github.event.inputs.current }} - - uses: actions/upload-artifact@v4 - with: - name: compare-results-${{ matrix.case }}-${{ matrix.scenario }}-${{ github.event.inputs.base }}-${{ github.event.inputs.current }} - path: output - report: - needs: [bench] - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.base }} vs ${{ github.event.inputs.current }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: actions/download-artifact@v4 - with: - path: output - pattern: compare-results-* - merge-multiple: true - - run: node bin/report.js diff --git a/.github/workflows/measure-all-cases.yml b/.github/workflows/measure-all-cases.yml deleted file mode 100644 index e70b8e7ac1..0000000000 --- a/.github/workflows/measure-all-cases.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Measure scenario and date for all cases - -on: - workflow_dispatch: - inputs: - scenario: - description: "Scenario to measure" - default: "development-build" - required: true - date: - description: "Date to measure (yyyy-mm-dd)" - default: "2021-10-01" - required: true - -jobs: - bench: - strategy: - fail-fast: false - matrix: - case: - - common-libs - - esbuild-three - - rome - - atlaskit-editor - - common-libs-chunks - runs-on: ubuntu-latest - steps: - - run: echo ${{ matrix.case }} ${{ github.event.inputs.scenario }} ${{ github.event.inputs.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ matrix.case }} ${{ github.event.inputs.scenario }} ${{ github.event.inputs.date }} - - uses: actions/upload-artifact@v4 - with: - name: measure-results-${{ matrix.case }}-${{ github.event.inputs.scenario }}-${{ github.event.inputs.date }} - path: output - upload: - needs: [bench] - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.scenario }} ${{ github.event.inputs.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: actions/download-artifact@v4 - with: - path: output - pattern: measure-results-* - merge-multiple: true - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - run: node bin/upload.js ${{ github.event.inputs.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/measure-date.yml b/.github/workflows/measure-date.yml deleted file mode 100644 index b464c61fbb..0000000000 --- a/.github/workflows/measure-date.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Measure date - -on: - workflow_dispatch: - inputs: - date: - description: "Date to measure (yyyy-mm-dd)" - default: "2021-01-01" - required: true -jobs: - bench: - strategy: - fail-fast: false - matrix: - case: - - common-libs - - esbuild-three - - rome - - atlaskit-editor - - common-libs-chunks - scenario: - - development-build - - development-build+initial-persistent-cache - - development-build+persistent-cache - - development-rebuild - - development-rebuild+unsafe-cache - - development-rebuild+unsafe-cache+no-exports-analysis - - development-rebuild+persistent-cache+unsafe-cache+no-exports-analysis - - production-build - - production-build+source-map - - production-build+source-map+babel-env - - production-build+no-minimize - - production-build+persistent-cache - - production-build+initial-persistent-cache - - production-build+source-map+persistent-cache - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ matrix.case }} ${{ matrix.scenario }} ${{ github.event.inputs.date }} - - uses: actions/upload-artifact@v4 - with: - name: measure-results-${{ matrix.case }}-${{ matrix.scenario }}-${{ github.event.inputs.date }} - path: output - upload: - needs: [bench] - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: actions/download-artifact@v4 - with: - path: output - pattern: measure-results-* - merge-multiple: true - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - run: node bin/upload.js ${{ github.event.inputs.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/measure-historic.yml b/.github/workflows/measure-historic.yml deleted file mode 100644 index 98ed2847a1..0000000000 --- a/.github/workflows/measure-historic.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Measure historic data - -on: - workflow_dispatch: - inputs: - case: - description: "Case to measure" - default: "common-libs" - required: true - scenario: - description: "Scenario to measure" - default: "development-build" - required: true -jobs: - bench: - strategy: - fail-fast: false - matrix: - date: - - "2020-01-01" - - "2020-02-01" - - "2020-03-01" - - "2020-04-01" - - "2020-05-01" - - "2020-06-01" - - "2020-07-01" - - "2020-08-01" - - "2020-09-01" - - "2020-10-01" - - "2020-11-01" - - "2020-12-01" - - "2021-01-01" - - "2021-01-15" - - "2021-02-01" - - "2021-02-15" - - "2021-03-01" - - "2021-03-15" - - "2021-04-01" - - "2021-04-15" - - "2021-05-01" - - "2021-05-15" - - "2021-06-01" - - "2021-06-05" - - "2021-06-10" - - "2021-06-15" - - "2021-06-20" - - "2021-06-25" - - "2021-07-01" - - "2021-07-05" - - "2021-07-10" - - "2021-07-15" - - "2021-07-20" - - "2021-07-25" - - "2021-08-01" - runs-on: ubuntu-latest - steps: - - run: echo ${{ matrix.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ github.event.inputs.case }} ${{ github.event.inputs.scenario }} ${{ matrix.date }} - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - run: node bin/upload.js ${{ matrix.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/measure-many-random-missing.yml b/.github/workflows/measure-many-random-missing.yml deleted file mode 100644 index 7ad685cc25..0000000000 --- a/.github/workflows/measure-many-random-missing.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Measure many random missing data points - -on: - workflow_dispatch: -jobs: - bench: - strategy: - fail-fast: false - max-parallel: 10 - matrix: - a: - - "0" - - "1" - - "2" - - "3" - - "4" - - "5" - - "6" - - "7" - - "8" - - "9" - b: - - "0" - - "1" - - "2" - - "3" - - "4" - - "5" - - "6" - - "7" - - "8" - - "9" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 14.x - cache: "yarn" - - name: Yarn - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - name: Find missing data point - id: missing - run: node bin/random-missing.js ${{ secrets.GITHUB_TOKEN }} - - name: Print Result - run: echo ${{ steps.missing.outputs.case }} ${{ steps.missing.outputs.scenario }} ${{ steps.missing.outputs.date }} - - name: Measure - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ steps.missing.outputs.case }} ${{ steps.missing.outputs.scenario }} ${{ steps.missing.outputs.date }} - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: Upload result - run: node bin/upload.js ${{ steps.missing.outputs.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/measure-random-missing.yml b/.github/workflows/measure-random-missing.yml deleted file mode 100644 index 3e05a9922c..0000000000 --- a/.github/workflows/measure-random-missing.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Measure random missing data point - -on: - schedule: - - cron: "*/30 * * * *" - workflow_dispatch: -jobs: - bench: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 14.x - cache: "yarn" - - name: Yarn - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - name: Find missing data point - id: missing - run: node bin/random-missing.js ${{ secrets.GITHUB_TOKEN }} 3 - - name: Print Result - run: echo ${{ steps.missing.outputs.case }} ${{ steps.missing.outputs.scenario }} ${{ steps.missing.outputs.date }} - - name: Measure - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ steps.missing.outputs.case }} ${{ steps.missing.outputs.scenario }} ${{ steps.missing.outputs.date }} - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: Upload result - run: node bin/upload.js ${{ steps.missing.outputs.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/measure-single.yml b/.github/workflows/measure-single.yml deleted file mode 100644 index 325656ab6c..0000000000 --- a/.github/workflows/measure-single.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Measure single data point - -on: - workflow_dispatch: - inputs: - case: - description: "Case to measure" - default: "common-libs" - required: true - scenario: - description: "Scenario to measure" - default: "development-build" - required: true - date: - description: "Date to measure (yyyy-mm-dd)" - default: "2021-10-01" - required: true -jobs: - bench: - runs-on: ubuntu-latest - steps: - - run: echo ${{ github.event.inputs.case }} ${{ github.event.inputs.scenario }} ${{ github.event.inputs.date }} - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 30 - command: node bin/measure-mean-normalized.js ${{ github.event.inputs.case }} ${{ github.event.inputs.scenario }} ${{ github.event.inputs.date }} - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - run: node bin/upload.js ${{ github.event.inputs.date }} ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/verify-stability.yml b/.github/workflows/verify-stability.yml deleted file mode 100644 index d7b1e38d9e..0000000000 --- a/.github/workflows/verify-stability.yml +++ /dev/null @@ -1,111 +0,0 @@ -name: Verify Stability - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - basic: - strategy: - fail-fast: false - matrix: - case: - - common-libs - - esbuild-three - - rome - - atlaskit-editor - scenario: - - development-build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 25 - command: node bin/compare.js ${{ matrix.case }} ${{ matrix.scenario }} - - uses: actions/upload-artifact@v4 - with: - name: compare-results-${{ matrix.case }}-${{ matrix.scenario }} - path: output - - complete: - needs: [basic] - strategy: - fail-fast: false - matrix: - case: - - common-libs - - esbuild-three - - rome - - atlaskit-editor - scenario: - - development-build - - development-build+persistent-cache - - development-build+swc-env - - development-build+babel-env - - development-rebuild - - production-build - - production-build+source-map - - production-build+no-minimize - - production-build+persistent-cache - - production-build+initial-persistent-cache - - production-build+source-map+persistent-cache - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 25 - command: node bin/compare.js ${{ matrix.case }} ${{ matrix.scenario }} - - uses: actions/upload-artifact@v4 - with: - name: compare-results-${{ matrix.case }}-${{ matrix.scenario }} - path: output - overwrite: true - - report: - needs: [basic, complete] - if: ${{ always() }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "yarn" - - uses: nick-invision/retry@v3 - with: - max_attempts: 3 - timeout_minutes: 5 - command: yarn - - uses: actions/download-artifact@v4 - with: - path: output - pattern: compare-results-* - merge-multiple: true - - run: node bin/report.js diff --git a/.gitignore b/.gitignore index 98d9806768..9afe7dea40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,3 @@ -node_modules -dist -cases/**/yarn.lock -*.log -.cache -.yarn -.yarnrc.yml -.pnp.js -/output -.gh-pages -*.cpuprofile -*.heapprofile +fixtures/*/*-dist +.parcel-cache +node_modules \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..27c6307105 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +fixtures/*/*-dist +.parcel-cache \ No newline at end of file diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index e479d5de82..0000000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - useTabs: true, - tabWidth: 2, - overrides: [ - { - files: "*.json", - options: { - parser: "json", - useTabs: false - } - }, - { - files: "*.ts", - options: { - parser: "typescript" - } - } - ] -}; diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..c02eee0a57 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Aviv Keller and Webpack Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000..4d2af33f9f --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# Webpack Benchmarker + +## CLI Options + +| Option | Short | Description | Default | +| ------------ | ----- | ------------------------------------ | ------------------------ | +| `--bundlers` | `-b` | Select bundlers to benchmark | `["vite", "webpack"]` | +| `--metrics` | `-m` | Choose metrics to collect | `["build-time", "size"]` | +| `--reporter` | `-r` | Choose output format | `"console"` | +| `--fixtures` | | Glob pattern for fixture directories | `"./fixtures/*"` | +| `--verbose` | | Enable verbose logging | `false` | +| `--silent` | | Suppress all output except errors | `false` | + +## Fixtures + +Fixtures are test projects used to benchmark bundlers. + +Each fixture should exist in `fixtures/[name]`, and have a `main.js` as an entrypoint. + +## Extending the Benchmarker + +### Adding a New Bundler + +Create a new file in `src/bundlers/[bundler-name].mjs` that exports two functions: + +```javascript +export async function build(fixture) { ... } +export async function clean(fixture) { ... } +``` + +### Adding a New Metric + +Create a new file in `src/metrics/[metric-name].mjs` that default exports a class: + +```javascript +export default class { + name = "My Metric Name"; // Required + + start(options) { ... } // Optional + + stop(options) { ... } // Optional + + collect(options) { ... } // Required +} +``` + +### Adding a New Reporter + +Create a new file in `src/reporters/[reporter-name].mjs` that default exports a function: + +```javascript +export default async function report(results, options) { ... } +``` + +## Using with Git Repositories + +To run a benchmark on a bundler directly from it's source, install it directly from it's repository, and benchmark like normal. + +For example, to benchmark Webpack's bleeding edge, install it with: +```bash +yarn add webpack@https://github.com/webpack/webpack +``` \ No newline at end of file diff --git a/addons/babel-env.js b/addons/babel-env.js deleted file mode 100644 index 8917f25acf..0000000000 --- a/addons/babel-env.js +++ /dev/null @@ -1,46 +0,0 @@ -import { writeFile, unlink } from "fs/promises"; - -export const packageJson = (json) => { - json.browserslist = "> 0.25%, not dead"; - Object.assign(json.devDependencies, { - "@babel/core": "*", - "@babel/preset-env": "*", - "babel-loader": "*", - "core-js": "*", - "regenerator-runtime": "*", - }); - return json; -}; - -export const setup = async () => { - await writeFile( - ".babelrc.js", - `module.exports = { - sourceType: "unambiguous", - presets: [["@babel/env", { - useBuiltIns: "usage", - corejs: +require("core-js/package.json").version.slice(0, 1) - }]] -}` - ); -}; - -export const teardown = async () => { - try { - await unlink(".babelrc.js"); - } catch (e) {} -}; - -export const config = (content) => `${content} - -module.exports.module = module.exports.module || {}; -module.exports.module.rules = module.exports.module.rules || []; -module.exports.module.rules.unshift({ - test: /\.(js|tsx?)$/, - use: [ - { - loader: "babel-loader" - } - ] -}); -`; diff --git a/addons/cpu-profile.js b/addons/cpu-profile.js deleted file mode 100644 index a69acd3fba..0000000000 --- a/addons/cpu-profile.js +++ /dev/null @@ -1,6 +0,0 @@ -export const nodeArgs = [ - "--no-turbo-inlining", - "--cpu-prof", - "--cpu-prof-interval", - "100", -]; diff --git a/addons/eval-source-map.js b/addons/eval-source-map.js deleted file mode 100644 index d38858f43c..0000000000 --- a/addons/eval-source-map.js +++ /dev/null @@ -1,16 +0,0 @@ -import { alterFile, revertFile } from "../lib/utils.js"; - -export const args = ["--devtool", "eval-source-map"]; - -export const setup = async (options) => { - await alterFile("tsconfig.json", (content) => { - return ( - content && - content.replace(/("compilerOptions": \{)/, '$1\n "sourceMap": true,') - ); - }); -}; - -export const teardown = async (options) => { - await revertFile("tsconfig.json"); -}; diff --git a/addons/future-defaults.js b/addons/future-defaults.js deleted file mode 100644 index c65c4e9105..0000000000 --- a/addons/future-defaults.js +++ /dev/null @@ -1,5 +0,0 @@ -export const config = (content) => `${content} - -module.exports.experiments = module.exports.experiments || {}; -module.exports.experiments.futureDefaults = true; -`; diff --git a/addons/hmr.js b/addons/hmr.js deleted file mode 100644 index b80fd684fc..0000000000 --- a/addons/hmr.js +++ /dev/null @@ -1 +0,0 @@ -export const args = ["--hot"]; diff --git a/addons/initial-persistent-cache.js b/addons/initial-persistent-cache.js deleted file mode 100644 index 7f6cc8bceb..0000000000 --- a/addons/initial-persistent-cache.js +++ /dev/null @@ -1,6 +0,0 @@ -export const config = (content) => `${content} - -if(!require("webpack").version.startsWith("4")) { - module.exports.cache = { type: "filesystem" }; -} -`; diff --git a/addons/memory-profile.js b/addons/memory-profile.js deleted file mode 100644 index c4e78e23a5..0000000000 --- a/addons/memory-profile.js +++ /dev/null @@ -1,6 +0,0 @@ -export const nodeArgs = [ - "--no-turbo-inlining", - "--heap-prof", - "--heap-prof-interval", - "1024", -]; diff --git a/addons/module-unsafe-cache.js b/addons/module-unsafe-cache.js deleted file mode 100644 index f8ffb64eeb..0000000000 --- a/addons/module-unsafe-cache.js +++ /dev/null @@ -1,5 +0,0 @@ -export const config = (content) => `${content} - -module.exports.module = module.exports.module || {}; -module.exports.module.unsafeCache = true; -`; diff --git a/addons/no-cache.js b/addons/no-cache.js deleted file mode 100644 index 5f874b5e3f..0000000000 --- a/addons/no-cache.js +++ /dev/null @@ -1,4 +0,0 @@ -export const config = (content) => `${content} - -module.exports.cache = false; -`; diff --git a/addons/no-concatenation.js b/addons/no-concatenation.js deleted file mode 100644 index 264c978b8d..0000000000 --- a/addons/no-concatenation.js +++ /dev/null @@ -1,5 +0,0 @@ -export const config = (content) => `${content} - -module.exports.optimization = module.exports.optimization || {}; -module.exports.optimization.concatenateModules = false; -`; diff --git a/addons/no-exports-analysis.js b/addons/no-exports-analysis.js deleted file mode 100644 index 427594d116..0000000000 --- a/addons/no-exports-analysis.js +++ /dev/null @@ -1,11 +0,0 @@ -export const config = (content) => `${content} - -module.exports.optimization = module.exports.optimization || {}; -module.exports.optimization.providedExports = false; -module.exports.optimization.usedExports = false; -module.exports.optimization.sideEffects = false; -if(!require("webpack").version.startsWith("4")) { - module.exports.optimization.mangleExports = false; - module.exports.optimization.innerGraph = false; -} -`; diff --git a/addons/no-minimize.js b/addons/no-minimize.js deleted file mode 100644 index 9b65db649a..0000000000 --- a/addons/no-minimize.js +++ /dev/null @@ -1,5 +0,0 @@ -export const config = (content) => `${content} - -module.exports.optimization = module.exports.optimization || {}; -module.exports.optimization.minimize = false; -`; diff --git a/addons/persistent-cache.js b/addons/persistent-cache.js deleted file mode 100644 index 570f0c35b6..0000000000 --- a/addons/persistent-cache.js +++ /dev/null @@ -1,9 +0,0 @@ -export const config = (content) => `${content} - -if(!require("webpack").version.startsWith("4")) { - module.exports.cache = { type: "filesystem" }; -} -`; - -export const keepBuildCache = true; -export const warmupTwice = true; diff --git a/addons/pnp.js b/addons/pnp.js deleted file mode 100644 index 3428b301af..0000000000 --- a/addons/pnp.js +++ /dev/null @@ -1,23 +0,0 @@ -export const installOptions = { pnp: true }; - -export const packageJson = (json) => { - Object.assign(json.dependencies, { - "pnp-webpack-plugin": "*", - }); - return json; -}; - -export const config = (content) => `${content} - -if(require("webpack").version.startsWith("4")) { - var PnpWebpackPlugin = require("pnp-webpack-plugin"); - - module.exports.resolve = module.exports.resolve || {}; - module.exports.resolve.plugins = module.exports.resolve.plugins || []; - module.exports.resolve.plugins.push(PnpWebpackPlugin); - - module.exports.resolveLoader = module.exports.resolveLoader || {}; - module.exports.resolveLoader.plugins = module.exports.resolveLoader.plugins || []; - module.exports.resolveLoader.plugins.push(PnpWebpackPlugin.moduleLoader(module)); -} -`; diff --git a/addons/resolve-unsafe-cache.js b/addons/resolve-unsafe-cache.js deleted file mode 100644 index 928132c4c1..0000000000 --- a/addons/resolve-unsafe-cache.js +++ /dev/null @@ -1,6 +0,0 @@ -export const config = (content) => `${content} - -module.exports.resolve = module.exports.resolve || {}; -if(!require("webpack").version.startsWith("4") && !module.exports.cache) module.exports.resolve.cache = false; -module.exports.resolve.unsafeCache = true; -`; diff --git a/addons/source-map.js b/addons/source-map.js deleted file mode 100644 index b661a82d7b..0000000000 --- a/addons/source-map.js +++ /dev/null @@ -1,16 +0,0 @@ -import { alterFile, revertFile } from "../lib/utils.js"; - -export const args = ["--devtool", "source-map"]; - -export const setup = async (options) => { - await alterFile("tsconfig.json", (content) => { - return ( - content && - content.replace(/("compilerOptions": \{)/, '$1\n "sourceMap": true,') - ); - }); -}; - -export const teardown = async (options) => { - await revertFile("tsconfig.json"); -}; diff --git a/addons/swc-env-minimize.js b/addons/swc-env-minimize.js deleted file mode 100644 index 13609bd4f7..0000000000 --- a/addons/swc-env-minimize.js +++ /dev/null @@ -1,60 +0,0 @@ -import { writeFile, unlink } from "fs/promises"; - -export const packageJson = (json) => { - json.browserslist = "> 0.25%, not dead"; - Object.assign(json.devDependencies, { - "@swc/core": "*", - browserslist: "*", - "swc-loader": "*", - "regenerator-runtime": "*", - "terser-webpack-plugin": "*", - }); - return json; -}; - -export const setup = async () => { - await writeFile( - ".swcrc", - JSON.stringify( - { - jsc: { - parser: { - syntax: "ecmascript", - dynamicImport: true, - }, - }, - env: {}, - }, - null, - 2 - ) - ); -}; - -export const teardown = async () => { - try { - await unlink(".swcrc"); - } catch (e) {} -}; - -export const config = (content) => `${content} - -var TerserPlugin = require("terser-webpack-plugin"); - -module.exports.module = module.exports.module || {}; -module.exports.module.rules = module.exports.module.rules || []; -module.exports.module.rules.unshift({ - test: /\.(js|tsx?)$/, - use: [ - { - loader: "swc-loader" - } - ] -}); - -module.exports.optimization = { - minimizer: [new TerserPlugin({ - minify: TerserPlugin.swcMinify, - })], -}; -`; diff --git a/addons/swc-env.js b/addons/swc-env.js deleted file mode 100644 index 38842d8caa..0000000000 --- a/addons/swc-env.js +++ /dev/null @@ -1,51 +0,0 @@ -import { writeFile, unlink } from "fs/promises"; - -export const packageJson = (json) => { - json.browserslist = "> 0.25%, not dead"; - Object.assign(json.devDependencies, { - "@swc/core": "*", - browserslist: "*", - "swc-loader": "*", - "regenerator-runtime": "*", - }); - return json; -}; - -export const setup = async () => { - await writeFile( - ".swcrc", - JSON.stringify( - { - jsc: { - parser: { - syntax: "ecmascript", - dynamicImport: true, - }, - }, - env: {}, - }, - null, - 2 - ) - ); -}; - -export const teardown = async () => { - try { - await unlink(".swcrc"); - } catch (e) {} -}; - -export const config = (content) => `${content} - -module.exports.module = module.exports.module || {}; -module.exports.module.rules = module.exports.module.rules || []; -module.exports.module.rules.unshift({ - test: /\.(js|tsx?)$/, - use: [ - { - loader: "swc-loader" - } - ] -}); -`; diff --git a/addons/swc-minimize.js b/addons/swc-minimize.js deleted file mode 100644 index d73e3cbd41..0000000000 --- a/addons/swc-minimize.js +++ /dev/null @@ -1,17 +0,0 @@ -export const packageJson = (json) => { - Object.assign(json.devDependencies, { - "terser-webpack-plugin": "*", - }); - return json; -}; - -export const config = (content) => `${content} - -var TerserPlugin = require("terser-webpack-plugin"); - -module.exports.optimization = { - minimizer: [new TerserPlugin({ - minify: TerserPlugin.swcMinify, - })], -}; -`; diff --git a/addons/thread-babel-env.js b/addons/thread-babel-env.js deleted file mode 100644 index 9a5160a2a1..0000000000 --- a/addons/thread-babel-env.js +++ /dev/null @@ -1,53 +0,0 @@ -import { writeFile, unlink } from "fs/promises"; - -export const packageJson = (json) => { - json.browserslist = "> 0.25%, not dead"; - Object.assign(json.devDependencies, { - "@babel/core": "*", - "@babel/preset-env": "*", - "babel-loader": "*", - "core-js": "*", - "regenerator-runtime": "*", - "thread-loader": "*", - }); - return json; -}; - -export const setup = async () => { - await writeFile( - ".babelrc.js", - `module.exports = { - sourceType: "unambiguous", - presets: [["@babel/env", { - useBuiltIns: "usage", - corejs: +require("core-js/package.json").version.slice(0, 1) - }]] -}` - ); -}; - -export const teardown = async () => { - try { - await unlink(".babelrc.js"); - } catch (e) {} -}; - -export const config = (content) => `${content} - -module.exports.module = module.exports.module || {}; -module.exports.module.rules = module.exports.module.rules || []; -module.exports.module.rules.unshift({ - test: /\.(js|tsx?)$/, - use: [ - { - loader: "thread-loader", - options: { - poolRespawn: true - } - }, - { - loader: "babel-loader" - } - ] -}); -`; diff --git a/addons/unsafe-cache.js b/addons/unsafe-cache.js deleted file mode 100644 index 56eecc26e3..0000000000 --- a/addons/unsafe-cache.js +++ /dev/null @@ -1,8 +0,0 @@ -export const config = (content) => `${content} - -module.exports.module = module.exports.module || {}; -module.exports.module.unsafeCache = true; -module.exports.resolve = module.exports.resolve || {}; -if(!require("webpack").version.startsWith("4") && !module.exports.cache) module.exports.resolve.cache = false; -module.exports.resolve.unsafeCache = true; -`; diff --git a/bin/compare-scenarios.js b/bin/compare-scenarios.js deleted file mode 100644 index b87013e14f..0000000000 --- a/bin/compare-scenarios.js +++ /dev/null @@ -1,34 +0,0 @@ -import compare from "../lib/compare.js"; -import { formatDiffTable, formatResultTable } from "../lib/utils.js"; -import { mkdir, writeFile } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; - -const [ - , - , - caseName = "minimal", - baseline = "development-build", - scenarioName = "development-build+persistent-cache", -] = process.argv; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -(async () => { - const { diff, result } = await compare(caseName, scenarioName, { - runs: 30, - verboseSetup: true, - baselineScenario: baseline, - }); - console.log(formatResultTable(result, { colors: true, verbose: true })); - console.log(); - console.log(formatDiffTable(diff, { colors: true, verbose: true })); - await mkdir(resolve(rootDir, "output"), { recursive: true }); - await writeFile( - resolve(rootDir, `output/${caseName}.json`), - JSON.stringify(diff, null, 2) - ); -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/compare.js b/bin/compare.js deleted file mode 100644 index c07f1f4b03..0000000000 --- a/bin/compare.js +++ /dev/null @@ -1,48 +0,0 @@ -import compare from "../lib/compare.js"; -import { - formatDiffTable, - formatResultTable, - parseDependencies, -} from "../lib/utils.js"; -import { mkdir, writeFile } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; - -const [ - , - , - caseName = "minimal", - scenarioName = "development-build", - baseline = "", - current = "", -] = process.argv; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -const isDate = (str) => str.startsWith("20"); - -(async () => { - const { diff, result, baseResult } = await compare(caseName, scenarioName, { - runs: 3, - verboseSetup: true, - baselineDependencies: isDate(baseline) - ? undefined - : parseDependencies(baseline), - baselineDate: isDate(baseline) ? baseline : undefined, - dependencies: isDate(current) ? undefined : parseDependencies(current), - date: isDate(current) ? current : undefined, - }); - console.log(formatResultTable(baseResult, { colors: true, verbose: true })); - console.log(formatResultTable(result, { colors: true, verbose: true })); - console.log(); - console.log(formatDiffTable(diff, { colors: true, verbose: true })); - await mkdir(resolve(rootDir, "output"), { recursive: true }); - await writeFile( - resolve(rootDir, `output/${caseName}_${scenarioName}.json`), - JSON.stringify(diff, null, 2) - ); - process.exitCode = diff.stats.lowHigh < 1 || diff.stats.highLow > 1 ? 1 : 0; -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/measure-mean-normalized.js b/bin/measure-mean-normalized.js deleted file mode 100644 index ef4c4bbb34..0000000000 --- a/bin/measure-mean-normalized.js +++ /dev/null @@ -1,51 +0,0 @@ -import measure from "../lib/measure.js"; -import { formatResultTable, normalizeResult } from "../lib/utils.js"; -import { mkdir, writeFile } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; - -const [ - , - , - caseName = "minimal", - scenarioName = "development-default-build", - date = undefined, - normalDate = scenarioName.includes("future-defaults") - ? "2021-09-20" - : scenarioName.includes("swc-env") - ? "2021-05-10" - : "2021-02-15", -] = process.argv; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -(async () => { - const normalResult1 = await measure(caseName, scenarioName, { - run: 15, - verboseSetup: true, - date: normalDate, - }); - const baseResult = await measure(caseName, scenarioName, { - runs: 30, - verboseSetup: true, - date, - }); - const normalResult2 = await measure(caseName, scenarioName, { - run: 15, - verboseSetup: true, - date: normalDate, - }); - const result = normalizeResult( - baseResult, - (normalResult1.stats.median + normalResult2.stats.median) / 2 - ); - console.log(formatResultTable(result, { colors: true, verbose: true })); - await mkdir(resolve(rootDir, "output"), { recursive: true }); - await writeFile( - resolve(rootDir, `output/${caseName}_${scenarioName}.json`), - JSON.stringify(result, null, 2) - ); -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/measure-mean.js b/bin/measure-mean.js deleted file mode 100644 index 9732280b28..0000000000 --- a/bin/measure-mean.js +++ /dev/null @@ -1,32 +0,0 @@ -import measure from "../lib/measure.js"; -import { formatResultTable } from "../lib/utils.js"; -import { mkdir, writeFile } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; - -const [ - , - , - caseName = "minimal", - scenarioName = "development-default-build", - date = undefined, -] = process.argv; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -(async () => { - const result = await measure(caseName, scenarioName, { - runs: 30, - verboseSetup: true, - date, - }); - console.log(formatResultTable(result, { colors: true, verbose: true })); - await mkdir(resolve(rootDir, "output"), { recursive: true }); - await writeFile( - resolve(rootDir, `output/${caseName}_${scenarioName}.json`), - JSON.stringify(result, null, 2) - ); -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/measure.js b/bin/measure.js deleted file mode 100644 index 86477eda81..0000000000 --- a/bin/measure.js +++ /dev/null @@ -1,27 +0,0 @@ -import { parseDependencies } from "../lib/utils.js"; -import measure from "../lib/measure.js"; - -const [ - , - , - caseName = "minimal", - scenarioName = "development-default-build", - current = "", -] = process.argv; - -const isDate = (str) => str.startsWith("20"); - -(async () => { - console.log( - await measure(caseName, scenarioName, { - verbose: true, - verboseSetup: true, - noStatistics: true, - dependencies: isDate(current) ? undefined : parseDependencies(current), - date: isDate(current) ? current : undefined, - }) - ); -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/random-missing.js b/bin/random-missing.js deleted file mode 100644 index 18cb50928e..0000000000 --- a/bin/random-missing.js +++ /dev/null @@ -1,100 +0,0 @@ -import { readFile, stat } from "fs/promises"; -import { resolve, relative } from "path"; -import { fileURLToPath } from "url"; -import { runCommand } from "../lib/utils.js"; - -const [, , token, pow] = process.argv; -const GITHUB_ACTOR = process.env.GITHUB_ACTOR; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -const run = (command, args) => runCommand(command, args, true); - -const dirExist = async (p) => { - try { - if ((await stat(p)).isDirectory()) return true; - } catch { - return false; - } -}; - -(async () => { - const targetDir = resolve(rootDir, ".gh-pages"); - if (!(await dirExist(targetDir))) { - await run("git", [ - "clone", - "--branch", - "gh-pages", - "--single-branch", - "--depth", - "1", - token - ? `https://${GITHUB_ACTOR}:${token}@github.com/webpack/benchmark.git` - : "https://github.com/webpack/benchmark", - ".gh-pages", - ]); - } - const cwd = process.cwd(); - process.chdir(targetDir); - await run("git", ["reset", "--hard", "origin/gh-pages"]); - await run("git", ["pull", "--rebase"]); - process.chdir(cwd); - const indexFile = resolve(targetDir, "results", "index.txt"); - const index = await readFile(indexFile, "utf-8"); - - const d = new Date(); - - const testCases = new Set(); - const scenarios = new Set(); - const dates = new Set([ - `${d.getFullYear()}-${`0${d.getMonth() + 1}`.slice( - -2 - )}-${`0${d.getDate()}`.slice(-2)}`, - ]); - const existing = new Set(); - for (const indexLine of index.split("\n")) { - const match = /^([^/]+)\/([^_]+)_(.+).json/.exec(indexLine); - if (!match) continue; - const testCase = match[2]; - const scenario = match[3]; - const date = match[1]; - existing.add(`${date}/${testCase}_${scenario}`); - testCases.add(testCase); - scenarios.add(scenario); - dates.add(date); - } - - const missing = []; - const randomOrder = () => (Math.random() < 0.5 ? -1 : 1); - for (const date of Array.from(dates).sort((a, b) => (a < b ? 1 : -1))) { - for (const testCase of Array.from(testCases).sort(randomOrder)) { - for (const scenario of Array.from(scenarios).sort(randomOrder)) { - if (scenario.includes("future-defaults") && date < "2021-09-17") { - continue; - } - if (!existing.has(`${date}/${testCase}_${scenario}`)) { - missing.push({ - testCase, - scenario, - date, - }); - } - } - } - } - - if (missing.length === 0) { - console.log("No missing entries"); - process.exitCode = 2; - return; - } - console.log(`${missing.length} missing entries`); - const selected = - missing[Math.floor(Math.pow(Math.random(), pow || 1) * missing.length)]; - console.log(`::set-output name=case::${selected.testCase}`); - console.log(`::set-output name=scenario::${selected.scenario}`); - console.log(`::set-output name=date::${selected.date}`); -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/report.js b/bin/report.js deleted file mode 100644 index 94bc9f663a..0000000000 --- a/bin/report.js +++ /dev/null @@ -1,73 +0,0 @@ -import { readdir, readFile, writeFile } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; -import { formatDiffTable } from "../lib/utils.js"; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -(async () => { - const diffNames = await readdir(resolve(rootDir, "output")); - const diffs = await Promise.all( - diffNames.map(async (name) => ({ - case: name.split("_")[0], - scenario: name.split("_")[1].replace(".json", ""), - diff: JSON.parse( - await readFile(resolve(rootDir, "output", name), "utf-8") - ), - })) - ); - - const getMergedDiff = ({ caseFilter, scenarioFilter } = {}) => { - const mergedDiff = {}; - for (const { case: caseName, scenario, diff } of diffs) { - if (caseFilter && caseName !== caseFilter) continue; - if (scenarioFilter && scenario !== scenarioFilter) continue; - for (const key of Object.keys(diff)) { - let name = key; - if (!scenarioFilter) name = `${scenario} ${name}`; - if (!caseFilter) name = `${caseName} ${name}`; - mergedDiff[name] = diff[key]; - } - } - return mergedDiff; - }; - - const output = (header, filters, options) => { - const diff = formatDiffTable(getMergedDiff(filters), { - colors: true, - ...options, - }); - if (diff) { - console.log(header); - console.log(); - console.log(diff); - console.log(); - } - }; - - output("# Summary", {}, { limit: 20 }); - - const cases = new Set(diffs.map((d) => d.case)); - const scenarios = new Set(diffs.map((d) => d.scenario)); - - if (scenarios.size > 1) { - console.log(); - console.log("# By scenario"); - console.log(); - for (const scenario of scenarios) { - output(`## ${scenario}`, { scenarioFilter: scenario }); - } - } - - if (cases.size > 1) { - console.log(); - console.log("# By case"); - console.log(); - for (const caseName of cases) { - output(`## ${caseName}`, { caseFilter: caseName }); - } - } -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/bin/upload.js b/bin/upload.js deleted file mode 100644 index 21f8201bbc..0000000000 --- a/bin/upload.js +++ /dev/null @@ -1,98 +0,0 @@ -import { readFile, writeFile, stat } from "fs/promises"; -import { resolve, relative } from "path"; -import { fileURLToPath } from "url"; -import { runCommand } from "../lib/utils.js"; -import ncpCallback from "ncp"; -import { promisify } from "util"; - -const ncp = promisify(ncpCallback); - -const [, , name, token] = process.argv; -const GITHUB_ACTOR = process.env.GITHUB_ACTOR; - -if (!name) throw new Error("name argument missing"); - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -const run = (command, args) => runCommand(command, args, true); - -const dirExist = async (p) => { - try { - if ((await stat(p)).isDirectory()) return true; - } catch { - return false; - } -}; - -(async () => { - const targetDir = resolve(rootDir, ".gh-pages"); - if (!(await dirExist(targetDir))) { - await run("git", [ - "clone", - "--branch", - "gh-pages", - "--single-branch", - "--depth", - "1", - token - ? `https://${GITHUB_ACTOR}:${token}@github.com/webpack/benchmark.git` - : "https://github.com/webpack/benchmark", - ".gh-pages", - ]); - } - process.chdir(targetDir); - for (let i = 0; i < 21; i++) { - try { - await run("git", ["reset", "--hard", "origin/gh-pages"]); - await run("git", ["pull", "--rebase"]); - - console.log("== copy output files =="); - const indexFile = resolve(targetDir, "results", "index.txt"); - const files = new Set((await readFile(indexFile, "utf-8")).split("\n")); - files.delete(""); - await ncp( - resolve(rootDir, "output"), - resolve(targetDir, "results", name), - { - filter: (filename) => { - if (filename.endsWith(".json")) { - files.add( - `${name}/${relative( - resolve(rootDir, "output"), - filename - ).replace(/\\/g, "/")}` - ); - } - return true; - }, - } - ); - - console.log("== update index.txt =="); - await writeFile( - indexFile, - Array.from(files, (f) => `${f}\n`).join("") + "\n" - ); - - console.log("== commit =="); - await run("git", ["add", `results/${name}/*.json`, "results/index.txt"]); - try { - await run("git", ["commit", "-m", `"add ${name} results"`]); - } catch { - break; - } - - console.log("== push =="); - await run("git", ["push"]); - break; - } catch (e) { - await new Promise((resolve) => - setTimeout(resolve, Math.random() * 30000) - ); - if (i === 20) throw e; - } - } -})().catch((err) => { - process.exitCode = 1; - console.error(err.stack); -}); diff --git a/cases/all/package.json b/cases/all/package.json deleted file mode 100644 index a4f5e8a998..0000000000 --- a/cases/all/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "rome", - "scripts": { - "bench:setup": "ncp ../esbuild-three/src/base src/copy1 --clobber && ncp ../esbuild-three/src/base src/copy2 --clobber && ncp ../esbuild-three/src/base src/copy3 --clobber && ncp ../esbuild-three/src/base src/copy4 --clobber && ncp ../esbuild-three/src/base src/copy5 --clobber && ncp ../esbuild-three/src/base src/copy6 --clobber && ncp ../esbuild-three/src/base src/copy7 --clobber && ncp ../esbuild-three/src/base src/copy8 --clobber && ncp ../esbuild-three/src/base src/copy9 --clobber && ncp ../esbuild-three/src/base src/copy10 --clobber && node -e \"try { require('fs').statSync('src/rome') } catch { process.exitCode = 1 }\" || git clone --single-branch --branch v10.0.4-beta https://github.com/romejs/rome src/rome" - }, - "dependenciesDate": "2021-05-05", - "dependencies": { - "@atlaskit/editor-core": "^120.1.0", - "@atlaskit/media-core": "^31.1.0", - "@atlaskit/smart-card": "^13.0.0", - "@babel/runtime": "^7.12.13", - "@material-ui/core": "^4.11.3", - "@material-ui/icons": "^4.11.2", - "@material-ui/lab": "^4.0.0-alpha.57", - "acorn": "^8.0.5", - "assert": "^2.0.0", - "classnames": "^2.2.6", - "date-fns": "^2.17.0", - "jquery": "^3.5.1", - "lodash": "^4.17.20", - "lodash-es": "^4.17.20", - "moment": "^2.29.1", - "ncp": "^2.0.0", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "react-intl": "^2.6.0", - "redux": "^4.0.5", - "rxjs": "^5.5.0", - "underscore": "^1.12.0", - "uuid": "^8.3.2", - "vue": "^2.6.12", - "zone.js": "^0.11.3", - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "ts-loader": "*", - "typescript": "*", - "webpack": "*" - } -} diff --git a/cases/all/src/.gitignore b/cases/all/src/.gitignore deleted file mode 100644 index 419dd91897..0000000000 --- a/cases/all/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -copy* -rome diff --git a/cases/all/src/babel-runtime.js b/cases/all/src/babel-runtime.js deleted file mode 100644 index 371f4e7d05..0000000000 --- a/cases/all/src/babel-runtime.js +++ /dev/null @@ -1,331 +0,0 @@ -import _typeof from "@babel/runtime/helpers/typeof"; -import jsx from "@babel/runtime/helpers/jsx"; -import asyncIterator from "@babel/runtime/helpers/asyncIterator"; -import AwaitValue from "@babel/runtime/helpers/AwaitValue"; -import AsyncGenerator from "@babel/runtime/helpers/AsyncGenerator"; -import wrapAsyncGenerator from "@babel/runtime/helpers/wrapAsyncGenerator"; -import awaitAsyncGenerator from "@babel/runtime/helpers/awaitAsyncGenerator"; -import asyncGeneratorDelegate from "@babel/runtime/helpers/asyncGeneratorDelegate"; -import asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; -import classCallCheck from "@babel/runtime/helpers/classCallCheck"; -import createClass from "@babel/runtime/helpers/createClass"; -import defineEnumerableProperties from "@babel/runtime/helpers/defineEnumerableProperties"; -import defaults from "@babel/runtime/helpers/defaults"; -import defineProperty from "@babel/runtime/helpers/defineProperty"; -import _extends from "@babel/runtime/helpers/extends"; -import objectSpread from "@babel/runtime/helpers/objectSpread"; -import objectSpread2 from "@babel/runtime/helpers/objectSpread2"; -import inherits from "@babel/runtime/helpers/inherits"; -import inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; -import getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; -import setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf"; -import isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct"; -import construct from "@babel/runtime/helpers/construct"; -import isNativeFunction from "@babel/runtime/helpers/isNativeFunction"; -import wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper"; -import _instanceof from "@babel/runtime/helpers/instanceof"; -import interopRequireDefault from "@babel/runtime/helpers/interopRequireDefault"; -import interopRequireWildcard from "@babel/runtime/helpers/interopRequireWildcard"; -import newArrowCheck from "@babel/runtime/helpers/newArrowCheck"; -import objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty"; -import objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; -import objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; -import assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; -import possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; -import createSuper from "@babel/runtime/helpers/createSuper"; -import superPropBase from "@babel/runtime/helpers/superPropBase"; -import get from "@babel/runtime/helpers/get"; -import set from "@babel/runtime/helpers/set"; -import taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral"; -import taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; -import readOnlyError from "@babel/runtime/helpers/readOnlyError"; -import writeOnlyError from "@babel/runtime/helpers/writeOnlyError"; -import classNameTDZError from "@babel/runtime/helpers/classNameTDZError"; -import temporalUndefined from "@babel/runtime/helpers/temporalUndefined"; -import tdz from "@babel/runtime/helpers/tdz"; -import temporalRef from "@babel/runtime/helpers/temporalRef"; -import slicedToArray from "@babel/runtime/helpers/slicedToArray"; -import slicedToArrayLoose from "@babel/runtime/helpers/slicedToArrayLoose"; -import toArray from "@babel/runtime/helpers/toArray"; -import toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; -import arrayWithoutHoles from "@babel/runtime/helpers/arrayWithoutHoles"; -import arrayWithHoles from "@babel/runtime/helpers/arrayWithHoles"; -import maybeArrayLike from "@babel/runtime/helpers/maybeArrayLike"; -import iterableToArray from "@babel/runtime/helpers/iterableToArray"; -import iterableToArrayLimit from "@babel/runtime/helpers/iterableToArrayLimit"; -import iterableToArrayLimitLoose from "@babel/runtime/helpers/iterableToArrayLimitLoose"; -import unsupportedIterableToArray from "@babel/runtime/helpers/unsupportedIterableToArray"; -import arrayLikeToArray from "@babel/runtime/helpers/arrayLikeToArray"; -import nonIterableSpread from "@babel/runtime/helpers/nonIterableSpread"; -import nonIterableRest from "@babel/runtime/helpers/nonIterableRest"; -import createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper"; -import createForOfIteratorHelperLoose from "@babel/runtime/helpers/createForOfIteratorHelperLoose"; -import skipFirstGeneratorNext from "@babel/runtime/helpers/skipFirstGeneratorNext"; -import toPrimitive from "@babel/runtime/helpers/toPrimitive"; -import toPropertyKey from "@babel/runtime/helpers/toPropertyKey"; -import initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper"; -import initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; -import applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor"; -import classPrivateFieldLooseKey from "@babel/runtime/helpers/classPrivateFieldLooseKey"; -import classPrivateFieldLooseBase from "@babel/runtime/helpers/classPrivateFieldLooseBase"; -import classPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet"; -import classPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet"; -import classPrivateFieldDestructureSet from "@babel/runtime/helpers/classPrivateFieldDestructureSet"; -import classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/classStaticPrivateFieldSpecGet"; -import classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/classStaticPrivateFieldSpecSet"; -import classStaticPrivateMethodGet from "@babel/runtime/helpers/classStaticPrivateMethodGet"; -import classStaticPrivateMethodSet from "@babel/runtime/helpers/classStaticPrivateMethodSet"; -import decorate from "@babel/runtime/helpers/decorate"; -import classPrivateMethodGet from "@babel/runtime/helpers/classPrivateMethodGet"; -import classPrivateMethodSet from "@babel/runtime/helpers/classPrivateMethodSet"; -import wrapRegExp from "@babel/runtime/helpers/wrapRegExp"; -import esm_typeof from "@babel/runtime/helpers/esm/typeof"; -import esm_jsx from "@babel/runtime/helpers/esm/jsx"; -import esm_asyncIterator from "@babel/runtime/helpers/esm/asyncIterator"; -import esm_AwaitValue from "@babel/runtime/helpers/esm/AwaitValue"; -import esm_AsyncGenerator from "@babel/runtime/helpers/esm/AsyncGenerator"; -import esm_wrapAsyncGenerator from "@babel/runtime/helpers/esm/wrapAsyncGenerator"; -import esm_awaitAsyncGenerator from "@babel/runtime/helpers/esm/awaitAsyncGenerator"; -import esm_asyncGeneratorDelegate from "@babel/runtime/helpers/esm/asyncGeneratorDelegate"; -import esm_asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; -import esm_classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; -import esm_createClass from "@babel/runtime/helpers/esm/createClass"; -import esm_defineEnumerableProperties from "@babel/runtime/helpers/esm/defineEnumerableProperties"; -import esm_defaults from "@babel/runtime/helpers/esm/defaults"; -import esm_defineProperty from "@babel/runtime/helpers/esm/defineProperty"; -import esm_extends from "@babel/runtime/helpers/esm/extends"; -import esm_objectSpread from "@babel/runtime/helpers/esm/objectSpread"; -import esm_objectSpread2 from "@babel/runtime/helpers/esm/objectSpread2"; -import esm_inherits from "@babel/runtime/helpers/esm/inherits"; -import esm_inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose"; -import esm_getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import esm_setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -import esm_isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct"; -import esm_construct from "@babel/runtime/helpers/esm/construct"; -import esm_isNativeFunction from "@babel/runtime/helpers/esm/isNativeFunction"; -import esm_wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; -import esm_instanceof from "@babel/runtime/helpers/esm/instanceof"; -import esm_interopRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault"; -import esm_interopRequireWildcard from "@babel/runtime/helpers/esm/interopRequireWildcard"; -import esm_newArrowCheck from "@babel/runtime/helpers/esm/newArrowCheck"; -import esm_objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty"; -import esm_objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; -import esm_objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; -import esm_assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized"; -import esm_possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import esm_createSuper from "@babel/runtime/helpers/esm/createSuper"; -import esm_superPropBase from "@babel/runtime/helpers/esm/superPropBase"; -import esm_get from "@babel/runtime/helpers/esm/get"; -import esm_set from "@babel/runtime/helpers/esm/set"; -import esm_taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral"; -import esm_taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose"; -import esm_readOnlyError from "@babel/runtime/helpers/esm/readOnlyError"; -import esm_writeOnlyError from "@babel/runtime/helpers/esm/writeOnlyError"; -import esm_classNameTDZError from "@babel/runtime/helpers/esm/classNameTDZError"; -import esm_temporalUndefined from "@babel/runtime/helpers/esm/temporalUndefined"; -import esm_tdz from "@babel/runtime/helpers/esm/tdz"; -import esm_temporalRef from "@babel/runtime/helpers/esm/temporalRef"; -import esm_slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; -import esm_slicedToArrayLoose from "@babel/runtime/helpers/esm/slicedToArrayLoose"; -import esm_toArray from "@babel/runtime/helpers/esm/toArray"; -import esm_toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; -import esm_arrayWithoutHoles from "@babel/runtime/helpers/esm/arrayWithoutHoles"; -import esm_arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import esm_maybeArrayLike from "@babel/runtime/helpers/esm/maybeArrayLike"; -import esm_iterableToArray from "@babel/runtime/helpers/esm/iterableToArray"; -import esm_iterableToArrayLimit from "@babel/runtime/helpers/esm/iterableToArrayLimit"; -import esm_iterableToArrayLimitLoose from "@babel/runtime/helpers/esm/iterableToArrayLimitLoose"; -import esm_unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import esm_arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -import esm_nonIterableSpread from "@babel/runtime/helpers/esm/nonIterableSpread"; -import esm_nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -import esm_createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper"; -import esm_createForOfIteratorHelperLoose from "@babel/runtime/helpers/esm/createForOfIteratorHelperLoose"; -import esm_skipFirstGeneratorNext from "@babel/runtime/helpers/esm/skipFirstGeneratorNext"; -import esm_toPrimitive from "@babel/runtime/helpers/esm/toPrimitive"; -import esm_toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey"; -import esm_initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; -import esm_initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; -import esm_applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; -import esm_classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateFieldLooseKey"; -import esm_classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase"; -import esm_classPrivateFieldGet from "@babel/runtime/helpers/esm/classPrivateFieldGet"; -import esm_classPrivateFieldSet from "@babel/runtime/helpers/esm/classPrivateFieldSet"; -import esm_classPrivateFieldDestructureSet from "@babel/runtime/helpers/esm/classPrivateFieldDestructureSet"; -import esm_classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet"; -import esm_classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet"; -import esm_classStaticPrivateMethodGet from "@babel/runtime/helpers/esm/classStaticPrivateMethodGet"; -import esm_classStaticPrivateMethodSet from "@babel/runtime/helpers/esm/classStaticPrivateMethodSet"; -import esm_decorate from "@babel/runtime/helpers/esm/decorate"; -import esm_classPrivateMethodGet from "@babel/runtime/helpers/esm/classPrivateMethodGet"; -import esm_classPrivateMethodSet from "@babel/runtime/helpers/esm/classPrivateMethodSet"; -import esm_wrapRegExp from "@babel/runtime/helpers/esm/wrapRegExp"; -import _package from "@babel/runtime/package.json"; -import regenerator from "@babel/runtime/regenerator"; - -console.log( - _typeof, - jsx, - asyncIterator, - AwaitValue, - AsyncGenerator, - wrapAsyncGenerator, - awaitAsyncGenerator, - asyncGeneratorDelegate, - asyncToGenerator, - classCallCheck, - createClass, - defineEnumerableProperties, - defaults, - defineProperty, - _extends, - objectSpread, - objectSpread2, - inherits, - inheritsLoose, - getPrototypeOf, - setPrototypeOf, - isNativeReflectConstruct, - construct, - isNativeFunction, - wrapNativeSuper, - _instanceof, - interopRequireDefault, - interopRequireWildcard, - newArrowCheck, - objectDestructuringEmpty, - objectWithoutPropertiesLoose, - objectWithoutProperties, - assertThisInitialized, - possibleConstructorReturn, - createSuper, - superPropBase, - get, - set, - taggedTemplateLiteral, - taggedTemplateLiteralLoose, - readOnlyError, - writeOnlyError, - classNameTDZError, - temporalUndefined, - tdz, - temporalRef, - slicedToArray, - slicedToArrayLoose, - toArray, - toConsumableArray, - arrayWithoutHoles, - arrayWithHoles, - maybeArrayLike, - iterableToArray, - iterableToArrayLimit, - iterableToArrayLimitLoose, - unsupportedIterableToArray, - arrayLikeToArray, - nonIterableSpread, - nonIterableRest, - createForOfIteratorHelper, - createForOfIteratorHelperLoose, - skipFirstGeneratorNext, - toPrimitive, - toPropertyKey, - initializerWarningHelper, - initializerDefineProperty, - applyDecoratedDescriptor, - classPrivateFieldLooseKey, - classPrivateFieldLooseBase, - classPrivateFieldGet, - classPrivateFieldSet, - classPrivateFieldDestructureSet, - classStaticPrivateFieldSpecGet, - classStaticPrivateFieldSpecSet, - classStaticPrivateMethodGet, - classStaticPrivateMethodSet, - decorate, - classPrivateMethodGet, - classPrivateMethodSet, - wrapRegExp, - esm_typeof, - esm_jsx, - esm_asyncIterator, - esm_AwaitValue, - esm_AsyncGenerator, - esm_wrapAsyncGenerator, - esm_awaitAsyncGenerator, - esm_asyncGeneratorDelegate, - esm_asyncToGenerator, - esm_classCallCheck, - esm_createClass, - esm_defineEnumerableProperties, - esm_defaults, - esm_defineProperty, - esm_extends, - esm_objectSpread, - esm_objectSpread2, - esm_inherits, - esm_inheritsLoose, - esm_getPrototypeOf, - esm_setPrototypeOf, - esm_isNativeReflectConstruct, - esm_construct, - esm_isNativeFunction, - esm_wrapNativeSuper, - esm_instanceof, - esm_interopRequireDefault, - esm_interopRequireWildcard, - esm_newArrowCheck, - esm_objectDestructuringEmpty, - esm_objectWithoutPropertiesLoose, - esm_objectWithoutProperties, - esm_assertThisInitialized, - esm_possibleConstructorReturn, - esm_createSuper, - esm_superPropBase, - esm_get, - esm_set, - esm_taggedTemplateLiteral, - esm_taggedTemplateLiteralLoose, - esm_readOnlyError, - esm_writeOnlyError, - esm_classNameTDZError, - esm_temporalUndefined, - esm_tdz, - esm_temporalRef, - esm_slicedToArray, - esm_slicedToArrayLoose, - esm_toArray, - esm_toConsumableArray, - esm_arrayWithoutHoles, - esm_arrayWithHoles, - esm_maybeArrayLike, - esm_iterableToArray, - esm_iterableToArrayLimit, - esm_iterableToArrayLimitLoose, - esm_unsupportedIterableToArray, - esm_arrayLikeToArray, - esm_nonIterableSpread, - esm_nonIterableRest, - esm_createForOfIteratorHelper, - esm_createForOfIteratorHelperLoose, - esm_skipFirstGeneratorNext, - esm_toPrimitive, - esm_toPropertyKey, - esm_initializerWarningHelper, - esm_initializerDefineProperty, - esm_applyDecoratedDescriptor, - esm_classPrivateFieldLooseKey, - esm_classPrivateFieldLooseBase, - esm_classPrivateFieldGet, - esm_classPrivateFieldSet, - esm_classPrivateFieldDestructureSet, - esm_classStaticPrivateFieldSpecGet, - esm_classStaticPrivateFieldSpecSet, - esm_classStaticPrivateMethodGet, - esm_classStaticPrivateMethodSet, - esm_decorate, - esm_classPrivateMethodGet, - esm_classPrivateMethodSet, - esm_wrapRegExp, - _package, - regenerator -); diff --git a/cases/all/src/index.js b/cases/all/src/index.js deleted file mode 100644 index 1a1b028ee4..0000000000 --- a/cases/all/src/index.js +++ /dev/null @@ -1,93 +0,0 @@ -// common-libs -import "./babel-runtime"; -import * as core from "@material-ui/core"; -import * as lab from "@material-ui/lab"; -import * as icons from "@material-ui/icons"; -console.log(core, lab, icons); -import "acorn"; -import "classnames"; -import * as dateFn from "date-fns"; -import * as dateFnEsm from "date-fns/esm"; -console.log(dateFn, dateFnEsm); -import "jquery"; -import "lodash"; -import * as lodashEs from "lodash-es"; -console.log(lodashEs); -import "moment"; -import "react"; -import "react-dom"; -import "redux"; -import * as rxjs from "rxjs"; -console.log(rxjs); -import * as underscore from "underscore"; -import * as underscoreModules from "underscore/modules/index-all"; -console.log(underscore, underscoreModules); -import { NIL, parse, stringify, v1, v3, v4, v5, validate, version } from "uuid"; -console.log(NIL, parse, stringify, v1, v3, v4, v5, validate, version); -import "vue"; -import "zone.js"; - -// common-libs-chunks -import("./babel-runtime"); -import("@material-ui/core"); -import("@material-ui/lab"); -import("@material-ui/icons"); -import("acorn"); -import("classnames"); -import("date-fns"); -import("date-fns/esm"); -import("jquery"); -import("lodash"); -import("lodash-es"); -import("moment"); -import("react"); -import("react-dom"); -import("redux"); -import("rxjs"); -import("underscore"); -import("underscore/modules/index-all"); -import("uuid"); -import("vue"); -import("zone.js"); - -// atlaskit-editor -// benchmark from parcel-benchmark -import React from "react"; -import ReactDOM from "react-dom"; -import { Editor } from "@atlaskit/editor-core"; - -ReactDOM.render( - React.createElement(Editor, { - placeholder: "editor", - appearance: "comment", - test: "Hello World", - }), - document.getElementById("react-root") -); - -// esbuild-three -import * as copy1 from "./copy1/Three.js"; -export { copy1 }; -import * as copy2 from "./copy2/Three.js"; -export { copy2 }; -import * as copy3 from "./copy3/Three.js"; -export { copy3 }; -import * as copy4 from "./copy4/Three.js"; -export { copy4 }; -import * as copy5 from "./copy5/Three.js"; -export { copy5 }; -import * as copy6 from "./copy6/Three.js"; -export { copy6 }; -import * as copy7 from "./copy7/Three.js"; -export { copy7 }; -import * as copy8 from "./copy8/Three.js"; -export { copy8 }; -import * as copy9 from "./copy9/Three.js"; -export { copy9 }; -import * as copy10 from "./copy10/Three.js"; -export { copy10 }; - -// rome -import "./rome.ts"; - -console.log("Hello World"); diff --git a/cases/all/src/rome.ts b/cases/all/src/rome.ts deleted file mode 100644 index 8516af7e84..0000000000 --- a/cases/all/src/rome.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "./rome/internal/cli/cli"; - -console.log("Hello World"); diff --git a/cases/all/tsconfig.json b/cases/all/tsconfig.json deleted file mode 100644 index 83208c7687..0000000000 --- a/cases/all/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "moduleResolution": "node", - "target": "es2019", - "module": "esnext", - "baseUrl": "." - }, - "include": [ - "./src/rome.ts" - ], - "paths": { - "@internal/*": [ - "src/rome/internal/*" - ], - "@internal/virtual-*": [ - "src/rome/internal/virtual-packages/*" - ], - "rome": [ - "src/rome/internal/virtual-packages/rome" - ] - } -} diff --git a/cases/all/webpack.config.js b/cases/all/webpack.config.js deleted file mode 100644 index 508b091598..0000000000 --- a/cases/all/webpack.config.js +++ /dev/null @@ -1,43 +0,0 @@ -const { resolve } = require("path"); -/** @type {import("webpack").Configuration} */ -module.exports = { - resolve: { - extensions: [".ts", ".tsx", ".js"], - alias: { - "@internal": resolve(__dirname, "src/rome/internal"), - // rome: resolve(__dirname, "src/rome/internal/virtual-packages/rome"), - }, - }, - output: { - hashFunction: "xxhash64", - }, - optimization: { - sideEffects: false, - }, - experiments: { - cacheUnaffected: true, - }, - module: { - unsafeCache: true, - rules: [ - { - test: /\.tsx?$/, - loader: "ts-loader", - options: { transpileOnly: true }, - }, - ], - }, -}; -if (require("webpack").version.startsWith("5")) { - module.exports.ignoreWarnings = [ - { - message: /export.+was not found|only default export is available soon/, - }, - ]; -} - -module.exports.plugins = module.exports.plugins || []; -module.exports.plugins.push(new (require("../../lib/build-plugin.cjs"))()); - -module.exports.plugins = module.exports.plugins || []; -module.exports.plugins.push(new (require("../../lib/build-plugin.cjs"))()); diff --git a/cases/atlaskit-editor/package.json b/cases/atlaskit-editor/package.json deleted file mode 100644 index 7898cae51e..0000000000 --- a/cases/atlaskit-editor/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "atlaskit-editor", - "dependenciesDate": "2021-05-05", - "dependencies": { - "@atlaskit/editor-core": "^120.1.0", - "@atlaskit/media-core": "^31.1.0", - "@atlaskit/smart-card": "^13.0.0", - "assert": "^2.0.0", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-intl": "^2.6.0", - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "webpack": "*" - } -} diff --git a/cases/atlaskit-editor/src/index.js b/cases/atlaskit-editor/src/index.js deleted file mode 100644 index ff7df71f42..0000000000 --- a/cases/atlaskit-editor/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -// benchmark from parcel-benchmark -import React from "react"; -import ReactDOM from "react-dom"; -import { Editor } from "@atlaskit/editor-core"; - -ReactDOM.render( - React.createElement(Editor, { - placeholder: "editor", - appearance: "comment", - test: "Hello World", - }), - document.getElementById("react-root") -); diff --git a/cases/atlaskit-editor/webpack.config.js b/cases/atlaskit-editor/webpack.config.js deleted file mode 100644 index f053ebf797..0000000000 --- a/cases/atlaskit-editor/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/cases/common-libs-chunks/package.json b/cases/common-libs-chunks/package.json deleted file mode 100644 index 72f912ff28..0000000000 --- a/cases/common-libs-chunks/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "common-libs", - "dependenciesDate": "2021-02-15", - "dependencies": { - "@babel/runtime": "^7.12.13", - "@material-ui/core": "^4.11.3", - "@material-ui/icons": "^4.11.2", - "@material-ui/lab": "^4.0.0-alpha.57", - "acorn": "^8.0.5", - "classnames": "^2.2.6", - "date-fns": "^2.17.0", - "jquery": "^3.5.1", - "lodash": "^4.17.20", - "lodash-es": "^4.17.20", - "moment": "^2.29.1", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "redux": "^4.0.5", - "rxjs": "^6.6.3", - "underscore": "^1.12.0", - "uuid": "^8.3.2", - "vue": "^2.6.12", - "zone.js": "^0.11.3", - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "webpack": "*" - } -} diff --git a/cases/common-libs-chunks/src/babel-runtime.js b/cases/common-libs-chunks/src/babel-runtime.js deleted file mode 100644 index 371f4e7d05..0000000000 --- a/cases/common-libs-chunks/src/babel-runtime.js +++ /dev/null @@ -1,331 +0,0 @@ -import _typeof from "@babel/runtime/helpers/typeof"; -import jsx from "@babel/runtime/helpers/jsx"; -import asyncIterator from "@babel/runtime/helpers/asyncIterator"; -import AwaitValue from "@babel/runtime/helpers/AwaitValue"; -import AsyncGenerator from "@babel/runtime/helpers/AsyncGenerator"; -import wrapAsyncGenerator from "@babel/runtime/helpers/wrapAsyncGenerator"; -import awaitAsyncGenerator from "@babel/runtime/helpers/awaitAsyncGenerator"; -import asyncGeneratorDelegate from "@babel/runtime/helpers/asyncGeneratorDelegate"; -import asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; -import classCallCheck from "@babel/runtime/helpers/classCallCheck"; -import createClass from "@babel/runtime/helpers/createClass"; -import defineEnumerableProperties from "@babel/runtime/helpers/defineEnumerableProperties"; -import defaults from "@babel/runtime/helpers/defaults"; -import defineProperty from "@babel/runtime/helpers/defineProperty"; -import _extends from "@babel/runtime/helpers/extends"; -import objectSpread from "@babel/runtime/helpers/objectSpread"; -import objectSpread2 from "@babel/runtime/helpers/objectSpread2"; -import inherits from "@babel/runtime/helpers/inherits"; -import inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; -import getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; -import setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf"; -import isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct"; -import construct from "@babel/runtime/helpers/construct"; -import isNativeFunction from "@babel/runtime/helpers/isNativeFunction"; -import wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper"; -import _instanceof from "@babel/runtime/helpers/instanceof"; -import interopRequireDefault from "@babel/runtime/helpers/interopRequireDefault"; -import interopRequireWildcard from "@babel/runtime/helpers/interopRequireWildcard"; -import newArrowCheck from "@babel/runtime/helpers/newArrowCheck"; -import objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty"; -import objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; -import objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; -import assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; -import possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; -import createSuper from "@babel/runtime/helpers/createSuper"; -import superPropBase from "@babel/runtime/helpers/superPropBase"; -import get from "@babel/runtime/helpers/get"; -import set from "@babel/runtime/helpers/set"; -import taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral"; -import taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; -import readOnlyError from "@babel/runtime/helpers/readOnlyError"; -import writeOnlyError from "@babel/runtime/helpers/writeOnlyError"; -import classNameTDZError from "@babel/runtime/helpers/classNameTDZError"; -import temporalUndefined from "@babel/runtime/helpers/temporalUndefined"; -import tdz from "@babel/runtime/helpers/tdz"; -import temporalRef from "@babel/runtime/helpers/temporalRef"; -import slicedToArray from "@babel/runtime/helpers/slicedToArray"; -import slicedToArrayLoose from "@babel/runtime/helpers/slicedToArrayLoose"; -import toArray from "@babel/runtime/helpers/toArray"; -import toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; -import arrayWithoutHoles from "@babel/runtime/helpers/arrayWithoutHoles"; -import arrayWithHoles from "@babel/runtime/helpers/arrayWithHoles"; -import maybeArrayLike from "@babel/runtime/helpers/maybeArrayLike"; -import iterableToArray from "@babel/runtime/helpers/iterableToArray"; -import iterableToArrayLimit from "@babel/runtime/helpers/iterableToArrayLimit"; -import iterableToArrayLimitLoose from "@babel/runtime/helpers/iterableToArrayLimitLoose"; -import unsupportedIterableToArray from "@babel/runtime/helpers/unsupportedIterableToArray"; -import arrayLikeToArray from "@babel/runtime/helpers/arrayLikeToArray"; -import nonIterableSpread from "@babel/runtime/helpers/nonIterableSpread"; -import nonIterableRest from "@babel/runtime/helpers/nonIterableRest"; -import createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper"; -import createForOfIteratorHelperLoose from "@babel/runtime/helpers/createForOfIteratorHelperLoose"; -import skipFirstGeneratorNext from "@babel/runtime/helpers/skipFirstGeneratorNext"; -import toPrimitive from "@babel/runtime/helpers/toPrimitive"; -import toPropertyKey from "@babel/runtime/helpers/toPropertyKey"; -import initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper"; -import initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; -import applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor"; -import classPrivateFieldLooseKey from "@babel/runtime/helpers/classPrivateFieldLooseKey"; -import classPrivateFieldLooseBase from "@babel/runtime/helpers/classPrivateFieldLooseBase"; -import classPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet"; -import classPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet"; -import classPrivateFieldDestructureSet from "@babel/runtime/helpers/classPrivateFieldDestructureSet"; -import classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/classStaticPrivateFieldSpecGet"; -import classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/classStaticPrivateFieldSpecSet"; -import classStaticPrivateMethodGet from "@babel/runtime/helpers/classStaticPrivateMethodGet"; -import classStaticPrivateMethodSet from "@babel/runtime/helpers/classStaticPrivateMethodSet"; -import decorate from "@babel/runtime/helpers/decorate"; -import classPrivateMethodGet from "@babel/runtime/helpers/classPrivateMethodGet"; -import classPrivateMethodSet from "@babel/runtime/helpers/classPrivateMethodSet"; -import wrapRegExp from "@babel/runtime/helpers/wrapRegExp"; -import esm_typeof from "@babel/runtime/helpers/esm/typeof"; -import esm_jsx from "@babel/runtime/helpers/esm/jsx"; -import esm_asyncIterator from "@babel/runtime/helpers/esm/asyncIterator"; -import esm_AwaitValue from "@babel/runtime/helpers/esm/AwaitValue"; -import esm_AsyncGenerator from "@babel/runtime/helpers/esm/AsyncGenerator"; -import esm_wrapAsyncGenerator from "@babel/runtime/helpers/esm/wrapAsyncGenerator"; -import esm_awaitAsyncGenerator from "@babel/runtime/helpers/esm/awaitAsyncGenerator"; -import esm_asyncGeneratorDelegate from "@babel/runtime/helpers/esm/asyncGeneratorDelegate"; -import esm_asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; -import esm_classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; -import esm_createClass from "@babel/runtime/helpers/esm/createClass"; -import esm_defineEnumerableProperties from "@babel/runtime/helpers/esm/defineEnumerableProperties"; -import esm_defaults from "@babel/runtime/helpers/esm/defaults"; -import esm_defineProperty from "@babel/runtime/helpers/esm/defineProperty"; -import esm_extends from "@babel/runtime/helpers/esm/extends"; -import esm_objectSpread from "@babel/runtime/helpers/esm/objectSpread"; -import esm_objectSpread2 from "@babel/runtime/helpers/esm/objectSpread2"; -import esm_inherits from "@babel/runtime/helpers/esm/inherits"; -import esm_inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose"; -import esm_getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import esm_setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -import esm_isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct"; -import esm_construct from "@babel/runtime/helpers/esm/construct"; -import esm_isNativeFunction from "@babel/runtime/helpers/esm/isNativeFunction"; -import esm_wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; -import esm_instanceof from "@babel/runtime/helpers/esm/instanceof"; -import esm_interopRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault"; -import esm_interopRequireWildcard from "@babel/runtime/helpers/esm/interopRequireWildcard"; -import esm_newArrowCheck from "@babel/runtime/helpers/esm/newArrowCheck"; -import esm_objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty"; -import esm_objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; -import esm_objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; -import esm_assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized"; -import esm_possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import esm_createSuper from "@babel/runtime/helpers/esm/createSuper"; -import esm_superPropBase from "@babel/runtime/helpers/esm/superPropBase"; -import esm_get from "@babel/runtime/helpers/esm/get"; -import esm_set from "@babel/runtime/helpers/esm/set"; -import esm_taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral"; -import esm_taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose"; -import esm_readOnlyError from "@babel/runtime/helpers/esm/readOnlyError"; -import esm_writeOnlyError from "@babel/runtime/helpers/esm/writeOnlyError"; -import esm_classNameTDZError from "@babel/runtime/helpers/esm/classNameTDZError"; -import esm_temporalUndefined from "@babel/runtime/helpers/esm/temporalUndefined"; -import esm_tdz from "@babel/runtime/helpers/esm/tdz"; -import esm_temporalRef from "@babel/runtime/helpers/esm/temporalRef"; -import esm_slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; -import esm_slicedToArrayLoose from "@babel/runtime/helpers/esm/slicedToArrayLoose"; -import esm_toArray from "@babel/runtime/helpers/esm/toArray"; -import esm_toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; -import esm_arrayWithoutHoles from "@babel/runtime/helpers/esm/arrayWithoutHoles"; -import esm_arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import esm_maybeArrayLike from "@babel/runtime/helpers/esm/maybeArrayLike"; -import esm_iterableToArray from "@babel/runtime/helpers/esm/iterableToArray"; -import esm_iterableToArrayLimit from "@babel/runtime/helpers/esm/iterableToArrayLimit"; -import esm_iterableToArrayLimitLoose from "@babel/runtime/helpers/esm/iterableToArrayLimitLoose"; -import esm_unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import esm_arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -import esm_nonIterableSpread from "@babel/runtime/helpers/esm/nonIterableSpread"; -import esm_nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -import esm_createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper"; -import esm_createForOfIteratorHelperLoose from "@babel/runtime/helpers/esm/createForOfIteratorHelperLoose"; -import esm_skipFirstGeneratorNext from "@babel/runtime/helpers/esm/skipFirstGeneratorNext"; -import esm_toPrimitive from "@babel/runtime/helpers/esm/toPrimitive"; -import esm_toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey"; -import esm_initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; -import esm_initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; -import esm_applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; -import esm_classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateFieldLooseKey"; -import esm_classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase"; -import esm_classPrivateFieldGet from "@babel/runtime/helpers/esm/classPrivateFieldGet"; -import esm_classPrivateFieldSet from "@babel/runtime/helpers/esm/classPrivateFieldSet"; -import esm_classPrivateFieldDestructureSet from "@babel/runtime/helpers/esm/classPrivateFieldDestructureSet"; -import esm_classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet"; -import esm_classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet"; -import esm_classStaticPrivateMethodGet from "@babel/runtime/helpers/esm/classStaticPrivateMethodGet"; -import esm_classStaticPrivateMethodSet from "@babel/runtime/helpers/esm/classStaticPrivateMethodSet"; -import esm_decorate from "@babel/runtime/helpers/esm/decorate"; -import esm_classPrivateMethodGet from "@babel/runtime/helpers/esm/classPrivateMethodGet"; -import esm_classPrivateMethodSet from "@babel/runtime/helpers/esm/classPrivateMethodSet"; -import esm_wrapRegExp from "@babel/runtime/helpers/esm/wrapRegExp"; -import _package from "@babel/runtime/package.json"; -import regenerator from "@babel/runtime/regenerator"; - -console.log( - _typeof, - jsx, - asyncIterator, - AwaitValue, - AsyncGenerator, - wrapAsyncGenerator, - awaitAsyncGenerator, - asyncGeneratorDelegate, - asyncToGenerator, - classCallCheck, - createClass, - defineEnumerableProperties, - defaults, - defineProperty, - _extends, - objectSpread, - objectSpread2, - inherits, - inheritsLoose, - getPrototypeOf, - setPrototypeOf, - isNativeReflectConstruct, - construct, - isNativeFunction, - wrapNativeSuper, - _instanceof, - interopRequireDefault, - interopRequireWildcard, - newArrowCheck, - objectDestructuringEmpty, - objectWithoutPropertiesLoose, - objectWithoutProperties, - assertThisInitialized, - possibleConstructorReturn, - createSuper, - superPropBase, - get, - set, - taggedTemplateLiteral, - taggedTemplateLiteralLoose, - readOnlyError, - writeOnlyError, - classNameTDZError, - temporalUndefined, - tdz, - temporalRef, - slicedToArray, - slicedToArrayLoose, - toArray, - toConsumableArray, - arrayWithoutHoles, - arrayWithHoles, - maybeArrayLike, - iterableToArray, - iterableToArrayLimit, - iterableToArrayLimitLoose, - unsupportedIterableToArray, - arrayLikeToArray, - nonIterableSpread, - nonIterableRest, - createForOfIteratorHelper, - createForOfIteratorHelperLoose, - skipFirstGeneratorNext, - toPrimitive, - toPropertyKey, - initializerWarningHelper, - initializerDefineProperty, - applyDecoratedDescriptor, - classPrivateFieldLooseKey, - classPrivateFieldLooseBase, - classPrivateFieldGet, - classPrivateFieldSet, - classPrivateFieldDestructureSet, - classStaticPrivateFieldSpecGet, - classStaticPrivateFieldSpecSet, - classStaticPrivateMethodGet, - classStaticPrivateMethodSet, - decorate, - classPrivateMethodGet, - classPrivateMethodSet, - wrapRegExp, - esm_typeof, - esm_jsx, - esm_asyncIterator, - esm_AwaitValue, - esm_AsyncGenerator, - esm_wrapAsyncGenerator, - esm_awaitAsyncGenerator, - esm_asyncGeneratorDelegate, - esm_asyncToGenerator, - esm_classCallCheck, - esm_createClass, - esm_defineEnumerableProperties, - esm_defaults, - esm_defineProperty, - esm_extends, - esm_objectSpread, - esm_objectSpread2, - esm_inherits, - esm_inheritsLoose, - esm_getPrototypeOf, - esm_setPrototypeOf, - esm_isNativeReflectConstruct, - esm_construct, - esm_isNativeFunction, - esm_wrapNativeSuper, - esm_instanceof, - esm_interopRequireDefault, - esm_interopRequireWildcard, - esm_newArrowCheck, - esm_objectDestructuringEmpty, - esm_objectWithoutPropertiesLoose, - esm_objectWithoutProperties, - esm_assertThisInitialized, - esm_possibleConstructorReturn, - esm_createSuper, - esm_superPropBase, - esm_get, - esm_set, - esm_taggedTemplateLiteral, - esm_taggedTemplateLiteralLoose, - esm_readOnlyError, - esm_writeOnlyError, - esm_classNameTDZError, - esm_temporalUndefined, - esm_tdz, - esm_temporalRef, - esm_slicedToArray, - esm_slicedToArrayLoose, - esm_toArray, - esm_toConsumableArray, - esm_arrayWithoutHoles, - esm_arrayWithHoles, - esm_maybeArrayLike, - esm_iterableToArray, - esm_iterableToArrayLimit, - esm_iterableToArrayLimitLoose, - esm_unsupportedIterableToArray, - esm_arrayLikeToArray, - esm_nonIterableSpread, - esm_nonIterableRest, - esm_createForOfIteratorHelper, - esm_createForOfIteratorHelperLoose, - esm_skipFirstGeneratorNext, - esm_toPrimitive, - esm_toPropertyKey, - esm_initializerWarningHelper, - esm_initializerDefineProperty, - esm_applyDecoratedDescriptor, - esm_classPrivateFieldLooseKey, - esm_classPrivateFieldLooseBase, - esm_classPrivateFieldGet, - esm_classPrivateFieldSet, - esm_classPrivateFieldDestructureSet, - esm_classStaticPrivateFieldSpecGet, - esm_classStaticPrivateFieldSpecSet, - esm_classStaticPrivateMethodGet, - esm_classStaticPrivateMethodSet, - esm_decorate, - esm_classPrivateMethodGet, - esm_classPrivateMethodSet, - esm_wrapRegExp, - _package, - regenerator -); diff --git a/cases/common-libs-chunks/src/index.js b/cases/common-libs-chunks/src/index.js deleted file mode 100644 index fdc6a4a025..0000000000 --- a/cases/common-libs-chunks/src/index.js +++ /dev/null @@ -1,23 +0,0 @@ -import("./babel-runtime"); -import("@material-ui/core"); -import("@material-ui/lab"); -import("@material-ui/icons"); -import("acorn"); -import("classnames"); -import("date-fns"); -import("date-fns/esm"); -import("jquery"); -import("lodash"); -import("lodash-es"); -import("moment"); -import("react"); -import("react-dom"); -import("redux"); -import("rxjs"); -import("underscore"); -import("underscore/modules"); -import("uuid"); -import("vue"); -import("zone.js"); - -console.log("Hello World"); diff --git a/cases/common-libs-chunks/webpack.config.js b/cases/common-libs-chunks/webpack.config.js deleted file mode 100644 index f053ebf797..0000000000 --- a/cases/common-libs-chunks/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/cases/common-libs/package.json b/cases/common-libs/package.json deleted file mode 100644 index 72f912ff28..0000000000 --- a/cases/common-libs/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "common-libs", - "dependenciesDate": "2021-02-15", - "dependencies": { - "@babel/runtime": "^7.12.13", - "@material-ui/core": "^4.11.3", - "@material-ui/icons": "^4.11.2", - "@material-ui/lab": "^4.0.0-alpha.57", - "acorn": "^8.0.5", - "classnames": "^2.2.6", - "date-fns": "^2.17.0", - "jquery": "^3.5.1", - "lodash": "^4.17.20", - "lodash-es": "^4.17.20", - "moment": "^2.29.1", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "redux": "^4.0.5", - "rxjs": "^6.6.3", - "underscore": "^1.12.0", - "uuid": "^8.3.2", - "vue": "^2.6.12", - "zone.js": "^0.11.3", - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "webpack": "*" - } -} diff --git a/cases/common-libs/src/babel-runtime.js b/cases/common-libs/src/babel-runtime.js deleted file mode 100644 index 371f4e7d05..0000000000 --- a/cases/common-libs/src/babel-runtime.js +++ /dev/null @@ -1,331 +0,0 @@ -import _typeof from "@babel/runtime/helpers/typeof"; -import jsx from "@babel/runtime/helpers/jsx"; -import asyncIterator from "@babel/runtime/helpers/asyncIterator"; -import AwaitValue from "@babel/runtime/helpers/AwaitValue"; -import AsyncGenerator from "@babel/runtime/helpers/AsyncGenerator"; -import wrapAsyncGenerator from "@babel/runtime/helpers/wrapAsyncGenerator"; -import awaitAsyncGenerator from "@babel/runtime/helpers/awaitAsyncGenerator"; -import asyncGeneratorDelegate from "@babel/runtime/helpers/asyncGeneratorDelegate"; -import asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; -import classCallCheck from "@babel/runtime/helpers/classCallCheck"; -import createClass from "@babel/runtime/helpers/createClass"; -import defineEnumerableProperties from "@babel/runtime/helpers/defineEnumerableProperties"; -import defaults from "@babel/runtime/helpers/defaults"; -import defineProperty from "@babel/runtime/helpers/defineProperty"; -import _extends from "@babel/runtime/helpers/extends"; -import objectSpread from "@babel/runtime/helpers/objectSpread"; -import objectSpread2 from "@babel/runtime/helpers/objectSpread2"; -import inherits from "@babel/runtime/helpers/inherits"; -import inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; -import getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; -import setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf"; -import isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct"; -import construct from "@babel/runtime/helpers/construct"; -import isNativeFunction from "@babel/runtime/helpers/isNativeFunction"; -import wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper"; -import _instanceof from "@babel/runtime/helpers/instanceof"; -import interopRequireDefault from "@babel/runtime/helpers/interopRequireDefault"; -import interopRequireWildcard from "@babel/runtime/helpers/interopRequireWildcard"; -import newArrowCheck from "@babel/runtime/helpers/newArrowCheck"; -import objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty"; -import objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; -import objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; -import assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; -import possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; -import createSuper from "@babel/runtime/helpers/createSuper"; -import superPropBase from "@babel/runtime/helpers/superPropBase"; -import get from "@babel/runtime/helpers/get"; -import set from "@babel/runtime/helpers/set"; -import taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral"; -import taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; -import readOnlyError from "@babel/runtime/helpers/readOnlyError"; -import writeOnlyError from "@babel/runtime/helpers/writeOnlyError"; -import classNameTDZError from "@babel/runtime/helpers/classNameTDZError"; -import temporalUndefined from "@babel/runtime/helpers/temporalUndefined"; -import tdz from "@babel/runtime/helpers/tdz"; -import temporalRef from "@babel/runtime/helpers/temporalRef"; -import slicedToArray from "@babel/runtime/helpers/slicedToArray"; -import slicedToArrayLoose from "@babel/runtime/helpers/slicedToArrayLoose"; -import toArray from "@babel/runtime/helpers/toArray"; -import toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; -import arrayWithoutHoles from "@babel/runtime/helpers/arrayWithoutHoles"; -import arrayWithHoles from "@babel/runtime/helpers/arrayWithHoles"; -import maybeArrayLike from "@babel/runtime/helpers/maybeArrayLike"; -import iterableToArray from "@babel/runtime/helpers/iterableToArray"; -import iterableToArrayLimit from "@babel/runtime/helpers/iterableToArrayLimit"; -import iterableToArrayLimitLoose from "@babel/runtime/helpers/iterableToArrayLimitLoose"; -import unsupportedIterableToArray from "@babel/runtime/helpers/unsupportedIterableToArray"; -import arrayLikeToArray from "@babel/runtime/helpers/arrayLikeToArray"; -import nonIterableSpread from "@babel/runtime/helpers/nonIterableSpread"; -import nonIterableRest from "@babel/runtime/helpers/nonIterableRest"; -import createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper"; -import createForOfIteratorHelperLoose from "@babel/runtime/helpers/createForOfIteratorHelperLoose"; -import skipFirstGeneratorNext from "@babel/runtime/helpers/skipFirstGeneratorNext"; -import toPrimitive from "@babel/runtime/helpers/toPrimitive"; -import toPropertyKey from "@babel/runtime/helpers/toPropertyKey"; -import initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper"; -import initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty"; -import applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor"; -import classPrivateFieldLooseKey from "@babel/runtime/helpers/classPrivateFieldLooseKey"; -import classPrivateFieldLooseBase from "@babel/runtime/helpers/classPrivateFieldLooseBase"; -import classPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet"; -import classPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet"; -import classPrivateFieldDestructureSet from "@babel/runtime/helpers/classPrivateFieldDestructureSet"; -import classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/classStaticPrivateFieldSpecGet"; -import classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/classStaticPrivateFieldSpecSet"; -import classStaticPrivateMethodGet from "@babel/runtime/helpers/classStaticPrivateMethodGet"; -import classStaticPrivateMethodSet from "@babel/runtime/helpers/classStaticPrivateMethodSet"; -import decorate from "@babel/runtime/helpers/decorate"; -import classPrivateMethodGet from "@babel/runtime/helpers/classPrivateMethodGet"; -import classPrivateMethodSet from "@babel/runtime/helpers/classPrivateMethodSet"; -import wrapRegExp from "@babel/runtime/helpers/wrapRegExp"; -import esm_typeof from "@babel/runtime/helpers/esm/typeof"; -import esm_jsx from "@babel/runtime/helpers/esm/jsx"; -import esm_asyncIterator from "@babel/runtime/helpers/esm/asyncIterator"; -import esm_AwaitValue from "@babel/runtime/helpers/esm/AwaitValue"; -import esm_AsyncGenerator from "@babel/runtime/helpers/esm/AsyncGenerator"; -import esm_wrapAsyncGenerator from "@babel/runtime/helpers/esm/wrapAsyncGenerator"; -import esm_awaitAsyncGenerator from "@babel/runtime/helpers/esm/awaitAsyncGenerator"; -import esm_asyncGeneratorDelegate from "@babel/runtime/helpers/esm/asyncGeneratorDelegate"; -import esm_asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; -import esm_classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; -import esm_createClass from "@babel/runtime/helpers/esm/createClass"; -import esm_defineEnumerableProperties from "@babel/runtime/helpers/esm/defineEnumerableProperties"; -import esm_defaults from "@babel/runtime/helpers/esm/defaults"; -import esm_defineProperty from "@babel/runtime/helpers/esm/defineProperty"; -import esm_extends from "@babel/runtime/helpers/esm/extends"; -import esm_objectSpread from "@babel/runtime/helpers/esm/objectSpread"; -import esm_objectSpread2 from "@babel/runtime/helpers/esm/objectSpread2"; -import esm_inherits from "@babel/runtime/helpers/esm/inherits"; -import esm_inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose"; -import esm_getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import esm_setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -import esm_isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct"; -import esm_construct from "@babel/runtime/helpers/esm/construct"; -import esm_isNativeFunction from "@babel/runtime/helpers/esm/isNativeFunction"; -import esm_wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; -import esm_instanceof from "@babel/runtime/helpers/esm/instanceof"; -import esm_interopRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault"; -import esm_interopRequireWildcard from "@babel/runtime/helpers/esm/interopRequireWildcard"; -import esm_newArrowCheck from "@babel/runtime/helpers/esm/newArrowCheck"; -import esm_objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty"; -import esm_objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; -import esm_objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; -import esm_assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized"; -import esm_possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import esm_createSuper from "@babel/runtime/helpers/esm/createSuper"; -import esm_superPropBase from "@babel/runtime/helpers/esm/superPropBase"; -import esm_get from "@babel/runtime/helpers/esm/get"; -import esm_set from "@babel/runtime/helpers/esm/set"; -import esm_taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral"; -import esm_taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose"; -import esm_readOnlyError from "@babel/runtime/helpers/esm/readOnlyError"; -import esm_writeOnlyError from "@babel/runtime/helpers/esm/writeOnlyError"; -import esm_classNameTDZError from "@babel/runtime/helpers/esm/classNameTDZError"; -import esm_temporalUndefined from "@babel/runtime/helpers/esm/temporalUndefined"; -import esm_tdz from "@babel/runtime/helpers/esm/tdz"; -import esm_temporalRef from "@babel/runtime/helpers/esm/temporalRef"; -import esm_slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; -import esm_slicedToArrayLoose from "@babel/runtime/helpers/esm/slicedToArrayLoose"; -import esm_toArray from "@babel/runtime/helpers/esm/toArray"; -import esm_toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; -import esm_arrayWithoutHoles from "@babel/runtime/helpers/esm/arrayWithoutHoles"; -import esm_arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import esm_maybeArrayLike from "@babel/runtime/helpers/esm/maybeArrayLike"; -import esm_iterableToArray from "@babel/runtime/helpers/esm/iterableToArray"; -import esm_iterableToArrayLimit from "@babel/runtime/helpers/esm/iterableToArrayLimit"; -import esm_iterableToArrayLimitLoose from "@babel/runtime/helpers/esm/iterableToArrayLimitLoose"; -import esm_unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import esm_arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -import esm_nonIterableSpread from "@babel/runtime/helpers/esm/nonIterableSpread"; -import esm_nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -import esm_createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper"; -import esm_createForOfIteratorHelperLoose from "@babel/runtime/helpers/esm/createForOfIteratorHelperLoose"; -import esm_skipFirstGeneratorNext from "@babel/runtime/helpers/esm/skipFirstGeneratorNext"; -import esm_toPrimitive from "@babel/runtime/helpers/esm/toPrimitive"; -import esm_toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey"; -import esm_initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper"; -import esm_initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty"; -import esm_applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor"; -import esm_classPrivateFieldLooseKey from "@babel/runtime/helpers/esm/classPrivateFieldLooseKey"; -import esm_classPrivateFieldLooseBase from "@babel/runtime/helpers/esm/classPrivateFieldLooseBase"; -import esm_classPrivateFieldGet from "@babel/runtime/helpers/esm/classPrivateFieldGet"; -import esm_classPrivateFieldSet from "@babel/runtime/helpers/esm/classPrivateFieldSet"; -import esm_classPrivateFieldDestructureSet from "@babel/runtime/helpers/esm/classPrivateFieldDestructureSet"; -import esm_classStaticPrivateFieldSpecGet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet"; -import esm_classStaticPrivateFieldSpecSet from "@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet"; -import esm_classStaticPrivateMethodGet from "@babel/runtime/helpers/esm/classStaticPrivateMethodGet"; -import esm_classStaticPrivateMethodSet from "@babel/runtime/helpers/esm/classStaticPrivateMethodSet"; -import esm_decorate from "@babel/runtime/helpers/esm/decorate"; -import esm_classPrivateMethodGet from "@babel/runtime/helpers/esm/classPrivateMethodGet"; -import esm_classPrivateMethodSet from "@babel/runtime/helpers/esm/classPrivateMethodSet"; -import esm_wrapRegExp from "@babel/runtime/helpers/esm/wrapRegExp"; -import _package from "@babel/runtime/package.json"; -import regenerator from "@babel/runtime/regenerator"; - -console.log( - _typeof, - jsx, - asyncIterator, - AwaitValue, - AsyncGenerator, - wrapAsyncGenerator, - awaitAsyncGenerator, - asyncGeneratorDelegate, - asyncToGenerator, - classCallCheck, - createClass, - defineEnumerableProperties, - defaults, - defineProperty, - _extends, - objectSpread, - objectSpread2, - inherits, - inheritsLoose, - getPrototypeOf, - setPrototypeOf, - isNativeReflectConstruct, - construct, - isNativeFunction, - wrapNativeSuper, - _instanceof, - interopRequireDefault, - interopRequireWildcard, - newArrowCheck, - objectDestructuringEmpty, - objectWithoutPropertiesLoose, - objectWithoutProperties, - assertThisInitialized, - possibleConstructorReturn, - createSuper, - superPropBase, - get, - set, - taggedTemplateLiteral, - taggedTemplateLiteralLoose, - readOnlyError, - writeOnlyError, - classNameTDZError, - temporalUndefined, - tdz, - temporalRef, - slicedToArray, - slicedToArrayLoose, - toArray, - toConsumableArray, - arrayWithoutHoles, - arrayWithHoles, - maybeArrayLike, - iterableToArray, - iterableToArrayLimit, - iterableToArrayLimitLoose, - unsupportedIterableToArray, - arrayLikeToArray, - nonIterableSpread, - nonIterableRest, - createForOfIteratorHelper, - createForOfIteratorHelperLoose, - skipFirstGeneratorNext, - toPrimitive, - toPropertyKey, - initializerWarningHelper, - initializerDefineProperty, - applyDecoratedDescriptor, - classPrivateFieldLooseKey, - classPrivateFieldLooseBase, - classPrivateFieldGet, - classPrivateFieldSet, - classPrivateFieldDestructureSet, - classStaticPrivateFieldSpecGet, - classStaticPrivateFieldSpecSet, - classStaticPrivateMethodGet, - classStaticPrivateMethodSet, - decorate, - classPrivateMethodGet, - classPrivateMethodSet, - wrapRegExp, - esm_typeof, - esm_jsx, - esm_asyncIterator, - esm_AwaitValue, - esm_AsyncGenerator, - esm_wrapAsyncGenerator, - esm_awaitAsyncGenerator, - esm_asyncGeneratorDelegate, - esm_asyncToGenerator, - esm_classCallCheck, - esm_createClass, - esm_defineEnumerableProperties, - esm_defaults, - esm_defineProperty, - esm_extends, - esm_objectSpread, - esm_objectSpread2, - esm_inherits, - esm_inheritsLoose, - esm_getPrototypeOf, - esm_setPrototypeOf, - esm_isNativeReflectConstruct, - esm_construct, - esm_isNativeFunction, - esm_wrapNativeSuper, - esm_instanceof, - esm_interopRequireDefault, - esm_interopRequireWildcard, - esm_newArrowCheck, - esm_objectDestructuringEmpty, - esm_objectWithoutPropertiesLoose, - esm_objectWithoutProperties, - esm_assertThisInitialized, - esm_possibleConstructorReturn, - esm_createSuper, - esm_superPropBase, - esm_get, - esm_set, - esm_taggedTemplateLiteral, - esm_taggedTemplateLiteralLoose, - esm_readOnlyError, - esm_writeOnlyError, - esm_classNameTDZError, - esm_temporalUndefined, - esm_tdz, - esm_temporalRef, - esm_slicedToArray, - esm_slicedToArrayLoose, - esm_toArray, - esm_toConsumableArray, - esm_arrayWithoutHoles, - esm_arrayWithHoles, - esm_maybeArrayLike, - esm_iterableToArray, - esm_iterableToArrayLimit, - esm_iterableToArrayLimitLoose, - esm_unsupportedIterableToArray, - esm_arrayLikeToArray, - esm_nonIterableSpread, - esm_nonIterableRest, - esm_createForOfIteratorHelper, - esm_createForOfIteratorHelperLoose, - esm_skipFirstGeneratorNext, - esm_toPrimitive, - esm_toPropertyKey, - esm_initializerWarningHelper, - esm_initializerDefineProperty, - esm_applyDecoratedDescriptor, - esm_classPrivateFieldLooseKey, - esm_classPrivateFieldLooseBase, - esm_classPrivateFieldGet, - esm_classPrivateFieldSet, - esm_classPrivateFieldDestructureSet, - esm_classStaticPrivateFieldSpecGet, - esm_classStaticPrivateFieldSpecSet, - esm_classStaticPrivateMethodGet, - esm_classStaticPrivateMethodSet, - esm_decorate, - esm_classPrivateMethodGet, - esm_classPrivateMethodSet, - esm_wrapRegExp, - _package, - regenerator -); diff --git a/cases/common-libs/src/index.js b/cases/common-libs/src/index.js deleted file mode 100644 index e4fe80245b..0000000000 --- a/cases/common-libs/src/index.js +++ /dev/null @@ -1,29 +0,0 @@ -import "./babel-runtime"; -import * as core from "@material-ui/core"; -import * as lab from "@material-ui/lab"; -import * as icons from "@material-ui/icons"; -console.log(core, lab, icons); -import "acorn"; -import "classnames"; -import * as dateFn from "date-fns"; -import * as dateFnEsm from "date-fns/esm"; -console.log(dateFn, dateFnEsm); -import "jquery"; -import "lodash"; -import * as lodashEs from "lodash-es"; -console.log(lodashEs); -import "moment"; -import "react"; -import "react-dom"; -import "redux"; -import * as rxjs from "rxjs"; -console.log(rxjs); -import * as underscore from "underscore"; -import * as underscoreModules from "underscore/modules"; -console.log(underscore, underscoreModules); -import { NIL, parse, stringify, v1, v3, v4, v5, validate, version } from "uuid"; -console.log(NIL, parse, stringify, v1, v3, v4, v5, validate, version); -import "vue"; -import "zone.js"; - -console.log("Hello World"); diff --git a/cases/common-libs/webpack.config.js b/cases/common-libs/webpack.config.js deleted file mode 100644 index f053ebf797..0000000000 --- a/cases/common-libs/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/cases/esbuild-three/package.json b/cases/esbuild-three/package.json deleted file mode 100644 index 69e0d20467..0000000000 --- a/cases/esbuild-three/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "esbuild-three", - "scripts": { - "bench:setup": "ncp src/base src/copy1 --clobber && ncp src/base src/copy2 --clobber && ncp src/base src/copy3 --clobber && ncp src/base src/copy4 --clobber && ncp src/base src/copy5 --clobber && ncp src/base src/copy6 --clobber && ncp src/base src/copy7 --clobber && ncp src/base src/copy8 --clobber && ncp src/base src/copy9 --clobber && ncp src/base src/copy10 --clobber" - }, - "dependenciesDate": "2021-02-15", - "dependencies": { - "ncp": "^2.0.0", - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "webpack": "*" - } -} diff --git a/cases/esbuild-three/src/.gitignore b/cases/esbuild-three/src/.gitignore deleted file mode 100644 index 792c8686b9..0000000000 --- a/cases/esbuild-three/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -copy* diff --git a/cases/esbuild-three/src/base/Three.Legacy.d.ts b/cases/esbuild-three/src/base/Three.Legacy.d.ts deleted file mode 100644 index 51248d92e6..0000000000 --- a/cases/esbuild-three/src/base/Three.Legacy.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Geometry } from './core/Geometry'; -import { Material } from './materials/Material'; -import { Object3D } from './core/Object3D'; -import { Scene } from './scenes/Scene'; - -export namespace SceneUtils { - export function createMultiMaterialObject( - geometry: Geometry, - materials: Material[] - ): Object3D; - export function detach( child: Object3D, parent: Object3D, scene: Scene ): void; - export function attach( child: Object3D, scene: Scene, parent: Object3D ): void; -} diff --git a/cases/esbuild-three/src/base/Three.Legacy.js b/cases/esbuild-three/src/base/Three.Legacy.js deleted file mode 100644 index b461b7c14a..0000000000 --- a/cases/esbuild-three/src/base/Three.Legacy.js +++ /dev/null @@ -1,1943 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Audio } from './audio/Audio.js'; -import { AudioAnalyser } from './audio/AudioAnalyser.js'; -import { PerspectiveCamera } from './cameras/PerspectiveCamera.js'; -import { FlatShading } from './constants.js'; -import { - Float64BufferAttribute, - Float32BufferAttribute, - Uint32BufferAttribute, - Int32BufferAttribute, - Uint16BufferAttribute, - Int16BufferAttribute, - Uint8ClampedBufferAttribute, - Uint8BufferAttribute, - Int8BufferAttribute, - BufferAttribute -} from './core/BufferAttribute.js'; -import { BufferGeometry } from './core/BufferGeometry.js'; -import { Face3 } from './core/Face3.js'; -import { Geometry } from './core/Geometry.js'; -import { Object3D } from './core/Object3D.js'; -import { Uniform } from './core/Uniform.js'; -import { Curve } from './extras/core/Curve.js'; -import { CurvePath } from './extras/core/CurvePath.js'; -import { Path } from './extras/core/Path.js'; -import { CatmullRomCurve3 } from './extras/curves/CatmullRomCurve3.js'; -import { AxesHelper } from './helpers/AxesHelper.js'; -import { BoxHelper } from './helpers/BoxHelper.js'; -import { GridHelper } from './helpers/GridHelper.js'; -import { SkeletonHelper } from './helpers/SkeletonHelper.js'; -import { BoxGeometry } from './geometries/BoxGeometry.js'; -import { EdgesGeometry } from './geometries/EdgesGeometry.js'; -import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js'; -import { ExtrudeBufferGeometry } from './geometries/ExtrudeGeometry.js'; -import { ShapeGeometry } from './geometries/ShapeGeometry.js'; -import { WireframeGeometry } from './geometries/WireframeGeometry.js'; -import { Light } from './lights/Light.js'; -import { Loader } from './loaders/Loader.js'; -import { LoaderUtils } from './loaders/LoaderUtils.js'; -import { FileLoader } from './loaders/FileLoader.js'; -import { AudioLoader } from './loaders/AudioLoader.js'; -import { CubeTextureLoader } from './loaders/CubeTextureLoader.js'; -import { DataTextureLoader } from './loaders/DataTextureLoader.js'; -import { ObjectLoader } from './loaders/ObjectLoader.js'; -import { TextureLoader } from './loaders/TextureLoader.js'; -import { Material } from './materials/Material.js'; -import { LineBasicMaterial } from './materials/LineBasicMaterial.js'; -import { MeshPhongMaterial } from './materials/MeshPhongMaterial.js'; -import { PointsMaterial } from './materials/PointsMaterial.js'; -import { ShaderMaterial } from './materials/ShaderMaterial.js'; -import { Box2 } from './math/Box2.js'; -import { Box3 } from './math/Box3.js'; -import { Color } from './math/Color.js'; -import { Line3 } from './math/Line3.js'; -import { _Math } from './math/Math.js'; -import { Matrix3 } from './math/Matrix3.js'; -import { Matrix4 } from './math/Matrix4.js'; -import { Plane } from './math/Plane.js'; -import { Quaternion } from './math/Quaternion.js'; -import { Ray } from './math/Ray.js'; -import { Triangle } from './math/Triangle.js'; -import { Vector2 } from './math/Vector2.js'; -import { Vector3 } from './math/Vector3.js'; -import { Vector4 } from './math/Vector4.js'; -import { LineSegments } from './objects/LineSegments.js'; -import { LOD } from './objects/LOD.js'; -import { Points } from './objects/Points.js'; -import { Sprite } from './objects/Sprite.js'; -import { Skeleton } from './objects/Skeleton.js'; -import { SkinnedMesh } from './objects/SkinnedMesh.js'; -import { WebGLRenderer } from './renderers/WebGLRenderer.js'; -import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js'; -import { WebGLRenderTargetCube } from './renderers/WebGLRenderTargetCube.js'; -import { WebGLShadowMap } from './renderers/webgl/WebGLShadowMap.js'; -import { WebVRManager } from './renderers/webvr/WebVRManager.js'; -import { ImageUtils } from './extras/ImageUtils.js'; -import { Shape } from './extras/core/Shape.js'; -import { CubeCamera } from './cameras/CubeCamera.js'; - -export { BoxGeometry as CubeGeometry }; - -export function Face4( a, b, c, d, normal, color, materialIndex ) { - - console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ); - return new Face3( a, b, c, normal, color, materialIndex ); - -} - -export var LineStrip = 0; - -export var LinePieces = 1; - -export function MeshFaceMaterial( materials ) { - - console.warn( 'THREE.MeshFaceMaterial has been removed. Use an Array instead.' ); - return materials; - -} - -export function MultiMaterial( materials ) { - - if ( materials === undefined ) materials = []; - - console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' ); - materials.isMultiMaterial = true; - materials.materials = materials; - materials.clone = function () { - - return materials.slice(); - - }; - return materials; - -} - -export function PointCloud( geometry, material ) { - - console.warn( 'THREE.PointCloud has been renamed to THREE.Points.' ); - return new Points( geometry, material ); - -} - -export function Particle( material ) { - - console.warn( 'THREE.Particle has been renamed to THREE.Sprite.' ); - return new Sprite( material ); - -} - -export function ParticleSystem( geometry, material ) { - - console.warn( 'THREE.ParticleSystem has been renamed to THREE.Points.' ); - return new Points( geometry, material ); - -} - -export function PointCloudMaterial( parameters ) { - - console.warn( 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); - -} - -export function ParticleBasicMaterial( parameters ) { - - console.warn( 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); - -} - -export function ParticleSystemMaterial( parameters ) { - - console.warn( 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.' ); - return new PointsMaterial( parameters ); - -} - -export function Vertex( x, y, z ) { - - console.warn( 'THREE.Vertex has been removed. Use THREE.Vector3 instead.' ); - return new Vector3( x, y, z ); - -} - -// - -export function DynamicBufferAttribute( array, itemSize ) { - - console.warn( 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.' ); - return new BufferAttribute( array, itemSize ).setDynamic( true ); - -} - -export function Int8Attribute( array, itemSize ) { - - console.warn( 'THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.' ); - return new Int8BufferAttribute( array, itemSize ); - -} - -export function Uint8Attribute( array, itemSize ) { - - console.warn( 'THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.' ); - return new Uint8BufferAttribute( array, itemSize ); - -} - -export function Uint8ClampedAttribute( array, itemSize ) { - - console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.' ); - return new Uint8ClampedBufferAttribute( array, itemSize ); - -} - -export function Int16Attribute( array, itemSize ) { - - console.warn( 'THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.' ); - return new Int16BufferAttribute( array, itemSize ); - -} - -export function Uint16Attribute( array, itemSize ) { - - console.warn( 'THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.' ); - return new Uint16BufferAttribute( array, itemSize ); - -} - -export function Int32Attribute( array, itemSize ) { - - console.warn( 'THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.' ); - return new Int32BufferAttribute( array, itemSize ); - -} - -export function Uint32Attribute( array, itemSize ) { - - console.warn( 'THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.' ); - return new Uint32BufferAttribute( array, itemSize ); - -} - -export function Float32Attribute( array, itemSize ) { - - console.warn( 'THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.' ); - return new Float32BufferAttribute( array, itemSize ); - -} - -export function Float64Attribute( array, itemSize ) { - - console.warn( 'THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.' ); - return new Float64BufferAttribute( array, itemSize ); - -} - -// - -Curve.create = function ( construct, getPoint ) { - - console.log( 'THREE.Curve.create() has been deprecated' ); - - construct.prototype = Object.create( Curve.prototype ); - construct.prototype.constructor = construct; - construct.prototype.getPoint = getPoint; - - return construct; - -}; - -// - -Object.assign( CurvePath.prototype, { - - createPointsGeometry: function ( divisions ) { - - console.warn( 'THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' ); - - // generate geometry from path points (for Line or Points objects) - - var pts = this.getPoints( divisions ); - return this.createGeometry( pts ); - - }, - - createSpacedPointsGeometry: function ( divisions ) { - - console.warn( 'THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' ); - - // generate geometry from equidistant sampling along the path - - var pts = this.getSpacedPoints( divisions ); - return this.createGeometry( pts ); - - }, - - createGeometry: function ( points ) { - - console.warn( 'THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.' ); - - var geometry = new Geometry(); - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - var point = points[ i ]; - geometry.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); - - } - - return geometry; - - } - -} ); - -// - -Object.assign( Path.prototype, { - - fromPoints: function ( points ) { - - console.warn( 'THREE.Path: .fromPoints() has been renamed to .setFromPoints().' ); - this.setFromPoints( points ); - - } - -} ); - -// - -export function ClosedSplineCurve3( points ) { - - console.warn( 'THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' ); - - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; - this.closed = true; - -} - -ClosedSplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype ); - -// - -export function SplineCurve3( points ) { - - console.warn( 'THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.' ); - - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; - -} - -SplineCurve3.prototype = Object.create( CatmullRomCurve3.prototype ); - -// - -export function Spline( points ) { - - console.warn( 'THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.' ); - - CatmullRomCurve3.call( this, points ); - this.type = 'catmullrom'; - -} - -Spline.prototype = Object.create( CatmullRomCurve3.prototype ); - -Object.assign( Spline.prototype, { - - initFromArray: function ( /* a */ ) { - - console.error( 'THREE.Spline: .initFromArray() has been removed.' ); - - }, - getControlPointsArray: function ( /* optionalTarget */ ) { - - console.error( 'THREE.Spline: .getControlPointsArray() has been removed.' ); - - }, - reparametrizeByArcLength: function ( /* samplingCoef */ ) { - - console.error( 'THREE.Spline: .reparametrizeByArcLength() has been removed.' ); - - } - -} ); - -// - -export function AxisHelper( size ) { - - console.warn( 'THREE.AxisHelper has been renamed to THREE.AxesHelper.' ); - return new AxesHelper( size ); - -} - -export function BoundingBoxHelper( object, color ) { - - console.warn( 'THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.' ); - return new BoxHelper( object, color ); - -} - -export function EdgesHelper( object, hex ) { - - console.warn( 'THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.' ); - return new LineSegments( new EdgesGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); - -} - -GridHelper.prototype.setColors = function () { - - console.error( 'THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.' ); - -}; - -SkeletonHelper.prototype.update = function () { - - console.error( 'THREE.SkeletonHelper: update() no longer needs to be called.' ); - -}; - -export function WireframeHelper( object, hex ) { - - console.warn( 'THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.' ); - return new LineSegments( new WireframeGeometry( object.geometry ), new LineBasicMaterial( { color: hex !== undefined ? hex : 0xffffff } ) ); - -} - -// - -Object.assign( Loader.prototype, { - - extractUrlBase: function ( url ) { - - console.warn( 'THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.' ); - return LoaderUtils.extractUrlBase( url ); - - } - -} ); - -export function XHRLoader( manager ) { - - console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' ); - return new FileLoader( manager ); - -} - -export function BinaryTextureLoader( manager ) { - - console.warn( 'THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.' ); - return new DataTextureLoader( manager ); - -} - -Object.assign( ObjectLoader.prototype, { - - setTexturePath: function ( value ) { - - console.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().' ); - return this.setResourcePath( value ); - - } - -} ); - -// - -Object.assign( Box2.prototype, { - - center: function ( optionalTarget ) { - - console.warn( 'THREE.Box2: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); - - }, - empty: function () { - - console.warn( 'THREE.Box2: .empty() has been renamed to .isEmpty().' ); - return this.isEmpty(); - - }, - isIntersectionBox: function ( box ) { - - console.warn( 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); - - }, - size: function ( optionalTarget ) { - - console.warn( 'THREE.Box2: .size() has been renamed to .getSize().' ); - return this.getSize( optionalTarget ); - - } -} ); - -Object.assign( Box3.prototype, { - - center: function ( optionalTarget ) { - - console.warn( 'THREE.Box3: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); - - }, - empty: function () { - - console.warn( 'THREE.Box3: .empty() has been renamed to .isEmpty().' ); - return this.isEmpty(); - - }, - isIntersectionBox: function ( box ) { - - console.warn( 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); - - }, - isIntersectionSphere: function ( sphere ) { - - console.warn( 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); - return this.intersectsSphere( sphere ); - - }, - size: function ( optionalTarget ) { - - console.warn( 'THREE.Box3: .size() has been renamed to .getSize().' ); - return this.getSize( optionalTarget ); - - } -} ); - -Line3.prototype.center = function ( optionalTarget ) { - - console.warn( 'THREE.Line3: .center() has been renamed to .getCenter().' ); - return this.getCenter( optionalTarget ); - -}; - -Object.assign( _Math, { - - random16: function () { - - console.warn( 'THREE.Math: .random16() has been deprecated. Use Math.random() instead.' ); - return Math.random(); - - }, - - nearestPowerOfTwo: function ( value ) { - - console.warn( 'THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().' ); - return _Math.floorPowerOfTwo( value ); - - }, - - nextPowerOfTwo: function ( value ) { - - console.warn( 'THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().' ); - return _Math.ceilPowerOfTwo( value ); - - } - -} ); - -Object.assign( Matrix3.prototype, { - - flattenToArrayOffset: function ( array, offset ) { - - console.warn( "THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." ); - return this.toArray( array, offset ); - - }, - multiplyVector3: function ( vector ) { - - console.warn( 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.' ); - return vector.applyMatrix3( this ); - - }, - multiplyVector3Array: function ( /* a */ ) { - - console.error( 'THREE.Matrix3: .multiplyVector3Array() has been removed.' ); - - }, - applyToBuffer: function ( buffer /*, offset, length */ ) { - - console.warn( 'THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); - - }, - applyToVector3Array: function ( /* array, offset, length */ ) { - - console.error( 'THREE.Matrix3: .applyToVector3Array() has been removed.' ); - - } - -} ); - -Object.assign( Matrix4.prototype, { - - extractPosition: function ( m ) { - - console.warn( 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().' ); - return this.copyPosition( m ); - - }, - flattenToArrayOffset: function ( array, offset ) { - - console.warn( "THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead." ); - return this.toArray( array, offset ); - - }, - getPosition: function () { - - console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); - return new Vector3().setFromMatrixColumn( this, 3 ); - - }, - setRotationFromQuaternion: function ( q ) { - - console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); - return this.makeRotationFromQuaternion( q ); - - }, - multiplyToArray: function () { - - console.warn( 'THREE.Matrix4: .multiplyToArray() has been removed.' ); - - }, - multiplyVector3: function ( vector ) { - - console.warn( 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); - - }, - multiplyVector4: function ( vector ) { - - console.warn( 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); - - }, - multiplyVector3Array: function ( /* a */ ) { - - console.error( 'THREE.Matrix4: .multiplyVector3Array() has been removed.' ); - - }, - rotateAxis: function ( v ) { - - console.warn( 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.' ); - v.transformDirection( this ); - - }, - crossVector: function ( vector ) { - - console.warn( 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.' ); - return vector.applyMatrix4( this ); - - }, - translate: function () { - - console.error( 'THREE.Matrix4: .translate() has been removed.' ); - - }, - rotateX: function () { - - console.error( 'THREE.Matrix4: .rotateX() has been removed.' ); - - }, - rotateY: function () { - - console.error( 'THREE.Matrix4: .rotateY() has been removed.' ); - - }, - rotateZ: function () { - - console.error( 'THREE.Matrix4: .rotateZ() has been removed.' ); - - }, - rotateByAxis: function () { - - console.error( 'THREE.Matrix4: .rotateByAxis() has been removed.' ); - - }, - applyToBuffer: function ( buffer /*, offset, length */ ) { - - console.warn( 'THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.' ); - return this.applyToBufferAttribute( buffer ); - - }, - applyToVector3Array: function ( /* array, offset, length */ ) { - - console.error( 'THREE.Matrix4: .applyToVector3Array() has been removed.' ); - - }, - makeFrustum: function ( left, right, bottom, top, near, far ) { - - console.warn( 'THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.' ); - return this.makePerspective( left, right, top, bottom, near, far ); - - } - -} ); - -Plane.prototype.isIntersectionLine = function ( line ) { - - console.warn( 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().' ); - return this.intersectsLine( line ); - -}; - -Quaternion.prototype.multiplyVector3 = function ( vector ) { - - console.warn( 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.' ); - return vector.applyQuaternion( this ); - -}; - -Object.assign( Ray.prototype, { - - isIntersectionBox: function ( box ) { - - console.warn( 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().' ); - return this.intersectsBox( box ); - - }, - isIntersectionPlane: function ( plane ) { - - console.warn( 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().' ); - return this.intersectsPlane( plane ); - - }, - isIntersectionSphere: function ( sphere ) { - - console.warn( 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().' ); - return this.intersectsSphere( sphere ); - - } - -} ); - -Object.assign( Triangle.prototype, { - - area: function () { - - console.warn( 'THREE.Triangle: .area() has been renamed to .getArea().' ); - return this.getArea(); - - }, - barycoordFromPoint: function ( point, target ) { - - console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' ); - return this.getBarycoord( point, target ); - - }, - midpoint: function ( target ) { - - console.warn( 'THREE.Triangle: .midpoint() has been renamed to .getMidpoint().' ); - return this.getMidpoint( target ); - - }, - normal: function ( target ) { - - console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' ); - return this.getNormal( target ); - - }, - plane: function ( target ) { - - console.warn( 'THREE.Triangle: .plane() has been renamed to .getPlane().' ); - return this.getPlane( target ); - - } - -} ); - -Object.assign( Triangle, { - - barycoordFromPoint: function ( point, a, b, c, target ) { - - console.warn( 'THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().' ); - return Triangle.getBarycoord( point, a, b, c, target ); - - }, - normal: function ( a, b, c, target ) { - - console.warn( 'THREE.Triangle: .normal() has been renamed to .getNormal().' ); - return Triangle.getNormal( a, b, c, target ); - - } - -} ); - -Object.assign( Shape.prototype, { - - extractAllPoints: function ( divisions ) { - - console.warn( 'THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.' ); - return this.extractPoints( divisions ); - - }, - extrude: function ( options ) { - - console.warn( 'THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.' ); - return new ExtrudeGeometry( this, options ); - - }, - makeGeometry: function ( options ) { - - console.warn( 'THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.' ); - return new ShapeGeometry( this, options ); - - } - -} ); - -Object.assign( Vector2.prototype, { - - fromAttribute: function ( attribute, index, offset ) { - - console.warn( 'THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); - - }, - distanceToManhattan: function ( v ) { - - console.warn( 'THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); - return this.manhattanDistanceTo( v ); - - }, - lengthManhattan: function () { - - console.warn( 'THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().' ); - return this.manhattanLength(); - - } - -} ); - -Object.assign( Vector3.prototype, { - - setEulerFromRotationMatrix: function () { - - console.error( 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.' ); - - }, - setEulerFromQuaternion: function () { - - console.error( 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.' ); - - }, - getPositionFromMatrix: function ( m ) { - - console.warn( 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().' ); - return this.setFromMatrixPosition( m ); - - }, - getScaleFromMatrix: function ( m ) { - - console.warn( 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().' ); - return this.setFromMatrixScale( m ); - - }, - getColumnFromMatrix: function ( index, matrix ) { - - console.warn( 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().' ); - return this.setFromMatrixColumn( matrix, index ); - - }, - applyProjection: function ( m ) { - - console.warn( 'THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.' ); - return this.applyMatrix4( m ); - - }, - fromAttribute: function ( attribute, index, offset ) { - - console.warn( 'THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); - - }, - distanceToManhattan: function ( v ) { - - console.warn( 'THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().' ); - return this.manhattanDistanceTo( v ); - - }, - lengthManhattan: function () { - - console.warn( 'THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().' ); - return this.manhattanLength(); - - } - -} ); - -Object.assign( Vector4.prototype, { - - fromAttribute: function ( attribute, index, offset ) { - - console.warn( 'THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().' ); - return this.fromBufferAttribute( attribute, index, offset ); - - }, - lengthManhattan: function () { - - console.warn( 'THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().' ); - return this.manhattanLength(); - - } - -} ); - -// - -Object.assign( Geometry.prototype, { - - computeTangents: function () { - - console.error( 'THREE.Geometry: .computeTangents() has been removed.' ); - - }, - computeLineDistances: function () { - - console.error( 'THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.' ); - - } - -} ); - -Object.assign( Object3D.prototype, { - - getChildByName: function ( name ) { - - console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' ); - return this.getObjectByName( name ); - - }, - renderDepth: function () { - - console.warn( 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.' ); - - }, - translate: function ( distance, axis ) { - - console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' ); - return this.translateOnAxis( axis, distance ); - - }, - getWorldRotation: function () { - - console.error( 'THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.' ); - - } - -} ); - -Object.defineProperties( Object3D.prototype, { - - eulerOrder: { - get: function () { - - console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); - return this.rotation.order; - - }, - set: function ( value ) { - - console.warn( 'THREE.Object3D: .eulerOrder is now .rotation.order.' ); - this.rotation.order = value; - - } - }, - useQuaternion: { - get: function () { - - console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); - - }, - set: function () { - - console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' ); - - } - } - -} ); - -Object.defineProperties( LOD.prototype, { - - objects: { - get: function () { - - console.warn( 'THREE.LOD: .objects has been renamed to .levels.' ); - return this.levels; - - } - } - -} ); - -Object.defineProperty( Skeleton.prototype, 'useVertexTexture', { - - get: function () { - - console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' ); - - }, - set: function () { - - console.warn( 'THREE.Skeleton: useVertexTexture has been removed.' ); - - } - -} ); - -SkinnedMesh.prototype.initBones = function () { - - console.error( 'THREE.SkinnedMesh: initBones() has been removed.' ); - -}; - -Object.defineProperty( Curve.prototype, '__arcLengthDivisions', { - - get: function () { - - console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' ); - return this.arcLengthDivisions; - - }, - set: function ( value ) { - - console.warn( 'THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.' ); - this.arcLengthDivisions = value; - - } - -} ); - -// - -PerspectiveCamera.prototype.setLens = function ( focalLength, filmGauge ) { - - console.warn( "THREE.PerspectiveCamera.setLens is deprecated. " + - "Use .setFocalLength and .filmGauge for a photographic setup." ); - - if ( filmGauge !== undefined ) this.filmGauge = filmGauge; - this.setFocalLength( focalLength ); - -}; - -// - -Object.defineProperties( Light.prototype, { - onlyShadow: { - set: function () { - - console.warn( 'THREE.Light: .onlyShadow has been removed.' ); - - } - }, - shadowCameraFov: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraFov is now .shadow.camera.fov.' ); - this.shadow.camera.fov = value; - - } - }, - shadowCameraLeft: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraLeft is now .shadow.camera.left.' ); - this.shadow.camera.left = value; - - } - }, - shadowCameraRight: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraRight is now .shadow.camera.right.' ); - this.shadow.camera.right = value; - - } - }, - shadowCameraTop: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraTop is now .shadow.camera.top.' ); - this.shadow.camera.top = value; - - } - }, - shadowCameraBottom: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.' ); - this.shadow.camera.bottom = value; - - } - }, - shadowCameraNear: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraNear is now .shadow.camera.near.' ); - this.shadow.camera.near = value; - - } - }, - shadowCameraFar: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowCameraFar is now .shadow.camera.far.' ); - this.shadow.camera.far = value; - - } - }, - shadowCameraVisible: { - set: function () { - - console.warn( 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.' ); - - } - }, - shadowBias: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowBias is now .shadow.bias.' ); - this.shadow.bias = value; - - } - }, - shadowDarkness: { - set: function () { - - console.warn( 'THREE.Light: .shadowDarkness has been removed.' ); - - } - }, - shadowMapWidth: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.' ); - this.shadow.mapSize.width = value; - - } - }, - shadowMapHeight: { - set: function ( value ) { - - console.warn( 'THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.' ); - this.shadow.mapSize.height = value; - - } - } -} ); - -// - -Object.defineProperties( BufferAttribute.prototype, { - - length: { - get: function () { - - console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' ); - return this.array.length; - - } - }, - copyIndicesArray: function ( /* indices */ ) { - - console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' ); - - } - -} ); - -Object.assign( BufferGeometry.prototype, { - - addIndex: function ( index ) { - - console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' ); - this.setIndex( index ); - - }, - addDrawCall: function ( start, count, indexOffset ) { - - if ( indexOffset !== undefined ) { - - console.warn( 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.' ); - - } - console.warn( 'THREE.BufferGeometry: .addDrawCall() is now .addGroup().' ); - this.addGroup( start, count ); - - }, - clearDrawCalls: function () { - - console.warn( 'THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().' ); - this.clearGroups(); - - }, - computeTangents: function () { - - console.warn( 'THREE.BufferGeometry: .computeTangents() has been removed.' ); - - }, - computeOffsets: function () { - - console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' ); - - } - -} ); - -Object.defineProperties( BufferGeometry.prototype, { - - drawcalls: { - get: function () { - - console.error( 'THREE.BufferGeometry: .drawcalls has been renamed to .groups.' ); - return this.groups; - - } - }, - offsets: { - get: function () { - - console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .groups.' ); - return this.groups; - - } - } - -} ); - -// - -Object.assign( ExtrudeBufferGeometry.prototype, { - - getArrays: function () { - - console.error( 'THREE.ExtrudeBufferGeometry: .getArrays() has been removed.' ); - - }, - - addShapeList: function () { - - console.error( 'THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.' ); - - }, - - addShape: function () { - - console.error( 'THREE.ExtrudeBufferGeometry: .addShape() has been removed.' ); - - } - -} ); - -// - -Object.defineProperties( Uniform.prototype, { - - dynamic: { - set: function () { - - console.warn( 'THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.' ); - - } - }, - onUpdate: { - value: function () { - - console.warn( 'THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.' ); - return this; - - } - } - -} ); - -// - -Object.defineProperties( Material.prototype, { - - wrapAround: { - get: function () { - - console.warn( 'THREE.Material: .wrapAround has been removed.' ); - - }, - set: function () { - - console.warn( 'THREE.Material: .wrapAround has been removed.' ); - - } - }, - - overdraw: { - get: function () { - - console.warn( 'THREE.Material: .overdraw has been removed.' ); - - }, - set: function () { - - console.warn( 'THREE.Material: .overdraw has been removed.' ); - - } - }, - - wrapRGB: { - get: function () { - - console.warn( 'THREE.Material: .wrapRGB has been removed.' ); - return new Color(); - - } - }, - - shading: { - get: function () { - - console.error( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); - - }, - set: function ( value ) { - - console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); - this.flatShading = ( value === FlatShading ); - - } - } - -} ); - -Object.defineProperties( MeshPhongMaterial.prototype, { - - metal: { - get: function () { - - console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.' ); - return false; - - }, - set: function () { - - console.warn( 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead' ); - - } - } - -} ); - -Object.defineProperties( ShaderMaterial.prototype, { - - derivatives: { - get: function () { - - console.warn( 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); - return this.extensions.derivatives; - - }, - set: function ( value ) { - - console.warn( 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.' ); - this.extensions.derivatives = value; - - } - } - -} ); - -// - -Object.assign( WebGLRenderer.prototype, { - - clearTarget: function ( renderTarget, color, depth, stencil ) { - - console.warn( 'THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.' ); - this.setRenderTarget( renderTarget ); - this.clear( color, depth, stencil ); - - }, - animate: function ( callback ) { - - console.warn( 'THREE.WebGLRenderer: .animate() is now .setAnimationLoop().' ); - this.setAnimationLoop( callback ); - - }, - getCurrentRenderTarget: function () { - - console.warn( 'THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().' ); - return this.getRenderTarget(); - - }, - getMaxAnisotropy: function () { - - console.warn( 'THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().' ); - return this.capabilities.getMaxAnisotropy(); - - }, - getPrecision: function () { - - console.warn( 'THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.' ); - return this.capabilities.precision; - - }, - resetGLState: function () { - - console.warn( 'THREE.WebGLRenderer: .resetGLState() is now .state.reset().' ); - return this.state.reset(); - - }, - supportsFloatTextures: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \'OES_texture_float\' ).' ); - return this.extensions.get( 'OES_texture_float' ); - - }, - supportsHalfFloatTextures: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \'OES_texture_half_float\' ).' ); - return this.extensions.get( 'OES_texture_half_float' ); - - }, - supportsStandardDerivatives: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \'OES_standard_derivatives\' ).' ); - return this.extensions.get( 'OES_standard_derivatives' ); - - }, - supportsCompressedTextureS3TC: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \'WEBGL_compressed_texture_s3tc\' ).' ); - return this.extensions.get( 'WEBGL_compressed_texture_s3tc' ); - - }, - supportsCompressedTexturePVRTC: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \'WEBGL_compressed_texture_pvrtc\' ).' ); - return this.extensions.get( 'WEBGL_compressed_texture_pvrtc' ); - - }, - supportsBlendMinMax: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \'EXT_blend_minmax\' ).' ); - return this.extensions.get( 'EXT_blend_minmax' ); - - }, - supportsVertexTextures: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.' ); - return this.capabilities.vertexTextures; - - }, - supportsInstancedArrays: function () { - - console.warn( 'THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \'ANGLE_instanced_arrays\' ).' ); - return this.extensions.get( 'ANGLE_instanced_arrays' ); - - }, - enableScissorTest: function ( boolean ) { - - console.warn( 'THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().' ); - this.setScissorTest( boolean ); - - }, - initMaterial: function () { - - console.warn( 'THREE.WebGLRenderer: .initMaterial() has been removed.' ); - - }, - addPrePlugin: function () { - - console.warn( 'THREE.WebGLRenderer: .addPrePlugin() has been removed.' ); - - }, - addPostPlugin: function () { - - console.warn( 'THREE.WebGLRenderer: .addPostPlugin() has been removed.' ); - - }, - updateShadowMap: function () { - - console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' ); - - }, - setFaceCulling: function () { - - console.warn( 'THREE.WebGLRenderer: .setFaceCulling() has been removed.' ); - - }, - allocTextureUnit: function () { - - console.warn( 'THREE.WebGLRenderer: .allocTextureUnit() has been removed.' ); - - }, - setTexture: function () { - - console.warn( 'THREE.WebGLRenderer: .setTexture() has been removed.' ); - - }, - setTexture2D: function () { - - console.warn( 'THREE.WebGLRenderer: .setTexture2D() has been removed.' ); - - }, - setTextureCube: function () { - - console.warn( 'THREE.WebGLRenderer: .setTextureCube() has been removed.' ); - - }, - getActiveMipMapLevel: function () { - - console.warn( 'THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().' ); - return this.getActiveMipmapLevel(); - - } - -} ); - -Object.defineProperties( WebGLRenderer.prototype, { - - shadowMapEnabled: { - get: function () { - - return this.shadowMap.enabled; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.' ); - this.shadowMap.enabled = value; - - } - }, - shadowMapType: { - get: function () { - - return this.shadowMap.type; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.' ); - this.shadowMap.type = value; - - } - }, - shadowMapCullFace: { - get: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' ); - return undefined; - - }, - set: function ( /* value */ ) { - - console.warn( 'THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.' ); - - } - }, - context: { - get: function () { - - console.warn( 'THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.' ); - return this.getContext(); - - } - } - -} ); - -Object.defineProperties( WebGLShadowMap.prototype, { - - cullFace: { - get: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' ); - return undefined; - - }, - set: function ( /* cullFace */ ) { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.' ); - - } - }, - renderReverseSided: { - get: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' ); - return undefined; - - }, - set: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.' ); - - } - }, - renderSingleSided: { - get: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' ); - return undefined; - - }, - set: function () { - - console.warn( 'THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.' ); - - } - } - -} ); - -// - -Object.defineProperties( WebGLRenderTargetCube.prototype, { - - activeCubeFace: { - set: function ( /* value */ ) { - - console.warn( 'THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().' ); - - } - }, - activeMipMapLevel: { - set: function ( /* value */ ) { - - console.warn( 'THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().' ); - - } - } - -} ); - -// - -Object.defineProperties( WebGLRenderTarget.prototype, { - - wrapS: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); - return this.texture.wrapS; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.' ); - this.texture.wrapS = value; - - } - }, - wrapT: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); - return this.texture.wrapT; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.' ); - this.texture.wrapT = value; - - } - }, - magFilter: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); - return this.texture.magFilter; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.' ); - this.texture.magFilter = value; - - } - }, - minFilter: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); - return this.texture.minFilter; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.' ); - this.texture.minFilter = value; - - } - }, - anisotropy: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); - return this.texture.anisotropy; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.' ); - this.texture.anisotropy = value; - - } - }, - offset: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); - return this.texture.offset; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .offset is now .texture.offset.' ); - this.texture.offset = value; - - } - }, - repeat: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); - return this.texture.repeat; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .repeat is now .texture.repeat.' ); - this.texture.repeat = value; - - } - }, - format: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); - return this.texture.format; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .format is now .texture.format.' ); - this.texture.format = value; - - } - }, - type: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); - return this.texture.type; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .type is now .texture.type.' ); - this.texture.type = value; - - } - }, - generateMipmaps: { - get: function () { - - console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); - return this.texture.generateMipmaps; - - }, - set: function ( value ) { - - console.warn( 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.' ); - this.texture.generateMipmaps = value; - - } - } - -} ); - -// - -Object.defineProperties( WebVRManager.prototype, { - - standing: { - set: function ( /* value */ ) { - - console.warn( 'THREE.WebVRManager: .standing has been removed.' ); - - } - }, - userHeight: { - set: function ( /* value */ ) { - - console.warn( 'THREE.WebVRManager: .userHeight has been removed.' ); - - } - } - -} ); - -// - -Audio.prototype.load = function ( file ) { - - console.warn( 'THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.' ); - var scope = this; - var audioLoader = new AudioLoader(); - audioLoader.load( file, function ( buffer ) { - - scope.setBuffer( buffer ); - - } ); - return this; - -}; - -AudioAnalyser.prototype.getData = function () { - - console.warn( 'THREE.AudioAnalyser: .getData() is now .getFrequencyData().' ); - return this.getFrequencyData(); - -}; - -// - -CubeCamera.prototype.updateCubeMap = function ( renderer, scene ) { - - console.warn( 'THREE.CubeCamera: .updateCubeMap() is now .update().' ); - return this.update( renderer, scene ); - -}; - -// - -export var GeometryUtils = { - - merge: function ( geometry1, geometry2, materialIndexOffset ) { - - console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' ); - var matrix; - - if ( geometry2.isMesh ) { - - geometry2.matrixAutoUpdate && geometry2.updateMatrix(); - - matrix = geometry2.matrix; - geometry2 = geometry2.geometry; - - } - - geometry1.merge( geometry2, matrix, materialIndexOffset ); - - }, - - center: function ( geometry ) { - - console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' ); - return geometry.center(); - - } - -}; - -ImageUtils.crossOrigin = undefined; - -ImageUtils.loadTexture = function ( url, mapping, onLoad, onError ) { - - console.warn( 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.' ); - - var loader = new TextureLoader(); - loader.setCrossOrigin( this.crossOrigin ); - - var texture = loader.load( url, onLoad, undefined, onError ); - - if ( mapping ) texture.mapping = mapping; - - return texture; - -}; - -ImageUtils.loadTextureCube = function ( urls, mapping, onLoad, onError ) { - - console.warn( 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.' ); - - var loader = new CubeTextureLoader(); - loader.setCrossOrigin( this.crossOrigin ); - - var texture = loader.load( urls, onLoad, undefined, onError ); - - if ( mapping ) texture.mapping = mapping; - - return texture; - -}; - -ImageUtils.loadCompressedTexture = function () { - - console.error( 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.' ); - -}; - -ImageUtils.loadCompressedTextureCube = function () { - - console.error( 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.' ); - -}; - -// - -export function CanvasRenderer() { - - console.error( 'THREE.CanvasRenderer has been removed' ); - -} - -// - -export function JSONLoader() { - - console.error( 'THREE.JSONLoader has been removed.' ); - -} - -// - -export var SceneUtils = { - - createMultiMaterialObject: function ( /* geometry, materials */ ) { - - console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); - - }, - - detach: function ( /* child, parent, scene */ ) { - - console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); - - }, - - attach: function ( /* child, scene, parent */ ) { - - console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); - - } - -}; - -// - -export function LensFlare() { - - console.error( 'THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js' ); - -} diff --git a/cases/esbuild-three/src/base/Three.d.ts b/cases/esbuild-three/src/base/Three.d.ts deleted file mode 100644 index fc61e25f46..0000000000 --- a/cases/esbuild-three/src/base/Three.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -export * from './polyfills'; -export * from './renderers/WebGLMultisampleRenderTarget'; -export * from './renderers/WebGLRenderTargetCube'; -export * from './renderers/WebGLRenderTarget'; -export * from './renderers/WebGLRenderer'; -export * from './renderers/shaders/ShaderLib'; -export * from './renderers/shaders/UniformsLib'; -export * from './renderers/shaders/UniformsUtils'; -export * from './renderers/shaders/ShaderChunk'; -export * from './scenes/FogExp2'; -export * from './scenes/Fog'; -export * from './scenes/Scene'; -export * from './objects/Sprite'; -export * from './objects/LOD'; -export * from './objects/SkinnedMesh'; -export * from './objects/Skeleton'; -export * from './objects/Bone'; -export * from './objects/Mesh'; -export * from './objects/LineSegments'; -export * from './objects/LineLoop'; -export * from './objects/Line'; -export * from './objects/Points'; -export * from './objects/Group'; -export * from './textures/VideoTexture'; -export * from './textures/DataTexture'; -export * from './textures/DataTexture3D'; -export * from './textures/CompressedTexture'; -export * from './textures/CubeTexture'; -export * from './textures/CanvasTexture'; -export * from './textures/DepthTexture'; -export * from './textures/Texture'; -export * from './geometries/Geometries'; -export * from './materials/Materials'; -export * from './loaders/AnimationLoader'; -export * from './loaders/CompressedTextureLoader'; -export * from './loaders/DataTextureLoader'; -export * from './loaders/CubeTextureLoader'; -export * from './loaders/TextureLoader'; -export * from './loaders/ObjectLoader'; -export * from './loaders/MaterialLoader'; -export * from './loaders/BufferGeometryLoader'; -export * from './loaders/LoadingManager'; -export * from './loaders/ImageLoader'; -export * from './loaders/ImageBitmapLoader'; -export * from './loaders/FontLoader'; -export * from './loaders/FileLoader'; -export * from './loaders/Loader'; -export * from './loaders/LoaderUtils'; -export * from './loaders/Cache'; -export * from './loaders/AudioLoader'; -export * from './lights/SpotLightShadow'; -export * from './lights/SpotLight'; -export * from './lights/PointLight'; -export * from './lights/RectAreaLight'; -export * from './lights/HemisphereLight'; -export * from './lights/DirectionalLightShadow'; -export * from './lights/DirectionalLight'; -export * from './lights/AmbientLight'; -export * from './lights/LightShadow'; -export * from './lights/Light'; -export * from './lights/AmbientLightProbe'; -export * from './lights/HemisphereLightProbe'; -export * from './lights/LightProbe'; -export * from './cameras/StereoCamera'; -export * from './cameras/PerspectiveCamera'; -export * from './cameras/OrthographicCamera'; -export * from './cameras/CubeCamera'; -export * from './cameras/ArrayCamera'; -export * from './cameras/Camera'; -export * from './audio/AudioListener'; -export * from './audio/PositionalAudio'; -export * from './audio/AudioContext'; -export * from './audio/AudioAnalyser'; -export * from './audio/Audio'; -export * from './animation/tracks/VectorKeyframeTrack'; -export * from './animation/tracks/StringKeyframeTrack'; -export * from './animation/tracks/QuaternionKeyframeTrack'; -export * from './animation/tracks/NumberKeyframeTrack'; -export * from './animation/tracks/ColorKeyframeTrack'; -export * from './animation/tracks/BooleanKeyframeTrack'; -export * from './animation/PropertyMixer'; -export * from './animation/PropertyBinding'; -export * from './animation/KeyframeTrack'; -export * from './animation/AnimationUtils'; -export * from './animation/AnimationObjectGroup'; -export * from './animation/AnimationMixer'; -export * from './animation/AnimationClip'; -export * from './animation/AnimationAction'; -export * from './core/Uniform'; -export * from './core/InstancedBufferGeometry'; -export * from './core/BufferGeometry'; -export * from './core/Geometry'; -export * from './core/InterleavedBufferAttribute'; -export * from './core/InstancedInterleavedBuffer'; -export * from './core/InterleavedBuffer'; -export * from './core/InstancedBufferAttribute'; -export * from './core/BufferAttribute'; -export * from './core/Face3'; -export * from './core/Object3D'; -export * from './core/Raycaster'; -export * from './core/Layers'; -export * from './core/EventDispatcher'; -export * from './core/DirectGeometry'; -export * from './core/Clock'; -export * from './math/interpolants/QuaternionLinearInterpolant'; -export * from './math/interpolants/LinearInterpolant'; -export * from './math/interpolants/DiscreteInterpolant'; -export * from './math/interpolants/CubicInterpolant'; -export * from './math/Interpolant'; -export * from './math/Triangle'; -export { _Math as Math } from './math/Math'; -export * from './math/Spherical'; -export * from './math/Cylindrical'; -export * from './math/Plane'; -export * from './math/Frustum'; -export * from './math/Sphere'; -export * from './math/Ray'; -export * from './math/Matrix4'; -export * from './math/Matrix3'; -export * from './math/Box3'; -export * from './math/Box2'; -export * from './math/Line3'; -export * from './math/Euler'; -export * from './math/Vector4'; -export * from './math/Vector3'; -export * from './math/Vector2'; -export * from './math/Quaternion'; -export * from './math/Color'; -export * from './math/SphericalHarmonics3'; -export * from './extras/objects/ImmediateRenderObject'; -export * from './helpers/VertexNormalsHelper'; -export * from './helpers/SpotLightHelper'; -export * from './helpers/SkeletonHelper'; -export * from './helpers/PointLightHelper'; -export * from './helpers/RectAreaLightHelper'; -export * from './helpers/HemisphereLightHelper'; -export * from './helpers/GridHelper'; -export * from './helpers/PolarGridHelper'; -export * from './helpers/PositionalAudioHelper'; -export * from './helpers/FaceNormalsHelper'; -export * from './helpers/DirectionalLightHelper'; -export * from './helpers/CameraHelper'; -export * from './helpers/BoxHelper'; -export * from './helpers/Box3Helper'; -export * from './helpers/PlaneHelper'; -export * from './helpers/ArrowHelper'; -export * from './helpers/AxesHelper'; -export * from './extras/curves/Curves'; -export * from './extras/core/Shape'; -export * from './extras/core/Path'; -export * from './extras/core/ShapePath'; -export * from './extras/core/Font'; -export * from './extras/core/CurvePath'; -export * from './extras/core/Curve'; -export * from './extras/ImageUtils'; -export * from './extras/ShapeUtils'; -export * from './renderers/webgl/WebGLBufferRenderer'; -export * from './renderers/webgl/WebGLCapabilities'; -export * from './renderers/webgl/WebGLClipping'; -export * from './renderers/webgl/WebGLExtensions'; -export * from './renderers/webgl/WebGLGeometries'; -export * from './renderers/webgl/WebGLIndexedBufferRenderer'; -export * from './renderers/webgl/WebGLInfo'; -export * from './renderers/webgl/WebGLLights'; -export * from './renderers/webgl/WebGLObjects'; -export * from './renderers/webgl/WebGLProgram'; -export * from './renderers/webgl/WebGLPrograms'; -export * from './renderers/webgl/WebGLProperties'; -export * from './renderers/webgl/WebGLRenderLists'; -export * from './renderers/webgl/WebGLShader'; -export * from './renderers/webgl/WebGLShadowMap'; -export * from './renderers/webgl/WebGLState'; -export * from './renderers/webgl/WebGLTextures'; -export * from './renderers/webgl/WebGLUniforms'; -//export * from './renderers/webgl/WebGLUtils'; -export * from './renderers/webvr/WebVRManager'; -export * from './constants'; -export * from './Three.Legacy'; - -export as namespace THREE; diff --git a/cases/esbuild-three/src/base/Three.js b/cases/esbuild-three/src/base/Three.js deleted file mode 100644 index f6816d4eea..0000000000 --- a/cases/esbuild-three/src/base/Three.js +++ /dev/null @@ -1,160 +0,0 @@ -import './polyfills.js'; - -export { WebGLMultisampleRenderTarget } from './renderers/WebGLMultisampleRenderTarget.js'; -export { WebGLRenderTargetCube } from './renderers/WebGLRenderTargetCube.js'; -export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js'; -export { WebGLRenderer } from './renderers/WebGLRenderer.js'; -export { ShaderLib } from './renderers/shaders/ShaderLib.js'; -export { UniformsLib } from './renderers/shaders/UniformsLib.js'; -export { UniformsUtils } from './renderers/shaders/UniformsUtils.js'; -export { ShaderChunk } from './renderers/shaders/ShaderChunk.js'; -export { FogExp2 } from './scenes/FogExp2.js'; -export { Fog } from './scenes/Fog.js'; -export { Scene } from './scenes/Scene.js'; -export { Sprite } from './objects/Sprite.js'; -export { LOD } from './objects/LOD.js'; -export { SkinnedMesh } from './objects/SkinnedMesh.js'; -export { Skeleton } from './objects/Skeleton.js'; -export { Bone } from './objects/Bone.js'; -export { Mesh } from './objects/Mesh.js'; -export { LineSegments } from './objects/LineSegments.js'; -export { LineLoop } from './objects/LineLoop.js'; -export { Line } from './objects/Line.js'; -export { Points } from './objects/Points.js'; -export { Group } from './objects/Group.js'; -export { VideoTexture } from './textures/VideoTexture.js'; -export { DataTexture } from './textures/DataTexture.js'; -export { DataTexture2DArray } from './textures/DataTexture2DArray.js'; -export { DataTexture3D } from './textures/DataTexture3D.js'; -export { CompressedTexture } from './textures/CompressedTexture.js'; -export { CubeTexture } from './textures/CubeTexture.js'; -export { CanvasTexture } from './textures/CanvasTexture.js'; -export { DepthTexture } from './textures/DepthTexture.js'; -export { Texture } from './textures/Texture.js'; -export * from './geometries/Geometries.js'; -export * from './materials/Materials.js'; -export { AnimationLoader } from './loaders/AnimationLoader.js'; -export { CompressedTextureLoader } from './loaders/CompressedTextureLoader.js'; -export { DataTextureLoader } from './loaders/DataTextureLoader.js'; -export { CubeTextureLoader } from './loaders/CubeTextureLoader.js'; -export { TextureLoader } from './loaders/TextureLoader.js'; -export { ObjectLoader } from './loaders/ObjectLoader.js'; -export { MaterialLoader } from './loaders/MaterialLoader.js'; -export { BufferGeometryLoader } from './loaders/BufferGeometryLoader.js'; -export { DefaultLoadingManager, LoadingManager } from './loaders/LoadingManager.js'; -export { ImageLoader } from './loaders/ImageLoader.js'; -export { ImageBitmapLoader } from './loaders/ImageBitmapLoader.js'; -export { FontLoader } from './loaders/FontLoader.js'; -export { FileLoader } from './loaders/FileLoader.js'; -export { Loader } from './loaders/Loader.js'; -export { LoaderUtils } from './loaders/LoaderUtils.js'; -export { Cache } from './loaders/Cache.js'; -export { AudioLoader } from './loaders/AudioLoader.js'; -export { SpotLightShadow } from './lights/SpotLightShadow.js'; -export { SpotLight } from './lights/SpotLight.js'; -export { PointLight } from './lights/PointLight.js'; -export { RectAreaLight } from './lights/RectAreaLight.js'; -export { HemisphereLight } from './lights/HemisphereLight.js'; -export { HemisphereLightProbe } from './lights/HemisphereLightProbe.js'; -export { DirectionalLightShadow } from './lights/DirectionalLightShadow.js'; -export { DirectionalLight } from './lights/DirectionalLight.js'; -export { AmbientLight } from './lights/AmbientLight.js'; -export { AmbientLightProbe } from './lights/AmbientLightProbe.js'; -export { LightShadow } from './lights/LightShadow.js'; -export { Light } from './lights/Light.js'; -export { LightProbe } from './lights/LightProbe.js'; -export { StereoCamera } from './cameras/StereoCamera.js'; -export { PerspectiveCamera } from './cameras/PerspectiveCamera.js'; -export { OrthographicCamera } from './cameras/OrthographicCamera.js'; -export { CubeCamera } from './cameras/CubeCamera.js'; -export { ArrayCamera } from './cameras/ArrayCamera.js'; -export { Camera } from './cameras/Camera.js'; -export { AudioListener } from './audio/AudioListener.js'; -export { PositionalAudio } from './audio/PositionalAudio.js'; -export { AudioContext } from './audio/AudioContext.js'; -export { AudioAnalyser } from './audio/AudioAnalyser.js'; -export { Audio } from './audio/Audio.js'; -export { VectorKeyframeTrack } from './animation/tracks/VectorKeyframeTrack.js'; -export { StringKeyframeTrack } from './animation/tracks/StringKeyframeTrack.js'; -export { QuaternionKeyframeTrack } from './animation/tracks/QuaternionKeyframeTrack.js'; -export { NumberKeyframeTrack } from './animation/tracks/NumberKeyframeTrack.js'; -export { ColorKeyframeTrack } from './animation/tracks/ColorKeyframeTrack.js'; -export { BooleanKeyframeTrack } from './animation/tracks/BooleanKeyframeTrack.js'; -export { PropertyMixer } from './animation/PropertyMixer.js'; -export { PropertyBinding } from './animation/PropertyBinding.js'; -export { KeyframeTrack } from './animation/KeyframeTrack.js'; -export { AnimationUtils } from './animation/AnimationUtils.js'; -export { AnimationObjectGroup } from './animation/AnimationObjectGroup.js'; -export { AnimationMixer } from './animation/AnimationMixer.js'; -export { AnimationClip } from './animation/AnimationClip.js'; -export { Uniform } from './core/Uniform.js'; -export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js'; -export { BufferGeometry } from './core/BufferGeometry.js'; -export { Geometry } from './core/Geometry.js'; -export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js'; -export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js'; -export { InterleavedBuffer } from './core/InterleavedBuffer.js'; -export { InstancedBufferAttribute } from './core/InstancedBufferAttribute.js'; -export * from './core/BufferAttribute.js'; -export { Face3 } from './core/Face3.js'; -export { Object3D } from './core/Object3D.js'; -export { Raycaster } from './core/Raycaster.js'; -export { Layers } from './core/Layers.js'; -export { EventDispatcher } from './core/EventDispatcher.js'; -export { Clock } from './core/Clock.js'; -export { QuaternionLinearInterpolant } from './math/interpolants/QuaternionLinearInterpolant.js'; -export { LinearInterpolant } from './math/interpolants/LinearInterpolant.js'; -export { DiscreteInterpolant } from './math/interpolants/DiscreteInterpolant.js'; -export { CubicInterpolant } from './math/interpolants/CubicInterpolant.js'; -export { Interpolant } from './math/Interpolant.js'; -export { Triangle } from './math/Triangle.js'; -export { _Math as Math } from './math/Math.js'; -export { Spherical } from './math/Spherical.js'; -export { Cylindrical } from './math/Cylindrical.js'; -export { Plane } from './math/Plane.js'; -export { Frustum } from './math/Frustum.js'; -export { Sphere } from './math/Sphere.js'; -export { Ray } from './math/Ray.js'; -export { Matrix4 } from './math/Matrix4.js'; -export { Matrix3 } from './math/Matrix3.js'; -export { Box3 } from './math/Box3.js'; -export { Box2 } from './math/Box2.js'; -export { Line3 } from './math/Line3.js'; -export { Euler } from './math/Euler.js'; -export { Vector4 } from './math/Vector4.js'; -export { Vector3 } from './math/Vector3.js'; -export { Vector2 } from './math/Vector2.js'; -export { Quaternion } from './math/Quaternion.js'; -export { Color } from './math/Color.js'; -export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js'; -export { ImmediateRenderObject } from './extras/objects/ImmediateRenderObject.js'; -export { VertexNormalsHelper } from './helpers/VertexNormalsHelper.js'; -export { SpotLightHelper } from './helpers/SpotLightHelper.js'; -export { SkeletonHelper } from './helpers/SkeletonHelper.js'; -export { PointLightHelper } from './helpers/PointLightHelper.js'; -export { RectAreaLightHelper } from './helpers/RectAreaLightHelper.js'; -export { HemisphereLightHelper } from './helpers/HemisphereLightHelper.js'; -export { LightProbeHelper } from './helpers/LightProbeHelper.js'; -export { GridHelper } from './helpers/GridHelper.js'; -export { PolarGridHelper } from './helpers/PolarGridHelper.js'; -export { PositionalAudioHelper } from './helpers/PositionalAudioHelper.js'; -export { FaceNormalsHelper } from './helpers/FaceNormalsHelper.js'; -export { DirectionalLightHelper } from './helpers/DirectionalLightHelper.js'; -export { CameraHelper } from './helpers/CameraHelper.js'; -export { BoxHelper } from './helpers/BoxHelper.js'; -export { Box3Helper } from './helpers/Box3Helper.js'; -export { PlaneHelper } from './helpers/PlaneHelper.js'; -export { ArrowHelper } from './helpers/ArrowHelper.js'; -export { AxesHelper } from './helpers/AxesHelper.js'; -export * from './extras/curves/Curves.js'; -export { Shape } from './extras/core/Shape.js'; -export { Path } from './extras/core/Path.js'; -export { ShapePath } from './extras/core/ShapePath.js'; -export { Font } from './extras/core/Font.js'; -export { CurvePath } from './extras/core/CurvePath.js'; -export { Curve } from './extras/core/Curve.js'; -export { ImageUtils } from './extras/ImageUtils.js'; -export { ShapeUtils } from './extras/ShapeUtils.js'; -export { WebGLUtils } from './renderers/webgl/WebGLUtils.js'; -export * from './constants.js'; -export * from './Three.Legacy.js'; diff --git a/cases/esbuild-three/src/base/animation/AnimationAction.d.ts b/cases/esbuild-three/src/base/animation/AnimationAction.d.ts deleted file mode 100644 index 647502fcc5..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationAction.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { AnimationMixer } from './AnimationMixer'; -import { AnimationClip } from './AnimationClip'; -import { AnimationActionLoopStyles } from '../constants'; -// Animation //////////////////////////////////////////////////////////////////////////////////////// - -export class AnimationAction { - - loop: AnimationActionLoopStyles; - time: number; - timeScale: number; - weight: number; - repetitions: number; - paused: boolean; - enabled: boolean; - clampWhenFinished: boolean; - zeroSlopeAtStart: boolean; - zeroSlopeAtEnd: boolean; - - play(): AnimationAction; - stop(): AnimationAction; - reset(): AnimationAction; - isRunning(): boolean; - isScheduled(): boolean; - startAt( time: number ): AnimationAction; - setLoop( - mode: AnimationActionLoopStyles, - repetitions: number - ): AnimationAction; - setEffectiveWeight( weight: number ): AnimationAction; - getEffectiveWeight(): number; - fadeIn( duration: number ): AnimationAction; - fadeOut( duration: number ): AnimationAction; - crossFadeFrom( - fadeOutAction: AnimationAction, - duration: number, - warp: boolean - ): AnimationAction; - crossFadeTo( - fadeInAction: AnimationAction, - duration: number, - warp: boolean - ): AnimationAction; - stopFading(): AnimationAction; - setEffectiveTimeScale( timeScale: number ): AnimationAction; - getEffectiveTimeScale(): number; - setDuration( duration: number ): AnimationAction; - syncWith( action: AnimationAction ): AnimationAction; - halt( duration: number ): AnimationAction; - warp( - statTimeScale: number, - endTimeScale: number, - duration: number - ): AnimationAction; - stopWarping(): AnimationAction; - getMixer(): AnimationMixer; - getClip(): AnimationClip; - getRoot(): any; - -} diff --git a/cases/esbuild-three/src/base/animation/AnimationAction.js b/cases/esbuild-three/src/base/animation/AnimationAction.js deleted file mode 100644 index 7dac8a7f2e..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationAction.js +++ /dev/null @@ -1,688 +0,0 @@ -import { WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, LoopPingPong, LoopOnce, LoopRepeat } from '../constants.js'; - -/** - * - * Action provided by AnimationMixer for scheduling clip playback on specific - * objects. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - * - */ - -function AnimationAction( mixer, clip, localRoot ) { - - this._mixer = mixer; - this._clip = clip; - this._localRoot = localRoot || null; - - var tracks = clip.tracks, - nTracks = tracks.length, - interpolants = new Array( nTracks ); - - var interpolantSettings = { - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding - }; - - for ( var i = 0; i !== nTracks; ++ i ) { - - var interpolant = tracks[ i ].createInterpolant( null ); - interpolants[ i ] = interpolant; - interpolant.settings = interpolantSettings; - - } - - this._interpolantSettings = interpolantSettings; - - this._interpolants = interpolants; // bound by the mixer - - // inside: PropertyMixer (managed by the mixer) - this._propertyBindings = new Array( nTracks ); - - this._cacheIndex = null; // for the memory manager - this._byClipCacheIndex = null; // for the memory manager - - this._timeScaleInterpolant = null; - this._weightInterpolant = null; - - this.loop = LoopRepeat; - this._loopCount = - 1; - - // global mixer time when the action is to be started - // it's set back to 'null' upon start of the action - this._startTime = null; - - // scaled local time of the action - // gets clamped or wrapped to 0..clip.duration according to loop - this.time = 0; - - this.timeScale = 1; - this._effectiveTimeScale = 1; - - this.weight = 1; - this._effectiveWeight = 1; - - this.repetitions = Infinity; // no. of repetitions when looping - - this.paused = false; // true -> zero effective time scale - this.enabled = true; // false -> zero effective weight - - this.clampWhenFinished = false;// keep feeding the last frame? - - this.zeroSlopeAtStart = true;// for smooth interpolation w/o separate - this.zeroSlopeAtEnd = true;// clips for start, loop and end - -} - -Object.assign( AnimationAction.prototype, { - - // State & Scheduling - - play: function () { - - this._mixer._activateAction( this ); - - return this; - - }, - - stop: function () { - - this._mixer._deactivateAction( this ); - - return this.reset(); - - }, - - reset: function () { - - this.paused = false; - this.enabled = true; - - this.time = 0; // restart clip - this._loopCount = - 1;// forget previous loops - this._startTime = null;// forget scheduling - - return this.stopFading().stopWarping(); - - }, - - isRunning: function () { - - return this.enabled && ! this.paused && this.timeScale !== 0 && - this._startTime === null && this._mixer._isActiveAction( this ); - - }, - - // return true when play has been called - isScheduled: function () { - - return this._mixer._isActiveAction( this ); - - }, - - startAt: function ( time ) { - - this._startTime = time; - - return this; - - }, - - setLoop: function ( mode, repetitions ) { - - this.loop = mode; - this.repetitions = repetitions; - - return this; - - }, - - // Weight - - // set the weight stopping any scheduled fading - // although .enabled = false yields an effective weight of zero, this - // method does *not* change .enabled, because it would be confusing - setEffectiveWeight: function ( weight ) { - - this.weight = weight; - - // note: same logic as when updated at runtime - this._effectiveWeight = this.enabled ? weight : 0; - - return this.stopFading(); - - }, - - // return the weight considering fading and .enabled - getEffectiveWeight: function () { - - return this._effectiveWeight; - - }, - - fadeIn: function ( duration ) { - - return this._scheduleFading( duration, 0, 1 ); - - }, - - fadeOut: function ( duration ) { - - return this._scheduleFading( duration, 1, 0 ); - - }, - - crossFadeFrom: function ( fadeOutAction, duration, warp ) { - - fadeOutAction.fadeOut( duration ); - this.fadeIn( duration ); - - if ( warp ) { - - var fadeInDuration = this._clip.duration, - fadeOutDuration = fadeOutAction._clip.duration, - - startEndRatio = fadeOutDuration / fadeInDuration, - endStartRatio = fadeInDuration / fadeOutDuration; - - fadeOutAction.warp( 1.0, startEndRatio, duration ); - this.warp( endStartRatio, 1.0, duration ); - - } - - return this; - - }, - - crossFadeTo: function ( fadeInAction, duration, warp ) { - - return fadeInAction.crossFadeFrom( this, duration, warp ); - - }, - - stopFading: function () { - - var weightInterpolant = this._weightInterpolant; - - if ( weightInterpolant !== null ) { - - this._weightInterpolant = null; - this._mixer._takeBackControlInterpolant( weightInterpolant ); - - } - - return this; - - }, - - // Time Scale Control - - // set the time scale stopping any scheduled warping - // although .paused = true yields an effective time scale of zero, this - // method does *not* change .paused, because it would be confusing - setEffectiveTimeScale: function ( timeScale ) { - - this.timeScale = timeScale; - this._effectiveTimeScale = this.paused ? 0 : timeScale; - - return this.stopWarping(); - - }, - - // return the time scale considering warping and .paused - getEffectiveTimeScale: function () { - - return this._effectiveTimeScale; - - }, - - setDuration: function ( duration ) { - - this.timeScale = this._clip.duration / duration; - - return this.stopWarping(); - - }, - - syncWith: function ( action ) { - - this.time = action.time; - this.timeScale = action.timeScale; - - return this.stopWarping(); - - }, - - halt: function ( duration ) { - - return this.warp( this._effectiveTimeScale, 0, duration ); - - }, - - warp: function ( startTimeScale, endTimeScale, duration ) { - - var mixer = this._mixer, now = mixer.time, - interpolant = this._timeScaleInterpolant, - - timeScale = this.timeScale; - - if ( interpolant === null ) { - - interpolant = mixer._lendControlInterpolant(); - this._timeScaleInterpolant = interpolant; - - } - - var times = interpolant.parameterPositions, - values = interpolant.sampleValues; - - times[ 0 ] = now; - times[ 1 ] = now + duration; - - values[ 0 ] = startTimeScale / timeScale; - values[ 1 ] = endTimeScale / timeScale; - - return this; - - }, - - stopWarping: function () { - - var timeScaleInterpolant = this._timeScaleInterpolant; - - if ( timeScaleInterpolant !== null ) { - - this._timeScaleInterpolant = null; - this._mixer._takeBackControlInterpolant( timeScaleInterpolant ); - - } - - return this; - - }, - - // Object Accessors - - getMixer: function () { - - return this._mixer; - - }, - - getClip: function () { - - return this._clip; - - }, - - getRoot: function () { - - return this._localRoot || this._mixer._root; - - }, - - // Interna - - _update: function ( time, deltaTime, timeDirection, accuIndex ) { - - // called by the mixer - - if ( ! this.enabled ) { - - // call ._updateWeight() to update ._effectiveWeight - - this._updateWeight( time ); - return; - - } - - var startTime = this._startTime; - - if ( startTime !== null ) { - - // check for scheduled start of action - - var timeRunning = ( time - startTime ) * timeDirection; - if ( timeRunning < 0 || timeDirection === 0 ) { - - return; // yet to come / don't decide when delta = 0 - - } - - // start - - this._startTime = null; // unschedule - deltaTime = timeDirection * timeRunning; - - } - - // apply time scale and advance time - - deltaTime *= this._updateTimeScale( time ); - var clipTime = this._updateTime( deltaTime ); - - // note: _updateTime may disable the action resulting in - // an effective weight of 0 - - var weight = this._updateWeight( time ); - - if ( weight > 0 ) { - - var interpolants = this._interpolants; - var propertyMixers = this._propertyBindings; - - for ( var j = 0, m = interpolants.length; j !== m; ++ j ) { - - interpolants[ j ].evaluate( clipTime ); - propertyMixers[ j ].accumulate( accuIndex, weight ); - - } - - } - - }, - - _updateWeight: function ( time ) { - - var weight = 0; - - if ( this.enabled ) { - - weight = this.weight; - var interpolant = this._weightInterpolant; - - if ( interpolant !== null ) { - - var interpolantValue = interpolant.evaluate( time )[ 0 ]; - - weight *= interpolantValue; - - if ( time > interpolant.parameterPositions[ 1 ] ) { - - this.stopFading(); - - if ( interpolantValue === 0 ) { - - // faded out, disable - this.enabled = false; - - } - - } - - } - - } - - this._effectiveWeight = weight; - return weight; - - }, - - _updateTimeScale: function ( time ) { - - var timeScale = 0; - - if ( ! this.paused ) { - - timeScale = this.timeScale; - - var interpolant = this._timeScaleInterpolant; - - if ( interpolant !== null ) { - - var interpolantValue = interpolant.evaluate( time )[ 0 ]; - - timeScale *= interpolantValue; - - if ( time > interpolant.parameterPositions[ 1 ] ) { - - this.stopWarping(); - - if ( timeScale === 0 ) { - - // motion has halted, pause - this.paused = true; - - } else { - - // warp done - apply final time scale - this.timeScale = timeScale; - - } - - } - - } - - } - - this._effectiveTimeScale = timeScale; - return timeScale; - - }, - - _updateTime: function ( deltaTime ) { - - var time = this.time + deltaTime; - var duration = this._clip.duration; - var loop = this.loop; - var loopCount = this._loopCount; - - var pingPong = ( loop === LoopPingPong ); - - if ( deltaTime === 0 ) { - - if ( loopCount === - 1 ) return time; - - return ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time; - - } - - if ( loop === LoopOnce ) { - - if ( loopCount === - 1 ) { - - // just started - - this._loopCount = 0; - this._setEndings( true, true, false ); - - } - - handle_stop: { - - if ( time >= duration ) { - - time = duration; - - } else if ( time < 0 ) { - - time = 0; - - } else { - - this.time = time; - - break handle_stop; - - } - - if ( this.clampWhenFinished ) this.paused = true; - else this.enabled = false; - - this.time = time; - - this._mixer.dispatchEvent( { - type: 'finished', action: this, - direction: deltaTime < 0 ? - 1 : 1 - } ); - - } - - } else { // repetitive Repeat or PingPong - - if ( loopCount === - 1 ) { - - // just started - - if ( deltaTime >= 0 ) { - - loopCount = 0; - - this._setEndings( true, this.repetitions === 0, pingPong ); - - } else { - - // when looping in reverse direction, the initial - // transition through zero counts as a repetition, - // so leave loopCount at -1 - - this._setEndings( this.repetitions === 0, true, pingPong ); - - } - - } - - if ( time >= duration || time < 0 ) { - - // wrap around - - var loopDelta = Math.floor( time / duration ); // signed - time -= duration * loopDelta; - - loopCount += Math.abs( loopDelta ); - - var pending = this.repetitions - loopCount; - - if ( pending <= 0 ) { - - // have to stop (switch state, clamp time, fire event) - - if ( this.clampWhenFinished ) this.paused = true; - else this.enabled = false; - - time = deltaTime > 0 ? duration : 0; - - this.time = time; - - this._mixer.dispatchEvent( { - type: 'finished', action: this, - direction: deltaTime > 0 ? 1 : - 1 - } ); - - } else { - - // keep running - - if ( pending === 1 ) { - - // entering the last round - - var atStart = deltaTime < 0; - this._setEndings( atStart, ! atStart, pingPong ); - - } else { - - this._setEndings( false, false, pingPong ); - - } - - this._loopCount = loopCount; - - this.time = time; - - this._mixer.dispatchEvent( { - type: 'loop', action: this, loopDelta: loopDelta - } ); - - } - - } else { - - this.time = time; - - } - - if ( pingPong && ( loopCount & 1 ) === 1 ) { - - // invert time for the "pong round" - - return duration - time; - - } - - } - - return time; - - }, - - _setEndings: function ( atStart, atEnd, pingPong ) { - - var settings = this._interpolantSettings; - - if ( pingPong ) { - - settings.endingStart = ZeroSlopeEnding; - settings.endingEnd = ZeroSlopeEnding; - - } else { - - // assuming for LoopOnce atStart == atEnd == true - - if ( atStart ) { - - settings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding; - - } else { - - settings.endingStart = WrapAroundEnding; - - } - - if ( atEnd ) { - - settings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding; - - } else { - - settings.endingEnd = WrapAroundEnding; - - } - - } - - }, - - _scheduleFading: function ( duration, weightNow, weightThen ) { - - var mixer = this._mixer, now = mixer.time, - interpolant = this._weightInterpolant; - - if ( interpolant === null ) { - - interpolant = mixer._lendControlInterpolant(); - this._weightInterpolant = interpolant; - - } - - var times = interpolant.parameterPositions, - values = interpolant.sampleValues; - - times[ 0 ] = now; - values[ 0 ] = weightNow; - times[ 1 ] = now + duration; - values[ 1 ] = weightThen; - - return this; - - } - -} ); - - -export { AnimationAction }; diff --git a/cases/esbuild-three/src/base/animation/AnimationClip.d.ts b/cases/esbuild-three/src/base/animation/AnimationClip.d.ts deleted file mode 100644 index 668bcf9940..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationClip.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { KeyframeTrack } from './KeyframeTrack'; -import { Bone } from './../objects/Bone'; -import { MorphTarget } from '../core/Geometry'; - -export class AnimationClip { - - constructor( name?: string, duration?: number, tracks?: KeyframeTrack[] ); - - name: string; - tracks: KeyframeTrack[]; - duration: number; - uuid: string; - results: any[]; - - resetDuration(): void; - trim(): AnimationClip; - optimize(): AnimationClip; - - static CreateFromMorphTargetSequence( - name: string, - morphTargetSequence: MorphTarget[], - fps: number, - noLoop: boolean - ): AnimationClip; - static findByName( clipArray: AnimationClip[], name: string ): AnimationClip; - static CreateClipsFromMorphTargetSequences( - morphTargets: MorphTarget[], - fps: number, - noLoop: boolean - ): AnimationClip[]; - static parse( json: any ): AnimationClip; - static parseAnimation( - animation: any, - bones: Bone[], - nodeName: string - ): AnimationClip; - static toJSON(): any; - -} diff --git a/cases/esbuild-three/src/base/animation/AnimationClip.js b/cases/esbuild-three/src/base/animation/AnimationClip.js deleted file mode 100644 index c9374656b2..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationClip.js +++ /dev/null @@ -1,468 +0,0 @@ -import { AnimationUtils } from './AnimationUtils.js'; -import { KeyframeTrack } from './KeyframeTrack.js'; -import { BooleanKeyframeTrack } from './tracks/BooleanKeyframeTrack.js'; -import { ColorKeyframeTrack } from './tracks/ColorKeyframeTrack.js'; -import { NumberKeyframeTrack } from './tracks/NumberKeyframeTrack.js'; -import { QuaternionKeyframeTrack } from './tracks/QuaternionKeyframeTrack.js'; -import { StringKeyframeTrack } from './tracks/StringKeyframeTrack.js'; -import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack.js'; -import { _Math } from '../math/Math.js'; - -/** - * - * Reusable set of Tracks that represent an animation. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - */ - -function AnimationClip( name, duration, tracks ) { - - this.name = name; - this.tracks = tracks; - this.duration = ( duration !== undefined ) ? duration : - 1; - - this.uuid = _Math.generateUUID(); - - // this means it should figure out its duration by scanning the tracks - if ( this.duration < 0 ) { - - this.resetDuration(); - - } - -} - -function getTrackTypeForValueTypeName( typeName ) { - - switch ( typeName.toLowerCase() ) { - - case 'scalar': - case 'double': - case 'float': - case 'number': - case 'integer': - - return NumberKeyframeTrack; - - case 'vector': - case 'vector2': - case 'vector3': - case 'vector4': - - return VectorKeyframeTrack; - - case 'color': - - return ColorKeyframeTrack; - - case 'quaternion': - - return QuaternionKeyframeTrack; - - case 'bool': - case 'boolean': - - return BooleanKeyframeTrack; - - case 'string': - - return StringKeyframeTrack; - - } - - throw new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName ); - -} - -function parseKeyframeTrack( json ) { - - if ( json.type === undefined ) { - - throw new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' ); - - } - - var trackType = getTrackTypeForValueTypeName( json.type ); - - if ( json.times === undefined ) { - - var times = [], values = []; - - AnimationUtils.flattenJSON( json.keys, times, values, 'value' ); - - json.times = times; - json.values = values; - - } - - // derived classes can define a static parse method - if ( trackType.parse !== undefined ) { - - return trackType.parse( json ); - - } else { - - // by default, we assume a constructor compatible with the base - return new trackType( json.name, json.times, json.values, json.interpolation ); - - } - -} - -Object.assign( AnimationClip, { - - parse: function ( json ) { - - var tracks = [], - jsonTracks = json.tracks, - frameTime = 1.0 / ( json.fps || 1.0 ); - - for ( var i = 0, n = jsonTracks.length; i !== n; ++ i ) { - - tracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) ); - - } - - return new AnimationClip( json.name, json.duration, tracks ); - - }, - - toJSON: function ( clip ) { - - var tracks = [], - clipTracks = clip.tracks; - - var json = { - - 'name': clip.name, - 'duration': clip.duration, - 'tracks': tracks, - 'uuid': clip.uuid - - }; - - for ( var i = 0, n = clipTracks.length; i !== n; ++ i ) { - - tracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) ); - - } - - return json; - - }, - - CreateFromMorphTargetSequence: function ( name, morphTargetSequence, fps, noLoop ) { - - var numMorphTargets = morphTargetSequence.length; - var tracks = []; - - for ( var i = 0; i < numMorphTargets; i ++ ) { - - var times = []; - var values = []; - - times.push( - ( i + numMorphTargets - 1 ) % numMorphTargets, - i, - ( i + 1 ) % numMorphTargets ); - - values.push( 0, 1, 0 ); - - var order = AnimationUtils.getKeyframeOrder( times ); - times = AnimationUtils.sortedArray( times, 1, order ); - values = AnimationUtils.sortedArray( values, 1, order ); - - // if there is a key at the first frame, duplicate it as the - // last frame as well for perfect loop. - if ( ! noLoop && times[ 0 ] === 0 ) { - - times.push( numMorphTargets ); - values.push( values[ 0 ] ); - - } - - tracks.push( - new NumberKeyframeTrack( - '.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']', - times, values - ).scale( 1.0 / fps ) ); - - } - - return new AnimationClip( name, - 1, tracks ); - - }, - - findByName: function ( objectOrClipArray, name ) { - - var clipArray = objectOrClipArray; - - if ( ! Array.isArray( objectOrClipArray ) ) { - - var o = objectOrClipArray; - clipArray = o.geometry && o.geometry.animations || o.animations; - - } - - for ( var i = 0; i < clipArray.length; i ++ ) { - - if ( clipArray[ i ].name === name ) { - - return clipArray[ i ]; - - } - - } - - return null; - - }, - - CreateClipsFromMorphTargetSequences: function ( morphTargets, fps, noLoop ) { - - var animationToMorphTargets = {}; - - // tested with https://regex101.com/ on trick sequences - // such flamingo_flyA_003, flamingo_run1_003, crdeath0059 - var pattern = /^([\w-]*?)([\d]+)$/; - - // sort morph target names into animation groups based - // patterns like Walk_001, Walk_002, Run_001, Run_002 - for ( var i = 0, il = morphTargets.length; i < il; i ++ ) { - - var morphTarget = morphTargets[ i ]; - var parts = morphTarget.name.match( pattern ); - - if ( parts && parts.length > 1 ) { - - var name = parts[ 1 ]; - - var animationMorphTargets = animationToMorphTargets[ name ]; - if ( ! animationMorphTargets ) { - - animationToMorphTargets[ name ] = animationMorphTargets = []; - - } - - animationMorphTargets.push( morphTarget ); - - } - - } - - var clips = []; - - for ( var name in animationToMorphTargets ) { - - clips.push( AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) ); - - } - - return clips; - - }, - - // parse the animation.hierarchy format - parseAnimation: function ( animation, bones ) { - - if ( ! animation ) { - - console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' ); - return null; - - } - - var addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) { - - // only return track if there are actually keys. - if ( animationKeys.length !== 0 ) { - - var times = []; - var values = []; - - AnimationUtils.flattenJSON( animationKeys, times, values, propertyName ); - - // empty keys are filtered out, so check again - if ( times.length !== 0 ) { - - destTracks.push( new trackType( trackName, times, values ) ); - - } - - } - - }; - - var tracks = []; - - var clipName = animation.name || 'default'; - // automatic length determination in AnimationClip. - var duration = animation.length || - 1; - var fps = animation.fps || 30; - - var hierarchyTracks = animation.hierarchy || []; - - for ( var h = 0; h < hierarchyTracks.length; h ++ ) { - - var animationKeys = hierarchyTracks[ h ].keys; - - // skip empty tracks - if ( ! animationKeys || animationKeys.length === 0 ) continue; - - // process morph targets - if ( animationKeys[ 0 ].morphTargets ) { - - // figure out all morph targets used in this track - var morphTargetNames = {}; - - for ( var k = 0; k < animationKeys.length; k ++ ) { - - if ( animationKeys[ k ].morphTargets ) { - - for ( var m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) { - - morphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = - 1; - - } - - } - - } - - // create a track for each morph target with all zero - // morphTargetInfluences except for the keys in which - // the morphTarget is named. - for ( var morphTargetName in morphTargetNames ) { - - var times = []; - var values = []; - - for ( var m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) { - - var animationKey = animationKeys[ k ]; - - times.push( animationKey.time ); - values.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 ); - - } - - tracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) ); - - } - - duration = morphTargetNames.length * ( fps || 1.0 ); - - } else { - - // ...assume skeletal animation - - var boneName = '.bones[' + bones[ h ].name + ']'; - - addNonemptyTrack( - VectorKeyframeTrack, boneName + '.position', - animationKeys, 'pos', tracks ); - - addNonemptyTrack( - QuaternionKeyframeTrack, boneName + '.quaternion', - animationKeys, 'rot', tracks ); - - addNonemptyTrack( - VectorKeyframeTrack, boneName + '.scale', - animationKeys, 'scl', tracks ); - - } - - } - - if ( tracks.length === 0 ) { - - return null; - - } - - var clip = new AnimationClip( clipName, duration, tracks ); - - return clip; - - } - -} ); - -Object.assign( AnimationClip.prototype, { - - resetDuration: function () { - - var tracks = this.tracks, duration = 0; - - for ( var i = 0, n = tracks.length; i !== n; ++ i ) { - - var track = this.tracks[ i ]; - - duration = Math.max( duration, track.times[ track.times.length - 1 ] ); - - } - - this.duration = duration; - - return this; - - }, - - trim: function () { - - for ( var i = 0; i < this.tracks.length; i ++ ) { - - this.tracks[ i ].trim( 0, this.duration ); - - } - - return this; - - }, - - validate: function () { - - var valid = true; - - for ( var i = 0; i < this.tracks.length; i ++ ) { - - valid = valid && this.tracks[ i ].validate(); - - } - - return valid; - - }, - - optimize: function () { - - for ( var i = 0; i < this.tracks.length; i ++ ) { - - this.tracks[ i ].optimize(); - - } - - return this; - - }, - - - clone: function () { - - var tracks = []; - - for ( var i = 0; i < this.tracks.length; i ++ ) { - - tracks.push( this.tracks[ i ].clone() ); - - } - - return new AnimationClip( this.name, this.duration, tracks ); - - } - -} ); - - -export { AnimationClip }; diff --git a/cases/esbuild-three/src/base/animation/AnimationMixer.d.ts b/cases/esbuild-three/src/base/animation/AnimationMixer.d.ts deleted file mode 100644 index 5a8c779ade..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationMixer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AnimationClip } from './AnimationClip'; -import { AnimationAction } from './AnimationAction'; -import { EventDispatcher } from './../core/EventDispatcher'; - -export class AnimationMixer extends EventDispatcher { - - constructor( root: any ); - - time: number; - timeScale: number; - - clipAction( clip: AnimationClip, root?: any ): AnimationAction; - existingAction( clip: AnimationClip, root?: any ): AnimationAction; - stopAllAction(): AnimationMixer; - update( deltaTime: number ): AnimationMixer; - getRoot(): any; - uncacheClip( clip: AnimationClip ): void; - uncacheRoot( root: any ): void; - uncacheAction( clip: AnimationClip, root?: any ): void; - -} diff --git a/cases/esbuild-three/src/base/animation/AnimationMixer.js b/cases/esbuild-three/src/base/animation/AnimationMixer.js deleted file mode 100644 index 8c9057e54d..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationMixer.js +++ /dev/null @@ -1,759 +0,0 @@ -import { AnimationAction } from './AnimationAction.js'; -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js'; -import { PropertyBinding } from './PropertyBinding.js'; -import { PropertyMixer } from './PropertyMixer.js'; -import { AnimationClip } from './AnimationClip.js'; - -/** - * - * Player for AnimationClips. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function AnimationMixer( root ) { - - this._root = root; - this._initMemoryManager(); - this._accuIndex = 0; - - this.time = 0; - - this.timeScale = 1.0; - -} - -AnimationMixer.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: AnimationMixer, - - _bindAction: function ( action, prototypeAction ) { - - var root = action._localRoot || this._root, - tracks = action._clip.tracks, - nTracks = tracks.length, - bindings = action._propertyBindings, - interpolants = action._interpolants, - rootUuid = root.uuid, - bindingsByRoot = this._bindingsByRootAndName, - bindingsByName = bindingsByRoot[ rootUuid ]; - - if ( bindingsByName === undefined ) { - - bindingsByName = {}; - bindingsByRoot[ rootUuid ] = bindingsByName; - - } - - for ( var i = 0; i !== nTracks; ++ i ) { - - var track = tracks[ i ], - trackName = track.name, - binding = bindingsByName[ trackName ]; - - if ( binding !== undefined ) { - - bindings[ i ] = binding; - - } else { - - binding = bindings[ i ]; - - if ( binding !== undefined ) { - - // existing binding, make sure the cache knows - - if ( binding._cacheIndex === null ) { - - ++ binding.referenceCount; - this._addInactiveBinding( binding, rootUuid, trackName ); - - } - - continue; - - } - - var path = prototypeAction && prototypeAction. - _propertyBindings[ i ].binding.parsedPath; - - binding = new PropertyMixer( - PropertyBinding.create( root, trackName, path ), - track.ValueTypeName, track.getValueSize() ); - - ++ binding.referenceCount; - this._addInactiveBinding( binding, rootUuid, trackName ); - - bindings[ i ] = binding; - - } - - interpolants[ i ].resultBuffer = binding.buffer; - - } - - }, - - _activateAction: function ( action ) { - - if ( ! this._isActiveAction( action ) ) { - - if ( action._cacheIndex === null ) { - - // this action has been forgotten by the cache, but the user - // appears to be still using it -> rebind - - var rootUuid = ( action._localRoot || this._root ).uuid, - clipUuid = action._clip.uuid, - actionsForClip = this._actionsByClip[ clipUuid ]; - - this._bindAction( action, - actionsForClip && actionsForClip.knownActions[ 0 ] ); - - this._addInactiveAction( action, clipUuid, rootUuid ); - - } - - var bindings = action._propertyBindings; - - // increment reference counts / sort out state - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { - - var binding = bindings[ i ]; - - if ( binding.useCount ++ === 0 ) { - - this._lendBinding( binding ); - binding.saveOriginalState(); - - } - - } - - this._lendAction( action ); - - } - - }, - - _deactivateAction: function ( action ) { - - if ( this._isActiveAction( action ) ) { - - var bindings = action._propertyBindings; - - // decrement reference counts / sort out state - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { - - var binding = bindings[ i ]; - - if ( -- binding.useCount === 0 ) { - - binding.restoreOriginalState(); - this._takeBackBinding( binding ); - - } - - } - - this._takeBackAction( action ); - - } - - }, - - // Memory manager - - _initMemoryManager: function () { - - this._actions = []; // 'nActiveActions' followed by inactive ones - this._nActiveActions = 0; - - this._actionsByClip = {}; - // inside: - // { - // knownActions: Array< AnimationAction > - used as prototypes - // actionByRoot: AnimationAction - lookup - // } - - - this._bindings = []; // 'nActiveBindings' followed by inactive ones - this._nActiveBindings = 0; - - this._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer > - - - this._controlInterpolants = []; // same game as above - this._nActiveControlInterpolants = 0; - - var scope = this; - - this.stats = { - - actions: { - get total() { - - return scope._actions.length; - - }, - get inUse() { - - return scope._nActiveActions; - - } - }, - bindings: { - get total() { - - return scope._bindings.length; - - }, - get inUse() { - - return scope._nActiveBindings; - - } - }, - controlInterpolants: { - get total() { - - return scope._controlInterpolants.length; - - }, - get inUse() { - - return scope._nActiveControlInterpolants; - - } - } - - }; - - }, - - // Memory management for AnimationAction objects - - _isActiveAction: function ( action ) { - - var index = action._cacheIndex; - return index !== null && index < this._nActiveActions; - - }, - - _addInactiveAction: function ( action, clipUuid, rootUuid ) { - - var actions = this._actions, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ]; - - if ( actionsForClip === undefined ) { - - actionsForClip = { - - knownActions: [ action ], - actionByRoot: {} - - }; - - action._byClipCacheIndex = 0; - - actionsByClip[ clipUuid ] = actionsForClip; - - } else { - - var knownActions = actionsForClip.knownActions; - - action._byClipCacheIndex = knownActions.length; - knownActions.push( action ); - - } - - action._cacheIndex = actions.length; - actions.push( action ); - - actionsForClip.actionByRoot[ rootUuid ] = action; - - }, - - _removeInactiveAction: function ( action ) { - - var actions = this._actions, - lastInactiveAction = actions[ actions.length - 1 ], - cacheIndex = action._cacheIndex; - - lastInactiveAction._cacheIndex = cacheIndex; - actions[ cacheIndex ] = lastInactiveAction; - actions.pop(); - - action._cacheIndex = null; - - - var clipUuid = action._clip.uuid, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ], - knownActionsForClip = actionsForClip.knownActions, - - lastKnownAction = - knownActionsForClip[ knownActionsForClip.length - 1 ], - - byClipCacheIndex = action._byClipCacheIndex; - - lastKnownAction._byClipCacheIndex = byClipCacheIndex; - knownActionsForClip[ byClipCacheIndex ] = lastKnownAction; - knownActionsForClip.pop(); - - action._byClipCacheIndex = null; - - - var actionByRoot = actionsForClip.actionByRoot, - rootUuid = ( action._localRoot || this._root ).uuid; - - delete actionByRoot[ rootUuid ]; - - if ( knownActionsForClip.length === 0 ) { - - delete actionsByClip[ clipUuid ]; - - } - - this._removeInactiveBindingsForAction( action ); - - }, - - _removeInactiveBindingsForAction: function ( action ) { - - var bindings = action._propertyBindings; - for ( var i = 0, n = bindings.length; i !== n; ++ i ) { - - var binding = bindings[ i ]; - - if ( -- binding.referenceCount === 0 ) { - - this._removeInactiveBinding( binding ); - - } - - } - - }, - - _lendAction: function ( action ) { - - // [ active actions | inactive actions ] - // [ active actions >| inactive actions ] - // s a - // <-swap-> - // a s - - var actions = this._actions, - prevIndex = action._cacheIndex, - - lastActiveIndex = this._nActiveActions ++, - - firstInactiveAction = actions[ lastActiveIndex ]; - - action._cacheIndex = lastActiveIndex; - actions[ lastActiveIndex ] = action; - - firstInactiveAction._cacheIndex = prevIndex; - actions[ prevIndex ] = firstInactiveAction; - - }, - - _takeBackAction: function ( action ) { - - // [ active actions | inactive actions ] - // [ active actions |< inactive actions ] - // a s - // <-swap-> - // s a - - var actions = this._actions, - prevIndex = action._cacheIndex, - - firstInactiveIndex = -- this._nActiveActions, - - lastActiveAction = actions[ firstInactiveIndex ]; - - action._cacheIndex = firstInactiveIndex; - actions[ firstInactiveIndex ] = action; - - lastActiveAction._cacheIndex = prevIndex; - actions[ prevIndex ] = lastActiveAction; - - }, - - // Memory management for PropertyMixer objects - - _addInactiveBinding: function ( binding, rootUuid, trackName ) { - - var bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ], - - bindings = this._bindings; - - if ( bindingByName === undefined ) { - - bindingByName = {}; - bindingsByRoot[ rootUuid ] = bindingByName; - - } - - bindingByName[ trackName ] = binding; - - binding._cacheIndex = bindings.length; - bindings.push( binding ); - - }, - - _removeInactiveBinding: function ( binding ) { - - var bindings = this._bindings, - propBinding = binding.binding, - rootUuid = propBinding.rootNode.uuid, - trackName = propBinding.path, - bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ], - - lastInactiveBinding = bindings[ bindings.length - 1 ], - cacheIndex = binding._cacheIndex; - - lastInactiveBinding._cacheIndex = cacheIndex; - bindings[ cacheIndex ] = lastInactiveBinding; - bindings.pop(); - - delete bindingByName[ trackName ]; - - if ( Object.keys( bindingByName ).length === 0 ) { - - delete bindingsByRoot[ rootUuid ]; - - } - - }, - - _lendBinding: function ( binding ) { - - var bindings = this._bindings, - prevIndex = binding._cacheIndex, - - lastActiveIndex = this._nActiveBindings ++, - - firstInactiveBinding = bindings[ lastActiveIndex ]; - - binding._cacheIndex = lastActiveIndex; - bindings[ lastActiveIndex ] = binding; - - firstInactiveBinding._cacheIndex = prevIndex; - bindings[ prevIndex ] = firstInactiveBinding; - - }, - - _takeBackBinding: function ( binding ) { - - var bindings = this._bindings, - prevIndex = binding._cacheIndex, - - firstInactiveIndex = -- this._nActiveBindings, - - lastActiveBinding = bindings[ firstInactiveIndex ]; - - binding._cacheIndex = firstInactiveIndex; - bindings[ firstInactiveIndex ] = binding; - - lastActiveBinding._cacheIndex = prevIndex; - bindings[ prevIndex ] = lastActiveBinding; - - }, - - - // Memory management of Interpolants for weight and time scale - - _lendControlInterpolant: function () { - - var interpolants = this._controlInterpolants, - lastActiveIndex = this._nActiveControlInterpolants ++, - interpolant = interpolants[ lastActiveIndex ]; - - if ( interpolant === undefined ) { - - interpolant = new LinearInterpolant( - new Float32Array( 2 ), new Float32Array( 2 ), - 1, this._controlInterpolantsResultBuffer ); - - interpolant.__cacheIndex = lastActiveIndex; - interpolants[ lastActiveIndex ] = interpolant; - - } - - return interpolant; - - }, - - _takeBackControlInterpolant: function ( interpolant ) { - - var interpolants = this._controlInterpolants, - prevIndex = interpolant.__cacheIndex, - - firstInactiveIndex = -- this._nActiveControlInterpolants, - - lastActiveInterpolant = interpolants[ firstInactiveIndex ]; - - interpolant.__cacheIndex = firstInactiveIndex; - interpolants[ firstInactiveIndex ] = interpolant; - - lastActiveInterpolant.__cacheIndex = prevIndex; - interpolants[ prevIndex ] = lastActiveInterpolant; - - }, - - _controlInterpolantsResultBuffer: new Float32Array( 1 ), - - // return an action for a clip optionally using a custom root target - // object (this method allocates a lot of dynamic memory in case a - // previously unknown clip/root combination is specified) - clipAction: function ( clip, optionalRoot ) { - - var root = optionalRoot || this._root, - rootUuid = root.uuid, - - clipObject = typeof clip === 'string' ? - AnimationClip.findByName( root, clip ) : clip, - - clipUuid = clipObject !== null ? clipObject.uuid : clip, - - actionsForClip = this._actionsByClip[ clipUuid ], - prototypeAction = null; - - if ( actionsForClip !== undefined ) { - - var existingAction = - actionsForClip.actionByRoot[ rootUuid ]; - - if ( existingAction !== undefined ) { - - return existingAction; - - } - - // we know the clip, so we don't have to parse all - // the bindings again but can just copy - prototypeAction = actionsForClip.knownActions[ 0 ]; - - // also, take the clip from the prototype action - if ( clipObject === null ) - clipObject = prototypeAction._clip; - - } - - // clip must be known when specified via string - if ( clipObject === null ) return null; - - // allocate all resources required to run it - var newAction = new AnimationAction( this, clipObject, optionalRoot ); - - this._bindAction( newAction, prototypeAction ); - - // and make the action known to the memory manager - this._addInactiveAction( newAction, clipUuid, rootUuid ); - - return newAction; - - }, - - // get an existing action - existingAction: function ( clip, optionalRoot ) { - - var root = optionalRoot || this._root, - rootUuid = root.uuid, - - clipObject = typeof clip === 'string' ? - AnimationClip.findByName( root, clip ) : clip, - - clipUuid = clipObject ? clipObject.uuid : clip, - - actionsForClip = this._actionsByClip[ clipUuid ]; - - if ( actionsForClip !== undefined ) { - - return actionsForClip.actionByRoot[ rootUuid ] || null; - - } - - return null; - - }, - - // deactivates all previously scheduled actions - stopAllAction: function () { - - var actions = this._actions, - nActions = this._nActiveActions, - bindings = this._bindings, - nBindings = this._nActiveBindings; - - this._nActiveActions = 0; - this._nActiveBindings = 0; - - for ( var i = 0; i !== nActions; ++ i ) { - - actions[ i ].reset(); - - } - - for ( var i = 0; i !== nBindings; ++ i ) { - - bindings[ i ].useCount = 0; - - } - - return this; - - }, - - // advance the time and update apply the animation - update: function ( deltaTime ) { - - deltaTime *= this.timeScale; - - var actions = this._actions, - nActions = this._nActiveActions, - - time = this.time += deltaTime, - timeDirection = Math.sign( deltaTime ), - - accuIndex = this._accuIndex ^= 1; - - // run active actions - - for ( var i = 0; i !== nActions; ++ i ) { - - var action = actions[ i ]; - - action._update( time, deltaTime, timeDirection, accuIndex ); - - } - - // update scene graph - - var bindings = this._bindings, - nBindings = this._nActiveBindings; - - for ( var i = 0; i !== nBindings; ++ i ) { - - bindings[ i ].apply( accuIndex ); - - } - - return this; - - }, - - // return this mixer's root target object - getRoot: function () { - - return this._root; - - }, - - // free all resources specific to a particular clip - uncacheClip: function ( clip ) { - - var actions = this._actions, - clipUuid = clip.uuid, - actionsByClip = this._actionsByClip, - actionsForClip = actionsByClip[ clipUuid ]; - - if ( actionsForClip !== undefined ) { - - // note: just calling _removeInactiveAction would mess up the - // iteration state and also require updating the state we can - // just throw away - - var actionsToRemove = actionsForClip.knownActions; - - for ( var i = 0, n = actionsToRemove.length; i !== n; ++ i ) { - - var action = actionsToRemove[ i ]; - - this._deactivateAction( action ); - - var cacheIndex = action._cacheIndex, - lastInactiveAction = actions[ actions.length - 1 ]; - - action._cacheIndex = null; - action._byClipCacheIndex = null; - - lastInactiveAction._cacheIndex = cacheIndex; - actions[ cacheIndex ] = lastInactiveAction; - actions.pop(); - - this._removeInactiveBindingsForAction( action ); - - } - - delete actionsByClip[ clipUuid ]; - - } - - }, - - // free all resources specific to a particular root target object - uncacheRoot: function ( root ) { - - var rootUuid = root.uuid, - actionsByClip = this._actionsByClip; - - for ( var clipUuid in actionsByClip ) { - - var actionByRoot = actionsByClip[ clipUuid ].actionByRoot, - action = actionByRoot[ rootUuid ]; - - if ( action !== undefined ) { - - this._deactivateAction( action ); - this._removeInactiveAction( action ); - - } - - } - - var bindingsByRoot = this._bindingsByRootAndName, - bindingByName = bindingsByRoot[ rootUuid ]; - - if ( bindingByName !== undefined ) { - - for ( var trackName in bindingByName ) { - - var binding = bindingByName[ trackName ]; - binding.restoreOriginalState(); - this._removeInactiveBinding( binding ); - - } - - } - - }, - - // remove a targeted clip from the cache - uncacheAction: function ( clip, optionalRoot ) { - - var action = this.existingAction( clip, optionalRoot ); - - if ( action !== null ) { - - this._deactivateAction( action ); - this._removeInactiveAction( action ); - - } - - } - -} ); - - -export { AnimationMixer }; diff --git a/cases/esbuild-three/src/base/animation/AnimationObjectGroup.d.ts b/cases/esbuild-three/src/base/animation/AnimationObjectGroup.d.ts deleted file mode 100644 index 8bbfe38319..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationObjectGroup.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export class AnimationObjectGroup { - - constructor( ...args: any[] ); - - uuid: string; - stats: { - bindingsPerObject: number; - objects: { - total: number; - inUse: number; - }; - }; - - add( ...args: any[] ): void; - remove( ...args: any[] ): void; - uncache( ...args: any[] ): void; - -} diff --git a/cases/esbuild-three/src/base/animation/AnimationObjectGroup.js b/cases/esbuild-three/src/base/animation/AnimationObjectGroup.js deleted file mode 100644 index 7f6309006f..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationObjectGroup.js +++ /dev/null @@ -1,381 +0,0 @@ -import { PropertyBinding } from './PropertyBinding.js'; -import { _Math } from '../math/Math.js'; - -/** - * - * A group of objects that receives a shared animation state. - * - * Usage: - * - * - Add objects you would otherwise pass as 'root' to the - * constructor or the .clipAction method of AnimationMixer. - * - * - Instead pass this object as 'root'. - * - * - You can also add and remove objects later when the mixer - * is running. - * - * Note: - * - * Objects of this class appear as one object to the mixer, - * so cache control of the individual objects must be done - * on the group. - * - * Limitation: - * - * - The animated properties must be compatible among the - * all objects in the group. - * - * - A single property can either be controlled through a - * target group or directly, but not both. - * - * @author tschw - */ - -function AnimationObjectGroup() { - - this.uuid = _Math.generateUUID(); - - // cached objects followed by the active ones - this._objects = Array.prototype.slice.call( arguments ); - - this.nCachedObjects_ = 0; // threshold - // note: read by PropertyBinding.Composite - - var indices = {}; - this._indicesByUUID = indices; // for bookkeeping - - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { - - indices[ arguments[ i ].uuid ] = i; - - } - - this._paths = []; // inside: string - this._parsedPaths = []; // inside: { we don't care, here } - this._bindings = []; // inside: Array< PropertyBinding > - this._bindingsIndicesByPath = {}; // inside: indices in these arrays - - var scope = this; - - this.stats = { - - objects: { - get total() { - - return scope._objects.length; - - }, - get inUse() { - - return this.total - scope.nCachedObjects_; - - } - }, - get bindingsPerObject() { - - return scope._bindings.length; - - } - - }; - -} - -Object.assign( AnimationObjectGroup.prototype, { - - isAnimationObjectGroup: true, - - add: function () { - - var objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - paths = this._paths, - parsedPaths = this._parsedPaths, - bindings = this._bindings, - nBindings = bindings.length, - knownObject = undefined; - - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { - - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ]; - - if ( index === undefined ) { - - // unknown object -> add it to the ACTIVE region - - index = nObjects ++; - indicesByUUID[ uuid ] = index; - objects.push( object ); - - // accounting is done, now do the same for all bindings - - for ( var j = 0, m = nBindings; j !== m; ++ j ) { - - bindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) ); - - } - - } else if ( index < nCachedObjects ) { - - knownObject = objects[ index ]; - - // move existing object to the ACTIVE region - - var firstActiveIndex = -- nCachedObjects, - lastCachedObject = objects[ firstActiveIndex ]; - - indicesByUUID[ lastCachedObject.uuid ] = index; - objects[ index ] = lastCachedObject; - - indicesByUUID[ uuid ] = firstActiveIndex; - objects[ firstActiveIndex ] = object; - - // accounting is done, now do the same for all bindings - - for ( var j = 0, m = nBindings; j !== m; ++ j ) { - - var bindingsForPath = bindings[ j ], - lastCached = bindingsForPath[ firstActiveIndex ], - binding = bindingsForPath[ index ]; - - bindingsForPath[ index ] = lastCached; - - if ( binding === undefined ) { - - // since we do not bother to create new bindings - // for objects that are cached, the binding may - // or may not exist - - binding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ); - - } - - bindingsForPath[ firstActiveIndex ] = binding; - - } - - } else if ( objects[ index ] !== knownObject ) { - - console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' + - 'detected. Clean the caches or recreate your infrastructure when reloading scenes.' ); - - } // else the object is already where we want it to be - - } // for arguments - - this.nCachedObjects_ = nCachedObjects; - - }, - - remove: function () { - - var objects = this._objects, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - bindings = this._bindings, - nBindings = bindings.length; - - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { - - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ]; - - if ( index !== undefined && index >= nCachedObjects ) { - - // move existing object into the CACHED region - - var lastCachedIndex = nCachedObjects ++, - firstActiveObject = objects[ lastCachedIndex ]; - - indicesByUUID[ firstActiveObject.uuid ] = index; - objects[ index ] = firstActiveObject; - - indicesByUUID[ uuid ] = lastCachedIndex; - objects[ lastCachedIndex ] = object; - - // accounting is done, now do the same for all bindings - - for ( var j = 0, m = nBindings; j !== m; ++ j ) { - - var bindingsForPath = bindings[ j ], - firstActive = bindingsForPath[ lastCachedIndex ], - binding = bindingsForPath[ index ]; - - bindingsForPath[ index ] = firstActive; - bindingsForPath[ lastCachedIndex ] = binding; - - } - - } - - } // for arguments - - this.nCachedObjects_ = nCachedObjects; - - }, - - // remove & forget - uncache: function () { - - var objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - indicesByUUID = this._indicesByUUID, - bindings = this._bindings, - nBindings = bindings.length; - - for ( var i = 0, n = arguments.length; i !== n; ++ i ) { - - var object = arguments[ i ], - uuid = object.uuid, - index = indicesByUUID[ uuid ]; - - if ( index !== undefined ) { - - delete indicesByUUID[ uuid ]; - - if ( index < nCachedObjects ) { - - // object is cached, shrink the CACHED region - - var firstActiveIndex = -- nCachedObjects, - lastCachedObject = objects[ firstActiveIndex ], - lastIndex = -- nObjects, - lastObject = objects[ lastIndex ]; - - // last cached object takes this object's place - indicesByUUID[ lastCachedObject.uuid ] = index; - objects[ index ] = lastCachedObject; - - // last object goes to the activated slot and pop - indicesByUUID[ lastObject.uuid ] = firstActiveIndex; - objects[ firstActiveIndex ] = lastObject; - objects.pop(); - - // accounting is done, now do the same for all bindings - - for ( var j = 0, m = nBindings; j !== m; ++ j ) { - - var bindingsForPath = bindings[ j ], - lastCached = bindingsForPath[ firstActiveIndex ], - last = bindingsForPath[ lastIndex ]; - - bindingsForPath[ index ] = lastCached; - bindingsForPath[ firstActiveIndex ] = last; - bindingsForPath.pop(); - - } - - } else { - - // object is active, just swap with the last and pop - - var lastIndex = -- nObjects, - lastObject = objects[ lastIndex ]; - - indicesByUUID[ lastObject.uuid ] = index; - objects[ index ] = lastObject; - objects.pop(); - - // accounting is done, now do the same for all bindings - - for ( var j = 0, m = nBindings; j !== m; ++ j ) { - - var bindingsForPath = bindings[ j ]; - - bindingsForPath[ index ] = bindingsForPath[ lastIndex ]; - bindingsForPath.pop(); - - } - - } // cached or active - - } // if object is known - - } // for arguments - - this.nCachedObjects_ = nCachedObjects; - - }, - - // Internal interface used by befriended PropertyBinding.Composite: - - subscribe_: function ( path, parsedPath ) { - - // returns an array of bindings for the given path that is changed - // according to the contained objects in the group - - var indicesByPath = this._bindingsIndicesByPath, - index = indicesByPath[ path ], - bindings = this._bindings; - - if ( index !== undefined ) return bindings[ index ]; - - var paths = this._paths, - parsedPaths = this._parsedPaths, - objects = this._objects, - nObjects = objects.length, - nCachedObjects = this.nCachedObjects_, - bindingsForPath = new Array( nObjects ); - - index = bindings.length; - - indicesByPath[ path ] = index; - - paths.push( path ); - parsedPaths.push( parsedPath ); - bindings.push( bindingsForPath ); - - for ( var i = nCachedObjects, n = objects.length; i !== n; ++ i ) { - - var object = objects[ i ]; - bindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath ); - - } - - return bindingsForPath; - - }, - - unsubscribe_: function ( path ) { - - // tells the group to forget about a property path and no longer - // update the array previously obtained with 'subscribe_' - - var indicesByPath = this._bindingsIndicesByPath, - index = indicesByPath[ path ]; - - if ( index !== undefined ) { - - var paths = this._paths, - parsedPaths = this._parsedPaths, - bindings = this._bindings, - lastBindingsIndex = bindings.length - 1, - lastBindings = bindings[ lastBindingsIndex ], - lastBindingsPath = path[ lastBindingsIndex ]; - - indicesByPath[ lastBindingsPath ] = index; - - bindings[ index ] = lastBindings; - bindings.pop(); - - parsedPaths[ index ] = parsedPaths[ lastBindingsIndex ]; - parsedPaths.pop(); - - paths[ index ] = paths[ lastBindingsIndex ]; - paths.pop(); - - } - - } - -} ); - - -export { AnimationObjectGroup }; diff --git a/cases/esbuild-three/src/base/animation/AnimationUtils.d.ts b/cases/esbuild-three/src/base/animation/AnimationUtils.d.ts deleted file mode 100644 index f13d93c7c1..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationUtils.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export namespace AnimationUtils { - export function arraySlice( array: any, from: number, to: number ): any; - export function convertArray( array: any, type: any, forceClone: boolean ): any; - export function isTypedArray( object: any ): boolean; - export function getKeyFrameOrder( times: number ): number[]; - export function sortedArray( - values: any[], - stride: number, - order: number[] - ): any[]; - export function flattenJSON( - jsonKeys: string[], - times: any[], - values: any[], - valuePropertyName: string - ): void; -} diff --git a/cases/esbuild-three/src/base/animation/AnimationUtils.js b/cases/esbuild-three/src/base/animation/AnimationUtils.js deleted file mode 100644 index 300213e081..0000000000 --- a/cases/esbuild-three/src/base/animation/AnimationUtils.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @author tschw - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - */ - -var AnimationUtils = { - - // same as Array.prototype.slice, but also works on typed arrays - arraySlice: function ( array, from, to ) { - - if ( AnimationUtils.isTypedArray( array ) ) { - - // in ios9 array.subarray(from, undefined) will return empty array - // but array.subarray(from) or array.subarray(from, len) is correct - return new array.constructor( array.subarray( from, to !== undefined ? to : array.length ) ); - - } - - return array.slice( from, to ); - - }, - - // converts an array to a specific type - convertArray: function ( array, type, forceClone ) { - - if ( ! array || // let 'undefined' and 'null' pass - ! forceClone && array.constructor === type ) return array; - - if ( typeof type.BYTES_PER_ELEMENT === 'number' ) { - - return new type( array ); // create typed array - - } - - return Array.prototype.slice.call( array ); // create Array - - }, - - isTypedArray: function ( object ) { - - return ArrayBuffer.isView( object ) && - ! ( object instanceof DataView ); - - }, - - // returns an array by which times and values can be sorted - getKeyframeOrder: function ( times ) { - - function compareTime( i, j ) { - - return times[ i ] - times[ j ]; - - } - - var n = times.length; - var result = new Array( n ); - for ( var i = 0; i !== n; ++ i ) result[ i ] = i; - - result.sort( compareTime ); - - return result; - - }, - - // uses the array previously returned by 'getKeyframeOrder' to sort data - sortedArray: function ( values, stride, order ) { - - var nValues = values.length; - var result = new values.constructor( nValues ); - - for ( var i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) { - - var srcOffset = order[ i ] * stride; - - for ( var j = 0; j !== stride; ++ j ) { - - result[ dstOffset ++ ] = values[ srcOffset + j ]; - - } - - } - - return result; - - }, - - // function for parsing AOS keyframe formats - flattenJSON: function ( jsonKeys, times, values, valuePropertyName ) { - - var i = 1, key = jsonKeys[ 0 ]; - - while ( key !== undefined && key[ valuePropertyName ] === undefined ) { - - key = jsonKeys[ i ++ ]; - - } - - if ( key === undefined ) return; // no data - - var value = key[ valuePropertyName ]; - if ( value === undefined ) return; // no data - - if ( Array.isArray( value ) ) { - - do { - - value = key[ valuePropertyName ]; - - if ( value !== undefined ) { - - times.push( key.time ); - values.push.apply( values, value ); // push all elements - - } - - key = jsonKeys[ i ++ ]; - - } while ( key !== undefined ); - - } else if ( value.toArray !== undefined ) { - - // ...assume THREE.Math-ish - - do { - - value = key[ valuePropertyName ]; - - if ( value !== undefined ) { - - times.push( key.time ); - value.toArray( values, values.length ); - - } - - key = jsonKeys[ i ++ ]; - - } while ( key !== undefined ); - - } else { - - // otherwise push as-is - - do { - - value = key[ valuePropertyName ]; - - if ( value !== undefined ) { - - times.push( key.time ); - values.push( value ); - - } - - key = jsonKeys[ i ++ ]; - - } while ( key !== undefined ); - - } - - } - -}; - -export { AnimationUtils }; diff --git a/cases/esbuild-three/src/base/animation/KeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/KeyframeTrack.d.ts deleted file mode 100644 index 73035c6b3e..0000000000 --- a/cases/esbuild-three/src/base/animation/KeyframeTrack.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { DiscreteInterpolant } from './../math/interpolants/DiscreteInterpolant'; -import { LinearInterpolant } from './../math/interpolants/LinearInterpolant'; -import { CubicInterpolant } from './../math/interpolants/CubicInterpolant'; -import { InterpolationModes } from '../constants'; - -export class KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - - name: string; - times: any[]; - values: any[]; - - ValueTypeName: string; - TimeBufferType: Float32Array; - ValueBufferType: Float32Array; - - DefaultInterpolation: InterpolationModes; - - InterpolantFactoryMethodDiscrete( result: any ): DiscreteInterpolant; - InterpolantFactoryMethodLinear( result: any ): LinearInterpolant; - InterpolantFactoryMethodSmooth( result: any ): CubicInterpolant; - - setInterpolation( interpolation: InterpolationModes ): void; - getInterpolation(): InterpolationModes; - - getValuesize(): number; - - shift( timeOffset: number ): KeyframeTrack; - scale( timeScale: number ): KeyframeTrack; - trim( startTime: number, endTime: number ): KeyframeTrack; - validate(): boolean; - optimize(): KeyframeTrack; - - static parse( json: any ): KeyframeTrack; - static toJSON( track: KeyframeTrack ): any; - -} diff --git a/cases/esbuild-three/src/base/animation/KeyframeTrack.js b/cases/esbuild-three/src/base/animation/KeyframeTrack.js deleted file mode 100644 index d490067388..0000000000 --- a/cases/esbuild-three/src/base/animation/KeyframeTrack.js +++ /dev/null @@ -1,469 +0,0 @@ -import { - InterpolateLinear, - InterpolateSmooth, - InterpolateDiscrete -} from '../constants.js'; -import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js'; -import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js'; -import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js'; -import { AnimationUtils } from './AnimationUtils.js'; - -/** - * - * A timed sequence of keyframes for a specific property. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function KeyframeTrack( name, times, values, interpolation ) { - - if ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' ); - if ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name ); - - this.name = name; - - this.times = AnimationUtils.convertArray( times, this.TimeBufferType ); - this.values = AnimationUtils.convertArray( values, this.ValueBufferType ); - - this.setInterpolation( interpolation || this.DefaultInterpolation ); - -} - -// Static methods - -Object.assign( KeyframeTrack, { - - // Serialization (in static context, because of constructor invocation - // and automatic invocation of .toJSON): - - toJSON: function ( track ) { - - var trackType = track.constructor; - - var json; - - // derived classes can define a static toJSON method - if ( trackType.toJSON !== undefined ) { - - json = trackType.toJSON( track ); - - } else { - - // by default, we assume the data can be serialized as-is - json = { - - 'name': track.name, - 'times': AnimationUtils.convertArray( track.times, Array ), - 'values': AnimationUtils.convertArray( track.values, Array ) - - }; - - var interpolation = track.getInterpolation(); - - if ( interpolation !== track.DefaultInterpolation ) { - - json.interpolation = interpolation; - - } - - } - - json.type = track.ValueTypeName; // mandatory - - return json; - - } - -} ); - -Object.assign( KeyframeTrack.prototype, { - - constructor: KeyframeTrack, - - TimeBufferType: Float32Array, - - ValueBufferType: Float32Array, - - DefaultInterpolation: InterpolateLinear, - - InterpolantFactoryMethodDiscrete: function ( result ) { - - return new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result ); - - }, - - InterpolantFactoryMethodLinear: function ( result ) { - - return new LinearInterpolant( this.times, this.values, this.getValueSize(), result ); - - }, - - InterpolantFactoryMethodSmooth: function ( result ) { - - return new CubicInterpolant( this.times, this.values, this.getValueSize(), result ); - - }, - - setInterpolation: function ( interpolation ) { - - var factoryMethod; - - switch ( interpolation ) { - - case InterpolateDiscrete: - - factoryMethod = this.InterpolantFactoryMethodDiscrete; - - break; - - case InterpolateLinear: - - factoryMethod = this.InterpolantFactoryMethodLinear; - - break; - - case InterpolateSmooth: - - factoryMethod = this.InterpolantFactoryMethodSmooth; - - break; - - } - - if ( factoryMethod === undefined ) { - - var message = "unsupported interpolation for " + - this.ValueTypeName + " keyframe track named " + this.name; - - if ( this.createInterpolant === undefined ) { - - // fall back to default, unless the default itself is messed up - if ( interpolation !== this.DefaultInterpolation ) { - - this.setInterpolation( this.DefaultInterpolation ); - - } else { - - throw new Error( message ); // fatal, in this case - - } - - } - - console.warn( 'THREE.KeyframeTrack:', message ); - return this; - - } - - this.createInterpolant = factoryMethod; - - return this; - - }, - - getInterpolation: function () { - - switch ( this.createInterpolant ) { - - case this.InterpolantFactoryMethodDiscrete: - - return InterpolateDiscrete; - - case this.InterpolantFactoryMethodLinear: - - return InterpolateLinear; - - case this.InterpolantFactoryMethodSmooth: - - return InterpolateSmooth; - - } - - }, - - getValueSize: function () { - - return this.values.length / this.times.length; - - }, - - // move all keyframes either forwards or backwards in time - shift: function ( timeOffset ) { - - if ( timeOffset !== 0.0 ) { - - var times = this.times; - - for ( var i = 0, n = times.length; i !== n; ++ i ) { - - times[ i ] += timeOffset; - - } - - } - - return this; - - }, - - // scale all keyframe times by a factor (useful for frame <-> seconds conversions) - scale: function ( timeScale ) { - - if ( timeScale !== 1.0 ) { - - var times = this.times; - - for ( var i = 0, n = times.length; i !== n; ++ i ) { - - times[ i ] *= timeScale; - - } - - } - - return this; - - }, - - // removes keyframes before and after animation without changing any values within the range [startTime, endTime]. - // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values - trim: function ( startTime, endTime ) { - - var times = this.times, - nKeys = times.length, - from = 0, - to = nKeys - 1; - - while ( from !== nKeys && times[ from ] < startTime ) { - - ++ from; - - } - - while ( to !== - 1 && times[ to ] > endTime ) { - - -- to; - - } - - ++ to; // inclusive -> exclusive bound - - if ( from !== 0 || to !== nKeys ) { - - // empty tracks are forbidden, so keep at least one keyframe - if ( from >= to ) to = Math.max( to, 1 ), from = to - 1; - - var stride = this.getValueSize(); - this.times = AnimationUtils.arraySlice( times, from, to ); - this.values = AnimationUtils.arraySlice( this.values, from * stride, to * stride ); - - } - - return this; - - }, - - // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable - validate: function () { - - var valid = true; - - var valueSize = this.getValueSize(); - if ( valueSize - Math.floor( valueSize ) !== 0 ) { - - console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this ); - valid = false; - - } - - var times = this.times, - values = this.values, - - nKeys = times.length; - - if ( nKeys === 0 ) { - - console.error( 'THREE.KeyframeTrack: Track is empty.', this ); - valid = false; - - } - - var prevTime = null; - - for ( var i = 0; i !== nKeys; i ++ ) { - - var currTime = times[ i ]; - - if ( typeof currTime === 'number' && isNaN( currTime ) ) { - - console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime ); - valid = false; - break; - - } - - if ( prevTime !== null && prevTime > currTime ) { - - console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime ); - valid = false; - break; - - } - - prevTime = currTime; - - } - - if ( values !== undefined ) { - - if ( AnimationUtils.isTypedArray( values ) ) { - - for ( var i = 0, n = values.length; i !== n; ++ i ) { - - var value = values[ i ]; - - if ( isNaN( value ) ) { - - console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value ); - valid = false; - break; - - } - - } - - } - - } - - return valid; - - }, - - // removes equivalent sequential keys as common in morph target sequences - // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0) - optimize: function () { - - var times = this.times, - values = this.values, - stride = this.getValueSize(), - - smoothInterpolation = this.getInterpolation() === InterpolateSmooth, - - writeIndex = 1, - lastIndex = times.length - 1; - - for ( var i = 1; i < lastIndex; ++ i ) { - - var keep = false; - - var time = times[ i ]; - var timeNext = times[ i + 1 ]; - - // remove adjacent keyframes scheduled at the same time - - if ( time !== timeNext && ( i !== 1 || time !== time[ 0 ] ) ) { - - if ( ! smoothInterpolation ) { - - // remove unnecessary keyframes same as their neighbors - - var offset = i * stride, - offsetP = offset - stride, - offsetN = offset + stride; - - for ( var j = 0; j !== stride; ++ j ) { - - var value = values[ offset + j ]; - - if ( value !== values[ offsetP + j ] || - value !== values[ offsetN + j ] ) { - - keep = true; - break; - - } - - } - - } else { - - keep = true; - - } - - } - - // in-place compaction - - if ( keep ) { - - if ( i !== writeIndex ) { - - times[ writeIndex ] = times[ i ]; - - var readOffset = i * stride, - writeOffset = writeIndex * stride; - - for ( var j = 0; j !== stride; ++ j ) { - - values[ writeOffset + j ] = values[ readOffset + j ]; - - } - - } - - ++ writeIndex; - - } - - } - - // flush last keyframe (compaction looks ahead) - - if ( lastIndex > 0 ) { - - times[ writeIndex ] = times[ lastIndex ]; - - for ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) { - - values[ writeOffset + j ] = values[ readOffset + j ]; - - } - - ++ writeIndex; - - } - - if ( writeIndex !== times.length ) { - - this.times = AnimationUtils.arraySlice( times, 0, writeIndex ); - this.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride ); - - } - - return this; - - }, - - clone: function () { - - var times = AnimationUtils.arraySlice( this.times, 0 ); - var values = AnimationUtils.arraySlice( this.values, 0 ); - - var TypedKeyframeTrack = this.constructor; - var track = new TypedKeyframeTrack( this.name, times, values ); - - // Interpolant argument to constructor is not saved, so copy the factory method directly. - track.createInterpolant = this.createInterpolant; - - return track; - - } - -} ); - -export { KeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/PropertyBinding.d.ts b/cases/esbuild-three/src/base/animation/PropertyBinding.d.ts deleted file mode 100644 index c860ebde2c..0000000000 --- a/cases/esbuild-three/src/base/animation/PropertyBinding.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export class PropertyBinding { - - constructor( rootNode: any, path: string, parsedPath?: any ); - - path: string; - parsedPath: any; - node: any; - rootNode: any; - - getValue( targetArray: any, offset: number ): any; - setValue( sourceArray: any, offset: number ): void; - bind(): void; - unbind(): void; - - BindingType: { [bindingType: string]: number }; - Versioning: { [versioning: string]: number }; - - GetterByBindingType: Function[]; - SetterByBindingTypeAndVersioning: Array; - - static create( - root: any, - path: any, - parsedPath?: any - ): PropertyBinding | PropertyBinding.Composite; - static parseTrackName( trackName: string ): any; - static findNode( root: any, nodeName: string ): any; - -} - -export namespace PropertyBinding { - export class Composite { - - constructor( targetGroup: any, path: any, parsedPath?: any ); - - getValue( array: any, offset: number ): any; - setValue( array: any, offset: number ): void; - bind(): void; - unbind(): void; - - } -} diff --git a/cases/esbuild-three/src/base/animation/PropertyBinding.js b/cases/esbuild-three/src/base/animation/PropertyBinding.js deleted file mode 100644 index 252d30f259..0000000000 --- a/cases/esbuild-three/src/base/animation/PropertyBinding.js +++ /dev/null @@ -1,714 +0,0 @@ -/** - * - * A reference to a real property in the scene graph. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -// Characters [].:/ are reserved for track binding syntax. -var _RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; -var _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' ); - -// Attempts to allow node names from any language. ES5's `\w` regexp matches -// only latin characters, and the unicode \p{L} is not yet supported. So -// instead, we exclude reserved characters and match everything else. -var _wordChar = '[^' + _RESERVED_CHARS_RE + ']'; -var _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; - -// Parent directories, delimited by '/' or ':'. Currently unused, but must -// be matched to parse the rest of the track name. -var _directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', _wordChar ); - -// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. -var _nodeRe = /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot ); - -// Object on target node, and accessor. May not contain reserved -// characters. Accessor may contain any character except closing bracket. -var _objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', _wordChar ); - -// Property and accessor. May not contain reserved characters. Accessor may -// contain any non-bracket characters. -var _propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', _wordChar ); - -var _trackRe = new RegExp( '' - + '^' - + _directoryRe - + _nodeRe - + _objectRe - + _propertyRe - + '$' -); - -var _supportedObjectNames = [ 'material', 'materials', 'bones' ]; - -function Composite( targetGroup, path, optionalParsedPath ) { - - var parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path ); - - this._targetGroup = targetGroup; - this._bindings = targetGroup.subscribe_( path, parsedPath ); - -} - -Object.assign( Composite.prototype, { - - getValue: function ( array, offset ) { - - this.bind(); // bind all binding - - var firstValidIndex = this._targetGroup.nCachedObjects_, - binding = this._bindings[ firstValidIndex ]; - - // and only call .getValue on the first - if ( binding !== undefined ) binding.getValue( array, offset ); - - }, - - setValue: function ( array, offset ) { - - var bindings = this._bindings; - - for ( var i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { - - bindings[ i ].setValue( array, offset ); - - } - - }, - - bind: function () { - - var bindings = this._bindings; - - for ( var i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { - - bindings[ i ].bind(); - - } - - }, - - unbind: function () { - - var bindings = this._bindings; - - for ( var i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) { - - bindings[ i ].unbind(); - - } - - } - -} ); - - -function PropertyBinding( rootNode, path, parsedPath ) { - - this.path = path; - this.parsedPath = parsedPath || PropertyBinding.parseTrackName( path ); - - this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName ) || rootNode; - - this.rootNode = rootNode; - -} - -Object.assign( PropertyBinding, { - - Composite: Composite, - - create: function ( root, path, parsedPath ) { - - if ( ! ( root && root.isAnimationObjectGroup ) ) { - - return new PropertyBinding( root, path, parsedPath ); - - } else { - - return new PropertyBinding.Composite( root, path, parsedPath ); - - } - - }, - - /** - * Replaces spaces with underscores and removes unsupported characters from - * node names, to ensure compatibility with parseTrackName(). - * - * @param {string} name Node name to be sanitized. - * @return {string} - */ - sanitizeNodeName: function ( name ) { - - return name.replace( /\s/g, '_' ).replace( _reservedRe, '' ); - - }, - - parseTrackName: function ( trackName ) { - - var matches = _trackRe.exec( trackName ); - - if ( ! matches ) { - - throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); - - } - - var results = { - // directoryName: matches[ 1 ], // (tschw) currently unused - nodeName: matches[ 2 ], - objectName: matches[ 3 ], - objectIndex: matches[ 4 ], - propertyName: matches[ 5 ], // required - propertyIndex: matches[ 6 ] - }; - - var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); - - if ( lastDot !== undefined && lastDot !== - 1 ) { - - var objectName = results.nodeName.substring( lastDot + 1 ); - - // Object names must be checked against a whitelist. Otherwise, there - // is no way to parse 'foo.bar.baz': 'baz' must be a property, but - // 'bar' could be the objectName, or part of a nodeName (which can - // include '.' characters). - if ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) { - - results.nodeName = results.nodeName.substring( 0, lastDot ); - results.objectName = objectName; - - } - - } - - if ( results.propertyName === null || results.propertyName.length === 0 ) { - - throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); - - } - - return results; - - }, - - findNode: function ( root, nodeName ) { - - if ( ! nodeName || nodeName === "" || nodeName === "root" || nodeName === "." || nodeName === - 1 || nodeName === root.name || nodeName === root.uuid ) { - - return root; - - } - - // search into skeleton bones. - if ( root.skeleton ) { - - var bone = root.skeleton.getBoneByName( nodeName ); - - if ( bone !== undefined ) { - - return bone; - - } - - } - - // search into node subtree. - if ( root.children ) { - - var searchNodeSubtree = function ( children ) { - - for ( var i = 0; i < children.length; i ++ ) { - - var childNode = children[ i ]; - - if ( childNode.name === nodeName || childNode.uuid === nodeName ) { - - return childNode; - - } - - var result = searchNodeSubtree( childNode.children ); - - if ( result ) return result; - - } - - return null; - - }; - - var subTreeNode = searchNodeSubtree( root.children ); - - if ( subTreeNode ) { - - return subTreeNode; - - } - - } - - return null; - - } - -} ); - -Object.assign( PropertyBinding.prototype, { // prototype, continued - - // these are used to "bind" a nonexistent property - _getValue_unavailable: function () {}, - _setValue_unavailable: function () {}, - - BindingType: { - Direct: 0, - EntireArray: 1, - ArrayElement: 2, - HasFromToArray: 3 - }, - - Versioning: { - None: 0, - NeedsUpdate: 1, - MatrixWorldNeedsUpdate: 2 - }, - - GetterByBindingType: [ - - function getValue_direct( buffer, offset ) { - - buffer[ offset ] = this.node[ this.propertyName ]; - - }, - - function getValue_array( buffer, offset ) { - - var source = this.resolvedProperty; - - for ( var i = 0, n = source.length; i !== n; ++ i ) { - - buffer[ offset ++ ] = source[ i ]; - - } - - }, - - function getValue_arrayElement( buffer, offset ) { - - buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ]; - - }, - - function getValue_toArray( buffer, offset ) { - - this.resolvedProperty.toArray( buffer, offset ); - - } - - ], - - SetterByBindingTypeAndVersioning: [ - - [ - // Direct - - function setValue_direct( buffer, offset ) { - - this.targetObject[ this.propertyName ] = buffer[ offset ]; - - }, - - function setValue_direct_setNeedsUpdate( buffer, offset ) { - - this.targetObject[ this.propertyName ] = buffer[ offset ]; - this.targetObject.needsUpdate = true; - - }, - - function setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) { - - this.targetObject[ this.propertyName ] = buffer[ offset ]; - this.targetObject.matrixWorldNeedsUpdate = true; - - } - - ], [ - - // EntireArray - - function setValue_array( buffer, offset ) { - - var dest = this.resolvedProperty; - - for ( var i = 0, n = dest.length; i !== n; ++ i ) { - - dest[ i ] = buffer[ offset ++ ]; - - } - - }, - - function setValue_array_setNeedsUpdate( buffer, offset ) { - - var dest = this.resolvedProperty; - - for ( var i = 0, n = dest.length; i !== n; ++ i ) { - - dest[ i ] = buffer[ offset ++ ]; - - } - - this.targetObject.needsUpdate = true; - - }, - - function setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) { - - var dest = this.resolvedProperty; - - for ( var i = 0, n = dest.length; i !== n; ++ i ) { - - dest[ i ] = buffer[ offset ++ ]; - - } - - this.targetObject.matrixWorldNeedsUpdate = true; - - } - - ], [ - - // ArrayElement - - function setValue_arrayElement( buffer, offset ) { - - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; - - }, - - function setValue_arrayElement_setNeedsUpdate( buffer, offset ) { - - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; - this.targetObject.needsUpdate = true; - - }, - - function setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) { - - this.resolvedProperty[ this.propertyIndex ] = buffer[ offset ]; - this.targetObject.matrixWorldNeedsUpdate = true; - - } - - ], [ - - // HasToFromArray - - function setValue_fromArray( buffer, offset ) { - - this.resolvedProperty.fromArray( buffer, offset ); - - }, - - function setValue_fromArray_setNeedsUpdate( buffer, offset ) { - - this.resolvedProperty.fromArray( buffer, offset ); - this.targetObject.needsUpdate = true; - - }, - - function setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) { - - this.resolvedProperty.fromArray( buffer, offset ); - this.targetObject.matrixWorldNeedsUpdate = true; - - } - - ] - - ], - - getValue: function getValue_unbound( targetArray, offset ) { - - this.bind(); - this.getValue( targetArray, offset ); - - // Note: This class uses a State pattern on a per-method basis: - // 'bind' sets 'this.getValue' / 'setValue' and shadows the - // prototype version of these methods with one that represents - // the bound state. When the property is not found, the methods - // become no-ops. - - }, - - setValue: function getValue_unbound( sourceArray, offset ) { - - this.bind(); - this.setValue( sourceArray, offset ); - - }, - - // create getter / setter pair for a property in the scene graph - bind: function () { - - var targetObject = this.node, - parsedPath = this.parsedPath, - - objectName = parsedPath.objectName, - propertyName = parsedPath.propertyName, - propertyIndex = parsedPath.propertyIndex; - - if ( ! targetObject ) { - - targetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName ) || this.rootNode; - - this.node = targetObject; - - } - - // set fail state so we can just 'return' on error - this.getValue = this._getValue_unavailable; - this.setValue = this._setValue_unavailable; - - // ensure there is a value node - if ( ! targetObject ) { - - console.error( 'THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\'t found.' ); - return; - - } - - if ( objectName ) { - - var objectIndex = parsedPath.objectIndex; - - // special cases were we need to reach deeper into the hierarchy to get the face materials.... - switch ( objectName ) { - - case 'materials': - - if ( ! targetObject.material ) { - - console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this ); - return; - - } - - if ( ! targetObject.material.materials ) { - - console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this ); - return; - - } - - targetObject = targetObject.material.materials; - - break; - - case 'bones': - - if ( ! targetObject.skeleton ) { - - console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this ); - return; - - } - - // potential future optimization: skip this if propertyIndex is already an integer - // and convert the integer string to a true integer. - - targetObject = targetObject.skeleton.bones; - - // support resolving morphTarget names into indices. - for ( var i = 0; i < targetObject.length; i ++ ) { - - if ( targetObject[ i ].name === objectIndex ) { - - objectIndex = i; - break; - - } - - } - - break; - - default: - - if ( targetObject[ objectName ] === undefined ) { - - console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this ); - return; - - } - - targetObject = targetObject[ objectName ]; - - } - - - if ( objectIndex !== undefined ) { - - if ( targetObject[ objectIndex ] === undefined ) { - - console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject ); - return; - - } - - targetObject = targetObject[ objectIndex ]; - - } - - } - - // resolve property - var nodeProperty = targetObject[ propertyName ]; - - if ( nodeProperty === undefined ) { - - var nodeName = parsedPath.nodeName; - - console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName + - '.' + propertyName + ' but it wasn\'t found.', targetObject ); - return; - - } - - // determine versioning scheme - var versioning = this.Versioning.None; - - this.targetObject = targetObject; - - if ( targetObject.needsUpdate !== undefined ) { // material - - versioning = this.Versioning.NeedsUpdate; - - } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform - - versioning = this.Versioning.MatrixWorldNeedsUpdate; - - } - - // determine how the property gets bound - var bindingType = this.BindingType.Direct; - - if ( propertyIndex !== undefined ) { - - // access a sub element of the property array (only primitives are supported right now) - - if ( propertyName === "morphTargetInfluences" ) { - - // potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer. - - // support resolving morphTarget names into indices. - if ( ! targetObject.geometry ) { - - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this ); - return; - - } - - if ( targetObject.geometry.isBufferGeometry ) { - - if ( ! targetObject.geometry.morphAttributes ) { - - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this ); - return; - - } - - for ( var i = 0; i < this.node.geometry.morphAttributes.position.length; i ++ ) { - - if ( targetObject.geometry.morphAttributes.position[ i ].name === propertyIndex ) { - - propertyIndex = i; - break; - - } - - } - - - } else { - - if ( ! targetObject.geometry.morphTargets ) { - - console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.', this ); - return; - - } - - for ( var i = 0; i < this.node.geometry.morphTargets.length; i ++ ) { - - if ( targetObject.geometry.morphTargets[ i ].name === propertyIndex ) { - - propertyIndex = i; - break; - - } - - } - - } - - } - - bindingType = this.BindingType.ArrayElement; - - this.resolvedProperty = nodeProperty; - this.propertyIndex = propertyIndex; - - } else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) { - - // must use copy for Object3D.Euler/Quaternion - - bindingType = this.BindingType.HasFromToArray; - - this.resolvedProperty = nodeProperty; - - } else if ( Array.isArray( nodeProperty ) ) { - - bindingType = this.BindingType.EntireArray; - - this.resolvedProperty = nodeProperty; - - } else { - - this.propertyName = propertyName; - - } - - // select getter / setter - this.getValue = this.GetterByBindingType[ bindingType ]; - this.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ]; - - }, - - unbind: function () { - - this.node = null; - - // back to the prototype version of getValue / setValue - // note: avoiding to mutate the shape of 'this' via 'delete' - this.getValue = this._getValue_unbound; - this.setValue = this._setValue_unbound; - - } - -} ); - -//!\ DECLARE ALIAS AFTER assign prototype ! -Object.assign( PropertyBinding.prototype, { - - // initial state of these methods that calls 'bind' - _getValue_unbound: PropertyBinding.prototype.getValue, - _setValue_unbound: PropertyBinding.prototype.setValue, - -} ); - -export { PropertyBinding }; diff --git a/cases/esbuild-three/src/base/animation/PropertyMixer.d.ts b/cases/esbuild-three/src/base/animation/PropertyMixer.d.ts deleted file mode 100644 index 9e86622ab2..0000000000 --- a/cases/esbuild-three/src/base/animation/PropertyMixer.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export class PropertyMixer { - - constructor( binding: any, typeName: string, valueSize: number ); - - binding: any; - valueSize: number; - buffer: any; - cumulativeWeight: number; - useCount: number; - referenceCount: number; - - accumulate( accuIndex: number, weight: number ): void; - apply( accuIndex: number ): void; - saveOriginalState(): void; - restoreOriginalState(): void; - -} diff --git a/cases/esbuild-three/src/base/animation/PropertyMixer.js b/cases/esbuild-three/src/base/animation/PropertyMixer.js deleted file mode 100644 index a4c0bbf57f..0000000000 --- a/cases/esbuild-three/src/base/animation/PropertyMixer.js +++ /dev/null @@ -1,209 +0,0 @@ -import { Quaternion } from '../math/Quaternion.js'; - -/** - * - * Buffered scene graph property that allows weighted accumulation. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function PropertyMixer( binding, typeName, valueSize ) { - - this.binding = binding; - this.valueSize = valueSize; - - var bufferType = Float64Array, - mixFunction; - - switch ( typeName ) { - - case 'quaternion': - mixFunction = this._slerp; - break; - - case 'string': - case 'bool': - bufferType = Array; - mixFunction = this._select; - break; - - default: - mixFunction = this._lerp; - - } - - this.buffer = new bufferType( valueSize * 4 ); - // layout: [ incoming | accu0 | accu1 | orig ] - // - // interpolators can use .buffer as their .result - // the data then goes to 'incoming' - // - // 'accu0' and 'accu1' are used frame-interleaved for - // the cumulative result and are compared to detect - // changes - // - // 'orig' stores the original state of the property - - this._mixBufferRegion = mixFunction; - - this.cumulativeWeight = 0; - - this.useCount = 0; - this.referenceCount = 0; - -} - -Object.assign( PropertyMixer.prototype, { - - // accumulate data in the 'incoming' region into 'accu' - accumulate: function ( accuIndex, weight ) { - - // note: happily accumulating nothing when weight = 0, the caller knows - // the weight and shouldn't have made the call in the first place - - var buffer = this.buffer, - stride = this.valueSize, - offset = accuIndex * stride + stride, - - currentWeight = this.cumulativeWeight; - - if ( currentWeight === 0 ) { - - // accuN := incoming * weight - - for ( var i = 0; i !== stride; ++ i ) { - - buffer[ offset + i ] = buffer[ i ]; - - } - - currentWeight = weight; - - } else { - - // accuN := accuN + incoming * weight - - currentWeight += weight; - var mix = weight / currentWeight; - this._mixBufferRegion( buffer, offset, 0, mix, stride ); - - } - - this.cumulativeWeight = currentWeight; - - }, - - // apply the state of 'accu' to the binding when accus differ - apply: function ( accuIndex ) { - - var stride = this.valueSize, - buffer = this.buffer, - offset = accuIndex * stride + stride, - - weight = this.cumulativeWeight, - - binding = this.binding; - - this.cumulativeWeight = 0; - - if ( weight < 1 ) { - - // accuN := accuN + original * ( 1 - cumulativeWeight ) - - var originalValueOffset = stride * 3; - - this._mixBufferRegion( - buffer, offset, originalValueOffset, 1 - weight, stride ); - - } - - for ( var i = stride, e = stride + stride; i !== e; ++ i ) { - - if ( buffer[ i ] !== buffer[ i + stride ] ) { - - // value has changed -> update scene graph - - binding.setValue( buffer, offset ); - break; - - } - - } - - }, - - // remember the state of the bound property and copy it to both accus - saveOriginalState: function () { - - var binding = this.binding; - - var buffer = this.buffer, - stride = this.valueSize, - - originalValueOffset = stride * 3; - - binding.getValue( buffer, originalValueOffset ); - - // accu[0..1] := orig -- initially detect changes against the original - for ( var i = stride, e = originalValueOffset; i !== e; ++ i ) { - - buffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ]; - - } - - this.cumulativeWeight = 0; - - }, - - // apply the state previously taken via 'saveOriginalState' to the binding - restoreOriginalState: function () { - - var originalValueOffset = this.valueSize * 3; - this.binding.setValue( this.buffer, originalValueOffset ); - - }, - - - // mix functions - - _select: function ( buffer, dstOffset, srcOffset, t, stride ) { - - if ( t >= 0.5 ) { - - for ( var i = 0; i !== stride; ++ i ) { - - buffer[ dstOffset + i ] = buffer[ srcOffset + i ]; - - } - - } - - }, - - _slerp: function ( buffer, dstOffset, srcOffset, t ) { - - Quaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t ); - - }, - - _lerp: function ( buffer, dstOffset, srcOffset, t, stride ) { - - var s = 1 - t; - - for ( var i = 0; i !== stride; ++ i ) { - - var j = dstOffset + i; - - buffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t; - - } - - } - -} ); - - -export { PropertyMixer }; diff --git a/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.d.ts deleted file mode 100644 index e37b0eac7c..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; - -export class BooleanKeyframeTrack extends KeyframeTrack { - - constructor( name: string, times: any[], values: any[] ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.js deleted file mode 100644 index bec2d2dd81..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/BooleanKeyframeTrack.js +++ /dev/null @@ -1,38 +0,0 @@ -import { InterpolateDiscrete } from '../../constants.js'; -import { KeyframeTrack } from '../KeyframeTrack.js'; - -/** - * - * A Track of Boolean keyframe values. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function BooleanKeyframeTrack( name, times, values ) { - - KeyframeTrack.call( this, name, times, values ); - -} - -BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: BooleanKeyframeTrack, - - ValueTypeName: 'bool', - ValueBufferType: Array, - - DefaultInterpolation: InterpolateDiscrete, - - InterpolantFactoryMethodLinear: undefined, - InterpolantFactoryMethodSmooth: undefined - - // Note: Actually this track could have a optimized / compressed - // representation of a single value and a custom interpolant that - // computes "firstValue ^ isOdd( index )". - -} ); - -export { BooleanKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.d.ts deleted file mode 100644 index aacf8bfb71..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; -import { InterpolationModes } from '../../constants'; - -export class ColorKeyframeTrack extends KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.js deleted file mode 100644 index c409645b9f..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/ColorKeyframeTrack.js +++ /dev/null @@ -1,34 +0,0 @@ -import { KeyframeTrack } from '../KeyframeTrack.js'; - -/** - * - * A Track of keyframe values that represent color. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function ColorKeyframeTrack( name, times, values, interpolation ) { - - KeyframeTrack.call( this, name, times, values, interpolation ); - -} - -ColorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: ColorKeyframeTrack, - - ValueTypeName: 'color' - - // ValueBufferType is inherited - - // DefaultInterpolation is inherited - - // Note: Very basic implementation and nothing special yet. - // However, this is the place for color space parameterization. - -} ); - -export { ColorKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.d.ts deleted file mode 100644 index b7f36e03ea..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; -import { InterpolationModes } from '../../constants'; - -export class NumberKeyframeTrack extends KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.js deleted file mode 100644 index f717221998..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/NumberKeyframeTrack.js +++ /dev/null @@ -1,30 +0,0 @@ -import { KeyframeTrack } from '../KeyframeTrack.js'; - -/** - * - * A Track of numeric keyframe values. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function NumberKeyframeTrack( name, times, values, interpolation ) { - - KeyframeTrack.call( this, name, times, values, interpolation ); - -} - -NumberKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: NumberKeyframeTrack, - - ValueTypeName: 'number' - - // ValueBufferType is inherited - - // DefaultInterpolation is inherited - -} ); - -export { NumberKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.d.ts deleted file mode 100644 index b06b707226..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; -import { InterpolationModes } from '../../constants'; - -export class QuaternionKeyframeTrack extends KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.js deleted file mode 100644 index 95949598d6..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/QuaternionKeyframeTrack.js +++ /dev/null @@ -1,40 +0,0 @@ -import { InterpolateLinear } from '../../constants.js'; -import { KeyframeTrack } from '../KeyframeTrack.js'; -import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant.js'; - -/** - * - * A Track of quaternion keyframe values. - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function QuaternionKeyframeTrack( name, times, values, interpolation ) { - - KeyframeTrack.call( this, name, times, values, interpolation ); - -} - -QuaternionKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: QuaternionKeyframeTrack, - - ValueTypeName: 'quaternion', - - // ValueBufferType is inherited - - DefaultInterpolation: InterpolateLinear, - - InterpolantFactoryMethodLinear: function ( result ) { - - return new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result ); - - }, - - InterpolantFactoryMethodSmooth: undefined // not yet implemented - -} ); - -export { QuaternionKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.d.ts deleted file mode 100644 index ecf2b7f244..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; -import { InterpolationModes } from '../../constants'; - -export class StringKeyframeTrack extends KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.js deleted file mode 100644 index 5d021d2159..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/StringKeyframeTrack.js +++ /dev/null @@ -1,35 +0,0 @@ -import { InterpolateDiscrete } from '../../constants.js'; -import { KeyframeTrack } from '../KeyframeTrack.js'; - -/** - * - * A Track that interpolates Strings - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function StringKeyframeTrack( name, times, values, interpolation ) { - - KeyframeTrack.call( this, name, times, values, interpolation ); - -} - -StringKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: StringKeyframeTrack, - - ValueTypeName: 'string', - ValueBufferType: Array, - - DefaultInterpolation: InterpolateDiscrete, - - InterpolantFactoryMethodLinear: undefined, - - InterpolantFactoryMethodSmooth: undefined - -} ); - -export { StringKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.d.ts b/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.d.ts deleted file mode 100644 index d9647db05b..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { KeyframeTrack } from './../KeyframeTrack'; -import { InterpolationModes } from '../../constants'; - -export class VectorKeyframeTrack extends KeyframeTrack { - - constructor( - name: string, - times: any[], - values: any[], - interpolation?: InterpolationModes - ); - -} diff --git a/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.js b/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.js deleted file mode 100644 index cff8c9f059..0000000000 --- a/cases/esbuild-three/src/base/animation/tracks/VectorKeyframeTrack.js +++ /dev/null @@ -1,31 +0,0 @@ -import { KeyframeTrack } from '../KeyframeTrack.js'; - -/** - * - * A Track of vectored keyframe values. - * - * - * @author Ben Houston / http://clara.io/ - * @author David Sarno / http://lighthaus.us/ - * @author tschw - */ - -function VectorKeyframeTrack( name, times, values, interpolation ) { - - KeyframeTrack.call( this, name, times, values, interpolation ); - -} - -VectorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), { - - constructor: VectorKeyframeTrack, - - ValueTypeName: 'vector' - - // ValueBufferType is inherited - - // DefaultInterpolation is inherited - -} ); - -export { VectorKeyframeTrack }; diff --git a/cases/esbuild-three/src/base/audio/Audio.d.ts b/cases/esbuild-three/src/base/audio/Audio.d.ts deleted file mode 100644 index d27e56b73e..0000000000 --- a/cases/esbuild-three/src/base/audio/Audio.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { AudioListener } from './AudioListener'; -import { AudioContext } from './AudioContext'; - -// Extras / Audio ///////////////////////////////////////////////////////////////////// - -export class Audio extends Object3D { - - constructor( listener: AudioListener ); - type: 'Audio'; - - context: AudioContext; - gain: GainNode; - autoplay: boolean; - buffer: null | Audio; - detune: number; - loop: boolean; - startTime: number; - offset: number; - duration: number | undefined; - playbackRate: number; - isPlaying: boolean; - hasPlaybackControl: boolean; - sourceType: string; - source: AudioBufferSourceNode; - filters: any[]; - - getOutput(): GainNode; - setNodeSource( audioNode: AudioBufferSourceNode ): this; - setMediaElementSource( mediaElement: MediaElementAudioSourceNode ): this; - setBuffer( audioBuffer: AudioBuffer ): this; - play(): this; - onEnded(): void; - pause(): this; - stop(): this; - connect(): this; - disconnect(): this; - setDetune( value: number ): this; - getDetune(): number; - getFilters(): any[]; - setFilter( value: any[] ): this; - getFilter(): any; - setFilter( filter: any ): this; - setPlaybackRate( value: number ): this; - getPlaybackRate(): number; - getLoop(): boolean; - setLoop( value: boolean ): void; - getVolume(): number; - setVolume( value: number ): this; - /** - * @deprecated Use {@link AudioLoader} instead. - */ - load( file: string ): Audio; - -} - -export class AudioBuffer { - - constructor( context: any ); - - context: any; - ready: boolean; - readyCallbacks: Function[]; - - load( file: string ): AudioBuffer; - onReady( callback: Function ): void; - -} diff --git a/cases/esbuild-three/src/base/audio/Audio.js b/cases/esbuild-three/src/base/audio/Audio.js deleted file mode 100644 index 6d3dd62dcc..0000000000 --- a/cases/esbuild-three/src/base/audio/Audio.js +++ /dev/null @@ -1,346 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Reece Aaron Lecrivain / http://reecenotes.com/ - */ - -import { Object3D } from '../core/Object3D.js'; - -function Audio( listener ) { - - Object3D.call( this ); - - this.type = 'Audio'; - - this.listener = listener; - this.context = listener.context; - - this.gain = this.context.createGain(); - this.gain.connect( listener.getInput() ); - - this.autoplay = false; - - this.buffer = null; - this.detune = 0; - this.loop = false; - this.startTime = 0; - this.offset = 0; - this.duration = undefined; - this.playbackRate = 1; - this.isPlaying = false; - this.hasPlaybackControl = true; - this.sourceType = 'empty'; - - this.filters = []; - -} - -Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Audio, - - getOutput: function () { - - return this.gain; - - }, - - setNodeSource: function ( audioNode ) { - - this.hasPlaybackControl = false; - this.sourceType = 'audioNode'; - this.source = audioNode; - this.connect(); - - return this; - - }, - - setMediaElementSource: function ( mediaElement ) { - - this.hasPlaybackControl = false; - this.sourceType = 'mediaNode'; - this.source = this.context.createMediaElementSource( mediaElement ); - this.connect(); - - return this; - - }, - - setBuffer: function ( audioBuffer ) { - - this.buffer = audioBuffer; - this.sourceType = 'buffer'; - - if ( this.autoplay ) this.play(); - - return this; - - }, - - play: function () { - - if ( this.isPlaying === true ) { - - console.warn( 'THREE.Audio: Audio is already playing.' ); - return; - - } - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; - - } - - var source = this.context.createBufferSource(); - - source.buffer = this.buffer; - source.loop = this.loop; - source.onended = this.onEnded.bind( this ); - this.startTime = this.context.currentTime; - source.start( this.startTime, this.offset, this.duration ); - - this.isPlaying = true; - - this.source = source; - - this.setDetune( this.detune ); - this.setPlaybackRate( this.playbackRate ); - - return this.connect(); - - }, - - pause: function () { - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; - - } - - if ( this.isPlaying === true ) { - - this.source.stop(); - this.source.onended = null; - this.offset += ( this.context.currentTime - this.startTime ) * this.playbackRate; - this.isPlaying = false; - - } - - return this; - - }, - - stop: function () { - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; - - } - - this.source.stop(); - this.source.onended = null; - this.offset = 0; - this.isPlaying = false; - - return this; - - }, - - connect: function () { - - if ( this.filters.length > 0 ) { - - this.source.connect( this.filters[ 0 ] ); - - for ( var i = 1, l = this.filters.length; i < l; i ++ ) { - - this.filters[ i - 1 ].connect( this.filters[ i ] ); - - } - - this.filters[ this.filters.length - 1 ].connect( this.getOutput() ); - - } else { - - this.source.connect( this.getOutput() ); - - } - - return this; - - }, - - disconnect: function () { - - if ( this.filters.length > 0 ) { - - this.source.disconnect( this.filters[ 0 ] ); - - for ( var i = 1, l = this.filters.length; i < l; i ++ ) { - - this.filters[ i - 1 ].disconnect( this.filters[ i ] ); - - } - - this.filters[ this.filters.length - 1 ].disconnect( this.getOutput() ); - - } else { - - this.source.disconnect( this.getOutput() ); - - } - - return this; - - }, - - getFilters: function () { - - return this.filters; - - }, - - setFilters: function ( value ) { - - if ( ! value ) value = []; - - if ( this.isPlaying === true ) { - - this.disconnect(); - this.filters = value; - this.connect(); - - } else { - - this.filters = value; - - } - - return this; - - }, - - setDetune: function ( value ) { - - this.detune = value; - - if ( this.source.detune === undefined ) return; // only set detune when available - - if ( this.isPlaying === true ) { - - this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 ); - - } - - return this; - - }, - - getDetune: function () { - - return this.detune; - - }, - - getFilter: function () { - - return this.getFilters()[ 0 ]; - - }, - - setFilter: function ( filter ) { - - return this.setFilters( filter ? [ filter ] : [] ); - - }, - - setPlaybackRate: function ( value ) { - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; - - } - - this.playbackRate = value; - - if ( this.isPlaying === true ) { - - this.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 ); - - } - - return this; - - }, - - getPlaybackRate: function () { - - return this.playbackRate; - - }, - - onEnded: function () { - - this.isPlaying = false; - - }, - - getLoop: function () { - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return false; - - } - - return this.loop; - - }, - - setLoop: function ( value ) { - - if ( this.hasPlaybackControl === false ) { - - console.warn( 'THREE.Audio: this Audio has no playback control.' ); - return; - - } - - this.loop = value; - - if ( this.isPlaying === true ) { - - this.source.loop = this.loop; - - } - - return this; - - }, - - getVolume: function () { - - return this.gain.gain.value; - - }, - - setVolume: function ( value ) { - - this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); - - return this; - - } - -} ); - -export { Audio }; diff --git a/cases/esbuild-three/src/base/audio/AudioAnalyser.d.ts b/cases/esbuild-three/src/base/audio/AudioAnalyser.d.ts deleted file mode 100644 index f1051b1c56..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioAnalyser.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export class AudioAnalyser { - - constructor( audio: any, fftSize: number ); - - analyser: any; - data: Uint8Array; - - getFrequencyData(): Uint8Array; - getAverageFrequency(): number; - - /** - * @deprecated Use {@link AudioAnalyser#getFrequencyData .getFrequencyData()} instead. - */ - getData( file: any ): any; - -} diff --git a/cases/esbuild-three/src/base/audio/AudioAnalyser.js b/cases/esbuild-three/src/base/audio/AudioAnalyser.js deleted file mode 100644 index ce21a4ad14..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioAnalyser.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function AudioAnalyser( audio, fftSize ) { - - this.analyser = audio.context.createAnalyser(); - this.analyser.fftSize = fftSize !== undefined ? fftSize : 2048; - - this.data = new Uint8Array( this.analyser.frequencyBinCount ); - - audio.getOutput().connect( this.analyser ); - -} - -Object.assign( AudioAnalyser.prototype, { - - getFrequencyData: function () { - - this.analyser.getByteFrequencyData( this.data ); - - return this.data; - - }, - - getAverageFrequency: function () { - - var value = 0, data = this.getFrequencyData(); - - for ( var i = 0; i < data.length; i ++ ) { - - value += data[ i ]; - - } - - return value / data.length; - - } - -} ); - -export { AudioAnalyser }; diff --git a/cases/esbuild-three/src/base/audio/AudioContext.d.ts b/cases/esbuild-three/src/base/audio/AudioContext.d.ts deleted file mode 100644 index 5fb703a41b..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioContext.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const AudioContext: AudioContext; diff --git a/cases/esbuild-three/src/base/audio/AudioContext.js b/cases/esbuild-three/src/base/audio/AudioContext.js deleted file mode 100644 index ef039a077c..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioContext.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -var _context; - -var AudioContext = { - - getContext: function () { - - if ( _context === undefined ) { - - _context = new ( window.AudioContext || window.webkitAudioContext )(); - - } - - return _context; - - }, - - setContext: function ( value ) { - - _context = value; - - } - -}; - -export { AudioContext }; diff --git a/cases/esbuild-three/src/base/audio/AudioListener.d.ts b/cases/esbuild-three/src/base/audio/AudioListener.d.ts deleted file mode 100644 index de3fb11833..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioListener.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { AudioContext } from './AudioContext'; - -export class AudioListener extends Object3D { - - constructor(); - - type: 'AudioListener'; - context: AudioContext; - gain: GainNode; - filter: null | any; - - getInput(): GainNode; - removeFilter(): void; - setFilter( value: any ): void; - getFilter(): any; - setMasterVolume( value: number ): void; - getMasterVolume(): number; - updateMatrixWorld( force?: boolean ): void; - -} diff --git a/cases/esbuild-three/src/base/audio/AudioListener.js b/cases/esbuild-three/src/base/audio/AudioListener.js deleted file mode 100644 index d217c65632..0000000000 --- a/cases/esbuild-three/src/base/audio/AudioListener.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Vector3 } from '../math/Vector3.js'; -import { Quaternion } from '../math/Quaternion.js'; -import { Clock } from '../core/Clock.js'; -import { Object3D } from '../core/Object3D.js'; -import { AudioContext } from './AudioContext.js'; - -var _position = new Vector3(); -var _quaternion = new Quaternion(); -var _scale = new Vector3(); -var _orientation = new Vector3(); - -function AudioListener() { - - Object3D.call( this ); - - this.type = 'AudioListener'; - - this.context = AudioContext.getContext(); - - this.gain = this.context.createGain(); - this.gain.connect( this.context.destination ); - - this.filter = null; - - this.timeDelta = 0; - - // private - - this._clock = new Clock(); - -} - -AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: AudioListener, - - getInput: function () { - - return this.gain; - - }, - - removeFilter: function ( ) { - - if ( this.filter !== null ) { - - this.gain.disconnect( this.filter ); - this.filter.disconnect( this.context.destination ); - this.gain.connect( this.context.destination ); - this.filter = null; - - } - - return this; - - }, - - getFilter: function () { - - return this.filter; - - }, - - setFilter: function ( value ) { - - if ( this.filter !== null ) { - - this.gain.disconnect( this.filter ); - this.filter.disconnect( this.context.destination ); - - } else { - - this.gain.disconnect( this.context.destination ); - - } - - this.filter = value; - this.gain.connect( this.filter ); - this.filter.connect( this.context.destination ); - - return this; - - }, - - getMasterVolume: function () { - - return this.gain.gain.value; - - }, - - setMasterVolume: function ( value ) { - - this.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 ); - - return this; - - }, - - updateMatrixWorld: function ( force ) { - - Object3D.prototype.updateMatrixWorld.call( this, force ); - - var listener = this.context.listener; - var up = this.up; - - this.timeDelta = this._clock.getDelta(); - - this.matrixWorld.decompose( _position, _quaternion, _scale ); - - _orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion ); - - if ( listener.positionX ) { - - // code path for Chrome (see #14393) - - var endTime = this.context.currentTime + this.timeDelta; - - listener.positionX.linearRampToValueAtTime( _position.x, endTime ); - listener.positionY.linearRampToValueAtTime( _position.y, endTime ); - listener.positionZ.linearRampToValueAtTime( _position.z, endTime ); - listener.forwardX.linearRampToValueAtTime( _orientation.x, endTime ); - listener.forwardY.linearRampToValueAtTime( _orientation.y, endTime ); - listener.forwardZ.linearRampToValueAtTime( _orientation.z, endTime ); - listener.upX.linearRampToValueAtTime( up.x, endTime ); - listener.upY.linearRampToValueAtTime( up.y, endTime ); - listener.upZ.linearRampToValueAtTime( up.z, endTime ); - - } else { - - listener.setPosition( _position.x, _position.y, _position.z ); - listener.setOrientation( _orientation.x, _orientation.y, _orientation.z, up.x, up.y, up.z ); - - } - - } - -} ); - -export { AudioListener }; diff --git a/cases/esbuild-three/src/base/audio/PositionalAudio.d.ts b/cases/esbuild-three/src/base/audio/PositionalAudio.d.ts deleted file mode 100644 index eb328bea46..0000000000 --- a/cases/esbuild-three/src/base/audio/PositionalAudio.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AudioListener } from './AudioListener'; -import { Audio } from './Audio'; - -export class PositionalAudio extends Audio { - - constructor( listener: AudioListener ); - - panner: PannerNode; - - setRefDistance( value: number ): this; - getRefDistance(): number; - setRolloffFactor( value: number ): this; - getRolloffFactor(): number; - setDistanceModel( value: string ): this; - getDistanceModel(): string; - setMaxDistance( value: number ): this; - getMaxDistance(): number; - setDirectionalCone( - coneInnerAngle: number, - coneOuterAngle: number, - coneOuterGain: number - ): this; - -} diff --git a/cases/esbuild-three/src/base/audio/PositionalAudio.js b/cases/esbuild-three/src/base/audio/PositionalAudio.js deleted file mode 100644 index 04400efa7e..0000000000 --- a/cases/esbuild-three/src/base/audio/PositionalAudio.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Vector3 } from '../math/Vector3.js'; -import { Quaternion } from '../math/Quaternion.js'; -import { Audio } from './Audio.js'; -import { Object3D } from '../core/Object3D.js'; - -var _position = new Vector3(); -var _quaternion = new Quaternion(); -var _scale = new Vector3(); -var _orientation = new Vector3(); - -function PositionalAudio( listener ) { - - Audio.call( this, listener ); - - this.panner = this.context.createPanner(); - this.panner.panningModel = 'HRTF'; - this.panner.connect( this.gain ); - -} - -PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { - - constructor: PositionalAudio, - - getOutput: function () { - - return this.panner; - - }, - - getRefDistance: function () { - - return this.panner.refDistance; - - }, - - setRefDistance: function ( value ) { - - this.panner.refDistance = value; - - return this; - - }, - - getRolloffFactor: function () { - - return this.panner.rolloffFactor; - - }, - - setRolloffFactor: function ( value ) { - - this.panner.rolloffFactor = value; - - return this; - - }, - - getDistanceModel: function () { - - return this.panner.distanceModel; - - }, - - setDistanceModel: function ( value ) { - - this.panner.distanceModel = value; - - return this; - - }, - - getMaxDistance: function () { - - return this.panner.maxDistance; - - }, - - setMaxDistance: function ( value ) { - - this.panner.maxDistance = value; - - return this; - - }, - - setDirectionalCone: function ( coneInnerAngle, coneOuterAngle, coneOuterGain ) { - - this.panner.coneInnerAngle = coneInnerAngle; - this.panner.coneOuterAngle = coneOuterAngle; - this.panner.coneOuterGain = coneOuterGain; - - return this; - - }, - - updateMatrixWorld: function ( force ) { - - Object3D.prototype.updateMatrixWorld.call( this, force ); - - if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; - - this.matrixWorld.decompose( _position, _quaternion, _scale ); - - _orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion ); - - var panner = this.panner; - - if ( panner.positionX ) { - - // code path for Chrome and Firefox (see #14393) - - var endTime = this.context.currentTime + this.listener.timeDelta; - - panner.positionX.linearRampToValueAtTime( _position.x, endTime ); - panner.positionY.linearRampToValueAtTime( _position.y, endTime ); - panner.positionZ.linearRampToValueAtTime( _position.z, endTime ); - panner.orientationX.linearRampToValueAtTime( _orientation.x, endTime ); - panner.orientationY.linearRampToValueAtTime( _orientation.y, endTime ); - panner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime ); - - } else { - - panner.setPosition( _position.x, _position.y, _position.z ); - panner.setOrientation( _orientation.x, _orientation.y, _orientation.z ); - - } - - } - -} ); - -export { PositionalAudio }; diff --git a/cases/esbuild-three/src/base/cameras/ArrayCamera.d.ts b/cases/esbuild-three/src/base/cameras/ArrayCamera.d.ts deleted file mode 100644 index 08b4c65bdf..0000000000 --- a/cases/esbuild-three/src/base/cameras/ArrayCamera.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PerspectiveCamera } from './PerspectiveCamera'; - -export class ArrayCamera extends PerspectiveCamera { - - constructor( cameras?: PerspectiveCamera[] ); - - cameras: PerspectiveCamera[]; - isArrayCamera: true; - -} diff --git a/cases/esbuild-three/src/base/cameras/ArrayCamera.js b/cases/esbuild-three/src/base/cameras/ArrayCamera.js deleted file mode 100644 index fc98224bf7..0000000000 --- a/cases/esbuild-three/src/base/cameras/ArrayCamera.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { PerspectiveCamera } from './PerspectiveCamera.js'; - -function ArrayCamera( array ) { - - PerspectiveCamera.call( this ); - - this.cameras = array || []; - -} - -ArrayCamera.prototype = Object.assign( Object.create( PerspectiveCamera.prototype ), { - - constructor: ArrayCamera, - - isArrayCamera: true - -} ); - - -export { ArrayCamera }; diff --git a/cases/esbuild-three/src/base/cameras/Camera.d.ts b/cases/esbuild-three/src/base/cameras/Camera.d.ts deleted file mode 100644 index f858802d72..0000000000 --- a/cases/esbuild-three/src/base/cameras/Camera.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Matrix4 } from './../math/Matrix4'; -import { Vector3 } from './../math/Vector3'; -import { Object3D } from './../core/Object3D'; - -// Cameras //////////////////////////////////////////////////////////////////////////////////////// - -/** - * Abstract base class for cameras. This class should always be inherited when you build a new camera. - */ -export class Camera extends Object3D { - - /** - * This constructor sets following properties to the correct type: matrixWorldInverse, projectionMatrix and projectionMatrixInverse. - */ - constructor(); - - /** - * This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera. - */ - matrixWorldInverse: Matrix4; - - /** - * This is the matrix which contains the projection. - */ - projectionMatrix: Matrix4; - - /** - * This is the inverse of projectionMatrix. - */ - projectionMatrixInverse: Matrix4; - - isCamera: true; - - getWorldDirection( target: Vector3 ): Vector3; - - updateMatrixWorld( force?: boolean ): void; - -} diff --git a/cases/esbuild-three/src/base/cameras/Camera.js b/cases/esbuild-three/src/base/cameras/Camera.js deleted file mode 100644 index cb992a6794..0000000000 --- a/cases/esbuild-three/src/base/cameras/Camera.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - * @author WestLangley / http://github.com/WestLangley -*/ - -import { Matrix4 } from '../math/Matrix4.js'; -import { Object3D } from '../core/Object3D.js'; -import { Vector3 } from '../math/Vector3.js'; - -function Camera() { - - Object3D.call( this ); - - this.type = 'Camera'; - - this.matrixWorldInverse = new Matrix4(); - - this.projectionMatrix = new Matrix4(); - this.projectionMatrixInverse = new Matrix4(); - -} - -Camera.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Camera, - - isCamera: true, - - copy: function ( source, recursive ) { - - Object3D.prototype.copy.call( this, source, recursive ); - - this.matrixWorldInverse.copy( source.matrixWorldInverse ); - - this.projectionMatrix.copy( source.projectionMatrix ); - this.projectionMatrixInverse.copy( source.projectionMatrixInverse ); - - return this; - - }, - - getWorldDirection: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Camera: .getWorldDirection() target is now required' ); - target = new Vector3(); - - } - - this.updateMatrixWorld( true ); - - var e = this.matrixWorld.elements; - - return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize(); - - }, - - updateMatrixWorld: function ( force ) { - - Object3D.prototype.updateMatrixWorld.call( this, force ); - - this.matrixWorldInverse.getInverse( this.matrixWorld ); - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - } - -} ); - -export { Camera }; diff --git a/cases/esbuild-three/src/base/cameras/CubeCamera.d.ts b/cases/esbuild-three/src/base/cameras/CubeCamera.d.ts deleted file mode 100644 index 931bd8f6a8..0000000000 --- a/cases/esbuild-three/src/base/cameras/CubeCamera.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { WebGLRenderTargetCube } from './../renderers/WebGLRenderTargetCube'; -import { Scene } from './../scenes/Scene'; -import { WebGLRenderer } from './../renderers/WebGLRenderer'; -import { Object3D } from './../core/Object3D'; - -export class CubeCamera extends Object3D { - - constructor( near?: number, far?: number, cubeResolution?: number ); - - type: 'CubeCamera'; - - renderTarget: WebGLRenderTargetCube; - - update( renderer: WebGLRenderer, scene: Scene ): void; - - clear( renderer: WebGLRenderer, color: boolean, depth: boolean, stencil: boolean ): void; - -} diff --git a/cases/esbuild-three/src/base/cameras/CubeCamera.js b/cases/esbuild-three/src/base/cameras/CubeCamera.js deleted file mode 100644 index e49e1df609..0000000000 --- a/cases/esbuild-three/src/base/cameras/CubeCamera.js +++ /dev/null @@ -1,116 +0,0 @@ -import { Object3D } from '../core/Object3D.js'; -import { WebGLRenderTargetCube } from '../renderers/WebGLRenderTargetCube.js'; -import { LinearFilter, RGBFormat } from '../constants.js'; -import { Vector3 } from '../math/Vector3.js'; -import { PerspectiveCamera } from './PerspectiveCamera.js'; - -/** - * Camera for rendering cube maps - * - renders scene into axis-aligned cube - * - * @author alteredq / http://alteredqualia.com/ - */ - -var fov = 90, aspect = 1; - -function CubeCamera( near, far, cubeResolution, options ) { - - Object3D.call( this ); - - this.type = 'CubeCamera'; - - var cameraPX = new PerspectiveCamera( fov, aspect, near, far ); - cameraPX.up.set( 0, - 1, 0 ); - cameraPX.lookAt( new Vector3( 1, 0, 0 ) ); - this.add( cameraPX ); - - var cameraNX = new PerspectiveCamera( fov, aspect, near, far ); - cameraNX.up.set( 0, - 1, 0 ); - cameraNX.lookAt( new Vector3( - 1, 0, 0 ) ); - this.add( cameraNX ); - - var cameraPY = new PerspectiveCamera( fov, aspect, near, far ); - cameraPY.up.set( 0, 0, 1 ); - cameraPY.lookAt( new Vector3( 0, 1, 0 ) ); - this.add( cameraPY ); - - var cameraNY = new PerspectiveCamera( fov, aspect, near, far ); - cameraNY.up.set( 0, 0, - 1 ); - cameraNY.lookAt( new Vector3( 0, - 1, 0 ) ); - this.add( cameraNY ); - - var cameraPZ = new PerspectiveCamera( fov, aspect, near, far ); - cameraPZ.up.set( 0, - 1, 0 ); - cameraPZ.lookAt( new Vector3( 0, 0, 1 ) ); - this.add( cameraPZ ); - - var cameraNZ = new PerspectiveCamera( fov, aspect, near, far ); - cameraNZ.up.set( 0, - 1, 0 ); - cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) ); - this.add( cameraNZ ); - - options = options || { format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter }; - - this.renderTarget = new WebGLRenderTargetCube( cubeResolution, cubeResolution, options ); - this.renderTarget.texture.name = "CubeCamera"; - - this.update = function ( renderer, scene ) { - - if ( this.parent === null ) this.updateMatrixWorld(); - - var currentRenderTarget = renderer.getRenderTarget(); - - var renderTarget = this.renderTarget; - var generateMipmaps = renderTarget.texture.generateMipmaps; - - renderTarget.texture.generateMipmaps = false; - - renderer.setRenderTarget( renderTarget, 0 ); - renderer.render( scene, cameraPX ); - - renderer.setRenderTarget( renderTarget, 1 ); - renderer.render( scene, cameraNX ); - - renderer.setRenderTarget( renderTarget, 2 ); - renderer.render( scene, cameraPY ); - - renderer.setRenderTarget( renderTarget, 3 ); - renderer.render( scene, cameraNY ); - - renderer.setRenderTarget( renderTarget, 4 ); - renderer.render( scene, cameraPZ ); - - renderTarget.texture.generateMipmaps = generateMipmaps; - - renderer.setRenderTarget( renderTarget, 5 ); - renderer.render( scene, cameraNZ ); - - renderer.setRenderTarget( currentRenderTarget ); - - }; - - this.clear = function ( renderer, color, depth, stencil ) { - - var currentRenderTarget = renderer.getRenderTarget(); - - var renderTarget = this.renderTarget; - - for ( var i = 0; i < 6; i ++ ) { - - renderer.setRenderTarget( renderTarget, i ); - - renderer.clear( color, depth, stencil ); - - } - - renderer.setRenderTarget( currentRenderTarget ); - - }; - -} - -CubeCamera.prototype = Object.create( Object3D.prototype ); -CubeCamera.prototype.constructor = CubeCamera; - - -export { CubeCamera }; diff --git a/cases/esbuild-three/src/base/cameras/OrthographicCamera.d.ts b/cases/esbuild-three/src/base/cameras/OrthographicCamera.d.ts deleted file mode 100644 index d598d55f12..0000000000 --- a/cases/esbuild-three/src/base/cameras/OrthographicCamera.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Camera } from './Camera'; - -/** - * Camera with orthographic projection - * - * @example - * var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 ); - * scene.add( camera ); - * - * @see src/cameras/OrthographicCamera.js - */ -export class OrthographicCamera extends Camera { - - /** - * @param left Camera frustum left plane. - * @param right Camera frustum right plane. - * @param top Camera frustum top plane. - * @param bottom Camera frustum bottom plane. - * @param near Camera frustum near plane. - * @param far Camera frustum far plane. - */ - constructor( - left: number, - right: number, - top: number, - bottom: number, - near?: number, - far?: number - ); - - type: 'OrthographicCamera'; - - isOrthographicCamera: true; - - zoom: number; - view: null | { - enabled: boolean; - fullWidth: number; - fullHeight: number; - offsetX: number; - offsetY: number; - width: number; - height: number; - }; - - /** - * Camera frustum left plane. - */ - left: number; - - /** - * Camera frustum right plane. - */ - right: number; - - /** - * Camera frustum top plane. - */ - top: number; - - /** - * Camera frustum bottom plane. - */ - bottom: number; - - /** - * Camera frustum near plane. - */ - near: number; - - /** - * Camera frustum far plane. - */ - far: number; - - /** - * Updates the camera projection matrix. Must be called after change of parameters. - */ - updateProjectionMatrix(): void; - setViewOffset( - fullWidth: number, - fullHeight: number, - offsetX: number, - offsetY: number, - width: number, - height: number - ): void; - clearViewOffset(): void; - toJSON( meta?: any ): any; - -} diff --git a/cases/esbuild-three/src/base/cameras/OrthographicCamera.js b/cases/esbuild-three/src/base/cameras/OrthographicCamera.js deleted file mode 100644 index 532da017b7..0000000000 --- a/cases/esbuild-three/src/base/cameras/OrthographicCamera.js +++ /dev/null @@ -1,147 +0,0 @@ -import { Camera } from './Camera.js'; -import { Object3D } from '../core/Object3D.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - * @author arose / http://github.com/arose - */ - -function OrthographicCamera( left, right, top, bottom, near, far ) { - - Camera.call( this ); - - this.type = 'OrthographicCamera'; - - this.zoom = 1; - this.view = null; - - this.left = ( left !== undefined ) ? left : - 1; - this.right = ( right !== undefined ) ? right : 1; - this.top = ( top !== undefined ) ? top : 1; - this.bottom = ( bottom !== undefined ) ? bottom : - 1; - - this.near = ( near !== undefined ) ? near : 0.1; - this.far = ( far !== undefined ) ? far : 2000; - - this.updateProjectionMatrix(); - -} - -OrthographicCamera.prototype = Object.assign( Object.create( Camera.prototype ), { - - constructor: OrthographicCamera, - - isOrthographicCamera: true, - - copy: function ( source, recursive ) { - - Camera.prototype.copy.call( this, source, recursive ); - - this.left = source.left; - this.right = source.right; - this.top = source.top; - this.bottom = source.bottom; - this.near = source.near; - this.far = source.far; - - this.zoom = source.zoom; - this.view = source.view === null ? null : Object.assign( {}, source.view ); - - return this; - - }, - - setViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) { - - if ( this.view === null ) { - - this.view = { - enabled: true, - fullWidth: 1, - fullHeight: 1, - offsetX: 0, - offsetY: 0, - width: 1, - height: 1 - }; - - } - - this.view.enabled = true; - this.view.fullWidth = fullWidth; - this.view.fullHeight = fullHeight; - this.view.offsetX = x; - this.view.offsetY = y; - this.view.width = width; - this.view.height = height; - - this.updateProjectionMatrix(); - - }, - - clearViewOffset: function () { - - if ( this.view !== null ) { - - this.view.enabled = false; - - } - - this.updateProjectionMatrix(); - - }, - - updateProjectionMatrix: function () { - - var dx = ( this.right - this.left ) / ( 2 * this.zoom ); - var dy = ( this.top - this.bottom ) / ( 2 * this.zoom ); - var cx = ( this.right + this.left ) / 2; - var cy = ( this.top + this.bottom ) / 2; - - var left = cx - dx; - var right = cx + dx; - var top = cy + dy; - var bottom = cy - dy; - - if ( this.view !== null && this.view.enabled ) { - - var zoomW = this.zoom / ( this.view.width / this.view.fullWidth ); - var zoomH = this.zoom / ( this.view.height / this.view.fullHeight ); - var scaleW = ( this.right - this.left ) / this.view.width; - var scaleH = ( this.top - this.bottom ) / this.view.height; - - left += scaleW * ( this.view.offsetX / zoomW ); - right = left + scaleW * ( this.view.width / zoomW ); - top -= scaleH * ( this.view.offsetY / zoomH ); - bottom = top - scaleH * ( this.view.height / zoomH ); - - } - - this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far ); - - this.projectionMatrixInverse.getInverse( this.projectionMatrix ); - - }, - - toJSON: function ( meta ) { - - var data = Object3D.prototype.toJSON.call( this, meta ); - - data.object.zoom = this.zoom; - data.object.left = this.left; - data.object.right = this.right; - data.object.top = this.top; - data.object.bottom = this.bottom; - data.object.near = this.near; - data.object.far = this.far; - - if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); - - return data; - - } - -} ); - - -export { OrthographicCamera }; diff --git a/cases/esbuild-three/src/base/cameras/PerspectiveCamera.d.ts b/cases/esbuild-three/src/base/cameras/PerspectiveCamera.d.ts deleted file mode 100644 index d6b2c61ddc..0000000000 --- a/cases/esbuild-three/src/base/cameras/PerspectiveCamera.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { Camera } from './Camera'; - -/** - * Camera with perspective projection. - * - * @source https://github.com/mrdoob/three.js/blob/master/src/cameras/PerspectiveCamera.js - */ -export class PerspectiveCamera extends Camera { - - /** - * @param fov Camera frustum vertical field of view. Default value is 50. - * @param aspect Camera frustum aspect ratio. Default value is 1. - * @param near Camera frustum near plane. Default value is 0.1. - * @param far Camera frustum far plane. Default value is 2000. - */ - constructor( fov?: number, aspect?: number, near?: number, far?: number ); - - type: 'PerspectiveCamera'; - - isPerspectiveCamera: true; - - zoom: number; - - /** - * Camera frustum vertical field of view, from bottom to top of view, in degrees. - */ - fov: number; - - /** - * Camera frustum aspect ratio, window width divided by window height. - */ - aspect: number; - - /** - * Camera frustum near plane. - */ - near: number; - - /** - * Camera frustum far plane. - */ - far: number; - - focus: number; - view: null | { - enabled: boolean; - fullWidth: number; - fullHeight: number; - offsetX: number; - offsetY: number; - width: number; - height: number; - }; - filmGauge: number; - filmOffset: number; - - setFocalLength( focalLength: number ): void; - getFocalLength(): number; - getEffectiveFOV(): number; - getFilmWidth(): number; - getFilmHeight(): number; - - /** - * Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups. - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this: - * - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - * - * then for each monitor you would call it like this: - * - * var w = 1920; - * var h = 1080; - * var fullWidth = w * 3; - * var fullHeight = h * 2; - * - * // A - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * // B - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * // C - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * // D - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * // E - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * // F - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); Note there is no reason monitors have to be the same size or in a grid. - * - * @param fullWidth full width of multiview setup - * @param fullHeight full height of multiview setup - * @param x horizontal offset of subcamera - * @param y vertical offset of subcamera - * @param width width of subcamera - * @param height height of subcamera - */ - setViewOffset( - fullWidth: number, - fullHeight: number, - x: number, - y: number, - width: number, - height: number - ): void; - clearViewOffset(): void; - - /** - * Updates the camera projection matrix. Must be called after change of parameters. - */ - updateProjectionMatrix(): void; - toJSON( meta?: any ): any; - - /** - * @deprecated Use {@link PerspectiveCamera#setFocalLength .setFocalLength()} and {@link PerspectiveCamera#filmGauge .filmGauge} instead. - */ - setLens( focalLength: number, frameHeight?: number ): void; - -} diff --git a/cases/esbuild-three/src/base/cameras/PerspectiveCamera.js b/cases/esbuild-three/src/base/cameras/PerspectiveCamera.js deleted file mode 100644 index 7b0cbb7b85..0000000000 --- a/cases/esbuild-three/src/base/cameras/PerspectiveCamera.js +++ /dev/null @@ -1,244 +0,0 @@ -import { Camera } from './Camera.js'; -import { Object3D } from '../core/Object3D.js'; -import { _Math } from '../math/Math.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author greggman / http://games.greggman.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author tschw - */ - -function PerspectiveCamera( fov, aspect, near, far ) { - - Camera.call( this ); - - this.type = 'PerspectiveCamera'; - - this.fov = fov !== undefined ? fov : 50; - this.zoom = 1; - - this.near = near !== undefined ? near : 0.1; - this.far = far !== undefined ? far : 2000; - this.focus = 10; - - this.aspect = aspect !== undefined ? aspect : 1; - this.view = null; - - this.filmGauge = 35; // width of the film (default in millimeters) - this.filmOffset = 0; // horizontal film offset (same unit as gauge) - - this.updateProjectionMatrix(); - -} - -PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ), { - - constructor: PerspectiveCamera, - - isPerspectiveCamera: true, - - copy: function ( source, recursive ) { - - Camera.prototype.copy.call( this, source, recursive ); - - this.fov = source.fov; - this.zoom = source.zoom; - - this.near = source.near; - this.far = source.far; - this.focus = source.focus; - - this.aspect = source.aspect; - this.view = source.view === null ? null : Object.assign( {}, source.view ); - - this.filmGauge = source.filmGauge; - this.filmOffset = source.filmOffset; - - return this; - - }, - - /** - * Sets the FOV by focal length in respect to the current .filmGauge. - * - * The default film gauge is 35, so that the focal length can be specified for - * a 35mm (full frame) camera. - * - * Values for focal length and film gauge must have the same unit. - */ - setFocalLength: function ( focalLength ) { - - // see http://www.bobatkins.com/photography/technical/field_of_view.html - var vExtentSlope = 0.5 * this.getFilmHeight() / focalLength; - - this.fov = _Math.RAD2DEG * 2 * Math.atan( vExtentSlope ); - this.updateProjectionMatrix(); - - }, - - /** - * Calculates the focal length from the current .fov and .filmGauge. - */ - getFocalLength: function () { - - var vExtentSlope = Math.tan( _Math.DEG2RAD * 0.5 * this.fov ); - - return 0.5 * this.getFilmHeight() / vExtentSlope; - - }, - - getEffectiveFOV: function () { - - return _Math.RAD2DEG * 2 * Math.atan( - Math.tan( _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom ); - - }, - - getFilmWidth: function () { - - // film not completely covered in portrait format (aspect < 1) - return this.filmGauge * Math.min( this.aspect, 1 ); - - }, - - getFilmHeight: function () { - - // film not completely covered in landscape format (aspect > 1) - return this.filmGauge / Math.max( this.aspect, 1 ); - - }, - - /** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and - * the monitors are in grid like this - * - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - * - * then for each monitor you would call it like this - * - * var w = 1920; - * var h = 1080; - * var fullWidth = w * 3; - * var fullHeight = h * 2; - * - * --A-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * --B-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * --C-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * --D-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * --E-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * --F-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); - * - * Note there is no reason monitors have to be the same size or in a grid. - */ - setViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) { - - this.aspect = fullWidth / fullHeight; - - if ( this.view === null ) { - - this.view = { - enabled: true, - fullWidth: 1, - fullHeight: 1, - offsetX: 0, - offsetY: 0, - width: 1, - height: 1 - }; - - } - - this.view.enabled = true; - this.view.fullWidth = fullWidth; - this.view.fullHeight = fullHeight; - this.view.offsetX = x; - this.view.offsetY = y; - this.view.width = width; - this.view.height = height; - - this.updateProjectionMatrix(); - - }, - - clearViewOffset: function () { - - if ( this.view !== null ) { - - this.view.enabled = false; - - } - - this.updateProjectionMatrix(); - - }, - - updateProjectionMatrix: function () { - - var near = this.near, - top = near * Math.tan( _Math.DEG2RAD * 0.5 * this.fov ) / this.zoom, - height = 2 * top, - width = this.aspect * height, - left = - 0.5 * width, - view = this.view; - - if ( this.view !== null && this.view.enabled ) { - - var fullWidth = view.fullWidth, - fullHeight = view.fullHeight; - - left += view.offsetX * width / fullWidth; - top -= view.offsetY * height / fullHeight; - width *= view.width / fullWidth; - height *= view.height / fullHeight; - - } - - var skew = this.filmOffset; - if ( skew !== 0 ) left += near * skew / this.getFilmWidth(); - - this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far ); - - this.projectionMatrixInverse.getInverse( this.projectionMatrix ); - - }, - - toJSON: function ( meta ) { - - var data = Object3D.prototype.toJSON.call( this, meta ); - - data.object.fov = this.fov; - data.object.zoom = this.zoom; - - data.object.near = this.near; - data.object.far = this.far; - data.object.focus = this.focus; - - data.object.aspect = this.aspect; - - if ( this.view !== null ) data.object.view = Object.assign( {}, this.view ); - - data.object.filmGauge = this.filmGauge; - data.object.filmOffset = this.filmOffset; - - return data; - - } - -} ); - - -export { PerspectiveCamera }; diff --git a/cases/esbuild-three/src/base/cameras/StereoCamera.d.ts b/cases/esbuild-three/src/base/cameras/StereoCamera.d.ts deleted file mode 100644 index 5ba067df46..0000000000 --- a/cases/esbuild-three/src/base/cameras/StereoCamera.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PerspectiveCamera } from './PerspectiveCamera'; -import { Camera } from './Camera'; - -export class StereoCamera extends Camera { - - constructor(); - - type: 'StereoCamera'; - - aspect: number; - eyeSep: number; - cameraL: PerspectiveCamera; - cameraR: PerspectiveCamera; - - update( camera: PerspectiveCamera ): void; - -} diff --git a/cases/esbuild-three/src/base/cameras/StereoCamera.js b/cases/esbuild-three/src/base/cameras/StereoCamera.js deleted file mode 100644 index b5c80dea1a..0000000000 --- a/cases/esbuild-three/src/base/cameras/StereoCamera.js +++ /dev/null @@ -1,104 +0,0 @@ -import { Matrix4 } from '../math/Matrix4.js'; -import { _Math } from '../math/Math.js'; -import { PerspectiveCamera } from './PerspectiveCamera.js'; - -var _eyeRight = new Matrix4(); -var _eyeLeft = new Matrix4(); - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function StereoCamera() { - - this.type = 'StereoCamera'; - - this.aspect = 1; - - this.eyeSep = 0.064; - - this.cameraL = new PerspectiveCamera(); - this.cameraL.layers.enable( 1 ); - this.cameraL.matrixAutoUpdate = false; - - this.cameraR = new PerspectiveCamera(); - this.cameraR.layers.enable( 2 ); - this.cameraR.matrixAutoUpdate = false; - - this._cache = { - focus: null, - fov: null, - aspect: null, - near: null, - far: null, - zoom: null, - eyeSep: null - }; - -} - -Object.assign( StereoCamera.prototype, { - - update: function ( camera ) { - - var cache = this._cache; - - var needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || - cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || - cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep; - - if ( needsUpdate ) { - - cache.focus = camera.focus; - cache.fov = camera.fov; - cache.aspect = camera.aspect * this.aspect; - cache.near = camera.near; - cache.far = camera.far; - cache.zoom = camera.zoom; - cache.eyeSep = this.eyeSep; - - // Off-axis stereoscopic effect based on - // http://paulbourke.net/stereographics/stereorender/ - - var projectionMatrix = camera.projectionMatrix.clone(); - var eyeSepHalf = cache.eyeSep / 2; - var eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus; - var ymax = ( cache.near * Math.tan( _Math.DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom; - var xmin, xmax; - - // translate xOffset - - _eyeLeft.elements[ 12 ] = - eyeSepHalf; - _eyeRight.elements[ 12 ] = eyeSepHalf; - - // for left eye - - xmin = - ymax * cache.aspect + eyeSepOnProjection; - xmax = ymax * cache.aspect + eyeSepOnProjection; - - projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); - projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); - - this.cameraL.projectionMatrix.copy( projectionMatrix ); - - // for right eye - - xmin = - ymax * cache.aspect - eyeSepOnProjection; - xmax = ymax * cache.aspect - eyeSepOnProjection; - - projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin ); - projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin ); - - this.cameraR.projectionMatrix.copy( projectionMatrix ); - - } - - this.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft ); - this.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight ); - - } - -} ); - - -export { StereoCamera }; diff --git a/cases/esbuild-three/src/base/constants.d.ts b/cases/esbuild-three/src/base/constants.d.ts deleted file mode 100644 index 8d200621ac..0000000000 --- a/cases/esbuild-three/src/base/constants.d.ts +++ /dev/null @@ -1,277 +0,0 @@ -export const REVISION: string; - -// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button -export enum MOUSE { - LEFT, - MIDDLE, - RIGHT, - ROTATE, - DOLLY, - PAN, -} - -export enum TOUCH { - ROTATE, - PAN, - DOLLY_PAN, - DOLLY_ROTATE, -} - -// GL STATE CONSTANTS -export enum CullFace {} -export const CullFaceNone: CullFace; -export const CullFaceBack: CullFace; -export const CullFaceFront: CullFace; -export const CullFaceFrontBack: CullFace; - -export enum FrontFaceDirection {} -export const FrontFaceDirectionCW: FrontFaceDirection; -export const FrontFaceDirectionCCW: FrontFaceDirection; - -// Shadowing Type -export enum ShadowMapType {} -export const BasicShadowMap: ShadowMapType; -export const PCFShadowMap: ShadowMapType; -export const PCFSoftShadowMap: ShadowMapType; -export const VSMShadowMap: ShadowMapType; - -// MATERIAL CONSTANTS - -// side -export enum Side {} -export const FrontSide: Side; -export const BackSide: Side; -export const DoubleSide: Side; - -// shading -export enum Shading {} -export const FlatShading: Shading; -export const SmoothShading: Shading; - -// colors -export enum Colors {} -export const NoColors: Colors; -export const FaceColors: Colors; -export const VertexColors: Colors; - -// blending modes -export enum Blending {} -export const NoBlending: Blending; -export const NormalBlending: Blending; -export const AdditiveBlending: Blending; -export const SubtractiveBlending: Blending; -export const MultiplyBlending: Blending; -export const CustomBlending: Blending; - -// custom blending equations -// (numbers start from 100 not to clash with other -// mappings to OpenGL constants defined in Texture.js) -export enum BlendingEquation {} -export const AddEquation: BlendingEquation; -export const SubtractEquation: BlendingEquation; -export const ReverseSubtractEquation: BlendingEquation; -export const MinEquation: BlendingEquation; -export const MaxEquation: BlendingEquation; - -// custom blending destination factors -export enum BlendingDstFactor {} -export const ZeroFactor: BlendingDstFactor; -export const OneFactor: BlendingDstFactor; -export const SrcColorFactor: BlendingDstFactor; -export const OneMinusSrcColorFactor: BlendingDstFactor; -export const SrcAlphaFactor: BlendingDstFactor; -export const OneMinusSrcAlphaFactor: BlendingDstFactor; -export const DstAlphaFactor: BlendingDstFactor; -export const OneMinusDstAlphaFactor: BlendingDstFactor; -export const DstColorFactor: BlendingDstFactor; -export const OneMinusDstColorFactor: BlendingDstFactor; - -// custom blending src factors -export enum BlendingSrcFactor {} -export const SrcAlphaSaturateFactor: BlendingSrcFactor; - -// depth modes -export enum DepthModes {} -export const NeverDepth: DepthModes; -export const AlwaysDepth: DepthModes; -export const LessDepth: DepthModes; -export const LessEqualDepth: DepthModes; -export const EqualDepth: DepthModes; -export const GreaterEqualDepth: DepthModes; -export const GreaterDepth: DepthModes; -export const NotEqualDepth: DepthModes; - -// TEXTURE CONSTANTS -// Operations -export enum Combine {} -export const MultiplyOperation: Combine; -export const MixOperation: Combine; -export const AddOperation: Combine; - -// Tone Mapping modes -export enum ToneMapping {} -export const NoToneMapping: ToneMapping; -export const LinearToneMapping: ToneMapping; -export const ReinhardToneMapping: ToneMapping; -export const Uncharted2ToneMapping: ToneMapping; -export const CineonToneMapping: ToneMapping; - -// Mapping modes -export enum Mapping {} -export const UVMapping: Mapping; -export const CubeReflectionMapping: Mapping; -export const CubeRefractionMapping: Mapping; -export const EquirectangularReflectionMapping: Mapping; -export const EquirectangularRefractionMapping: Mapping; -export const SphericalReflectionMapping: Mapping; -export const CubeUVReflectionMapping: Mapping; -export const CubeUVRefractionMapping: Mapping; - -// Wrapping modes -export enum Wrapping {} -export const RepeatWrapping: Wrapping; -export const ClampToEdgeWrapping: Wrapping; -export const MirroredRepeatWrapping: Wrapping; - -// Filters -export enum TextureFilter {} -export const NearestFilter: TextureFilter; -export const NearestMipmapNearestFilter: TextureFilter; -export const NearestMipMapNearestFilter: TextureFilter; -export const NearestMipmapLinearFilter: TextureFilter; -export const NearestMipMapLinearFilter: TextureFilter; -export const LinearFilter: TextureFilter; -export const LinearMipmapNearestFilter: TextureFilter; -export const LinearMipMapNearestFilter: TextureFilter; -export const LinearMipmapLinearFilter: TextureFilter; -export const LinearMipMapLinearFilter: TextureFilter; - -// Data types -export enum TextureDataType {} -export const UnsignedByteType: TextureDataType; -export const ByteType: TextureDataType; -export const ShortType: TextureDataType; -export const UnsignedShortType: TextureDataType; -export const IntType: TextureDataType; -export const UnsignedIntType: TextureDataType; -export const FloatType: TextureDataType; -export const HalfFloatType: TextureDataType; - -// Pixel types -export enum PixelType {} -export const UnsignedShort4444Type: PixelType; -export const UnsignedShort5551Type: PixelType; -export const UnsignedShort565Type: PixelType; -export const UnsignedInt248Type: PixelType; - -// Pixel formats -export enum PixelFormat {} -export const AlphaFormat: PixelFormat; -export const RGBFormat: PixelFormat; -export const RGBAFormat: PixelFormat; -export const LuminanceFormat: PixelFormat; -export const LuminanceAlphaFormat: PixelFormat; -export const RGBEFormat: PixelFormat; -export const DepthFormat: PixelFormat; -export const DepthStencilFormat: PixelFormat; -export const RedFormat: PixelFormat; - -// Compressed texture formats -// DDS / ST3C Compressed texture formats -export enum CompressedPixelFormat {} -export const RGB_S3TC_DXT1_Format: CompressedPixelFormat; -export const RGBA_S3TC_DXT1_Format: CompressedPixelFormat; -export const RGBA_S3TC_DXT3_Format: CompressedPixelFormat; -export const RGBA_S3TC_DXT5_Format: CompressedPixelFormat; - -// PVRTC compressed './texture formats -export const RGB_PVRTC_4BPPV1_Format: CompressedPixelFormat; -export const RGB_PVRTC_2BPPV1_Format: CompressedPixelFormat; -export const RGBA_PVRTC_4BPPV1_Format: CompressedPixelFormat; -export const RGBA_PVRTC_2BPPV1_Format: CompressedPixelFormat; - -// ETC compressed texture formats -export const RGB_ETC1_Format: CompressedPixelFormat; - -// ASTC compressed texture formats -export const RGBA_ASTC_4x4_Format: CompressedPixelFormat; -export const RGBA_ASTC_5x4_Format: CompressedPixelFormat; -export const RGBA_ASTC_5x5_Format: CompressedPixelFormat; -export const RGBA_ASTC_6x5_Format: CompressedPixelFormat; -export const RGBA_ASTC_6x6_Format: CompressedPixelFormat; -export const RGBA_ASTC_8x5_Format: CompressedPixelFormat; -export const RGBA_ASTC_8x6_Format: CompressedPixelFormat; -export const RGBA_ASTC_8x8_Format: CompressedPixelFormat; -export const RGBA_ASTC_10x5_Format: CompressedPixelFormat; -export const RGBA_ASTC_10x6_Format: CompressedPixelFormat; -export const RGBA_ASTC_10x8_Format: CompressedPixelFormat; -export const RGBA_ASTC_10x10_Format: CompressedPixelFormat; -export const RGBA_ASTC_12x10_Format: CompressedPixelFormat; -export const RGBA_ASTC_12x12_Format: CompressedPixelFormat; - -// Loop styles for AnimationAction -export enum AnimationActionLoopStyles {} -export const LoopOnce: AnimationActionLoopStyles; -export const LoopRepeat: AnimationActionLoopStyles; -export const LoopPingPong: AnimationActionLoopStyles; - -// Interpolation -export enum InterpolationModes {} -export const InterpolateDiscrete: InterpolationModes; -export const InterpolateLinear: InterpolationModes; -export const InterpolateSmooth: InterpolationModes; - -// Interpolant ending modes -export enum InterpolationEndingModes {} -export const ZeroCurvatureEnding: InterpolationEndingModes; -export const ZeroSlopeEnding: InterpolationEndingModes; -export const WrapAroundEnding: InterpolationEndingModes; - -// Triangle Draw modes -export enum TrianglesDrawModes {} -export const TrianglesDrawMode: TrianglesDrawModes; -export const TriangleStripDrawMode: TrianglesDrawModes; -export const TriangleFanDrawMode: TrianglesDrawModes; - -// Texture Encodings -export enum TextureEncoding {} -export const LinearEncoding: TextureEncoding; -export const sRGBEncoding: TextureEncoding; -export const GammaEncoding: TextureEncoding; -export const RGBEEncoding: TextureEncoding; -export const LogLuvEncoding: TextureEncoding; -export const RGBM7Encoding: TextureEncoding; -export const RGBM16Encoding: TextureEncoding; -export const RGBDEncoding: TextureEncoding; - -// Depth packing strategies -export enum DepthPackingStrategies {} -export const BasicDepthPacking: DepthPackingStrategies; -export const RGBADepthPacking: DepthPackingStrategies; - -// Normal Map types -export enum NormalMapTypes {} -export const TangentSpaceNormalMap: NormalMapTypes; -export const ObjectSpaceNormalMap: NormalMapTypes; - -// Stencil Op types -export enum StencilOp {} -export const ZeroStencilOp: StencilOp; -export const KeepStencilOp: StencilOp; -export const ReplaceStencilOp: StencilOp; -export const IncrementStencilOp: StencilOp; -export const DecrementStencilOp: StencilOp; -export const IncrementWrapStencilOp: StencilOp; -export const DecrementWrapStencilOp: StencilOp; -export const InvertStencilOp: StencilOp; - -// Stencil Func types -export enum StencilFunc {} -export const NeverStencilFunc: StencilFunc; -export const LessStencilFunc: StencilFunc; -export const EqualStencilFunc: StencilFunc; -export const LessEqualStencilFunc: StencilFunc; -export const GreaterStencilFunc: StencilFunc; -export const NotEqualStencilFunc: StencilFunc; -export const GreaterEqualStencilFunc: StencilFunc; -export const AlwaysStencilFunc: StencilFunc; diff --git a/cases/esbuild-three/src/base/constants.js b/cases/esbuild-three/src/base/constants.js deleted file mode 100644 index faddeb0c79..0000000000 --- a/cases/esbuild-three/src/base/constants.js +++ /dev/null @@ -1,168 +0,0 @@ -export var REVISION = '108'; -export var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; -export var TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; -export var CullFaceNone = 0; -export var CullFaceBack = 1; -export var CullFaceFront = 2; -export var CullFaceFrontBack = 3; -export var FrontFaceDirectionCW = 0; -export var FrontFaceDirectionCCW = 1; -export var BasicShadowMap = 0; -export var PCFShadowMap = 1; -export var PCFSoftShadowMap = 2; -export var VSMShadowMap = 3; -export var FrontSide = 0; -export var BackSide = 1; -export var DoubleSide = 2; -export var FlatShading = 1; -export var SmoothShading = 2; -export var NoColors = 0; -export var FaceColors = 1; -export var VertexColors = 2; -export var NoBlending = 0; -export var NormalBlending = 1; -export var AdditiveBlending = 2; -export var SubtractiveBlending = 3; -export var MultiplyBlending = 4; -export var CustomBlending = 5; -export var AddEquation = 100; -export var SubtractEquation = 101; -export var ReverseSubtractEquation = 102; -export var MinEquation = 103; -export var MaxEquation = 104; -export var ZeroFactor = 200; -export var OneFactor = 201; -export var SrcColorFactor = 202; -export var OneMinusSrcColorFactor = 203; -export var SrcAlphaFactor = 204; -export var OneMinusSrcAlphaFactor = 205; -export var DstAlphaFactor = 206; -export var OneMinusDstAlphaFactor = 207; -export var DstColorFactor = 208; -export var OneMinusDstColorFactor = 209; -export var SrcAlphaSaturateFactor = 210; -export var NeverDepth = 0; -export var AlwaysDepth = 1; -export var LessDepth = 2; -export var LessEqualDepth = 3; -export var EqualDepth = 4; -export var GreaterEqualDepth = 5; -export var GreaterDepth = 6; -export var NotEqualDepth = 7; -export var MultiplyOperation = 0; -export var MixOperation = 1; -export var AddOperation = 2; -export var NoToneMapping = 0; -export var LinearToneMapping = 1; -export var ReinhardToneMapping = 2; -export var Uncharted2ToneMapping = 3; -export var CineonToneMapping = 4; -export var ACESFilmicToneMapping = 5; - -export var UVMapping = 300; -export var CubeReflectionMapping = 301; -export var CubeRefractionMapping = 302; -export var EquirectangularReflectionMapping = 303; -export var EquirectangularRefractionMapping = 304; -export var SphericalReflectionMapping = 305; -export var CubeUVReflectionMapping = 306; -export var CubeUVRefractionMapping = 307; -export var RepeatWrapping = 1000; -export var ClampToEdgeWrapping = 1001; -export var MirroredRepeatWrapping = 1002; -export var NearestFilter = 1003; -export var NearestMipmapNearestFilter = 1004; -export var NearestMipMapNearestFilter = 1004; -export var NearestMipmapLinearFilter = 1005; -export var NearestMipMapLinearFilter = 1005; -export var LinearFilter = 1006; -export var LinearMipmapNearestFilter = 1007; -export var LinearMipMapNearestFilter = 1007; -export var LinearMipmapLinearFilter = 1008; -export var LinearMipMapLinearFilter = 1008; -export var UnsignedByteType = 1009; -export var ByteType = 1010; -export var ShortType = 1011; -export var UnsignedShortType = 1012; -export var IntType = 1013; -export var UnsignedIntType = 1014; -export var FloatType = 1015; -export var HalfFloatType = 1016; -export var UnsignedShort4444Type = 1017; -export var UnsignedShort5551Type = 1018; -export var UnsignedShort565Type = 1019; -export var UnsignedInt248Type = 1020; -export var AlphaFormat = 1021; -export var RGBFormat = 1022; -export var RGBAFormat = 1023; -export var LuminanceFormat = 1024; -export var LuminanceAlphaFormat = 1025; -export var RGBEFormat = RGBAFormat; -export var DepthFormat = 1026; -export var DepthStencilFormat = 1027; -export var RedFormat = 1028; -export var RGB_S3TC_DXT1_Format = 33776; -export var RGBA_S3TC_DXT1_Format = 33777; -export var RGBA_S3TC_DXT3_Format = 33778; -export var RGBA_S3TC_DXT5_Format = 33779; -export var RGB_PVRTC_4BPPV1_Format = 35840; -export var RGB_PVRTC_2BPPV1_Format = 35841; -export var RGBA_PVRTC_4BPPV1_Format = 35842; -export var RGBA_PVRTC_2BPPV1_Format = 35843; -export var RGB_ETC1_Format = 36196; -export var RGBA_ASTC_4x4_Format = 37808; -export var RGBA_ASTC_5x4_Format = 37809; -export var RGBA_ASTC_5x5_Format = 37810; -export var RGBA_ASTC_6x5_Format = 37811; -export var RGBA_ASTC_6x6_Format = 37812; -export var RGBA_ASTC_8x5_Format = 37813; -export var RGBA_ASTC_8x6_Format = 37814; -export var RGBA_ASTC_8x8_Format = 37815; -export var RGBA_ASTC_10x5_Format = 37816; -export var RGBA_ASTC_10x6_Format = 37817; -export var RGBA_ASTC_10x8_Format = 37818; -export var RGBA_ASTC_10x10_Format = 37819; -export var RGBA_ASTC_12x10_Format = 37820; -export var RGBA_ASTC_12x12_Format = 37821; -export var LoopOnce = 2200; -export var LoopRepeat = 2201; -export var LoopPingPong = 2202; -export var InterpolateDiscrete = 2300; -export var InterpolateLinear = 2301; -export var InterpolateSmooth = 2302; -export var ZeroCurvatureEnding = 2400; -export var ZeroSlopeEnding = 2401; -export var WrapAroundEnding = 2402; -export var TrianglesDrawMode = 0; -export var TriangleStripDrawMode = 1; -export var TriangleFanDrawMode = 2; -export var LinearEncoding = 3000; -export var sRGBEncoding = 3001; -export var GammaEncoding = 3007; -export var RGBEEncoding = 3002; -export var LogLuvEncoding = 3003; -export var RGBM7Encoding = 3004; -export var RGBM16Encoding = 3005; -export var RGBDEncoding = 3006; -export var BasicDepthPacking = 3200; -export var RGBADepthPacking = 3201; -export var TangentSpaceNormalMap = 0; -export var ObjectSpaceNormalMap = 1; - -export var ZeroStencilOp = 0; -export var KeepStencilOp = 7680; -export var ReplaceStencilOp = 7681; -export var IncrementStencilOp = 7682; -export var DecrementStencilOp = 7683; -export var IncrementWrapStencilOp = 34055; -export var DecrementWrapStencilOp = 34056; -export var InvertStencilOp = 5386; - -export var NeverStencilFunc = 512; -export var LessStencilFunc = 513; -export var EqualStencilFunc = 514; -export var LessEqualStencilFunc = 515; -export var GreaterStencilFunc = 516; -export var NotEqualStencilFunc = 517; -export var GreaterEqualStencilFunc = 518; -export var AlwaysStencilFunc = 519; diff --git a/cases/esbuild-three/src/base/core/BufferAttribute.d.ts b/cases/esbuild-three/src/base/core/BufferAttribute.d.ts deleted file mode 100644 index c01514c7bc..0000000000 --- a/cases/esbuild-three/src/base/core/BufferAttribute.d.ts +++ /dev/null @@ -1,236 +0,0 @@ -/** - * @see src/core/BufferAttribute.js - */ -export class BufferAttribute { - - constructor( array: ArrayLike, itemSize: number, normalized?: boolean ); // array parameter should be TypedArray. - - name: string; - array: ArrayLike; - itemSize: number; - dynamic: boolean; - updateRange: { offset: number; count: number }; - version: number; - normalized: boolean; - needsUpdate: boolean; - count: number; - onUpload: Function; - - setArray( array?: ArrayBufferView ): void; - setDynamic( dynamic: boolean ): BufferAttribute; - clone(): this; - copy( source: BufferAttribute ): this; - copyAt( - index1: number, - attribute: BufferAttribute, - index2: number - ): BufferAttribute; - copyArray( array: ArrayLike ): BufferAttribute; - copyColorsArray( - colors: { r: number; g: number; b: number }[] - ): BufferAttribute; - copyVector2sArray( vectors: { x: number; y: number }[] ): BufferAttribute; - copyVector3sArray( - vectors: { x: number; y: number; z: number }[] - ): BufferAttribute; - copyVector4sArray( - vectors: { x: number; y: number; z: number; w: number }[] - ): BufferAttribute; - set( - value: ArrayLike | ArrayBufferView, - offset?: number - ): BufferAttribute; - getX( index: number ): number; - setX( index: number, x: number ): BufferAttribute; - getY( index: number ): number; - setY( index: number, y: number ): BufferAttribute; - getZ( index: number ): number; - setZ( index: number, z: number ): BufferAttribute; - getW( index: number ): number; - setW( index: number, z: number ): BufferAttribute; - setXY( index: number, x: number, y: number ): BufferAttribute; - setXYZ( index: number, x: number, y: number, z: number ): BufferAttribute; - setXYZW( - index: number, - x: number, - y: number, - z: number, - w: number - ): BufferAttribute; - /** - * @deprecated Use {@link BufferAttribute#count .count} instead. - */ - length: number; - -} - -/** - * @deprecated THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead. - */ -export class Int8Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead. - */ -export class Uint8Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead. - */ -export class Uint8ClampedAttribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead. - */ -export class Int16Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead. - */ -export class Uint16Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead. - */ -export class Int32Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead. - */ -export class Uint32Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead. - */ -export class Float32Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -/** - * @deprecated THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead. - */ -export class Float64Attribute extends BufferAttribute { - - constructor( array: any, itemSize: number ); - -} - -export class Int8BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Uint8BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Uint8ClampedBufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Int16BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Uint16BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Int32BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Uint32BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Float32BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} - -export class Float64BufferAttribute extends BufferAttribute { - - constructor( - array: Iterable | ArrayLike | ArrayBuffer, - itemSize: number, - normalized?: boolean - ); - -} diff --git a/cases/esbuild-three/src/base/core/BufferAttribute.js b/cases/esbuild-three/src/base/core/BufferAttribute.js deleted file mode 100644 index d7cff273df..0000000000 --- a/cases/esbuild-three/src/base/core/BufferAttribute.js +++ /dev/null @@ -1,441 +0,0 @@ -import { Vector4 } from '../math/Vector4.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function BufferAttribute( array, itemSize, normalized ) { - - if ( Array.isArray( array ) ) { - - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); - - } - - this.name = ''; - - this.array = array; - this.itemSize = itemSize; - this.count = array !== undefined ? array.length / itemSize : 0; - this.normalized = normalized === true; - - this.dynamic = false; - this.updateRange = { offset: 0, count: - 1 }; - - this.version = 0; - -} - -Object.defineProperty( BufferAttribute.prototype, 'needsUpdate', { - - set: function ( value ) { - - if ( value === true ) this.version ++; - - } - -} ); - -Object.assign( BufferAttribute.prototype, { - - isBufferAttribute: true, - - onUploadCallback: function () {}, - - setArray: function ( array ) { - - if ( Array.isArray( array ) ) { - - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); - - } - - this.count = array !== undefined ? array.length / this.itemSize : 0; - this.array = array; - - return this; - - }, - - setDynamic: function ( value ) { - - this.dynamic = value; - - return this; - - }, - - copy: function ( source ) { - - this.name = source.name; - this.array = new source.array.constructor( source.array ); - this.itemSize = source.itemSize; - this.count = source.count; - this.normalized = source.normalized; - - this.dynamic = source.dynamic; - - return this; - - }, - - copyAt: function ( index1, attribute, index2 ) { - - index1 *= this.itemSize; - index2 *= attribute.itemSize; - - for ( var i = 0, l = this.itemSize; i < l; i ++ ) { - - this.array[ index1 + i ] = attribute.array[ index2 + i ]; - - } - - return this; - - }, - - copyArray: function ( array ) { - - this.array.set( array ); - - return this; - - }, - - copyColorsArray: function ( colors ) { - - var array = this.array, offset = 0; - - for ( var i = 0, l = colors.length; i < l; i ++ ) { - - var color = colors[ i ]; - - if ( color === undefined ) { - - console.warn( 'THREE.BufferAttribute.copyColorsArray(): color is undefined', i ); - color = new Color(); - - } - - array[ offset ++ ] = color.r; - array[ offset ++ ] = color.g; - array[ offset ++ ] = color.b; - - } - - return this; - - }, - - copyVector2sArray: function ( vectors ) { - - var array = this.array, offset = 0; - - for ( var i = 0, l = vectors.length; i < l; i ++ ) { - - var vector = vectors[ i ]; - - if ( vector === undefined ) { - - console.warn( 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i ); - vector = new Vector2(); - - } - - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; - - } - - return this; - - }, - - copyVector3sArray: function ( vectors ) { - - var array = this.array, offset = 0; - - for ( var i = 0, l = vectors.length; i < l; i ++ ) { - - var vector = vectors[ i ]; - - if ( vector === undefined ) { - - console.warn( 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i ); - vector = new Vector3(); - - } - - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; - array[ offset ++ ] = vector.z; - - } - - return this; - - }, - - copyVector4sArray: function ( vectors ) { - - var array = this.array, offset = 0; - - for ( var i = 0, l = vectors.length; i < l; i ++ ) { - - var vector = vectors[ i ]; - - if ( vector === undefined ) { - - console.warn( 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i ); - vector = new Vector4(); - - } - - array[ offset ++ ] = vector.x; - array[ offset ++ ] = vector.y; - array[ offset ++ ] = vector.z; - array[ offset ++ ] = vector.w; - - } - - return this; - - }, - - set: function ( value, offset ) { - - if ( offset === undefined ) offset = 0; - - this.array.set( value, offset ); - - return this; - - }, - - getX: function ( index ) { - - return this.array[ index * this.itemSize ]; - - }, - - setX: function ( index, x ) { - - this.array[ index * this.itemSize ] = x; - - return this; - - }, - - getY: function ( index ) { - - return this.array[ index * this.itemSize + 1 ]; - - }, - - setY: function ( index, y ) { - - this.array[ index * this.itemSize + 1 ] = y; - - return this; - - }, - - getZ: function ( index ) { - - return this.array[ index * this.itemSize + 2 ]; - - }, - - setZ: function ( index, z ) { - - this.array[ index * this.itemSize + 2 ] = z; - - return this; - - }, - - getW: function ( index ) { - - return this.array[ index * this.itemSize + 3 ]; - - }, - - setW: function ( index, w ) { - - this.array[ index * this.itemSize + 3 ] = w; - - return this; - - }, - - setXY: function ( index, x, y ) { - - index *= this.itemSize; - - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; - - return this; - - }, - - setXYZ: function ( index, x, y, z ) { - - index *= this.itemSize; - - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; - this.array[ index + 2 ] = z; - - return this; - - }, - - setXYZW: function ( index, x, y, z, w ) { - - index *= this.itemSize; - - this.array[ index + 0 ] = x; - this.array[ index + 1 ] = y; - this.array[ index + 2 ] = z; - this.array[ index + 3 ] = w; - - return this; - - }, - - onUpload: function ( callback ) { - - this.onUploadCallback = callback; - - return this; - - }, - - clone: function () { - - return new this.constructor( this.array, this.itemSize ).copy( this ); - - }, - - toJSON: function () { - - return { - itemSize: this.itemSize, - type: this.array.constructor.name, - array: Array.prototype.slice.call( this.array ), - normalized: this.normalized - }; - - } - -} ); - -// - -function Int8BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Int8Array( array ), itemSize, normalized ); - -} - -Int8BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Int8BufferAttribute.prototype.constructor = Int8BufferAttribute; - - -function Uint8BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Uint8Array( array ), itemSize, normalized ); - -} - -Uint8BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Uint8BufferAttribute.prototype.constructor = Uint8BufferAttribute; - - -function Uint8ClampedBufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Uint8ClampedArray( array ), itemSize, normalized ); - -} - -Uint8ClampedBufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Uint8ClampedBufferAttribute.prototype.constructor = Uint8ClampedBufferAttribute; - - -function Int16BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Int16Array( array ), itemSize, normalized ); - -} - -Int16BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Int16BufferAttribute.prototype.constructor = Int16BufferAttribute; - - -function Uint16BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Uint16Array( array ), itemSize, normalized ); - -} - -Uint16BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Uint16BufferAttribute.prototype.constructor = Uint16BufferAttribute; - - -function Int32BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Int32Array( array ), itemSize, normalized ); - -} - -Int32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Int32BufferAttribute.prototype.constructor = Int32BufferAttribute; - - -function Uint32BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Uint32Array( array ), itemSize, normalized ); - -} - -Uint32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Uint32BufferAttribute.prototype.constructor = Uint32BufferAttribute; - - -function Float32BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Float32Array( array ), itemSize, normalized ); - -} - -Float32BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Float32BufferAttribute.prototype.constructor = Float32BufferAttribute; - - -function Float64BufferAttribute( array, itemSize, normalized ) { - - BufferAttribute.call( this, new Float64Array( array ), itemSize, normalized ); - -} - -Float64BufferAttribute.prototype = Object.create( BufferAttribute.prototype ); -Float64BufferAttribute.prototype.constructor = Float64BufferAttribute; - -// - -export { - Float64BufferAttribute, - Float32BufferAttribute, - Uint32BufferAttribute, - Int32BufferAttribute, - Uint16BufferAttribute, - Int16BufferAttribute, - Uint8ClampedBufferAttribute, - Uint8BufferAttribute, - Int8BufferAttribute, - BufferAttribute -}; diff --git a/cases/esbuild-three/src/base/core/BufferGeometry.d.ts b/cases/esbuild-three/src/base/core/BufferGeometry.d.ts deleted file mode 100644 index 21e2f5adf5..0000000000 --- a/cases/esbuild-three/src/base/core/BufferGeometry.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { BufferAttribute } from './BufferAttribute'; -import { Box3 } from './../math/Box3'; -import { Sphere } from './../math/Sphere'; -import { Matrix4 } from './../math/Matrix4'; -import { Vector2 } from './../math/Vector2'; -import { Vector3 } from './../math/Vector3'; -import { Object3D } from './Object3D'; -import { Geometry } from './Geometry'; -import { DirectGeometry } from './DirectGeometry'; -import { EventDispatcher } from './EventDispatcher'; -import { InterleavedBufferAttribute } from './InterleavedBufferAttribute'; - -/** - * This is a superefficent class for geometries because it saves all data in buffers. - * It reduces memory costs and cpu cycles. But it is not as easy to work with because of all the nessecary buffer calculations. - * It is mainly interesting when working with static objects. - * - * @see src/core/BufferGeometry.js - */ -export class BufferGeometry extends EventDispatcher { - - /** - * This creates a new BufferGeometry. It also sets several properties to an default value. - */ - constructor(); - - static MaxIndex: number; - - /** - * Unique number of this buffergeometry instance - */ - id: number; - uuid: string; - name: string; - type: string; - index: BufferAttribute; - attributes: { - [name: string]: BufferAttribute | InterleavedBufferAttribute; - }; - morphAttributes: any; - groups: { start: number; count: number; materialIndex?: number }[]; - boundingBox: Box3; - boundingSphere: Sphere; - drawRange: { start: number; count: number }; - userData: {[key: string]: any}; - isBufferGeometry: boolean; - - getIndex(): BufferAttribute; - setIndex( index: BufferAttribute | number[] ): void; - - addAttribute( - name: string, - attribute: BufferAttribute | InterleavedBufferAttribute - ): BufferGeometry; - - getAttribute( name: string ): BufferAttribute | InterleavedBufferAttribute; - removeAttribute( name: string ): BufferGeometry; - - addGroup( start: number, count: number, materialIndex?: number ): void; - clearGroups(): void; - - setDrawRange( start: number, count: number ): void; - - /** - * Bakes matrix transform directly into vertex coordinates. - */ - applyMatrix( matrix: Matrix4 ): BufferGeometry; - - rotateX( angle: number ): BufferGeometry; - rotateY( angle: number ): BufferGeometry; - rotateZ( angle: number ): BufferGeometry; - translate( x: number, y: number, z: number ): BufferGeometry; - scale( x: number, y: number, z: number ): BufferGeometry; - lookAt( v: Vector3 ): void; - - center(): BufferGeometry; - - setFromObject( object: Object3D ): BufferGeometry; - setFromPoints( points: Vector3[] | Vector2[] ): BufferGeometry; - updateFromObject( object: Object3D ): void; - - fromGeometry( geometry: Geometry, settings?: any ): BufferGeometry; - - fromDirectGeometry( geometry: DirectGeometry ): BufferGeometry; - - /** - * Computes bounding box of the geometry, updating Geometry.boundingBox attribute. - * Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are null. - */ - computeBoundingBox(): void; - - /** - * Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. - * Bounding spheres aren't' computed by default. They need to be explicitly computed, otherwise they are null. - */ - computeBoundingSphere(): void; - - /** - * Computes vertex normals by averaging face normals. - */ - computeVertexNormals(): void; - - merge( geometry: BufferGeometry, offset: number ): BufferGeometry; - normalizeNormals(): void; - - toNonIndexed(): BufferGeometry; - - toJSON(): any; - clone(): this; - copy( source: BufferGeometry ): this; - - /** - * Disposes the object from memory. - * You need to call this when you want the bufferGeometry removed while the application is running. - */ - dispose(): void; - - /** - * @deprecated Use {@link BufferGeometry#groups .groups} instead. - */ - drawcalls: any; - - /** - * @deprecated Use {@link BufferGeometry#groups .groups} instead. - */ - offsets: any; - - /** - * @deprecated Use {@link BufferGeometry#setIndex .setIndex()} instead. - */ - addIndex( index: any ): void; - - /** - * @deprecated Use {@link BufferGeometry#addGroup .addGroup()} instead. - */ - addDrawCall( start: any, count: any, indexOffset?: any ): void; - - /** - * @deprecated Use {@link BufferGeometry#clearGroups .clearGroups()} instead. - */ - clearDrawCalls(): void; - - addAttribute( name: any, array: any, itemSize: any ): any; - -} diff --git a/cases/esbuild-three/src/base/core/BufferGeometry.js b/cases/esbuild-three/src/base/core/BufferGeometry.js deleted file mode 100644 index 32f354eaa8..0000000000 --- a/cases/esbuild-three/src/base/core/BufferGeometry.js +++ /dev/null @@ -1,1217 +0,0 @@ -import { Vector3 } from '../math/Vector3.js'; -import { Box3 } from '../math/Box3.js'; -import { EventDispatcher } from './EventDispatcher.js'; -import { BufferAttribute, Float32BufferAttribute, Uint16BufferAttribute, Uint32BufferAttribute } from './BufferAttribute.js'; -import { Sphere } from '../math/Sphere.js'; -import { DirectGeometry } from './DirectGeometry.js'; -import { Object3D } from './Object3D.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { _Math } from '../math/Math.js'; -import { arrayMax } from '../utils.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -var _bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id - -var _m1 = new Matrix4(); -var _obj = new Object3D(); -var _offset = new Vector3(); -var _box = new Box3(); -var _boxMorphTargets = new Box3(); -var _vector = new Vector3(); - -function BufferGeometry() { - - Object.defineProperty( this, 'id', { value: _bufferGeometryId += 2 } ); - - this.uuid = _Math.generateUUID(); - - this.name = ''; - this.type = 'BufferGeometry'; - - this.index = null; - this.attributes = {}; - - this.morphAttributes = {}; - - this.groups = []; - - this.boundingBox = null; - this.boundingSphere = null; - - this.drawRange = { start: 0, count: Infinity }; - - this.userData = {}; - -} - -BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: BufferGeometry, - - isBufferGeometry: true, - - getIndex: function () { - - return this.index; - - }, - - setIndex: function ( index ) { - - if ( Array.isArray( index ) ) { - - this.index = new ( arrayMax( index ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 ); - - } else { - - this.index = index; - - } - - }, - - addAttribute: function ( name, attribute ) { - - if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) { - - console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' ); - - return this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) ); - - } - - if ( name === 'index' ) { - - console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' ); - this.setIndex( attribute ); - - return this; - - } - - this.attributes[ name ] = attribute; - - return this; - - }, - - getAttribute: function ( name ) { - - return this.attributes[ name ]; - - }, - - removeAttribute: function ( name ) { - - delete this.attributes[ name ]; - - return this; - - }, - - addGroup: function ( start, count, materialIndex ) { - - this.groups.push( { - - start: start, - count: count, - materialIndex: materialIndex !== undefined ? materialIndex : 0 - - } ); - - }, - - clearGroups: function () { - - this.groups = []; - - }, - - setDrawRange: function ( start, count ) { - - this.drawRange.start = start; - this.drawRange.count = count; - - }, - - applyMatrix: function ( matrix ) { - - var position = this.attributes.position; - - if ( position !== undefined ) { - - matrix.applyToBufferAttribute( position ); - position.needsUpdate = true; - - } - - var normal = this.attributes.normal; - - if ( normal !== undefined ) { - - var normalMatrix = new Matrix3().getNormalMatrix( matrix ); - - normalMatrix.applyToBufferAttribute( normal ); - normal.needsUpdate = true; - - } - - var tangent = this.attributes.tangent; - - if ( tangent !== undefined ) { - - var normalMatrix = new Matrix3().getNormalMatrix( matrix ); - - // Tangent is vec4, but the '.w' component is a sign value (+1/-1). - normalMatrix.applyToBufferAttribute( tangent ); - tangent.needsUpdate = true; - - } - - if ( this.boundingBox !== null ) { - - this.computeBoundingBox(); - - } - - if ( this.boundingSphere !== null ) { - - this.computeBoundingSphere(); - - } - - return this; - - }, - - rotateX: function ( angle ) { - - // rotate geometry around world x-axis - - _m1.makeRotationX( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - rotateY: function ( angle ) { - - // rotate geometry around world y-axis - - _m1.makeRotationY( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - rotateZ: function ( angle ) { - - // rotate geometry around world z-axis - - _m1.makeRotationZ( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - translate: function ( x, y, z ) { - - // translate geometry - - _m1.makeTranslation( x, y, z ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - scale: function ( x, y, z ) { - - // scale geometry - - _m1.makeScale( x, y, z ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - lookAt: function ( vector ) { - - _obj.lookAt( vector ); - - _obj.updateMatrix(); - - this.applyMatrix( _obj.matrix ); - - return this; - - }, - - center: function () { - - this.computeBoundingBox(); - - this.boundingBox.getCenter( _offset ).negate(); - - this.translate( _offset.x, _offset.y, _offset.z ); - - return this; - - }, - - setFromObject: function ( object ) { - - // console.log( 'THREE.BufferGeometry.setFromObject(). Converting', object, this ); - - var geometry = object.geometry; - - if ( object.isPoints || object.isLine ) { - - var positions = new Float32BufferAttribute( geometry.vertices.length * 3, 3 ); - var colors = new Float32BufferAttribute( geometry.colors.length * 3, 3 ); - - this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) ); - this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) ); - - if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) { - - var lineDistances = new Float32BufferAttribute( geometry.lineDistances.length, 1 ); - - this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) ); - - } - - if ( geometry.boundingSphere !== null ) { - - this.boundingSphere = geometry.boundingSphere.clone(); - - } - - if ( geometry.boundingBox !== null ) { - - this.boundingBox = geometry.boundingBox.clone(); - - } - - } else if ( object.isMesh ) { - - if ( geometry && geometry.isGeometry ) { - - this.fromGeometry( geometry ); - - } - - } - - return this; - - }, - - setFromPoints: function ( points ) { - - var position = []; - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - var point = points[ i ]; - position.push( point.x, point.y, point.z || 0 ); - - } - - this.addAttribute( 'position', new Float32BufferAttribute( position, 3 ) ); - - return this; - - }, - - updateFromObject: function ( object ) { - - var geometry = object.geometry; - - if ( object.isMesh ) { - - var direct = geometry.__directGeometry; - - if ( geometry.elementsNeedUpdate === true ) { - - direct = undefined; - geometry.elementsNeedUpdate = false; - - } - - if ( direct === undefined ) { - - return this.fromGeometry( geometry ); - - } - - direct.verticesNeedUpdate = geometry.verticesNeedUpdate; - direct.normalsNeedUpdate = geometry.normalsNeedUpdate; - direct.colorsNeedUpdate = geometry.colorsNeedUpdate; - direct.uvsNeedUpdate = geometry.uvsNeedUpdate; - direct.groupsNeedUpdate = geometry.groupsNeedUpdate; - - geometry.verticesNeedUpdate = false; - geometry.normalsNeedUpdate = false; - geometry.colorsNeedUpdate = false; - geometry.uvsNeedUpdate = false; - geometry.groupsNeedUpdate = false; - - geometry = direct; - - } - - var attribute; - - if ( geometry.verticesNeedUpdate === true ) { - - attribute = this.attributes.position; - - if ( attribute !== undefined ) { - - attribute.copyVector3sArray( geometry.vertices ); - attribute.needsUpdate = true; - - } - - geometry.verticesNeedUpdate = false; - - } - - if ( geometry.normalsNeedUpdate === true ) { - - attribute = this.attributes.normal; - - if ( attribute !== undefined ) { - - attribute.copyVector3sArray( geometry.normals ); - attribute.needsUpdate = true; - - } - - geometry.normalsNeedUpdate = false; - - } - - if ( geometry.colorsNeedUpdate === true ) { - - attribute = this.attributes.color; - - if ( attribute !== undefined ) { - - attribute.copyColorsArray( geometry.colors ); - attribute.needsUpdate = true; - - } - - geometry.colorsNeedUpdate = false; - - } - - if ( geometry.uvsNeedUpdate ) { - - attribute = this.attributes.uv; - - if ( attribute !== undefined ) { - - attribute.copyVector2sArray( geometry.uvs ); - attribute.needsUpdate = true; - - } - - geometry.uvsNeedUpdate = false; - - } - - if ( geometry.lineDistancesNeedUpdate ) { - - attribute = this.attributes.lineDistance; - - if ( attribute !== undefined ) { - - attribute.copyArray( geometry.lineDistances ); - attribute.needsUpdate = true; - - } - - geometry.lineDistancesNeedUpdate = false; - - } - - if ( geometry.groupsNeedUpdate ) { - - geometry.computeGroups( object.geometry ); - this.groups = geometry.groups; - - geometry.groupsNeedUpdate = false; - - } - - return this; - - }, - - fromGeometry: function ( geometry ) { - - geometry.__directGeometry = new DirectGeometry().fromGeometry( geometry ); - - return this.fromDirectGeometry( geometry.__directGeometry ); - - }, - - fromDirectGeometry: function ( geometry ) { - - var positions = new Float32Array( geometry.vertices.length * 3 ); - this.addAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) ); - - if ( geometry.normals.length > 0 ) { - - var normals = new Float32Array( geometry.normals.length * 3 ); - this.addAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) ); - - } - - if ( geometry.colors.length > 0 ) { - - var colors = new Float32Array( geometry.colors.length * 3 ); - this.addAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) ); - - } - - if ( geometry.uvs.length > 0 ) { - - var uvs = new Float32Array( geometry.uvs.length * 2 ); - this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) ); - - } - - if ( geometry.uvs2.length > 0 ) { - - var uvs2 = new Float32Array( geometry.uvs2.length * 2 ); - this.addAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) ); - - } - - // groups - - this.groups = geometry.groups; - - // morphs - - for ( var name in geometry.morphTargets ) { - - var array = []; - var morphTargets = geometry.morphTargets[ name ]; - - for ( var i = 0, l = morphTargets.length; i < l; i ++ ) { - - var morphTarget = morphTargets[ i ]; - - var attribute = new Float32BufferAttribute( morphTarget.data.length * 3, 3 ); - attribute.name = morphTarget.name; - - array.push( attribute.copyVector3sArray( morphTarget.data ) ); - - } - - this.morphAttributes[ name ] = array; - - } - - // skinning - - if ( geometry.skinIndices.length > 0 ) { - - var skinIndices = new Float32BufferAttribute( geometry.skinIndices.length * 4, 4 ); - this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) ); - - } - - if ( geometry.skinWeights.length > 0 ) { - - var skinWeights = new Float32BufferAttribute( geometry.skinWeights.length * 4, 4 ); - this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) ); - - } - - // - - if ( geometry.boundingSphere !== null ) { - - this.boundingSphere = geometry.boundingSphere.clone(); - - } - - if ( geometry.boundingBox !== null ) { - - this.boundingBox = geometry.boundingBox.clone(); - - } - - return this; - - }, - - computeBoundingBox: function () { - - if ( this.boundingBox === null ) { - - this.boundingBox = new Box3(); - - } - - var position = this.attributes.position; - var morphAttributesPosition = this.morphAttributes.position; - - if ( position !== undefined ) { - - this.boundingBox.setFromBufferAttribute( position ); - - // process morph attributes if present - - if ( morphAttributesPosition ) { - - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - - var morphAttribute = morphAttributesPosition[ i ]; - _box.setFromBufferAttribute( morphAttribute ); - - this.boundingBox.expandByPoint( _box.min ); - this.boundingBox.expandByPoint( _box.max ); - - } - - } - - } else { - - this.boundingBox.makeEmpty(); - - } - - if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); - - } - - }, - - computeBoundingSphere: function () { - - if ( this.boundingSphere === null ) { - - this.boundingSphere = new Sphere(); - - } - - var position = this.attributes.position; - var morphAttributesPosition = this.morphAttributes.position; - - if ( position ) { - - // first, find the center of the bounding sphere - - var center = this.boundingSphere.center; - - _box.setFromBufferAttribute( position ); - - // process morph attributes if present - - if ( morphAttributesPosition ) { - - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - - var morphAttribute = morphAttributesPosition[ i ]; - _boxMorphTargets.setFromBufferAttribute( morphAttribute ); - - _box.expandByPoint( _boxMorphTargets.min ); - _box.expandByPoint( _boxMorphTargets.max ); - - } - - } - - _box.getCenter( center ); - - // second, try to find a boundingSphere with a radius smaller than the - // boundingSphere of the boundingBox: sqrt(3) smaller in the best case - - var maxRadiusSq = 0; - - for ( var i = 0, il = position.count; i < il; i ++ ) { - - _vector.fromBufferAttribute( position, i ); - - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) ); - - } - - // process morph attributes if present - - if ( morphAttributesPosition ) { - - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - - var morphAttribute = morphAttributesPosition[ i ]; - - for ( var j = 0, jl = morphAttribute.count; j < jl; j ++ ) { - - _vector.fromBufferAttribute( morphAttribute, j ); - - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) ); - - } - - } - - } - - this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); - - if ( isNaN( this.boundingSphere.radius ) ) { - - console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); - - } - - } - - }, - - computeFaceNormals: function () { - - // backwards compatibility - - }, - - computeVertexNormals: function () { - - var index = this.index; - var attributes = this.attributes; - - if ( attributes.position ) { - - var positions = attributes.position.array; - - if ( attributes.normal === undefined ) { - - this.addAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) ); - - } else { - - // reset existing normals to zero - - var array = attributes.normal.array; - - for ( var i = 0, il = array.length; i < il; i ++ ) { - - array[ i ] = 0; - - } - - } - - var normals = attributes.normal.array; - - var vA, vB, vC; - var pA = new Vector3(), pB = new Vector3(), pC = new Vector3(); - var cb = new Vector3(), ab = new Vector3(); - - // indexed elements - - if ( index ) { - - var indices = index.array; - - for ( var i = 0, il = index.count; i < il; i += 3 ) { - - vA = indices[ i + 0 ] * 3; - vB = indices[ i + 1 ] * 3; - vC = indices[ i + 2 ] * 3; - - pA.fromArray( positions, vA ); - pB.fromArray( positions, vB ); - pC.fromArray( positions, vC ); - - cb.subVectors( pC, pB ); - ab.subVectors( pA, pB ); - cb.cross( ab ); - - normals[ vA ] += cb.x; - normals[ vA + 1 ] += cb.y; - normals[ vA + 2 ] += cb.z; - - normals[ vB ] += cb.x; - normals[ vB + 1 ] += cb.y; - normals[ vB + 2 ] += cb.z; - - normals[ vC ] += cb.x; - normals[ vC + 1 ] += cb.y; - normals[ vC + 2 ] += cb.z; - - } - - } else { - - // non-indexed elements (unconnected triangle soup) - - for ( var i = 0, il = positions.length; i < il; i += 9 ) { - - pA.fromArray( positions, i ); - pB.fromArray( positions, i + 3 ); - pC.fromArray( positions, i + 6 ); - - cb.subVectors( pC, pB ); - ab.subVectors( pA, pB ); - cb.cross( ab ); - - normals[ i ] = cb.x; - normals[ i + 1 ] = cb.y; - normals[ i + 2 ] = cb.z; - - normals[ i + 3 ] = cb.x; - normals[ i + 4 ] = cb.y; - normals[ i + 5 ] = cb.z; - - normals[ i + 6 ] = cb.x; - normals[ i + 7 ] = cb.y; - normals[ i + 8 ] = cb.z; - - } - - } - - this.normalizeNormals(); - - attributes.normal.needsUpdate = true; - - } - - }, - - merge: function ( geometry, offset ) { - - if ( ! ( geometry && geometry.isBufferGeometry ) ) { - - console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry ); - return; - - } - - if ( offset === undefined ) { - - offset = 0; - - console.warn( - 'THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. ' - + 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.' - ); - - } - - var attributes = this.attributes; - - for ( var key in attributes ) { - - if ( geometry.attributes[ key ] === undefined ) continue; - - var attribute1 = attributes[ key ]; - var attributeArray1 = attribute1.array; - - var attribute2 = geometry.attributes[ key ]; - var attributeArray2 = attribute2.array; - - var attributeOffset = attribute2.itemSize * offset; - var length = Math.min( attributeArray2.length, attributeArray1.length - attributeOffset ); - - for ( var i = 0, j = attributeOffset; i < length; i ++, j ++ ) { - - attributeArray1[ j ] = attributeArray2[ i ]; - - } - - } - - return this; - - }, - - normalizeNormals: function () { - - var normals = this.attributes.normal; - - for ( var i = 0, il = normals.count; i < il; i ++ ) { - - _vector.x = normals.getX( i ); - _vector.y = normals.getY( i ); - _vector.z = normals.getZ( i ); - - _vector.normalize(); - - normals.setXYZ( i, _vector.x, _vector.y, _vector.z ); - - } - - }, - - toNonIndexed: function () { - - function convertBufferAttribute( attribute, indices ) { - - var array = attribute.array; - var itemSize = attribute.itemSize; - - var array2 = new array.constructor( indices.length * itemSize ); - - var index = 0, index2 = 0; - - for ( var i = 0, l = indices.length; i < l; i ++ ) { - - index = indices[ i ] * itemSize; - - for ( var j = 0; j < itemSize; j ++ ) { - - array2[ index2 ++ ] = array[ index ++ ]; - - } - - } - - return new BufferAttribute( array2, itemSize ); - - } - - // - - if ( this.index === null ) { - - console.warn( 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.' ); - return this; - - } - - var geometry2 = new BufferGeometry(); - - var indices = this.index.array; - var attributes = this.attributes; - - // attributes - - for ( var name in attributes ) { - - var attribute = attributes[ name ]; - - var newAttribute = convertBufferAttribute( attribute, indices ); - - geometry2.addAttribute( name, newAttribute ); - - } - - // morph attributes - - var morphAttributes = this.morphAttributes; - - for ( name in morphAttributes ) { - - var morphArray = []; - var morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes - - for ( var i = 0, il = morphAttribute.length; i < il; i ++ ) { - - var attribute = morphAttribute[ i ]; - - var newAttribute = convertBufferAttribute( attribute, indices ); - - morphArray.push( newAttribute ); - - } - - geometry2.morphAttributes[ name ] = morphArray; - - } - - // groups - - var groups = this.groups; - - for ( var i = 0, l = groups.length; i < l; i ++ ) { - - var group = groups[ i ]; - geometry2.addGroup( group.start, group.count, group.materialIndex ); - - } - - return geometry2; - - }, - - toJSON: function () { - - var data = { - metadata: { - version: 4.5, - type: 'BufferGeometry', - generator: 'BufferGeometry.toJSON' - } - }; - - // standard BufferGeometry serialization - - data.uuid = this.uuid; - data.type = this.type; - if ( this.name !== '' ) data.name = this.name; - if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData; - - if ( this.parameters !== undefined ) { - - var parameters = this.parameters; - - for ( var key in parameters ) { - - if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; - - } - - return data; - - } - - data.data = { attributes: {} }; - - var index = this.index; - - if ( index !== null ) { - - data.data.index = { - type: index.array.constructor.name, - array: Array.prototype.slice.call( index.array ) - }; - - } - - var attributes = this.attributes; - - for ( var key in attributes ) { - - var attribute = attributes[ key ]; - - var attributeData = attribute.toJSON(); - - if ( attribute.name !== '' ) attributeData.name = attribute.name; - - data.data.attributes[ key ] = attributeData; - - } - - var morphAttributes = {}; - var hasMorphAttributes = false; - - for ( var key in this.morphAttributes ) { - - var attributeArray = this.morphAttributes[ key ]; - - var array = []; - - for ( var i = 0, il = attributeArray.length; i < il; i ++ ) { - - var attribute = attributeArray[ i ]; - - var attributeData = attribute.toJSON(); - - if ( attribute.name !== '' ) attributeData.name = attribute.name; - - array.push( attributeData ); - - } - - if ( array.length > 0 ) { - - morphAttributes[ key ] = array; - - hasMorphAttributes = true; - - } - - } - - if ( hasMorphAttributes ) data.data.morphAttributes = morphAttributes; - - var groups = this.groups; - - if ( groups.length > 0 ) { - - data.data.groups = JSON.parse( JSON.stringify( groups ) ); - - } - - var boundingSphere = this.boundingSphere; - - if ( boundingSphere !== null ) { - - data.data.boundingSphere = { - center: boundingSphere.center.toArray(), - radius: boundingSphere.radius - }; - - } - - return data; - - }, - - clone: function () { - - /* - // Handle primitives - - var parameters = this.parameters; - - if ( parameters !== undefined ) { - - var values = []; - - for ( var key in parameters ) { - - values.push( parameters[ key ] ); - - } - - var geometry = Object.create( this.constructor.prototype ); - this.constructor.apply( geometry, values ); - return geometry; - - } - - return new this.constructor().copy( this ); - */ - - return new BufferGeometry().copy( this ); - - }, - - copy: function ( source ) { - - var name, i, l; - - // reset - - this.index = null; - this.attributes = {}; - this.morphAttributes = {}; - this.groups = []; - this.boundingBox = null; - this.boundingSphere = null; - - // name - - this.name = source.name; - - // index - - var index = source.index; - - if ( index !== null ) { - - this.setIndex( index.clone() ); - - } - - // attributes - - var attributes = source.attributes; - - for ( name in attributes ) { - - var attribute = attributes[ name ]; - this.addAttribute( name, attribute.clone() ); - - } - - // morph attributes - - var morphAttributes = source.morphAttributes; - - for ( name in morphAttributes ) { - - var array = []; - var morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes - - for ( i = 0, l = morphAttribute.length; i < l; i ++ ) { - - array.push( morphAttribute[ i ].clone() ); - - } - - this.morphAttributes[ name ] = array; - - } - - // groups - - var groups = source.groups; - - for ( i = 0, l = groups.length; i < l; i ++ ) { - - var group = groups[ i ]; - this.addGroup( group.start, group.count, group.materialIndex ); - - } - - // bounding box - - var boundingBox = source.boundingBox; - - if ( boundingBox !== null ) { - - this.boundingBox = boundingBox.clone(); - - } - - // bounding sphere - - var boundingSphere = source.boundingSphere; - - if ( boundingSphere !== null ) { - - this.boundingSphere = boundingSphere.clone(); - - } - - // draw range - - this.drawRange.start = source.drawRange.start; - this.drawRange.count = source.drawRange.count; - - // user data - - this.userData = source.userData; - - return this; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - } - -} ); - - -export { BufferGeometry }; diff --git a/cases/esbuild-three/src/base/core/Clock.d.ts b/cases/esbuild-three/src/base/core/Clock.d.ts deleted file mode 100644 index 29d2cc508d..0000000000 --- a/cases/esbuild-three/src/base/core/Clock.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Object for keeping track of time. - * - * @see src/core/Clock.js - */ -export class Clock { - - /** - * @param autoStart Automatically start the clock. - */ - constructor( autoStart?: boolean ); - - /** - * If set, starts the clock automatically when the first update is called. - */ - autoStart: boolean; - - /** - * When the clock is running, It holds the starttime of the clock. - * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. - */ - startTime: number; - - /** - * When the clock is running, It holds the previous time from a update. - * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. - */ - oldTime: number; - - /** - * When the clock is running, It holds the time elapsed between the start of the clock to the previous update. - * This parameter is in seconds of three decimal places. - */ - elapsedTime: number; - - /** - * This property keeps track whether the clock is running or not. - */ - running: boolean; - - /** - * Starts clock. - */ - start(): void; - - /** - * Stops clock. - */ - stop(): void; - - /** - * Get the seconds passed since the clock started. - */ - getElapsedTime(): number; - - /** - * Get the seconds passed since the last call to this method. - */ - getDelta(): number; - -} diff --git a/cases/esbuild-three/src/base/core/Clock.js b/cases/esbuild-three/src/base/core/Clock.js deleted file mode 100644 index a0bc86f0a2..0000000000 --- a/cases/esbuild-three/src/base/core/Clock.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - */ - -function Clock( autoStart ) { - - this.autoStart = ( autoStart !== undefined ) ? autoStart : true; - - this.startTime = 0; - this.oldTime = 0; - this.elapsedTime = 0; - - this.running = false; - -} - -Object.assign( Clock.prototype, { - - start: function () { - - this.startTime = ( typeof performance === 'undefined' ? Date : performance ).now(); // see #10732 - - this.oldTime = this.startTime; - this.elapsedTime = 0; - this.running = true; - - }, - - stop: function () { - - this.getElapsedTime(); - this.running = false; - this.autoStart = false; - - }, - - getElapsedTime: function () { - - this.getDelta(); - return this.elapsedTime; - - }, - - getDelta: function () { - - var diff = 0; - - if ( this.autoStart && ! this.running ) { - - this.start(); - return 0; - - } - - if ( this.running ) { - - var newTime = ( typeof performance === 'undefined' ? Date : performance ).now(); - - diff = ( newTime - this.oldTime ) / 1000; - this.oldTime = newTime; - - this.elapsedTime += diff; - - } - - return diff; - - } - -} ); - - -export { Clock }; diff --git a/cases/esbuild-three/src/base/core/DirectGeometry.d.ts b/cases/esbuild-three/src/base/core/DirectGeometry.d.ts deleted file mode 100644 index 3fdaf4335d..0000000000 --- a/cases/esbuild-three/src/base/core/DirectGeometry.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Color } from './../math/Color'; -import { Vector2 } from './../math/Vector2'; -import { Vector4 } from './../math/Vector4'; -import { Box3 } from './../math/Box3'; -import { Sphere } from './../math/Sphere'; -import { Geometry } from './Geometry'; -import { Event } from './Face3'; -import { EventDispatcher } from './EventDispatcher'; -import { MorphTarget } from './Geometry'; -/** - * @see src/core/DirectGeometry.js - */ -export class DirectGeometry extends EventDispatcher { - - constructor(); - - id: number; - uuid: string; - name: string; - type: string; - indices: number[]; - vertices: Vector3[]; - normals: Vector3[]; - colors: Color[]; - uvs: Vector2[]; - uvs2: Vector2[]; - groups: { start: number; materialIndex: number }[]; - morphTargets: MorphTarget[]; - skinWeights: Vector4[]; - skinIndices: Vector4[]; - boundingBox: Box3; - boundingSphere: Sphere; - verticesNeedUpdate: boolean; - normalsNeedUpdate: boolean; - colorsNeedUpdate: boolean; - uvsNeedUpdate: boolean; - groupsNeedUpdate: boolean; - - computeBoundingBox(): void; - computeBoundingSphere(): void; - computeGroups( geometry: Geometry ): void; - fromGeometry( geometry: Geometry ): DirectGeometry; - dispose(): void; - - // EventDispatcher mixins - addEventListener( type: string, listener: ( event: Event ) => void ): void; - hasEventListener( type: string, listener: ( event: Event ) => void ): boolean; - removeEventListener( type: string, listener: ( event: Event ) => void ): void; - dispatchEvent( event: { type: string; [attachment: string]: any } ): void; - -} diff --git a/cases/esbuild-three/src/base/core/DirectGeometry.js b/cases/esbuild-three/src/base/core/DirectGeometry.js deleted file mode 100644 index caeee523e9..0000000000 --- a/cases/esbuild-three/src/base/core/DirectGeometry.js +++ /dev/null @@ -1,286 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Vector2 } from '../math/Vector2.js'; - -function DirectGeometry() { - - this.vertices = []; - this.normals = []; - this.colors = []; - this.uvs = []; - this.uvs2 = []; - - this.groups = []; - - this.morphTargets = {}; - - this.skinWeights = []; - this.skinIndices = []; - - // this.lineDistances = []; - - this.boundingBox = null; - this.boundingSphere = null; - - // update flags - - this.verticesNeedUpdate = false; - this.normalsNeedUpdate = false; - this.colorsNeedUpdate = false; - this.uvsNeedUpdate = false; - this.groupsNeedUpdate = false; - -} - -Object.assign( DirectGeometry.prototype, { - - computeGroups: function ( geometry ) { - - var group; - var groups = []; - var materialIndex = undefined; - - var faces = geometry.faces; - - for ( var i = 0; i < faces.length; i ++ ) { - - var face = faces[ i ]; - - // materials - - if ( face.materialIndex !== materialIndex ) { - - materialIndex = face.materialIndex; - - if ( group !== undefined ) { - - group.count = ( i * 3 ) - group.start; - groups.push( group ); - - } - - group = { - start: i * 3, - materialIndex: materialIndex - }; - - } - - } - - if ( group !== undefined ) { - - group.count = ( i * 3 ) - group.start; - groups.push( group ); - - } - - this.groups = groups; - - }, - - fromGeometry: function ( geometry ) { - - var faces = geometry.faces; - var vertices = geometry.vertices; - var faceVertexUvs = geometry.faceVertexUvs; - - var hasFaceVertexUv = faceVertexUvs[ 0 ] && faceVertexUvs[ 0 ].length > 0; - var hasFaceVertexUv2 = faceVertexUvs[ 1 ] && faceVertexUvs[ 1 ].length > 0; - - // morphs - - var morphTargets = geometry.morphTargets; - var morphTargetsLength = morphTargets.length; - - var morphTargetsPosition; - - if ( morphTargetsLength > 0 ) { - - morphTargetsPosition = []; - - for ( var i = 0; i < morphTargetsLength; i ++ ) { - - morphTargetsPosition[ i ] = { - name: morphTargets[ i ].name, - data: [] - }; - - } - - this.morphTargets.position = morphTargetsPosition; - - } - - var morphNormals = geometry.morphNormals; - var morphNormalsLength = morphNormals.length; - - var morphTargetsNormal; - - if ( morphNormalsLength > 0 ) { - - morphTargetsNormal = []; - - for ( var i = 0; i < morphNormalsLength; i ++ ) { - - morphTargetsNormal[ i ] = { - name: morphNormals[ i ].name, - data: [] - }; - - } - - this.morphTargets.normal = morphTargetsNormal; - - } - - // skins - - var skinIndices = geometry.skinIndices; - var skinWeights = geometry.skinWeights; - - var hasSkinIndices = skinIndices.length === vertices.length; - var hasSkinWeights = skinWeights.length === vertices.length; - - // - - if ( vertices.length > 0 && faces.length === 0 ) { - - console.error( 'THREE.DirectGeometry: Faceless geometries are not supported.' ); - - } - - for ( var i = 0; i < faces.length; i ++ ) { - - var face = faces[ i ]; - - this.vertices.push( vertices[ face.a ], vertices[ face.b ], vertices[ face.c ] ); - - var vertexNormals = face.vertexNormals; - - if ( vertexNormals.length === 3 ) { - - this.normals.push( vertexNormals[ 0 ], vertexNormals[ 1 ], vertexNormals[ 2 ] ); - - } else { - - var normal = face.normal; - - this.normals.push( normal, normal, normal ); - - } - - var vertexColors = face.vertexColors; - - if ( vertexColors.length === 3 ) { - - this.colors.push( vertexColors[ 0 ], vertexColors[ 1 ], vertexColors[ 2 ] ); - - } else { - - var color = face.color; - - this.colors.push( color, color, color ); - - } - - if ( hasFaceVertexUv === true ) { - - var vertexUvs = faceVertexUvs[ 0 ][ i ]; - - if ( vertexUvs !== undefined ) { - - this.uvs.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); - - } else { - - console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', i ); - - this.uvs.push( new Vector2(), new Vector2(), new Vector2() ); - - } - - } - - if ( hasFaceVertexUv2 === true ) { - - var vertexUvs = faceVertexUvs[ 1 ][ i ]; - - if ( vertexUvs !== undefined ) { - - this.uvs2.push( vertexUvs[ 0 ], vertexUvs[ 1 ], vertexUvs[ 2 ] ); - - } else { - - console.warn( 'THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', i ); - - this.uvs2.push( new Vector2(), new Vector2(), new Vector2() ); - - } - - } - - // morphs - - for ( var j = 0; j < morphTargetsLength; j ++ ) { - - var morphTarget = morphTargets[ j ].vertices; - - morphTargetsPosition[ j ].data.push( morphTarget[ face.a ], morphTarget[ face.b ], morphTarget[ face.c ] ); - - } - - for ( var j = 0; j < morphNormalsLength; j ++ ) { - - var morphNormal = morphNormals[ j ].vertexNormals[ i ]; - - morphTargetsNormal[ j ].data.push( morphNormal.a, morphNormal.b, morphNormal.c ); - - } - - // skins - - if ( hasSkinIndices ) { - - this.skinIndices.push( skinIndices[ face.a ], skinIndices[ face.b ], skinIndices[ face.c ] ); - - } - - if ( hasSkinWeights ) { - - this.skinWeights.push( skinWeights[ face.a ], skinWeights[ face.b ], skinWeights[ face.c ] ); - - } - - } - - this.computeGroups( geometry ); - - this.verticesNeedUpdate = geometry.verticesNeedUpdate; - this.normalsNeedUpdate = geometry.normalsNeedUpdate; - this.colorsNeedUpdate = geometry.colorsNeedUpdate; - this.uvsNeedUpdate = geometry.uvsNeedUpdate; - this.groupsNeedUpdate = geometry.groupsNeedUpdate; - - if ( geometry.boundingSphere !== null ) { - - this.boundingSphere = geometry.boundingSphere.clone(); - - } - - if ( geometry.boundingBox !== null ) { - - this.boundingBox = geometry.boundingBox.clone(); - - } - - return this; - - } - -} ); - - -export { DirectGeometry }; diff --git a/cases/esbuild-three/src/base/core/EventDispatcher.d.ts b/cases/esbuild-three/src/base/core/EventDispatcher.d.ts deleted file mode 100644 index 4395cc9458..0000000000 --- a/cases/esbuild-three/src/base/core/EventDispatcher.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Event } from './Face3'; - -/** - * JavaScript events for custom objects - * - * @source src/core/EventDispatcher.js - */ -export class EventDispatcher { - - /** - * Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object. - */ - constructor(); - - /** - * Adds a listener to an event type. - * @param type The type of event to listen to. - * @param listener The function that gets called when the event is fired. - */ - addEventListener( type: string, listener: ( event: Event ) => void ): void; - - /** - * Checks if listener is added to an event type. - * @param type The type of event to listen to. - * @param listener The function that gets called when the event is fired. - */ - hasEventListener( type: string, listener: ( event: Event ) => void ): boolean; - - /** - * Removes a listener from an event type. - * @param type The type of the listener that gets removed. - * @param listener The listener function that gets removed. - */ - removeEventListener( type: string, listener: ( event: Event ) => void ): void; - - /** - * Fire an event type. - * @param type The type of event that gets fired. - */ - dispatchEvent( event: { type: string; [attachment: string]: any } ): void; - -} diff --git a/cases/esbuild-three/src/base/core/EventDispatcher.js b/cases/esbuild-three/src/base/core/EventDispatcher.js deleted file mode 100644 index de5ca8ecf3..0000000000 --- a/cases/esbuild-three/src/base/core/EventDispatcher.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * https://github.com/mrdoob/eventdispatcher.js/ - */ - -function EventDispatcher() {} - -Object.assign( EventDispatcher.prototype, { - - addEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) this._listeners = {}; - - var listeners = this._listeners; - - if ( listeners[ type ] === undefined ) { - - listeners[ type ] = []; - - } - - if ( listeners[ type ].indexOf( listener ) === - 1 ) { - - listeners[ type ].push( listener ); - - } - - }, - - hasEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) return false; - - var listeners = this._listeners; - - return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; - - }, - - removeEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) return; - - var listeners = this._listeners; - var listenerArray = listeners[ type ]; - - if ( listenerArray !== undefined ) { - - var index = listenerArray.indexOf( listener ); - - if ( index !== - 1 ) { - - listenerArray.splice( index, 1 ); - - } - - } - - }, - - dispatchEvent: function ( event ) { - - if ( this._listeners === undefined ) return; - - var listeners = this._listeners; - var listenerArray = listeners[ event.type ]; - - if ( listenerArray !== undefined ) { - - event.target = this; - - var array = listenerArray.slice( 0 ); - - for ( var i = 0, l = array.length; i < l; i ++ ) { - - array[ i ].call( this, event ); - - } - - } - - } - -} ); - - -export { EventDispatcher }; diff --git a/cases/esbuild-three/src/base/core/Face3.d.ts b/cases/esbuild-three/src/base/core/Face3.d.ts deleted file mode 100644 index b8704c14a2..0000000000 --- a/cases/esbuild-three/src/base/core/Face3.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Color } from './../math/Color'; - -export interface Event { - type: string; - target?: any; - [attachment: string]: any; -} - -/** - * Triangle face. - * - * @source https://github.com/mrdoob/three.js/blob/master/src/core/Face3.js - */ -export class Face3 { - - /** - * @param a Vertex A index. - * @param b Vertex B index. - * @param c Vertex C index. - * @param normal Face normal or array of vertex normals. - * @param color Face color or array of vertex colors. - * @param materialIndex Material index. - */ - constructor( - a: number, - b: number, - c: number, - normal?: Vector3, - color?: Color, - materialIndex?: number - ); - constructor( - a: number, - b: number, - c: number, - normal?: Vector3, - vertexColors?: Color[], - materialIndex?: number - ); - constructor( - a: number, - b: number, - c: number, - vertexNormals?: Vector3[], - color?: Color, - materialIndex?: number - ); - constructor( - a: number, - b: number, - c: number, - vertexNormals?: Vector3[], - vertexColors?: Color[], - materialIndex?: number - ); - - /** - * Vertex A index. - */ - a: number; - - /** - * Vertex B index. - */ - b: number; - - /** - * Vertex C index. - */ - c: number; - - /** - * Face normal. - */ - normal: Vector3; - - /** - * Array of 4 vertex normals. - */ - vertexNormals: Vector3[]; - - /** - * Face color. - */ - color: Color; - - /** - * Array of 4 vertex normals. - */ - vertexColors: Color[]; - - /** - * Material index (points to {@link Geometry.materials}). - */ - materialIndex: number; - - clone(): this; - copy( source: Face3 ): this; - -} diff --git a/cases/esbuild-three/src/base/core/Face3.js b/cases/esbuild-three/src/base/core/Face3.js deleted file mode 100644 index b2d76f6f8f..0000000000 --- a/cases/esbuild-three/src/base/core/Face3.js +++ /dev/null @@ -1,63 +0,0 @@ -import { Color } from '../math/Color.js'; -import { Vector3 } from '../math/Vector3.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -function Face3( a, b, c, normal, color, materialIndex ) { - - this.a = a; - this.b = b; - this.c = c; - - this.normal = ( normal && normal.isVector3 ) ? normal : new Vector3(); - this.vertexNormals = Array.isArray( normal ) ? normal : []; - - this.color = ( color && color.isColor ) ? color : new Color(); - this.vertexColors = Array.isArray( color ) ? color : []; - - this.materialIndex = materialIndex !== undefined ? materialIndex : 0; - -} - -Object.assign( Face3.prototype, { - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( source ) { - - this.a = source.a; - this.b = source.b; - this.c = source.c; - - this.normal.copy( source.normal ); - this.color.copy( source.color ); - - this.materialIndex = source.materialIndex; - - for ( var i = 0, il = source.vertexNormals.length; i < il; i ++ ) { - - this.vertexNormals[ i ] = source.vertexNormals[ i ].clone(); - - } - - for ( var i = 0, il = source.vertexColors.length; i < il; i ++ ) { - - this.vertexColors[ i ] = source.vertexColors[ i ].clone(); - - } - - return this; - - } - -} ); - - -export { Face3 }; diff --git a/cases/esbuild-three/src/base/core/Geometry.d.ts b/cases/esbuild-three/src/base/core/Geometry.d.ts deleted file mode 100644 index 4a7bb35ffd..0000000000 --- a/cases/esbuild-three/src/base/core/Geometry.d.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Color } from './../math/Color'; -import { Face3, Event } from './Face3'; -import { Vector2 } from './../math/Vector2'; -import { Vector4 } from './../math/Vector4'; -import { Box3 } from './../math/Box3'; -import { Sphere } from './../math/Sphere'; -import { Matrix4 } from './../math/Matrix4'; -import { BufferGeometry } from './BufferGeometry'; -import { Matrix } from './../math/Matrix3'; -import { Mesh } from './../objects/Mesh'; -import { Bone } from './../objects/Bone'; -import { AnimationClip } from './../animation/AnimationClip'; -import { EventDispatcher } from './EventDispatcher'; - -/** - * @deprecated Use {@link Face3} instead. - */ - -export interface MorphTarget { - name: string; - vertices: Vector3[]; -} - -export interface MorphColor { - name: string; - colors: Color[]; -} - -export interface MorphNormals { - name: string; - normals: Vector3[]; -} - -export let GeometryIdCount: number; - -/** - * Base class for geometries - * - * @see https://github.com/mrdoob/three.js/blob/master/src/core/Geometry.js - */ -export class Geometry extends EventDispatcher { - - constructor(); - - /** - * Unique number of this geometry instance - */ - id: number; - - uuid: string; - - isGeometry: boolean; - - /** - * Name for this geometry. Default is an empty string. - */ - name: string; - - type: string; - - /** - * The array of vertices hold every position of points of the model. - * To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true. - */ - vertices: Vector3[]; - - /** - * Array of vertex colors, matching number and order of vertices. - * Used in ParticleSystem, Line and Ribbon. - * Meshes use per-face-use-of-vertex colors embedded directly in faces. - * To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true. - */ - colors: Color[]; - - /** - * Array of triangles or/and quads. - * The array of faces describe how each vertex in the model is connected with each other. - * To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true. - */ - faces: Face3[]; - - /** - * Array of face UV layers. - * Each UV layer is an array of UV matching order and number of vertices in faces. - * To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true. - */ - faceVertexUvs: Vector2[][][]; - - /** - * Array of morph targets. Each morph target is a Javascript object: - * - * { name: "targetName", vertices: [ new THREE.Vector3(), ... ] } - * - * Morph vertices match number and order of primary vertices. - */ - morphTargets: MorphTarget[]; - - /** - * Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object: - * - * morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] } - */ - morphNormals: MorphNormals[]; - - /** - * Array of skinning weights, matching number and order of vertices. - */ - skinWeights: Vector4[]; - - /** - * Array of skinning indices, matching number and order of vertices. - */ - skinIndices: Vector4[]; - - /** - * - */ - lineDistances: number[]; - - /** - * Bounding box. - */ - boundingBox: Box3; - - /** - * Bounding sphere. - */ - boundingSphere: Sphere; - - /** - * Set to true if the vertices array has been updated. - */ - verticesNeedUpdate: boolean; - - /** - * Set to true if the faces array has been updated. - */ - elementsNeedUpdate: boolean; - - /** - * Set to true if the uvs array has been updated. - */ - uvsNeedUpdate: boolean; - - /** - * Set to true if the normals array has been updated. - */ - normalsNeedUpdate: boolean; - - /** - * Set to true if the colors array has been updated. - */ - colorsNeedUpdate: boolean; - - /** - * Set to true if the linedistances array has been updated. - */ - lineDistancesNeedUpdate: boolean; - - /** - * - */ - groupsNeedUpdate: boolean; - - /** - * Bakes matrix transform directly into vertex coordinates. - */ - applyMatrix( matrix: Matrix4 ): Geometry; - - rotateX( angle: number ): Geometry; - rotateY( angle: number ): Geometry; - rotateZ( angle: number ): Geometry; - - translate( x: number, y: number, z: number ): Geometry; - scale( x: number, y: number, z: number ): Geometry; - lookAt( vector: Vector3 ): void; - - fromBufferGeometry( geometry: BufferGeometry ): Geometry; - - center(): Geometry; - - normalize(): Geometry; - - /** - * Computes face normals. - */ - computeFaceNormals(): void; - - /** - * Computes vertex normals by averaging face normals. - * Face normals must be existing / computed beforehand. - */ - computeVertexNormals( areaWeighted?: boolean ): void; - - /** - * Compute vertex normals, but duplicating face normals. - */ - computeFlatVertexNormals(): void; - - /** - * Computes morph normals. - */ - computeMorphNormals(): void; - - /** - * Computes bounding box of the geometry, updating {@link Geometry.boundingBox} attribute. - */ - computeBoundingBox(): void; - - /** - * Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. - * Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null. - */ - computeBoundingSphere(): void; - - merge( - geometry: Geometry, - matrix?: Matrix, - materialIndexOffset?: number - ): void; - - mergeMesh( mesh: Mesh ): void; - - /** - * Checks for duplicate vertices using hashmap. - * Duplicated vertices are removed and faces' vertices are updated. - */ - mergeVertices(): number; - - setFromPoints( points: Array | Array ): this; - - sortFacesByMaterialIndex(): void; - - toJSON(): any; - - /** - * Creates a new clone of the Geometry. - */ - clone(): this; - - copy( source: Geometry ): this; - - /** - * Removes The object from memory. - * Don't forget to call this method when you remove an geometry because it can cuase meomory leaks. - */ - dispose(): void; - - // These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. - bones: Bone[]; - animation: AnimationClip; - animations: AnimationClip[]; - - // EventDispatcher mixins - addEventListener( type: string, listener: ( event: Event ) => void ): void; - hasEventListener( type: string, listener: ( event: Event ) => void ): boolean; - removeEventListener( type: string, listener: ( event: Event ) => void ): void; - dispatchEvent( event: { type: string; [attachment: string]: any } ): void; - -} diff --git a/cases/esbuild-three/src/base/core/Geometry.js b/cases/esbuild-three/src/base/core/Geometry.js deleted file mode 100644 index 222d4547f0..0000000000 --- a/cases/esbuild-three/src/base/core/Geometry.js +++ /dev/null @@ -1,1398 +0,0 @@ -import { EventDispatcher } from './EventDispatcher.js'; -import { Face3 } from './Face3.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { Sphere } from '../math/Sphere.js'; -import { Box3 } from '../math/Box3.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; -import { Object3D } from './Object3D.js'; -import { _Math } from '../math/Math.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author bhouston / http://clara.io - */ - -var _geometryId = 0; // Geometry uses even numbers as Id -var _m1 = new Matrix4(); -var _obj = new Object3D(); -var _offset = new Vector3(); - -function Geometry() { - - Object.defineProperty( this, 'id', { value: _geometryId += 2 } ); - - this.uuid = _Math.generateUUID(); - - this.name = ''; - this.type = 'Geometry'; - - this.vertices = []; - this.colors = []; - this.faces = []; - this.faceVertexUvs = [[]]; - - this.morphTargets = []; - this.morphNormals = []; - - this.skinWeights = []; - this.skinIndices = []; - - this.lineDistances = []; - - this.boundingBox = null; - this.boundingSphere = null; - - // update flags - - this.elementsNeedUpdate = false; - this.verticesNeedUpdate = false; - this.uvsNeedUpdate = false; - this.normalsNeedUpdate = false; - this.colorsNeedUpdate = false; - this.lineDistancesNeedUpdate = false; - this.groupsNeedUpdate = false; - -} - -Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: Geometry, - - isGeometry: true, - - applyMatrix: function ( matrix ) { - - var normalMatrix = new Matrix3().getNormalMatrix( matrix ); - - for ( var i = 0, il = this.vertices.length; i < il; i ++ ) { - - var vertex = this.vertices[ i ]; - vertex.applyMatrix4( matrix ); - - } - - for ( var i = 0, il = this.faces.length; i < il; i ++ ) { - - var face = this.faces[ i ]; - face.normal.applyMatrix3( normalMatrix ).normalize(); - - for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { - - face.vertexNormals[ j ].applyMatrix3( normalMatrix ).normalize(); - - } - - } - - if ( this.boundingBox !== null ) { - - this.computeBoundingBox(); - - } - - if ( this.boundingSphere !== null ) { - - this.computeBoundingSphere(); - - } - - this.verticesNeedUpdate = true; - this.normalsNeedUpdate = true; - - return this; - - }, - - rotateX: function ( angle ) { - - // rotate geometry around world x-axis - - _m1.makeRotationX( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - rotateY: function ( angle ) { - - // rotate geometry around world y-axis - - _m1.makeRotationY( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - rotateZ: function ( angle ) { - - // rotate geometry around world z-axis - - _m1.makeRotationZ( angle ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - translate: function ( x, y, z ) { - - // translate geometry - - _m1.makeTranslation( x, y, z ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - scale: function ( x, y, z ) { - - // scale geometry - - _m1.makeScale( x, y, z ); - - this.applyMatrix( _m1 ); - - return this; - - }, - - lookAt: function ( vector ) { - - _obj.lookAt( vector ); - - _obj.updateMatrix(); - - this.applyMatrix( _obj.matrix ); - - return this; - - }, - - fromBufferGeometry: function ( geometry ) { - - var scope = this; - - var indices = geometry.index !== null ? geometry.index.array : undefined; - var attributes = geometry.attributes; - - var positions = attributes.position.array; - var normals = attributes.normal !== undefined ? attributes.normal.array : undefined; - var colors = attributes.color !== undefined ? attributes.color.array : undefined; - var uvs = attributes.uv !== undefined ? attributes.uv.array : undefined; - var uvs2 = attributes.uv2 !== undefined ? attributes.uv2.array : undefined; - - if ( uvs2 !== undefined ) this.faceVertexUvs[ 1 ] = []; - - for ( var i = 0; i < positions.length; i += 3 ) { - - scope.vertices.push( new Vector3().fromArray( positions, i ) ); - - if ( colors !== undefined ) { - - scope.colors.push( new Color().fromArray( colors, i ) ); - - } - - } - - function addFace( a, b, c, materialIndex ) { - - var vertexColors = ( colors === undefined ) ? [] : [ - scope.colors[ a ].clone(), - scope.colors[ b ].clone(), - scope.colors[ c ].clone() ]; - - var vertexNormals = ( normals === undefined ) ? [] : [ - new Vector3().fromArray( normals, a * 3 ), - new Vector3().fromArray( normals, b * 3 ), - new Vector3().fromArray( normals, c * 3 ) - ]; - - var face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex ); - - scope.faces.push( face ); - - if ( uvs !== undefined ) { - - scope.faceVertexUvs[ 0 ].push( [ - new Vector2().fromArray( uvs, a * 2 ), - new Vector2().fromArray( uvs, b * 2 ), - new Vector2().fromArray( uvs, c * 2 ) - ] ); - - } - - if ( uvs2 !== undefined ) { - - scope.faceVertexUvs[ 1 ].push( [ - new Vector2().fromArray( uvs2, a * 2 ), - new Vector2().fromArray( uvs2, b * 2 ), - new Vector2().fromArray( uvs2, c * 2 ) - ] ); - - } - - } - - var groups = geometry.groups; - - if ( groups.length > 0 ) { - - for ( var i = 0; i < groups.length; i ++ ) { - - var group = groups[ i ]; - - var start = group.start; - var count = group.count; - - for ( var j = start, jl = start + count; j < jl; j += 3 ) { - - if ( indices !== undefined ) { - - addFace( indices[ j ], indices[ j + 1 ], indices[ j + 2 ], group.materialIndex ); - - } else { - - addFace( j, j + 1, j + 2, group.materialIndex ); - - } - - } - - } - - } else { - - if ( indices !== undefined ) { - - for ( var i = 0; i < indices.length; i += 3 ) { - - addFace( indices[ i ], indices[ i + 1 ], indices[ i + 2 ] ); - - } - - } else { - - for ( var i = 0; i < positions.length / 3; i += 3 ) { - - addFace( i, i + 1, i + 2 ); - - } - - } - - } - - this.computeFaceNormals(); - - if ( geometry.boundingBox !== null ) { - - this.boundingBox = geometry.boundingBox.clone(); - - } - - if ( geometry.boundingSphere !== null ) { - - this.boundingSphere = geometry.boundingSphere.clone(); - - } - - return this; - - }, - - center: function () { - - this.computeBoundingBox(); - - this.boundingBox.getCenter( _offset ).negate(); - - this.translate( _offset.x, _offset.y, _offset.z ); - - return this; - - }, - - normalize: function () { - - this.computeBoundingSphere(); - - var center = this.boundingSphere.center; - var radius = this.boundingSphere.radius; - - var s = radius === 0 ? 1 : 1.0 / radius; - - var matrix = new Matrix4(); - matrix.set( - s, 0, 0, - s * center.x, - 0, s, 0, - s * center.y, - 0, 0, s, - s * center.z, - 0, 0, 0, 1 - ); - - this.applyMatrix( matrix ); - - return this; - - }, - - computeFaceNormals: function () { - - var cb = new Vector3(), ab = new Vector3(); - - for ( var f = 0, fl = this.faces.length; f < fl; f ++ ) { - - var face = this.faces[ f ]; - - var vA = this.vertices[ face.a ]; - var vB = this.vertices[ face.b ]; - var vC = this.vertices[ face.c ]; - - cb.subVectors( vC, vB ); - ab.subVectors( vA, vB ); - cb.cross( ab ); - - cb.normalize(); - - face.normal.copy( cb ); - - } - - }, - - computeVertexNormals: function ( areaWeighted ) { - - if ( areaWeighted === undefined ) areaWeighted = true; - - var v, vl, f, fl, face, vertices; - - vertices = new Array( this.vertices.length ); - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - vertices[ v ] = new Vector3(); - - } - - if ( areaWeighted ) { - - // vertex normals weighted by triangle areas - // http://www.iquilezles.org/www/articles/normals/normals.htm - - var vA, vB, vC; - var cb = new Vector3(), ab = new Vector3(); - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - vA = this.vertices[ face.a ]; - vB = this.vertices[ face.b ]; - vC = this.vertices[ face.c ]; - - cb.subVectors( vC, vB ); - ab.subVectors( vA, vB ); - cb.cross( ab ); - - vertices[ face.a ].add( cb ); - vertices[ face.b ].add( cb ); - vertices[ face.c ].add( cb ); - - } - - } else { - - this.computeFaceNormals(); - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - vertices[ face.a ].add( face.normal ); - vertices[ face.b ].add( face.normal ); - vertices[ face.c ].add( face.normal ); - - } - - } - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - vertices[ v ].normalize(); - - } - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - var vertexNormals = face.vertexNormals; - - if ( vertexNormals.length === 3 ) { - - vertexNormals[ 0 ].copy( vertices[ face.a ] ); - vertexNormals[ 1 ].copy( vertices[ face.b ] ); - vertexNormals[ 2 ].copy( vertices[ face.c ] ); - - } else { - - vertexNormals[ 0 ] = vertices[ face.a ].clone(); - vertexNormals[ 1 ] = vertices[ face.b ].clone(); - vertexNormals[ 2 ] = vertices[ face.c ].clone(); - - } - - } - - if ( this.faces.length > 0 ) { - - this.normalsNeedUpdate = true; - - } - - }, - - computeFlatVertexNormals: function () { - - var f, fl, face; - - this.computeFaceNormals(); - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - var vertexNormals = face.vertexNormals; - - if ( vertexNormals.length === 3 ) { - - vertexNormals[ 0 ].copy( face.normal ); - vertexNormals[ 1 ].copy( face.normal ); - vertexNormals[ 2 ].copy( face.normal ); - - } else { - - vertexNormals[ 0 ] = face.normal.clone(); - vertexNormals[ 1 ] = face.normal.clone(); - vertexNormals[ 2 ] = face.normal.clone(); - - } - - } - - if ( this.faces.length > 0 ) { - - this.normalsNeedUpdate = true; - - } - - }, - - computeMorphNormals: function () { - - var i, il, f, fl, face; - - // save original normals - // - create temp variables on first access - // otherwise just copy (for faster repeated calls) - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - if ( ! face.__originalFaceNormal ) { - - face.__originalFaceNormal = face.normal.clone(); - - } else { - - face.__originalFaceNormal.copy( face.normal ); - - } - - if ( ! face.__originalVertexNormals ) face.__originalVertexNormals = []; - - for ( i = 0, il = face.vertexNormals.length; i < il; i ++ ) { - - if ( ! face.__originalVertexNormals[ i ] ) { - - face.__originalVertexNormals[ i ] = face.vertexNormals[ i ].clone(); - - } else { - - face.__originalVertexNormals[ i ].copy( face.vertexNormals[ i ] ); - - } - - } - - } - - // use temp geometry to compute face and vertex normals for each morph - - var tmpGeo = new Geometry(); - tmpGeo.faces = this.faces; - - for ( i = 0, il = this.morphTargets.length; i < il; i ++ ) { - - // create on first access - - if ( ! this.morphNormals[ i ] ) { - - this.morphNormals[ i ] = {}; - this.morphNormals[ i ].faceNormals = []; - this.morphNormals[ i ].vertexNormals = []; - - var dstNormalsFace = this.morphNormals[ i ].faceNormals; - var dstNormalsVertex = this.morphNormals[ i ].vertexNormals; - - var faceNormal, vertexNormals; - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - faceNormal = new Vector3(); - vertexNormals = { a: new Vector3(), b: new Vector3(), c: new Vector3() }; - - dstNormalsFace.push( faceNormal ); - dstNormalsVertex.push( vertexNormals ); - - } - - } - - var morphNormals = this.morphNormals[ i ]; - - // set vertices to morph target - - tmpGeo.vertices = this.morphTargets[ i ].vertices; - - // compute morph normals - - tmpGeo.computeFaceNormals(); - tmpGeo.computeVertexNormals(); - - // store morph normals - - var faceNormal, vertexNormals; - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - faceNormal = morphNormals.faceNormals[ f ]; - vertexNormals = morphNormals.vertexNormals[ f ]; - - faceNormal.copy( face.normal ); - - vertexNormals.a.copy( face.vertexNormals[ 0 ] ); - vertexNormals.b.copy( face.vertexNormals[ 1 ] ); - vertexNormals.c.copy( face.vertexNormals[ 2 ] ); - - } - - } - - // restore original normals - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - face.normal = face.__originalFaceNormal; - face.vertexNormals = face.__originalVertexNormals; - - } - - }, - - computeBoundingBox: function () { - - if ( this.boundingBox === null ) { - - this.boundingBox = new Box3(); - - } - - this.boundingBox.setFromPoints( this.vertices ); - - }, - - computeBoundingSphere: function () { - - if ( this.boundingSphere === null ) { - - this.boundingSphere = new Sphere(); - - } - - this.boundingSphere.setFromPoints( this.vertices ); - - }, - - merge: function ( geometry, matrix, materialIndexOffset ) { - - if ( ! ( geometry && geometry.isGeometry ) ) { - - console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry ); - return; - - } - - var normalMatrix, - vertexOffset = this.vertices.length, - vertices1 = this.vertices, - vertices2 = geometry.vertices, - faces1 = this.faces, - faces2 = geometry.faces, - colors1 = this.colors, - colors2 = geometry.colors; - - if ( materialIndexOffset === undefined ) materialIndexOffset = 0; - - if ( matrix !== undefined ) { - - normalMatrix = new Matrix3().getNormalMatrix( matrix ); - - } - - // vertices - - for ( var i = 0, il = vertices2.length; i < il; i ++ ) { - - var vertex = vertices2[ i ]; - - var vertexCopy = vertex.clone(); - - if ( matrix !== undefined ) vertexCopy.applyMatrix4( matrix ); - - vertices1.push( vertexCopy ); - - } - - // colors - - for ( var i = 0, il = colors2.length; i < il; i ++ ) { - - colors1.push( colors2[ i ].clone() ); - - } - - // faces - - for ( i = 0, il = faces2.length; i < il; i ++ ) { - - var face = faces2[ i ], faceCopy, normal, color, - faceVertexNormals = face.vertexNormals, - faceVertexColors = face.vertexColors; - - faceCopy = new Face3( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset ); - faceCopy.normal.copy( face.normal ); - - if ( normalMatrix !== undefined ) { - - faceCopy.normal.applyMatrix3( normalMatrix ).normalize(); - - } - - for ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) { - - normal = faceVertexNormals[ j ].clone(); - - if ( normalMatrix !== undefined ) { - - normal.applyMatrix3( normalMatrix ).normalize(); - - } - - faceCopy.vertexNormals.push( normal ); - - } - - faceCopy.color.copy( face.color ); - - for ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) { - - color = faceVertexColors[ j ]; - faceCopy.vertexColors.push( color.clone() ); - - } - - faceCopy.materialIndex = face.materialIndex + materialIndexOffset; - - faces1.push( faceCopy ); - - } - - // uvs - - for ( var i = 0, il = geometry.faceVertexUvs.length; i < il; i ++ ) { - - var faceVertexUvs2 = geometry.faceVertexUvs[ i ]; - - if ( this.faceVertexUvs[ i ] === undefined ) this.faceVertexUvs[ i ] = []; - - for ( var j = 0, jl = faceVertexUvs2.length; j < jl; j ++ ) { - - var uvs2 = faceVertexUvs2[ j ], uvsCopy = []; - - for ( var k = 0, kl = uvs2.length; k < kl; k ++ ) { - - uvsCopy.push( uvs2[ k ].clone() ); - - } - - this.faceVertexUvs[ i ].push( uvsCopy ); - - } - - } - - }, - - mergeMesh: function ( mesh ) { - - if ( ! ( mesh && mesh.isMesh ) ) { - - console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh ); - return; - - } - - if ( mesh.matrixAutoUpdate ) mesh.updateMatrix(); - - this.merge( mesh.geometry, mesh.matrix ); - - }, - - /* - * Checks for duplicate vertices with hashmap. - * Duplicated vertices are removed - * and faces' vertices are updated. - */ - - mergeVertices: function () { - - var verticesMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique) - var unique = [], changes = []; - - var v, key; - var precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001 - var precision = Math.pow( 10, precisionPoints ); - var i, il, face; - var indices, j, jl; - - for ( i = 0, il = this.vertices.length; i < il; i ++ ) { - - v = this.vertices[ i ]; - key = Math.round( v.x * precision ) + '_' + Math.round( v.y * precision ) + '_' + Math.round( v.z * precision ); - - if ( verticesMap[ key ] === undefined ) { - - verticesMap[ key ] = i; - unique.push( this.vertices[ i ] ); - changes[ i ] = unique.length - 1; - - } else { - - //console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]); - changes[ i ] = changes[ verticesMap[ key ] ]; - - } - - } - - - // if faces are completely degenerate after merging vertices, we - // have to remove them from the geometry. - var faceIndicesToRemove = []; - - for ( i = 0, il = this.faces.length; i < il; i ++ ) { - - face = this.faces[ i ]; - - face.a = changes[ face.a ]; - face.b = changes[ face.b ]; - face.c = changes[ face.c ]; - - indices = [ face.a, face.b, face.c ]; - - // if any duplicate vertices are found in a Face3 - // we have to remove the face as nothing can be saved - for ( var n = 0; n < 3; n ++ ) { - - if ( indices[ n ] === indices[ ( n + 1 ) % 3 ] ) { - - faceIndicesToRemove.push( i ); - break; - - } - - } - - } - - for ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) { - - var idx = faceIndicesToRemove[ i ]; - - this.faces.splice( idx, 1 ); - - for ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) { - - this.faceVertexUvs[ j ].splice( idx, 1 ); - - } - - } - - // Use unique set of vertices - - var diff = this.vertices.length - unique.length; - this.vertices = unique; - return diff; - - }, - - setFromPoints: function ( points ) { - - this.vertices = []; - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - var point = points[ i ]; - this.vertices.push( new Vector3( point.x, point.y, point.z || 0 ) ); - - } - - return this; - - }, - - sortFacesByMaterialIndex: function () { - - var faces = this.faces; - var length = faces.length; - - // tag faces - - for ( var i = 0; i < length; i ++ ) { - - faces[ i ]._id = i; - - } - - // sort faces - - function materialIndexSort( a, b ) { - - return a.materialIndex - b.materialIndex; - - } - - faces.sort( materialIndexSort ); - - // sort uvs - - var uvs1 = this.faceVertexUvs[ 0 ]; - var uvs2 = this.faceVertexUvs[ 1 ]; - - var newUvs1, newUvs2; - - if ( uvs1 && uvs1.length === length ) newUvs1 = []; - if ( uvs2 && uvs2.length === length ) newUvs2 = []; - - for ( var i = 0; i < length; i ++ ) { - - var id = faces[ i ]._id; - - if ( newUvs1 ) newUvs1.push( uvs1[ id ] ); - if ( newUvs2 ) newUvs2.push( uvs2[ id ] ); - - } - - if ( newUvs1 ) this.faceVertexUvs[ 0 ] = newUvs1; - if ( newUvs2 ) this.faceVertexUvs[ 1 ] = newUvs2; - - }, - - toJSON: function () { - - var data = { - metadata: { - version: 4.5, - type: 'Geometry', - generator: 'Geometry.toJSON' - } - }; - - // standard Geometry serialization - - data.uuid = this.uuid; - data.type = this.type; - if ( this.name !== '' ) data.name = this.name; - - if ( this.parameters !== undefined ) { - - var parameters = this.parameters; - - for ( var key in parameters ) { - - if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ]; - - } - - return data; - - } - - var vertices = []; - - for ( var i = 0; i < this.vertices.length; i ++ ) { - - var vertex = this.vertices[ i ]; - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - var faces = []; - var normals = []; - var normalsHash = {}; - var colors = []; - var colorsHash = {}; - var uvs = []; - var uvsHash = {}; - - for ( var i = 0; i < this.faces.length; i ++ ) { - - var face = this.faces[ i ]; - - var hasMaterial = true; - var hasFaceUv = false; // deprecated - var hasFaceVertexUv = this.faceVertexUvs[ 0 ][ i ] !== undefined; - var hasFaceNormal = face.normal.length() > 0; - var hasFaceVertexNormal = face.vertexNormals.length > 0; - var hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1; - var hasFaceVertexColor = face.vertexColors.length > 0; - - var faceType = 0; - - faceType = setBit( faceType, 0, 0 ); // isQuad - faceType = setBit( faceType, 1, hasMaterial ); - faceType = setBit( faceType, 2, hasFaceUv ); - faceType = setBit( faceType, 3, hasFaceVertexUv ); - faceType = setBit( faceType, 4, hasFaceNormal ); - faceType = setBit( faceType, 5, hasFaceVertexNormal ); - faceType = setBit( faceType, 6, hasFaceColor ); - faceType = setBit( faceType, 7, hasFaceVertexColor ); - - faces.push( faceType ); - faces.push( face.a, face.b, face.c ); - faces.push( face.materialIndex ); - - if ( hasFaceVertexUv ) { - - var faceVertexUvs = this.faceVertexUvs[ 0 ][ i ]; - - faces.push( - getUvIndex( faceVertexUvs[ 0 ] ), - getUvIndex( faceVertexUvs[ 1 ] ), - getUvIndex( faceVertexUvs[ 2 ] ) - ); - - } - - if ( hasFaceNormal ) { - - faces.push( getNormalIndex( face.normal ) ); - - } - - if ( hasFaceVertexNormal ) { - - var vertexNormals = face.vertexNormals; - - faces.push( - getNormalIndex( vertexNormals[ 0 ] ), - getNormalIndex( vertexNormals[ 1 ] ), - getNormalIndex( vertexNormals[ 2 ] ) - ); - - } - - if ( hasFaceColor ) { - - faces.push( getColorIndex( face.color ) ); - - } - - if ( hasFaceVertexColor ) { - - var vertexColors = face.vertexColors; - - faces.push( - getColorIndex( vertexColors[ 0 ] ), - getColorIndex( vertexColors[ 1 ] ), - getColorIndex( vertexColors[ 2 ] ) - ); - - } - - } - - function setBit( value, position, enabled ) { - - return enabled ? value | ( 1 << position ) : value & ( ~ ( 1 << position ) ); - - } - - function getNormalIndex( normal ) { - - var hash = normal.x.toString() + normal.y.toString() + normal.z.toString(); - - if ( normalsHash[ hash ] !== undefined ) { - - return normalsHash[ hash ]; - - } - - normalsHash[ hash ] = normals.length / 3; - normals.push( normal.x, normal.y, normal.z ); - - return normalsHash[ hash ]; - - } - - function getColorIndex( color ) { - - var hash = color.r.toString() + color.g.toString() + color.b.toString(); - - if ( colorsHash[ hash ] !== undefined ) { - - return colorsHash[ hash ]; - - } - - colorsHash[ hash ] = colors.length; - colors.push( color.getHex() ); - - return colorsHash[ hash ]; - - } - - function getUvIndex( uv ) { - - var hash = uv.x.toString() + uv.y.toString(); - - if ( uvsHash[ hash ] !== undefined ) { - - return uvsHash[ hash ]; - - } - - uvsHash[ hash ] = uvs.length / 2; - uvs.push( uv.x, uv.y ); - - return uvsHash[ hash ]; - - } - - data.data = {}; - - data.data.vertices = vertices; - data.data.normals = normals; - if ( colors.length > 0 ) data.data.colors = colors; - if ( uvs.length > 0 ) data.data.uvs = [ uvs ]; // temporal backward compatibility - data.data.faces = faces; - - return data; - - }, - - clone: function () { - - /* - // Handle primitives - - var parameters = this.parameters; - - if ( parameters !== undefined ) { - - var values = []; - - for ( var key in parameters ) { - - values.push( parameters[ key ] ); - - } - - var geometry = Object.create( this.constructor.prototype ); - this.constructor.apply( geometry, values ); - return geometry; - - } - - return new this.constructor().copy( this ); - */ - - return new Geometry().copy( this ); - - }, - - copy: function ( source ) { - - var i, il, j, jl, k, kl; - - // reset - - this.vertices = []; - this.colors = []; - this.faces = []; - this.faceVertexUvs = [[]]; - this.morphTargets = []; - this.morphNormals = []; - this.skinWeights = []; - this.skinIndices = []; - this.lineDistances = []; - this.boundingBox = null; - this.boundingSphere = null; - - // name - - this.name = source.name; - - // vertices - - var vertices = source.vertices; - - for ( i = 0, il = vertices.length; i < il; i ++ ) { - - this.vertices.push( vertices[ i ].clone() ); - - } - - // colors - - var colors = source.colors; - - for ( i = 0, il = colors.length; i < il; i ++ ) { - - this.colors.push( colors[ i ].clone() ); - - } - - // faces - - var faces = source.faces; - - for ( i = 0, il = faces.length; i < il; i ++ ) { - - this.faces.push( faces[ i ].clone() ); - - } - - // face vertex uvs - - for ( i = 0, il = source.faceVertexUvs.length; i < il; i ++ ) { - - var faceVertexUvs = source.faceVertexUvs[ i ]; - - if ( this.faceVertexUvs[ i ] === undefined ) { - - this.faceVertexUvs[ i ] = []; - - } - - for ( j = 0, jl = faceVertexUvs.length; j < jl; j ++ ) { - - var uvs = faceVertexUvs[ j ], uvsCopy = []; - - for ( k = 0, kl = uvs.length; k < kl; k ++ ) { - - var uv = uvs[ k ]; - - uvsCopy.push( uv.clone() ); - - } - - this.faceVertexUvs[ i ].push( uvsCopy ); - - } - - } - - // morph targets - - var morphTargets = source.morphTargets; - - for ( i = 0, il = morphTargets.length; i < il; i ++ ) { - - var morphTarget = {}; - morphTarget.name = morphTargets[ i ].name; - - // vertices - - if ( morphTargets[ i ].vertices !== undefined ) { - - morphTarget.vertices = []; - - for ( j = 0, jl = morphTargets[ i ].vertices.length; j < jl; j ++ ) { - - morphTarget.vertices.push( morphTargets[ i ].vertices[ j ].clone() ); - - } - - } - - // normals - - if ( morphTargets[ i ].normals !== undefined ) { - - morphTarget.normals = []; - - for ( j = 0, jl = morphTargets[ i ].normals.length; j < jl; j ++ ) { - - morphTarget.normals.push( morphTargets[ i ].normals[ j ].clone() ); - - } - - } - - this.morphTargets.push( morphTarget ); - - } - - // morph normals - - var morphNormals = source.morphNormals; - - for ( i = 0, il = morphNormals.length; i < il; i ++ ) { - - var morphNormal = {}; - - // vertex normals - - if ( morphNormals[ i ].vertexNormals !== undefined ) { - - morphNormal.vertexNormals = []; - - for ( j = 0, jl = morphNormals[ i ].vertexNormals.length; j < jl; j ++ ) { - - var srcVertexNormal = morphNormals[ i ].vertexNormals[ j ]; - var destVertexNormal = {}; - - destVertexNormal.a = srcVertexNormal.a.clone(); - destVertexNormal.b = srcVertexNormal.b.clone(); - destVertexNormal.c = srcVertexNormal.c.clone(); - - morphNormal.vertexNormals.push( destVertexNormal ); - - } - - } - - // face normals - - if ( morphNormals[ i ].faceNormals !== undefined ) { - - morphNormal.faceNormals = []; - - for ( j = 0, jl = morphNormals[ i ].faceNormals.length; j < jl; j ++ ) { - - morphNormal.faceNormals.push( morphNormals[ i ].faceNormals[ j ].clone() ); - - } - - } - - this.morphNormals.push( morphNormal ); - - } - - // skin weights - - var skinWeights = source.skinWeights; - - for ( i = 0, il = skinWeights.length; i < il; i ++ ) { - - this.skinWeights.push( skinWeights[ i ].clone() ); - - } - - // skin indices - - var skinIndices = source.skinIndices; - - for ( i = 0, il = skinIndices.length; i < il; i ++ ) { - - this.skinIndices.push( skinIndices[ i ].clone() ); - - } - - // line distances - - var lineDistances = source.lineDistances; - - for ( i = 0, il = lineDistances.length; i < il; i ++ ) { - - this.lineDistances.push( lineDistances[ i ] ); - - } - - // bounding box - - var boundingBox = source.boundingBox; - - if ( boundingBox !== null ) { - - this.boundingBox = boundingBox.clone(); - - } - - // bounding sphere - - var boundingSphere = source.boundingSphere; - - if ( boundingSphere !== null ) { - - this.boundingSphere = boundingSphere.clone(); - - } - - // update flags - - this.elementsNeedUpdate = source.elementsNeedUpdate; - this.verticesNeedUpdate = source.verticesNeedUpdate; - this.uvsNeedUpdate = source.uvsNeedUpdate; - this.normalsNeedUpdate = source.normalsNeedUpdate; - this.colorsNeedUpdate = source.colorsNeedUpdate; - this.lineDistancesNeedUpdate = source.lineDistancesNeedUpdate; - this.groupsNeedUpdate = source.groupsNeedUpdate; - - return this; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - } - -} ); - - -export { Geometry }; diff --git a/cases/esbuild-three/src/base/core/InstancedBufferAttribute.d.ts b/cases/esbuild-three/src/base/core/InstancedBufferAttribute.d.ts deleted file mode 100644 index 6e7eaa5bab..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedBufferAttribute.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { BufferGeometry } from './BufferGeometry'; -import { BufferAttribute } from './BufferAttribute'; - -/** - * @see examples/js/BufferGeometryUtils.js - */ -export namespace BufferGeometryUtils { - export function mergeBufferGeometries( - geometries: BufferGeometry[] - ): BufferGeometry; - export function computeTangents( geometry: BufferGeometry ): null; - export function mergeBufferAttributes( - attributes: BufferAttribute[] - ): BufferAttribute; -} - -/** - * @deprecated - */ -export namespace GeometryUtils { - /** - * @deprecated Use {@link Geometry#merge geometry.merge( geometry2, matrix, materialIndexOffset )} instead. - */ - export function merge( - geometry1: any, - geometry2: any, - materialIndexOffset?: any - ): any; - /** - * @deprecated Use {@link Geometry#center geometry.center()} instead. - */ - export function center( geometry: any ): any; -} - -/** - * @see src/core/InstancedBufferAttribute.js - */ -export class InstancedBufferAttribute extends BufferAttribute { - - constructor( - array: ArrayLike, - itemSize: number, - normalized?: boolean, - meshPerAttribute?: number - ); - - meshPerAttribute: number; - -} diff --git a/cases/esbuild-three/src/base/core/InstancedBufferAttribute.js b/cases/esbuild-three/src/base/core/InstancedBufferAttribute.js deleted file mode 100644 index c62c4451a5..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedBufferAttribute.js +++ /dev/null @@ -1,57 +0,0 @@ -import { BufferAttribute } from './BufferAttribute.js'; - -/** - * @author benaadams / https://twitter.com/ben_a_adams - */ - -function InstancedBufferAttribute( array, itemSize, normalized, meshPerAttribute ) { - - if ( typeof ( normalized ) === 'number' ) { - - meshPerAttribute = normalized; - - normalized = false; - - console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' ); - - } - - BufferAttribute.call( this, array, itemSize, normalized ); - - this.meshPerAttribute = meshPerAttribute || 1; - -} - -InstancedBufferAttribute.prototype = Object.assign( Object.create( BufferAttribute.prototype ), { - - constructor: InstancedBufferAttribute, - - isInstancedBufferAttribute: true, - - copy: function ( source ) { - - BufferAttribute.prototype.copy.call( this, source ); - - this.meshPerAttribute = source.meshPerAttribute; - - return this; - - }, - - toJSON: function () { - - var data = BufferAttribute.prototype.toJSON.call( this ); - - data.meshPerAttribute = this.meshPerAttribute; - - data.isInstancedBufferAttribute = true; - - return data; - - } - -} ); - - - -export { InstancedBufferAttribute }; diff --git a/cases/esbuild-three/src/base/core/InstancedBufferGeometry.d.ts b/cases/esbuild-three/src/base/core/InstancedBufferGeometry.d.ts deleted file mode 100644 index 8896a10671..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedBufferGeometry.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { BufferGeometry } from './BufferGeometry'; - -/** - * @see src/core/InstancedBufferGeometry.js - */ -export class InstancedBufferGeometry extends BufferGeometry { - - constructor(); - - groups: { start: number; count: number; instances: number }[]; - maxInstancedCount: number; - - addGroup( start: number, count: number, instances: number ): void; - -} diff --git a/cases/esbuild-three/src/base/core/InstancedBufferGeometry.js b/cases/esbuild-three/src/base/core/InstancedBufferGeometry.js deleted file mode 100644 index 2422610bb1..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedBufferGeometry.js +++ /dev/null @@ -1,52 +0,0 @@ -import { BufferGeometry } from './BufferGeometry.js'; - -/** - * @author benaadams / https://twitter.com/ben_a_adams - */ - -function InstancedBufferGeometry() { - - BufferGeometry.call( this ); - - this.type = 'InstancedBufferGeometry'; - this.maxInstancedCount = undefined; - -} - -InstancedBufferGeometry.prototype = Object.assign( Object.create( BufferGeometry.prototype ), { - - constructor: InstancedBufferGeometry, - - isInstancedBufferGeometry: true, - - copy: function ( source ) { - - BufferGeometry.prototype.copy.call( this, source ); - - this.maxInstancedCount = source.maxInstancedCount; - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - toJSON: function () { - - var data = BufferGeometry.prototype.toJSON.call( this ); - - data.maxInstancedCount = this.maxInstancedCount; - - data.isInstancedBufferGeometry = true; - - return data; - - } - -} ); - -export { InstancedBufferGeometry }; diff --git a/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.d.ts b/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.d.ts deleted file mode 100644 index ca8c8adb1e..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { InterleavedBuffer } from './InterleavedBuffer'; - -/** - * @see src/core/InstancedInterleavedBuffer.js - */ -export class InstancedInterleavedBuffer extends InterleavedBuffer { - - constructor( - array: ArrayLike, - stride: number, - meshPerAttribute?: number - ); - - meshPerAttribute: number; - -} diff --git a/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.js b/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.js deleted file mode 100644 index 12bc90bc6f..0000000000 --- a/cases/esbuild-three/src/base/core/InstancedInterleavedBuffer.js +++ /dev/null @@ -1,33 +0,0 @@ -import { InterleavedBuffer } from './InterleavedBuffer.js'; - -/** - * @author benaadams / https://twitter.com/ben_a_adams - */ - -function InstancedInterleavedBuffer( array, stride, meshPerAttribute ) { - - InterleavedBuffer.call( this, array, stride ); - - this.meshPerAttribute = meshPerAttribute || 1; - -} - -InstancedInterleavedBuffer.prototype = Object.assign( Object.create( InterleavedBuffer.prototype ), { - - constructor: InstancedInterleavedBuffer, - - isInstancedInterleavedBuffer: true, - - copy: function ( source ) { - - InterleavedBuffer.prototype.copy.call( this, source ); - - this.meshPerAttribute = source.meshPerAttribute; - - return this; - - } - -} ); - -export { InstancedInterleavedBuffer }; diff --git a/cases/esbuild-three/src/base/core/InterleavedBuffer.d.ts b/cases/esbuild-three/src/base/core/InterleavedBuffer.d.ts deleted file mode 100644 index 8a0266562e..0000000000 --- a/cases/esbuild-three/src/base/core/InterleavedBuffer.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { InterleavedBufferAttribute } from './InterleavedBufferAttribute'; - -/** - * @see src/core/InterleavedBuffer.js - */ -export class InterleavedBuffer { - - constructor( array: ArrayLike, stride: number ); - - array: ArrayLike; - stride: number; - dynamic: boolean; - updateRange: { offset: number; count: number }; - version: number; - length: number; - count: number; - needsUpdate: boolean; - - setArray( array?: ArrayBufferView ): void; - setDynamic( dynamic: boolean ): InterleavedBuffer; - clone(): this; - copy( source: InterleavedBuffer ): this; - copyAt( - index1: number, - attribute: InterleavedBufferAttribute, - index2: number - ): InterleavedBuffer; - set( value: ArrayLike, index: number ): InterleavedBuffer; - -} diff --git a/cases/esbuild-three/src/base/core/InterleavedBuffer.js b/cases/esbuild-three/src/base/core/InterleavedBuffer.js deleted file mode 100644 index dd63120268..0000000000 --- a/cases/esbuild-three/src/base/core/InterleavedBuffer.js +++ /dev/null @@ -1,111 +0,0 @@ - -/** - * @author benaadams / https://twitter.com/ben_a_adams - */ - -function InterleavedBuffer( array, stride ) { - - this.array = array; - this.stride = stride; - this.count = array !== undefined ? array.length / stride : 0; - - this.dynamic = false; - this.updateRange = { offset: 0, count: - 1 }; - - this.version = 0; - -} - -Object.defineProperty( InterleavedBuffer.prototype, 'needsUpdate', { - - set: function ( value ) { - - if ( value === true ) this.version ++; - - } - -} ); - -Object.assign( InterleavedBuffer.prototype, { - - isInterleavedBuffer: true, - - onUploadCallback: function () {}, - - setArray: function ( array ) { - - if ( Array.isArray( array ) ) { - - throw new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' ); - - } - - this.count = array !== undefined ? array.length / this.stride : 0; - this.array = array; - - return this; - - }, - - setDynamic: function ( value ) { - - this.dynamic = value; - - return this; - - }, - - copy: function ( source ) { - - this.array = new source.array.constructor( source.array ); - this.count = source.count; - this.stride = source.stride; - this.dynamic = source.dynamic; - - return this; - - }, - - copyAt: function ( index1, attribute, index2 ) { - - index1 *= this.stride; - index2 *= attribute.stride; - - for ( var i = 0, l = this.stride; i < l; i ++ ) { - - this.array[ index1 + i ] = attribute.array[ index2 + i ]; - - } - - return this; - - }, - - set: function ( value, offset ) { - - if ( offset === undefined ) offset = 0; - - this.array.set( value, offset ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - onUpload: function ( callback ) { - - this.onUploadCallback = callback; - - return this; - - } - -} ); - - -export { InterleavedBuffer }; diff --git a/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.d.ts b/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.d.ts deleted file mode 100644 index ec2ce921ac..0000000000 --- a/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { InterleavedBuffer } from './InterleavedBuffer'; -/** - * @see src/core/InterleavedBufferAttribute.js - */ -export class InterleavedBufferAttribute { - - constructor( - interleavedBuffer: InterleavedBuffer, - itemSize: number, - offset: number, - normalized?: boolean - ); - - uuid: string; - data: InterleavedBuffer; - itemSize: number; - offset: number; - count: number; - normalized: boolean; - array: any[]; - - getX( index: number ): number; - setX( index: number, x: number ): InterleavedBufferAttribute; - getY( index: number ): number; - setY( index: number, y: number ): InterleavedBufferAttribute; - getZ( index: number ): number; - setZ( index: number, z: number ): InterleavedBufferAttribute; - getW( index: number ): number; - setW( index: number, z: number ): InterleavedBufferAttribute; - setXY( index: number, x: number, y: number ): InterleavedBufferAttribute; - setXYZ( - index: number, - x: number, - y: number, - z: number - ): InterleavedBufferAttribute; - setXYZW( - index: number, - x: number, - y: number, - z: number, - w: number - ): InterleavedBufferAttribute; - /** - * @deprecated Use {@link InterleavedBufferAttribute#count .count} instead. - */ - length: number; - -} diff --git a/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.js b/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.js deleted file mode 100644 index 3cfefca189..0000000000 --- a/cases/esbuild-three/src/base/core/InterleavedBufferAttribute.js +++ /dev/null @@ -1,139 +0,0 @@ - -/** - * @author benaadams / https://twitter.com/ben_a_adams - */ - -function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) { - - this.data = interleavedBuffer; - this.itemSize = itemSize; - this.offset = offset; - - this.normalized = normalized === true; - -} - -Object.defineProperties( InterleavedBufferAttribute.prototype, { - - count: { - - get: function () { - - return this.data.count; - - } - - }, - - array: { - - get: function () { - - return this.data.array; - - } - - } - -} ); - -Object.assign( InterleavedBufferAttribute.prototype, { - - isInterleavedBufferAttribute: true, - - setX: function ( index, x ) { - - this.data.array[ index * this.data.stride + this.offset ] = x; - - return this; - - }, - - setY: function ( index, y ) { - - this.data.array[ index * this.data.stride + this.offset + 1 ] = y; - - return this; - - }, - - setZ: function ( index, z ) { - - this.data.array[ index * this.data.stride + this.offset + 2 ] = z; - - return this; - - }, - - setW: function ( index, w ) { - - this.data.array[ index * this.data.stride + this.offset + 3 ] = w; - - return this; - - }, - - getX: function ( index ) { - - return this.data.array[ index * this.data.stride + this.offset ]; - - }, - - getY: function ( index ) { - - return this.data.array[ index * this.data.stride + this.offset + 1 ]; - - }, - - getZ: function ( index ) { - - return this.data.array[ index * this.data.stride + this.offset + 2 ]; - - }, - - getW: function ( index ) { - - return this.data.array[ index * this.data.stride + this.offset + 3 ]; - - }, - - setXY: function ( index, x, y ) { - - index = index * this.data.stride + this.offset; - - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; - - return this; - - }, - - setXYZ: function ( index, x, y, z ) { - - index = index * this.data.stride + this.offset; - - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; - this.data.array[ index + 2 ] = z; - - return this; - - }, - - setXYZW: function ( index, x, y, z, w ) { - - index = index * this.data.stride + this.offset; - - this.data.array[ index + 0 ] = x; - this.data.array[ index + 1 ] = y; - this.data.array[ index + 2 ] = z; - this.data.array[ index + 3 ] = w; - - return this; - - } - -} ); - - -export { InterleavedBufferAttribute }; diff --git a/cases/esbuild-three/src/base/core/Layers.d.ts b/cases/esbuild-three/src/base/core/Layers.d.ts deleted file mode 100644 index 14dad236dd..0000000000 --- a/cases/esbuild-three/src/base/core/Layers.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class Layers { - - constructor(); - - mask: number; - - set( channel: number ): void; - enable( channel: number ): void; - enableAll(): void; - toggle( channel: number ): void; - disable( channel: number ): void; - disableAll(): void; - test( layers: Layers ): boolean; - -} diff --git a/cases/esbuild-three/src/base/core/Layers.js b/cases/esbuild-three/src/base/core/Layers.js deleted file mode 100644 index 33483282df..0000000000 --- a/cases/esbuild-three/src/base/core/Layers.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function Layers() { - - this.mask = 1 | 0; - -} - -Object.assign( Layers.prototype, { - - set: function ( channel ) { - - this.mask = 1 << channel | 0; - - }, - - enable: function ( channel ) { - - this.mask |= 1 << channel | 0; - - }, - - enableAll: function () { - - this.mask = 0xffffffff | 0; - - }, - - toggle: function ( channel ) { - - this.mask ^= 1 << channel | 0; - - }, - - disable: function ( channel ) { - - this.mask &= ~ ( 1 << channel | 0 ); - - }, - - disableAll: function () { - - this.mask = 0; - - }, - - test: function ( layers ) { - - return ( this.mask & layers.mask ) !== 0; - - } - -} ); - - -export { Layers }; diff --git a/cases/esbuild-three/src/base/core/Object3D.d.ts b/cases/esbuild-three/src/base/core/Object3D.d.ts deleted file mode 100644 index f3612b088c..0000000000 --- a/cases/esbuild-three/src/base/core/Object3D.d.ts +++ /dev/null @@ -1,351 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Euler } from './../math/Euler'; -import { Quaternion } from './../math/Quaternion'; -import { Matrix4 } from './../math/Matrix4'; -import { Matrix3 } from './../math/Matrix3'; -import { Layers } from './Layers'; -import { WebGLRenderer } from './../renderers/WebGLRenderer'; -import { Scene } from './../scenes/Scene'; -import { Camera } from './../cameras/Camera'; -import { Geometry } from './Geometry'; -import { Material } from './../materials/Material'; -import { Group } from './../objects/Group'; -import { Raycaster } from './Raycaster'; -import { EventDispatcher } from './EventDispatcher'; -import { BufferGeometry } from './BufferGeometry'; -import { Intersection } from './Raycaster'; - -export let Object3DIdCount: number; - -/** - * Base class for scene graph objects - */ -export class Object3D extends EventDispatcher { - - constructor(); - - /** - * Unique number of this object instance. - */ - id: number; - - /** - * - */ - uuid: string; - - /** - * Optional name of the object (doesn't need to be unique). - */ - name: string; - - type: string; - - /** - * Object's parent in the scene graph. - */ - parent: Object3D | null; - - /** - * Array with object's children. - */ - children: Object3D[]; - - /** - * Up direction. - */ - up: Vector3; - - /** - * Object's local position. - */ - position: Vector3; - - /** - * Object's local rotation (Euler angles), in radians. - */ - rotation: Euler; - - /** - * Global rotation. - */ - quaternion: Quaternion; - - /** - * Object's local scale. - */ - scale: Vector3; - - modelViewMatrix: Matrix4; - - normalMatrix: Matrix3; - - /** - * Local transform. - */ - matrix: Matrix4; - - /** - * The global transform of the object. If the Object3d has no parent, then it's identical to the local transform. - */ - matrixWorld: Matrix4; - - /** - * When this is set, it calculates the matrix of position, (rotation or quaternion) and scale every frame and also recalculates the matrixWorld property. - */ - matrixAutoUpdate: boolean; - - /** - * When this is set, it calculates the matrixWorld in that frame and resets this property to false. - */ - matrixWorldNeedsUpdate: boolean; - - layers: Layers; - /** - * Object gets rendered if true. - */ - visible: boolean; - - /** - * Gets rendered into shadow map. - */ - castShadow: boolean; - - /** - * Material gets baked in shadow receiving. - */ - receiveShadow: boolean; - - /** - * When this is set, it checks every frame if the object is in the frustum of the camera. Otherwise the object gets drawn every frame even if it isn't visible. - */ - frustumCulled: boolean; - - /** - * Overrides the default rendering order of scene graph objects, from lowest to highest renderOrder. Opaque and transparent objects remain sorted independently though. When this property is set for an instance of Group, all descendants objects will be sorted and rendered together. - */ - renderOrder: number; - - /** - * An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned. - */ - userData: { [key: string]: any }; - - /** - * Custom depth material to be used when rendering to the depth map. Can only be used in context of meshes. - * When shadow-casting with a DirectionalLight or SpotLight, if you are (a) modifying vertex positions in - * the vertex shader, (b) using a displacement map, (c) using an alpha map with alphaTest, or (d) using a - * transparent texture with alphaTest, you must specify a customDepthMaterial for proper shadows. - */ - customDepthMaterial: Material; - - /** - * Same as customDepthMaterial, but used with PointLight. - */ - customDistanceMaterial: Material; - - /** - * Used to check whether this or derived classes are Object3Ds. Default is true. - * You should not change this, as it is used internally for optimisation. - */ - isObject3D: true; - - /** - * Calls before rendering object - */ - onBeforeRender: ( - renderer: WebGLRenderer, - scene: Scene, - camera: Camera, - geometry: Geometry | BufferGeometry, - material: Material, - group: Group - ) => void; - - /** - * Calls after rendering object - */ - onAfterRender: ( - renderer: WebGLRenderer, - scene: Scene, - camera: Camera, - geometry: Geometry | BufferGeometry, - material: Material, - group: Group - ) => void; - - static DefaultUp: Vector3; - static DefaultMatrixAutoUpdate: boolean; - - /** - * This updates the position, rotation and scale with the matrix. - */ - applyMatrix( matrix: Matrix4 ): void; - - applyQuaternion( quaternion: Quaternion ): this; - - /** - * - */ - setRotationFromAxisAngle( axis: Vector3, angle: number ): void; - - /** - * - */ - setRotationFromEuler( euler: Euler ): void; - - /** - * - */ - setRotationFromMatrix( m: Matrix4 ): void; - - /** - * - */ - setRotationFromQuaternion( q: Quaternion ): void; - - /** - * Rotate an object along an axis in object space. The axis is assumed to be normalized. - * @param axis A normalized vector in object space. - * @param angle The angle in radians. - */ - rotateOnAxis( axis: Vector3, angle: number ): this; - - /** - * Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent. - * @param axis A normalized vector in object space. - * @param angle The angle in radians. - */ - rotateOnWorldAxis( axis: Vector3, angle: number ): this; - - /** - * - * @param angle - */ - rotateX( angle: number ): this; - - /** - * - * @param angle - */ - rotateY( angle: number ): this; - - /** - * - * @param angle - */ - rotateZ( angle: number ): this; - - /** - * @param axis A normalized vector in object space. - * @param distance The distance to translate. - */ - translateOnAxis( axis: Vector3, distance: number ): this; - - /** - * Translates object along x axis by distance. - * @param distance Distance. - */ - translateX( distance: number ): this; - - /** - * Translates object along y axis by distance. - * @param distance Distance. - */ - translateY( distance: number ): this; - - /** - * Translates object along z axis by distance. - * @param distance Distance. - */ - translateZ( distance: number ): this; - - /** - * Updates the vector from local space to world space. - * @param vector A local vector. - */ - localToWorld( vector: Vector3 ): Vector3; - - /** - * Updates the vector from world space to local space. - * @param vector A world vector. - */ - worldToLocal( vector: Vector3 ): Vector3; - - /** - * Rotates object to face point in space. - * @param vector A world vector to look at. - */ - lookAt( vector: Vector3 | number, y?: number, z?: number ): void; - - /** - * Adds object as child of this object. - */ - add( ...object: Object3D[] ): this; - - /** - * Removes object as child of this object. - */ - remove( ...object: Object3D[] ): this; - - /** - * Adds object as a child of this, while maintaining the object's world transform. - */ - attach( object: Object3D ): this; - - /** - * Searches through the object's children and returns the first with a matching id. - * @param id Unique number of the object instance - */ - getObjectById( id: number ): Object3D | undefined; - - /** - * Searches through the object's children and returns the first with a matching name. - * @param name String to match to the children's Object3d.name property. - */ - getObjectByName( name: string ): Object3D | undefined; - - getObjectByProperty( name: string, value: string ): Object3D | undefined; - - getWorldPosition( target: Vector3 ): Vector3; - getWorldQuaternion( target: Quaternion ): Quaternion; - getWorldScale( target: Vector3 ): Vector3; - getWorldDirection( target: Vector3 ): Vector3; - - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - - traverse( callback: ( object: Object3D ) => any ): void; - - traverseVisible( callback: ( object: Object3D ) => any ): void; - - traverseAncestors( callback: ( object: Object3D ) => any ): void; - - /** - * Updates local transform. - */ - updateMatrix(): void; - - /** - * Updates global transform of the object and its children. - */ - updateMatrixWorld( force?: boolean ): void; - - updateWorldMatrix( updateParents: boolean, updateChildren: boolean ): void; - - toJSON( meta?: { - geometries: any; - materials: any; - textures: any; - images: any; - } ): any; - - clone( recursive?: boolean ): this; - - /** - * - * @param object - * @param recursive - */ - copy( source: this, recursive?: boolean ): this; - -} diff --git a/cases/esbuild-three/src/base/core/Object3D.js b/cases/esbuild-three/src/base/core/Object3D.js deleted file mode 100644 index 74502b7722..0000000000 --- a/cases/esbuild-three/src/base/core/Object3D.js +++ /dev/null @@ -1,858 +0,0 @@ -import { Quaternion } from '../math/Quaternion.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { EventDispatcher } from './EventDispatcher.js'; -import { Euler } from '../math/Euler.js'; -import { Layers } from './Layers.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { _Math } from '../math/Math.js'; -import { TrianglesDrawMode } from '../constants.js'; - -var _object3DId = 0; - -var _v1 = new Vector3(); -var _q1 = new Quaternion(); -var _m1 = new Matrix4(); -var _target = new Vector3(); - -var _position = new Vector3(); -var _scale = new Vector3(); -var _quaternion = new Quaternion(); - -var _xAxis = new Vector3( 1, 0, 0 ); -var _yAxis = new Vector3( 0, 1, 0 ); -var _zAxis = new Vector3( 0, 0, 1 ); - -var _addedEvent = { type: 'added' }; -var _removedEvent = { type: 'removed' }; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author elephantatwork / www.elephantatwork.ch - */ - -function Object3D() { - - Object.defineProperty( this, 'id', { value: _object3DId ++ } ); - - this.uuid = _Math.generateUUID(); - - this.name = ''; - this.type = 'Object3D'; - - this.parent = null; - this.children = []; - - this.up = Object3D.DefaultUp.clone(); - - var position = new Vector3(); - var rotation = new Euler(); - var quaternion = new Quaternion(); - var scale = new Vector3( 1, 1, 1 ); - - function onRotationChange() { - - quaternion.setFromEuler( rotation, false ); - - } - - function onQuaternionChange() { - - rotation.setFromQuaternion( quaternion, undefined, false ); - - } - - rotation._onChange( onRotationChange ); - quaternion._onChange( onQuaternionChange ); - - Object.defineProperties( this, { - position: { - configurable: true, - enumerable: true, - value: position - }, - rotation: { - configurable: true, - enumerable: true, - value: rotation - }, - quaternion: { - configurable: true, - enumerable: true, - value: quaternion - }, - scale: { - configurable: true, - enumerable: true, - value: scale - }, - modelViewMatrix: { - value: new Matrix4() - }, - normalMatrix: { - value: new Matrix3() - } - } ); - - this.matrix = new Matrix4(); - this.matrixWorld = new Matrix4(); - - this.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate; - this.matrixWorldNeedsUpdate = false; - - this.layers = new Layers(); - this.visible = true; - - this.castShadow = false; - this.receiveShadow = false; - - this.frustumCulled = true; - this.renderOrder = 0; - - this.userData = {}; - -} - -Object3D.DefaultUp = new Vector3( 0, 1, 0 ); -Object3D.DefaultMatrixAutoUpdate = true; - -Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: Object3D, - - isObject3D: true, - - onBeforeRender: function () {}, - onAfterRender: function () {}, - - applyMatrix: function ( matrix ) { - - if ( this.matrixAutoUpdate ) this.updateMatrix(); - - this.matrix.premultiply( matrix ); - - this.matrix.decompose( this.position, this.quaternion, this.scale ); - - }, - - applyQuaternion: function ( q ) { - - this.quaternion.premultiply( q ); - - return this; - - }, - - setRotationFromAxisAngle: function ( axis, angle ) { - - // assumes axis is normalized - - this.quaternion.setFromAxisAngle( axis, angle ); - - }, - - setRotationFromEuler: function ( euler ) { - - this.quaternion.setFromEuler( euler, true ); - - }, - - setRotationFromMatrix: function ( m ) { - - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - - this.quaternion.setFromRotationMatrix( m ); - - }, - - setRotationFromQuaternion: function ( q ) { - - // assumes q is normalized - - this.quaternion.copy( q ); - - }, - - rotateOnAxis: function ( axis, angle ) { - - // rotate object on axis in object space - // axis is assumed to be normalized - - _q1.setFromAxisAngle( axis, angle ); - - this.quaternion.multiply( _q1 ); - - return this; - - }, - - rotateOnWorldAxis: function ( axis, angle ) { - - // rotate object on axis in world space - // axis is assumed to be normalized - // method assumes no rotated parent - - _q1.setFromAxisAngle( axis, angle ); - - this.quaternion.premultiply( _q1 ); - - return this; - - }, - - rotateX: function ( angle ) { - - return this.rotateOnAxis( _xAxis, angle ); - - }, - - rotateY: function ( angle ) { - - return this.rotateOnAxis( _yAxis, angle ); - - }, - - rotateZ: function ( angle ) { - - return this.rotateOnAxis( _zAxis, angle ); - - }, - - translateOnAxis: function ( axis, distance ) { - - // translate object by distance along axis in object space - // axis is assumed to be normalized - - _v1.copy( axis ).applyQuaternion( this.quaternion ); - - this.position.add( _v1.multiplyScalar( distance ) ); - - return this; - - }, - - translateX: function ( distance ) { - - return this.translateOnAxis( _xAxis, distance ); - - }, - - translateY: function ( distance ) { - - return this.translateOnAxis( _yAxis, distance ); - - }, - - translateZ: function ( distance ) { - - return this.translateOnAxis( _zAxis, distance ); - - }, - - localToWorld: function ( vector ) { - - return vector.applyMatrix4( this.matrixWorld ); - - }, - - worldToLocal: function ( vector ) { - - return vector.applyMatrix4( _m1.getInverse( this.matrixWorld ) ); - - }, - - lookAt: function ( x, y, z ) { - - // This method does not support objects having non-uniformly-scaled parent(s) - - if ( x.isVector3 ) { - - _target.copy( x ); - - } else { - - _target.set( x, y, z ); - - } - - var parent = this.parent; - - this.updateWorldMatrix( true, false ); - - _position.setFromMatrixPosition( this.matrixWorld ); - - if ( this.isCamera || this.isLight ) { - - _m1.lookAt( _position, _target, this.up ); - - } else { - - _m1.lookAt( _target, _position, this.up ); - - } - - this.quaternion.setFromRotationMatrix( _m1 ); - - if ( parent ) { - - _m1.extractRotation( parent.matrixWorld ); - _q1.setFromRotationMatrix( _m1 ); - this.quaternion.premultiply( _q1.inverse() ); - - } - - }, - - add: function ( object ) { - - if ( arguments.length > 1 ) { - - for ( var i = 0; i < arguments.length; i ++ ) { - - this.add( arguments[ i ] ); - - } - - return this; - - } - - if ( object === this ) { - - console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object ); - return this; - - } - - if ( ( object && object.isObject3D ) ) { - - if ( object.parent !== null ) { - - object.parent.remove( object ); - - } - - object.parent = this; - this.children.push( object ); - - object.dispatchEvent( _addedEvent ); - - } else { - - console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object ); - - } - - return this; - - }, - - remove: function ( object ) { - - if ( arguments.length > 1 ) { - - for ( var i = 0; i < arguments.length; i ++ ) { - - this.remove( arguments[ i ] ); - - } - - return this; - - } - - var index = this.children.indexOf( object ); - - if ( index !== - 1 ) { - - object.parent = null; - this.children.splice( index, 1 ); - - object.dispatchEvent( _removedEvent ); - - } - - return this; - - }, - - attach: function ( object ) { - - // adds object as a child of this, while maintaining the object's world transform - - this.updateWorldMatrix( true, false ); - - _m1.getInverse( this.matrixWorld ); - - if ( object.parent !== null ) { - - object.parent.updateWorldMatrix( true, false ); - - _m1.multiply( object.parent.matrixWorld ); - - } - - object.applyMatrix( _m1 ); - - object.updateWorldMatrix( false, false ); - - this.add( object ); - - return this; - - }, - - getObjectById: function ( id ) { - - return this.getObjectByProperty( 'id', id ); - - }, - - getObjectByName: function ( name ) { - - return this.getObjectByProperty( 'name', name ); - - }, - - getObjectByProperty: function ( name, value ) { - - if ( this[ name ] === value ) return this; - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - var child = this.children[ i ]; - var object = child.getObjectByProperty( name, value ); - - if ( object !== undefined ) { - - return object; - - } - - } - - return undefined; - - }, - - getWorldPosition: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Object3D: .getWorldPosition() target is now required' ); - target = new Vector3(); - - } - - this.updateMatrixWorld( true ); - - return target.setFromMatrixPosition( this.matrixWorld ); - - }, - - getWorldQuaternion: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); - target = new Quaternion(); - - } - - this.updateMatrixWorld( true ); - - this.matrixWorld.decompose( _position, target, _scale ); - - return target; - - }, - - getWorldScale: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); - target = new Vector3(); - - } - - this.updateMatrixWorld( true ); - - this.matrixWorld.decompose( _position, _quaternion, target ); - - return target; - - }, - - getWorldDirection: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' ); - target = new Vector3(); - - } - - this.updateMatrixWorld( true ); - - var e = this.matrixWorld.elements; - - return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize(); - - }, - - raycast: function () {}, - - traverse: function ( callback ) { - - callback( this ); - - var children = this.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].traverse( callback ); - - } - - }, - - traverseVisible: function ( callback ) { - - if ( this.visible === false ) return; - - callback( this ); - - var children = this.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].traverseVisible( callback ); - - } - - }, - - traverseAncestors: function ( callback ) { - - var parent = this.parent; - - if ( parent !== null ) { - - callback( parent ); - - parent.traverseAncestors( callback ); - - } - - }, - - updateMatrix: function () { - - this.matrix.compose( this.position, this.quaternion, this.scale ); - - this.matrixWorldNeedsUpdate = true; - - }, - - updateMatrixWorld: function ( force ) { - - if ( this.matrixAutoUpdate ) this.updateMatrix(); - - if ( this.matrixWorldNeedsUpdate || force ) { - - if ( this.parent === null ) { - - this.matrixWorld.copy( this.matrix ); - - } else { - - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - - } - - this.matrixWorldNeedsUpdate = false; - - force = true; - - } - - // update children - - var children = this.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateMatrixWorld( force ); - - } - - }, - - updateWorldMatrix: function ( updateParents, updateChildren ) { - - var parent = this.parent; - - if ( updateParents === true && parent !== null ) { - - parent.updateWorldMatrix( true, false ); - - } - - if ( this.matrixAutoUpdate ) this.updateMatrix(); - - if ( this.parent === null ) { - - this.matrixWorld.copy( this.matrix ); - - } else { - - this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix ); - - } - - // update children - - if ( updateChildren === true ) { - - var children = this.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateWorldMatrix( false, true ); - - } - - } - - }, - - toJSON: function ( meta ) { - - // meta is a string when called from JSON.stringify - var isRootObject = ( meta === undefined || typeof meta === 'string' ); - - var output = {}; - - // meta is a hash used to collect geometries, materials. - // not providing it implies that this is the root object - // being serialized. - if ( isRootObject ) { - - // initialize meta obj - meta = { - geometries: {}, - materials: {}, - textures: {}, - images: {}, - shapes: {} - }; - - output.metadata = { - version: 4.5, - type: 'Object', - generator: 'Object3D.toJSON' - }; - - } - - // standard Object3D serialization - - var object = {}; - - object.uuid = this.uuid; - object.type = this.type; - - if ( this.name !== '' ) object.name = this.name; - if ( this.castShadow === true ) object.castShadow = true; - if ( this.receiveShadow === true ) object.receiveShadow = true; - if ( this.visible === false ) object.visible = false; - if ( this.frustumCulled === false ) object.frustumCulled = false; - if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder; - if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData; - - object.layers = this.layers.mask; - object.matrix = this.matrix.toArray(); - - if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false; - - // object specific properties - - if ( this.isMesh && this.drawMode !== TrianglesDrawMode ) object.drawMode = this.drawMode; - - // - - function serialize( library, element ) { - - if ( library[ element.uuid ] === undefined ) { - - library[ element.uuid ] = element.toJSON( meta ); - - } - - return element.uuid; - - } - - if ( this.isMesh || this.isLine || this.isPoints ) { - - object.geometry = serialize( meta.geometries, this.geometry ); - - var parameters = this.geometry.parameters; - - if ( parameters !== undefined && parameters.shapes !== undefined ) { - - var shapes = parameters.shapes; - - if ( Array.isArray( shapes ) ) { - - for ( var i = 0, l = shapes.length; i < l; i ++ ) { - - var shape = shapes[ i ]; - - serialize( meta.shapes, shape ); - - } - - } else { - - serialize( meta.shapes, shapes ); - - } - - } - - } - - if ( this.material !== undefined ) { - - if ( Array.isArray( this.material ) ) { - - var uuids = []; - - for ( var i = 0, l = this.material.length; i < l; i ++ ) { - - uuids.push( serialize( meta.materials, this.material[ i ] ) ); - - } - - object.material = uuids; - - } else { - - object.material = serialize( meta.materials, this.material ); - - } - - } - - // - - if ( this.children.length > 0 ) { - - object.children = []; - - for ( var i = 0; i < this.children.length; i ++ ) { - - object.children.push( this.children[ i ].toJSON( meta ).object ); - - } - - } - - if ( isRootObject ) { - - var geometries = extractFromCache( meta.geometries ); - var materials = extractFromCache( meta.materials ); - var textures = extractFromCache( meta.textures ); - var images = extractFromCache( meta.images ); - var shapes = extractFromCache( meta.shapes ); - - if ( geometries.length > 0 ) output.geometries = geometries; - if ( materials.length > 0 ) output.materials = materials; - if ( textures.length > 0 ) output.textures = textures; - if ( images.length > 0 ) output.images = images; - if ( shapes.length > 0 ) output.shapes = shapes; - - } - - output.object = object; - - return output; - - // extract data from the cache hash - // remove metadata on each item - // and return as array - function extractFromCache( cache ) { - - var values = []; - for ( var key in cache ) { - - var data = cache[ key ]; - delete data.metadata; - values.push( data ); - - } - return values; - - } - - }, - - clone: function ( recursive ) { - - return new this.constructor().copy( this, recursive ); - - }, - - copy: function ( source, recursive ) { - - if ( recursive === undefined ) recursive = true; - - this.name = source.name; - - this.up.copy( source.up ); - - this.position.copy( source.position ); - this.quaternion.copy( source.quaternion ); - this.scale.copy( source.scale ); - - this.matrix.copy( source.matrix ); - this.matrixWorld.copy( source.matrixWorld ); - - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - - this.layers.mask = source.layers.mask; - this.visible = source.visible; - - this.castShadow = source.castShadow; - this.receiveShadow = source.receiveShadow; - - this.frustumCulled = source.frustumCulled; - this.renderOrder = source.renderOrder; - - this.userData = JSON.parse( JSON.stringify( source.userData ) ); - - if ( recursive === true ) { - - for ( var i = 0; i < source.children.length; i ++ ) { - - var child = source.children[ i ]; - this.add( child.clone() ); - - } - - } - - return this; - - } - -} ); - - -export { Object3D }; diff --git a/cases/esbuild-three/src/base/core/Raycaster.d.ts b/cases/esbuild-three/src/base/core/Raycaster.d.ts deleted file mode 100644 index 483f7237f5..0000000000 --- a/cases/esbuild-three/src/base/core/Raycaster.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Face3 } from './Face3'; -import { Object3D } from './Object3D'; -import { Vector2 } from './../math/Vector2'; -import { Ray } from './../math/Ray'; -import { Camera } from './../cameras/Camera'; - -export interface Intersection { - distance: number; - distanceToRay?: number; - point: Vector3; - index?: number; - face?: Face3 | null; - faceIndex?: number; - object: Object3D; - uv?: Vector2; -} - -export interface RaycasterParameters { - Mesh?: any; - Line?: any; - LOD?: any; - Points?: { threshold: number }; - Sprite?: any; -} - -export class Raycaster { - - /** - * This creates a new raycaster object. - * @param origin The origin vector where the ray casts from. - * @param direction The direction vector that gives direction to the ray. Should be normalized. - * @param near All results returned are further away than near. Near can't be negative. Default value is 0. - * @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity. - */ - constructor( - origin?: Vector3, - direction?: Vector3, - near?: number, - far?: number - ); - - /** The Ray used for the raycasting. */ - ray: Ray; - - /** - * The near factor of the raycaster. This value indicates which objects can be discarded based on the - * distance. This value shouldn't be negative and should be smaller than the far property. - */ - near: number; - - /** - * The far factor of the raycaster. This value indicates which objects can be discarded based on the - * distance. This value shouldn't be negative and should be larger than the near property. - */ - far: number; - - /** - * The camera to use when raycasting against view-dependent objects such as billboarded objects like Sprites. This field - * can be set manually or is set when calling "setFromCamera". - */ - camera: Camera; - - params: RaycasterParameters; - - /** - * The precision factor of the raycaster when intersecting Line objects. - */ - linePrecision: number; - - /** - * Updates the ray with a new origin and direction. - * @param origin The origin vector where the ray casts from. - * @param direction The normalized direction vector that gives direction to the ray. - */ - set( origin: Vector3, direction: Vector3 ): void; - - /** - * Updates the ray with a new origin and direction. - * @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1. - * @param camera camera from which the ray should originate - */ - setFromCamera( coords: { x: number; y: number }, camera: Camera ): void; - - /** - * Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. - * @param object The object to check for intersection with the ray. - * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false. - * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). - */ - intersectObject( - object: Object3D, - recursive?: boolean, - optionalTarget?: Intersection[] - ): Intersection[]; - - /** - * Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject. - * @param objects The objects to check for intersection with the ray. - * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false. - * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). - */ - intersectObjects( - objects: Object3D[], - recursive?: boolean, - optionalTarget?: Intersection[] - ): Intersection[]; - -} diff --git a/cases/esbuild-three/src/base/core/Raycaster.js b/cases/esbuild-three/src/base/core/Raycaster.js deleted file mode 100644 index 926884f245..0000000000 --- a/cases/esbuild-three/src/base/core/Raycaster.js +++ /dev/null @@ -1,137 +0,0 @@ -import { Ray } from '../math/Ray.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author bhouston / http://clara.io/ - * @author stephomi / http://stephaneginier.com/ - */ - -function Raycaster( origin, direction, near, far ) { - - this.ray = new Ray( origin, direction ); - // direction is assumed to be normalized (for accurate distance calculations) - - this.near = near || 0; - this.far = far || Infinity; - this.camera = null; - - this.params = { - Mesh: {}, - Line: {}, - LOD: {}, - Points: { threshold: 1 }, - Sprite: {} - }; - - Object.defineProperties( this.params, { - PointCloud: { - get: function () { - - console.warn( 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.' ); - return this.Points; - - } - } - } ); - -} - -function ascSort( a, b ) { - - return a.distance - b.distance; - -} - -function intersectObject( object, raycaster, intersects, recursive ) { - - if ( object.visible === false ) return; - - object.raycast( raycaster, intersects ); - - if ( recursive === true ) { - - var children = object.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - intersectObject( children[ i ], raycaster, intersects, true ); - - } - - } - -} - -Object.assign( Raycaster.prototype, { - - linePrecision: 1, - - set: function ( origin, direction ) { - - // direction is assumed to be normalized (for accurate distance calculations) - - this.ray.set( origin, direction ); - - }, - - setFromCamera: function ( coords, camera ) { - - if ( ( camera && camera.isPerspectiveCamera ) ) { - - this.ray.origin.setFromMatrixPosition( camera.matrixWorld ); - this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize(); - this.camera = camera; - - } else if ( ( camera && camera.isOrthographicCamera ) ) { - - this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera - this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); - this.camera = camera; - - } else { - - console.error( 'THREE.Raycaster: Unsupported camera type.' ); - - } - - }, - - intersectObject: function ( object, recursive, optionalTarget ) { - - var intersects = optionalTarget || []; - - intersectObject( object, this, intersects, recursive ); - - intersects.sort( ascSort ); - - return intersects; - - }, - - intersectObjects: function ( objects, recursive, optionalTarget ) { - - var intersects = optionalTarget || []; - - if ( Array.isArray( objects ) === false ) { - - console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' ); - return intersects; - - } - - for ( var i = 0, l = objects.length; i < l; i ++ ) { - - intersectObject( objects[ i ], this, intersects, recursive ); - - } - - intersects.sort( ascSort ); - - return intersects; - - } - -} ); - - -export { Raycaster }; diff --git a/cases/esbuild-three/src/base/core/Uniform.d.ts b/cases/esbuild-three/src/base/core/Uniform.d.ts deleted file mode 100644 index b890fd65a5..0000000000 --- a/cases/esbuild-three/src/base/core/Uniform.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export class Uniform { - - constructor( value: any ); - /** - * @deprecated - */ - constructor( type: string, value: any ); - /** - * @deprecated - */ - type: string; - value: any; - /** - * @deprecated Use {@link Object3D#onBeforeRender object.onBeforeRender()} instead. - */ - dynamic: boolean; - onUpdateCallback: Function; - - /** - * @deprecated Use {@link Object3D#onBeforeRender object.onBeforeRender()} instead. - */ - onUpdate( callback: Function ): Uniform; - -} diff --git a/cases/esbuild-three/src/base/core/Uniform.js b/cases/esbuild-three/src/base/core/Uniform.js deleted file mode 100644 index 8c53319d5b..0000000000 --- a/cases/esbuild-three/src/base/core/Uniform.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function Uniform( value ) { - - if ( typeof value === 'string' ) { - - console.warn( 'THREE.Uniform: Type parameter is no longer needed.' ); - value = arguments[ 1 ]; - - } - - this.value = value; - -} - -Uniform.prototype.clone = function () { - - return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() ); - -}; - -export { Uniform }; diff --git a/cases/esbuild-three/src/base/extras/Earcut.js b/cases/esbuild-three/src/base/extras/Earcut.js deleted file mode 100644 index c2e2ff0bfc..0000000000 --- a/cases/esbuild-three/src/base/extras/Earcut.js +++ /dev/null @@ -1,760 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - * Port from https://github.com/mapbox/earcut (v2.1.5) - */ - -var Earcut = { - - triangulate: function ( data, holeIndices, dim ) { - - dim = dim || 2; - - var hasHoles = holeIndices && holeIndices.length, - outerLen = hasHoles ? holeIndices[ 0 ] * dim : data.length, - outerNode = linkedList( data, 0, outerLen, dim, true ), - triangles = []; - - if ( ! outerNode || outerNode.next === outerNode.prev ) return triangles; - - var minX, minY, maxX, maxY, x, y, invSize; - - if ( hasHoles ) outerNode = eliminateHoles( data, holeIndices, outerNode, dim ); - - // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox - if ( data.length > 80 * dim ) { - - minX = maxX = data[ 0 ]; - minY = maxY = data[ 1 ]; - - for ( var i = dim; i < outerLen; i += dim ) { - - x = data[ i ]; - y = data[ i + 1 ]; - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - - } - - // minX, minY and invSize are later used to transform coords into integers for z-order calculation - invSize = Math.max( maxX - minX, maxY - minY ); - invSize = invSize !== 0 ? 1 / invSize : 0; - - } - - earcutLinked( outerNode, triangles, dim, minX, minY, invSize ); - - return triangles; - - } - -}; - -// create a circular doubly linked list from polygon points in the specified winding order -function linkedList( data, start, end, dim, clockwise ) { - - var i, last; - - if ( clockwise === ( signedArea( data, start, end, dim ) > 0 ) ) { - - for ( i = start; i < end; i += dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); - - } else { - - for ( i = end - dim; i >= start; i -= dim ) last = insertNode( i, data[ i ], data[ i + 1 ], last ); - - } - - if ( last && equals( last, last.next ) ) { - - removeNode( last ); - last = last.next; - - } - - return last; - -} - -// eliminate colinear or duplicate points -function filterPoints( start, end ) { - - if ( ! start ) return start; - if ( ! end ) end = start; - - var p = start, - again; - do { - - again = false; - - if ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) { - - removeNode( p ); - p = end = p.prev; - if ( p === p.next ) break; - again = true; - - } else { - - p = p.next; - - } - - } while ( again || p !== end ); - - return end; - -} - -// main ear slicing loop which triangulates a polygon (given as a linked list) -function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) { - - if ( ! ear ) return; - - // interlink polygon nodes in z-order - if ( ! pass && invSize ) indexCurve( ear, minX, minY, invSize ); - - var stop = ear, - prev, next; - - // iterate through ears, slicing them one by one - while ( ear.prev !== ear.next ) { - - prev = ear.prev; - next = ear.next; - - if ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) { - - // cut off the triangle - triangles.push( prev.i / dim ); - triangles.push( ear.i / dim ); - triangles.push( next.i / dim ); - - removeNode( ear ); - - // skipping the next vertex leads to less sliver triangles - ear = next.next; - stop = next.next; - - continue; - - } - - ear = next; - - // if we looped through the whole remaining polygon and can't find any more ears - if ( ear === stop ) { - - // try filtering points and slicing again - if ( ! pass ) { - - earcutLinked( filterPoints( ear ), triangles, dim, minX, minY, invSize, 1 ); - - // if this didn't work, try curing all small self-intersections locally - - } else if ( pass === 1 ) { - - ear = cureLocalIntersections( ear, triangles, dim ); - earcutLinked( ear, triangles, dim, minX, minY, invSize, 2 ); - - // as a last resort, try splitting the remaining polygon into two - - } else if ( pass === 2 ) { - - splitEarcut( ear, triangles, dim, minX, minY, invSize ); - - } - - break; - - } - - } - -} - -// check whether a polygon node forms a valid ear with adjacent nodes -function isEar( ear ) { - - var a = ear.prev, - b = ear, - c = ear.next; - - if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear - - // now make sure we don't have other points inside the potential ear - var p = ear.next.next; - - while ( p !== ear.prev ) { - - if ( pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && - area( p.prev, p, p.next ) >= 0 ) return false; - p = p.next; - - } - - return true; - -} - -function isEarHashed( ear, minX, minY, invSize ) { - - var a = ear.prev, - b = ear, - c = ear.next; - - if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear - - // triangle bbox; min & max are calculated like this for speed - var minTX = a.x < b.x ? ( a.x < c.x ? a.x : c.x ) : ( b.x < c.x ? b.x : c.x ), - minTY = a.y < b.y ? ( a.y < c.y ? a.y : c.y ) : ( b.y < c.y ? b.y : c.y ), - maxTX = a.x > b.x ? ( a.x > c.x ? a.x : c.x ) : ( b.x > c.x ? b.x : c.x ), - maxTY = a.y > b.y ? ( a.y > c.y ? a.y : c.y ) : ( b.y > c.y ? b.y : c.y ); - - // z-order range for the current triangle bbox; - var minZ = zOrder( minTX, minTY, minX, minY, invSize ), - maxZ = zOrder( maxTX, maxTY, minX, minY, invSize ); - - var p = ear.prevZ, - n = ear.nextZ; - - // look for points inside the triangle in both directions - while ( p && p.z >= minZ && n && n.z <= maxZ ) { - - if ( p !== ear.prev && p !== ear.next && - pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && - area( p.prev, p, p.next ) >= 0 ) return false; - p = p.prevZ; - - if ( n !== ear.prev && n !== ear.next && - pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) && - area( n.prev, n, n.next ) >= 0 ) return false; - n = n.nextZ; - - } - - // look for remaining points in decreasing z-order - while ( p && p.z >= minZ ) { - - if ( p !== ear.prev && p !== ear.next && - pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) && - area( p.prev, p, p.next ) >= 0 ) return false; - p = p.prevZ; - - } - - // look for remaining points in increasing z-order - while ( n && n.z <= maxZ ) { - - if ( n !== ear.prev && n !== ear.next && - pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) && - area( n.prev, n, n.next ) >= 0 ) return false; - n = n.nextZ; - - } - - return true; - -} - -// go through all polygon nodes and cure small local self-intersections -function cureLocalIntersections( start, triangles, dim ) { - - var p = start; - do { - - var a = p.prev, - b = p.next.next; - - if ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) { - - triangles.push( a.i / dim ); - triangles.push( p.i / dim ); - triangles.push( b.i / dim ); - - // remove two nodes involved - removeNode( p ); - removeNode( p.next ); - - p = start = b; - - } - - p = p.next; - - } while ( p !== start ); - - return p; - -} - -// try splitting polygon into two and triangulate them independently -function splitEarcut( start, triangles, dim, minX, minY, invSize ) { - - // look for a valid diagonal that divides the polygon into two - var a = start; - do { - - var b = a.next.next; - while ( b !== a.prev ) { - - if ( a.i !== b.i && isValidDiagonal( a, b ) ) { - - // split the polygon in two by the diagonal - var c = splitPolygon( a, b ); - - // filter colinear points around the cuts - a = filterPoints( a, a.next ); - c = filterPoints( c, c.next ); - - // run earcut on each half - earcutLinked( a, triangles, dim, minX, minY, invSize ); - earcutLinked( c, triangles, dim, minX, minY, invSize ); - return; - - } - - b = b.next; - - } - - a = a.next; - - } while ( a !== start ); - -} - -// link every hole into the outer loop, producing a single-ring polygon without holes -function eliminateHoles( data, holeIndices, outerNode, dim ) { - - var queue = [], - i, len, start, end, list; - - for ( i = 0, len = holeIndices.length; i < len; i ++ ) { - - start = holeIndices[ i ] * dim; - end = i < len - 1 ? holeIndices[ i + 1 ] * dim : data.length; - list = linkedList( data, start, end, dim, false ); - if ( list === list.next ) list.steiner = true; - queue.push( getLeftmost( list ) ); - - } - - queue.sort( compareX ); - - // process holes from left to right - for ( i = 0; i < queue.length; i ++ ) { - - eliminateHole( queue[ i ], outerNode ); - outerNode = filterPoints( outerNode, outerNode.next ); - - } - - return outerNode; - -} - -function compareX( a, b ) { - - return a.x - b.x; - -} - -// find a bridge between vertices that connects hole with an outer ring and and link it -function eliminateHole( hole, outerNode ) { - - outerNode = findHoleBridge( hole, outerNode ); - if ( outerNode ) { - - var b = splitPolygon( outerNode, hole ); - filterPoints( b, b.next ); - - } - -} - -// David Eberly's algorithm for finding a bridge between hole and outer polygon -function findHoleBridge( hole, outerNode ) { - - var p = outerNode, - hx = hole.x, - hy = hole.y, - qx = - Infinity, - m; - - // find a segment intersected by a ray from the hole's leftmost point to the left; - // segment's endpoint with lesser x will be potential connection point - do { - - if ( hy <= p.y && hy >= p.next.y && p.next.y !== p.y ) { - - var x = p.x + ( hy - p.y ) * ( p.next.x - p.x ) / ( p.next.y - p.y ); - if ( x <= hx && x > qx ) { - - qx = x; - if ( x === hx ) { - - if ( hy === p.y ) return p; - if ( hy === p.next.y ) return p.next; - - } - - m = p.x < p.next.x ? p : p.next; - - } - - } - - p = p.next; - - } while ( p !== outerNode ); - - if ( ! m ) return null; - - if ( hx === qx ) return m.prev; // hole touches outer segment; pick lower endpoint - - // look for points inside the triangle of hole point, segment intersection and endpoint; - // if there are no points found, we have a valid connection; - // otherwise choose the point of the minimum angle with the ray as connection point - - var stop = m, - mx = m.x, - my = m.y, - tanMin = Infinity, - tan; - - p = m.next; - - while ( p !== stop ) { - - if ( hx >= p.x && p.x >= mx && hx !== p.x && - pointInTriangle( hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y ) ) { - - tan = Math.abs( hy - p.y ) / ( hx - p.x ); // tangential - - if ( ( tan < tanMin || ( tan === tanMin && p.x > m.x ) ) && locallyInside( p, hole ) ) { - - m = p; - tanMin = tan; - - } - - } - - p = p.next; - - } - - return m; - -} - -// interlink polygon nodes in z-order -function indexCurve( start, minX, minY, invSize ) { - - var p = start; - do { - - if ( p.z === null ) p.z = zOrder( p.x, p.y, minX, minY, invSize ); - p.prevZ = p.prev; - p.nextZ = p.next; - p = p.next; - - } while ( p !== start ); - - p.prevZ.nextZ = null; - p.prevZ = null; - - sortLinked( p ); - -} - -// Simon Tatham's linked list merge sort algorithm -// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html -function sortLinked( list ) { - - var i, p, q, e, tail, numMerges, pSize, qSize, - inSize = 1; - - do { - - p = list; - list = null; - tail = null; - numMerges = 0; - - while ( p ) { - - numMerges ++; - q = p; - pSize = 0; - for ( i = 0; i < inSize; i ++ ) { - - pSize ++; - q = q.nextZ; - if ( ! q ) break; - - } - - qSize = inSize; - - while ( pSize > 0 || ( qSize > 0 && q ) ) { - - if ( pSize !== 0 && ( qSize === 0 || ! q || p.z <= q.z ) ) { - - e = p; - p = p.nextZ; - pSize --; - - } else { - - e = q; - q = q.nextZ; - qSize --; - - } - - if ( tail ) tail.nextZ = e; - else list = e; - - e.prevZ = tail; - tail = e; - - } - - p = q; - - } - - tail.nextZ = null; - inSize *= 2; - - } while ( numMerges > 1 ); - - return list; - -} - -// z-order of a point given coords and inverse of the longer side of data bbox -function zOrder( x, y, minX, minY, invSize ) { - - // coords are transformed into non-negative 15-bit integer range - x = 32767 * ( x - minX ) * invSize; - y = 32767 * ( y - minY ) * invSize; - - x = ( x | ( x << 8 ) ) & 0x00FF00FF; - x = ( x | ( x << 4 ) ) & 0x0F0F0F0F; - x = ( x | ( x << 2 ) ) & 0x33333333; - x = ( x | ( x << 1 ) ) & 0x55555555; - - y = ( y | ( y << 8 ) ) & 0x00FF00FF; - y = ( y | ( y << 4 ) ) & 0x0F0F0F0F; - y = ( y | ( y << 2 ) ) & 0x33333333; - y = ( y | ( y << 1 ) ) & 0x55555555; - - return x | ( y << 1 ); - -} - -// find the leftmost node of a polygon ring -function getLeftmost( start ) { - - var p = start, - leftmost = start; - do { - - if ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p; - p = p.next; - - } while ( p !== start ); - - return leftmost; - -} - -// check if a point lies within a convex triangle -function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) { - - return ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 && - ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 && - ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0; - -} - -// check if a diagonal between two polygon nodes is valid (lies in polygon interior) -function isValidDiagonal( a, b ) { - - return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && - locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ); - -} - -// signed area of a triangle -function area( p, q, r ) { - - return ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y ); - -} - -// check if two points are equal -function equals( p1, p2 ) { - - return p1.x === p2.x && p1.y === p2.y; - -} - -// check if two segments intersect -function intersects( p1, q1, p2, q2 ) { - - if ( ( equals( p1, p2 ) && equals( q1, q2 ) ) || - ( equals( p1, q2 ) && equals( p2, q1 ) ) ) return true; - return area( p1, q1, p2 ) > 0 !== area( p1, q1, q2 ) > 0 && - area( p2, q2, p1 ) > 0 !== area( p2, q2, q1 ) > 0; - -} - -// check if a polygon diagonal intersects any polygon segments -function intersectsPolygon( a, b ) { - - var p = a; - do { - - if ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && - intersects( p, p.next, a, b ) ) return true; - p = p.next; - - } while ( p !== a ); - - return false; - -} - -// check if a polygon diagonal is locally inside the polygon -function locallyInside( a, b ) { - - return area( a.prev, a, a.next ) < 0 ? - area( a, b, a.next ) >= 0 && area( a, a.prev, b ) >= 0 : - area( a, b, a.prev ) < 0 || area( a, a.next, b ) < 0; - -} - -// check if the middle point of a polygon diagonal is inside the polygon -function middleInside( a, b ) { - - var p = a, - inside = false, - px = ( a.x + b.x ) / 2, - py = ( a.y + b.y ) / 2; - do { - - if ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y && - ( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) ) - inside = ! inside; - p = p.next; - - } while ( p !== a ); - - return inside; - -} - -// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; -// if one belongs to the outer ring and another to a hole, it merges it into a single ring -function splitPolygon( a, b ) { - - var a2 = new Node( a.i, a.x, a.y ), - b2 = new Node( b.i, b.x, b.y ), - an = a.next, - bp = b.prev; - - a.next = b; - b.prev = a; - - a2.next = an; - an.prev = a2; - - b2.next = a2; - a2.prev = b2; - - bp.next = b2; - b2.prev = bp; - - return b2; - -} - -// create a node and optionally link it with previous one (in a circular doubly linked list) -function insertNode( i, x, y, last ) { - - var p = new Node( i, x, y ); - - if ( ! last ) { - - p.prev = p; - p.next = p; - - } else { - - p.next = last.next; - p.prev = last; - last.next.prev = p; - last.next = p; - - } - - return p; - -} - -function removeNode( p ) { - - p.next.prev = p.prev; - p.prev.next = p.next; - - if ( p.prevZ ) p.prevZ.nextZ = p.nextZ; - if ( p.nextZ ) p.nextZ.prevZ = p.prevZ; - -} - -function Node( i, x, y ) { - - // vertex index in coordinates array - this.i = i; - - // vertex coordinates - this.x = x; - this.y = y; - - // previous and next vertex nodes in a polygon ring - this.prev = null; - this.next = null; - - // z-order curve value - this.z = null; - - // previous and next nodes in z-order - this.prevZ = null; - this.nextZ = null; - - // indicates whether this is a steiner point - this.steiner = false; - -} - -function signedArea( data, start, end, dim ) { - - var sum = 0; - for ( var i = start, j = end - dim; i < end; i += dim ) { - - sum += ( data[ j ] - data[ i ] ) * ( data[ i + 1 ] + data[ j + 1 ] ); - j = i; - - } - - return sum; - -} - -export { Earcut }; diff --git a/cases/esbuild-three/src/base/extras/ImageUtils.d.ts b/cases/esbuild-three/src/base/extras/ImageUtils.d.ts deleted file mode 100644 index 522bcc1e97..0000000000 --- a/cases/esbuild-three/src/base/extras/ImageUtils.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Mapping } from '../constants'; -import { Texture } from '../textures/Texture'; - -// Extras ///////////////////////////////////////////////////////////////////// - -/** - * @deprecated Use {@link TextureLoader} instead. - */ -export namespace ImageUtils { - /** - * @deprecated - */ - export let crossOrigin: string; - - /** - * @deprecated Use {@link TextureLoader THREE.TextureLoader()} instead. - */ - export function loadTexture( - url: string, - mapping?: Mapping, - onLoad?: ( texture: Texture ) => void, - onError?: ( message: string ) => void - ): Texture; - - /** - * @deprecated Use {@link CubeTextureLoader THREE.CubeTextureLoader()} instead. - */ - export function loadTextureCube( - array: string[], - mapping?: Mapping, - onLoad?: ( texture: Texture ) => void, - onError?: ( message: string ) => void - ): Texture; -} diff --git a/cases/esbuild-three/src/base/extras/ImageUtils.js b/cases/esbuild-three/src/base/extras/ImageUtils.js deleted file mode 100644 index ca1d0a4861..0000000000 --- a/cases/esbuild-three/src/base/extras/ImageUtils.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - */ - -var _canvas; - -var ImageUtils = { - - getDataURL: function ( image ) { - - var canvas; - - if ( typeof HTMLCanvasElement == 'undefined' ) { - - return image.src; - - } else if ( image instanceof HTMLCanvasElement ) { - - canvas = image; - - } else { - - if ( _canvas === undefined ) _canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - - _canvas.width = image.width; - _canvas.height = image.height; - - var context = _canvas.getContext( '2d' ); - - if ( image instanceof ImageData ) { - - context.putImageData( image, 0, 0 ); - - } else { - - context.drawImage( image, 0, 0, image.width, image.height ); - - } - - canvas = _canvas; - - } - - if ( canvas.width > 2048 || canvas.height > 2048 ) { - - return canvas.toDataURL( 'image/jpeg', 0.6 ); - - } else { - - return canvas.toDataURL( 'image/png' ); - - } - - } - -}; - -export { ImageUtils }; diff --git a/cases/esbuild-three/src/base/extras/ShapeUtils.d.ts b/cases/esbuild-three/src/base/extras/ShapeUtils.d.ts deleted file mode 100644 index fd24dc732a..0000000000 --- a/cases/esbuild-three/src/base/extras/ShapeUtils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -interface Vec2 { - x: number; - y: number; -} - -export namespace ShapeUtils { - export function area( contour: Vec2[] ): number; - export function triangulate( contour: Vec2[], indices: boolean ): number[]; - export function triangulateShape( contour: Vec2[], holes: Vec2[] ): number[][]; - export function isClockWise( pts: Vec2[] ): boolean; -} diff --git a/cases/esbuild-three/src/base/extras/ShapeUtils.js b/cases/esbuild-three/src/base/extras/ShapeUtils.js deleted file mode 100644 index ec050afb57..0000000000 --- a/cases/esbuild-three/src/base/extras/ShapeUtils.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - */ - -import { Earcut } from './Earcut.js'; - -var ShapeUtils = { - - // calculate area of the contour polygon - - area: function ( contour ) { - - var n = contour.length; - var a = 0.0; - - for ( var p = n - 1, q = 0; q < n; p = q ++ ) { - - a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; - - } - - return a * 0.5; - - }, - - isClockWise: function ( pts ) { - - return ShapeUtils.area( pts ) < 0; - - }, - - triangulateShape: function ( contour, holes ) { - - var vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ] - var holeIndices = []; // array of hole indices - var faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ] - - removeDupEndPts( contour ); - addContour( vertices, contour ); - - // - - var holeIndex = contour.length; - - holes.forEach( removeDupEndPts ); - - for ( var i = 0; i < holes.length; i ++ ) { - - holeIndices.push( holeIndex ); - holeIndex += holes[ i ].length; - addContour( vertices, holes[ i ] ); - - } - - // - - var triangles = Earcut.triangulate( vertices, holeIndices ); - - // - - for ( var i = 0; i < triangles.length; i += 3 ) { - - faces.push( triangles.slice( i, i + 3 ) ); - - } - - return faces; - - } - -}; - -function removeDupEndPts( points ) { - - var l = points.length; - - if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { - - points.pop(); - - } - -} - -function addContour( vertices, contour ) { - - for ( var i = 0; i < contour.length; i ++ ) { - - vertices.push( contour[ i ].x ); - vertices.push( contour[ i ].y ); - - } - -} - -export { ShapeUtils }; diff --git a/cases/esbuild-three/src/base/extras/core/Curve.d.ts b/cases/esbuild-three/src/base/extras/core/Curve.d.ts deleted file mode 100644 index ff995651af..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Curve.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Vector } from './../../math/Vector2'; - -// Extras / Core ///////////////////////////////////////////////////////////////////// - -/** - * An extensible curve object which contains methods for interpolation - * class Curve<T extends Vector> - */ -export class Curve { - - /** - * This value determines the amount of divisions when calculating the cumulative segment lengths of a curve via .getLengths. - * To ensure precision when using methods like .getSpacedPoints, it is recommended to increase .arcLengthDivisions if the curve is very large. - * Default is 200. - */ - arcLengthDivisions: number; - - /** - * Returns a vector for point t of the curve where t is between 0 and 1 - * getPoint(t: number): T; - */ - getPoint( t: number, optionalTarget?: T ): T; - - /** - * Returns a vector for point at relative position in curve according to arc length - * getPointAt(u: number): T; - */ - getPointAt( u: number, optionalTarget?: T ): T; - - /** - * Get sequence of points using getPoint( t ) - * getPoints(divisions?: number): T[]; - */ - getPoints( divisions?: number ): T[]; - - /** - * Get sequence of equi-spaced points using getPointAt( u ) - * getSpacedPoints(divisions?: number): T[]; - */ - getSpacedPoints( divisions?: number ): T[]; - - /** - * Get total curve arc length - */ - getLength(): number; - - /** - * Get list of cumulative segment lengths - */ - getLengths( divisions?: number ): number[]; - - /** - * Update the cumlative segment distance cache - */ - updateArcLengths(): void; - - /** - * Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi distance - */ - getUtoTmapping( u: number, distance: number ): number; - - /** - * Returns a unit vector tangent at t. If the subclassed curve do not implement its tangent derivation, 2 points a small delta apart will be used to find its gradient which seems to give a reasonable approximation - * getTangent(t: number): T; - */ - getTangent( t: number ): T; - - /** - * Returns tangent at equidistance point u on the curve - * getTangentAt(u: number): T; - */ - getTangentAt( u: number ): T; - - /** - * @deprecated since r84. - */ - static create( constructorFunc: Function, getPointFunc: Function ): Function; - -} diff --git a/cases/esbuild-three/src/base/extras/core/Curve.js b/cases/esbuild-three/src/base/extras/core/Curve.js deleted file mode 100644 index 4aac16a62a..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Curve.js +++ /dev/null @@ -1,425 +0,0 @@ -import { _Math } from '../../math/Math.js'; -import { Vector3 } from '../../math/Vector3.js'; -import { Matrix4 } from '../../math/Matrix4.js'; - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Extensible curve object - * - * Some common of curve methods: - * .getPoint( t, optionalTarget ), .getTangent( t ) - * .getPointAt( u, optionalTarget ), .getTangentAt( u ) - * .getPoints(), .getSpacedPoints() - * .getLength() - * .updateArcLengths() - * - * This following curves inherit from THREE.Curve: - * - * -- 2D curves -- - * THREE.ArcCurve - * THREE.CubicBezierCurve - * THREE.EllipseCurve - * THREE.LineCurve - * THREE.QuadraticBezierCurve - * THREE.SplineCurve - * - * -- 3D curves -- - * THREE.CatmullRomCurve3 - * THREE.CubicBezierCurve3 - * THREE.LineCurve3 - * THREE.QuadraticBezierCurve3 - * - * A series of curves can be represented as a THREE.CurvePath. - * - **/ - -/************************************************************** - * Abstract Curve base class - **************************************************************/ - -function Curve() { - - this.type = 'Curve'; - - this.arcLengthDivisions = 200; - -} - -Object.assign( Curve.prototype, { - - // Virtual base class method to overwrite and implement in subclasses - // - t [0 .. 1] - - getPoint: function ( /* t, optionalTarget */ ) { - - console.warn( 'THREE.Curve: .getPoint() not implemented.' ); - return null; - - }, - - // Get point at relative position in curve according to arc length - // - u [0 .. 1] - - getPointAt: function ( u, optionalTarget ) { - - var t = this.getUtoTmapping( u ); - return this.getPoint( t, optionalTarget ); - - }, - - // Get sequence of points using getPoint( t ) - - getPoints: function ( divisions ) { - - if ( divisions === undefined ) divisions = 5; - - var points = []; - - for ( var d = 0; d <= divisions; d ++ ) { - - points.push( this.getPoint( d / divisions ) ); - - } - - return points; - - }, - - // Get sequence of points using getPointAt( u ) - - getSpacedPoints: function ( divisions ) { - - if ( divisions === undefined ) divisions = 5; - - var points = []; - - for ( var d = 0; d <= divisions; d ++ ) { - - points.push( this.getPointAt( d / divisions ) ); - - } - - return points; - - }, - - // Get total curve arc length - - getLength: function () { - - var lengths = this.getLengths(); - return lengths[ lengths.length - 1 ]; - - }, - - // Get list of cumulative segment lengths - - getLengths: function ( divisions ) { - - if ( divisions === undefined ) divisions = this.arcLengthDivisions; - - if ( this.cacheArcLengths && - ( this.cacheArcLengths.length === divisions + 1 ) && - ! this.needsUpdate ) { - - return this.cacheArcLengths; - - } - - this.needsUpdate = false; - - var cache = []; - var current, last = this.getPoint( 0 ); - var p, sum = 0; - - cache.push( 0 ); - - for ( p = 1; p <= divisions; p ++ ) { - - current = this.getPoint( p / divisions ); - sum += current.distanceTo( last ); - cache.push( sum ); - last = current; - - } - - this.cacheArcLengths = cache; - - return cache; // { sums: cache, sum: sum }; Sum is in the last element. - - }, - - updateArcLengths: function () { - - this.needsUpdate = true; - this.getLengths(); - - }, - - // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant - - getUtoTmapping: function ( u, distance ) { - - var arcLengths = this.getLengths(); - - var i = 0, il = arcLengths.length; - - var targetArcLength; // The targeted u distance value to get - - if ( distance ) { - - targetArcLength = distance; - - } else { - - targetArcLength = u * arcLengths[ il - 1 ]; - - } - - // binary search for the index with largest value smaller than target u distance - - var low = 0, high = il - 1, comparison; - - while ( low <= high ) { - - i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats - - comparison = arcLengths[ i ] - targetArcLength; - - if ( comparison < 0 ) { - - low = i + 1; - - } else if ( comparison > 0 ) { - - high = i - 1; - - } else { - - high = i; - break; - - // DONE - - } - - } - - i = high; - - if ( arcLengths[ i ] === targetArcLength ) { - - return i / ( il - 1 ); - - } - - // we could get finer grain at lengths, or use simple interpolation between two points - - var lengthBefore = arcLengths[ i ]; - var lengthAfter = arcLengths[ i + 1 ]; - - var segmentLength = lengthAfter - lengthBefore; - - // determine where we are between the 'before' and 'after' points - - var segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength; - - // add that fractional amount to t - - var t = ( i + segmentFraction ) / ( il - 1 ); - - return t; - - }, - - // Returns a unit vector tangent at t - // In case any sub curve does not implement its tangent derivation, - // 2 points a small delta apart will be used to find its gradient - // which seems to give a reasonable approximation - - getTangent: function ( t ) { - - var delta = 0.0001; - var t1 = t - delta; - var t2 = t + delta; - - // Capping in case of danger - - if ( t1 < 0 ) t1 = 0; - if ( t2 > 1 ) t2 = 1; - - var pt1 = this.getPoint( t1 ); - var pt2 = this.getPoint( t2 ); - - var vec = pt2.clone().sub( pt1 ); - return vec.normalize(); - - }, - - getTangentAt: function ( u ) { - - var t = this.getUtoTmapping( u ); - return this.getTangent( t ); - - }, - - computeFrenetFrames: function ( segments, closed ) { - - // see http://www.cs.indiana.edu/pub/techreports/TR425.pdf - - var normal = new Vector3(); - - var tangents = []; - var normals = []; - var binormals = []; - - var vec = new Vector3(); - var mat = new Matrix4(); - - var i, u, theta; - - // compute the tangent vectors for each segment on the curve - - for ( i = 0; i <= segments; i ++ ) { - - u = i / segments; - - tangents[ i ] = this.getTangentAt( u ); - tangents[ i ].normalize(); - - } - - // select an initial normal vector perpendicular to the first tangent vector, - // and in the direction of the minimum tangent xyz component - - normals[ 0 ] = new Vector3(); - binormals[ 0 ] = new Vector3(); - var min = Number.MAX_VALUE; - var tx = Math.abs( tangents[ 0 ].x ); - var ty = Math.abs( tangents[ 0 ].y ); - var tz = Math.abs( tangents[ 0 ].z ); - - if ( tx <= min ) { - - min = tx; - normal.set( 1, 0, 0 ); - - } - - if ( ty <= min ) { - - min = ty; - normal.set( 0, 1, 0 ); - - } - - if ( tz <= min ) { - - normal.set( 0, 0, 1 ); - - } - - vec.crossVectors( tangents[ 0 ], normal ).normalize(); - - normals[ 0 ].crossVectors( tangents[ 0 ], vec ); - binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ); - - - // compute the slowly-varying normal and binormal vectors for each segment on the curve - - for ( i = 1; i <= segments; i ++ ) { - - normals[ i ] = normals[ i - 1 ].clone(); - - binormals[ i ] = binormals[ i - 1 ].clone(); - - vec.crossVectors( tangents[ i - 1 ], tangents[ i ] ); - - if ( vec.length() > Number.EPSILON ) { - - vec.normalize(); - - theta = Math.acos( _Math.clamp( tangents[ i - 1 ].dot( tangents[ i ] ), - 1, 1 ) ); // clamp for floating pt errors - - normals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) ); - - } - - binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); - - } - - // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same - - if ( closed === true ) { - - theta = Math.acos( _Math.clamp( normals[ 0 ].dot( normals[ segments ] ), - 1, 1 ) ); - theta /= segments; - - if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) { - - theta = - theta; - - } - - for ( i = 1; i <= segments; i ++ ) { - - // twist a little... - normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) ); - binormals[ i ].crossVectors( tangents[ i ], normals[ i ] ); - - } - - } - - return { - tangents: tangents, - normals: normals, - binormals: binormals - }; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( source ) { - - this.arcLengthDivisions = source.arcLengthDivisions; - - return this; - - }, - - toJSON: function () { - - var data = { - metadata: { - version: 4.5, - type: 'Curve', - generator: 'Curve.toJSON' - } - }; - - data.arcLengthDivisions = this.arcLengthDivisions; - data.type = this.type; - - return data; - - }, - - fromJSON: function ( json ) { - - this.arcLengthDivisions = json.arcLengthDivisions; - - return this; - - } - -} ); - - -export { Curve }; diff --git a/cases/esbuild-three/src/base/extras/core/CurvePath.d.ts b/cases/esbuild-three/src/base/extras/core/CurvePath.d.ts deleted file mode 100644 index 346285817d..0000000000 --- a/cases/esbuild-three/src/base/extras/core/CurvePath.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Curve } from './Curve'; -import { Geometry } from './../../core/Geometry'; -import { Vector } from './../../math/Vector2'; - -export class CurvePath extends Curve { - - constructor(); - - curves: Curve[]; - autoClose: boolean; - - add( curve: Curve ): void; - checkConnection(): boolean; - closePath(): void; - getPoint( t: number ): T; - getLength(): number; - updateArcLengths(): void; - getCurveLengths(): number[]; - getSpacedPoints( divisions?: number ): T[]; - getPoints( divisions?: number ): T[]; - - /** - * @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead. - */ - createPointsGeometry( divisions: number ): Geometry; - /** - * @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead. - */ - createSpacedPointsGeometry( divisions: number ): Geometry; - /** - * @deprecated Use {@link Geometry#setFromPoints new THREE.Geometry().setFromPoints( points )} instead. - */ - createGeometry( points: T[] ): Geometry; - -} diff --git a/cases/esbuild-three/src/base/extras/core/CurvePath.js b/cases/esbuild-three/src/base/extras/core/CurvePath.js deleted file mode 100644 index c739130708..0000000000 --- a/cases/esbuild-three/src/base/extras/core/CurvePath.js +++ /dev/null @@ -1,261 +0,0 @@ -import { Curve } from './Curve.js'; -import * as Curves from '../curves/Curves.js'; - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - **/ - -/************************************************************** - * Curved Path - a curve path is simply a array of connected - * curves, but retains the api of a curve - **************************************************************/ - -function CurvePath() { - - Curve.call( this ); - - this.type = 'CurvePath'; - - this.curves = []; - this.autoClose = false; // Automatically closes the path - -} - -CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), { - - constructor: CurvePath, - - add: function ( curve ) { - - this.curves.push( curve ); - - }, - - closePath: function () { - - // Add a line curve if start and end of lines are not connected - var startPoint = this.curves[ 0 ].getPoint( 0 ); - var endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 ); - - if ( ! startPoint.equals( endPoint ) ) { - - this.curves.push( new Curves[ 'LineCurve' ]( endPoint, startPoint ) ); - - } - - }, - - // To get accurate point with reference to - // entire path distance at time t, - // following has to be done: - - // 1. Length of each sub path have to be known - // 2. Locate and identify type of curve - // 3. Get t for the curve - // 4. Return curve.getPointAt(t') - - getPoint: function ( t ) { - - var d = t * this.getLength(); - var curveLengths = this.getCurveLengths(); - var i = 0; - - // To think about boundaries points. - - while ( i < curveLengths.length ) { - - if ( curveLengths[ i ] >= d ) { - - var diff = curveLengths[ i ] - d; - var curve = this.curves[ i ]; - - var segmentLength = curve.getLength(); - var u = segmentLength === 0 ? 0 : 1 - diff / segmentLength; - - return curve.getPointAt( u ); - - } - - i ++; - - } - - return null; - - // loop where sum != 0, sum > d , sum+1 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) { - - points.push( points[ 0 ] ); - - } - - return points; - - }, - - copy: function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.curves = []; - - for ( var i = 0, l = source.curves.length; i < l; i ++ ) { - - var curve = source.curves[ i ]; - - this.curves.push( curve.clone() ); - - } - - this.autoClose = source.autoClose; - - return this; - - }, - - toJSON: function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.autoClose = this.autoClose; - data.curves = []; - - for ( var i = 0, l = this.curves.length; i < l; i ++ ) { - - var curve = this.curves[ i ]; - data.curves.push( curve.toJSON() ); - - } - - return data; - - }, - - fromJSON: function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.autoClose = json.autoClose; - this.curves = []; - - for ( var i = 0, l = json.curves.length; i < l; i ++ ) { - - var curve = json.curves[ i ]; - this.curves.push( new Curves[ curve.type ]().fromJSON( curve ) ); - - } - - return this; - - } - -} ); - - -export { CurvePath }; diff --git a/cases/esbuild-three/src/base/extras/core/Font.d.ts b/cases/esbuild-three/src/base/extras/core/Font.d.ts deleted file mode 100644 index 1ef5b5c70a..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Font.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class Font { - - constructor( jsondata: any ); - - data: string; - - generateShapes( text: string, size: number, divisions: number ): any[]; - -} diff --git a/cases/esbuild-three/src/base/extras/core/Font.js b/cases/esbuild-three/src/base/extras/core/Font.js deleted file mode 100644 index df45cf13ba..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Font.js +++ /dev/null @@ -1,151 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author mrdoob / http://mrdoob.com/ - */ - -import { ShapePath } from './ShapePath.js'; - - -function Font( data ) { - - this.type = 'Font'; - - this.data = data; - -} - -Object.assign( Font.prototype, { - - isFont: true, - - generateShapes: function ( text, size ) { - - if ( size === undefined ) size = 100; - - var shapes = []; - var paths = createPaths( text, size, this.data ); - - for ( var p = 0, pl = paths.length; p < pl; p ++ ) { - - Array.prototype.push.apply( shapes, paths[ p ].toShapes() ); - - } - - return shapes; - - } - -} ); - -function createPaths( text, size, data ) { - - var chars = Array.from ? Array.from( text ) : String( text ).split( '' ); // see #13988 - var scale = size / data.resolution; - var line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale; - - var paths = []; - - var offsetX = 0, offsetY = 0; - - for ( var i = 0; i < chars.length; i ++ ) { - - var char = chars[ i ]; - - if ( char === '\n' ) { - - offsetX = 0; - offsetY -= line_height; - - } else { - - var ret = createPath( char, scale, offsetX, offsetY, data ); - offsetX += ret.offsetX; - paths.push( ret.path ); - - } - - } - - return paths; - -} - -function createPath( char, scale, offsetX, offsetY, data ) { - - var glyph = data.glyphs[ char ] || data.glyphs[ '?' ]; - - if ( ! glyph ) { - - console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' ); - - return; - - } - - var path = new ShapePath(); - - var x, y, cpx, cpy, cpx1, cpy1, cpx2, cpy2; - - if ( glyph.o ) { - - var outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) ); - - for ( var i = 0, l = outline.length; i < l; ) { - - var action = outline[ i ++ ]; - - switch ( action ) { - - case 'm': // moveTo - - x = outline[ i ++ ] * scale + offsetX; - y = outline[ i ++ ] * scale + offsetY; - - path.moveTo( x, y ); - - break; - - case 'l': // lineTo - - x = outline[ i ++ ] * scale + offsetX; - y = outline[ i ++ ] * scale + offsetY; - - path.lineTo( x, y ); - - break; - - case 'q': // quadraticCurveTo - - cpx = outline[ i ++ ] * scale + offsetX; - cpy = outline[ i ++ ] * scale + offsetY; - cpx1 = outline[ i ++ ] * scale + offsetX; - cpy1 = outline[ i ++ ] * scale + offsetY; - - path.quadraticCurveTo( cpx1, cpy1, cpx, cpy ); - - break; - - case 'b': // bezierCurveTo - - cpx = outline[ i ++ ] * scale + offsetX; - cpy = outline[ i ++ ] * scale + offsetY; - cpx1 = outline[ i ++ ] * scale + offsetX; - cpy1 = outline[ i ++ ] * scale + offsetY; - cpx2 = outline[ i ++ ] * scale + offsetX; - cpy2 = outline[ i ++ ] * scale + offsetY; - - path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy ); - - break; - - } - - } - - } - - return { offsetX: glyph.ha * scale, path: path }; - -} - -export { Font }; diff --git a/cases/esbuild-three/src/base/extras/core/Interpolations.d.ts b/cases/esbuild-three/src/base/extras/core/Interpolations.d.ts deleted file mode 100644 index f0d8970d1b..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Interpolations.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export namespace Interpolations { - export function CatmullRom( t: number, p0: number, p1: number, p2: number, p3: number ): number; - export function QuadraticBezier( t: number, p0: number, p1: number, p2: number ): number; - export function CubicBezier( t: number, p0: number, p1: number, p2: number, p3: number ): number; -} diff --git a/cases/esbuild-three/src/base/extras/core/Interpolations.js b/cases/esbuild-three/src/base/extras/core/Interpolations.js deleted file mode 100644 index 0fb812c1ff..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Interpolations.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * Bezier Curves formulas obtained from - * http://en.wikipedia.org/wiki/Bézier_curve - */ - -function CatmullRom( t, p0, p1, p2, p3 ) { - - var v0 = ( p2 - p0 ) * 0.5; - var v1 = ( p3 - p1 ) * 0.5; - var t2 = t * t; - var t3 = t * t2; - return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; - -} - -// - -function QuadraticBezierP0( t, p ) { - - var k = 1 - t; - return k * k * p; - -} - -function QuadraticBezierP1( t, p ) { - - return 2 * ( 1 - t ) * t * p; - -} - -function QuadraticBezierP2( t, p ) { - - return t * t * p; - -} - -function QuadraticBezier( t, p0, p1, p2 ) { - - return QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) + - QuadraticBezierP2( t, p2 ); - -} - -// - -function CubicBezierP0( t, p ) { - - var k = 1 - t; - return k * k * k * p; - -} - -function CubicBezierP1( t, p ) { - - var k = 1 - t; - return 3 * k * k * t * p; - -} - -function CubicBezierP2( t, p ) { - - return 3 * ( 1 - t ) * t * t * p; - -} - -function CubicBezierP3( t, p ) { - - return t * t * t * p; - -} - -function CubicBezier( t, p0, p1, p2, p3 ) { - - return CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) + - CubicBezierP3( t, p3 ); - -} - -export { CatmullRom, QuadraticBezier, CubicBezier }; diff --git a/cases/esbuild-three/src/base/extras/core/Path.d.ts b/cases/esbuild-three/src/base/extras/core/Path.d.ts deleted file mode 100644 index b45e7b4ebd..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Path.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { CurvePath } from './CurvePath'; - -export enum PathActions { - MOVE_TO, - LINE_TO, - QUADRATIC_CURVE_TO, // Bezier quadratic curve - BEZIER_CURVE_TO, // Bezier cubic curve - CSPLINE_THRU, // Catmull-rom spline - ARC, // Circle - ELLIPSE, -} - -export interface PathAction { - action: PathActions; - args: any; -} - -/** - * a 2d path representation, comprising of points, lines, and cubes, similar to the html5 2d canvas api. It extends CurvePath. - */ -export class Path extends CurvePath { - - constructor( points?: Vector2[] ); - - currentPoint: Vector2; - - /** - * @deprecated Use {@link Path#setFromPoints .setFromPoints()} instead. - */ - fromPoints( vectors: Vector2[] ): void; - setFromPoints( vectors: Vector2[] ): void; - moveTo( x: number, y: number ): void; - lineTo( x: number, y: number ): void; - quadraticCurveTo( aCPx: number, aCPy: number, aX: number, aY: number ): void; - bezierCurveTo( - aCP1x: number, - aCP1y: number, - aCP2x: number, - aCP2y: number, - aX: number, - aY: number - ): void; - splineThru( pts: Vector2[] ): void; - arc( - aX: number, - aY: number, - aRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean - ): void; - absarc( - aX: number, - aY: number, - aRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean - ): void; - ellipse( - aX: number, - aY: number, - xRadius: number, - yRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean, - aRotation: number - ): void; - absellipse( - aX: number, - aY: number, - xRadius: number, - yRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean, - aRotation: number - ): void; - -} diff --git a/cases/esbuild-three/src/base/extras/core/Path.js b/cases/esbuild-three/src/base/extras/core/Path.js deleted file mode 100644 index d2b978c3ab..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Path.js +++ /dev/null @@ -1,183 +0,0 @@ -import { Vector2 } from '../../math/Vector2.js'; -import { CurvePath } from './CurvePath.js'; -import { EllipseCurve } from '../curves/EllipseCurve.js'; -import { SplineCurve } from '../curves/SplineCurve.js'; -import { CubicBezierCurve } from '../curves/CubicBezierCurve.js'; -import { QuadraticBezierCurve } from '../curves/QuadraticBezierCurve.js'; -import { LineCurve } from '../curves/LineCurve.js'; - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Creates free form 2d path using series of points, lines or curves. - **/ - -function Path( points ) { - - CurvePath.call( this ); - - this.type = 'Path'; - - this.currentPoint = new Vector2(); - - if ( points ) { - - this.setFromPoints( points ); - - } - -} - -Path.prototype = Object.assign( Object.create( CurvePath.prototype ), { - - constructor: Path, - - setFromPoints: function ( points ) { - - this.moveTo( points[ 0 ].x, points[ 0 ].y ); - - for ( var i = 1, l = points.length; i < l; i ++ ) { - - this.lineTo( points[ i ].x, points[ i ].y ); - - } - - }, - - moveTo: function ( x, y ) { - - this.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying? - - }, - - lineTo: function ( x, y ) { - - var curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) ); - this.curves.push( curve ); - - this.currentPoint.set( x, y ); - - }, - - quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { - - var curve = new QuadraticBezierCurve( - this.currentPoint.clone(), - new Vector2( aCPx, aCPy ), - new Vector2( aX, aY ) - ); - - this.curves.push( curve ); - - this.currentPoint.set( aX, aY ); - - }, - - bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { - - var curve = new CubicBezierCurve( - this.currentPoint.clone(), - new Vector2( aCP1x, aCP1y ), - new Vector2( aCP2x, aCP2y ), - new Vector2( aX, aY ) - ); - - this.curves.push( curve ); - - this.currentPoint.set( aX, aY ); - - }, - - splineThru: function ( pts /*Array of Vector*/ ) { - - var npts = [ this.currentPoint.clone() ].concat( pts ); - - var curve = new SplineCurve( npts ); - this.curves.push( curve ); - - this.currentPoint.copy( pts[ pts.length - 1 ] ); - - }, - - arc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - - var x0 = this.currentPoint.x; - var y0 = this.currentPoint.y; - - this.absarc( aX + x0, aY + y0, aRadius, - aStartAngle, aEndAngle, aClockwise ); - - }, - - absarc: function ( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - - this.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); - - }, - - ellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { - - var x0 = this.currentPoint.x; - var y0 = this.currentPoint.y; - - this.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); - - }, - - absellipse: function ( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { - - var curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ); - - if ( this.curves.length > 0 ) { - - // if a previous curve is present, attempt to join - var firstPoint = curve.getPoint( 0 ); - - if ( ! firstPoint.equals( this.currentPoint ) ) { - - this.lineTo( firstPoint.x, firstPoint.y ); - - } - - } - - this.curves.push( curve ); - - var lastPoint = curve.getPoint( 1 ); - this.currentPoint.copy( lastPoint ); - - }, - - copy: function ( source ) { - - CurvePath.prototype.copy.call( this, source ); - - this.currentPoint.copy( source.currentPoint ); - - return this; - - }, - - toJSON: function () { - - var data = CurvePath.prototype.toJSON.call( this ); - - data.currentPoint = this.currentPoint.toArray(); - - return data; - - }, - - fromJSON: function ( json ) { - - CurvePath.prototype.fromJSON.call( this, json ); - - this.currentPoint.fromArray( json.currentPoint ); - - return this; - - } - -} ); - - -export { Path }; diff --git a/cases/esbuild-three/src/base/extras/core/Shape.d.ts b/cases/esbuild-three/src/base/extras/core/Shape.d.ts deleted file mode 100644 index bee3659c29..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Shape.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Path } from './Path'; -import { ExtrudeGeometry } from './../../geometries/ExtrudeGeometry'; -import { ShapeGeometry } from './../../geometries/ShapeGeometry'; - -/** - * Defines a 2d shape plane using paths. - */ -export class Shape extends Path { - - constructor( points?: Vector2[] ); - - holes: Path[]; - - /** - * @deprecated Use {@link ExtrudeGeometry ExtrudeGeometry()} instead. - */ - extrude( options?: any ): ExtrudeGeometry; - - /** - * @deprecated Use {@link ShapeGeometry ShapeGeometry()} instead. - */ - makeGeometry( options?: any ): ShapeGeometry; - getPointsHoles( divisions: number ): Vector2[][]; - - /** - * @deprecated Use {@link Shape#extractPoints .extractPoints()} instead. - */ - extractAllPoints( - divisions: number - ): { - shape: Vector2[]; - holes: Vector2[][]; - }; - extractPoints( divisions: number ): Vector2[]; - -} diff --git a/cases/esbuild-three/src/base/extras/core/Shape.js b/cases/esbuild-three/src/base/extras/core/Shape.js deleted file mode 100644 index 539415cde5..0000000000 --- a/cases/esbuild-three/src/base/extras/core/Shape.js +++ /dev/null @@ -1,115 +0,0 @@ -import { Path } from './Path.js'; -import { _Math } from '../../math/Math.js'; - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Defines a 2d shape plane using paths. - **/ - -// STEP 1 Create a path. -// STEP 2 Turn path into shape. -// STEP 3 ExtrudeGeometry takes in Shape/Shapes -// STEP 3a - Extract points from each shape, turn to vertices -// STEP 3b - Triangulate each shape, add faces. - -function Shape( points ) { - - Path.call( this, points ); - - this.uuid = _Math.generateUUID(); - - this.type = 'Shape'; - - this.holes = []; - -} - -Shape.prototype = Object.assign( Object.create( Path.prototype ), { - - constructor: Shape, - - getPointsHoles: function ( divisions ) { - - var holesPts = []; - - for ( var i = 0, l = this.holes.length; i < l; i ++ ) { - - holesPts[ i ] = this.holes[ i ].getPoints( divisions ); - - } - - return holesPts; - - }, - - // get points of shape and holes (keypoints based on segments parameter) - - extractPoints: function ( divisions ) { - - return { - - shape: this.getPoints( divisions ), - holes: this.getPointsHoles( divisions ) - - }; - - }, - - copy: function ( source ) { - - Path.prototype.copy.call( this, source ); - - this.holes = []; - - for ( var i = 0, l = source.holes.length; i < l; i ++ ) { - - var hole = source.holes[ i ]; - - this.holes.push( hole.clone() ); - - } - - return this; - - }, - - toJSON: function () { - - var data = Path.prototype.toJSON.call( this ); - - data.uuid = this.uuid; - data.holes = []; - - for ( var i = 0, l = this.holes.length; i < l; i ++ ) { - - var hole = this.holes[ i ]; - data.holes.push( hole.toJSON() ); - - } - - return data; - - }, - - fromJSON: function ( json ) { - - Path.prototype.fromJSON.call( this, json ); - - this.uuid = json.uuid; - this.holes = []; - - for ( var i = 0, l = json.holes.length; i < l; i ++ ) { - - var hole = json.holes[ i ]; - this.holes.push( new Path().fromJSON( hole ) ); - - } - - return this; - - } - -} ); - - -export { Shape }; diff --git a/cases/esbuild-three/src/base/extras/core/ShapePath.d.ts b/cases/esbuild-three/src/base/extras/core/ShapePath.d.ts deleted file mode 100644 index 97fcf1a1eb..0000000000 --- a/cases/esbuild-three/src/base/extras/core/ShapePath.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Shape } from './Shape'; - -export class ShapePath { - - constructor(); - - subPaths: any[]; - currentPath: any; - - moveTo( x: number, y: number ): void; - lineTo( x: number, y: number ): void; - quadraticCurveTo( aCPx: number, aCPy: number, aX: number, aY: number ): void; - bezierCurveTo( - aCP1x: number, - aCP1y: number, - aCP2x: number, - aCP2y: number, - aX: number, - aY: number - ): void; - splineThru( pts: Vector2[] ): void; - toShapes( isCCW: boolean, noHoles: any ): Shape[]; - -} diff --git a/cases/esbuild-three/src/base/extras/core/ShapePath.js b/cases/esbuild-three/src/base/extras/core/ShapePath.js deleted file mode 100644 index a5f734497a..0000000000 --- a/cases/esbuild-three/src/base/extras/core/ShapePath.js +++ /dev/null @@ -1,286 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * minimal class for proxing functions to Path. Replaces old "extractSubpaths()" - **/ - -import { Color } from '../../math/Color.js'; -import { Path } from './Path.js'; -import { Shape } from './Shape.js'; -import { ShapeUtils } from '../ShapeUtils.js'; - -function ShapePath() { - - this.type = 'ShapePath'; - - this.color = new Color(); - - this.subPaths = []; - this.currentPath = null; - -} - -Object.assign( ShapePath.prototype, { - - moveTo: function ( x, y ) { - - this.currentPath = new Path(); - this.subPaths.push( this.currentPath ); - this.currentPath.moveTo( x, y ); - - }, - - lineTo: function ( x, y ) { - - this.currentPath.lineTo( x, y ); - - }, - - quadraticCurveTo: function ( aCPx, aCPy, aX, aY ) { - - this.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY ); - - }, - - bezierCurveTo: function ( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) { - - this.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ); - - }, - - splineThru: function ( pts ) { - - this.currentPath.splineThru( pts ); - - }, - - toShapes: function ( isCCW, noHoles ) { - - function toShapesNoHoles( inSubpaths ) { - - var shapes = []; - - for ( var i = 0, l = inSubpaths.length; i < l; i ++ ) { - - var tmpPath = inSubpaths[ i ]; - - var tmpShape = new Shape(); - tmpShape.curves = tmpPath.curves; - - shapes.push( tmpShape ); - - } - - return shapes; - - } - - function isPointInsidePolygon( inPt, inPolygon ) { - - var polyLen = inPolygon.length; - - // inPt on polygon contour => immediate success or - // toggling of inside/outside at every single! intersection point of an edge - // with the horizontal line through inPt, left of inPt - // not counting lowerY endpoints of edges and whole edges on that line - var inside = false; - for ( var p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) { - - var edgeLowPt = inPolygon[ p ]; - var edgeHighPt = inPolygon[ q ]; - - var edgeDx = edgeHighPt.x - edgeLowPt.x; - var edgeDy = edgeHighPt.y - edgeLowPt.y; - - if ( Math.abs( edgeDy ) > Number.EPSILON ) { - - // not parallel - if ( edgeDy < 0 ) { - - edgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx; - edgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy; - - } - if ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) continue; - - if ( inPt.y === edgeLowPt.y ) { - - if ( inPt.x === edgeLowPt.x ) return true; // inPt is on contour ? - // continue; // no intersection or edgeLowPt => doesn't count !!! - - } else { - - var perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y ); - if ( perpEdge === 0 ) return true; // inPt is on contour ? - if ( perpEdge < 0 ) continue; - inside = ! inside; // true intersection left of inPt - - } - - } else { - - // parallel or collinear - if ( inPt.y !== edgeLowPt.y ) continue; // parallel - // edge lies on the same horizontal line as inPt - if ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) || - ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) ) return true; // inPt: Point on contour ! - // continue; - - } - - } - - return inside; - - } - - var isClockWise = ShapeUtils.isClockWise; - - var subPaths = this.subPaths; - if ( subPaths.length === 0 ) return []; - - if ( noHoles === true ) return toShapesNoHoles( subPaths ); - - - var solid, tmpPath, tmpShape, shapes = []; - - if ( subPaths.length === 1 ) { - - tmpPath = subPaths[ 0 ]; - tmpShape = new Shape(); - tmpShape.curves = tmpPath.curves; - shapes.push( tmpShape ); - return shapes; - - } - - var holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() ); - holesFirst = isCCW ? ! holesFirst : holesFirst; - - // console.log("Holes first", holesFirst); - - var betterShapeHoles = []; - var newShapes = []; - var newShapeHoles = []; - var mainIdx = 0; - var tmpPoints; - - newShapes[ mainIdx ] = undefined; - newShapeHoles[ mainIdx ] = []; - - for ( var i = 0, l = subPaths.length; i < l; i ++ ) { - - tmpPath = subPaths[ i ]; - tmpPoints = tmpPath.getPoints(); - solid = isClockWise( tmpPoints ); - solid = isCCW ? ! solid : solid; - - if ( solid ) { - - if ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) ) mainIdx ++; - - newShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints }; - newShapes[ mainIdx ].s.curves = tmpPath.curves; - - if ( holesFirst ) mainIdx ++; - newShapeHoles[ mainIdx ] = []; - - //console.log('cw', i); - - } else { - - newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } ); - - //console.log('ccw', i); - - } - - } - - // only Holes? -> probably all Shapes with wrong orientation - if ( ! newShapes[ 0 ] ) return toShapesNoHoles( subPaths ); - - - if ( newShapes.length > 1 ) { - - var ambiguous = false; - var toChange = []; - - for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { - - betterShapeHoles[ sIdx ] = []; - - } - - for ( var sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) { - - var sho = newShapeHoles[ sIdx ]; - - for ( var hIdx = 0; hIdx < sho.length; hIdx ++ ) { - - var ho = sho[ hIdx ]; - var hole_unassigned = true; - - for ( var s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) { - - if ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) { - - if ( sIdx !== s2Idx ) toChange.push( { froms: sIdx, tos: s2Idx, hole: hIdx } ); - if ( hole_unassigned ) { - - hole_unassigned = false; - betterShapeHoles[ s2Idx ].push( ho ); - - } else { - - ambiguous = true; - - } - - } - - } - if ( hole_unassigned ) { - - betterShapeHoles[ sIdx ].push( ho ); - - } - - } - - } - // console.log("ambiguous: ", ambiguous); - if ( toChange.length > 0 ) { - - // console.log("to change: ", toChange); - if ( ! ambiguous ) newShapeHoles = betterShapeHoles; - - } - - } - - var tmpHoles; - - for ( var i = 0, il = newShapes.length; i < il; i ++ ) { - - tmpShape = newShapes[ i ].s; - shapes.push( tmpShape ); - tmpHoles = newShapeHoles[ i ]; - - for ( var j = 0, jl = tmpHoles.length; j < jl; j ++ ) { - - tmpShape.holes.push( tmpHoles[ j ].h ); - - } - - } - - //console.log("shape", shapes); - - return shapes; - - } - -} ); - - -export { ShapePath }; diff --git a/cases/esbuild-three/src/base/extras/curves/ArcCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/ArcCurve.d.ts deleted file mode 100644 index ccd7efa83e..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/ArcCurve.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { EllipseCurve } from './EllipseCurve'; -export class ArcCurve extends EllipseCurve { - - constructor( - aX: number, - aY: number, - aRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean - ); - -} diff --git a/cases/esbuild-three/src/base/extras/curves/ArcCurve.js b/cases/esbuild-three/src/base/extras/curves/ArcCurve.js deleted file mode 100644 index 54b8848c4c..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/ArcCurve.js +++ /dev/null @@ -1,18 +0,0 @@ -import { EllipseCurve } from './EllipseCurve.js'; - - -function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { - - EllipseCurve.call( this, aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise ); - - this.type = 'ArcCurve'; - -} - -ArcCurve.prototype = Object.create( EllipseCurve.prototype ); -ArcCurve.prototype.constructor = ArcCurve; - -ArcCurve.prototype.isArcCurve = true; - - -export { ArcCurve }; diff --git a/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.d.ts b/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.d.ts deleted file mode 100644 index 890c8ffdd1..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Vector3 } from './../../math/Vector3'; -import { Curve } from './../core/Curve'; - -// Extras / Curves ///////////////////////////////////////////////////////////////////// -export namespace CurveUtils { - export function tangentQuadraticBezier( - t: number, - p0: number, - p1: number, - p2: number - ): number; - export function tangentCubicBezier( - t: number, - p0: number, - p1: number, - p2: number, - p3: number - ): number; - export function tangentSpline( - t: number, - p0: number, - p1: number, - p2: number, - p3: number - ): number; - export function interpolate( - p0: number, - p1: number, - p2: number, - p3: number, - t: number - ): number; -} - -export class CatmullRomCurve3 extends Curve { - - constructor( - points?: Vector3[], - closed?: boolean, - curveType?: string, - tension?: number - ); - - points: Vector3[]; - - getPoint( t: number ): Vector3; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.js b/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.js deleted file mode 100644 index 5f53a36f11..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CatmullRomCurve3.js +++ /dev/null @@ -1,255 +0,0 @@ -import { Vector3 } from '../../math/Vector3.js'; -import { Curve } from '../core/Curve.js'; - -/** - * @author zz85 https://github.com/zz85 - * - * Centripetal CatmullRom Curve - which is useful for avoiding - * cusps and self-intersections in non-uniform catmull rom curves. - * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf - * - * curve.type accepts centripetal(default), chordal and catmullrom - * curve.tension is used for catmullrom which defaults to 0.5 - */ - - -/* -Based on an optimized c++ solution in - - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/ - - http://ideone.com/NoEbVM - -This CubicPoly class could be used for reusing some variables and calculations, -but for three.js curve use, it could be possible inlined and flatten into a single function call -which can be placed in CurveUtils. -*/ - -function CubicPoly() { - - var c0 = 0, c1 = 0, c2 = 0, c3 = 0; - - /* - * Compute coefficients for a cubic polynomial - * p(s) = c0 + c1*s + c2*s^2 + c3*s^3 - * such that - * p(0) = x0, p(1) = x1 - * and - * p'(0) = t0, p'(1) = t1. - */ - function init( x0, x1, t0, t1 ) { - - c0 = x0; - c1 = t0; - c2 = - 3 * x0 + 3 * x1 - 2 * t0 - t1; - c3 = 2 * x0 - 2 * x1 + t0 + t1; - - } - - return { - - initCatmullRom: function ( x0, x1, x2, x3, tension ) { - - init( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) ); - - }, - - initNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) { - - // compute tangents when parameterized in [t1,t2] - var t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1; - var t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2; - - // rescale tangents for parametrization in [0,1] - t1 *= dt1; - t2 *= dt1; - - init( x1, x2, t1, t2 ); - - }, - - calc: function ( t ) { - - var t2 = t * t; - var t3 = t2 * t; - return c0 + c1 * t + c2 * t2 + c3 * t3; - - } - - }; - -} - -// - -var tmp = new Vector3(); -var px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly(); - -function CatmullRomCurve3( points, closed, curveType, tension ) { - - Curve.call( this ); - - this.type = 'CatmullRomCurve3'; - - this.points = points || []; - this.closed = closed || false; - this.curveType = curveType || 'centripetal'; - this.tension = tension || 0.5; - -} - -CatmullRomCurve3.prototype = Object.create( Curve.prototype ); -CatmullRomCurve3.prototype.constructor = CatmullRomCurve3; - -CatmullRomCurve3.prototype.isCatmullRomCurve3 = true; - -CatmullRomCurve3.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector3(); - - var points = this.points; - var l = points.length; - - var p = ( l - ( this.closed ? 0 : 1 ) ) * t; - var intPoint = Math.floor( p ); - var weight = p - intPoint; - - if ( this.closed ) { - - intPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l; - - } else if ( weight === 0 && intPoint === l - 1 ) { - - intPoint = l - 2; - weight = 1; - - } - - var p0, p1, p2, p3; // 4 points - - if ( this.closed || intPoint > 0 ) { - - p0 = points[ ( intPoint - 1 ) % l ]; - - } else { - - // extrapolate first point - tmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] ); - p0 = tmp; - - } - - p1 = points[ intPoint % l ]; - p2 = points[ ( intPoint + 1 ) % l ]; - - if ( this.closed || intPoint + 2 < l ) { - - p3 = points[ ( intPoint + 2 ) % l ]; - - } else { - - // extrapolate last point - tmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] ); - p3 = tmp; - - } - - if ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) { - - // init Centripetal / Chordal Catmull-Rom - var pow = this.curveType === 'chordal' ? 0.5 : 0.25; - var dt0 = Math.pow( p0.distanceToSquared( p1 ), pow ); - var dt1 = Math.pow( p1.distanceToSquared( p2 ), pow ); - var dt2 = Math.pow( p2.distanceToSquared( p3 ), pow ); - - // safety check for repeated points - if ( dt1 < 1e-4 ) dt1 = 1.0; - if ( dt0 < 1e-4 ) dt0 = dt1; - if ( dt2 < 1e-4 ) dt2 = dt1; - - px.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 ); - py.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 ); - pz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 ); - - } else if ( this.curveType === 'catmullrom' ) { - - px.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension ); - py.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension ); - pz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension ); - - } - - point.set( - px.calc( weight ), - py.calc( weight ), - pz.calc( weight ) - ); - - return point; - -}; - -CatmullRomCurve3.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.points = []; - - for ( var i = 0, l = source.points.length; i < l; i ++ ) { - - var point = source.points[ i ]; - - this.points.push( point.clone() ); - - } - - this.closed = source.closed; - this.curveType = source.curveType; - this.tension = source.tension; - - return this; - -}; - -CatmullRomCurve3.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.points = []; - - for ( var i = 0, l = this.points.length; i < l; i ++ ) { - - var point = this.points[ i ]; - data.points.push( point.toArray() ); - - } - - data.closed = this.closed; - data.curveType = this.curveType; - data.tension = this.tension; - - return data; - -}; - -CatmullRomCurve3.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.points = []; - - for ( var i = 0, l = json.points.length; i < l; i ++ ) { - - var point = json.points[ i ]; - this.points.push( new Vector3().fromArray( point ) ); - - } - - this.closed = json.closed; - this.curveType = json.curveType; - this.tension = json.tension; - - return this; - -}; - - -export { CatmullRomCurve3 }; diff --git a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.d.ts deleted file mode 100644 index 4310980233..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Curve } from './../core/Curve'; - -export class CubicBezierCurve extends Curve { - - constructor( v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2 ); - - v0: Vector2; - v1: Vector2; - v2: Vector2; - v3: Vector2; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.js b/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.js deleted file mode 100644 index 719bc2f43b..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve.js +++ /dev/null @@ -1,79 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { CubicBezier } from '../core/Interpolations.js'; -import { Vector2 } from '../../math/Vector2.js'; - - -function CubicBezierCurve( v0, v1, v2, v3 ) { - - Curve.call( this ); - - this.type = 'CubicBezierCurve'; - - this.v0 = v0 || new Vector2(); - this.v1 = v1 || new Vector2(); - this.v2 = v2 || new Vector2(); - this.v3 = v3 || new Vector2(); - -} - -CubicBezierCurve.prototype = Object.create( Curve.prototype ); -CubicBezierCurve.prototype.constructor = CubicBezierCurve; - -CubicBezierCurve.prototype.isCubicBezierCurve = true; - -CubicBezierCurve.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector2(); - - var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - - point.set( - CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), - CubicBezier( t, v0.y, v1.y, v2.y, v3.y ) - ); - - return point; - -}; - -CubicBezierCurve.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v0.copy( source.v0 ); - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - this.v3.copy( source.v3 ); - - return this; - -}; - -CubicBezierCurve.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - data.v3 = this.v3.toArray(); - - return data; - -}; - -CubicBezierCurve.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v0.fromArray( json.v0 ); - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - this.v3.fromArray( json.v3 ); - - return this; - -}; - - -export { CubicBezierCurve }; diff --git a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.d.ts b/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.d.ts deleted file mode 100644 index 402ed76221..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Vector3 } from './../../math/Vector3'; -import { Curve } from './../core/Curve'; - -export class CubicBezierCurve3 extends Curve { - - constructor( v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3 ); - - v0: Vector3; - v1: Vector3; - v2: Vector3; - v3: Vector3; - - getPoint( t: number ): Vector3; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.js b/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.js deleted file mode 100644 index 3864f011e6..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/CubicBezierCurve3.js +++ /dev/null @@ -1,80 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { CubicBezier } from '../core/Interpolations.js'; -import { Vector3 } from '../../math/Vector3.js'; - - -function CubicBezierCurve3( v0, v1, v2, v3 ) { - - Curve.call( this ); - - this.type = 'CubicBezierCurve3'; - - this.v0 = v0 || new Vector3(); - this.v1 = v1 || new Vector3(); - this.v2 = v2 || new Vector3(); - this.v3 = v3 || new Vector3(); - -} - -CubicBezierCurve3.prototype = Object.create( Curve.prototype ); -CubicBezierCurve3.prototype.constructor = CubicBezierCurve3; - -CubicBezierCurve3.prototype.isCubicBezierCurve3 = true; - -CubicBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector3(); - - var v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3; - - point.set( - CubicBezier( t, v0.x, v1.x, v2.x, v3.x ), - CubicBezier( t, v0.y, v1.y, v2.y, v3.y ), - CubicBezier( t, v0.z, v1.z, v2.z, v3.z ) - ); - - return point; - -}; - -CubicBezierCurve3.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v0.copy( source.v0 ); - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - this.v3.copy( source.v3 ); - - return this; - -}; - -CubicBezierCurve3.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - data.v3 = this.v3.toArray(); - - return data; - -}; - -CubicBezierCurve3.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v0.fromArray( json.v0 ); - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - this.v3.fromArray( json.v3 ); - - return this; - -}; - - -export { CubicBezierCurve3 }; diff --git a/cases/esbuild-three/src/base/extras/curves/Curves.d.ts b/cases/esbuild-three/src/base/extras/curves/Curves.d.ts deleted file mode 100644 index e89592bc67..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/Curves.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './ArcCurve'; -export * from './CatmullRomCurve3'; -export * from './CubicBezierCurve'; -export * from './CubicBezierCurve3'; -export * from './EllipseCurve'; -export * from './LineCurve'; -export * from './LineCurve3'; -export * from './QuadraticBezierCurve'; -export * from './QuadraticBezierCurve3'; -export * from './SplineCurve'; diff --git a/cases/esbuild-three/src/base/extras/curves/Curves.js b/cases/esbuild-three/src/base/extras/curves/Curves.js deleted file mode 100644 index c984a85394..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/Curves.js +++ /dev/null @@ -1,10 +0,0 @@ -export { ArcCurve } from './ArcCurve.js'; -export { CatmullRomCurve3 } from './CatmullRomCurve3.js'; -export { CubicBezierCurve } from './CubicBezierCurve.js'; -export { CubicBezierCurve3 } from './CubicBezierCurve3.js'; -export { EllipseCurve } from './EllipseCurve.js'; -export { LineCurve } from './LineCurve.js'; -export { LineCurve3 } from './LineCurve3.js'; -export { QuadraticBezierCurve } from './QuadraticBezierCurve.js'; -export { QuadraticBezierCurve3 } from './QuadraticBezierCurve3.js'; -export { SplineCurve } from './SplineCurve.js'; diff --git a/cases/esbuild-three/src/base/extras/curves/EllipseCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/EllipseCurve.d.ts deleted file mode 100644 index 8ff8d04fa7..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/EllipseCurve.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Curve } from './../core/Curve'; -import { Vector2 } from '../../math/Vector2'; - -export class EllipseCurve extends Curve { - - constructor( - aX: number, - aY: number, - xRadius: number, - yRadius: number, - aStartAngle: number, - aEndAngle: number, - aClockwise: boolean, - aRotation: number - ); - - aX: number; - aY: number; - xRadius: number; - yRadius: number; - aStartAngle: number; - aEndAngle: number; - aClockwise: boolean; - aRotation: number; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/EllipseCurve.js b/cases/esbuild-three/src/base/extras/curves/EllipseCurve.js deleted file mode 100644 index ea536e6501..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/EllipseCurve.js +++ /dev/null @@ -1,158 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { Vector2 } from '../../math/Vector2.js'; - - -function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { - - Curve.call( this ); - - this.type = 'EllipseCurve'; - - this.aX = aX || 0; - this.aY = aY || 0; - - this.xRadius = xRadius || 1; - this.yRadius = yRadius || 1; - - this.aStartAngle = aStartAngle || 0; - this.aEndAngle = aEndAngle || 2 * Math.PI; - - this.aClockwise = aClockwise || false; - - this.aRotation = aRotation || 0; - -} - -EllipseCurve.prototype = Object.create( Curve.prototype ); -EllipseCurve.prototype.constructor = EllipseCurve; - -EllipseCurve.prototype.isEllipseCurve = true; - -EllipseCurve.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector2(); - - var twoPi = Math.PI * 2; - var deltaAngle = this.aEndAngle - this.aStartAngle; - var samePoints = Math.abs( deltaAngle ) < Number.EPSILON; - - // ensures that deltaAngle is 0 .. 2 PI - while ( deltaAngle < 0 ) deltaAngle += twoPi; - while ( deltaAngle > twoPi ) deltaAngle -= twoPi; - - if ( deltaAngle < Number.EPSILON ) { - - if ( samePoints ) { - - deltaAngle = 0; - - } else { - - deltaAngle = twoPi; - - } - - } - - if ( this.aClockwise === true && ! samePoints ) { - - if ( deltaAngle === twoPi ) { - - deltaAngle = - twoPi; - - } else { - - deltaAngle = deltaAngle - twoPi; - - } - - } - - var angle = this.aStartAngle + t * deltaAngle; - var x = this.aX + this.xRadius * Math.cos( angle ); - var y = this.aY + this.yRadius * Math.sin( angle ); - - if ( this.aRotation !== 0 ) { - - var cos = Math.cos( this.aRotation ); - var sin = Math.sin( this.aRotation ); - - var tx = x - this.aX; - var ty = y - this.aY; - - // Rotate the point about the center of the ellipse. - x = tx * cos - ty * sin + this.aX; - y = tx * sin + ty * cos + this.aY; - - } - - return point.set( x, y ); - -}; - -EllipseCurve.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.aX = source.aX; - this.aY = source.aY; - - this.xRadius = source.xRadius; - this.yRadius = source.yRadius; - - this.aStartAngle = source.aStartAngle; - this.aEndAngle = source.aEndAngle; - - this.aClockwise = source.aClockwise; - - this.aRotation = source.aRotation; - - return this; - -}; - - -EllipseCurve.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.aX = this.aX; - data.aY = this.aY; - - data.xRadius = this.xRadius; - data.yRadius = this.yRadius; - - data.aStartAngle = this.aStartAngle; - data.aEndAngle = this.aEndAngle; - - data.aClockwise = this.aClockwise; - - data.aRotation = this.aRotation; - - return data; - -}; - -EllipseCurve.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.aX = json.aX; - this.aY = json.aY; - - this.xRadius = json.xRadius; - this.yRadius = json.yRadius; - - this.aStartAngle = json.aStartAngle; - this.aEndAngle = json.aEndAngle; - - this.aClockwise = json.aClockwise; - - this.aRotation = json.aRotation; - - return this; - -}; - - -export { EllipseCurve }; diff --git a/cases/esbuild-three/src/base/extras/curves/LineCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/LineCurve.d.ts deleted file mode 100644 index 270c58560a..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/LineCurve.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Curve } from './../core/Curve'; - -export class LineCurve extends Curve { - - constructor( v1: Vector2, v2: Vector2 ); - - v1: Vector2; - v2: Vector2; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/LineCurve.js b/cases/esbuild-three/src/base/extras/curves/LineCurve.js deleted file mode 100644 index 6185f35375..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/LineCurve.js +++ /dev/null @@ -1,90 +0,0 @@ -import { Vector2 } from '../../math/Vector2.js'; -import { Curve } from '../core/Curve.js'; - - -function LineCurve( v1, v2 ) { - - Curve.call( this ); - - this.type = 'LineCurve'; - - this.v1 = v1 || new Vector2(); - this.v2 = v2 || new Vector2(); - -} - -LineCurve.prototype = Object.create( Curve.prototype ); -LineCurve.prototype.constructor = LineCurve; - -LineCurve.prototype.isLineCurve = true; - -LineCurve.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector2(); - - if ( t === 1 ) { - - point.copy( this.v2 ); - - } else { - - point.copy( this.v2 ).sub( this.v1 ); - point.multiplyScalar( t ).add( this.v1 ); - - } - - return point; - -}; - -// Line curve is linear, so we can overwrite default getPointAt - -LineCurve.prototype.getPointAt = function ( u, optionalTarget ) { - - return this.getPoint( u, optionalTarget ); - -}; - -LineCurve.prototype.getTangent = function ( /* t */ ) { - - var tangent = this.v2.clone().sub( this.v1 ); - - return tangent.normalize(); - -}; - -LineCurve.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - - return this; - -}; - -LineCurve.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - - return data; - -}; - -LineCurve.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - - return this; - -}; - - -export { LineCurve }; diff --git a/cases/esbuild-three/src/base/extras/curves/LineCurve3.d.ts b/cases/esbuild-three/src/base/extras/curves/LineCurve3.d.ts deleted file mode 100644 index be96881e80..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/LineCurve3.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Vector3 } from './../../math/Vector3'; -import { Curve } from './../core/Curve'; - -export class LineCurve3 extends Curve { - - constructor( v1: Vector3, v2: Vector3 ); - - v1: Vector3; - v2: Vector3; - - getPoint( t: number ): Vector3; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/LineCurve3.js b/cases/esbuild-three/src/base/extras/curves/LineCurve3.js deleted file mode 100644 index 5ee830ac2c..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/LineCurve3.js +++ /dev/null @@ -1,82 +0,0 @@ -import { Vector3 } from '../../math/Vector3.js'; -import { Curve } from '../core/Curve.js'; - - -function LineCurve3( v1, v2 ) { - - Curve.call( this ); - - this.type = 'LineCurve3'; - - this.v1 = v1 || new Vector3(); - this.v2 = v2 || new Vector3(); - -} - -LineCurve3.prototype = Object.create( Curve.prototype ); -LineCurve3.prototype.constructor = LineCurve3; - -LineCurve3.prototype.isLineCurve3 = true; - -LineCurve3.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector3(); - - if ( t === 1 ) { - - point.copy( this.v2 ); - - } else { - - point.copy( this.v2 ).sub( this.v1 ); - point.multiplyScalar( t ).add( this.v1 ); - - } - - return point; - -}; - -// Line curve is linear, so we can overwrite default getPointAt - -LineCurve3.prototype.getPointAt = function ( u, optionalTarget ) { - - return this.getPoint( u, optionalTarget ); - -}; - -LineCurve3.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - - return this; - -}; - -LineCurve3.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - - return data; - -}; - -LineCurve3.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - - return this; - -}; - - -export { LineCurve3 }; diff --git a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.d.ts deleted file mode 100644 index 344d109d4f..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Curve } from './../core/Curve'; - -export class QuadraticBezierCurve extends Curve { - - constructor( v0: Vector2, v1: Vector2, v2: Vector2 ); - - v0: Vector2; - v1: Vector2; - v2: Vector2; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.js b/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.js deleted file mode 100644 index 71db15320b..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve.js +++ /dev/null @@ -1,75 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { QuadraticBezier } from '../core/Interpolations.js'; -import { Vector2 } from '../../math/Vector2.js'; - - -function QuadraticBezierCurve( v0, v1, v2 ) { - - Curve.call( this ); - - this.type = 'QuadraticBezierCurve'; - - this.v0 = v0 || new Vector2(); - this.v1 = v1 || new Vector2(); - this.v2 = v2 || new Vector2(); - -} - -QuadraticBezierCurve.prototype = Object.create( Curve.prototype ); -QuadraticBezierCurve.prototype.constructor = QuadraticBezierCurve; - -QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true; - -QuadraticBezierCurve.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector2(); - - var v0 = this.v0, v1 = this.v1, v2 = this.v2; - - point.set( - QuadraticBezier( t, v0.x, v1.x, v2.x ), - QuadraticBezier( t, v0.y, v1.y, v2.y ) - ); - - return point; - -}; - -QuadraticBezierCurve.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v0.copy( source.v0 ); - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - - return this; - -}; - -QuadraticBezierCurve.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - - return data; - -}; - -QuadraticBezierCurve.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v0.fromArray( json.v0 ); - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - - return this; - -}; - - -export { QuadraticBezierCurve }; diff --git a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.d.ts b/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.d.ts deleted file mode 100644 index 77ec4350c3..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Vector3 } from './../../math/Vector3'; -import { Curve } from './../core/Curve'; - -export class QuadraticBezierCurve3 extends Curve { - - constructor( v0: Vector3, v1: Vector3, v2: Vector3 ); - - v0: Vector3; - v1: Vector3; - v2: Vector3; - - getPoint( t: number ): Vector3; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.js b/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.js deleted file mode 100644 index ab2042d104..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/QuadraticBezierCurve3.js +++ /dev/null @@ -1,76 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { QuadraticBezier } from '../core/Interpolations.js'; -import { Vector3 } from '../../math/Vector3.js'; - - -function QuadraticBezierCurve3( v0, v1, v2 ) { - - Curve.call( this ); - - this.type = 'QuadraticBezierCurve3'; - - this.v0 = v0 || new Vector3(); - this.v1 = v1 || new Vector3(); - this.v2 = v2 || new Vector3(); - -} - -QuadraticBezierCurve3.prototype = Object.create( Curve.prototype ); -QuadraticBezierCurve3.prototype.constructor = QuadraticBezierCurve3; - -QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true; - -QuadraticBezierCurve3.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector3(); - - var v0 = this.v0, v1 = this.v1, v2 = this.v2; - - point.set( - QuadraticBezier( t, v0.x, v1.x, v2.x ), - QuadraticBezier( t, v0.y, v1.y, v2.y ), - QuadraticBezier( t, v0.z, v1.z, v2.z ) - ); - - return point; - -}; - -QuadraticBezierCurve3.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.v0.copy( source.v0 ); - this.v1.copy( source.v1 ); - this.v2.copy( source.v2 ); - - return this; - -}; - -QuadraticBezierCurve3.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.v0 = this.v0.toArray(); - data.v1 = this.v1.toArray(); - data.v2 = this.v2.toArray(); - - return data; - -}; - -QuadraticBezierCurve3.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.v0.fromArray( json.v0 ); - this.v1.fromArray( json.v1 ); - this.v2.fromArray( json.v2 ); - - return this; - -}; - - -export { QuadraticBezierCurve3 }; diff --git a/cases/esbuild-three/src/base/extras/curves/SplineCurve.d.ts b/cases/esbuild-three/src/base/extras/curves/SplineCurve.d.ts deleted file mode 100644 index 37d10d24e7..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/SplineCurve.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Vector2 } from './../../math/Vector2'; -import { Curve } from './../core/Curve'; - -export class SplineCurve extends Curve { - - constructor( points?: Vector2[] ); - - points: Vector2[]; - -} diff --git a/cases/esbuild-three/src/base/extras/curves/SplineCurve.js b/cases/esbuild-three/src/base/extras/curves/SplineCurve.js deleted file mode 100644 index e844b002c8..0000000000 --- a/cases/esbuild-three/src/base/extras/curves/SplineCurve.js +++ /dev/null @@ -1,98 +0,0 @@ -import { Curve } from '../core/Curve.js'; -import { CatmullRom } from '../core/Interpolations.js'; -import { Vector2 } from '../../math/Vector2.js'; - - -function SplineCurve( points /* array of Vector2 */ ) { - - Curve.call( this ); - - this.type = 'SplineCurve'; - - this.points = points || []; - -} - -SplineCurve.prototype = Object.create( Curve.prototype ); -SplineCurve.prototype.constructor = SplineCurve; - -SplineCurve.prototype.isSplineCurve = true; - -SplineCurve.prototype.getPoint = function ( t, optionalTarget ) { - - var point = optionalTarget || new Vector2(); - - var points = this.points; - var p = ( points.length - 1 ) * t; - - var intPoint = Math.floor( p ); - var weight = p - intPoint; - - var p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ]; - var p1 = points[ intPoint ]; - var p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; - var p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; - - point.set( - CatmullRom( weight, p0.x, p1.x, p2.x, p3.x ), - CatmullRom( weight, p0.y, p1.y, p2.y, p3.y ) - ); - - return point; - -}; - -SplineCurve.prototype.copy = function ( source ) { - - Curve.prototype.copy.call( this, source ); - - this.points = []; - - for ( var i = 0, l = source.points.length; i < l; i ++ ) { - - var point = source.points[ i ]; - - this.points.push( point.clone() ); - - } - - return this; - -}; - -SplineCurve.prototype.toJSON = function () { - - var data = Curve.prototype.toJSON.call( this ); - - data.points = []; - - for ( var i = 0, l = this.points.length; i < l; i ++ ) { - - var point = this.points[ i ]; - data.points.push( point.toArray() ); - - } - - return data; - -}; - -SplineCurve.prototype.fromJSON = function ( json ) { - - Curve.prototype.fromJSON.call( this, json ); - - this.points = []; - - for ( var i = 0, l = json.points.length; i < l; i ++ ) { - - var point = json.points[ i ]; - this.points.push( new Vector2().fromArray( point ) ); - - } - - return this; - -}; - - -export { SplineCurve }; diff --git a/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.d.ts b/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.d.ts deleted file mode 100644 index 3145ad7def..0000000000 --- a/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Object3D } from './../../core/Object3D'; -import { Material } from './../../materials/Material'; - -// Extras / Objects ///////////////////////////////////////////////////////////////////// - -export class ImmediateRenderObject extends Object3D { - - constructor( material: Material ); - - material: Material; - render( renderCallback: Function ): void; - -} diff --git a/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.js b/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.js deleted file mode 100644 index f10becfd25..0000000000 --- a/cases/esbuild-three/src/base/extras/objects/ImmediateRenderObject.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Object3D } from '../../core/Object3D.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -function ImmediateRenderObject( material ) { - - Object3D.call( this ); - - this.material = material; - this.render = function ( /* renderCallback */ ) {}; - -} - -ImmediateRenderObject.prototype = Object.create( Object3D.prototype ); -ImmediateRenderObject.prototype.constructor = ImmediateRenderObject; - -ImmediateRenderObject.prototype.isImmediateRenderObject = true; - - -export { ImmediateRenderObject }; diff --git a/cases/esbuild-three/src/base/geometries/BoxGeometry.d.ts b/cases/esbuild-three/src/base/geometries/BoxGeometry.d.ts deleted file mode 100644 index 9645280b9f..0000000000 --- a/cases/esbuild-three/src/base/geometries/BoxGeometry.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Geometry } from '../core/Geometry'; -import { BufferGeometry } from '../core/BufferGeometry'; - -// Extras / Geometries ///////////////////////////////////////////////////////////////////// -export class BoxBufferGeometry extends BufferGeometry { - - constructor( - width?: number, - height?: number, - depth?: number, - widthSegments?: number, - heightSegments?: number, - depthSegments?: number - ); - - parameters: { - width: number; - height: number; - depth: number; - widthSegments: number; - heightSegments: number; - depthSegments: number; - }; - -} - -/** - * BoxGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided within the (optional) 'width', 'height', & 'depth' constructor arguments. - */ -export class BoxGeometry extends Geometry { - - /** - * @param width — Width of the sides on the X axis. - * @param height — Height of the sides on the Y axis. - * @param depth — Depth of the sides on the Z axis. - * @param widthSegments — Number of segmented faces along the width of the sides. - * @param heightSegments — Number of segmented faces along the height of the sides. - * @param depthSegments — Number of segmented faces along the depth of the sides. - */ - constructor( - width?: number, - height?: number, - depth?: number, - widthSegments?: number, - heightSegments?: number, - depthSegments?: number - ); - - parameters: { - width: number; - height: number; - depth: number; - widthSegments: number; - heightSegments: number; - depthSegments: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/BoxGeometry.js b/cases/esbuild-three/src/base/geometries/BoxGeometry.js deleted file mode 100644 index b4dc014361..0000000000 --- a/cases/esbuild-three/src/base/geometries/BoxGeometry.js +++ /dev/null @@ -1,203 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -// BoxGeometry - -function BoxGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { - - Geometry.call( this ); - - this.type = 'BoxGeometry'; - - this.parameters = { - width: width, - height: height, - depth: depth, - widthSegments: widthSegments, - heightSegments: heightSegments, - depthSegments: depthSegments - }; - - this.fromBufferGeometry( new BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) ); - this.mergeVertices(); - -} - -BoxGeometry.prototype = Object.create( Geometry.prototype ); -BoxGeometry.prototype.constructor = BoxGeometry; - -// BoxBufferGeometry - -function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) { - - BufferGeometry.call( this ); - - this.type = 'BoxBufferGeometry'; - - this.parameters = { - width: width, - height: height, - depth: depth, - widthSegments: widthSegments, - heightSegments: heightSegments, - depthSegments: depthSegments - }; - - var scope = this; - - width = width || 1; - height = height || 1; - depth = depth || 1; - - // segments - - widthSegments = Math.floor( widthSegments ) || 1; - heightSegments = Math.floor( heightSegments ) || 1; - depthSegments = Math.floor( depthSegments ) || 1; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var numberOfVertices = 0; - var groupStart = 0; - - // build each side of the box geometry - - buildPlane( 'z', 'y', 'x', - 1, - 1, depth, height, width, depthSegments, heightSegments, 0 ); // px - buildPlane( 'z', 'y', 'x', 1, - 1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx - buildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py - buildPlane( 'x', 'z', 'y', 1, - 1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny - buildPlane( 'x', 'y', 'z', 1, - 1, width, height, depth, widthSegments, heightSegments, 4 ); // pz - buildPlane( 'x', 'y', 'z', - 1, - 1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) { - - var segmentWidth = width / gridX; - var segmentHeight = height / gridY; - - var widthHalf = width / 2; - var heightHalf = height / 2; - var depthHalf = depth / 2; - - var gridX1 = gridX + 1; - var gridY1 = gridY + 1; - - var vertexCounter = 0; - var groupCount = 0; - - var ix, iy; - - var vector = new Vector3(); - - // generate vertices, normals and uvs - - for ( iy = 0; iy < gridY1; iy ++ ) { - - var y = iy * segmentHeight - heightHalf; - - for ( ix = 0; ix < gridX1; ix ++ ) { - - var x = ix * segmentWidth - widthHalf; - - // set values to correct vector component - - vector[ u ] = x * udir; - vector[ v ] = y * vdir; - vector[ w ] = depthHalf; - - // now apply vector to vertex buffer - - vertices.push( vector.x, vector.y, vector.z ); - - // set values to correct vector component - - vector[ u ] = 0; - vector[ v ] = 0; - vector[ w ] = depth > 0 ? 1 : - 1; - - // now apply vector to normal buffer - - normals.push( vector.x, vector.y, vector.z ); - - // uvs - - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); - - // counters - - vertexCounter += 1; - - } - - } - - // indices - - // 1. you need three indices to draw a single face - // 2. a single segment consists of two faces - // 3. so we need to generate six (2*3) indices per segment - - for ( iy = 0; iy < gridY; iy ++ ) { - - for ( ix = 0; ix < gridX; ix ++ ) { - - var a = numberOfVertices + ix + gridX1 * iy; - var b = numberOfVertices + ix + gridX1 * ( iy + 1 ); - var c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = numberOfVertices + ( ix + 1 ) + gridX1 * iy; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - // increase counter - - groupCount += 6; - - } - - } - - // add a group to the geometry. this will ensure multi material support - - scope.addGroup( groupStart, groupCount, materialIndex ); - - // calculate new start value for groups - - groupStart += groupCount; - - // update total number of vertices - - numberOfVertices += vertexCounter; - - } - -} - -BoxBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -BoxBufferGeometry.prototype.constructor = BoxBufferGeometry; - - -export { BoxGeometry, BoxBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/CircleGeometry.d.ts b/cases/esbuild-three/src/base/geometries/CircleGeometry.d.ts deleted file mode 100644 index 8f8b365971..0000000000 --- a/cases/esbuild-three/src/base/geometries/CircleGeometry.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from '../core/BufferGeometry'; - -export class CircleBufferGeometry extends BufferGeometry { - - constructor( - radius?: number, - segments?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radius: number; - segments: number; - thetaStart: number; - thetaLength: number; - }; - -} - -export class CircleGeometry extends Geometry { - - constructor( - radius?: number, - segments?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radius: number; - segments: number; - thetaStart: number; - thetaLength: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/CircleGeometry.js b/cases/esbuild-three/src/base/geometries/CircleGeometry.js deleted file mode 100644 index 20904b9fbf..0000000000 --- a/cases/esbuild-three/src/base/geometries/CircleGeometry.js +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @author benaadams / https://twitter.com/ben_a_adams - * @author Mugen87 / https://github.com/Mugen87 - * @author hughes - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; - -// CircleGeometry - -function CircleGeometry( radius, segments, thetaStart, thetaLength ) { - - Geometry.call( this ); - - this.type = 'CircleGeometry'; - - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - this.fromBufferGeometry( new CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) ); - this.mergeVertices(); - -} - -CircleGeometry.prototype = Object.create( Geometry.prototype ); -CircleGeometry.prototype.constructor = CircleGeometry; - -// CircleBufferGeometry - -function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) { - - BufferGeometry.call( this ); - - this.type = 'CircleBufferGeometry'; - - this.parameters = { - radius: radius, - segments: segments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - radius = radius || 1; - segments = segments !== undefined ? Math.max( 3, segments ) : 8; - - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var i, s; - var vertex = new Vector3(); - var uv = new Vector2(); - - // center point - - vertices.push( 0, 0, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( 0.5, 0.5 ); - - for ( s = 0, i = 3; s <= segments; s ++, i += 3 ) { - - var segment = thetaStart + s / segments * thetaLength; - - // vertex - - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - normals.push( 0, 0, 1 ); - - // uvs - - uv.x = ( vertices[ i ] / radius + 1 ) / 2; - uv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2; - - uvs.push( uv.x, uv.y ); - - } - - // indices - - for ( i = 1; i <= segments; i ++ ) { - - indices.push( i, i + 1, 0 ); - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -CircleBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -CircleBufferGeometry.prototype.constructor = CircleBufferGeometry; - - -export { CircleGeometry, CircleBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/ConeGeometry.d.ts b/cases/esbuild-three/src/base/geometries/ConeGeometry.d.ts deleted file mode 100644 index 04340a986d..0000000000 --- a/cases/esbuild-three/src/base/geometries/ConeGeometry.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { CylinderGeometry } from './CylinderGeometry'; -import { CylinderBufferGeometry } from './CylinderGeometry'; - -export class ConeBufferGeometry extends CylinderBufferGeometry { - - constructor( - radius?: number, - height?: number, - radialSegment?: number, - heightSegment?: number, - openEnded?: boolean, - thetaStart?: number, - thetaLength?: number - ); - -} - -export class ConeGeometry extends CylinderGeometry { - - constructor( - radius?: number, - height?: number, - radialSegment?: number, - heightSegment?: number, - openEnded?: boolean, - thetaStart?: number, - thetaLength?: number - ); - -} diff --git a/cases/esbuild-three/src/base/geometries/ConeGeometry.js b/cases/esbuild-three/src/base/geometries/ConeGeometry.js deleted file mode 100644 index 21df9ac0c5..0000000000 --- a/cases/esbuild-three/src/base/geometries/ConeGeometry.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author abelnation / http://github.com/abelnation - */ - -import { CylinderGeometry } from './CylinderGeometry.js'; -import { CylinderBufferGeometry } from './CylinderGeometry.js'; - -// ConeGeometry - -function ConeGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - CylinderGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - this.type = 'ConeGeometry'; - - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - -} - -ConeGeometry.prototype = Object.create( CylinderGeometry.prototype ); -ConeGeometry.prototype.constructor = ConeGeometry; - -// ConeBufferGeometry - -function ConeBufferGeometry( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - CylinderBufferGeometry.call( this, 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ); - - this.type = 'ConeBufferGeometry'; - - this.parameters = { - radius: radius, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - -} - -ConeBufferGeometry.prototype = Object.create( CylinderBufferGeometry.prototype ); -ConeBufferGeometry.prototype.constructor = ConeBufferGeometry; - - -export { ConeGeometry, ConeBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/CylinderGeometry.d.ts b/cases/esbuild-three/src/base/geometries/CylinderGeometry.d.ts deleted file mode 100644 index eaad678bcb..0000000000 --- a/cases/esbuild-three/src/base/geometries/CylinderGeometry.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from '../core/BufferGeometry'; - -export class CylinderBufferGeometry extends BufferGeometry { - - constructor( - radiusTop?: number, - radiusBottom?: number, - height?: number, - radialSegments?: number, - heightSegments?: number, - openEnded?: boolean, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radiusTop: number; - radiusBottom: number; - height: number; - radialSegments: number; - heightSegments: number; - openEnded: boolean; - thetaStart: number; - thetaLength: number; - }; - -} - -export class CylinderGeometry extends Geometry { - - /** - * @param radiusTop — Radius of the cylinder at the top. - * @param radiusBottom — Radius of the cylinder at the bottom. - * @param height — Height of the cylinder. - * @param radiusSegments — Number of segmented faces around the circumference of the cylinder. - * @param heightSegments — Number of rows of faces along the height of the cylinder. - * @param openEnded - A Boolean indicating whether or not to cap the ends of the cylinder. - */ - constructor( - radiusTop?: number, - radiusBottom?: number, - height?: number, - radiusSegments?: number, - heightSegments?: number, - openEnded?: boolean, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radiusTop: number; - radiusBottom: number; - height: number; - radialSegments: number; - heightSegments: number; - openEnded: boolean; - thetaStart: number; - thetaLength: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/CylinderGeometry.js b/cases/esbuild-three/src/base/geometries/CylinderGeometry.js deleted file mode 100644 index e345a03742..0000000000 --- a/cases/esbuild-three/src/base/geometries/CylinderGeometry.js +++ /dev/null @@ -1,316 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; - -// CylinderGeometry - -function CylinderGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - Geometry.call( this ); - - this.type = 'CylinderGeometry'; - - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - this.fromBufferGeometry( new CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) ); - this.mergeVertices(); - -} - -CylinderGeometry.prototype = Object.create( Geometry.prototype ); -CylinderGeometry.prototype.constructor = CylinderGeometry; - -// CylinderBufferGeometry - -function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) { - - BufferGeometry.call( this ); - - this.type = 'CylinderBufferGeometry'; - - this.parameters = { - radiusTop: radiusTop, - radiusBottom: radiusBottom, - height: height, - radialSegments: radialSegments, - heightSegments: heightSegments, - openEnded: openEnded, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - var scope = this; - - radiusTop = radiusTop !== undefined ? radiusTop : 1; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 1; - height = height || 1; - - radialSegments = Math.floor( radialSegments ) || 8; - heightSegments = Math.floor( heightSegments ) || 1; - - openEnded = openEnded !== undefined ? openEnded : false; - thetaStart = thetaStart !== undefined ? thetaStart : 0.0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var index = 0; - var indexArray = []; - var halfHeight = height / 2; - var groupStart = 0; - - // generate geometry - - generateTorso(); - - if ( openEnded === false ) { - - if ( radiusTop > 0 ) generateCap( true ); - if ( radiusBottom > 0 ) generateCap( false ); - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - function generateTorso() { - - var x, y; - var normal = new Vector3(); - var vertex = new Vector3(); - - var groupCount = 0; - - // this will be used to calculate the normal - var slope = ( radiusBottom - radiusTop ) / height; - - // generate vertices, normals and uvs - - for ( y = 0; y <= heightSegments; y ++ ) { - - var indexRow = []; - - var v = y / heightSegments; - - // calculate the radius of the current row - - var radius = v * ( radiusBottom - radiusTop ) + radiusTop; - - for ( x = 0; x <= radialSegments; x ++ ) { - - var u = x / radialSegments; - - var theta = u * thetaLength + thetaStart; - - var sinTheta = Math.sin( theta ); - var cosTheta = Math.cos( theta ); - - // vertex - - vertex.x = radius * sinTheta; - vertex.y = - v * height + halfHeight; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - normal.set( sinTheta, slope, cosTheta ).normalize(); - normals.push( normal.x, normal.y, normal.z ); - - // uv - - uvs.push( u, 1 - v ); - - // save index of vertex in respective row - - indexRow.push( index ++ ); - - } - - // now save vertices of the row in our index array - - indexArray.push( indexRow ); - - } - - // generate indices - - for ( x = 0; x < radialSegments; x ++ ) { - - for ( y = 0; y < heightSegments; y ++ ) { - - // we use the index array to access the correct indices - - var a = indexArray[ y ][ x ]; - var b = indexArray[ y + 1 ][ x ]; - var c = indexArray[ y + 1 ][ x + 1 ]; - var d = indexArray[ y ][ x + 1 ]; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - // update group counter - - groupCount += 6; - - } - - } - - // add a group to the geometry. this will ensure multi material support - - scope.addGroup( groupStart, groupCount, 0 ); - - // calculate new start value for groups - - groupStart += groupCount; - - } - - function generateCap( top ) { - - var x, centerIndexStart, centerIndexEnd; - - var uv = new Vector2(); - var vertex = new Vector3(); - - var groupCount = 0; - - var radius = ( top === true ) ? radiusTop : radiusBottom; - var sign = ( top === true ) ? 1 : - 1; - - // save the index of the first center vertex - centerIndexStart = index; - - // first we generate the center vertex data of the cap. - // because the geometry needs one set of uvs per face, - // we must generate a center vertex per face/segment - - for ( x = 1; x <= radialSegments; x ++ ) { - - // vertex - - vertices.push( 0, halfHeight * sign, 0 ); - - // normal - - normals.push( 0, sign, 0 ); - - // uv - - uvs.push( 0.5, 0.5 ); - - // increase index - - index ++; - - } - - // save the index of the last center vertex - - centerIndexEnd = index; - - // now we generate the surrounding vertices, normals and uvs - - for ( x = 0; x <= radialSegments; x ++ ) { - - var u = x / radialSegments; - var theta = u * thetaLength + thetaStart; - - var cosTheta = Math.cos( theta ); - var sinTheta = Math.sin( theta ); - - // vertex - - vertex.x = radius * sinTheta; - vertex.y = halfHeight * sign; - vertex.z = radius * cosTheta; - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - normals.push( 0, sign, 0 ); - - // uv - - uv.x = ( cosTheta * 0.5 ) + 0.5; - uv.y = ( sinTheta * 0.5 * sign ) + 0.5; - uvs.push( uv.x, uv.y ); - - // increase index - - index ++; - - } - - // generate indices - - for ( x = 0; x < radialSegments; x ++ ) { - - var c = centerIndexStart + x; - var i = centerIndexEnd + x; - - if ( top === true ) { - - // face top - - indices.push( i, i + 1, c ); - - } else { - - // face bottom - - indices.push( i + 1, i, c ); - - } - - groupCount += 3; - - } - - // add a group to the geometry. this will ensure multi material support - - scope.addGroup( groupStart, groupCount, top === true ? 1 : 2 ); - - // calculate new start value for groups - - groupStart += groupCount; - - } - -} - -CylinderBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -CylinderBufferGeometry.prototype.constructor = CylinderBufferGeometry; - - -export { CylinderGeometry, CylinderBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.d.ts b/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.d.ts deleted file mode 100644 index ea97fa17b0..0000000000 --- a/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { PolyhedronBufferGeometry } from './PolyhedronGeometry'; - -export class DodecahedronBufferGeometry extends PolyhedronBufferGeometry { - - constructor( radius?: number, detail?: number ); - -} - -export class DodecahedronGeometry extends Geometry { - - constructor( radius?: number, detail?: number ); - - parameters: { - radius: number; - detail: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.js b/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.js deleted file mode 100644 index 384ee81b6b..0000000000 --- a/cases/esbuild-three/src/base/geometries/DodecahedronGeometry.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Abe Pazos / https://hamoid.com - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { PolyhedronBufferGeometry } from './PolyhedronGeometry.js'; - -// DodecahedronGeometry - -function DodecahedronGeometry( radius, detail ) { - - Geometry.call( this ); - - this.type = 'DodecahedronGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - - this.fromBufferGeometry( new DodecahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); - -} - -DodecahedronGeometry.prototype = Object.create( Geometry.prototype ); -DodecahedronGeometry.prototype.constructor = DodecahedronGeometry; - -// DodecahedronBufferGeometry - -function DodecahedronBufferGeometry( radius, detail ) { - - var t = ( 1 + Math.sqrt( 5 ) ) / 2; - var r = 1 / t; - - var vertices = [ - - // (±1, ±1, ±1) - - 1, - 1, - 1, - 1, - 1, 1, - - 1, 1, - 1, - 1, 1, 1, - 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, 1, 1, 1, - - // (0, ±1/φ, ±φ) - 0, - r, - t, 0, - r, t, - 0, r, - t, 0, r, t, - - // (±1/φ, ±φ, 0) - - r, - t, 0, - r, t, 0, - r, - t, 0, r, t, 0, - - // (±φ, 0, ±1/φ) - - t, 0, - r, t, 0, - r, - - t, 0, r, t, 0, r - ]; - - var indices = [ - 3, 11, 7, 3, 7, 15, 3, 15, 13, - 7, 19, 17, 7, 17, 6, 7, 6, 15, - 17, 4, 8, 17, 8, 10, 17, 10, 6, - 8, 0, 16, 8, 16, 2, 8, 2, 10, - 0, 12, 1, 0, 1, 18, 0, 18, 16, - 6, 10, 2, 6, 2, 13, 6, 13, 15, - 2, 16, 18, 2, 18, 3, 2, 3, 13, - 18, 1, 9, 18, 9, 11, 18, 11, 3, - 4, 14, 12, 4, 12, 0, 4, 0, 8, - 11, 9, 5, 11, 5, 19, 11, 19, 7, - 19, 5, 14, 19, 14, 4, 19, 4, 17, - 1, 12, 14, 1, 14, 5, 1, 5, 9 - ]; - - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - - this.type = 'DodecahedronBufferGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - -} - -DodecahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -DodecahedronBufferGeometry.prototype.constructor = DodecahedronBufferGeometry; - - -export { DodecahedronGeometry, DodecahedronBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/EdgesGeometry.d.ts b/cases/esbuild-three/src/base/geometries/EdgesGeometry.d.ts deleted file mode 100644 index 86a75108d6..0000000000 --- a/cases/esbuild-three/src/base/geometries/EdgesGeometry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BufferGeometry } from '../core/BufferGeometry'; -import { Geometry } from '../core/Geometry'; - -export class EdgesGeometry extends BufferGeometry { - - constructor( geometry: BufferGeometry | Geometry, thresholdAngle?: number ); - -} diff --git a/cases/esbuild-three/src/base/geometries/EdgesGeometry.js b/cases/esbuild-three/src/base/geometries/EdgesGeometry.js deleted file mode 100644 index aef6085759..0000000000 --- a/cases/esbuild-three/src/base/geometries/EdgesGeometry.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Geometry } from '../core/Geometry.js'; -import { _Math } from '../math/Math.js'; - -function EdgesGeometry( geometry, thresholdAngle ) { - - BufferGeometry.call( this ); - - this.type = 'EdgesGeometry'; - - this.parameters = { - thresholdAngle: thresholdAngle - }; - - thresholdAngle = ( thresholdAngle !== undefined ) ? thresholdAngle : 1; - - // buffer - - var vertices = []; - - // helper variables - - var thresholdDot = Math.cos( _Math.DEG2RAD * thresholdAngle ); - var edge = [ 0, 0 ], edges = {}, edge1, edge2; - var key, keys = [ 'a', 'b', 'c' ]; - - // prepare source geometry - - var geometry2; - - if ( geometry.isBufferGeometry ) { - - geometry2 = new Geometry(); - geometry2.fromBufferGeometry( geometry ); - - } else { - - geometry2 = geometry.clone(); - - } - - geometry2.mergeVertices(); - geometry2.computeFaceNormals(); - - var sourceVertices = geometry2.vertices; - var faces = geometry2.faces; - - // now create a data structure where each entry represents an edge with its adjoining faces - - for ( var i = 0, l = faces.length; i < l; i ++ ) { - - var face = faces[ i ]; - - for ( var j = 0; j < 3; j ++ ) { - - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); - edge[ 1 ] = Math.max( edge1, edge2 ); - - key = edge[ 0 ] + ',' + edge[ 1 ]; - - if ( edges[ key ] === undefined ) { - - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ], face1: i, face2: undefined }; - - } else { - - edges[ key ].face2 = i; - - } - - } - - } - - // generate vertices - - for ( key in edges ) { - - var e = edges[ key ]; - - // an edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. default = 1 degree. - - if ( e.face2 === undefined || faces[ e.face1 ].normal.dot( faces[ e.face2 ].normal ) <= thresholdDot ) { - - var vertex = sourceVertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); - - vertex = sourceVertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - } - - // build geometry - - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - -} - -EdgesGeometry.prototype = Object.create( BufferGeometry.prototype ); -EdgesGeometry.prototype.constructor = EdgesGeometry; - - -export { EdgesGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.d.ts b/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.d.ts deleted file mode 100644 index e471203b9e..0000000000 --- a/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Curve } from './../extras/core/Curve'; -import { UVGenerator } from './ExtrudeGeometry'; -import { Vector2 } from './../math/Vector2'; -import { Vector3 } from './../math/Vector3'; -import { Shape } from './../extras/core/Shape'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export interface ExtrudeGeometryOptions { - curveSegments?: number; - steps?: number; - depth?: number; - bevelEnabled?: boolean; - bevelThickness?: number; - bevelSize?: number; - bevelOffset?: number; - bevelSegments?: number; - extrudePath?: Curve; - UVGenerator?: UVGenerator; -} - -export interface UVGenerator { - generateTopUV( - geometry: ExtrudeBufferGeometry, - vertices: number[], - indexA: number, - indexB: number, - indexC: number - ): Vector2[]; - generateSideWallUV( - geometry: ExtrudeBufferGeometry, - vertices: number[], - indexA: number, - indexB: number, - indexC: number, - indexD: number - ): Vector2[]; -} - -export class ExtrudeBufferGeometry extends BufferGeometry { - - constructor( shapes: Shape | Shape[], options?: ExtrudeGeometryOptions ); - - static WorldUVGenerator: UVGenerator; - - addShapeList( shapes: Shape[], options?: any ): void; - addShape( shape: Shape, options?: any ): void; - -} - -export class ExtrudeGeometry extends Geometry { - - constructor( shapes: Shape | Shape[], options?: ExtrudeGeometryOptions ); - - static WorldUVGenerator: UVGenerator; - - addShapeList( shapes: Shape[], options?: any ): void; - addShape( shape: Shape, options?: any ): void; - -} diff --git a/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.js b/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.js deleted file mode 100644 index 14c6d9dd15..0000000000 --- a/cases/esbuild-three/src/base/geometries/ExtrudeGeometry.js +++ /dev/null @@ -1,835 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * Creates extruded geometry from a path shape. - * - * parameters = { - * - * curveSegments: , // number of points on the curves - * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too - * depth: , // Depth to extrude the shape - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into the original shape bevel goes - * bevelSize: , // how far from shape outline (including bevelOffset) is bevel - * bevelOffset: , // how far from shape outline does bevel start - * bevelSegments: , // number of bevel layers - * - * extrudePath: // curve to extrude shape along - * - * UVGenerator: // object that provides UV generator functions - * - * } - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { ShapeUtils } from '../extras/ShapeUtils.js'; - -// ExtrudeGeometry - -function ExtrudeGeometry( shapes, options ) { - - Geometry.call( this ); - - this.type = 'ExtrudeGeometry'; - - this.parameters = { - shapes: shapes, - options: options - }; - - this.fromBufferGeometry( new ExtrudeBufferGeometry( shapes, options ) ); - this.mergeVertices(); - -} - -ExtrudeGeometry.prototype = Object.create( Geometry.prototype ); -ExtrudeGeometry.prototype.constructor = ExtrudeGeometry; - -ExtrudeGeometry.prototype.toJSON = function () { - - var data = Geometry.prototype.toJSON.call( this ); - - var shapes = this.parameters.shapes; - var options = this.parameters.options; - - return toJSON( shapes, options, data ); - -}; - -// ExtrudeBufferGeometry - -function ExtrudeBufferGeometry( shapes, options ) { - - BufferGeometry.call( this ); - - this.type = 'ExtrudeBufferGeometry'; - - this.parameters = { - shapes: shapes, - options: options - }; - - shapes = Array.isArray( shapes ) ? shapes : [ shapes ]; - - var scope = this; - - var verticesArray = []; - var uvArray = []; - - for ( var i = 0, l = shapes.length; i < l; i ++ ) { - - var shape = shapes[ i ]; - addShape( shape ); - - } - - // build geometry - - this.addAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) ); - - this.computeVertexNormals(); - - // functions - - function addShape( shape ) { - - var placeholder = []; - - // options - - var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; - var steps = options.steps !== undefined ? options.steps : 1; - var depth = options.depth !== undefined ? options.depth : 100; - - var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; - var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; - var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; - var bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0; - var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; - - var extrudePath = options.extrudePath; - - var uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; - - // deprecated options - - if ( options.amount !== undefined ) { - - console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' ); - depth = options.amount; - - } - - // - - var extrudePts, extrudeByPath = false; - var splineTube, binormal, normal, position2; - - if ( extrudePath ) { - - extrudePts = extrudePath.getSpacedPoints( steps ); - - extrudeByPath = true; - bevelEnabled = false; // bevels not supported for path extrusion - - // SETUP TNB variables - - // TODO1 - have a .isClosed in spline? - - splineTube = extrudePath.computeFrenetFrames( steps, false ); - - // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length); - - binormal = new Vector3(); - normal = new Vector3(); - position2 = new Vector3(); - - } - - // Safeguards if bevels are not enabled - - if ( ! bevelEnabled ) { - - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; - bevelOffset = 0; - - } - - // Variables initialization - - var ahole, h, hl; // looping of holes - - var shapePoints = shape.extractPoints( curveSegments ); - - var vertices = shapePoints.shape; - var holes = shapePoints.holes; - - var reverse = ! ShapeUtils.isClockWise( vertices ); - - if ( reverse ) { - - vertices = vertices.reverse(); - - // Maybe we should also check if holes are in the opposite direction, just to be safe ... - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - if ( ShapeUtils.isClockWise( ahole ) ) { - - holes[ h ] = ahole.reverse(); - - } - - } - - } - - - var faces = ShapeUtils.triangulateShape( vertices, holes ); - - /* Vertices */ - - var contour = vertices; // vertices has all points but contour has only points of circumference - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - vertices = vertices.concat( ahole ); - - } - - - function scalePt2( pt, vec, size ) { - - if ( ! vec ) console.error( "THREE.ExtrudeGeometry: vec does not exist" ); - - return vec.clone().multiplyScalar( size ).add( pt ); - - } - - var b, bs, t, z, - vert, vlen = vertices.length, - face, flen = faces.length; - - - // Find directions for point movement - - - function getBevelVec( inPt, inPrev, inNext ) { - - // computes for inPt the corresponding point inPt' on a new contour - // shifted by 1 unit (length of normalized vector) to the left - // if we walk along contour clockwise, this new contour is outside the old one - // - // inPt' is the intersection of the two lines parallel to the two - // adjacent edges of inPt at a distance of 1 unit on the left side. - - var v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt - - // good reading for geometry algorithms (here: line-line intersection) - // http://geomalgorithms.com/a05-_intersect-1.html - - var v_prev_x = inPt.x - inPrev.x, - v_prev_y = inPt.y - inPrev.y; - var v_next_x = inNext.x - inPt.x, - v_next_y = inNext.y - inPt.y; - - var v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y ); - - // check for collinear edges - var collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - - if ( Math.abs( collinear0 ) > Number.EPSILON ) { - - // not collinear - - // length of vectors for normalizing - - var v_prev_len = Math.sqrt( v_prev_lensq ); - var v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y ); - - // shift adjacent points by unit vectors to the left - - var ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len ); - var ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len ); - - var ptNextShift_x = ( inNext.x - v_next_y / v_next_len ); - var ptNextShift_y = ( inNext.y + v_next_x / v_next_len ); - - // scaling factor for v_prev to intersection point - - var sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y - - ( ptNextShift_y - ptPrevShift_y ) * v_next_x ) / - ( v_prev_x * v_next_y - v_prev_y * v_next_x ); - - // vector from inPt to intersection point - - v_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x ); - v_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y ); - - // Don't normalize!, otherwise sharp corners become ugly - // but prevent crazy spikes - var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); - if ( v_trans_lensq <= 2 ) { - - return new Vector2( v_trans_x, v_trans_y ); - - } else { - - shrink_by = Math.sqrt( v_trans_lensq / 2 ); - - } - - } else { - - // handle special case of collinear edges - - var direction_eq = false; // assumes: opposite - if ( v_prev_x > Number.EPSILON ) { - - if ( v_next_x > Number.EPSILON ) { - - direction_eq = true; - - } - - } else { - - if ( v_prev_x < - Number.EPSILON ) { - - if ( v_next_x < - Number.EPSILON ) { - - direction_eq = true; - - } - - } else { - - if ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) { - - direction_eq = true; - - } - - } - - } - - if ( direction_eq ) { - - // console.log("Warning: lines are a straight sequence"); - v_trans_x = - v_prev_y; - v_trans_y = v_prev_x; - shrink_by = Math.sqrt( v_prev_lensq ); - - } else { - - // console.log("Warning: lines are a straight spike"); - v_trans_x = v_prev_x; - v_trans_y = v_prev_y; - shrink_by = Math.sqrt( v_prev_lensq / 2 ); - - } - - } - - return new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by ); - - } - - - var contourMovements = []; - - for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - - if ( j === il ) j = 0; - if ( k === il ) k = 0; - - // (j)---(i)---(k) - // console.log('i,j,k', i, j , k) - - contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); - - } - - var holesMovements = [], - oneHoleMovements, verticesMovements = contourMovements.concat(); - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - oneHoleMovements = []; - - for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - - if ( j === il ) j = 0; - if ( k === il ) k = 0; - - // (j)---(i)---(k) - oneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); - - } - - holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); - - } - - - // Loop bevelSegments, 1 for the front, 1 for the back - - for ( b = 0; b < bevelSegments; b ++ ) { - - //for ( b = bevelSegments; b > 0; b -- ) { - - t = b / bevelSegments; - z = bevelThickness * Math.cos( t * Math.PI / 2 ); - bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - - // contract shape - - for ( i = 0, il = contour.length; i < il; i ++ ) { - - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - - v( vert.x, vert.y, - z ); - - } - - // expand holes - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; - - for ( i = 0, il = ahole.length; i < il; i ++ ) { - - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - - v( vert.x, vert.y, - z ); - - } - - } - - } - - bs = bevelSize + bevelOffset; - - // Back facing vertices - - for ( i = 0; i < vlen; i ++ ) { - - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - - if ( ! extrudeByPath ) { - - v( vert.x, vert.y, 0 ); - - } else { - - // v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); - - normal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y ); - - position2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal ); - - v( position2.x, position2.y, position2.z ); - - } - - } - - // Add stepped vertices... - // Including front facing vertices - - var s; - - for ( s = 1; s <= steps; s ++ ) { - - for ( i = 0; i < vlen; i ++ ) { - - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - - if ( ! extrudeByPath ) { - - v( vert.x, vert.y, depth / steps * s ); - - } else { - - // v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); - - normal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x ); - binormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y ); - - position2.copy( extrudePts[ s ] ).add( normal ).add( binormal ); - - v( position2.x, position2.y, position2.z ); - - } - - } - - } - - - // Add bevel segments planes - - //for ( b = 1; b <= bevelSegments; b ++ ) { - for ( b = bevelSegments - 1; b >= 0; b -- ) { - - t = b / bevelSegments; - z = bevelThickness * Math.cos( t * Math.PI / 2 ); - bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset; - - // contract shape - - for ( i = 0, il = contour.length; i < il; i ++ ) { - - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - v( vert.x, vert.y, depth + z ); - - } - - // expand holes - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; - - for ( i = 0, il = ahole.length; i < il; i ++ ) { - - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - - if ( ! extrudeByPath ) { - - v( vert.x, vert.y, depth + z ); - - } else { - - v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); - - } - - } - - } - - } - - /* Faces */ - - // Top and bottom faces - - buildLidFaces(); - - // Sides faces - - buildSideFaces(); - - - ///// Internal functions - - function buildLidFaces() { - - var start = verticesArray.length / 3; - - if ( bevelEnabled ) { - - var layer = 0; // steps + 1 - var offset = vlen * layer; - - // Bottom faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset ); - - } - - layer = steps + bevelSegments * 2; - offset = vlen * layer; - - // Top faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); - - } - - } else { - - // Bottom faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 2 ], face[ 1 ], face[ 0 ] ); - - } - - // Top faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); - - } - - } - - scope.addGroup( start, verticesArray.length / 3 - start, 0 ); - - } - - // Create faces for the z-sides of the shape - - function buildSideFaces() { - - var start = verticesArray.length / 3; - var layeroffset = 0; - sidewalls( contour, layeroffset ); - layeroffset += contour.length; - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - sidewalls( ahole, layeroffset ); - - //, true - layeroffset += ahole.length; - - } - - - scope.addGroup( start, verticesArray.length / 3 - start, 1 ); - - - } - - function sidewalls( contour, layeroffset ) { - - var j, k; - i = contour.length; - - while ( -- i >= 0 ) { - - j = i; - k = i - 1; - if ( k < 0 ) k = contour.length - 1; - - //console.log('b', i,j, i-1, k,vertices.length); - - var s = 0, - sl = steps + bevelSegments * 2; - - for ( s = 0; s < sl; s ++ ) { - - var slen1 = vlen * s; - var slen2 = vlen * ( s + 1 ); - - var a = layeroffset + j + slen1, - b = layeroffset + k + slen1, - c = layeroffset + k + slen2, - d = layeroffset + j + slen2; - - f4( a, b, c, d ); - - } - - } - - } - - function v( x, y, z ) { - - placeholder.push( x ); - placeholder.push( y ); - placeholder.push( z ); - - } - - - function f3( a, b, c ) { - - addVertex( a ); - addVertex( b ); - addVertex( c ); - - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); - - } - - function f4( a, b, c, d ) { - - addVertex( a ); - addVertex( b ); - addVertex( d ); - - addVertex( b ); - addVertex( c ); - addVertex( d ); - - - var nextIndex = verticesArray.length / 3; - var uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 ); - - addUV( uvs[ 0 ] ); - addUV( uvs[ 1 ] ); - addUV( uvs[ 3 ] ); - - addUV( uvs[ 1 ] ); - addUV( uvs[ 2 ] ); - addUV( uvs[ 3 ] ); - - } - - function addVertex( index ) { - - verticesArray.push( placeholder[ index * 3 + 0 ] ); - verticesArray.push( placeholder[ index * 3 + 1 ] ); - verticesArray.push( placeholder[ index * 3 + 2 ] ); - - } - - - function addUV( vector2 ) { - - uvArray.push( vector2.x ); - uvArray.push( vector2.y ); - - } - - } - -} - -ExtrudeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -ExtrudeBufferGeometry.prototype.constructor = ExtrudeBufferGeometry; - -ExtrudeBufferGeometry.prototype.toJSON = function () { - - var data = BufferGeometry.prototype.toJSON.call( this ); - - var shapes = this.parameters.shapes; - var options = this.parameters.options; - - return toJSON( shapes, options, data ); - -}; - -// - -var WorldUVGenerator = { - - generateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) { - - var a_x = vertices[ indexA * 3 ]; - var a_y = vertices[ indexA * 3 + 1 ]; - var b_x = vertices[ indexB * 3 ]; - var b_y = vertices[ indexB * 3 + 1 ]; - var c_x = vertices[ indexC * 3 ]; - var c_y = vertices[ indexC * 3 + 1 ]; - - return [ - new Vector2( a_x, a_y ), - new Vector2( b_x, b_y ), - new Vector2( c_x, c_y ) - ]; - - }, - - generateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) { - - var a_x = vertices[ indexA * 3 ]; - var a_y = vertices[ indexA * 3 + 1 ]; - var a_z = vertices[ indexA * 3 + 2 ]; - var b_x = vertices[ indexB * 3 ]; - var b_y = vertices[ indexB * 3 + 1 ]; - var b_z = vertices[ indexB * 3 + 2 ]; - var c_x = vertices[ indexC * 3 ]; - var c_y = vertices[ indexC * 3 + 1 ]; - var c_z = vertices[ indexC * 3 + 2 ]; - var d_x = vertices[ indexD * 3 ]; - var d_y = vertices[ indexD * 3 + 1 ]; - var d_z = vertices[ indexD * 3 + 2 ]; - - if ( Math.abs( a_y - b_y ) < 0.01 ) { - - return [ - new Vector2( a_x, 1 - a_z ), - new Vector2( b_x, 1 - b_z ), - new Vector2( c_x, 1 - c_z ), - new Vector2( d_x, 1 - d_z ) - ]; - - } else { - - return [ - new Vector2( a_y, 1 - a_z ), - new Vector2( b_y, 1 - b_z ), - new Vector2( c_y, 1 - c_z ), - new Vector2( d_y, 1 - d_z ) - ]; - - } - - } -}; - -function toJSON( shapes, options, data ) { - - // - - data.shapes = []; - - if ( Array.isArray( shapes ) ) { - - for ( var i = 0, l = shapes.length; i < l; i ++ ) { - - var shape = shapes[ i ]; - - data.shapes.push( shape.uuid ); - - } - - } else { - - data.shapes.push( shapes.uuid ); - - } - - // - - if ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON(); - - return data; - -} - - -export { ExtrudeGeometry, ExtrudeBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/Geometries.d.ts b/cases/esbuild-three/src/base/geometries/Geometries.d.ts deleted file mode 100644 index a5f780877c..0000000000 --- a/cases/esbuild-three/src/base/geometries/Geometries.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export * from './WireframeGeometry'; -export * from './ParametricGeometry'; -export * from './TetrahedronGeometry'; -export * from './OctahedronGeometry'; -export * from './IcosahedronGeometry'; -export * from './DodecahedronGeometry'; -export * from './PolyhedronGeometry'; -export * from './TubeGeometry'; -export * from './TorusKnotGeometry'; -export * from './TorusGeometry'; -export * from './TextGeometry'; -export * from './SphereGeometry'; -export * from './RingGeometry'; -export * from './PlaneGeometry'; -export * from './LatheGeometry'; -export * from './ShapeGeometry'; -export * from './ExtrudeGeometry'; -export * from './EdgesGeometry'; -export * from './ConeGeometry'; -export * from './CylinderGeometry'; -export * from './CircleGeometry'; -export * from './BoxGeometry'; diff --git a/cases/esbuild-three/src/base/geometries/Geometries.js b/cases/esbuild-three/src/base/geometries/Geometries.js deleted file mode 100644 index c374cb5e85..0000000000 --- a/cases/esbuild-three/src/base/geometries/Geometries.js +++ /dev/null @@ -1,22 +0,0 @@ -export { WireframeGeometry } from './WireframeGeometry.js'; -export { ParametricGeometry, ParametricBufferGeometry } from './ParametricGeometry.js'; -export { TetrahedronGeometry, TetrahedronBufferGeometry } from './TetrahedronGeometry.js'; -export { OctahedronGeometry, OctahedronBufferGeometry } from './OctahedronGeometry.js'; -export { IcosahedronGeometry, IcosahedronBufferGeometry } from './IcosahedronGeometry.js'; -export { DodecahedronGeometry, DodecahedronBufferGeometry } from './DodecahedronGeometry.js'; -export { PolyhedronGeometry, PolyhedronBufferGeometry } from './PolyhedronGeometry.js'; -export { TubeGeometry, TubeBufferGeometry } from './TubeGeometry.js'; -export { TorusKnotGeometry, TorusKnotBufferGeometry } from './TorusKnotGeometry.js'; -export { TorusGeometry, TorusBufferGeometry } from './TorusGeometry.js'; -export { TextGeometry, TextBufferGeometry } from './TextGeometry.js'; -export { SphereGeometry, SphereBufferGeometry } from './SphereGeometry.js'; -export { RingGeometry, RingBufferGeometry } from './RingGeometry.js'; -export { PlaneGeometry, PlaneBufferGeometry } from './PlaneGeometry.js'; -export { LatheGeometry, LatheBufferGeometry } from './LatheGeometry.js'; -export { ShapeGeometry, ShapeBufferGeometry } from './ShapeGeometry.js'; -export { ExtrudeGeometry, ExtrudeBufferGeometry } from './ExtrudeGeometry.js'; -export { EdgesGeometry } from './EdgesGeometry.js'; -export { ConeGeometry, ConeBufferGeometry } from './ConeGeometry.js'; -export { CylinderGeometry, CylinderBufferGeometry } from './CylinderGeometry.js'; -export { CircleGeometry, CircleBufferGeometry } from './CircleGeometry.js'; -export { BoxGeometry, BoxBufferGeometry } from './BoxGeometry.js'; diff --git a/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.d.ts b/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.d.ts deleted file mode 100644 index fc02ea396a..0000000000 --- a/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { - PolyhedronGeometry, - PolyhedronBufferGeometry, -} from './PolyhedronGeometry'; - -export class IcosahedronBufferGeometry extends PolyhedronBufferGeometry { - - constructor( radius?: number, detail?: number ); - -} - -export class IcosahedronGeometry extends PolyhedronGeometry { - - constructor( radius?: number, detail?: number ); - -} diff --git a/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.js b/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.js deleted file mode 100644 index 00f5249327..0000000000 --- a/cases/esbuild-three/src/base/geometries/IcosahedronGeometry.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { PolyhedronBufferGeometry } from './PolyhedronGeometry.js'; - -// IcosahedronGeometry - -function IcosahedronGeometry( radius, detail ) { - - Geometry.call( this ); - - this.type = 'IcosahedronGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - - this.fromBufferGeometry( new IcosahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); - -} - -IcosahedronGeometry.prototype = Object.create( Geometry.prototype ); -IcosahedronGeometry.prototype.constructor = IcosahedronGeometry; - -// IcosahedronBufferGeometry - -function IcosahedronBufferGeometry( radius, detail ) { - - var t = ( 1 + Math.sqrt( 5 ) ) / 2; - - var vertices = [ - - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, 0, - 0, - 1, t, 0, 1, t, 0, - 1, - t, 0, 1, - t, - t, 0, - 1, t, 0, 1, - t, 0, - 1, - t, 0, 1 - ]; - - var indices = [ - 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, - 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, - 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, - 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1 - ]; - - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - - this.type = 'IcosahedronBufferGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - -} - -IcosahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -IcosahedronBufferGeometry.prototype.constructor = IcosahedronBufferGeometry; - - -export { IcosahedronGeometry, IcosahedronBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/LatheGeometry.d.ts b/cases/esbuild-three/src/base/geometries/LatheGeometry.d.ts deleted file mode 100644 index aea669b760..0000000000 --- a/cases/esbuild-three/src/base/geometries/LatheGeometry.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Vector2 } from './../math/Vector2'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class LatheBufferGeometry extends BufferGeometry { - - constructor( - points: Vector2[], - segments?: number, - phiStart?: number, - phiLength?: number - ); - - parameters: { - points: Vector2[]; - segments: number; - phiStart: number; - phiLength: number; - }; - -} - -export class LatheGeometry extends Geometry { - - constructor( - points: Vector2[], - segments?: number, - phiStart?: number, - phiLength?: number - ); - - parameters: { - points: Vector2[]; - segments: number; - phiStart: number; - phiLength: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/LatheGeometry.js b/cases/esbuild-three/src/base/geometries/LatheGeometry.js deleted file mode 100644 index 907de87b2b..0000000000 --- a/cases/esbuild-three/src/base/geometries/LatheGeometry.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @author zz85 / https://github.com/zz85 - * @author bhouston / http://clara.io - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; -import { _Math } from '../math/Math.js'; - -// LatheGeometry - -function LatheGeometry( points, segments, phiStart, phiLength ) { - - Geometry.call( this ); - - this.type = 'LatheGeometry'; - - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; - - this.fromBufferGeometry( new LatheBufferGeometry( points, segments, phiStart, phiLength ) ); - this.mergeVertices(); - -} - -LatheGeometry.prototype = Object.create( Geometry.prototype ); -LatheGeometry.prototype.constructor = LatheGeometry; - -// LatheBufferGeometry - -function LatheBufferGeometry( points, segments, phiStart, phiLength ) { - - BufferGeometry.call( this ); - - this.type = 'LatheBufferGeometry'; - - this.parameters = { - points: points, - segments: segments, - phiStart: phiStart, - phiLength: phiLength - }; - - segments = Math.floor( segments ) || 12; - phiStart = phiStart || 0; - phiLength = phiLength || Math.PI * 2; - - // clamp phiLength so it's in range of [ 0, 2PI ] - - phiLength = _Math.clamp( phiLength, 0, Math.PI * 2 ); - - - // buffers - - var indices = []; - var vertices = []; - var uvs = []; - - // helper variables - - var base; - var inverseSegments = 1.0 / segments; - var vertex = new Vector3(); - var uv = new Vector2(); - var i, j; - - // generate vertices and uvs - - for ( i = 0; i <= segments; i ++ ) { - - var phi = phiStart + i * inverseSegments * phiLength; - - var sin = Math.sin( phi ); - var cos = Math.cos( phi ); - - for ( j = 0; j <= ( points.length - 1 ); j ++ ) { - - // vertex - - vertex.x = points[ j ].x * sin; - vertex.y = points[ j ].y; - vertex.z = points[ j ].x * cos; - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // uv - - uv.x = i / segments; - uv.y = j / ( points.length - 1 ); - - uvs.push( uv.x, uv.y ); - - - } - - } - - // indices - - for ( i = 0; i < segments; i ++ ) { - - for ( j = 0; j < ( points.length - 1 ); j ++ ) { - - base = j + i * points.length; - - var a = base; - var b = base + points.length; - var c = base + points.length + 1; - var d = base + 1; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - // generate normals - - this.computeVertexNormals(); - - // if the geometry is closed, we need to average the normals along the seam. - // because the corresponding vertices are identical (but still have different UVs). - - if ( phiLength === Math.PI * 2 ) { - - var normals = this.attributes.normal.array; - var n1 = new Vector3(); - var n2 = new Vector3(); - var n = new Vector3(); - - // this is the buffer offset for the last line of vertices - - base = segments * points.length * 3; - - for ( i = 0, j = 0; i < points.length; i ++, j += 3 ) { - - // select the normal of the vertex in the first line - - n1.x = normals[ j + 0 ]; - n1.y = normals[ j + 1 ]; - n1.z = normals[ j + 2 ]; - - // select the normal of the vertex in the last line - - n2.x = normals[ base + j + 0 ]; - n2.y = normals[ base + j + 1 ]; - n2.z = normals[ base + j + 2 ]; - - // average normals - - n.addVectors( n1, n2 ).normalize(); - - // assign the new values to both normals - - normals[ j + 0 ] = normals[ base + j + 0 ] = n.x; - normals[ j + 1 ] = normals[ base + j + 1 ] = n.y; - normals[ j + 2 ] = normals[ base + j + 2 ] = n.z; - - } - - } - -} - -LatheBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -LatheBufferGeometry.prototype.constructor = LatheBufferGeometry; - - -export { LatheGeometry, LatheBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/OctahedronGeometry.d.ts b/cases/esbuild-three/src/base/geometries/OctahedronGeometry.d.ts deleted file mode 100644 index ca7c079486..0000000000 --- a/cases/esbuild-three/src/base/geometries/OctahedronGeometry.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { - PolyhedronGeometry, - PolyhedronBufferGeometry, -} from './PolyhedronGeometry'; - -export class OctahedronBufferGeometry extends PolyhedronBufferGeometry { - - constructor( radius?: number, detail?: number ); - -} - -export class OctahedronGeometry extends PolyhedronGeometry { - - constructor( radius?: number, detail?: number ); - -} diff --git a/cases/esbuild-three/src/base/geometries/OctahedronGeometry.js b/cases/esbuild-three/src/base/geometries/OctahedronGeometry.js deleted file mode 100644 index 4513a7d73b..0000000000 --- a/cases/esbuild-three/src/base/geometries/OctahedronGeometry.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { PolyhedronBufferGeometry } from './PolyhedronGeometry.js'; - -// OctahedronGeometry - -function OctahedronGeometry( radius, detail ) { - - Geometry.call( this ); - - this.type = 'OctahedronGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - - this.fromBufferGeometry( new OctahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); - -} - -OctahedronGeometry.prototype = Object.create( Geometry.prototype ); -OctahedronGeometry.prototype.constructor = OctahedronGeometry; - -// OctahedronBufferGeometry - -function OctahedronBufferGeometry( radius, detail ) { - - var vertices = [ - 1, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, - 1, 0, 0, 0, 1, 0, 0, - 1 - ]; - - var indices = [ - 0, 2, 4, 0, 4, 3, 0, 3, 5, - 0, 5, 2, 1, 2, 5, 1, 5, 3, - 1, 3, 4, 1, 4, 2 - ]; - - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - - this.type = 'OctahedronBufferGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - -} - -OctahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -OctahedronBufferGeometry.prototype.constructor = OctahedronBufferGeometry; - - -export { OctahedronGeometry, OctahedronBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/ParametricGeometry.d.ts b/cases/esbuild-three/src/base/geometries/ParametricGeometry.d.ts deleted file mode 100644 index a12735b291..0000000000 --- a/cases/esbuild-three/src/base/geometries/ParametricGeometry.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class ParametricBufferGeometry extends BufferGeometry { - - constructor( - func: ( u: number, v: number, dest: Vector3 ) => void, - slices: number, - stacks: number - ); - - parameters: { - func: ( u: number, v: number, dest: Vector3 ) => void; - slices: number; - stacks: number; - }; - -} - -export class ParametricGeometry extends Geometry { - - constructor( - func: ( u: number, v: number, dest: Vector3 ) => void, - slices: number, - stacks: number - ); - - parameters: { - func: ( u: number, v: number, dest: Vector3 ) => void; - slices: number; - stacks: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/ParametricGeometry.js b/cases/esbuild-three/src/base/geometries/ParametricGeometry.js deleted file mode 100644 index 329230c4fa..0000000000 --- a/cases/esbuild-three/src/base/geometries/ParametricGeometry.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @author zz85 / https://github.com/zz85 - * @author Mugen87 / https://github.com/Mugen87 - * - * Parametric Surfaces Geometry - * based on the brilliant article by @prideout http://prideout.net/blog/?p=44 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -// ParametricGeometry - -function ParametricGeometry( func, slices, stacks ) { - - Geometry.call( this ); - - this.type = 'ParametricGeometry'; - - this.parameters = { - func: func, - slices: slices, - stacks: stacks - }; - - this.fromBufferGeometry( new ParametricBufferGeometry( func, slices, stacks ) ); - this.mergeVertices(); - -} - -ParametricGeometry.prototype = Object.create( Geometry.prototype ); -ParametricGeometry.prototype.constructor = ParametricGeometry; - -// ParametricBufferGeometry - -function ParametricBufferGeometry( func, slices, stacks ) { - - BufferGeometry.call( this ); - - this.type = 'ParametricBufferGeometry'; - - this.parameters = { - func: func, - slices: slices, - stacks: stacks - }; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - var EPS = 0.00001; - - var normal = new Vector3(); - - var p0 = new Vector3(), p1 = new Vector3(); - var pu = new Vector3(), pv = new Vector3(); - - var i, j; - - if ( func.length < 3 ) { - - console.error( 'THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.' ); - - } - - // generate vertices, normals and uvs - - var sliceCount = slices + 1; - - for ( i = 0; i <= stacks; i ++ ) { - - var v = i / stacks; - - for ( j = 0; j <= slices; j ++ ) { - - var u = j / slices; - - // vertex - - func( u, v, p0 ); - vertices.push( p0.x, p0.y, p0.z ); - - // normal - - // approximate tangent vectors via finite differences - - if ( u - EPS >= 0 ) { - - func( u - EPS, v, p1 ); - pu.subVectors( p0, p1 ); - - } else { - - func( u + EPS, v, p1 ); - pu.subVectors( p1, p0 ); - - } - - if ( v - EPS >= 0 ) { - - func( u, v - EPS, p1 ); - pv.subVectors( p0, p1 ); - - } else { - - func( u, v + EPS, p1 ); - pv.subVectors( p1, p0 ); - - } - - // cross product of tangent vectors returns surface normal - - normal.crossVectors( pu, pv ).normalize(); - normals.push( normal.x, normal.y, normal.z ); - - // uv - - uvs.push( u, v ); - - } - - } - - // generate indices - - for ( i = 0; i < stacks; i ++ ) { - - for ( j = 0; j < slices; j ++ ) { - - var a = i * sliceCount + j; - var b = i * sliceCount + j + 1; - var c = ( i + 1 ) * sliceCount + j + 1; - var d = ( i + 1 ) * sliceCount + j; - - // faces one and two - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry; - - -export { ParametricGeometry, ParametricBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/PlaneGeometry.d.ts b/cases/esbuild-three/src/base/geometries/PlaneGeometry.d.ts deleted file mode 100644 index 21447c3b0f..0000000000 --- a/cases/esbuild-three/src/base/geometries/PlaneGeometry.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class PlaneBufferGeometry extends BufferGeometry { - - constructor( - width?: number, - height?: number, - widthSegments?: number, - heightSegments?: number - ); - - parameters: { - width: number; - height: number; - widthSegments: number; - heightSegments: number; - }; - -} - -export class PlaneGeometry extends Geometry { - - constructor( - width?: number, - height?: number, - widthSegments?: number, - heightSegments?: number - ); - - parameters: { - width: number; - height: number; - widthSegments: number; - heightSegments: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/PlaneGeometry.js b/cases/esbuild-three/src/base/geometries/PlaneGeometry.js deleted file mode 100644 index 6b4fb3fa17..0000000000 --- a/cases/esbuild-three/src/base/geometries/PlaneGeometry.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; - -// PlaneGeometry - -function PlaneGeometry( width, height, widthSegments, heightSegments ) { - - Geometry.call( this ); - - this.type = 'PlaneGeometry'; - - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; - - this.fromBufferGeometry( new PlaneBufferGeometry( width, height, widthSegments, heightSegments ) ); - this.mergeVertices(); - -} - -PlaneGeometry.prototype = Object.create( Geometry.prototype ); -PlaneGeometry.prototype.constructor = PlaneGeometry; - -// PlaneBufferGeometry - -function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) { - - BufferGeometry.call( this ); - - this.type = 'PlaneBufferGeometry'; - - this.parameters = { - width: width, - height: height, - widthSegments: widthSegments, - heightSegments: heightSegments - }; - - width = width || 1; - height = height || 1; - - var width_half = width / 2; - var height_half = height / 2; - - var gridX = Math.floor( widthSegments ) || 1; - var gridY = Math.floor( heightSegments ) || 1; - - var gridX1 = gridX + 1; - var gridY1 = gridY + 1; - - var segment_width = width / gridX; - var segment_height = height / gridY; - - var ix, iy; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // generate vertices, normals and uvs - - for ( iy = 0; iy < gridY1; iy ++ ) { - - var y = iy * segment_height - height_half; - - for ( ix = 0; ix < gridX1; ix ++ ) { - - var x = ix * segment_width - width_half; - - vertices.push( x, - y, 0 ); - - normals.push( 0, 0, 1 ); - - uvs.push( ix / gridX ); - uvs.push( 1 - ( iy / gridY ) ); - - } - - } - - // indices - - for ( iy = 0; iy < gridY; iy ++ ) { - - for ( ix = 0; ix < gridX; ix ++ ) { - - var a = ix + gridX1 * iy; - var b = ix + gridX1 * ( iy + 1 ); - var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = ( ix + 1 ) + gridX1 * iy; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -PlaneBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -PlaneBufferGeometry.prototype.constructor = PlaneBufferGeometry; - - -export { PlaneGeometry, PlaneBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.d.ts b/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.d.ts deleted file mode 100644 index d57ea87b46..0000000000 --- a/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Sphere } from './../math/Sphere'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class PolyhedronBufferGeometry extends BufferGeometry { - - constructor( - vertices: number[], - indices: number[], - radius?: number, - detail?: number - ); - - parameters: { - vertices: number[]; - indices: number[]; - radius: number; - detail: number; - }; - -} - -export class PolyhedronGeometry extends Geometry { - - constructor( - vertices: number[], - indices: number[], - radius?: number, - detail?: number - ); - - parameters: { - vertices: number[]; - indices: number[]; - radius: number; - detail: number; - }; - boundingSphere: Sphere; - -} diff --git a/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.js b/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.js deleted file mode 100644 index 1ff08aa305..0000000000 --- a/cases/esbuild-three/src/base/geometries/PolyhedronGeometry.js +++ /dev/null @@ -1,341 +0,0 @@ -/** - * @author clockworkgeek / https://github.com/clockworkgeek - * @author timothypratley / https://github.com/timothypratley - * @author WestLangley / http://github.com/WestLangley - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; - -// PolyhedronGeometry - -function PolyhedronGeometry( vertices, indices, radius, detail ) { - - Geometry.call( this ); - - this.type = 'PolyhedronGeometry'; - - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; - - this.fromBufferGeometry( new PolyhedronBufferGeometry( vertices, indices, radius, detail ) ); - this.mergeVertices(); - -} - -PolyhedronGeometry.prototype = Object.create( Geometry.prototype ); -PolyhedronGeometry.prototype.constructor = PolyhedronGeometry; - -// PolyhedronBufferGeometry - -function PolyhedronBufferGeometry( vertices, indices, radius, detail ) { - - BufferGeometry.call( this ); - - this.type = 'PolyhedronBufferGeometry'; - - this.parameters = { - vertices: vertices, - indices: indices, - radius: radius, - detail: detail - }; - - radius = radius || 1; - detail = detail || 0; - - // default buffer data - - var vertexBuffer = []; - var uvBuffer = []; - - // the subdivision creates the vertex buffer data - - subdivide( detail ); - - // all vertices should lie on a conceptual sphere with a given radius - - applyRadius( radius ); - - // finally, create the uv data - - generateUVs(); - - // build non-indexed geometry - - this.addAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) ); - - if ( detail === 0 ) { - - this.computeVertexNormals(); // flat normals - - } else { - - this.normalizeNormals(); // smooth normals - - } - - // helper functions - - function subdivide( detail ) { - - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); - - // iterate over all faces and apply a subdivison with the given detail value - - for ( var i = 0; i < indices.length; i += 3 ) { - - // get the vertices of the face - - getVertexByIndex( indices[ i + 0 ], a ); - getVertexByIndex( indices[ i + 1 ], b ); - getVertexByIndex( indices[ i + 2 ], c ); - - // perform subdivision - - subdivideFace( a, b, c, detail ); - - } - - } - - function subdivideFace( a, b, c, detail ) { - - var cols = Math.pow( 2, detail ); - - // we use this multidimensional array as a data structure for creating the subdivision - - var v = []; - - var i, j; - - // construct all of the vertices for this subdivision - - for ( i = 0; i <= cols; i ++ ) { - - v[ i ] = []; - - var aj = a.clone().lerp( c, i / cols ); - var bj = b.clone().lerp( c, i / cols ); - - var rows = cols - i; - - for ( j = 0; j <= rows; j ++ ) { - - if ( j === 0 && i === cols ) { - - v[ i ][ j ] = aj; - - } else { - - v[ i ][ j ] = aj.clone().lerp( bj, j / rows ); - - } - - } - - } - - // construct all of the faces - - for ( i = 0; i < cols; i ++ ) { - - for ( j = 0; j < 2 * ( cols - i ) - 1; j ++ ) { - - var k = Math.floor( j / 2 ); - - if ( j % 2 === 0 ) { - - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); - pushVertex( v[ i ][ k ] ); - - } else { - - pushVertex( v[ i ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k + 1 ] ); - pushVertex( v[ i + 1 ][ k ] ); - - } - - } - - } - - } - - function applyRadius( radius ) { - - var vertex = new Vector3(); - - // iterate over the entire buffer and apply the radius to each vertex - - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { - - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; - - vertex.normalize().multiplyScalar( radius ); - - vertexBuffer[ i + 0 ] = vertex.x; - vertexBuffer[ i + 1 ] = vertex.y; - vertexBuffer[ i + 2 ] = vertex.z; - - } - - } - - function generateUVs() { - - var vertex = new Vector3(); - - for ( var i = 0; i < vertexBuffer.length; i += 3 ) { - - vertex.x = vertexBuffer[ i + 0 ]; - vertex.y = vertexBuffer[ i + 1 ]; - vertex.z = vertexBuffer[ i + 2 ]; - - var u = azimuth( vertex ) / 2 / Math.PI + 0.5; - var v = inclination( vertex ) / Math.PI + 0.5; - uvBuffer.push( u, 1 - v ); - - } - - correctUVs(); - - correctSeam(); - - } - - function correctSeam() { - - // handle case when face straddles the seam, see #3269 - - for ( var i = 0; i < uvBuffer.length; i += 6 ) { - - // uv data of a single face - - var x0 = uvBuffer[ i + 0 ]; - var x1 = uvBuffer[ i + 2 ]; - var x2 = uvBuffer[ i + 4 ]; - - var max = Math.max( x0, x1, x2 ); - var min = Math.min( x0, x1, x2 ); - - // 0.9 is somewhat arbitrary - - if ( max > 0.9 && min < 0.1 ) { - - if ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1; - if ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1; - if ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1; - - } - - } - - } - - function pushVertex( vertex ) { - - vertexBuffer.push( vertex.x, vertex.y, vertex.z ); - - } - - function getVertexByIndex( index, vertex ) { - - var stride = index * 3; - - vertex.x = vertices[ stride + 0 ]; - vertex.y = vertices[ stride + 1 ]; - vertex.z = vertices[ stride + 2 ]; - - } - - function correctUVs() { - - var a = new Vector3(); - var b = new Vector3(); - var c = new Vector3(); - - var centroid = new Vector3(); - - var uvA = new Vector2(); - var uvB = new Vector2(); - var uvC = new Vector2(); - - for ( var i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) { - - a.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] ); - b.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] ); - c.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] ); - - uvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] ); - uvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] ); - uvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] ); - - centroid.copy( a ).add( b ).add( c ).divideScalar( 3 ); - - var azi = azimuth( centroid ); - - correctUV( uvA, j + 0, a, azi ); - correctUV( uvB, j + 2, b, azi ); - correctUV( uvC, j + 4, c, azi ); - - } - - } - - function correctUV( uv, stride, vector, azimuth ) { - - if ( ( azimuth < 0 ) && ( uv.x === 1 ) ) { - - uvBuffer[ stride ] = uv.x - 1; - - } - - if ( ( vector.x === 0 ) && ( vector.z === 0 ) ) { - - uvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5; - - } - - } - - // Angle around the Y axis, counter-clockwise when looking from above. - - function azimuth( vector ) { - - return Math.atan2( vector.z, - vector.x ); - - } - - - // Angle above the XZ plane. - - function inclination( vector ) { - - return Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); - - } - -} - -PolyhedronBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -PolyhedronBufferGeometry.prototype.constructor = PolyhedronBufferGeometry; - - -export { PolyhedronGeometry, PolyhedronBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/RingGeometry.d.ts b/cases/esbuild-three/src/base/geometries/RingGeometry.d.ts deleted file mode 100644 index 057632438a..0000000000 --- a/cases/esbuild-three/src/base/geometries/RingGeometry.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class RingBufferGeometry extends BufferGeometry { - - constructor( - innerRadius?: number, - outerRadius?: number, - thetaSegments?: number, - phiSegments?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - innerRadius: number; - outerRadius: number; - thetaSegments: number; - phiSegments: number; - thetaStart: number; - thetaLength: number; - }; - -} - -export class RingGeometry extends Geometry { - - constructor( - innerRadius?: number, - outerRadius?: number, - thetaSegments?: number, - phiSegments?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - innerRadius: number; - outerRadius: number; - thetaSegments: number; - phiSegments: number; - thetaStart: number; - thetaLength: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/RingGeometry.js b/cases/esbuild-three/src/base/geometries/RingGeometry.js deleted file mode 100644 index 8acbda18d3..0000000000 --- a/cases/esbuild-three/src/base/geometries/RingGeometry.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @author Kaleb Murphy - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; - -// RingGeometry - -function RingGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - - Geometry.call( this ); - - this.type = 'RingGeometry'; - - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - this.fromBufferGeometry( new RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) ); - this.mergeVertices(); - -} - -RingGeometry.prototype = Object.create( Geometry.prototype ); -RingGeometry.prototype.constructor = RingGeometry; - -// RingBufferGeometry - -function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) { - - BufferGeometry.call( this ); - - this.type = 'RingBufferGeometry'; - - this.parameters = { - innerRadius: innerRadius, - outerRadius: outerRadius, - thetaSegments: thetaSegments, - phiSegments: phiSegments, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - innerRadius = innerRadius || 0.5; - outerRadius = outerRadius || 1; - - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI * 2; - - thetaSegments = thetaSegments !== undefined ? Math.max( 3, thetaSegments ) : 8; - phiSegments = phiSegments !== undefined ? Math.max( 1, phiSegments ) : 1; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // some helper variables - - var segment; - var radius = innerRadius; - var radiusStep = ( ( outerRadius - innerRadius ) / phiSegments ); - var vertex = new Vector3(); - var uv = new Vector2(); - var j, i; - - // generate vertices, normals and uvs - - for ( j = 0; j <= phiSegments; j ++ ) { - - for ( i = 0; i <= thetaSegments; i ++ ) { - - // values are generate from the inside of the ring to the outside - - segment = thetaStart + i / thetaSegments * thetaLength; - - // vertex - - vertex.x = radius * Math.cos( segment ); - vertex.y = radius * Math.sin( segment ); - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - normals.push( 0, 0, 1 ); - - // uv - - uv.x = ( vertex.x / outerRadius + 1 ) / 2; - uv.y = ( vertex.y / outerRadius + 1 ) / 2; - - uvs.push( uv.x, uv.y ); - - } - - // increase the radius for next row of vertices - - radius += radiusStep; - - } - - // indices - - for ( j = 0; j < phiSegments; j ++ ) { - - var thetaSegmentLevel = j * ( thetaSegments + 1 ); - - for ( i = 0; i < thetaSegments; i ++ ) { - - segment = i + thetaSegmentLevel; - - var a = segment; - var b = segment + thetaSegments + 1; - var c = segment + thetaSegments + 2; - var d = segment + 1; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -RingBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -RingBufferGeometry.prototype.constructor = RingBufferGeometry; - - -export { RingGeometry, RingBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/ShapeGeometry.d.ts b/cases/esbuild-three/src/base/geometries/ShapeGeometry.d.ts deleted file mode 100644 index f93497922c..0000000000 --- a/cases/esbuild-three/src/base/geometries/ShapeGeometry.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Shape } from './../extras/core/Shape'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class ShapeBufferGeometry extends BufferGeometry { - - constructor( shapes: Shape | Shape[], curveSegments?: number ); - -} - -export class ShapeGeometry extends Geometry { - - constructor( shapes: Shape | Shape[], curveSegments?: number ); - - addShapeList( shapes: Shape[], options: any ): ShapeGeometry; - addShape( shape: Shape, options?: any ): void; - -} diff --git a/cases/esbuild-three/src/base/geometries/ShapeGeometry.js b/cases/esbuild-three/src/base/geometries/ShapeGeometry.js deleted file mode 100644 index 085839b823..0000000000 --- a/cases/esbuild-three/src/base/geometries/ShapeGeometry.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @author jonobr1 / http://jonobr1.com - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { ShapeUtils } from '../extras/ShapeUtils.js'; - -// ShapeGeometry - -function ShapeGeometry( shapes, curveSegments ) { - - Geometry.call( this ); - - this.type = 'ShapeGeometry'; - - if ( typeof curveSegments === 'object' ) { - - console.warn( 'THREE.ShapeGeometry: Options parameter has been removed.' ); - - curveSegments = curveSegments.curveSegments; - - } - - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; - - this.fromBufferGeometry( new ShapeBufferGeometry( shapes, curveSegments ) ); - this.mergeVertices(); - -} - -ShapeGeometry.prototype = Object.create( Geometry.prototype ); -ShapeGeometry.prototype.constructor = ShapeGeometry; - -ShapeGeometry.prototype.toJSON = function () { - - var data = Geometry.prototype.toJSON.call( this ); - - var shapes = this.parameters.shapes; - - return toJSON( shapes, data ); - -}; - -// ShapeBufferGeometry - -function ShapeBufferGeometry( shapes, curveSegments ) { - - BufferGeometry.call( this ); - - this.type = 'ShapeBufferGeometry'; - - this.parameters = { - shapes: shapes, - curveSegments: curveSegments - }; - - curveSegments = curveSegments || 12; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var groupStart = 0; - var groupCount = 0; - - // allow single and array values for "shapes" parameter - - if ( Array.isArray( shapes ) === false ) { - - addShape( shapes ); - - } else { - - for ( var i = 0; i < shapes.length; i ++ ) { - - addShape( shapes[ i ] ); - - this.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support - - groupStart += groupCount; - groupCount = 0; - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - - // helper functions - - function addShape( shape ) { - - var i, l, shapeHole; - - var indexOffset = vertices.length / 3; - var points = shape.extractPoints( curveSegments ); - - var shapeVertices = points.shape; - var shapeHoles = points.holes; - - // check direction of vertices - - if ( ShapeUtils.isClockWise( shapeVertices ) === false ) { - - shapeVertices = shapeVertices.reverse(); - - } - - for ( i = 0, l = shapeHoles.length; i < l; i ++ ) { - - shapeHole = shapeHoles[ i ]; - - if ( ShapeUtils.isClockWise( shapeHole ) === true ) { - - shapeHoles[ i ] = shapeHole.reverse(); - - } - - } - - var faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles ); - - // join vertices of inner and outer paths to a single array - - for ( i = 0, l = shapeHoles.length; i < l; i ++ ) { - - shapeHole = shapeHoles[ i ]; - shapeVertices = shapeVertices.concat( shapeHole ); - - } - - // vertices, normals, uvs - - for ( i = 0, l = shapeVertices.length; i < l; i ++ ) { - - var vertex = shapeVertices[ i ]; - - vertices.push( vertex.x, vertex.y, 0 ); - normals.push( 0, 0, 1 ); - uvs.push( vertex.x, vertex.y ); // world uvs - - } - - // incides - - for ( i = 0, l = faces.length; i < l; i ++ ) { - - var face = faces[ i ]; - - var a = face[ 0 ] + indexOffset; - var b = face[ 1 ] + indexOffset; - var c = face[ 2 ] + indexOffset; - - indices.push( a, b, c ); - groupCount += 3; - - } - - } - -} - -ShapeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -ShapeBufferGeometry.prototype.constructor = ShapeBufferGeometry; - -ShapeBufferGeometry.prototype.toJSON = function () { - - var data = BufferGeometry.prototype.toJSON.call( this ); - - var shapes = this.parameters.shapes; - - return toJSON( shapes, data ); - -}; - -// - -function toJSON( shapes, data ) { - - data.shapes = []; - - if ( Array.isArray( shapes ) ) { - - for ( var i = 0, l = shapes.length; i < l; i ++ ) { - - var shape = shapes[ i ]; - - data.shapes.push( shape.uuid ); - - } - - } else { - - data.shapes.push( shapes.uuid ); - - } - - return data; - -} - - -export { ShapeGeometry, ShapeBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/SphereGeometry.d.ts b/cases/esbuild-three/src/base/geometries/SphereGeometry.d.ts deleted file mode 100644 index 7242a748a2..0000000000 --- a/cases/esbuild-three/src/base/geometries/SphereGeometry.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class SphereBufferGeometry extends BufferGeometry { - - constructor( - radius?: number, - widthSegments?: number, - heightSegments?: number, - phiStart?: number, - phiLength?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radius: number; - widthSegments: number; - heightSegments: number; - phiStart: number; - phiLength: number; - thetaStart: number; - thetaLength: number; - }; - -} - -/** - * A class for generating sphere geometries - */ -export class SphereGeometry extends Geometry { - - /** - * The geometry is created by sweeping and calculating vertexes around the Y axis (horizontal sweep) and the Z axis (vertical sweep). Thus, incomplete spheres (akin to 'sphere slices') can be created through the use of different values of phiStart, phiLength, thetaStart and thetaLength, in order to define the points in which we start (or end) calculating those vertices. - * - * @param radius — sphere radius. Default is 50. - * @param widthSegments — number of horizontal segments. Minimum value is 3, and the default is 8. - * @param heightSegments — number of vertical segments. Minimum value is 2, and the default is 6. - * @param phiStart — specify horizontal starting angle. Default is 0. - * @param phiLength — specify horizontal sweep angle size. Default is Math.PI * 2. - * @param thetaStart — specify vertical starting angle. Default is 0. - * @param thetaLength — specify vertical sweep angle size. Default is Math.PI. - */ - constructor( - radius?: number, - widthSegments?: number, - heightSegments?: number, - phiStart?: number, - phiLength?: number, - thetaStart?: number, - thetaLength?: number - ); - - parameters: { - radius: number; - widthSegments: number; - heightSegments: number; - phiStart: number; - phiLength: number; - thetaStart: number; - thetaLength: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/SphereGeometry.js b/cases/esbuild-three/src/base/geometries/SphereGeometry.js deleted file mode 100644 index 34e9d9475f..0000000000 --- a/cases/esbuild-three/src/base/geometries/SphereGeometry.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author benaadams / https://twitter.com/ben_a_adams - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -// SphereGeometry - -function SphereGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - Geometry.call( this ); - - this.type = 'SphereGeometry'; - - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - this.fromBufferGeometry( new SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) ); - this.mergeVertices(); - -} - -SphereGeometry.prototype = Object.create( Geometry.prototype ); -SphereGeometry.prototype.constructor = SphereGeometry; - -// SphereBufferGeometry - -function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) { - - BufferGeometry.call( this ); - - this.type = 'SphereBufferGeometry'; - - this.parameters = { - radius: radius, - widthSegments: widthSegments, - heightSegments: heightSegments, - phiStart: phiStart, - phiLength: phiLength, - thetaStart: thetaStart, - thetaLength: thetaLength - }; - - radius = radius || 1; - - widthSegments = Math.max( 3, Math.floor( widthSegments ) || 8 ); - heightSegments = Math.max( 2, Math.floor( heightSegments ) || 6 ); - - phiStart = phiStart !== undefined ? phiStart : 0; - phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; - - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; - - var thetaEnd = Math.min( thetaStart + thetaLength, Math.PI ); - - var ix, iy; - - var index = 0; - var grid = []; - - var vertex = new Vector3(); - var normal = new Vector3(); - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // generate vertices, normals and uvs - - for ( iy = 0; iy <= heightSegments; iy ++ ) { - - var verticesRow = []; - - var v = iy / heightSegments; - - // special case for the poles - - var uOffset = 0; - - if ( iy == 0 && thetaStart == 0 ) { - - uOffset = 0.5 / widthSegments; - - } else if ( iy == heightSegments && thetaEnd == Math.PI ) { - - uOffset = - 0.5 / widthSegments; - - } - - for ( ix = 0; ix <= widthSegments; ix ++ ) { - - var u = ix / widthSegments; - - // vertex - - vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); - vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - normal.copy( vertex ).normalize(); - normals.push( normal.x, normal.y, normal.z ); - - // uv - - uvs.push( u + uOffset, 1 - v ); - - verticesRow.push( index ++ ); - - } - - grid.push( verticesRow ); - - } - - // indices - - for ( iy = 0; iy < heightSegments; iy ++ ) { - - for ( ix = 0; ix < widthSegments; ix ++ ) { - - var a = grid[ iy ][ ix + 1 ]; - var b = grid[ iy ][ ix ]; - var c = grid[ iy + 1 ][ ix ]; - var d = grid[ iy + 1 ][ ix + 1 ]; - - if ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d ); - if ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -SphereBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -SphereBufferGeometry.prototype.constructor = SphereBufferGeometry; - - -export { SphereGeometry, SphereBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.d.ts b/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.d.ts deleted file mode 100644 index 7b4a7cc969..0000000000 --- a/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { PolyhedronGeometry, PolyhedronBufferGeometry } from './PolyhedronGeometry'; - -export class TetrahedronBufferGeometry extends PolyhedronBufferGeometry { - - constructor( radius?: number, detail?: number ); - -} - -export class TetrahedronGeometry extends PolyhedronGeometry { - - constructor( radius?: number, detail?: number ); - -} diff --git a/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.js b/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.js deleted file mode 100644 index 7f4a7cd0a8..0000000000 --- a/cases/esbuild-three/src/base/geometries/TetrahedronGeometry.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @author timothypratley / https://github.com/timothypratley - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { PolyhedronBufferGeometry } from './PolyhedronGeometry.js'; - -// TetrahedronGeometry - -function TetrahedronGeometry( radius, detail ) { - - Geometry.call( this ); - - this.type = 'TetrahedronGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - - this.fromBufferGeometry( new TetrahedronBufferGeometry( radius, detail ) ); - this.mergeVertices(); - -} - -TetrahedronGeometry.prototype = Object.create( Geometry.prototype ); -TetrahedronGeometry.prototype.constructor = TetrahedronGeometry; - -// TetrahedronBufferGeometry - -function TetrahedronBufferGeometry( radius, detail ) { - - var vertices = [ - 1, 1, 1, - 1, - 1, 1, - 1, 1, - 1, 1, - 1, - 1 - ]; - - var indices = [ - 2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1 - ]; - - PolyhedronBufferGeometry.call( this, vertices, indices, radius, detail ); - - this.type = 'TetrahedronBufferGeometry'; - - this.parameters = { - radius: radius, - detail: detail - }; - -} - -TetrahedronBufferGeometry.prototype = Object.create( PolyhedronBufferGeometry.prototype ); -TetrahedronBufferGeometry.prototype.constructor = TetrahedronBufferGeometry; - - -export { TetrahedronGeometry, TetrahedronBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/TextGeometry.d.ts b/cases/esbuild-three/src/base/geometries/TextGeometry.d.ts deleted file mode 100644 index b3278ab7f5..0000000000 --- a/cases/esbuild-three/src/base/geometries/TextGeometry.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Font } from './../extras/core/Font'; -import { ExtrudeGeometry, ExtrudeBufferGeometry } from './ExtrudeGeometry'; - -export interface TextGeometryParameters { - font?: Font; - size?: number; - height?: number; - curveSegments?: number; - bevelEnabled?: boolean; - bevelThickness?: number; - bevelSize?: number; - bevelOffset?: number; - bevelSegments?: number; -} - -export class TextBufferGeometry extends ExtrudeBufferGeometry { - - constructor( text: string, parameters?: TextGeometryParameters ); - - parameters: { - font: Font; - size: number; - height: number; - curveSegments: number; - bevelEnabled: boolean; - bevelThickness: number; - bevelSize: number; - bevelOffset: number; - bevelSegments: number; - }; - -} - -export class TextGeometry extends ExtrudeGeometry { - - constructor( text: string, parameters?: TextGeometryParameters ); - - parameters: { - font: Font; - size: number; - height: number; - curveSegments: number; - bevelEnabled: boolean; - bevelThickness: number; - bevelSize: number; - bevelOffset: number; - bevelSegments: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/TextGeometry.js b/cases/esbuild-three/src/base/geometries/TextGeometry.js deleted file mode 100644 index f8d65e2824..0000000000 --- a/cases/esbuild-three/src/base/geometries/TextGeometry.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author alteredq / http://alteredqualia.com/ - * - * Text = 3D Text - * - * parameters = { - * font: , // font - * - * size: , // size of the text - * height: , // thickness to extrude text - * curveSegments: , // number of points on the curves - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into text bevel goes - * bevelSize: , // how far from text outline (including bevelOffset) is bevel - * bevelOffset: // how far from text outline does bevel start - * } - */ - -import { Geometry } from '../core/Geometry.js'; -import { ExtrudeBufferGeometry } from './ExtrudeGeometry.js'; - -// TextGeometry - -function TextGeometry( text, parameters ) { - - Geometry.call( this ); - - this.type = 'TextGeometry'; - - this.parameters = { - text: text, - parameters: parameters - }; - - this.fromBufferGeometry( new TextBufferGeometry( text, parameters ) ); - this.mergeVertices(); - -} - -TextGeometry.prototype = Object.create( Geometry.prototype ); -TextGeometry.prototype.constructor = TextGeometry; - -// TextBufferGeometry - -function TextBufferGeometry( text, parameters ) { - - parameters = parameters || {}; - - var font = parameters.font; - - if ( ! ( font && font.isFont ) ) { - - console.error( 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.' ); - return new Geometry(); - - } - - var shapes = font.generateShapes( text, parameters.size ); - - // translate parameters to ExtrudeGeometry API - - parameters.depth = parameters.height !== undefined ? parameters.height : 50; - - // defaults - - if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; - if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; - if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; - - ExtrudeBufferGeometry.call( this, shapes, parameters ); - - this.type = 'TextBufferGeometry'; - -} - -TextBufferGeometry.prototype = Object.create( ExtrudeBufferGeometry.prototype ); -TextBufferGeometry.prototype.constructor = TextBufferGeometry; - - -export { TextGeometry, TextBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/TorusGeometry.d.ts b/cases/esbuild-three/src/base/geometries/TorusGeometry.d.ts deleted file mode 100644 index c05a13380b..0000000000 --- a/cases/esbuild-three/src/base/geometries/TorusGeometry.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class TorusBufferGeometry extends BufferGeometry { - - constructor( - radius?: number, - tube?: number, - radialSegments?: number, - tubularSegments?: number, - arc?: number - ); - - parameters: { - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - arc: number; - }; - -} - -export class TorusGeometry extends Geometry { - - constructor( - radius?: number, - tube?: number, - radialSegments?: number, - tubularSegments?: number, - arc?: number - ); - - parameters: { - radius: number; - tube: number; - radialSegments: number; - tubularSegments: number; - arc: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/TorusGeometry.js b/cases/esbuild-three/src/base/geometries/TorusGeometry.js deleted file mode 100644 index 401d34bb07..0000000000 --- a/cases/esbuild-three/src/base/geometries/TorusGeometry.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @author oosmoxiecode - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -// TorusGeometry - -function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { - - Geometry.call( this ); - - this.type = 'TorusGeometry'; - - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; - - this.fromBufferGeometry( new TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) ); - this.mergeVertices(); - -} - -TorusGeometry.prototype = Object.create( Geometry.prototype ); -TorusGeometry.prototype.constructor = TorusGeometry; - -// TorusBufferGeometry - -function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc ) { - - BufferGeometry.call( this ); - - this.type = 'TorusBufferGeometry'; - - this.parameters = { - radius: radius, - tube: tube, - radialSegments: radialSegments, - tubularSegments: tubularSegments, - arc: arc - }; - - radius = radius || 1; - tube = tube || 0.4; - radialSegments = Math.floor( radialSegments ) || 8; - tubularSegments = Math.floor( tubularSegments ) || 6; - arc = arc || Math.PI * 2; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var center = new Vector3(); - var vertex = new Vector3(); - var normal = new Vector3(); - - var j, i; - - // generate vertices, normals and uvs - - for ( j = 0; j <= radialSegments; j ++ ) { - - for ( i = 0; i <= tubularSegments; i ++ ) { - - var u = i / tubularSegments * arc; - var v = j / radialSegments * Math.PI * 2; - - // vertex - - vertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); - vertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); - vertex.z = tube * Math.sin( v ); - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal - - center.x = radius * Math.cos( u ); - center.y = radius * Math.sin( u ); - normal.subVectors( vertex, center ).normalize(); - - normals.push( normal.x, normal.y, normal.z ); - - // uv - - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); - - } - - } - - // generate indices - - for ( j = 1; j <= radialSegments; j ++ ) { - - for ( i = 1; i <= tubularSegments; i ++ ) { - - // indices - - var a = ( tubularSegments + 1 ) * j + i - 1; - var b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; - var c = ( tubularSegments + 1 ) * ( j - 1 ) + i; - var d = ( tubularSegments + 1 ) * j + i; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - -} - -TorusBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TorusBufferGeometry.prototype.constructor = TorusBufferGeometry; - - -export { TorusGeometry, TorusBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.d.ts b/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.d.ts deleted file mode 100644 index 06cfe8a467..0000000000 --- a/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class TorusKnotBufferGeometry extends BufferGeometry { - - constructor( - radius?: number, - tube?: number, - tubularSegments?: number, - radialSegments?: number, - p?: number, - q?: number - ); - - parameters: { - radius: number; - tube: number; - tubularSegments: number; - radialSegments: number; - p: number; - q: number; - heightScale: number; - }; - -} - -export class TorusKnotGeometry extends Geometry { - - constructor( - radius?: number, - tube?: number, - tubularSegments?: number, - radialSegments?: number, - p?: number, - q?: number - ); - - parameters: { - radius: number; - tube: number; - tubularSegments: number; - radialSegments: number; - p: number; - q: number; - heightScale: number; - }; - -} diff --git a/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.js b/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.js deleted file mode 100644 index 6041d99942..0000000000 --- a/cases/esbuild-three/src/base/geometries/TorusKnotGeometry.js +++ /dev/null @@ -1,194 +0,0 @@ -/** - * @author oosmoxiecode - * @author Mugen87 / https://github.com/Mugen87 - * - * based on http://www.blackpawn.com/texts/pqtorus/ - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -// TorusKnotGeometry - -function TorusKnotGeometry( radius, tube, tubularSegments, radialSegments, p, q, heightScale ) { - - Geometry.call( this ); - - this.type = 'TorusKnotGeometry'; - - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; - - if ( heightScale !== undefined ) console.warn( 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.' ); - - this.fromBufferGeometry( new TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) ); - this.mergeVertices(); - -} - -TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); -TorusKnotGeometry.prototype.constructor = TorusKnotGeometry; - -// TorusKnotBufferGeometry - -function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments, p, q ) { - - BufferGeometry.call( this ); - - this.type = 'TorusKnotBufferGeometry'; - - this.parameters = { - radius: radius, - tube: tube, - tubularSegments: tubularSegments, - radialSegments: radialSegments, - p: p, - q: q - }; - - radius = radius || 1; - tube = tube || 0.4; - tubularSegments = Math.floor( tubularSegments ) || 64; - radialSegments = Math.floor( radialSegments ) || 8; - p = p || 2; - q = q || 3; - - // buffers - - var indices = []; - var vertices = []; - var normals = []; - var uvs = []; - - // helper variables - - var i, j; - - var vertex = new Vector3(); - var normal = new Vector3(); - - var P1 = new Vector3(); - var P2 = new Vector3(); - - var B = new Vector3(); - var T = new Vector3(); - var N = new Vector3(); - - // generate vertices, normals and uvs - - for ( i = 0; i <= tubularSegments; ++ i ) { - - // the radian "u" is used to calculate the position on the torus curve of the current tubular segement - - var u = i / tubularSegments * p * Math.PI * 2; - - // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead. - // these points are used to create a special "coordinate space", which is necessary to calculate the correct vertex positions - - calculatePositionOnCurve( u, p, q, radius, P1 ); - calculatePositionOnCurve( u + 0.01, p, q, radius, P2 ); - - // calculate orthonormal basis - - T.subVectors( P2, P1 ); - N.addVectors( P2, P1 ); - B.crossVectors( T, N ); - N.crossVectors( B, T ); - - // normalize B, N. T can be ignored, we don't use it - - B.normalize(); - N.normalize(); - - for ( j = 0; j <= radialSegments; ++ j ) { - - // now calculate the vertices. they are nothing more than an extrusion of the torus curve. - // because we extrude a shape in the xy-plane, there is no need to calculate a z-value. - - var v = j / radialSegments * Math.PI * 2; - var cx = - tube * Math.cos( v ); - var cy = tube * Math.sin( v ); - - // now calculate the final vertex position. - // first we orient the extrusion with our basis vectos, then we add it to the current position on the curve - - vertex.x = P1.x + ( cx * N.x + cy * B.x ); - vertex.y = P1.y + ( cx * N.y + cy * B.y ); - vertex.z = P1.z + ( cx * N.z + cy * B.z ); - - vertices.push( vertex.x, vertex.y, vertex.z ); - - // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal) - - normal.subVectors( vertex, P1 ).normalize(); - - normals.push( normal.x, normal.y, normal.z ); - - // uv - - uvs.push( i / tubularSegments ); - uvs.push( j / radialSegments ); - - } - - } - - // generate indices - - for ( j = 1; j <= tubularSegments; j ++ ) { - - for ( i = 1; i <= radialSegments; i ++ ) { - - // indices - - var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - var b = ( radialSegments + 1 ) * j + ( i - 1 ); - var c = ( radialSegments + 1 ) * j + i; - var d = ( radialSegments + 1 ) * ( j - 1 ) + i; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - // this function calculates the current position on the torus curve - - function calculatePositionOnCurve( u, p, q, radius, position ) { - - var cu = Math.cos( u ); - var su = Math.sin( u ); - var quOverP = q / p * u; - var cs = Math.cos( quOverP ); - - position.x = radius * ( 2 + cs ) * 0.5 * cu; - position.y = radius * ( 2 + cs ) * su * 0.5; - position.z = radius * Math.sin( quOverP ) * 0.5; - - } - -} - -TorusKnotBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TorusKnotBufferGeometry.prototype.constructor = TorusKnotBufferGeometry; - - -export { TorusKnotGeometry, TorusKnotBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/TubeGeometry.d.ts b/cases/esbuild-three/src/base/geometries/TubeGeometry.d.ts deleted file mode 100644 index 2420bb587f..0000000000 --- a/cases/esbuild-three/src/base/geometries/TubeGeometry.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Curve } from './../extras/core/Curve'; -import { Vector3 } from './../math/Vector3'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class TubeBufferGeometry extends BufferGeometry { - - constructor( - path: Curve, - tubularSegments?: number, - radius?: number, - radiusSegments?: number, - closed?: boolean - ); - - parameters: { - path: Curve; - tubularSegments: number; - radius: number; - radialSegments: number; - closed: boolean; - }; - tangents: Vector3[]; - normals: Vector3[]; - binormals: Vector3[]; - -} - -export class TubeGeometry extends Geometry { - - constructor( - path: Curve, - tubularSegments?: number, - radius?: number, - radiusSegments?: number, - closed?: boolean - ); - - parameters: { - path: Curve; - tubularSegments: number; - radius: number; - radialSegments: number; - closed: boolean; - }; - tangents: Vector3[]; - normals: Vector3[]; - binormals: Vector3[]; - -} diff --git a/cases/esbuild-three/src/base/geometries/TubeGeometry.js b/cases/esbuild-three/src/base/geometries/TubeGeometry.js deleted file mode 100644 index 8f9159fd24..0000000000 --- a/cases/esbuild-three/src/base/geometries/TubeGeometry.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * @author oosmoxiecode / https://github.com/oosmoxiecode - * @author WestLangley / https://github.com/WestLangley - * @author zz85 / https://github.com/zz85 - * @author miningold / https://github.com/miningold - * @author jonobr1 / https://github.com/jonobr1 - * @author Mugen87 / https://github.com/Mugen87 - * - */ - -import { Geometry } from '../core/Geometry.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; - -// TubeGeometry - -function TubeGeometry( path, tubularSegments, radius, radialSegments, closed, taper ) { - - Geometry.call( this ); - - this.type = 'TubeGeometry'; - - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; - - if ( taper !== undefined ) console.warn( 'THREE.TubeGeometry: taper has been removed.' ); - - var bufferGeometry = new TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ); - - // expose internals - - this.tangents = bufferGeometry.tangents; - this.normals = bufferGeometry.normals; - this.binormals = bufferGeometry.binormals; - - // create geometry - - this.fromBufferGeometry( bufferGeometry ); - this.mergeVertices(); - -} - -TubeGeometry.prototype = Object.create( Geometry.prototype ); -TubeGeometry.prototype.constructor = TubeGeometry; - -// TubeBufferGeometry - -function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, closed ) { - - BufferGeometry.call( this ); - - this.type = 'TubeBufferGeometry'; - - this.parameters = { - path: path, - tubularSegments: tubularSegments, - radius: radius, - radialSegments: radialSegments, - closed: closed - }; - - tubularSegments = tubularSegments || 64; - radius = radius || 1; - radialSegments = radialSegments || 8; - closed = closed || false; - - var frames = path.computeFrenetFrames( tubularSegments, closed ); - - // expose internals - - this.tangents = frames.tangents; - this.normals = frames.normals; - this.binormals = frames.binormals; - - // helper variables - - var vertex = new Vector3(); - var normal = new Vector3(); - var uv = new Vector2(); - var P = new Vector3(); - - var i, j; - - // buffer - - var vertices = []; - var normals = []; - var uvs = []; - var indices = []; - - // create buffer data - - generateBufferData(); - - // build geometry - - this.setIndex( indices ); - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); - this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - - // functions - - function generateBufferData() { - - for ( i = 0; i < tubularSegments; i ++ ) { - - generateSegment( i ); - - } - - // if the geometry is not closed, generate the last row of vertices and normals - // at the regular position on the given path - // - // if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ) - - generateSegment( ( closed === false ) ? tubularSegments : 0 ); - - // uvs are generated in a separate function. - // this makes it easy compute correct values for closed geometries - - generateUVs(); - - // finally create faces - - generateIndices(); - - } - - function generateSegment( i ) { - - // we use getPointAt to sample evenly distributed points from the given path - - P = path.getPointAt( i / tubularSegments, P ); - - // retrieve corresponding normal and binormal - - var N = frames.normals[ i ]; - var B = frames.binormals[ i ]; - - // generate normals and vertices for the current segment - - for ( j = 0; j <= radialSegments; j ++ ) { - - var v = j / radialSegments * Math.PI * 2; - - var sin = Math.sin( v ); - var cos = - Math.cos( v ); - - // normal - - normal.x = ( cos * N.x + sin * B.x ); - normal.y = ( cos * N.y + sin * B.y ); - normal.z = ( cos * N.z + sin * B.z ); - normal.normalize(); - - normals.push( normal.x, normal.y, normal.z ); - - // vertex - - vertex.x = P.x + radius * normal.x; - vertex.y = P.y + radius * normal.y; - vertex.z = P.z + radius * normal.z; - - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - } - - function generateIndices() { - - for ( j = 1; j <= tubularSegments; j ++ ) { - - for ( i = 1; i <= radialSegments; i ++ ) { - - var a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 ); - var b = ( radialSegments + 1 ) * j + ( i - 1 ); - var c = ( radialSegments + 1 ) * j + i; - var d = ( radialSegments + 1 ) * ( j - 1 ) + i; - - // faces - - indices.push( a, b, d ); - indices.push( b, c, d ); - - } - - } - - } - - function generateUVs() { - - for ( i = 0; i <= tubularSegments; i ++ ) { - - for ( j = 0; j <= radialSegments; j ++ ) { - - uv.x = i / tubularSegments; - uv.y = j / radialSegments; - - uvs.push( uv.x, uv.y ); - - } - - } - - } - -} - -TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype ); -TubeBufferGeometry.prototype.constructor = TubeBufferGeometry; - -TubeBufferGeometry.prototype.toJSON = function () { - - var data = BufferGeometry.prototype.toJSON.call( this ); - - data.path = this.parameters.path.toJSON(); - - return data; - -}; - -export { TubeGeometry, TubeBufferGeometry }; diff --git a/cases/esbuild-three/src/base/geometries/WireframeGeometry.d.ts b/cases/esbuild-three/src/base/geometries/WireframeGeometry.d.ts deleted file mode 100644 index f92dd305ec..0000000000 --- a/cases/esbuild-three/src/base/geometries/WireframeGeometry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class WireframeGeometry extends BufferGeometry { - - constructor( geometry: Geometry | BufferGeometry ); - -} diff --git a/cases/esbuild-three/src/base/geometries/WireframeGeometry.js b/cases/esbuild-three/src/base/geometries/WireframeGeometry.js deleted file mode 100644 index 521b4c69b3..0000000000 --- a/cases/esbuild-three/src/base/geometries/WireframeGeometry.js +++ /dev/null @@ -1,179 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Vector3 } from '../math/Vector3.js'; - -function WireframeGeometry( geometry ) { - - BufferGeometry.call( this ); - - this.type = 'WireframeGeometry'; - - // buffer - - var vertices = []; - - // helper variables - - var i, j, l, o, ol; - var edge = [ 0, 0 ], edges = {}, e, edge1, edge2; - var key, keys = [ 'a', 'b', 'c' ]; - var vertex; - - // different logic for Geometry and BufferGeometry - - if ( geometry && geometry.isGeometry ) { - - // create a data structure that contains all edges without duplicates - - var faces = geometry.faces; - - for ( i = 0, l = faces.length; i < l; i ++ ) { - - var face = faces[ i ]; - - for ( j = 0; j < 3; j ++ ) { - - edge1 = face[ keys[ j ] ]; - edge2 = face[ keys[ ( j + 1 ) % 3 ] ]; - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); - - key = edge[ 0 ] + ',' + edge[ 1 ]; - - if ( edges[ key ] === undefined ) { - - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - - } - - } - - } - - // generate vertices - - for ( key in edges ) { - - e = edges[ key ]; - - vertex = geometry.vertices[ e.index1 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); - - vertex = geometry.vertices[ e.index2 ]; - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - } else if ( geometry && geometry.isBufferGeometry ) { - - var position, indices, groups; - var group, start, count; - var index1, index2; - - vertex = new Vector3(); - - if ( geometry.index !== null ) { - - // indexed BufferGeometry - - position = geometry.attributes.position; - indices = geometry.index; - groups = geometry.groups; - - if ( groups.length === 0 ) { - - groups = [ { start: 0, count: indices.count, materialIndex: 0 } ]; - - } - - // create a data structure that contains all eges without duplicates - - for ( o = 0, ol = groups.length; o < ol; ++ o ) { - - group = groups[ o ]; - - start = group.start; - count = group.count; - - for ( i = start, l = ( start + count ); i < l; i += 3 ) { - - for ( j = 0; j < 3; j ++ ) { - - edge1 = indices.getX( i + j ); - edge2 = indices.getX( i + ( j + 1 ) % 3 ); - edge[ 0 ] = Math.min( edge1, edge2 ); // sorting prevents duplicates - edge[ 1 ] = Math.max( edge1, edge2 ); - - key = edge[ 0 ] + ',' + edge[ 1 ]; - - if ( edges[ key ] === undefined ) { - - edges[ key ] = { index1: edge[ 0 ], index2: edge[ 1 ] }; - - } - - } - - } - - } - - // generate vertices - - for ( key in edges ) { - - e = edges[ key ]; - - vertex.fromBufferAttribute( position, e.index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); - - vertex.fromBufferAttribute( position, e.index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - } else { - - // non-indexed BufferGeometry - - position = geometry.attributes.position; - - for ( i = 0, l = ( position.count / 3 ); i < l; i ++ ) { - - for ( j = 0; j < 3; j ++ ) { - - // three edges per triangle, an edge is represented as (index1, index2) - // e.g. the first triangle has the following edges: (0,1),(1,2),(2,0) - - index1 = 3 * i + j; - vertex.fromBufferAttribute( position, index1 ); - vertices.push( vertex.x, vertex.y, vertex.z ); - - index2 = 3 * i + ( ( j + 1 ) % 3 ); - vertex.fromBufferAttribute( position, index2 ); - vertices.push( vertex.x, vertex.y, vertex.z ); - - } - - } - - } - - } - - // build geometry - - this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - -} - -WireframeGeometry.prototype = Object.create( BufferGeometry.prototype ); -WireframeGeometry.prototype.constructor = WireframeGeometry; - - -export { WireframeGeometry }; diff --git a/cases/esbuild-three/src/base/helpers/ArrowHelper.d.ts b/cases/esbuild-three/src/base/helpers/ArrowHelper.d.ts deleted file mode 100644 index cfe4f647ea..0000000000 --- a/cases/esbuild-three/src/base/helpers/ArrowHelper.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Vector3 } from './../math/Vector3'; -import { Line } from './../objects/Line'; -import { Mesh } from './../objects/Mesh'; -import { Color } from './../math/Color'; -import { Object3D } from './../core/Object3D'; - -// Extras / Helpers ///////////////////////////////////////////////////////////////////// - -export class ArrowHelper extends Object3D { - - constructor( - dir: Vector3, - origin?: Vector3, - length?: number, - hex?: number, - headLength?: number, - headWidth?: number - ); - - line: Line; - cone: Mesh; - - setDirection( dir: Vector3 ): void; - setLength( length: number, headLength?: number, headWidth?: number ): void; - setColor( color: Color | string | number ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/ArrowHelper.js b/cases/esbuild-three/src/base/helpers/ArrowHelper.js deleted file mode 100644 index 34c35096fd..0000000000 --- a/cases/esbuild-three/src/base/helpers/ArrowHelper.js +++ /dev/null @@ -1,133 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - * @author zz85 / http://github.com/zz85 - * @author bhouston / http://clara.io - * - * Creates an arrow for visualizing directions - * - * Parameters: - * dir - Vector3 - * origin - Vector3 - * length - Number - * color - color in hex value - * headLength - Number - * headWidth - Number - */ - -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Object3D } from '../core/Object3D.js'; -import { CylinderBufferGeometry } from '../geometries/CylinderGeometry.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Mesh } from '../objects/Mesh.js'; -import { Line } from '../objects/Line.js'; -import { Vector3 } from '../math/Vector3.js'; - -var _axis = new Vector3(); -var _lineGeometry, _coneGeometry; - -function ArrowHelper( dir, origin, length, color, headLength, headWidth ) { - - // dir is assumed to be normalized - - Object3D.call( this ); - - if ( dir === undefined ) dir = new Vector3( 0, 0, 1 ); - if ( origin === undefined ) origin = new Vector3( 0, 0, 0 ); - if ( length === undefined ) length = 1; - if ( color === undefined ) color = 0xffff00; - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; - - if ( _lineGeometry === undefined ) { - - _lineGeometry = new BufferGeometry(); - _lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) ); - - _coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 ); - _coneGeometry.translate( 0, - 0.5, 0 ); - - } - - this.position.copy( origin ); - - this.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color } ) ); - this.line.matrixAutoUpdate = false; - this.add( this.line ); - - this.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color } ) ); - this.cone.matrixAutoUpdate = false; - this.add( this.cone ); - - this.setDirection( dir ); - this.setLength( length, headLength, headWidth ); - -} - -ArrowHelper.prototype = Object.create( Object3D.prototype ); -ArrowHelper.prototype.constructor = ArrowHelper; - -ArrowHelper.prototype.setDirection = function ( dir ) { - - // dir is assumed to be normalized - - if ( dir.y > 0.99999 ) { - - this.quaternion.set( 0, 0, 0, 1 ); - - } else if ( dir.y < - 0.99999 ) { - - this.quaternion.set( 1, 0, 0, 0 ); - - } else { - - _axis.set( dir.z, 0, - dir.x ).normalize(); - - var radians = Math.acos( dir.y ); - - this.quaternion.setFromAxisAngle( _axis, radians ); - - } - -}; - -ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { - - if ( headLength === undefined ) headLength = 0.2 * length; - if ( headWidth === undefined ) headWidth = 0.2 * headLength; - - this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); - this.line.updateMatrix(); - - this.cone.scale.set( headWidth, headLength, headWidth ); - this.cone.position.y = length; - this.cone.updateMatrix(); - -}; - -ArrowHelper.prototype.setColor = function ( color ) { - - this.line.material.color.set( color ); - this.cone.material.color.set( color ); - -}; - -ArrowHelper.prototype.copy = function ( source ) { - - Object3D.prototype.copy.call( this, source, false ); - - this.line.copy( source.line ); - this.cone.copy( source.cone ); - - return this; - -}; - -ArrowHelper.prototype.clone = function () { - - return new this.constructor().copy( this ); - -}; - -export { ArrowHelper }; diff --git a/cases/esbuild-three/src/base/helpers/AxesHelper.d.ts b/cases/esbuild-three/src/base/helpers/AxesHelper.d.ts deleted file mode 100644 index e41d6cdcfb..0000000000 --- a/cases/esbuild-three/src/base/helpers/AxesHelper.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LineSegments } from './../objects/LineSegments'; - -export class AxesHelper extends LineSegments { - - constructor( size?: number ); - -} diff --git a/cases/esbuild-three/src/base/helpers/AxesHelper.js b/cases/esbuild-three/src/base/helpers/AxesHelper.js deleted file mode 100644 index 34a7f42ff5..0000000000 --- a/cases/esbuild-three/src/base/helpers/AxesHelper.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author sroucheray / http://sroucheray.org/ - * @author mrdoob / http://mrdoob.com/ - */ - -import { LineSegments } from '../objects/LineSegments.js'; -import { VertexColors } from '../constants.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -function AxesHelper( size ) { - - size = size || 1; - - var vertices = [ - 0, 0, 0, size, 0, 0, - 0, 0, 0, 0, size, 0, - 0, 0, 0, 0, 0, size - ]; - - var colors = [ - 1, 0, 0, 1, 0.6, 0, - 0, 1, 0, 0.6, 1, 0, - 0, 0, 1, 0, 0.6, 1 - ]; - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); - - LineSegments.call( this, geometry, material ); - -} - -AxesHelper.prototype = Object.create( LineSegments.prototype ); -AxesHelper.prototype.constructor = AxesHelper; - - -export { AxesHelper }; diff --git a/cases/esbuild-three/src/base/helpers/Box3Helper.d.ts b/cases/esbuild-three/src/base/helpers/Box3Helper.d.ts deleted file mode 100644 index b58c8d51a8..0000000000 --- a/cases/esbuild-three/src/base/helpers/Box3Helper.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Box3 } from './../math/Box3'; -import { Color } from './../math/Color'; -import { LineSegments } from './../objects/LineSegments'; - -export class Box3Helper extends LineSegments { - - constructor( box: Box3, color?: Color ); - - box: Box3; - -} diff --git a/cases/esbuild-three/src/base/helpers/Box3Helper.js b/cases/esbuild-three/src/base/helpers/Box3Helper.js deleted file mode 100644 index 92a0577b23..0000000000 --- a/cases/esbuild-three/src/base/helpers/Box3Helper.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - */ - -import { LineSegments } from '../objects/LineSegments.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { BufferAttribute } from '../core/BufferAttribute.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Object3D } from '../core/Object3D.js'; - -function Box3Helper( box, color ) { - - this.type = 'Box3Helper'; - - this.box = box; - - color = color || 0xffff00; - - var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - - var positions = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 1, - 1, 1, - 1, - 1 ]; - - var geometry = new BufferGeometry(); - - geometry.setIndex( new BufferAttribute( indices, 1 ) ); - - geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) ); - - this.geometry.computeBoundingSphere(); - -} - -Box3Helper.prototype = Object.create( LineSegments.prototype ); -Box3Helper.prototype.constructor = Box3Helper; - -Box3Helper.prototype.updateMatrixWorld = function ( force ) { - - var box = this.box; - - if ( box.isEmpty() ) return; - - box.getCenter( this.position ); - - box.getSize( this.scale ); - - this.scale.multiplyScalar( 0.5 ); - - Object3D.prototype.updateMatrixWorld.call( this, force ); - -}; - -export { Box3Helper }; diff --git a/cases/esbuild-three/src/base/helpers/BoxHelper.d.ts b/cases/esbuild-three/src/base/helpers/BoxHelper.d.ts deleted file mode 100644 index 662a383eca..0000000000 --- a/cases/esbuild-three/src/base/helpers/BoxHelper.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { Color } from './../math/Color'; -import { LineSegments } from './../objects/LineSegments'; - -export class BoxHelper extends LineSegments { - - constructor( object: Object3D, color?: Color ); - - update( object?: Object3D ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/BoxHelper.js b/cases/esbuild-three/src/base/helpers/BoxHelper.js deleted file mode 100644 index e7458a1cef..0000000000 --- a/cases/esbuild-three/src/base/helpers/BoxHelper.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / http://github.com/Mugen87 - */ - -import { Box3 } from '../math/Box3.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -var _box = new Box3(); - -function BoxHelper( object, color ) { - - this.object = object; - - if ( color === undefined ) color = 0xffff00; - - var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] ); - var positions = new Float32Array( 8 * 3 ); - - var geometry = new BufferGeometry(); - geometry.setIndex( new BufferAttribute( indices, 1 ) ); - geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) ); - - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) ); - - this.matrixAutoUpdate = false; - - this.update(); - -} - -BoxHelper.prototype = Object.create( LineSegments.prototype ); -BoxHelper.prototype.constructor = BoxHelper; - -BoxHelper.prototype.update = function ( object ) { - - if ( object !== undefined ) { - - console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' ); - - } - - if ( this.object !== undefined ) { - - _box.setFromObject( this.object ); - - } - - if ( _box.isEmpty() ) return; - - var min = _box.min; - var max = _box.max; - - /* - 5____4 - 1/___0/| - | 6__|_7 - 2/___3/ - - 0: max.x, max.y, max.z - 1: min.x, max.y, max.z - 2: min.x, min.y, max.z - 3: max.x, min.y, max.z - 4: max.x, max.y, min.z - 5: min.x, max.y, min.z - 6: min.x, min.y, min.z - 7: max.x, min.y, min.z - */ - - var position = this.geometry.attributes.position; - var array = position.array; - - array[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z; - array[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z; - array[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z; - array[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z; - array[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z; - array[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z; - array[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z; - array[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z; - - position.needsUpdate = true; - - this.geometry.computeBoundingSphere(); - - -}; - -BoxHelper.prototype.setFromObject = function ( object ) { - - this.object = object; - this.update(); - - return this; - -}; - -BoxHelper.prototype.copy = function ( source ) { - - LineSegments.prototype.copy.call( this, source ); - - this.object = source.object; - - return this; - -}; - -BoxHelper.prototype.clone = function () { - - return new this.constructor().copy( this ); - -}; - -export { BoxHelper }; diff --git a/cases/esbuild-three/src/base/helpers/CameraHelper.d.ts b/cases/esbuild-three/src/base/helpers/CameraHelper.d.ts deleted file mode 100644 index dc1ec11278..0000000000 --- a/cases/esbuild-three/src/base/helpers/CameraHelper.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Camera } from './../cameras/Camera'; -import { LineSegments } from './../objects/LineSegments'; - -export class CameraHelper extends LineSegments { - - constructor( camera: Camera ); - - camera: Camera; - pointMap: { [id: string]: number[] }; - - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/CameraHelper.js b/cases/esbuild-three/src/base/helpers/CameraHelper.js deleted file mode 100644 index 47f5f7fae9..0000000000 --- a/cases/esbuild-three/src/base/helpers/CameraHelper.js +++ /dev/null @@ -1,203 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author Mugen87 / https://github.com/Mugen87 - * - * - shows frustum, line of sight and up of the camera - * - suitable for fast updates - * - based on frustum visualization in lightgl.js shadowmap example - * http://evanw.github.com/lightgl.js/tests/shadowmap.html - */ - -import { Camera } from '../cameras/Camera.js'; -import { Vector3 } from '../math/Vector3.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { Color } from '../math/Color.js'; -import { FaceColors } from '../constants.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; - -var _vector = new Vector3(); -var _camera = new Camera(); - -function CameraHelper( camera ) { - - var geometry = new BufferGeometry(); - var material = new LineBasicMaterial( { color: 0xffffff, vertexColors: FaceColors } ); - - var vertices = []; - var colors = []; - - var pointMap = {}; - - // colors - - var colorFrustum = new Color( 0xffaa00 ); - var colorCone = new Color( 0xff0000 ); - var colorUp = new Color( 0x00aaff ); - var colorTarget = new Color( 0xffffff ); - var colorCross = new Color( 0x333333 ); - - // near - - addLine( 'n1', 'n2', colorFrustum ); - addLine( 'n2', 'n4', colorFrustum ); - addLine( 'n4', 'n3', colorFrustum ); - addLine( 'n3', 'n1', colorFrustum ); - - // far - - addLine( 'f1', 'f2', colorFrustum ); - addLine( 'f2', 'f4', colorFrustum ); - addLine( 'f4', 'f3', colorFrustum ); - addLine( 'f3', 'f1', colorFrustum ); - - // sides - - addLine( 'n1', 'f1', colorFrustum ); - addLine( 'n2', 'f2', colorFrustum ); - addLine( 'n3', 'f3', colorFrustum ); - addLine( 'n4', 'f4', colorFrustum ); - - // cone - - addLine( 'p', 'n1', colorCone ); - addLine( 'p', 'n2', colorCone ); - addLine( 'p', 'n3', colorCone ); - addLine( 'p', 'n4', colorCone ); - - // up - - addLine( 'u1', 'u2', colorUp ); - addLine( 'u2', 'u3', colorUp ); - addLine( 'u3', 'u1', colorUp ); - - // target - - addLine( 'c', 't', colorTarget ); - addLine( 'p', 'c', colorCross ); - - // cross - - addLine( 'cn1', 'cn2', colorCross ); - addLine( 'cn3', 'cn4', colorCross ); - - addLine( 'cf1', 'cf2', colorCross ); - addLine( 'cf3', 'cf4', colorCross ); - - function addLine( a, b, color ) { - - addPoint( a, color ); - addPoint( b, color ); - - } - - function addPoint( id, color ) { - - vertices.push( 0, 0, 0 ); - colors.push( color.r, color.g, color.b ); - - if ( pointMap[ id ] === undefined ) { - - pointMap[ id ] = []; - - } - - pointMap[ id ].push( ( vertices.length / 3 ) - 1 ); - - } - - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - - LineSegments.call( this, geometry, material ); - - this.camera = camera; - if ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix(); - - this.matrix = camera.matrixWorld; - this.matrixAutoUpdate = false; - - this.pointMap = pointMap; - - this.update(); - -} - -CameraHelper.prototype = Object.create( LineSegments.prototype ); -CameraHelper.prototype.constructor = CameraHelper; - -CameraHelper.prototype.update = function () { - - var geometry = this.geometry; - var pointMap = this.pointMap; - - var w = 1, h = 1; - - // we need just camera projection matrix inverse - // world matrix must be identity - - _camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse ); - - // center / target - - setPoint( 'c', pointMap, geometry, _camera, 0, 0, - 1 ); - setPoint( 't', pointMap, geometry, _camera, 0, 0, 1 ); - - // near - - setPoint( 'n1', pointMap, geometry, _camera, - w, - h, - 1 ); - setPoint( 'n2', pointMap, geometry, _camera, w, - h, - 1 ); - setPoint( 'n3', pointMap, geometry, _camera, - w, h, - 1 ); - setPoint( 'n4', pointMap, geometry, _camera, w, h, - 1 ); - - // far - - setPoint( 'f1', pointMap, geometry, _camera, - w, - h, 1 ); - setPoint( 'f2', pointMap, geometry, _camera, w, - h, 1 ); - setPoint( 'f3', pointMap, geometry, _camera, - w, h, 1 ); - setPoint( 'f4', pointMap, geometry, _camera, w, h, 1 ); - - // up - - setPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, - 1 ); - setPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, - 1 ); - setPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, - 1 ); - - // cross - - setPoint( 'cf1', pointMap, geometry, _camera, - w, 0, 1 ); - setPoint( 'cf2', pointMap, geometry, _camera, w, 0, 1 ); - setPoint( 'cf3', pointMap, geometry, _camera, 0, - h, 1 ); - setPoint( 'cf4', pointMap, geometry, _camera, 0, h, 1 ); - - setPoint( 'cn1', pointMap, geometry, _camera, - w, 0, - 1 ); - setPoint( 'cn2', pointMap, geometry, _camera, w, 0, - 1 ); - setPoint( 'cn3', pointMap, geometry, _camera, 0, - h, - 1 ); - setPoint( 'cn4', pointMap, geometry, _camera, 0, h, - 1 ); - - geometry.getAttribute( 'position' ).needsUpdate = true; - -}; - -function setPoint( point, pointMap, geometry, camera, x, y, z ) { - - _vector.set( x, y, z ).unproject( camera ); - - var points = pointMap[ point ]; - - if ( points !== undefined ) { - - var position = geometry.getAttribute( 'position' ); - - for ( var i = 0, l = points.length; i < l; i ++ ) { - - position.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z ); - - } - - } - -} - -export { CameraHelper }; diff --git a/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.d.ts b/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.d.ts deleted file mode 100644 index 632d818179..0000000000 --- a/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { DirectionalLight } from './../lights/DirectionalLight'; -import { Color } from './../math/Color'; -import { Line } from './../objects/Line'; -import { Matrix4 } from './../math/Matrix4'; -import { Object3D } from './../core/Object3D'; - -export class DirectionalLightHelper extends Object3D { - - constructor( - light: DirectionalLight, - size?: number, - color?: Color | string | number - ); - - light: DirectionalLight; - lightPlane: Line; - targetPlane: Line; - color: Color | string | number | undefined; - matrix: Matrix4; - matrixAutoUpdate: boolean; - - dispose(): void; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.js b/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.js deleted file mode 100644 index 2d09ff4f19..0000000000 --- a/cases/esbuild-three/src/base/helpers/DirectionalLightHelper.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -import { Vector3 } from '../math/Vector3.js'; -import { Object3D } from '../core/Object3D.js'; -import { Line } from '../objects/Line.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; - -var _v1 = new Vector3(); -var _v2 = new Vector3(); -var _v3 = new Vector3(); - -function DirectionalLightHelper( light, size, color ) { - - Object3D.call( this ); - - this.light = light; - this.light.updateMatrixWorld(); - - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; - - this.color = color; - - if ( size === undefined ) size = 1; - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( [ - - size, size, 0, - size, size, 0, - size, - size, 0, - - size, - size, 0, - - size, size, 0 - ], 3 ) ); - - var material = new LineBasicMaterial( { fog: false } ); - - this.lightPlane = new Line( geometry, material ); - this.add( this.lightPlane ); - - geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); - - this.targetLine = new Line( geometry, material ); - this.add( this.targetLine ); - - this.update(); - -} - -DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); -DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; - -DirectionalLightHelper.prototype.dispose = function () { - - this.lightPlane.geometry.dispose(); - this.lightPlane.material.dispose(); - this.targetLine.geometry.dispose(); - this.targetLine.material.dispose(); - -}; - -DirectionalLightHelper.prototype.update = function () { - - _v1.setFromMatrixPosition( this.light.matrixWorld ); - _v2.setFromMatrixPosition( this.light.target.matrixWorld ); - _v3.subVectors( _v2, _v1 ); - - this.lightPlane.lookAt( _v2 ); - - if ( this.color !== undefined ) { - - this.lightPlane.material.color.set( this.color ); - this.targetLine.material.color.set( this.color ); - - } else { - - this.lightPlane.material.color.copy( this.light.color ); - this.targetLine.material.color.copy( this.light.color ); - - } - - this.targetLine.lookAt( _v2 ); - this.targetLine.scale.z = _v3.length(); - -}; - - -export { DirectionalLightHelper }; diff --git a/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.d.ts b/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.d.ts deleted file mode 100644 index 7a5535f094..0000000000 --- a/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { LineSegments } from './../objects/LineSegments'; - -/** - * @deprecated Use {@link EdgesGeometry THREE.EdgesGeometry} - */ -// export class EdgesHelper extends LineSegments { -// constructor(object: Object3D, hex?: number, thresholdAngle?: number); -// } - -export class FaceNormalsHelper extends LineSegments { - - constructor( - object: Object3D, - size?: number, - hex?: number, - linewidth?: number - ); - - object: Object3D; - size: number; - - update( object?: Object3D ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.js b/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.js deleted file mode 100644 index 5452328493..0000000000 --- a/cases/esbuild-three/src/base/helpers/FaceNormalsHelper.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -import { Matrix3 } from '../math/Matrix3.js'; -import { Vector3 } from '../math/Vector3.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -var _v1 = new Vector3(); -var _v2 = new Vector3(); -var _normalMatrix = new Matrix3(); - -function FaceNormalsHelper( object, size, hex, linewidth ) { - - // FaceNormalsHelper only supports THREE.Geometry - - this.object = object; - - this.size = ( size !== undefined ) ? size : 1; - - var color = ( hex !== undefined ) ? hex : 0xffff00; - - var width = ( linewidth !== undefined ) ? linewidth : 1; - - // - - var nNormals = 0; - - var objGeometry = this.object.geometry; - - if ( objGeometry && objGeometry.isGeometry ) { - - nNormals = objGeometry.faces.length; - - } else { - - console.warn( 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.' ); - - } - - // - - var geometry = new BufferGeometry(); - - var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 ); - - geometry.addAttribute( 'position', positions ); - - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); - - // - - this.matrixAutoUpdate = false; - this.update(); - -} - -FaceNormalsHelper.prototype = Object.create( LineSegments.prototype ); -FaceNormalsHelper.prototype.constructor = FaceNormalsHelper; - -FaceNormalsHelper.prototype.update = function () { - - this.object.updateMatrixWorld( true ); - - _normalMatrix.getNormalMatrix( this.object.matrixWorld ); - - var matrixWorld = this.object.matrixWorld; - - var position = this.geometry.attributes.position; - - // - - var objGeometry = this.object.geometry; - - var vertices = objGeometry.vertices; - - var faces = objGeometry.faces; - - var idx = 0; - - for ( var i = 0, l = faces.length; i < l; i ++ ) { - - var face = faces[ i ]; - - var normal = face.normal; - - _v1.copy( vertices[ face.a ] ) - .add( vertices[ face.b ] ) - .add( vertices[ face.c ] ) - .divideScalar( 3 ) - .applyMatrix4( matrixWorld ); - - _v2.copy( normal ).applyMatrix3( _normalMatrix ).normalize().multiplyScalar( this.size ).add( _v1 ); - - position.setXYZ( idx, _v1.x, _v1.y, _v1.z ); - - idx = idx + 1; - - position.setXYZ( idx, _v2.x, _v2.y, _v2.z ); - - idx = idx + 1; - - } - - position.needsUpdate = true; - -}; - - -export { FaceNormalsHelper }; diff --git a/cases/esbuild-three/src/base/helpers/GridHelper.d.ts b/cases/esbuild-three/src/base/helpers/GridHelper.d.ts deleted file mode 100644 index ab7b080d13..0000000000 --- a/cases/esbuild-three/src/base/helpers/GridHelper.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Color } from './../math/Color'; -import { LineSegments } from './../objects/LineSegments'; - -export class GridHelper extends LineSegments { - - constructor( - size: number, - divisions: number, - color1?: Color | number, - color2?: Color | number - ); - /** - * @deprecated Colors should be specified in the constructor. - */ - setColors( color1?: Color | number, color2?: Color | number ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/GridHelper.js b/cases/esbuild-three/src/base/helpers/GridHelper.js deleted file mode 100644 index 649ac6b4c7..0000000000 --- a/cases/esbuild-three/src/base/helpers/GridHelper.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { LineSegments } from '../objects/LineSegments.js'; -import { VertexColors } from '../constants.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Color } from '../math/Color.js'; - -function GridHelper( size, divisions, color1, color2 ) { - - size = size || 10; - divisions = divisions || 10; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - - var center = divisions / 2; - var step = size / divisions; - var halfSize = size / 2; - - var vertices = [], colors = []; - - for ( var i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { - - vertices.push( - halfSize, 0, k, halfSize, 0, k ); - vertices.push( k, 0, - halfSize, k, 0, halfSize ); - - var color = i === center ? color1 : color2; - - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - color.toArray( colors, j ); j += 3; - - } - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); - - LineSegments.call( this, geometry, material ); - -} - -GridHelper.prototype = Object.assign( Object.create( LineSegments.prototype ), { - - constructor: GridHelper, - - copy: function ( source ) { - - LineSegments.prototype.copy.call( this, source ); - - this.geometry.copy( source.geometry ); - this.material.copy( source.material ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - } - -} ); - -export { GridHelper }; diff --git a/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.d.ts b/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.d.ts deleted file mode 100644 index 7d3ae8e2d4..0000000000 --- a/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { HemisphereLight } from './../lights/HemisphereLight'; -import { Color } from './../math/Color'; -import { Matrix4 } from './../math/Matrix4'; -import { MeshBasicMaterial } from './../materials/MeshBasicMaterial'; -import { Object3D } from './../core/Object3D'; - -export class HemisphereLightHelper extends Object3D { - - constructor( - light: HemisphereLight, - size: number, - color?: Color | number | string - ); - - light: HemisphereLight; - matrix: Matrix4; - matrixAutoUpdate: boolean; - material: MeshBasicMaterial; - - color: Color | string | number | undefined; - - dispose(): void; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.js b/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.js deleted file mode 100644 index 20f65ba1e3..0000000000 --- a/cases/esbuild-three/src/base/helpers/HemisphereLightHelper.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { Vector3 } from '../math/Vector3.js'; -import { Color } from '../math/Color.js'; -import { Object3D } from '../core/Object3D.js'; -import { Mesh } from '../objects/Mesh.js'; -import { VertexColors } from '../constants.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { OctahedronBufferGeometry } from '../geometries/OctahedronGeometry.js'; -import { BufferAttribute } from '../core/BufferAttribute.js'; - -var _vector = new Vector3(); -var _color1 = new Color(); -var _color2 = new Color(); - -function HemisphereLightHelper( light, size, color ) { - - Object3D.call( this ); - - this.light = light; - this.light.updateMatrixWorld(); - - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; - - this.color = color; - - var geometry = new OctahedronBufferGeometry( size ); - geometry.rotateY( Math.PI * 0.5 ); - - this.material = new MeshBasicMaterial( { wireframe: true, fog: false } ); - if ( this.color === undefined ) this.material.vertexColors = VertexColors; - - var position = geometry.getAttribute( 'position' ); - var colors = new Float32Array( position.count * 3 ); - - geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) ); - - this.add( new Mesh( geometry, this.material ) ); - - this.update(); - -} - -HemisphereLightHelper.prototype = Object.create( Object3D.prototype ); -HemisphereLightHelper.prototype.constructor = HemisphereLightHelper; - -HemisphereLightHelper.prototype.dispose = function () { - - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); - -}; - -HemisphereLightHelper.prototype.update = function () { - - var mesh = this.children[ 0 ]; - - if ( this.color !== undefined ) { - - this.material.color.set( this.color ); - - } else { - - var colors = mesh.geometry.getAttribute( 'color' ); - - _color1.copy( this.light.color ); - _color2.copy( this.light.groundColor ); - - for ( var i = 0, l = colors.count; i < l; i ++ ) { - - var color = ( i < ( l / 2 ) ) ? _color1 : _color2; - - colors.setXYZ( i, color.r, color.g, color.b ); - - } - - colors.needsUpdate = true; - - } - - mesh.lookAt( _vector.setFromMatrixPosition( this.light.matrixWorld ).negate() ); - -}; - - -export { HemisphereLightHelper }; diff --git a/cases/esbuild-three/src/base/helpers/LightProbeHelper.js b/cases/esbuild-three/src/base/helpers/LightProbeHelper.js deleted file mode 100644 index 9af1c16b10..0000000000 --- a/cases/esbuild-three/src/base/helpers/LightProbeHelper.js +++ /dev/null @@ -1,151 +0,0 @@ -import { Mesh } from '../objects/Mesh.js'; -import { ShaderMaterial } from '../materials/ShaderMaterial.js'; -import { SphereBufferGeometry } from '../geometries/SphereGeometry.js'; - -/** - * @author WestLangley / http://github.com/WestLangley - */ - -function LightProbeHelper( lightProbe, size ) { - - this.lightProbe = lightProbe; - - this.size = size; - - var defines = {}; - defines[ 'GAMMA_OUTPUT' ] = ""; - - // material - var material = new ShaderMaterial( { - - defines: defines, - - uniforms: { - - sh: { value: this.lightProbe.sh.coefficients }, // by reference - - intensity: { value: this.lightProbe.intensity } - - }, - - vertexShader: [ - - 'varying vec3 vNormal;', - - 'void main() {', - - ' vNormal = normalize( normalMatrix * normal );', - - ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', - - '}', - - ].join( '\n' ), - - fragmentShader: [ - - '#define RECIPROCAL_PI 0.318309886', - - 'vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {', - - ' // matrix is assumed to be orthogonal', - - ' return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );', - - '}', - - 'vec3 linearToOutput( in vec3 a ) {', - - ' #ifdef GAMMA_OUTPUT', - - ' return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );', - - ' #else', - - ' return a;', - - ' #endif', - - '}', - - '// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf', - 'vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {', - - ' // normal is assumed to have unit length', - - ' float x = normal.x, y = normal.y, z = normal.z;', - - ' // band 0', - ' vec3 result = shCoefficients[ 0 ] * 0.886227;', - - ' // band 1', - ' result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;', - ' result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;', - ' result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;', - - ' // band 2', - ' result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;', - ' result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;', - ' result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );', - ' result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;', - ' result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );', - - ' return result;', - - '}', - - 'uniform vec3 sh[ 9 ]; // sh coefficients', - - 'uniform float intensity; // light probe intensity', - - 'varying vec3 vNormal;', - - 'void main() {', - - ' vec3 normal = normalize( vNormal );', - - ' vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );', - - ' vec3 irradiance = shGetIrradianceAt( worldNormal, sh );', - - ' vec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;', - - ' outgoingLight = linearToOutput( outgoingLight );', - - ' gl_FragColor = vec4( outgoingLight, 1.0 );', - - '}' - - ].join( '\n' ) - - } ); - - var geometry = new SphereBufferGeometry( 1, 32, 16 ); - - Mesh.call( this, geometry, material ); - - this.onBeforeRender(); - -} - -LightProbeHelper.prototype = Object.create( Mesh.prototype ); -LightProbeHelper.prototype.constructor = LightProbeHelper; - -LightProbeHelper.prototype.dispose = function () { - - this.geometry.dispose(); - this.material.dispose(); - -}; - -LightProbeHelper.prototype.onBeforeRender = function () { - - this.position.copy( this.lightProbe.position ); - - this.scale.set( 1, 1, 1 ).multiplyScalar( this.size ); - - this.material.uniforms.intensity.value = this.lightProbe.intensity; - -}; - -export { LightProbeHelper }; diff --git a/cases/esbuild-three/src/base/helpers/PlaneHelper.d.ts b/cases/esbuild-three/src/base/helpers/PlaneHelper.d.ts deleted file mode 100644 index 353e31de18..0000000000 --- a/cases/esbuild-three/src/base/helpers/PlaneHelper.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Plane } from './../math/Plane'; -import { LineSegments } from './../objects/LineSegments'; - -export class PlaneHelper extends LineSegments { - - constructor( plane: Plane, size?: number, hex?: number ); - - plane: Plane; - size: number; - - updateMatrixWorld( force?: boolean ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/PlaneHelper.js b/cases/esbuild-three/src/base/helpers/PlaneHelper.js deleted file mode 100644 index edb94334aa..0000000000 --- a/cases/esbuild-three/src/base/helpers/PlaneHelper.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - */ - -import { Line } from '../objects/Line.js'; -import { Mesh } from '../objects/Mesh.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Object3D } from '../core/Object3D.js'; -import { FrontSide, BackSide } from '../constants.js'; - -function PlaneHelper( plane, size, hex ) { - - this.type = 'PlaneHelper'; - - this.plane = plane; - - this.size = ( size === undefined ) ? 1 : size; - - var color = ( hex !== undefined ) ? hex : 0xffff00; - - var positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ]; - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.computeBoundingSphere(); - - Line.call( this, geometry, new LineBasicMaterial( { color: color } ) ); - - // - - var positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ]; - - var geometry2 = new BufferGeometry(); - geometry2.addAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); - geometry2.computeBoundingSphere(); - - this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false } ) ) ); - -} - -PlaneHelper.prototype = Object.create( Line.prototype ); -PlaneHelper.prototype.constructor = PlaneHelper; - -PlaneHelper.prototype.updateMatrixWorld = function ( force ) { - - var scale = - this.plane.constant; - - if ( Math.abs( scale ) < 1e-8 ) scale = 1e-8; // sign does not matter - - this.scale.set( 0.5 * this.size, 0.5 * this.size, scale ); - - this.children[ 0 ].material.side = ( scale < 0 ) ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here - - this.lookAt( this.plane.normal ); - - Object3D.prototype.updateMatrixWorld.call( this, force ); - -}; - -export { PlaneHelper }; diff --git a/cases/esbuild-three/src/base/helpers/PointLightHelper.d.ts b/cases/esbuild-three/src/base/helpers/PointLightHelper.d.ts deleted file mode 100644 index 44aa29efab..0000000000 --- a/cases/esbuild-three/src/base/helpers/PointLightHelper.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PointLight } from './../lights/PointLight'; -import { Color } from './../math/Color'; -import { Matrix4 } from './../math/Matrix4'; -import { Object3D } from './../core/Object3D'; - -export class PointLightHelper extends Object3D { - - constructor( - light: PointLight, - sphereSize?: number, - color?: Color | string | number - ); - - light: PointLight; - color: Color | string | number | undefined; - matrix: Matrix4; - matrixAutoUpdate: boolean; - - dispose(): void; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/PointLightHelper.js b/cases/esbuild-three/src/base/helpers/PointLightHelper.js deleted file mode 100644 index 14d1291c41..0000000000 --- a/cases/esbuild-three/src/base/helpers/PointLightHelper.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -import { Mesh } from '../objects/Mesh.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { SphereBufferGeometry } from '../geometries/SphereGeometry.js'; - -function PointLightHelper( light, sphereSize, color ) { - - this.light = light; - this.light.updateMatrixWorld(); - - this.color = color; - - var geometry = new SphereBufferGeometry( sphereSize, 4, 2 ); - var material = new MeshBasicMaterial( { wireframe: true, fog: false } ); - - Mesh.call( this, geometry, material ); - - this.matrix = this.light.matrixWorld; - this.matrixAutoUpdate = false; - - this.update(); - - - /* - var distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 ); - var distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } ); - - this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial ); - this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial ); - - var d = light.distance; - - if ( d === 0.0 ) { - - this.lightDistance.visible = false; - - } else { - - this.lightDistance.scale.set( d, d, d ); - - } - - this.add( this.lightDistance ); - */ - -} - -PointLightHelper.prototype = Object.create( Mesh.prototype ); -PointLightHelper.prototype.constructor = PointLightHelper; - -PointLightHelper.prototype.dispose = function () { - - this.geometry.dispose(); - this.material.dispose(); - -}; - -PointLightHelper.prototype.update = function () { - - if ( this.color !== undefined ) { - - this.material.color.set( this.color ); - - } else { - - this.material.color.copy( this.light.color ); - - } - - /* - var d = this.light.distance; - - if ( d === 0.0 ) { - - this.lightDistance.visible = false; - - } else { - - this.lightDistance.visible = true; - this.lightDistance.scale.set( d, d, d ); - - } - */ - -}; - - -export { PointLightHelper }; diff --git a/cases/esbuild-three/src/base/helpers/PolarGridHelper.d.ts b/cases/esbuild-three/src/base/helpers/PolarGridHelper.d.ts deleted file mode 100644 index bdd253cce5..0000000000 --- a/cases/esbuild-three/src/base/helpers/PolarGridHelper.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { LineSegments } from '../objects/LineSegments'; -import { Color } from '../math/Color'; - -export class PolarGridHelper extends LineSegments { - - constructor( - radius: number, - radials: number, - circles: number, - divisions: number, - color1: Color | string | number | undefined, - color2: Color | string | number | undefined - ); - -} diff --git a/cases/esbuild-three/src/base/helpers/PolarGridHelper.js b/cases/esbuild-three/src/base/helpers/PolarGridHelper.js deleted file mode 100644 index bfbb0f0f19..0000000000 --- a/cases/esbuild-three/src/base/helpers/PolarGridHelper.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author Mugen87 / http://github.com/Mugen87 - * @author Hectate / http://www.github.com/Hectate - */ - -import { LineSegments } from '../objects/LineSegments.js'; -import { VertexColors } from '../constants.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Color } from '../math/Color.js'; - -function PolarGridHelper( radius, radials, circles, divisions, color1, color2 ) { - - radius = radius || 10; - radials = radials || 16; - circles = circles || 8; - divisions = divisions || 64; - color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); - color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); - - var vertices = []; - var colors = []; - - var x, z; - var v, i, j, r, color; - - // create the radials - - for ( i = 0; i <= radials; i ++ ) { - - v = ( i / radials ) * ( Math.PI * 2 ); - - x = Math.sin( v ) * radius; - z = Math.cos( v ) * radius; - - vertices.push( 0, 0, 0 ); - vertices.push( x, 0, z ); - - color = ( i & 1 ) ? color1 : color2; - - colors.push( color.r, color.g, color.b ); - colors.push( color.r, color.g, color.b ); - - } - - // create the circles - - for ( i = 0; i <= circles; i ++ ) { - - color = ( i & 1 ) ? color1 : color2; - - r = radius - ( radius / circles * i ); - - for ( j = 0; j < divisions; j ++ ) { - - // first vertex - - v = ( j / divisions ) * ( Math.PI * 2 ); - - x = Math.sin( v ) * r; - z = Math.cos( v ) * r; - - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); - - // second vertex - - v = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 ); - - x = Math.sin( v ) * r; - z = Math.cos( v ) * r; - - vertices.push( x, 0, z ); - colors.push( color.r, color.g, color.b ); - - } - - } - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - - var material = new LineBasicMaterial( { vertexColors: VertexColors } ); - - LineSegments.call( this, geometry, material ); - -} - -PolarGridHelper.prototype = Object.create( LineSegments.prototype ); -PolarGridHelper.prototype.constructor = PolarGridHelper; - -export { PolarGridHelper }; diff --git a/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.d.ts b/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.d.ts deleted file mode 100644 index 8f1e997ef1..0000000000 --- a/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PositionalAudio } from './../audio/PositionalAudio'; -import { Line } from './../objects/Line'; - -export class PositionalAudioHelper extends Line { - - constructor( audio: PositionalAudio, range?: number, divisionsInnerAngle?: number, divisionsOuterAngle?: number ); - - audio: PositionalAudio; - range: number; - divisionsInnerAngle: number; - divisionsOuterAngle: number; - - dispose(): void; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.js b/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.js deleted file mode 100644 index 2e3b89c1a9..0000000000 --- a/cases/esbuild-three/src/base/helpers/PositionalAudioHelper.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @author Mugen87 / http://github.com/Mugen87 - */ - -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { BufferAttribute } from '../core/BufferAttribute.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Line } from '../objects/Line.js'; -import { _Math } from '../math/Math.js'; - -function PositionalAudioHelper( audio, range, divisionsInnerAngle, divisionsOuterAngle ) { - - this.audio = audio; - this.range = range || 1; - this.divisionsInnerAngle = divisionsInnerAngle || 16; - this.divisionsOuterAngle = divisionsOuterAngle || 2; - - var geometry = new BufferGeometry(); - var divisions = this.divisionsInnerAngle + this.divisionsOuterAngle * 2; - var positions = new Float32Array( ( divisions * 3 + 3 ) * 3 ); - geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) ); - - var materialInnerAngle = new LineBasicMaterial( { color: 0x00ff00 } ); - var materialOuterAngle = new LineBasicMaterial( { color: 0xffff00 } ); - - Line.call( this, geometry, [ materialOuterAngle, materialInnerAngle ] ); - - this.update(); - -} - -PositionalAudioHelper.prototype = Object.create( Line.prototype ); -PositionalAudioHelper.prototype.constructor = PositionalAudioHelper; - -PositionalAudioHelper.prototype.update = function () { - - var audio = this.audio; - var range = this.range; - var divisionsInnerAngle = this.divisionsInnerAngle; - var divisionsOuterAngle = this.divisionsOuterAngle; - - var coneInnerAngle = _Math.degToRad( audio.panner.coneInnerAngle ); - var coneOuterAngle = _Math.degToRad( audio.panner.coneOuterAngle ); - - var halfConeInnerAngle = coneInnerAngle / 2; - var halfConeOuterAngle = coneOuterAngle / 2; - - var start = 0; - var count = 0; - var i, stride; - - var geometry = this.geometry; - var positionAttribute = geometry.attributes.position; - - geometry.clearGroups(); - - // - - function generateSegment( from, to, divisions, materialIndex ) { - - var step = ( to - from ) / divisions; - - positionAttribute.setXYZ( start, 0, 0, 0 ); - count ++; - - for ( i = from; i < to; i += step ) { - - stride = start + count; - - positionAttribute.setXYZ( stride, Math.sin( i ) * range, 0, Math.cos( i ) * range ); - positionAttribute.setXYZ( stride + 1, Math.sin( Math.min( i + step, to ) ) * range, 0, Math.cos( Math.min( i + step, to ) ) * range ); - positionAttribute.setXYZ( stride + 2, 0, 0, 0 ); - - count += 3; - - } - - geometry.addGroup( start, count, materialIndex ); - - start += count; - count = 0; - - } - - // - - generateSegment( - halfConeOuterAngle, - halfConeInnerAngle, divisionsOuterAngle, 0 ); - generateSegment( - halfConeInnerAngle, halfConeInnerAngle, divisionsInnerAngle, 1 ); - generateSegment( halfConeInnerAngle, halfConeOuterAngle, divisionsOuterAngle, 0 ); - - // - - positionAttribute.needsUpdate = true; - - if ( coneInnerAngle === coneOuterAngle ) this.material[ 0 ].visible = false; - -}; - -PositionalAudioHelper.prototype.dispose = function () { - - this.geometry.dispose(); - this.material[ 0 ].dispose(); - this.material[ 1 ].dispose(); - -}; - - -export { PositionalAudioHelper }; diff --git a/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.d.ts b/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.d.ts deleted file mode 100644 index c7551f8a0e..0000000000 --- a/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { RectAreaLight } from './../lights/RectAreaLight'; -import { Color } from './../math/Color'; -import { Line } from '../objects/Line'; - -export class RectAreaLightHelper extends Line { - - constructor( light: RectAreaLight, color?: Color | string | number ); - - light: RectAreaLight; - color: Color | string | number | undefined; - - update(): void; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.js b/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.js deleted file mode 100644 index cde2729392..0000000000 --- a/cases/esbuild-three/src/base/helpers/RectAreaLightHelper.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @author abelnation / http://github.com/abelnation - * @author Mugen87 / http://github.com/Mugen87 - * @author WestLangley / http://github.com/WestLangley - * - * This helper must be added as a child of the light - */ - -import { Line } from '../objects/Line.js'; -import { Mesh } from '../objects/Mesh.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { BackSide } from '../constants.js'; - -function RectAreaLightHelper( light, color ) { - - this.type = 'RectAreaLightHelper'; - - this.light = light; - - this.color = color; // optional hardwired color for the helper - - var positions = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ]; - - var geometry = new BufferGeometry(); - geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - geometry.computeBoundingSphere(); - - var material = new LineBasicMaterial( { fog: false } ); - - Line.call( this, geometry, material ); - - // - - var positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ]; - - var geometry2 = new BufferGeometry(); - geometry2.addAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) ); - geometry2.computeBoundingSphere(); - - this.add( new Mesh( geometry2, new MeshBasicMaterial( { side: BackSide, fog: false } ) ) ); - - this.update(); - -} - -RectAreaLightHelper.prototype = Object.create( Line.prototype ); -RectAreaLightHelper.prototype.constructor = RectAreaLightHelper; - -RectAreaLightHelper.prototype.update = function () { - - this.scale.set( 0.5 * this.light.width, 0.5 * this.light.height, 1 ); - - if ( this.color !== undefined ) { - - this.material.color.set( this.color ); - this.children[ 0 ].material.color.set( this.color ); - - } else { - - this.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); - - // prevent hue shift - var c = this.material.color; - var max = Math.max( c.r, c.g, c.b ); - if ( max > 1 ) c.multiplyScalar( 1 / max ); - - this.children[ 0 ].material.color.copy( this.material.color ); - - } - -}; - -RectAreaLightHelper.prototype.dispose = function () { - - this.geometry.dispose(); - this.material.dispose(); - this.children[ 0 ].geometry.dispose(); - this.children[ 0 ].material.dispose(); - -}; - -export { RectAreaLightHelper }; diff --git a/cases/esbuild-three/src/base/helpers/SkeletonHelper.d.ts b/cases/esbuild-three/src/base/helpers/SkeletonHelper.d.ts deleted file mode 100644 index f7a8fc007f..0000000000 --- a/cases/esbuild-three/src/base/helpers/SkeletonHelper.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { Bone } from './../objects/Bone'; -import { LineSegments } from './../objects/LineSegments'; - -export class SkeletonHelper extends LineSegments { - - constructor( bone: Object3D ); - - bones: Bone[]; - root: Object3D; - - getBoneList( object: Object3D ): Bone[]; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/SkeletonHelper.js b/cases/esbuild-three/src/base/helpers/SkeletonHelper.js deleted file mode 100644 index 20441dc110..0000000000 --- a/cases/esbuild-three/src/base/helpers/SkeletonHelper.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @author Sean Griffin / http://twitter.com/sgrif - * @author Michael Guerrero / http://realitymeltdown.com - * @author mrdoob / http://mrdoob.com/ - * @author ikerr / http://verold.com - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { LineSegments } from '../objects/LineSegments.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { VertexColors } from '../constants.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Color } from '../math/Color.js'; -import { Vector3 } from '../math/Vector3.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { Object3D } from '../core/Object3D.js'; - -var _vector = new Vector3(); -var _boneMatrix = new Matrix4(); -var _matrixWorldInv = new Matrix4(); - -function getBoneList( object ) { - - var boneList = []; - - if ( object && object.isBone ) { - - boneList.push( object ); - - } - - for ( var i = 0; i < object.children.length; i ++ ) { - - boneList.push.apply( boneList, getBoneList( object.children[ i ] ) ); - - } - - return boneList; - -} - -function SkeletonHelper( object ) { - - var bones = getBoneList( object ); - - var geometry = new BufferGeometry(); - - var vertices = []; - var colors = []; - - var color1 = new Color( 0, 0, 1 ); - var color2 = new Color( 0, 1, 0 ); - - for ( var i = 0; i < bones.length; i ++ ) { - - var bone = bones[ i ]; - - if ( bone.parent && bone.parent.isBone ) { - - vertices.push( 0, 0, 0 ); - vertices.push( 0, 0, 0 ); - colors.push( color1.r, color1.g, color1.b ); - colors.push( color2.r, color2.g, color2.b ); - - } - - } - - geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); - geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); - - var material = new LineBasicMaterial( { vertexColors: VertexColors, depthTest: false, depthWrite: false, transparent: true } ); - - LineSegments.call( this, geometry, material ); - - this.root = object; - this.bones = bones; - - this.matrix = object.matrixWorld; - this.matrixAutoUpdate = false; - -} - -SkeletonHelper.prototype = Object.create( LineSegments.prototype ); -SkeletonHelper.prototype.constructor = SkeletonHelper; - -SkeletonHelper.prototype.updateMatrixWorld = function ( force ) { - - var bones = this.bones; - - var geometry = this.geometry; - var position = geometry.getAttribute( 'position' ); - - _matrixWorldInv.getInverse( this.root.matrixWorld ); - - for ( var i = 0, j = 0; i < bones.length; i ++ ) { - - var bone = bones[ i ]; - - if ( bone.parent && bone.parent.isBone ) { - - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); - _vector.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j, _vector.x, _vector.y, _vector.z ); - - _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); - _vector.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j + 1, _vector.x, _vector.y, _vector.z ); - - j += 2; - - } - - } - - geometry.getAttribute( 'position' ).needsUpdate = true; - - Object3D.prototype.updateMatrixWorld.call( this, force ); - -}; - -export { SkeletonHelper }; diff --git a/cases/esbuild-three/src/base/helpers/SpotLightHelper.d.ts b/cases/esbuild-three/src/base/helpers/SpotLightHelper.d.ts deleted file mode 100644 index cf371860f1..0000000000 --- a/cases/esbuild-three/src/base/helpers/SpotLightHelper.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Light } from './../lights/Light'; -import { Color } from './../math/Color'; -import { Matrix4 } from './../math/Matrix4'; -import { Object3D } from './../core/Object3D'; -import { LineSegments } from '../objects/LineSegments'; - -export class SpotLightHelper extends Object3D { - - constructor( light: Light, color?: Color | string | number ); - - light: Light; - matrix: Matrix4; - matrixAutoUpdate: boolean; - color: Color | string | number | undefined; - cone: LineSegments; - - dispose(): void; - update(): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/SpotLightHelper.js b/cases/esbuild-three/src/base/helpers/SpotLightHelper.js deleted file mode 100644 index b2ea419e28..0000000000 --- a/cases/esbuild-three/src/base/helpers/SpotLightHelper.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -import { Vector3 } from '../math/Vector3.js'; -import { Object3D } from '../core/Object3D.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -var _vector = new Vector3(); - -function SpotLightHelper( light, color ) { - - Object3D.call( this ); - - this.light = light; - this.light.updateMatrixWorld(); - - this.matrix = light.matrixWorld; - this.matrixAutoUpdate = false; - - this.color = color; - - var geometry = new BufferGeometry(); - - var positions = [ - 0, 0, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 1, - 0, 0, 0, - 1, 0, 1, - 0, 0, 0, 0, 1, 1, - 0, 0, 0, 0, - 1, 1 - ]; - - for ( var i = 0, j = 1, l = 32; i < l; i ++, j ++ ) { - - var p1 = ( i / l ) * Math.PI * 2; - var p2 = ( j / l ) * Math.PI * 2; - - positions.push( - Math.cos( p1 ), Math.sin( p1 ), 1, - Math.cos( p2 ), Math.sin( p2 ), 1 - ); - - } - - geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) ); - - var material = new LineBasicMaterial( { fog: false } ); - - this.cone = new LineSegments( geometry, material ); - this.add( this.cone ); - - this.update(); - -} - -SpotLightHelper.prototype = Object.create( Object3D.prototype ); -SpotLightHelper.prototype.constructor = SpotLightHelper; - -SpotLightHelper.prototype.dispose = function () { - - this.cone.geometry.dispose(); - this.cone.material.dispose(); - -}; - -SpotLightHelper.prototype.update = function () { - - this.light.updateMatrixWorld(); - - var coneLength = this.light.distance ? this.light.distance : 1000; - var coneWidth = coneLength * Math.tan( this.light.angle ); - - this.cone.scale.set( coneWidth, coneWidth, coneLength ); - - _vector.setFromMatrixPosition( this.light.target.matrixWorld ); - - this.cone.lookAt( _vector ); - - if ( this.color !== undefined ) { - - this.cone.material.color.set( this.color ); - - } else { - - this.cone.material.color.copy( this.light.color ); - - } - -}; - - -export { SpotLightHelper }; diff --git a/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.d.ts b/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.d.ts deleted file mode 100644 index 090575c841..0000000000 --- a/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { LineSegments } from './../objects/LineSegments'; - -export class VertexNormalsHelper extends LineSegments { - - constructor( - object: Object3D, - size?: number, - hex?: number, - linewidth?: number - ); - - object: Object3D; - size: number; - - update( object?: Object3D ): void; - -} diff --git a/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.js b/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.js deleted file mode 100644 index fa5b56ef58..0000000000 --- a/cases/esbuild-three/src/base/helpers/VertexNormalsHelper.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -import { Matrix3 } from '../math/Matrix3.js'; -import { Vector3 } from '../math/Vector3.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -var _v1 = new Vector3(); -var _v2 = new Vector3(); -var _normalMatrix = new Matrix3(); -var _keys = [ 'a', 'b', 'c' ]; - -function VertexNormalsHelper( object, size, hex, linewidth ) { - - this.object = object; - - this.size = ( size !== undefined ) ? size : 1; - - var color = ( hex !== undefined ) ? hex : 0xff0000; - - var width = ( linewidth !== undefined ) ? linewidth : 1; - - // - - var nNormals = 0; - - var objGeometry = this.object.geometry; - - if ( objGeometry && objGeometry.isGeometry ) { - - nNormals = objGeometry.faces.length * 3; - - } else if ( objGeometry && objGeometry.isBufferGeometry ) { - - nNormals = objGeometry.attributes.normal.count; - - } - - // - - var geometry = new BufferGeometry(); - - var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 ); - - geometry.addAttribute( 'position', positions ); - - LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) ); - - // - - this.matrixAutoUpdate = false; - - this.update(); - -} - -VertexNormalsHelper.prototype = Object.create( LineSegments.prototype ); -VertexNormalsHelper.prototype.constructor = VertexNormalsHelper; - -VertexNormalsHelper.prototype.update = function () { - - this.object.updateMatrixWorld( true ); - - _normalMatrix.getNormalMatrix( this.object.matrixWorld ); - - var matrixWorld = this.object.matrixWorld; - - var position = this.geometry.attributes.position; - - // - - var objGeometry = this.object.geometry; - - if ( objGeometry && objGeometry.isGeometry ) { - - var vertices = objGeometry.vertices; - - var faces = objGeometry.faces; - - var idx = 0; - - for ( var i = 0, l = faces.length; i < l; i ++ ) { - - var face = faces[ i ]; - - for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { - - var vertex = vertices[ face[ _keys[ j ] ] ]; - - var normal = face.vertexNormals[ j ]; - - _v1.copy( vertex ).applyMatrix4( matrixWorld ); - - _v2.copy( normal ).applyMatrix3( _normalMatrix ).normalize().multiplyScalar( this.size ).add( _v1 ); - - position.setXYZ( idx, _v1.x, _v1.y, _v1.z ); - - idx = idx + 1; - - position.setXYZ( idx, _v2.x, _v2.y, _v2.z ); - - idx = idx + 1; - - } - - } - - } else if ( objGeometry && objGeometry.isBufferGeometry ) { - - var objPos = objGeometry.attributes.position; - - var objNorm = objGeometry.attributes.normal; - - var idx = 0; - - // for simplicity, ignore index and drawcalls, and render every normal - - for ( var j = 0, jl = objPos.count; j < jl; j ++ ) { - - _v1.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); - - _v2.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) ); - - _v2.applyMatrix3( _normalMatrix ).normalize().multiplyScalar( this.size ).add( _v1 ); - - position.setXYZ( idx, _v1.x, _v1.y, _v1.z ); - - idx = idx + 1; - - position.setXYZ( idx, _v2.x, _v2.y, _v2.z ); - - idx = idx + 1; - - } - - } - - position.needsUpdate = true; - -}; - - -export { VertexNormalsHelper }; diff --git a/cases/esbuild-three/src/base/lights/AmbientLight.d.ts b/cases/esbuild-three/src/base/lights/AmbientLight.d.ts deleted file mode 100644 index d6b05ceeed..0000000000 --- a/cases/esbuild-three/src/base/lights/AmbientLight.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Color } from './../math/Color'; -import { Light } from './Light'; - -/** - * This light's color gets applied to all the objects in the scene globally. - * - * @source https://github.com/mrdoob/three.js/blob/master/src/lights/AmbientLight.js - */ -export class AmbientLight extends Light { - - /** - * This creates a Ambientlight with a color. - * @param color Numeric value of the RGB component of the color or a Color instance. - */ - constructor( color?: Color | string | number, intensity?: number ); - - castShadow: boolean; - -} diff --git a/cases/esbuild-three/src/base/lights/AmbientLight.js b/cases/esbuild-three/src/base/lights/AmbientLight.js deleted file mode 100644 index 1c52837246..0000000000 --- a/cases/esbuild-three/src/base/lights/AmbientLight.js +++ /dev/null @@ -1,26 +0,0 @@ -import { Light } from './Light.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function AmbientLight( color, intensity ) { - - Light.call( this, color, intensity ); - - this.type = 'AmbientLight'; - - this.castShadow = undefined; - -} - -AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: AmbientLight, - - isAmbientLight: true - -} ); - - -export { AmbientLight }; diff --git a/cases/esbuild-three/src/base/lights/AmbientLightProbe.d.ts b/cases/esbuild-three/src/base/lights/AmbientLightProbe.d.ts deleted file mode 100644 index 5cc1de8a70..0000000000 --- a/cases/esbuild-three/src/base/lights/AmbientLightProbe.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Color } from './../math/Color'; -import { LightProbe } from './LightProbe'; - -export class AmbientLightProbe extends LightProbe { - - constructor( color?: Color | string | number, intensity?: number ); - - isAmbientLightProbe: true; - -} diff --git a/cases/esbuild-three/src/base/lights/AmbientLightProbe.js b/cases/esbuild-three/src/base/lights/AmbientLightProbe.js deleted file mode 100644 index 8f5c829d03..0000000000 --- a/cases/esbuild-three/src/base/lights/AmbientLightProbe.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - */ - -import { Color } from '../math/Color.js'; -import { LightProbe } from './LightProbe.js'; - -function AmbientLightProbe( color, intensity ) { - - LightProbe.call( this, undefined, intensity ); - - var color1 = new Color().set( color ); - - // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI ); - this.sh.coefficients[ 0 ].set( color1.r, color1.g, color1.b ).multiplyScalar( 2 * Math.sqrt( Math.PI ) ); - -} - -AmbientLightProbe.prototype = Object.assign( Object.create( LightProbe.prototype ), { - - constructor: AmbientLightProbe, - - isAmbientLightProbe: true, - - copy: function ( source ) { // modifying color not currently supported - - LightProbe.prototype.copy.call( this, source ); - - return this; - - }, - - toJSON: function ( meta ) { - - var data = LightProbe.prototype.toJSON.call( this, meta ); - - // data.sh = this.sh.toArray(); // todo - - return data; - - } - -} ); - -export { AmbientLightProbe }; diff --git a/cases/esbuild-three/src/base/lights/DirectionalLight.d.ts b/cases/esbuild-three/src/base/lights/DirectionalLight.d.ts deleted file mode 100644 index 25d619afba..0000000000 --- a/cases/esbuild-three/src/base/lights/DirectionalLight.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Color } from './../math/Color'; -import { Object3D } from './../core/Object3D'; -import { DirectionalLightShadow } from './DirectionalLightShadow'; -import { Light } from './Light'; - -/** - * Affects objects using MeshLambertMaterial or MeshPhongMaterial. - * - * @example - * // White directional light at half intensity shining from the top. - * var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 ); - * directionalLight.position.set( 0, 1, 0 ); - * scene.add( directionalLight ); - * - * @see src/lights/DirectionalLight.js - */ -export class DirectionalLight extends Light { - - constructor( color?: Color | string | number, intensity?: number ); - - /** - * Target used for shadow camera orientation. - */ - target: Object3D; - - /** - * Light's intensity. - * Default — 1.0. - */ - intensity: number; - - shadow: DirectionalLightShadow; - -} diff --git a/cases/esbuild-three/src/base/lights/DirectionalLight.js b/cases/esbuild-three/src/base/lights/DirectionalLight.js deleted file mode 100644 index 396a2a2282..0000000000 --- a/cases/esbuild-three/src/base/lights/DirectionalLight.js +++ /dev/null @@ -1,46 +0,0 @@ -import { Light } from './Light.js'; -import { DirectionalLightShadow } from './DirectionalLightShadow.js'; -import { Object3D } from '../core/Object3D.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -function DirectionalLight( color, intensity ) { - - Light.call( this, color, intensity ); - - this.type = 'DirectionalLight'; - - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); - - this.target = new Object3D(); - - this.shadow = new DirectionalLightShadow(); - -} - -DirectionalLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: DirectionalLight, - - isDirectionalLight: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.target = source.target.clone(); - - this.shadow = source.shadow.clone(); - - return this; - - } - -} ); - - -export { DirectionalLight }; diff --git a/cases/esbuild-three/src/base/lights/DirectionalLightShadow.d.ts b/cases/esbuild-three/src/base/lights/DirectionalLightShadow.d.ts deleted file mode 100644 index 7a506386ba..0000000000 --- a/cases/esbuild-three/src/base/lights/DirectionalLightShadow.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { OrthographicCamera } from './../cameras/OrthographicCamera'; -import { LightShadow } from './LightShadow'; - -export class DirectionalLightShadow extends LightShadow { - - camera: OrthographicCamera; - -} diff --git a/cases/esbuild-three/src/base/lights/DirectionalLightShadow.js b/cases/esbuild-three/src/base/lights/DirectionalLightShadow.js deleted file mode 100644 index 4f9211d410..0000000000 --- a/cases/esbuild-three/src/base/lights/DirectionalLightShadow.js +++ /dev/null @@ -1,29 +0,0 @@ -import { LightShadow } from './LightShadow.js'; -import { OrthographicCamera } from '../cameras/OrthographicCamera.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function DirectionalLightShadow() { - - LightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) ); - -} - -DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { - - constructor: DirectionalLightShadow, - - isDirectionalLightShadow: true, - - updateMatrices: function ( light, viewCamera, viewportIndex ) { - - LightShadow.prototype.updateMatrices.call( this, light, viewCamera, viewportIndex ); - - } - -} ); - - -export { DirectionalLightShadow }; diff --git a/cases/esbuild-three/src/base/lights/HemisphereLight.d.ts b/cases/esbuild-three/src/base/lights/HemisphereLight.d.ts deleted file mode 100644 index 1e40c3b446..0000000000 --- a/cases/esbuild-three/src/base/lights/HemisphereLight.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Color } from './../math/Color'; -import { Light } from './Light'; - -export class HemisphereLight extends Light { - - constructor( - skyColor?: Color | string | number, - groundColor?: Color | string | number, - intensity?: number - ); - - skyColor: Color; - groundColor: Color; - intensity: number; - -} diff --git a/cases/esbuild-three/src/base/lights/HemisphereLight.js b/cases/esbuild-three/src/base/lights/HemisphereLight.js deleted file mode 100644 index 84ccacb153..0000000000 --- a/cases/esbuild-three/src/base/lights/HemisphereLight.js +++ /dev/null @@ -1,43 +0,0 @@ -import { Light } from './Light.js'; -import { Color } from '../math/Color.js'; -import { Object3D } from '../core/Object3D.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -function HemisphereLight( skyColor, groundColor, intensity ) { - - Light.call( this, skyColor, intensity ); - - this.type = 'HemisphereLight'; - - this.castShadow = undefined; - - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); - - this.groundColor = new Color( groundColor ); - -} - -HemisphereLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: HemisphereLight, - - isHemisphereLight: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.groundColor.copy( source.groundColor ); - - return this; - - } - -} ); - - -export { HemisphereLight }; diff --git a/cases/esbuild-three/src/base/lights/HemisphereLightProbe.d.ts b/cases/esbuild-three/src/base/lights/HemisphereLightProbe.d.ts deleted file mode 100644 index 8b85882c7e..0000000000 --- a/cases/esbuild-three/src/base/lights/HemisphereLightProbe.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Color } from './../math/Color'; -import { LightProbe } from './LightProbe'; - -export class HemisphereLightProbe extends LightProbe { - - constructor( skyColor?: Color | string | number, groundColor?: Color | string | number, intensity?: number ); - - isHemisphereLightProbe: true; - -} diff --git a/cases/esbuild-three/src/base/lights/HemisphereLightProbe.js b/cases/esbuild-three/src/base/lights/HemisphereLightProbe.js deleted file mode 100644 index e6d6306af1..0000000000 --- a/cases/esbuild-three/src/base/lights/HemisphereLightProbe.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - */ - -import { Color } from '../math/Color.js'; -import { Vector3 } from '../math/Vector3.js'; -import { LightProbe } from './LightProbe.js'; - -function HemisphereLightProbe( skyColor, groundColor, intensity ) { - - LightProbe.call( this, undefined, intensity ); - - var color1 = new Color().set( skyColor ); - var color2 = new Color().set( groundColor ); - - var sky = new Vector3( color1.r, color1.g, color1.b ); - var ground = new Vector3( color2.r, color2.g, color2.b ); - - // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI ); - var c0 = Math.sqrt( Math.PI ); - var c1 = c0 * Math.sqrt( 0.75 ); - - this.sh.coefficients[ 0 ].copy( sky ).add( ground ).multiplyScalar( c0 ); - this.sh.coefficients[ 1 ].copy( sky ).sub( ground ).multiplyScalar( c1 ); - -} - -HemisphereLightProbe.prototype = Object.assign( Object.create( LightProbe.prototype ), { - - constructor: HemisphereLightProbe, - - isHemisphereLightProbe: true, - - copy: function ( source ) { // modifying colors not currently supported - - LightProbe.prototype.copy.call( this, source ); - - return this; - - }, - - toJSON: function ( meta ) { - - var data = LightProbe.prototype.toJSON.call( this, meta ); - - // data.sh = this.sh.toArray(); // todo - - return data; - - } - -} ); - -export { HemisphereLightProbe }; diff --git a/cases/esbuild-three/src/base/lights/Light.d.ts b/cases/esbuild-three/src/base/lights/Light.d.ts deleted file mode 100644 index ab54ff17d3..0000000000 --- a/cases/esbuild-three/src/base/lights/Light.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Color } from './../math/Color'; -import { LightShadow } from './LightShadow'; -import { Object3D } from './../core/Object3D'; - -// Lights ////////////////////////////////////////////////////////////////////////////////// - -/** - * Abstract base class for lights. - */ -export class Light extends Object3D { - - constructor( hex?: number | string, intensity?: number ); - - color: Color; - intensity: number; - isLight: true; - receiveShadow: boolean; - shadow: LightShadow; - /** - * @deprecated Use shadow.camera.fov instead. - */ - shadowCameraFov: any; - /** - * @deprecated Use shadow.camera.left instead. - */ - shadowCameraLeft: any; - /** - * @deprecated Use shadow.camera.right instead. - */ - shadowCameraRight: any; - /** - * @deprecated Use shadow.camera.top instead. - */ - shadowCameraTop: any; - /** - * @deprecated Use shadow.camera.bottom instead. - */ - shadowCameraBottom: any; - /** - * @deprecated Use shadow.camera.near instead. - */ - shadowCameraNear: any; - /** - * @deprecated Use shadow.camera.far instead. - */ - shadowCameraFar: any; - /** - * @deprecated Use shadow.bias instead. - */ - shadowBias: any; - /** - * @deprecated Use shadow.mapSize.width instead. - */ - shadowMapWidth: any; - /** - * @deprecated Use shadow.mapSize.height instead. - */ - shadowMapHeight: any; - -} diff --git a/cases/esbuild-three/src/base/lights/Light.js b/cases/esbuild-three/src/base/lights/Light.js deleted file mode 100644 index e4db9c009b..0000000000 --- a/cases/esbuild-three/src/base/lights/Light.js +++ /dev/null @@ -1,62 +0,0 @@ -import { Object3D } from '../core/Object3D.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -function Light( color, intensity ) { - - Object3D.call( this ); - - this.type = 'Light'; - - this.color = new Color( color ); - this.intensity = intensity !== undefined ? intensity : 1; - - this.receiveShadow = undefined; - -} - -Light.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Light, - - isLight: true, - - copy: function ( source ) { - - Object3D.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - this.intensity = source.intensity; - - return this; - - }, - - toJSON: function ( meta ) { - - var data = Object3D.prototype.toJSON.call( this, meta ); - - data.object.color = this.color.getHex(); - data.object.intensity = this.intensity; - - if ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex(); - - if ( this.distance !== undefined ) data.object.distance = this.distance; - if ( this.angle !== undefined ) data.object.angle = this.angle; - if ( this.decay !== undefined ) data.object.decay = this.decay; - if ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra; - - if ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON(); - - return data; - - } - -} ); - - -export { Light }; diff --git a/cases/esbuild-three/src/base/lights/LightProbe.d.ts b/cases/esbuild-three/src/base/lights/LightProbe.d.ts deleted file mode 100644 index 5dde42efe0..0000000000 --- a/cases/esbuild-three/src/base/lights/LightProbe.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SphericalHarmonics3 } from './../math/SphericalHarmonics3'; -import { Light } from './Light'; - -export class LightProbe extends Light { - - constructor( sh?: SphericalHarmonics3, intensity?: number ); - - isLightProbe: true; - sh: SphericalHarmonics3; - -} diff --git a/cases/esbuild-three/src/base/lights/LightProbe.js b/cases/esbuild-three/src/base/lights/LightProbe.js deleted file mode 100644 index f04b0a363b..0000000000 --- a/cases/esbuild-three/src/base/lights/LightProbe.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @author WestLangley / http://github.com/WestLangley - * - * A LightProbe is a source of indirect-diffuse light - */ - -import { SphericalHarmonics3 } from '../math/SphericalHarmonics3.js'; -import { Light } from './Light.js'; - -function LightProbe( sh, intensity ) { - - Light.call( this, undefined, intensity ); - - this.sh = ( sh !== undefined ) ? sh : new SphericalHarmonics3(); - -} - -LightProbe.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: LightProbe, - - isLightProbe: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.sh.copy( source.sh ); - this.intensity = source.intensity; - - return this; - - }, - - toJSON: function ( meta ) { - - var data = Light.prototype.toJSON.call( this, meta ); - - // data.sh = this.sh.toArray(); // todo - - return data; - - } - -} ); - -export { LightProbe }; diff --git a/cases/esbuild-three/src/base/lights/LightShadow.d.ts b/cases/esbuild-three/src/base/lights/LightShadow.d.ts deleted file mode 100644 index e2c8b00171..0000000000 --- a/cases/esbuild-three/src/base/lights/LightShadow.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Camera } from './../cameras/Camera'; -import { Light } from './../lights/Light'; -import { Vector2 } from './../math/Vector2'; -import { Vector4 } from './../math/Vector4'; -import { Matrix4 } from './../math/Matrix4'; -import { RenderTarget } from '../renderers/webgl/WebGLRenderLists'; - -export class LightShadow { - - constructor( camera: Camera ); - - camera: Camera; - bias: number; - radius: number; - mapSize: Vector2; - map: RenderTarget; - mapPass: RenderTarget; - matrix: Matrix4; - - copy( source: LightShadow ): this; - clone( recursive?: boolean ): this; - toJSON(): any; - getFrustum(): number; - updateMatrices( light: Light, viewCamera: Camera, viewportIndex: number ): void; - getViewport( viewportIndex: number ): Vector4; - getFrameExtents(): Vector2; - -} diff --git a/cases/esbuild-three/src/base/lights/LightShadow.js b/cases/esbuild-three/src/base/lights/LightShadow.js deleted file mode 100644 index 87c6bde9f4..0000000000 --- a/cases/esbuild-three/src/base/lights/LightShadow.js +++ /dev/null @@ -1,136 +0,0 @@ -import { Matrix4 } from '../math/Matrix4.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector4 } from '../math/Vector4.js'; -import { Frustum } from '../math/Frustum.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function LightShadow( camera ) { - - this.camera = camera; - - this.bias = 0; - this.radius = 1; - - this.mapSize = new Vector2( 512, 512 ); - - this.map = null; - this.mapPass = null; - this.matrix = new Matrix4(); - - this._frustum = new Frustum(); - this._frameExtents = new Vector2( 1, 1 ); - - this._viewportCount = 1; - - this._viewports = [ - - new Vector4( 0, 0, 1, 1 ) - - ]; - -} - -Object.assign( LightShadow.prototype, { - - _projScreenMatrix: new Matrix4(), - - _lightPositionWorld: new Vector3(), - - _lookTarget: new Vector3(), - - getViewportCount: function () { - - return this._viewportCount; - - }, - - getFrustum: function () { - - return this._frustum; - - }, - - updateMatrices: function ( light ) { - - var shadowCamera = this.camera, - shadowMatrix = this.matrix, - projScreenMatrix = this._projScreenMatrix, - lookTarget = this._lookTarget, - lightPositionWorld = this._lightPositionWorld; - - lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); - shadowCamera.position.copy( lightPositionWorld ); - - lookTarget.setFromMatrixPosition( light.target.matrixWorld ); - shadowCamera.lookAt( lookTarget ); - shadowCamera.updateMatrixWorld(); - - projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); - this._frustum.setFromMatrix( projScreenMatrix ); - - shadowMatrix.set( - 0.5, 0.0, 0.0, 0.5, - 0.0, 0.5, 0.0, 0.5, - 0.0, 0.0, 0.5, 0.5, - 0.0, 0.0, 0.0, 1.0 - ); - - shadowMatrix.multiply( shadowCamera.projectionMatrix ); - shadowMatrix.multiply( shadowCamera.matrixWorldInverse ); - - }, - - getViewport: function ( viewportIndex ) { - - return this._viewports[ viewportIndex ]; - - }, - - getFrameExtents: function () { - - return this._frameExtents; - - }, - - copy: function ( source ) { - - this.camera = source.camera.clone(); - - this.bias = source.bias; - this.radius = source.radius; - - this.mapSize.copy( source.mapSize ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - toJSON: function () { - - var object = {}; - - if ( this.bias !== 0 ) object.bias = this.bias; - if ( this.radius !== 1 ) object.radius = this.radius; - if ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray(); - - object.camera = this.camera.toJSON( false ).object; - delete object.camera.matrix; - - return object; - - } - -} ); - - -export { LightShadow }; diff --git a/cases/esbuild-three/src/base/lights/PointLight.d.ts b/cases/esbuild-three/src/base/lights/PointLight.d.ts deleted file mode 100644 index fa844da3a8..0000000000 --- a/cases/esbuild-three/src/base/lights/PointLight.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Color } from './../math/Color'; -import { Light } from './Light'; -import { PerspectiveCamera } from './../cameras/PerspectiveCamera'; -import { LightShadow } from './LightShadow'; - -export class PointLightShadow extends LightShadow { - - camera: PerspectiveCamera; - -} - -/** - * Affects objects using {@link MeshLambertMaterial} or {@link MeshPhongMaterial}. - * - * @example - * var light = new THREE.PointLight( 0xff0000, 1, 100 ); - * light.position.set( 50, 50, 50 ); - * scene.add( light ); - */ -export class PointLight extends Light { - - constructor( - color?: Color | string | number, - intensity?: number, - distance?: number, - decay?: number - ); - - /* - * Light's intensity. - * Default - 1.0. - */ - intensity: number; - - /** - * If non-zero, light will attenuate linearly from maximum intensity at light position down to zero at distance. - * Default — 0.0. - */ - distance: number; - - decay: number; - shadow: PointLightShadow; - power: number; - -} diff --git a/cases/esbuild-three/src/base/lights/PointLight.js b/cases/esbuild-three/src/base/lights/PointLight.js deleted file mode 100644 index 4e49b6d90d..0000000000 --- a/cases/esbuild-three/src/base/lights/PointLight.js +++ /dev/null @@ -1,61 +0,0 @@ -import { Light } from './Light.js'; -import { PointLightShadow } from './PointLightShadow.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - - -function PointLight( color, intensity, distance, decay ) { - - Light.call( this, color, intensity ); - - this.type = 'PointLight'; - - Object.defineProperty( this, 'power', { - get: function () { - - // intensity = power per solid angle. - // ref: equation (15) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf - return this.intensity * 4 * Math.PI; - - }, - set: function ( power ) { - - // intensity = power per solid angle. - // ref: equation (15) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf - this.intensity = power / ( 4 * Math.PI ); - - } - } ); - - this.distance = ( distance !== undefined ) ? distance : 0; - this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. - - this.shadow = new PointLightShadow(); - -} - -PointLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: PointLight, - - isPointLight: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.distance = source.distance; - this.decay = source.decay; - - this.shadow = source.shadow.clone(); - - return this; - - } - -} ); - - -export { PointLight }; diff --git a/cases/esbuild-three/src/base/lights/PointLightShadow.d.ts b/cases/esbuild-three/src/base/lights/PointLightShadow.d.ts deleted file mode 100644 index 8381c1ff3c..0000000000 --- a/cases/esbuild-three/src/base/lights/PointLightShadow.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PerspectiveCamera } from './../cameras/PerspectiveCamera'; -import { LightShadow } from './LightShadow'; - -export class PointLightShadow extends LightShadow { - - camera: PerspectiveCamera; - -} diff --git a/cases/esbuild-three/src/base/lights/PointLightShadow.js b/cases/esbuild-three/src/base/lights/PointLightShadow.js deleted file mode 100644 index 11a9e4af37..0000000000 --- a/cases/esbuild-three/src/base/lights/PointLightShadow.js +++ /dev/null @@ -1,88 +0,0 @@ -import { LightShadow } from './LightShadow.js'; -import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector4 } from '../math/Vector4.js'; - -function PointLightShadow() { - - LightShadow.call( this, new PerspectiveCamera( 90, 1, 0.5, 500 ) ); - - this._frameExtents = new Vector2( 4, 2 ); - - this._viewportCount = 6; - - this._viewports = [ - // These viewports map a cube-map onto a 2D texture with the - // following orientation: - // - // xzXZ - // y Y - // - // X - Positive x direction - // x - Negative x direction - // Y - Positive y direction - // y - Negative y direction - // Z - Positive z direction - // z - Negative z direction - - // positive X - new Vector4( 2, 1, 1, 1 ), - // negative X - new Vector4( 0, 1, 1, 1 ), - // positive Z - new Vector4( 3, 1, 1, 1 ), - // negative Z - new Vector4( 1, 1, 1, 1 ), - // positive Y - new Vector4( 3, 0, 1, 1 ), - // negative Y - new Vector4( 1, 0, 1, 1 ) - ]; - - this._cubeDirections = [ - new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ), - new Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 ) - ]; - - this._cubeUps = [ - new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), - new Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ), new Vector3( 0, 0, - 1 ) - ]; - -} - -PointLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { - - constructor: PointLightShadow, - - isPointLightShadow: true, - - updateMatrices: function ( light, viewCamera, viewportIndex ) { - - var camera = this.camera, - shadowMatrix = this.matrix, - lightPositionWorld = this._lightPositionWorld, - lookTarget = this._lookTarget, - projScreenMatrix = this._projScreenMatrix; - - lightPositionWorld.setFromMatrixPosition( light.matrixWorld ); - camera.position.copy( lightPositionWorld ); - - lookTarget.copy( camera.position ); - lookTarget.add( this._cubeDirections[ viewportIndex ] ); - camera.up.copy( this._cubeUps[ viewportIndex ] ); - camera.lookAt( lookTarget ); - camera.updateMatrixWorld(); - - shadowMatrix.makeTranslation( - lightPositionWorld.x, - lightPositionWorld.y, - lightPositionWorld.z ); - - projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); - this._frustum.setFromMatrix( projScreenMatrix ); - - } - -} ); - - -export { PointLightShadow }; diff --git a/cases/esbuild-three/src/base/lights/RectAreaLight.d.ts b/cases/esbuild-three/src/base/lights/RectAreaLight.d.ts deleted file mode 100644 index ec55ab12f9..0000000000 --- a/cases/esbuild-three/src/base/lights/RectAreaLight.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Light } from './Light'; -import { Color } from './../math/Color'; - -export class RectAreaLight extends Light { - - constructor( - color?: Color | string | number, - intensity?: number, - width?: number, - height?: number - ); - - type: string; - width: number; - height: number; - intensity: number; - -} diff --git a/cases/esbuild-three/src/base/lights/RectAreaLight.js b/cases/esbuild-three/src/base/lights/RectAreaLight.js deleted file mode 100644 index d65f35b130..0000000000 --- a/cases/esbuild-three/src/base/lights/RectAreaLight.js +++ /dev/null @@ -1,48 +0,0 @@ -import { Light } from './Light.js'; - -/** - * @author abelnation / http://github.com/abelnation - */ - -function RectAreaLight( color, intensity, width, height ) { - - Light.call( this, color, intensity ); - - this.type = 'RectAreaLight'; - - this.width = ( width !== undefined ) ? width : 10; - this.height = ( height !== undefined ) ? height : 10; - -} - -RectAreaLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: RectAreaLight, - - isRectAreaLight: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.width = source.width; - this.height = source.height; - - return this; - - }, - - toJSON: function ( meta ) { - - var data = Light.prototype.toJSON.call( this, meta ); - - data.object.width = this.width; - data.object.height = this.height; - - return data; - - } - -} ); - -export { RectAreaLight }; diff --git a/cases/esbuild-three/src/base/lights/SpotLight.d.ts b/cases/esbuild-three/src/base/lights/SpotLight.d.ts deleted file mode 100644 index 65ce39b2e7..0000000000 --- a/cases/esbuild-three/src/base/lights/SpotLight.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Color } from './../math/Color'; -import { Object3D } from './../core/Object3D'; -import { SpotLightShadow } from './SpotLightShadow'; -import { Light } from './Light'; - -/** - * A point light that can cast shadow in one direction. - */ -export class SpotLight extends Light { - - constructor( - color?: Color | string | number, - intensity?: number, - distance?: number, - angle?: number, - exponent?: number, - decay?: number - ); - - /** - * Spotlight focus points at target.position. - * Default position — (0,0,0). - */ - target: Object3D; - - /** - * Light's intensity. - * Default — 1.0. - */ - intensity: number; - - /** - * If non-zero, light will attenuate linearly from maximum intensity at light position down to zero at distance. - * Default — 0.0. - */ - distance: number; - - /* - * Maximum extent of the spotlight, in radians, from its direction. - * Default — Math.PI/2. - */ - angle: number; - - /** - * Rapidity of the falloff of light from its target direction. - * Default — 10.0. - */ - exponent: number; - - decay: number; - shadow: SpotLightShadow; - power: number; - penumbra: number; - -} diff --git a/cases/esbuild-three/src/base/lights/SpotLight.js b/cases/esbuild-three/src/base/lights/SpotLight.js deleted file mode 100644 index 90d891af10..0000000000 --- a/cases/esbuild-three/src/base/lights/SpotLight.js +++ /dev/null @@ -1,72 +0,0 @@ -import { Light } from './Light.js'; -import { SpotLightShadow } from './SpotLightShadow.js'; -import { Object3D } from '../core/Object3D.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -function SpotLight( color, intensity, distance, angle, penumbra, decay ) { - - Light.call( this, color, intensity ); - - this.type = 'SpotLight'; - - this.position.copy( Object3D.DefaultUp ); - this.updateMatrix(); - - this.target = new Object3D(); - - Object.defineProperty( this, 'power', { - get: function () { - - // intensity = power per solid angle. - // ref: equation (17) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf - return this.intensity * Math.PI; - - }, - set: function ( power ) { - - // intensity = power per solid angle. - // ref: equation (17) from https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf - this.intensity = power / Math.PI; - - } - } ); - - this.distance = ( distance !== undefined ) ? distance : 0; - this.angle = ( angle !== undefined ) ? angle : Math.PI / 3; - this.penumbra = ( penumbra !== undefined ) ? penumbra : 0; - this.decay = ( decay !== undefined ) ? decay : 1; // for physically correct lights, should be 2. - - this.shadow = new SpotLightShadow(); - -} - -SpotLight.prototype = Object.assign( Object.create( Light.prototype ), { - - constructor: SpotLight, - - isSpotLight: true, - - copy: function ( source ) { - - Light.prototype.copy.call( this, source ); - - this.distance = source.distance; - this.angle = source.angle; - this.penumbra = source.penumbra; - this.decay = source.decay; - - this.target = source.target.clone(); - - this.shadow = source.shadow.clone(); - - return this; - - } - -} ); - - -export { SpotLight }; diff --git a/cases/esbuild-three/src/base/lights/SpotLightShadow.d.ts b/cases/esbuild-three/src/base/lights/SpotLightShadow.d.ts deleted file mode 100644 index a3a432f4b1..0000000000 --- a/cases/esbuild-three/src/base/lights/SpotLightShadow.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PerspectiveCamera } from './../cameras/PerspectiveCamera'; -import { LightShadow } from './LightShadow'; - -export class SpotLightShadow extends LightShadow { - - camera: PerspectiveCamera; - -} diff --git a/cases/esbuild-three/src/base/lights/SpotLightShadow.js b/cases/esbuild-three/src/base/lights/SpotLightShadow.js deleted file mode 100644 index 47361e2279..0000000000 --- a/cases/esbuild-three/src/base/lights/SpotLightShadow.js +++ /dev/null @@ -1,45 +0,0 @@ -import { LightShadow } from './LightShadow.js'; -import { _Math } from '../math/Math.js'; -import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function SpotLightShadow() { - - LightShadow.call( this, new PerspectiveCamera( 50, 1, 0.5, 500 ) ); - -} - -SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), { - - constructor: SpotLightShadow, - - isSpotLightShadow: true, - - updateMatrices: function ( light, viewCamera, viewportIndex ) { - - var camera = this.camera; - - var fov = _Math.RAD2DEG * 2 * light.angle; - var aspect = this.mapSize.width / this.mapSize.height; - var far = light.distance || camera.far; - - if ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) { - - camera.fov = fov; - camera.aspect = aspect; - camera.far = far; - camera.updateProjectionMatrix(); - - } - - LightShadow.prototype.updateMatrices.call( this, light, viewCamera, viewportIndex ); - - } - -} ); - - -export { SpotLightShadow }; diff --git a/cases/esbuild-three/src/base/loaders/AnimationLoader.d.ts b/cases/esbuild-three/src/base/loaders/AnimationLoader.d.ts deleted file mode 100644 index b657037e5a..0000000000 --- a/cases/esbuild-three/src/base/loaders/AnimationLoader.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { LoadingManager } from './LoadingManager'; -import { Loader } from './Loader'; -import { AnimationClip } from './../animation/AnimationClip'; - -export class AnimationLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad?: ( response: string | ArrayBuffer ) => void, - onProgress?: ( request: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): any; - parse( json: any ): AnimationClip[]; - -} diff --git a/cases/esbuild-three/src/base/loaders/AnimationLoader.js b/cases/esbuild-three/src/base/loaders/AnimationLoader.js deleted file mode 100644 index 8600f0a7a5..0000000000 --- a/cases/esbuild-three/src/base/loaders/AnimationLoader.js +++ /dev/null @@ -1,52 +0,0 @@ -import { AnimationClip } from '../animation/AnimationClip.js'; -import { FileLoader } from './FileLoader.js'; -import { Loader } from './Loader.js'; - -/** - * @author bhouston / http://clara.io/ - */ - -function AnimationLoader( manager ) { - - Loader.call( this, manager ); - -} - -AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: AnimationLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var loader = new FileLoader( scope.manager ); - loader.setPath( scope.path ); - loader.load( url, function ( text ) { - - onLoad( scope.parse( JSON.parse( text ) ) ); - - }, onProgress, onError ); - - }, - - parse: function ( json ) { - - var animations = []; - - for ( var i = 0; i < json.length; i ++ ) { - - var clip = AnimationClip.parse( json[ i ] ); - - animations.push( clip ); - - } - - return animations; - - } - -} ); - - -export { AnimationLoader }; diff --git a/cases/esbuild-three/src/base/loaders/AudioLoader.d.ts b/cases/esbuild-three/src/base/loaders/AudioLoader.d.ts deleted file mode 100644 index d477b0f1b8..0000000000 --- a/cases/esbuild-three/src/base/loaders/AudioLoader.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; - -export class AudioLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad: Function, - onPrgress: Function, - onError: Function - ): void; - -} diff --git a/cases/esbuild-three/src/base/loaders/AudioLoader.js b/cases/esbuild-three/src/base/loaders/AudioLoader.js deleted file mode 100644 index 3ede1df0b9..0000000000 --- a/cases/esbuild-three/src/base/loaders/AudioLoader.js +++ /dev/null @@ -1,44 +0,0 @@ -import { AudioContext } from '../audio/AudioContext.js'; -import { FileLoader } from './FileLoader.js'; -import { Loader } from './Loader.js'; - -/** - * @author Reece Aaron Lecrivain / http://reecenotes.com/ - */ - -function AudioLoader( manager ) { - - Loader.call( this, manager ); - -} - -AudioLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: AudioLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); - loader.setPath( this.path ); - loader.load( url, function ( buffer ) { - - // Create a copy of the buffer. The `decodeAudioData` method - // detaches the buffer when complete, preventing reuse. - var bufferCopy = buffer.slice( 0 ); - - var context = AudioContext.getContext(); - context.decodeAudioData( bufferCopy, function ( audioBuffer ) { - - onLoad( audioBuffer ); - - } ); - - }, onProgress, onError ); - - } - -} ); - - -export { AudioLoader }; diff --git a/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.d.ts b/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.d.ts deleted file mode 100644 index ffdde0ff9a..0000000000 --- a/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export class BufferGeometryLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad: ( bufferGeometry: BufferGeometry ) => void, - onProgress?: ( event: any ) => void, - onError?: ( event: any ) => void - ): void; - parse( json: any ): BufferGeometry; - -} diff --git a/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.js b/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.js deleted file mode 100644 index 06561e559a..0000000000 --- a/cases/esbuild-three/src/base/loaders/BufferGeometryLoader.js +++ /dev/null @@ -1,143 +0,0 @@ -import { Sphere } from '../math/Sphere.js'; -import { Vector3 } from '../math/Vector3.js'; -import { BufferAttribute } from '../core/BufferAttribute.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { FileLoader } from './FileLoader.js'; -import { Loader } from './Loader.js'; -import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js'; -import { InstancedBufferAttribute } from '../core/InstancedBufferAttribute.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function BufferGeometryLoader( manager ) { - - Loader.call( this, manager ); - -} - -BufferGeometryLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: BufferGeometryLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var loader = new FileLoader( scope.manager ); - loader.setPath( scope.path ); - loader.load( url, function ( text ) { - - onLoad( scope.parse( JSON.parse( text ) ) ); - - }, onProgress, onError ); - - }, - - parse: function ( json ) { - - var geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry(); - - var index = json.data.index; - - if ( index !== undefined ) { - - var typedArray = new TYPED_ARRAYS[ index.type ]( index.array ); - geometry.setIndex( new BufferAttribute( typedArray, 1 ) ); - - } - - var attributes = json.data.attributes; - - for ( var key in attributes ) { - - var attribute = attributes[ key ]; - var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array ); - var bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute; - var bufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized ); - if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; - geometry.addAttribute( key, bufferAttribute ); - - } - - var morphAttributes = json.data.morphAttributes; - - if ( morphAttributes ) { - - for ( var key in morphAttributes ) { - - var attributeArray = morphAttributes[ key ]; - - var array = []; - - for ( var i = 0, il = attributeArray.length; i < il; i ++ ) { - - var attribute = attributeArray[ i ]; - var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array ); - - var bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ); - if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name; - array.push( bufferAttribute ); - - } - - geometry.morphAttributes[ key ] = array; - - } - - } - - var groups = json.data.groups || json.data.drawcalls || json.data.offsets; - - if ( groups !== undefined ) { - - for ( var i = 0, n = groups.length; i !== n; ++ i ) { - - var group = groups[ i ]; - - geometry.addGroup( group.start, group.count, group.materialIndex ); - - } - - } - - var boundingSphere = json.data.boundingSphere; - - if ( boundingSphere !== undefined ) { - - var center = new Vector3(); - - if ( boundingSphere.center !== undefined ) { - - center.fromArray( boundingSphere.center ); - - } - - geometry.boundingSphere = new Sphere( center, boundingSphere.radius ); - - } - - if ( json.name ) geometry.name = json.name; - if ( json.userData ) geometry.userData = json.userData; - - return geometry; - - } - -} ); - -var TYPED_ARRAYS = { - Int8Array: Int8Array, - Uint8Array: Uint8Array, - // Workaround for IE11 pre KB2929437. See #11440 - Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array, - Int16Array: Int16Array, - Uint16Array: Uint16Array, - Int32Array: Int32Array, - Uint32Array: Uint32Array, - Float32Array: Float32Array, - Float64Array: Float64Array -}; - -export { BufferGeometryLoader }; diff --git a/cases/esbuild-three/src/base/loaders/Cache.d.ts b/cases/esbuild-three/src/base/loaders/Cache.d.ts deleted file mode 100644 index a658f7a999..0000000000 --- a/cases/esbuild-three/src/base/loaders/Cache.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export namespace Cache { - export let enabled: boolean; - export let files: any; - - export function add( key: string, file: any ): void; - export function get( key: string ): any; - export function remove( key: string ): void; - export function clear(): void; -} diff --git a/cases/esbuild-three/src/base/loaders/Cache.js b/cases/esbuild-three/src/base/loaders/Cache.js deleted file mode 100644 index 9f63c8dfc6..0000000000 --- a/cases/esbuild-three/src/base/loaders/Cache.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -var Cache = { - - enabled: false, - - files: {}, - - add: function ( key, file ) { - - if ( this.enabled === false ) return; - - // console.log( 'THREE.Cache', 'Adding key:', key ); - - this.files[ key ] = file; - - }, - - get: function ( key ) { - - if ( this.enabled === false ) return; - - // console.log( 'THREE.Cache', 'Checking key:', key ); - - return this.files[ key ]; - - }, - - remove: function ( key ) { - - delete this.files[ key ]; - - }, - - clear: function () { - - this.files = {}; - - } - -}; - - -export { Cache }; diff --git a/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.d.ts b/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.d.ts deleted file mode 100644 index d95e6e4ebf..0000000000 --- a/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { CompressedTexture } from './../textures/CompressedTexture'; - -export class CompressedTextureLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad: ( texture: CompressedTexture ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): void; - -} diff --git a/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.js b/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.js deleted file mode 100644 index c8b630a3c1..0000000000 --- a/cases/esbuild-three/src/base/loaders/CompressedTextureLoader.js +++ /dev/null @@ -1,136 +0,0 @@ -import { LinearFilter } from '../constants.js'; -import { FileLoader } from './FileLoader.js'; -import { CompressedTexture } from '../textures/CompressedTexture.js'; -import { Loader } from './Loader.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * - * Abstract Base class to block based textures loader (dds, pvr, ...) - */ - -function CompressedTextureLoader( manager ) { - - Loader.call( this, manager ); - - // override in sub classes - this._parser = null; - -} - -CompressedTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: CompressedTextureLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var images = []; - - var texture = new CompressedTexture(); - texture.image = images; - - var loader = new FileLoader( this.manager ); - loader.setPath( this.path ); - loader.setResponseType( 'arraybuffer' ); - - function loadTexture( i ) { - - loader.load( url[ i ], function ( buffer ) { - - var texDatas = scope._parser( buffer, true ); - - images[ i ] = { - width: texDatas.width, - height: texDatas.height, - format: texDatas.format, - mipmaps: texDatas.mipmaps - }; - - loaded += 1; - - if ( loaded === 6 ) { - - if ( texDatas.mipmapCount === 1 ) - texture.minFilter = LinearFilter; - - texture.format = texDatas.format; - texture.needsUpdate = true; - - if ( onLoad ) onLoad( texture ); - - } - - }, onProgress, onError ); - - } - - if ( Array.isArray( url ) ) { - - var loaded = 0; - - for ( var i = 0, il = url.length; i < il; ++ i ) { - - loadTexture( i ); - - } - - } else { - - // compressed cubemap texture stored in a single DDS file - - loader.load( url, function ( buffer ) { - - var texDatas = scope._parser( buffer, true ); - - if ( texDatas.isCubemap ) { - - var faces = texDatas.mipmaps.length / texDatas.mipmapCount; - - for ( var f = 0; f < faces; f ++ ) { - - images[ f ] = { mipmaps: [] }; - - for ( var i = 0; i < texDatas.mipmapCount; i ++ ) { - - images[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] ); - images[ f ].format = texDatas.format; - images[ f ].width = texDatas.width; - images[ f ].height = texDatas.height; - - } - - } - - } else { - - texture.image.width = texDatas.width; - texture.image.height = texDatas.height; - texture.mipmaps = texDatas.mipmaps; - - } - - if ( texDatas.mipmapCount === 1 ) { - - texture.minFilter = LinearFilter; - - } - - texture.format = texDatas.format; - texture.needsUpdate = true; - - if ( onLoad ) onLoad( texture ); - - }, onProgress, onError ); - - } - - return texture; - - } - -} ); - - -export { CompressedTextureLoader }; diff --git a/cases/esbuild-three/src/base/loaders/CubeTextureLoader.d.ts b/cases/esbuild-three/src/base/loaders/CubeTextureLoader.d.ts deleted file mode 100644 index 12d7b3b3a0..0000000000 --- a/cases/esbuild-three/src/base/loaders/CubeTextureLoader.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { CubeTexture } from './../textures/CubeTexture'; - -export class CubeTextureLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - urls: Array, - onLoad?: ( texture: CubeTexture ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): CubeTexture; - -} diff --git a/cases/esbuild-three/src/base/loaders/CubeTextureLoader.js b/cases/esbuild-three/src/base/loaders/CubeTextureLoader.js deleted file mode 100644 index 8fb4d69667..0000000000 --- a/cases/esbuild-three/src/base/loaders/CubeTextureLoader.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { ImageLoader } from './ImageLoader.js'; -import { CubeTexture } from '../textures/CubeTexture.js'; -import { Loader } from './Loader.js'; - - -function CubeTextureLoader( manager ) { - - Loader.call( this, manager ); - -} - -CubeTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: CubeTextureLoader, - - load: function ( urls, onLoad, onProgress, onError ) { - - var texture = new CubeTexture(); - - var loader = new ImageLoader( this.manager ); - loader.setCrossOrigin( this.crossOrigin ); - loader.setPath( this.path ); - - var loaded = 0; - - function loadTexture( i ) { - - loader.load( urls[ i ], function ( image ) { - - texture.images[ i ] = image; - - loaded ++; - - if ( loaded === 6 ) { - - texture.needsUpdate = true; - - if ( onLoad ) onLoad( texture ); - - } - - }, undefined, onError ); - - } - - for ( var i = 0; i < urls.length; ++ i ) { - - loadTexture( i ); - - } - - return texture; - - } - -} ); - - -export { CubeTextureLoader }; diff --git a/cases/esbuild-three/src/base/loaders/DataTextureLoader.d.ts b/cases/esbuild-three/src/base/loaders/DataTextureLoader.d.ts deleted file mode 100644 index e49350915a..0000000000 --- a/cases/esbuild-three/src/base/loaders/DataTextureLoader.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { DataTexture } from './../textures/DataTexture'; - -export class DataTextureLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad: ( dataTexture: DataTexture ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): void; - -} diff --git a/cases/esbuild-three/src/base/loaders/DataTextureLoader.js b/cases/esbuild-three/src/base/loaders/DataTextureLoader.js deleted file mode 100644 index 5330a5746d..0000000000 --- a/cases/esbuild-three/src/base/loaders/DataTextureLoader.js +++ /dev/null @@ -1,97 +0,0 @@ -import { LinearFilter, LinearMipmapLinearFilter, ClampToEdgeWrapping } from '../constants.js'; -import { FileLoader } from './FileLoader.js'; -import { DataTexture } from '../textures/DataTexture.js'; -import { Loader } from './Loader.js'; - -/** - * @author Nikos M. / https://github.com/foo123/ - * - * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...) - */ - -function DataTextureLoader( manager ) { - - Loader.call( this, manager ); - - // override in sub classes - this._parser = null; - -} - -DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: DataTextureLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var texture = new DataTexture(); - - var loader = new FileLoader( this.manager ); - loader.setResponseType( 'arraybuffer' ); - loader.setPath( this.path ); - loader.load( url, function ( buffer ) { - - var texData = scope._parser( buffer ); - - if ( ! texData ) return; - - if ( texData.image !== undefined ) { - - texture.image = texData.image; - - } else if ( texData.data !== undefined ) { - - texture.image.width = texData.width; - texture.image.height = texData.height; - texture.image.data = texData.data; - - } - - texture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping; - texture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping; - - texture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter; - texture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearMipmapLinearFilter; - - texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; - - if ( texData.format !== undefined ) { - - texture.format = texData.format; - - } - if ( texData.type !== undefined ) { - - texture.type = texData.type; - - } - - if ( texData.mipmaps !== undefined ) { - - texture.mipmaps = texData.mipmaps; - - } - - if ( texData.mipmapCount === 1 ) { - - texture.minFilter = LinearFilter; - - } - - texture.needsUpdate = true; - - if ( onLoad ) onLoad( texture, texData ); - - }, onProgress, onError ); - - - return texture; - - } - -} ); - - -export { DataTextureLoader }; diff --git a/cases/esbuild-three/src/base/loaders/FileLoader.d.ts b/cases/esbuild-three/src/base/loaders/FileLoader.d.ts deleted file mode 100644 index fefd230d00..0000000000 --- a/cases/esbuild-three/src/base/loaders/FileLoader.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; - -export class FileLoader extends Loader { - - constructor( manager?: LoadingManager ); - - mimeType: undefined | MimeType; - responseType: undefined |string; - withCredentials: undefined |string; - requestHeader: undefined | { [header: string]: string }; - - load( - url: string, - onLoad?: ( response: string | ArrayBuffer ) => void, - onProgress?: ( request: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): any; - setMimeType( mimeType: MimeType ): FileLoader; - setResponseType( responseType: string ): FileLoader; - setWithCredentials( value: string ): FileLoader; - setRequestHeader( value: { [header: string]: string } ): FileLoader; - -} diff --git a/cases/esbuild-three/src/base/loaders/FileLoader.js b/cases/esbuild-three/src/base/loaders/FileLoader.js deleted file mode 100644 index ccfbbc0aac..0000000000 --- a/cases/esbuild-three/src/base/loaders/FileLoader.js +++ /dev/null @@ -1,314 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Cache } from './Cache.js'; -import { Loader } from './Loader.js'; - -var loading = {}; - -function FileLoader( manager ) { - - Loader.call( this, manager ); - -} - -FileLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: FileLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - if ( url === undefined ) url = ''; - - if ( this.path !== undefined ) url = this.path + url; - - url = this.manager.resolveURL( url ); - - var scope = this; - - var cached = Cache.get( url ); - - if ( cached !== undefined ) { - - scope.manager.itemStart( url ); - - setTimeout( function () { - - if ( onLoad ) onLoad( cached ); - - scope.manager.itemEnd( url ); - - }, 0 ); - - return cached; - - } - - // Check if request is duplicate - - if ( loading[ url ] !== undefined ) { - - loading[ url ].push( { - - onLoad: onLoad, - onProgress: onProgress, - onError: onError - - } ); - - return; - - } - - // Check for data: URI - var dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/; - var dataUriRegexResult = url.match( dataUriRegex ); - - // Safari can not handle Data URIs through XMLHttpRequest so process manually - if ( dataUriRegexResult ) { - - var mimeType = dataUriRegexResult[ 1 ]; - var isBase64 = !! dataUriRegexResult[ 2 ]; - var data = dataUriRegexResult[ 3 ]; - - data = decodeURIComponent( data ); - - if ( isBase64 ) data = atob( data ); - - try { - - var response; - var responseType = ( this.responseType || '' ).toLowerCase(); - - switch ( responseType ) { - - case 'arraybuffer': - case 'blob': - - var view = new Uint8Array( data.length ); - - for ( var i = 0; i < data.length; i ++ ) { - - view[ i ] = data.charCodeAt( i ); - - } - - if ( responseType === 'blob' ) { - - response = new Blob( [ view.buffer ], { type: mimeType } ); - - } else { - - response = view.buffer; - - } - - break; - - case 'document': - - var parser = new DOMParser(); - response = parser.parseFromString( data, mimeType ); - - break; - - case 'json': - - response = JSON.parse( data ); - - break; - - default: // 'text' or other - - response = data; - - break; - - } - - // Wait for next browser tick like standard XMLHttpRequest event dispatching does - setTimeout( function () { - - if ( onLoad ) onLoad( response ); - - scope.manager.itemEnd( url ); - - }, 0 ); - - } catch ( error ) { - - // Wait for next browser tick like standard XMLHttpRequest event dispatching does - setTimeout( function () { - - if ( onError ) onError( error ); - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - }, 0 ); - - } - - } else { - - // Initialise array for duplicate requests - - loading[ url ] = []; - - loading[ url ].push( { - - onLoad: onLoad, - onProgress: onProgress, - onError: onError - - } ); - - var request = new XMLHttpRequest(); - - request.open( 'GET', url, true ); - - request.addEventListener( 'load', function ( event ) { - - var response = this.response; - - Cache.add( url, response ); - - var callbacks = loading[ url ]; - - delete loading[ url ]; - - if ( this.status === 200 || this.status === 0 ) { - - // Some browsers return HTTP Status 0 when using non-http protocol - // e.g. 'file://' or 'data://'. Handle as success. - - if ( this.status === 0 ) console.warn( 'THREE.FileLoader: HTTP Status 0 received.' ); - - for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - - var callback = callbacks[ i ]; - if ( callback.onLoad ) callback.onLoad( response ); - - } - - scope.manager.itemEnd( url ); - - } else { - - for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - - var callback = callbacks[ i ]; - if ( callback.onError ) callback.onError( event ); - - } - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - } - - }, false ); - - request.addEventListener( 'progress', function ( event ) { - - var callbacks = loading[ url ]; - - for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - - var callback = callbacks[ i ]; - if ( callback.onProgress ) callback.onProgress( event ); - - } - - }, false ); - - request.addEventListener( 'error', function ( event ) { - - var callbacks = loading[ url ]; - - delete loading[ url ]; - - for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - - var callback = callbacks[ i ]; - if ( callback.onError ) callback.onError( event ); - - } - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - }, false ); - - request.addEventListener( 'abort', function ( event ) { - - var callbacks = loading[ url ]; - - delete loading[ url ]; - - for ( var i = 0, il = callbacks.length; i < il; i ++ ) { - - var callback = callbacks[ i ]; - if ( callback.onError ) callback.onError( event ); - - } - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - }, false ); - - if ( this.responseType !== undefined ) request.responseType = this.responseType; - if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials; - - if ( request.overrideMimeType ) request.overrideMimeType( this.mimeType !== undefined ? this.mimeType : 'text/plain' ); - - for ( var header in this.requestHeader ) { - - request.setRequestHeader( header, this.requestHeader[ header ] ); - - } - - request.send( null ); - - } - - scope.manager.itemStart( url ); - - return request; - - }, - - setResponseType: function ( value ) { - - this.responseType = value; - return this; - - }, - - setWithCredentials: function ( value ) { - - this.withCredentials = value; - return this; - - }, - - setMimeType: function ( value ) { - - this.mimeType = value; - return this; - - }, - - setRequestHeader: function ( value ) { - - this.requestHeader = value; - return this; - - } - -} ); - - -export { FileLoader }; diff --git a/cases/esbuild-three/src/base/loaders/FontLoader.d.ts b/cases/esbuild-three/src/base/loaders/FontLoader.d.ts deleted file mode 100644 index 28b1b189c3..0000000000 --- a/cases/esbuild-three/src/base/loaders/FontLoader.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { Font } from './../extras/core/Font'; - -export class FontLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad?: ( responseFont: Font ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): void; - parse( json: any ): Font; - -} diff --git a/cases/esbuild-three/src/base/loaders/FontLoader.js b/cases/esbuild-three/src/base/loaders/FontLoader.js deleted file mode 100644 index c9146188d4..0000000000 --- a/cases/esbuild-three/src/base/loaders/FontLoader.js +++ /dev/null @@ -1,57 +0,0 @@ -import { Font } from '../extras/core/Font.js'; -import { FileLoader } from './FileLoader.js'; -import { Loader } from './Loader.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function FontLoader( manager ) { - - Loader.call( this, manager ); - -} - -FontLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: FontLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var loader = new FileLoader( this.manager ); - loader.setPath( this.path ); - loader.load( url, function ( text ) { - - var json; - - try { - - json = JSON.parse( text ); - - } catch ( e ) { - - console.warn( 'THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead.' ); - json = JSON.parse( text.substring( 65, text.length - 2 ) ); - - } - - var font = scope.parse( json ); - - if ( onLoad ) onLoad( font ); - - }, onProgress, onError ); - - }, - - parse: function ( json ) { - - return new Font( json ); - - } - -} ); - - -export { FontLoader }; diff --git a/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.d.ts b/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.d.ts deleted file mode 100644 index 4aa65dcb26..0000000000 --- a/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager.js'; - -export class ImageBitmapLoader extends Loader { - - constructor( manager?: LoadingManager ); - - options: undefined | object; - - setOptions( options: object ): ImageBitmapLoader; - load( - url: string, - onLoad?: ( response: string | ArrayBuffer ) => void, - onProgress?: ( request: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): any; - -} diff --git a/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.js b/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.js deleted file mode 100644 index b676a994ac..0000000000 --- a/cases/esbuild-three/src/base/loaders/ImageBitmapLoader.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @author thespite / http://clicktorelease.com/ - */ - -import { Cache } from './Cache.js'; -import { Loader } from './Loader.js'; - - -function ImageBitmapLoader( manager ) { - - if ( typeof createImageBitmap === 'undefined' ) { - - console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' ); - - } - - if ( typeof fetch === 'undefined' ) { - - console.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' ); - - } - - Loader.call( this, manager ); - - this.options = undefined; - -} - -ImageBitmapLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: ImageBitmapLoader, - - setOptions: function setOptions( options ) { - - this.options = options; - - return this; - - }, - - load: function ( url, onLoad, onProgress, onError ) { - - if ( url === undefined ) url = ''; - - if ( this.path !== undefined ) url = this.path + url; - - url = this.manager.resolveURL( url ); - - var scope = this; - - var cached = Cache.get( url ); - - if ( cached !== undefined ) { - - scope.manager.itemStart( url ); - - setTimeout( function () { - - if ( onLoad ) onLoad( cached ); - - scope.manager.itemEnd( url ); - - }, 0 ); - - return cached; - - } - - fetch( url ).then( function ( res ) { - - return res.blob(); - - } ).then( function ( blob ) { - - if ( scope.options === undefined ) { - - // Workaround for FireFox. It causes an error if you pass options. - return createImageBitmap( blob ); - - } else { - - return createImageBitmap( blob, scope.options ); - - } - - } ).then( function ( imageBitmap ) { - - Cache.add( url, imageBitmap ); - - if ( onLoad ) onLoad( imageBitmap ); - - scope.manager.itemEnd( url ); - - } ).catch( function ( e ) { - - if ( onError ) onError( e ); - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - } ); - - scope.manager.itemStart( url ); - - } - -} ); - -export { ImageBitmapLoader }; diff --git a/cases/esbuild-three/src/base/loaders/ImageLoader.d.ts b/cases/esbuild-three/src/base/loaders/ImageLoader.d.ts deleted file mode 100644 index f20d1e6ae8..0000000000 --- a/cases/esbuild-three/src/base/loaders/ImageLoader.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; - -/** - * A loader for loading an image. - * Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object. - */ -export class ImageLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad?: ( image: HTMLImageElement ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): HTMLImageElement; - -} diff --git a/cases/esbuild-three/src/base/loaders/ImageLoader.js b/cases/esbuild-three/src/base/loaders/ImageLoader.js deleted file mode 100644 index 1873c45a4b..0000000000 --- a/cases/esbuild-three/src/base/loaders/ImageLoader.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Cache } from './Cache.js'; -import { Loader } from './Loader.js'; - -function ImageLoader( manager ) { - - Loader.call( this, manager ); - -} - -ImageLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: ImageLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - if ( this.path !== undefined ) url = this.path + url; - - url = this.manager.resolveURL( url ); - - var scope = this; - - var cached = Cache.get( url ); - - if ( cached !== undefined ) { - - scope.manager.itemStart( url ); - - setTimeout( function () { - - if ( onLoad ) onLoad( cached ); - - scope.manager.itemEnd( url ); - - }, 0 ); - - return cached; - - } - - var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' ); - - function onImageLoad() { - - image.removeEventListener( 'load', onImageLoad, false ); - image.removeEventListener( 'error', onImageError, false ); - - Cache.add( url, this ); - - if ( onLoad ) onLoad( this ); - - scope.manager.itemEnd( url ); - - } - - function onImageError( event ) { - - image.removeEventListener( 'load', onImageLoad, false ); - image.removeEventListener( 'error', onImageError, false ); - - if ( onError ) onError( event ); - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - } - - image.addEventListener( 'load', onImageLoad, false ); - image.addEventListener( 'error', onImageError, false ); - - if ( url.slice( 0, 5 ) !== 'data:' ) { - - if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin; - - } - - scope.manager.itemStart( url ); - - image.src = url; - - return image; - - } - -} ); - - -export { ImageLoader }; diff --git a/cases/esbuild-three/src/base/loaders/Loader.d.ts b/cases/esbuild-three/src/base/loaders/Loader.d.ts deleted file mode 100644 index 41e100cd50..0000000000 --- a/cases/esbuild-three/src/base/loaders/Loader.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { LoadingManager } from './LoadingManager'; - -/** - * Base class for implementing loaders. - */ -export class Loader { - - constructor( manager?: LoadingManager ); - - crossOrigin: string; - path: string; - resourcePath: string; - manager: LoadingManager; - - /* - load(): void; - parse(): void; - */ - - setCrossOrigin( crossOrigin: string ): this; - setPath( path: string ): this; - setResourcePath( resourcePath: string ): this; - - static Handlers: LoaderHandler; - -} - -// LoaderHandler - -export interface LoaderHandler { - handlers: ( RegExp | Loader )[]; - - add( regex: RegExp, loader: Loader ): void; - get( file: string ): Loader | null; -} diff --git a/cases/esbuild-three/src/base/loaders/Loader.js b/cases/esbuild-three/src/base/loaders/Loader.js deleted file mode 100644 index fad23314a2..0000000000 --- a/cases/esbuild-three/src/base/loaders/Loader.js +++ /dev/null @@ -1,82 +0,0 @@ -import { DefaultLoadingManager } from './LoadingManager.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -function Loader( manager ) { - - this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager; - - this.crossOrigin = 'anonymous'; - this.path = ''; - this.resourcePath = ''; - -} - -Object.assign( Loader.prototype, { - - load: function ( /* url, onLoad, onProgress, onError */ ) {}, - - parse: function ( /* data */ ) {}, - - setCrossOrigin: function ( crossOrigin ) { - - this.crossOrigin = crossOrigin; - return this; - - }, - - setPath: function ( path ) { - - this.path = path; - return this; - - }, - - setResourcePath: function ( resourcePath ) { - - this.resourcePath = resourcePath; - return this; - - } - -} ); - -// - -Loader.Handlers = { - - handlers: [], - - add: function ( regex, loader ) { - - this.handlers.push( regex, loader ); - - }, - - get: function ( file ) { - - var handlers = this.handlers; - - for ( var i = 0, l = handlers.length; i < l; i += 2 ) { - - var regex = handlers[ i ]; - var loader = handlers[ i + 1 ]; - - if ( regex.test( file ) ) { - - return loader; - - } - - } - - return null; - - } - -}; - - -export { Loader }; diff --git a/cases/esbuild-three/src/base/loaders/LoaderUtils.d.ts b/cases/esbuild-three/src/base/loaders/LoaderUtils.d.ts deleted file mode 100644 index d6014c1563..0000000000 --- a/cases/esbuild-three/src/base/loaders/LoaderUtils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { TypedArray } from '../polyfills'; - -export class LoaderUtils { - - static decodeText( array: TypedArray ): string; - static extractUrlBase( url: string ): string; - -} diff --git a/cases/esbuild-three/src/base/loaders/LoaderUtils.js b/cases/esbuild-three/src/base/loaders/LoaderUtils.js deleted file mode 100644 index 20bc2c7760..0000000000 --- a/cases/esbuild-three/src/base/loaders/LoaderUtils.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author Don McCurdy / https://www.donmccurdy.com - */ - -var LoaderUtils = { - - decodeText: function ( array ) { - - if ( typeof TextDecoder !== 'undefined' ) { - - return new TextDecoder().decode( array ); - - } - - // Avoid the String.fromCharCode.apply(null, array) shortcut, which - // throws a "maximum call stack size exceeded" error for large arrays. - - var s = ''; - - for ( var i = 0, il = array.length; i < il; i ++ ) { - - // Implicitly assumes little-endian. - s += String.fromCharCode( array[ i ] ); - - } - - try { - - // merges multi-byte utf-8 characters. - - return decodeURIComponent( escape( s ) ); - - } catch ( e ) { // see #16358 - - return s; - - } - - }, - - extractUrlBase: function ( url ) { - - var index = url.lastIndexOf( '/' ); - - if ( index === - 1 ) return './'; - - return url.slice( 0, index + 1 ); - - } - -}; - -export { LoaderUtils }; diff --git a/cases/esbuild-three/src/base/loaders/LoadingManager.d.ts b/cases/esbuild-three/src/base/loaders/LoadingManager.d.ts deleted file mode 100644 index 38bd8d877a..0000000000 --- a/cases/esbuild-three/src/base/loaders/LoadingManager.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -export const DefaultLoadingManager: LoadingManager; - -/** - * Handles and keeps track of loaded and pending data. - */ -export class LoadingManager { - - constructor( - onLoad?: () => void, - onProgress?: ( url: string, loaded: number, total: number ) => void, - onError?: ( url: string ) => void - ); - - onStart?: ( url: string, loaded: number, total: number ) => void; - - /** - * Will be called when load starts. - * The default is a function with empty body. - */ - onLoad: () => void; - - /** - * Will be called while load progresses. - * The default is a function with empty body. - */ - onProgress: ( item: any, loaded: number, total: number ) => void; - - /** - * Will be called when each element in the scene completes loading. - * The default is a function with empty body. - */ - onError: ( url: string ) => void; - - /** - * If provided, the callback will be passed each resource URL before a request is sent. - * The callback may return the original URL, or a new URL to override loading behavior. - * This behavior can be used to load assets from .ZIP files, drag-and-drop APIs, and Data URIs. - * @param callback URL modifier callback. Called with url argument, and must return resolvedURL. - */ - setURLModifier( callback?: ( url: string ) => string ): void; - - /** - * Given a URL, uses the URL modifier callback (if any) and returns a resolved URL. - * If no URL modifier is set, returns the original URL. - * @param url the url to load - */ - resolveURL( url: string ): string; - - itemStart( url: string ): void; - itemEnd( url: string ): void; - itemError( url: string ): void; - -} diff --git a/cases/esbuild-three/src/base/loaders/LoadingManager.js b/cases/esbuild-three/src/base/loaders/LoadingManager.js deleted file mode 100644 index 07a0cd619f..0000000000 --- a/cases/esbuild-three/src/base/loaders/LoadingManager.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function LoadingManager( onLoad, onProgress, onError ) { - - var scope = this; - - var isLoading = false; - var itemsLoaded = 0; - var itemsTotal = 0; - var urlModifier = undefined; - - // Refer to #5689 for the reason why we don't set .onStart - // in the constructor - - this.onStart = undefined; - this.onLoad = onLoad; - this.onProgress = onProgress; - this.onError = onError; - - this.itemStart = function ( url ) { - - itemsTotal ++; - - if ( isLoading === false ) { - - if ( scope.onStart !== undefined ) { - - scope.onStart( url, itemsLoaded, itemsTotal ); - - } - - } - - isLoading = true; - - }; - - this.itemEnd = function ( url ) { - - itemsLoaded ++; - - if ( scope.onProgress !== undefined ) { - - scope.onProgress( url, itemsLoaded, itemsTotal ); - - } - - if ( itemsLoaded === itemsTotal ) { - - isLoading = false; - - if ( scope.onLoad !== undefined ) { - - scope.onLoad(); - - } - - } - - }; - - this.itemError = function ( url ) { - - if ( scope.onError !== undefined ) { - - scope.onError( url ); - - } - - }; - - this.resolveURL = function ( url ) { - - if ( urlModifier ) { - - return urlModifier( url ); - - } - - return url; - - }; - - this.setURLModifier = function ( transform ) { - - urlModifier = transform; - return this; - - }; - -} - -var DefaultLoadingManager = new LoadingManager(); - - -export { DefaultLoadingManager, LoadingManager }; diff --git a/cases/esbuild-three/src/base/loaders/MaterialLoader.d.ts b/cases/esbuild-three/src/base/loaders/MaterialLoader.d.ts deleted file mode 100644 index bf9b5d9c22..0000000000 --- a/cases/esbuild-three/src/base/loaders/MaterialLoader.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { Texture } from './../textures/Texture'; -import { Material } from './../materials/Material'; - -export class MaterialLoader extends Loader { - - constructor( manager?: LoadingManager ); - - textures: { [key: string]: Texture }; - - load( - url: string, - onLoad: ( material: Material ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: Error | ErrorEvent ) => void - ): void; - setTextures( textures: { [key: string]: Texture } ): this; - parse( json: any ): Material; - -} diff --git a/cases/esbuild-three/src/base/loaders/MaterialLoader.js b/cases/esbuild-three/src/base/loaders/MaterialLoader.js deleted file mode 100644 index e7bb192114..0000000000 --- a/cases/esbuild-three/src/base/loaders/MaterialLoader.js +++ /dev/null @@ -1,255 +0,0 @@ -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector4 } from '../math/Vector4.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { FileLoader } from './FileLoader.js'; -import { Loader } from './Loader.js'; -import * as Materials from '../materials/Materials.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function MaterialLoader( manager ) { - - Loader.call( this, manager ); - - this.textures = {}; - -} - -MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: MaterialLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var loader = new FileLoader( scope.manager ); - loader.setPath( scope.path ); - loader.load( url, function ( text ) { - - onLoad( scope.parse( JSON.parse( text ) ) ); - - }, onProgress, onError ); - - }, - - parse: function ( json ) { - - var textures = this.textures; - - function getTexture( name ) { - - if ( textures[ name ] === undefined ) { - - console.warn( 'THREE.MaterialLoader: Undefined texture', name ); - - } - - return textures[ name ]; - - } - - var material = new Materials[ json.type ](); - - if ( json.uuid !== undefined ) material.uuid = json.uuid; - if ( json.name !== undefined ) material.name = json.name; - if ( json.color !== undefined ) material.color.setHex( json.color ); - if ( json.roughness !== undefined ) material.roughness = json.roughness; - if ( json.metalness !== undefined ) material.metalness = json.metalness; - if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive ); - if ( json.specular !== undefined ) material.specular.setHex( json.specular ); - if ( json.shininess !== undefined ) material.shininess = json.shininess; - if ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat; - if ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness; - if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors; - if ( json.fog !== undefined ) material.fog = json.fog; - if ( json.flatShading !== undefined ) material.flatShading = json.flatShading; - if ( json.blending !== undefined ) material.blending = json.blending; - if ( json.combine !== undefined ) material.combine = json.combine; - if ( json.side !== undefined ) material.side = json.side; - if ( json.opacity !== undefined ) material.opacity = json.opacity; - if ( json.transparent !== undefined ) material.transparent = json.transparent; - if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest; - if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; - if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; - if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; - if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; - if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; - if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; - if ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin; - - if ( json.rotation !== undefined ) material.rotation = json.rotation; - - if ( json.linewidth !== 1 ) material.linewidth = json.linewidth; - if ( json.dashSize !== undefined ) material.dashSize = json.dashSize; - if ( json.gapSize !== undefined ) material.gapSize = json.gapSize; - if ( json.scale !== undefined ) material.scale = json.scale; - - if ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset; - if ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor; - if ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits; - - if ( json.skinning !== undefined ) material.skinning = json.skinning; - if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets; - if ( json.morphNormals !== undefined ) material.morphNormals = json.morphNormals; - if ( json.dithering !== undefined ) material.dithering = json.dithering; - - if ( json.visible !== undefined ) material.visible = json.visible; - - if ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped; - - if ( json.userData !== undefined ) material.userData = json.userData; - - // Shader Material - - if ( json.uniforms !== undefined ) { - - for ( var name in json.uniforms ) { - - var uniform = json.uniforms[ name ]; - - material.uniforms[ name ] = {}; - - switch ( uniform.type ) { - - case 't': - material.uniforms[ name ].value = getTexture( uniform.value ); - break; - - case 'c': - material.uniforms[ name ].value = new Color().setHex( uniform.value ); - break; - - case 'v2': - material.uniforms[ name ].value = new Vector2().fromArray( uniform.value ); - break; - - case 'v3': - material.uniforms[ name ].value = new Vector3().fromArray( uniform.value ); - break; - - case 'v4': - material.uniforms[ name ].value = new Vector4().fromArray( uniform.value ); - break; - - case 'm3': - material.uniforms[ name ].value = new Matrix3().fromArray( uniform.value ); - - case 'm4': - material.uniforms[ name ].value = new Matrix4().fromArray( uniform.value ); - break; - - default: - material.uniforms[ name ].value = uniform.value; - - } - - } - - } - - if ( json.defines !== undefined ) material.defines = json.defines; - if ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader; - if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader; - - if ( json.extensions !== undefined ) { - - for ( var key in json.extensions ) { - - material.extensions[ key ] = json.extensions[ key ]; - - } - - } - - // Deprecated - - if ( json.shading !== undefined ) material.flatShading = json.shading === 1; // THREE.FlatShading - - // for PointsMaterial - - if ( json.size !== undefined ) material.size = json.size; - if ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation; - - // maps - - if ( json.map !== undefined ) material.map = getTexture( json.map ); - if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap ); - - if ( json.alphaMap !== undefined ) { - - material.alphaMap = getTexture( json.alphaMap ); - material.transparent = true; - - } - - if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap ); - if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; - - if ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap ); - if ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType; - if ( json.normalScale !== undefined ) { - - var normalScale = json.normalScale; - - if ( Array.isArray( normalScale ) === false ) { - - // Blender exporter used to export a scalar. See #7459 - - normalScale = [ normalScale, normalScale ]; - - } - - material.normalScale = new Vector2().fromArray( normalScale ); - - } - - if ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap ); - if ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale; - if ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias; - - if ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap ); - if ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap ); - - if ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap ); - if ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity; - - if ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap ); - - if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap ); - if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity; - - if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity; - if ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio; - - if ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap ); - if ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity; - - if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); - if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; - - if ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap ); - - if ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap ); - if ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale ); - - return material; - - }, - - setTextures: function ( value ) { - - this.textures = value; - return this; - - } - -} ); - - -export { MaterialLoader }; diff --git a/cases/esbuild-three/src/base/loaders/ObjectLoader.d.ts b/cases/esbuild-three/src/base/loaders/ObjectLoader.d.ts deleted file mode 100644 index 857eb77b31..0000000000 --- a/cases/esbuild-three/src/base/loaders/ObjectLoader.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { Object3D } from './../core/Object3D'; -import { Texture } from './../textures/Texture'; -import { Material } from './../materials/Material'; -import { AnimationClip } from './../animation/AnimationClip'; - -export class ObjectLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad?: ( object: ObjectType ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: Error | ErrorEvent ) => void - ): void; - parse( json: any, onLoad?: ( object: Object3D ) => void ): T; - parseGeometries( json: any ): any[]; // Array of BufferGeometry or Geometry or Geometry2. - parseMaterials( json: any, textures: Texture[] ): Material[]; // Array of Classes that inherits from Matrial. - parseAnimations( json: any ): AnimationClip[]; - parseImages( - json: any, - onLoad: () => void - ): { [key: string]: HTMLImageElement }; - parseTextures( json: any, images: any ): Texture[]; - parseObject( - data: any, - geometries: any[], - materials: Material[] - ): T; - -} diff --git a/cases/esbuild-three/src/base/loaders/ObjectLoader.js b/cases/esbuild-three/src/base/loaders/ObjectLoader.js deleted file mode 100644 index d2b2afeea5..0000000000 --- a/cases/esbuild-three/src/base/loaders/ObjectLoader.js +++ /dev/null @@ -1,1003 +0,0 @@ -import { - UVMapping, - CubeReflectionMapping, - CubeRefractionMapping, - EquirectangularReflectionMapping, - EquirectangularRefractionMapping, - SphericalReflectionMapping, - CubeUVReflectionMapping, - CubeUVRefractionMapping, - - RepeatWrapping, - ClampToEdgeWrapping, - MirroredRepeatWrapping, - - NearestFilter, - NearestMipmapNearestFilter, - NearestMipmapLinearFilter, - LinearFilter, - LinearMipmapNearestFilter, - LinearMipmapLinearFilter -} from '../constants.js'; -import { Color } from '../math/Color.js'; -import { Object3D } from '../core/Object3D.js'; -import { Group } from '../objects/Group.js'; -import { Sprite } from '../objects/Sprite.js'; -import { Points } from '../objects/Points.js'; -import { Line } from '../objects/Line.js'; -import { LineLoop } from '../objects/LineLoop.js'; -import { LineSegments } from '../objects/LineSegments.js'; -import { LOD } from '../objects/LOD.js'; -import { Mesh } from '../objects/Mesh.js'; -import { SkinnedMesh } from '../objects/SkinnedMesh.js'; -import { Shape } from '../extras/core/Shape.js'; -import { Fog } from '../scenes/Fog.js'; -import { FogExp2 } from '../scenes/FogExp2.js'; -import { HemisphereLight } from '../lights/HemisphereLight.js'; -import { SpotLight } from '../lights/SpotLight.js'; -import { PointLight } from '../lights/PointLight.js'; -import { DirectionalLight } from '../lights/DirectionalLight.js'; -import { AmbientLight } from '../lights/AmbientLight.js'; -import { RectAreaLight } from '../lights/RectAreaLight.js'; -import { OrthographicCamera } from '../cameras/OrthographicCamera.js'; -import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js'; -import { Scene } from '../scenes/Scene.js'; -import { CubeTexture } from '../textures/CubeTexture.js'; -import { Texture } from '../textures/Texture.js'; -import { ImageLoader } from './ImageLoader.js'; -import { LoadingManager } from './LoadingManager.js'; -import { AnimationClip } from '../animation/AnimationClip.js'; -import { MaterialLoader } from './MaterialLoader.js'; -import { LoaderUtils } from './LoaderUtils.js'; -import { BufferGeometryLoader } from './BufferGeometryLoader.js'; -import { Loader } from './Loader.js'; -import { FileLoader } from './FileLoader.js'; -import * as Geometries from '../geometries/Geometries.js'; -import * as Curves from '../extras/curves/Curves.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function ObjectLoader( manager ) { - - Loader.call( this, manager ); - -} - -ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: ObjectLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var scope = this; - - var path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path; - this.resourcePath = this.resourcePath || path; - - var loader = new FileLoader( scope.manager ); - loader.setPath( this.path ); - loader.load( url, function ( text ) { - - var json = null; - - try { - - json = JSON.parse( text ); - - } catch ( error ) { - - if ( onError !== undefined ) onError( error ); - - console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message ); - - return; - - } - - var metadata = json.metadata; - - if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) { - - console.error( 'THREE.ObjectLoader: Can\'t load ' + url ); - return; - - } - - scope.parse( json, onLoad ); - - }, onProgress, onError ); - - }, - - parse: function ( json, onLoad ) { - - var shapes = this.parseShape( json.shapes ); - var geometries = this.parseGeometries( json.geometries, shapes ); - - var images = this.parseImages( json.images, function () { - - if ( onLoad !== undefined ) onLoad( object ); - - } ); - - var textures = this.parseTextures( json.textures, images ); - var materials = this.parseMaterials( json.materials, textures ); - - var object = this.parseObject( json.object, geometries, materials ); - - if ( json.animations ) { - - object.animations = this.parseAnimations( json.animations ); - - } - - if ( json.images === undefined || json.images.length === 0 ) { - - if ( onLoad !== undefined ) onLoad( object ); - - } - - return object; - - }, - - parseShape: function ( json ) { - - var shapes = {}; - - if ( json !== undefined ) { - - for ( var i = 0, l = json.length; i < l; i ++ ) { - - var shape = new Shape().fromJSON( json[ i ] ); - - shapes[ shape.uuid ] = shape; - - } - - } - - return shapes; - - }, - - parseGeometries: function ( json, shapes ) { - - var geometries = {}; - - if ( json !== undefined ) { - - var bufferGeometryLoader = new BufferGeometryLoader(); - - for ( var i = 0, l = json.length; i < l; i ++ ) { - - var geometry; - var data = json[ i ]; - - switch ( data.type ) { - - case 'PlaneGeometry': - case 'PlaneBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.width, - data.height, - data.widthSegments, - data.heightSegments - ); - - break; - - case 'BoxGeometry': - case 'BoxBufferGeometry': - case 'CubeGeometry': // backwards compatible - - geometry = new Geometries[ data.type ]( - data.width, - data.height, - data.depth, - data.widthSegments, - data.heightSegments, - data.depthSegments - ); - - break; - - case 'CircleGeometry': - case 'CircleBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.segments, - data.thetaStart, - data.thetaLength - ); - - break; - - case 'CylinderGeometry': - case 'CylinderBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radiusTop, - data.radiusBottom, - data.height, - data.radialSegments, - data.heightSegments, - data.openEnded, - data.thetaStart, - data.thetaLength - ); - - break; - - case 'ConeGeometry': - case 'ConeBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.height, - data.radialSegments, - data.heightSegments, - data.openEnded, - data.thetaStart, - data.thetaLength - ); - - break; - - case 'SphereGeometry': - case 'SphereBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.widthSegments, - data.heightSegments, - data.phiStart, - data.phiLength, - data.thetaStart, - data.thetaLength - ); - - break; - - case 'DodecahedronGeometry': - case 'DodecahedronBufferGeometry': - case 'IcosahedronGeometry': - case 'IcosahedronBufferGeometry': - case 'OctahedronGeometry': - case 'OctahedronBufferGeometry': - case 'TetrahedronGeometry': - case 'TetrahedronBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.detail - ); - - break; - - case 'RingGeometry': - case 'RingBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.innerRadius, - data.outerRadius, - data.thetaSegments, - data.phiSegments, - data.thetaStart, - data.thetaLength - ); - - break; - - case 'TorusGeometry': - case 'TorusBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.tube, - data.radialSegments, - data.tubularSegments, - data.arc - ); - - break; - - case 'TorusKnotGeometry': - case 'TorusKnotBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.radius, - data.tube, - data.tubularSegments, - data.radialSegments, - data.p, - data.q - ); - - break; - - case 'TubeGeometry': - case 'TubeBufferGeometry': - - // This only works for built-in curves (e.g. CatmullRomCurve3). - // User defined curves or instances of CurvePath will not be deserialized. - geometry = new Geometries[ data.type ]( - new Curves[ data.path.type ]().fromJSON( data.path ), - data.tubularSegments, - data.radius, - data.radialSegments, - data.closed - ); - - break; - - case 'LatheGeometry': - case 'LatheBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.points, - data.segments, - data.phiStart, - data.phiLength - ); - - break; - - case 'PolyhedronGeometry': - case 'PolyhedronBufferGeometry': - - geometry = new Geometries[ data.type ]( - data.vertices, - data.indices, - data.radius, - data.details - ); - - break; - - case 'ShapeGeometry': - case 'ShapeBufferGeometry': - - var geometryShapes = []; - - for ( var j = 0, jl = data.shapes.length; j < jl; j ++ ) { - - var shape = shapes[ data.shapes[ j ] ]; - - geometryShapes.push( shape ); - - } - - geometry = new Geometries[ data.type ]( - geometryShapes, - data.curveSegments - ); - - break; - - - case 'ExtrudeGeometry': - case 'ExtrudeBufferGeometry': - - var geometryShapes = []; - - for ( var j = 0, jl = data.shapes.length; j < jl; j ++ ) { - - var shape = shapes[ data.shapes[ j ] ]; - - geometryShapes.push( shape ); - - } - - var extrudePath = data.options.extrudePath; - - if ( extrudePath !== undefined ) { - - data.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath ); - - } - - geometry = new Geometries[ data.type ]( - geometryShapes, - data.options - ); - - break; - - case 'BufferGeometry': - case 'InstancedBufferGeometry': - - geometry = bufferGeometryLoader.parse( data ); - - break; - - case 'Geometry': - - if ( 'THREE' in window && 'LegacyJSONLoader' in THREE ) { - - var geometryLoader = new THREE.LegacyJSONLoader(); - geometry = geometryLoader.parse( data, this.resourcePath ).geometry; - - - } else { - - console.error( 'THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".' ); - - } - - break; - - default: - - console.warn( 'THREE.ObjectLoader: Unsupported geometry type "' + data.type + '"' ); - - continue; - - } - - geometry.uuid = data.uuid; - - if ( data.name !== undefined ) geometry.name = data.name; - if ( geometry.isBufferGeometry === true && data.userData !== undefined ) geometry.userData = data.userData; - - geometries[ data.uuid ] = geometry; - - } - - } - - return geometries; - - }, - - parseMaterials: function ( json, textures ) { - - var cache = {}; // MultiMaterial - var materials = {}; - - if ( json !== undefined ) { - - var loader = new MaterialLoader(); - loader.setTextures( textures ); - - for ( var i = 0, l = json.length; i < l; i ++ ) { - - var data = json[ i ]; - - if ( data.type === 'MultiMaterial' ) { - - // Deprecated - - var array = []; - - for ( var j = 0; j < data.materials.length; j ++ ) { - - var material = data.materials[ j ]; - - if ( cache[ material.uuid ] === undefined ) { - - cache[ material.uuid ] = loader.parse( material ); - - } - - array.push( cache[ material.uuid ] ); - - } - - materials[ data.uuid ] = array; - - } else { - - if ( cache[ data.uuid ] === undefined ) { - - cache[ data.uuid ] = loader.parse( data ); - - } - - materials[ data.uuid ] = cache[ data.uuid ]; - - } - - } - - } - - return materials; - - }, - - parseAnimations: function ( json ) { - - var animations = []; - - for ( var i = 0; i < json.length; i ++ ) { - - var data = json[ i ]; - - var clip = AnimationClip.parse( data ); - - if ( data.uuid !== undefined ) clip.uuid = data.uuid; - - animations.push( clip ); - - } - - return animations; - - }, - - parseImages: function ( json, onLoad ) { - - var scope = this; - var images = {}; - - function loadImage( url ) { - - scope.manager.itemStart( url ); - - return loader.load( url, function () { - - scope.manager.itemEnd( url ); - - }, undefined, function () { - - scope.manager.itemError( url ); - scope.manager.itemEnd( url ); - - } ); - - } - - if ( json !== undefined && json.length > 0 ) { - - var manager = new LoadingManager( onLoad ); - - var loader = new ImageLoader( manager ); - loader.setCrossOrigin( this.crossOrigin ); - - for ( var i = 0, il = json.length; i < il; i ++ ) { - - var image = json[ i ]; - var url = image.url; - - if ( Array.isArray( url ) ) { - - // load array of images e.g CubeTexture - - images[ image.uuid ] = []; - - for ( var j = 0, jl = url.length; j < jl; j ++ ) { - - var currentUrl = url[ j ]; - - var path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( currentUrl ) ? currentUrl : scope.resourcePath + currentUrl; - - images[ image.uuid ].push( loadImage( path ) ); - - } - - } else { - - // load single image - - var path = /^(\/\/)|([a-z]+:(\/\/)?)/i.test( image.url ) ? image.url : scope.resourcePath + image.url; - - images[ image.uuid ] = loadImage( path ); - - } - - } - - } - - return images; - - }, - - parseTextures: function ( json, images ) { - - function parseConstant( value, type ) { - - if ( typeof value === 'number' ) return value; - - console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value ); - - return type[ value ]; - - } - - var textures = {}; - - if ( json !== undefined ) { - - for ( var i = 0, l = json.length; i < l; i ++ ) { - - var data = json[ i ]; - - if ( data.image === undefined ) { - - console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid ); - - } - - if ( images[ data.image ] === undefined ) { - - console.warn( 'THREE.ObjectLoader: Undefined image', data.image ); - - } - - var texture; - - if ( Array.isArray( images[ data.image ] ) ) { - - texture = new CubeTexture( images[ data.image ] ); - - } else { - - texture = new Texture( images[ data.image ] ); - - } - - texture.needsUpdate = true; - - texture.uuid = data.uuid; - - if ( data.name !== undefined ) texture.name = data.name; - - if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING ); - - if ( data.offset !== undefined ) texture.offset.fromArray( data.offset ); - if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat ); - if ( data.center !== undefined ) texture.center.fromArray( data.center ); - if ( data.rotation !== undefined ) texture.rotation = data.rotation; - - if ( data.wrap !== undefined ) { - - texture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING ); - texture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING ); - - } - - if ( data.format !== undefined ) texture.format = data.format; - if ( data.type !== undefined ) texture.type = data.type; - if ( data.encoding !== undefined ) texture.encoding = data.encoding; - - if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER ); - if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER ); - if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy; - - if ( data.flipY !== undefined ) texture.flipY = data.flipY; - - if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha; - if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment; - - textures[ data.uuid ] = texture; - - } - - } - - return textures; - - }, - - parseObject: function ( data, geometries, materials ) { - - var object; - - function getGeometry( name ) { - - if ( geometries[ name ] === undefined ) { - - console.warn( 'THREE.ObjectLoader: Undefined geometry', name ); - - } - - return geometries[ name ]; - - } - - function getMaterial( name ) { - - if ( name === undefined ) return undefined; - - if ( Array.isArray( name ) ) { - - var array = []; - - for ( var i = 0, l = name.length; i < l; i ++ ) { - - var uuid = name[ i ]; - - if ( materials[ uuid ] === undefined ) { - - console.warn( 'THREE.ObjectLoader: Undefined material', uuid ); - - } - - array.push( materials[ uuid ] ); - - } - - return array; - - } - - if ( materials[ name ] === undefined ) { - - console.warn( 'THREE.ObjectLoader: Undefined material', name ); - - } - - return materials[ name ]; - - } - - switch ( data.type ) { - - case 'Scene': - - object = new Scene(); - - if ( data.background !== undefined ) { - - if ( Number.isInteger( data.background ) ) { - - object.background = new Color( data.background ); - - } - - } - - if ( data.fog !== undefined ) { - - if ( data.fog.type === 'Fog' ) { - - object.fog = new Fog( data.fog.color, data.fog.near, data.fog.far ); - - } else if ( data.fog.type === 'FogExp2' ) { - - object.fog = new FogExp2( data.fog.color, data.fog.density ); - - } - - } - - break; - - case 'PerspectiveCamera': - - object = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far ); - - if ( data.focus !== undefined ) object.focus = data.focus; - if ( data.zoom !== undefined ) object.zoom = data.zoom; - if ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge; - if ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset; - if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); - - break; - - case 'OrthographicCamera': - - object = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far ); - - if ( data.zoom !== undefined ) object.zoom = data.zoom; - if ( data.view !== undefined ) object.view = Object.assign( {}, data.view ); - - break; - - case 'AmbientLight': - - object = new AmbientLight( data.color, data.intensity ); - - break; - - case 'DirectionalLight': - - object = new DirectionalLight( data.color, data.intensity ); - - break; - - case 'PointLight': - - object = new PointLight( data.color, data.intensity, data.distance, data.decay ); - - break; - - case 'RectAreaLight': - - object = new RectAreaLight( data.color, data.intensity, data.width, data.height ); - - break; - - case 'SpotLight': - - object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay ); - - break; - - case 'HemisphereLight': - - object = new HemisphereLight( data.color, data.groundColor, data.intensity ); - - break; - - case 'SkinnedMesh': - - console.warn( 'THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.' ); - - case 'Mesh': - - var geometry = getGeometry( data.geometry ); - var material = getMaterial( data.material ); - - if ( geometry.bones && geometry.bones.length > 0 ) { - - object = new SkinnedMesh( geometry, material ); - - } else { - - object = new Mesh( geometry, material ); - - } - - if ( data.drawMode !== undefined ) object.setDrawMode( data.drawMode ); - - break; - - case 'LOD': - - object = new LOD(); - - break; - - case 'Line': - - object = new Line( getGeometry( data.geometry ), getMaterial( data.material ), data.mode ); - - break; - - case 'LineLoop': - - object = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) ); - - break; - - case 'LineSegments': - - object = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) ); - - break; - - case 'PointCloud': - case 'Points': - - object = new Points( getGeometry( data.geometry ), getMaterial( data.material ) ); - - break; - - case 'Sprite': - - object = new Sprite( getMaterial( data.material ) ); - - break; - - case 'Group': - - object = new Group(); - - break; - - default: - - object = new Object3D(); - - } - - object.uuid = data.uuid; - - if ( data.name !== undefined ) object.name = data.name; - - if ( data.matrix !== undefined ) { - - object.matrix.fromArray( data.matrix ); - - if ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate; - if ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale ); - - } else { - - if ( data.position !== undefined ) object.position.fromArray( data.position ); - if ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation ); - if ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion ); - if ( data.scale !== undefined ) object.scale.fromArray( data.scale ); - - } - - if ( data.castShadow !== undefined ) object.castShadow = data.castShadow; - if ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow; - - if ( data.shadow ) { - - if ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias; - if ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius; - if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize ); - if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera ); - - } - - if ( data.visible !== undefined ) object.visible = data.visible; - if ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled; - if ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder; - if ( data.userData !== undefined ) object.userData = data.userData; - if ( data.layers !== undefined ) object.layers.mask = data.layers; - - if ( data.children !== undefined ) { - - var children = data.children; - - for ( var i = 0; i < children.length; i ++ ) { - - object.add( this.parseObject( children[ i ], geometries, materials ) ); - - } - - } - - if ( data.type === 'LOD' ) { - - var levels = data.levels; - - for ( var l = 0; l < levels.length; l ++ ) { - - var level = levels[ l ]; - var child = object.getObjectByProperty( 'uuid', level.object ); - - if ( child !== undefined ) { - - object.addLevel( child, level.distance ); - - } - - } - - } - - return object; - - } - -} ); - -var TEXTURE_MAPPING = { - UVMapping: UVMapping, - CubeReflectionMapping: CubeReflectionMapping, - CubeRefractionMapping: CubeRefractionMapping, - EquirectangularReflectionMapping: EquirectangularReflectionMapping, - EquirectangularRefractionMapping: EquirectangularRefractionMapping, - SphericalReflectionMapping: SphericalReflectionMapping, - CubeUVReflectionMapping: CubeUVReflectionMapping, - CubeUVRefractionMapping: CubeUVRefractionMapping -}; - -var TEXTURE_WRAPPING = { - RepeatWrapping: RepeatWrapping, - ClampToEdgeWrapping: ClampToEdgeWrapping, - MirroredRepeatWrapping: MirroredRepeatWrapping -}; - -var TEXTURE_FILTER = { - NearestFilter: NearestFilter, - NearestMipmapNearestFilter: NearestMipmapNearestFilter, - NearestMipmapLinearFilter: NearestMipmapLinearFilter, - LinearFilter: LinearFilter, - LinearMipmapNearestFilter: LinearMipmapNearestFilter, - LinearMipmapLinearFilter: LinearMipmapLinearFilter -}; - - -export { ObjectLoader }; diff --git a/cases/esbuild-three/src/base/loaders/TextureLoader.d.ts b/cases/esbuild-three/src/base/loaders/TextureLoader.d.ts deleted file mode 100644 index 2901301926..0000000000 --- a/cases/esbuild-three/src/base/loaders/TextureLoader.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Loader } from './Loader'; -import { LoadingManager } from './LoadingManager'; -import { Texture } from './../textures/Texture'; - -/** - * Class for loading a texture. - * Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object. - */ -export class TextureLoader extends Loader { - - constructor( manager?: LoadingManager ); - - load( - url: string, - onLoad?: ( texture: Texture ) => void, - onProgress?: ( event: ProgressEvent ) => void, - onError?: ( event: ErrorEvent ) => void - ): Texture; - -} diff --git a/cases/esbuild-three/src/base/loaders/TextureLoader.js b/cases/esbuild-three/src/base/loaders/TextureLoader.js deleted file mode 100644 index 3a31b78499..0000000000 --- a/cases/esbuild-three/src/base/loaders/TextureLoader.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { RGBAFormat, RGBFormat } from '../constants.js'; -import { ImageLoader } from './ImageLoader.js'; -import { Texture } from '../textures/Texture.js'; -import { Loader } from './Loader.js'; - -function TextureLoader( manager ) { - - Loader.call( this, manager ); - -} - -TextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), { - - constructor: TextureLoader, - - load: function ( url, onLoad, onProgress, onError ) { - - var texture = new Texture(); - - var loader = new ImageLoader( this.manager ); - loader.setCrossOrigin( this.crossOrigin ); - loader.setPath( this.path ); - - loader.load( url, function ( image ) { - - texture.image = image; - - // JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB. - var isJPEG = url.search( /\.jpe?g($|\?)/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0; - - texture.format = isJPEG ? RGBFormat : RGBAFormat; - texture.needsUpdate = true; - - if ( onLoad !== undefined ) { - - onLoad( texture ); - - } - - }, onProgress, onError ); - - return texture; - - } - -} ); - - -export { TextureLoader }; diff --git a/cases/esbuild-three/src/base/materials/LineBasicMaterial.d.ts b/cases/esbuild-three/src/base/materials/LineBasicMaterial.d.ts deleted file mode 100644 index ec05e8b872..0000000000 --- a/cases/esbuild-three/src/base/materials/LineBasicMaterial.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Color } from './../math/Color'; -import { MaterialParameters, Material } from './Material'; - -export interface LineBasicMaterialParameters extends MaterialParameters { - color?: Color | string | number; - linewidth?: number; - linecap?: string; - linejoin?: string; -} - -export class LineBasicMaterial extends Material { - - constructor( parameters?: LineBasicMaterialParameters ); - - color: Color; - linewidth: number; - linecap: string; - linejoin: string; - - setValues( parameters: LineBasicMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/LineBasicMaterial.js b/cases/esbuild-three/src/base/materials/LineBasicMaterial.js deleted file mode 100644 index 56463acc05..0000000000 --- a/cases/esbuild-three/src/base/materials/LineBasicMaterial.js +++ /dev/null @@ -1,56 +0,0 @@ -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * linewidth: , - * linecap: "round", - * linejoin: "round" - * } - */ - -function LineBasicMaterial( parameters ) { - - Material.call( this ); - - this.type = 'LineBasicMaterial'; - - this.color = new Color( 0xffffff ); - - this.linewidth = 1; - this.linecap = 'round'; - this.linejoin = 'round'; - - this.lights = false; - - this.setValues( parameters ); - -} - -LineBasicMaterial.prototype = Object.create( Material.prototype ); -LineBasicMaterial.prototype.constructor = LineBasicMaterial; - -LineBasicMaterial.prototype.isLineBasicMaterial = true; - -LineBasicMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - - this.linewidth = source.linewidth; - this.linecap = source.linecap; - this.linejoin = source.linejoin; - - return this; - -}; - - -export { LineBasicMaterial }; diff --git a/cases/esbuild-three/src/base/materials/LineDashedMaterial.d.ts b/cases/esbuild-three/src/base/materials/LineDashedMaterial.d.ts deleted file mode 100644 index 1cfd87d357..0000000000 --- a/cases/esbuild-three/src/base/materials/LineDashedMaterial.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Color } from './../math/Color'; -import { MaterialParameters } from './Material'; -import { LineBasicMaterial } from './LineBasicMaterial'; - -export interface LineDashedMaterialParameters extends MaterialParameters { - color?: Color | string | number; - linewidth?: number; - scale?: number; - dashSize?: number; - gapSize?: number; -} - -export class LineDashedMaterial extends LineBasicMaterial { - - constructor( parameters?: LineDashedMaterialParameters ); - - scale: number; - dashSize: number; - gapSize: number; - isLineDashedMaterial: boolean; - - setValues( parameters: LineDashedMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/LineDashedMaterial.js b/cases/esbuild-three/src/base/materials/LineDashedMaterial.js deleted file mode 100644 index 9fc30d4f0a..0000000000 --- a/cases/esbuild-three/src/base/materials/LineDashedMaterial.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * linewidth: , - * - * scale: , - * dashSize: , - * gapSize: - * } - */ - -import { LineBasicMaterial } from './LineBasicMaterial.js'; - -function LineDashedMaterial( parameters ) { - - LineBasicMaterial.call( this ); - - this.type = 'LineDashedMaterial'; - - this.scale = 1; - this.dashSize = 3; - this.gapSize = 1; - - this.setValues( parameters ); - -} - -LineDashedMaterial.prototype = Object.create( LineBasicMaterial.prototype ); -LineDashedMaterial.prototype.constructor = LineDashedMaterial; - -LineDashedMaterial.prototype.isLineDashedMaterial = true; - -LineDashedMaterial.prototype.copy = function ( source ) { - - LineBasicMaterial.prototype.copy.call( this, source ); - - this.scale = source.scale; - this.dashSize = source.dashSize; - this.gapSize = source.gapSize; - - return this; - -}; - - -export { LineDashedMaterial }; diff --git a/cases/esbuild-three/src/base/materials/Material.d.ts b/cases/esbuild-three/src/base/materials/Material.d.ts deleted file mode 100644 index 407df0c9d9..0000000000 --- a/cases/esbuild-three/src/base/materials/Material.d.ts +++ /dev/null @@ -1,336 +0,0 @@ -import { Plane } from './../math/Plane'; -import { Shader } from './../renderers/shaders/ShaderLib'; -import { EventDispatcher } from './../core/EventDispatcher'; -import { WebGLRenderer } from './../renderers/WebGLRenderer'; -import { - BlendingDstFactor, - BlendingEquation, - Blending, - BlendingSrcFactor, - DepthModes, - Side, - Colors, - StencilFunc, - StencilOp -} from '../constants'; - -// Materials ////////////////////////////////////////////////////////////////////////////////// -export let MaterialIdCount: number; - -export interface MaterialParameters { - alphaTest?: number; - blendDst?: BlendingDstFactor; - blendDstAlpha?: number; - blendEquation?: BlendingEquation; - blendEquationAlpha?: number; - blending?: Blending; - blendSrc?: BlendingSrcFactor | BlendingDstFactor; - blendSrcAlpha?: number; - clipIntersection?: boolean; - clippingPlanes?: Plane[]; - clipShadows?: boolean; - colorWrite?: boolean; - depthFunc?: DepthModes; - depthTest?: boolean; - depthWrite?: boolean; - fog?: boolean; - lights?: boolean; - name?: string; - opacity?: number; - overdraw?: number; - polygonOffset?: boolean; - polygonOffsetFactor?: number; - polygonOffsetUnits?: number; - precision?: 'highp' | 'mediump' | 'lowp' | null; - premultipliedAlpha?: boolean; - dithering?: boolean; - flatShading?: boolean; - side?: Side; - shadowSide?: Side; - transparent?: boolean; - vertexColors?: Colors; - vertexTangents?: boolean; - visible?: boolean; - stencilWrite?: boolean; - stencilFunc?: StencilFunc; - stencilRef?: number; - stencilMask?: number; - stencilFail?: StencilOp; - stencilZFail?: StencilOp; - stencilZPass?: StencilOp; -} - -/** - * Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer. - */ -export class Material extends EventDispatcher { - - constructor(); - - /** - * Sets the alpha value to be used when running an alpha test. Default is 0. - */ - alphaTest: number; - - /** - * Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}. - */ - blendDst: BlendingDstFactor; - - /** - * The tranparency of the .blendDst. Default is null. - */ - blendDstAlpha: number | null; - - /** - * Blending equation to use when applying blending. It's one of the constants defined in Three.js. Default is {@link AddEquation}. - */ - blendEquation: BlendingEquation; - - /** - * The tranparency of the .blendEquation. Default is null. - */ - blendEquationAlpha: number | null; - - /** - * Which blending to use when displaying objects with this material. Default is {@link NormalBlending}. - */ - blending: Blending; - - /** - * Blending source. It's one of the blending mode constants defined in Three.js. Default is {@link SrcAlphaFactor}. - */ - blendSrc: BlendingSrcFactor | BlendingDstFactor; - - /** - * The tranparency of the .blendSrc. Default is null. - */ - blendSrcAlpha: number | null; - - /** - * Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union. Default is false. - */ - clipIntersection: boolean; - - /** - * User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply to the objects this material is attached to. Points in space whose signed distance to the plane is negative are clipped (not rendered). See the WebGL / clipping /intersection example. Default is null. - */ - clippingPlanes: any; - - /** - * Defines whether to clip shadows according to the clipping planes specified on this material. Default is false. - */ - clipShadows: boolean; - - /** - * Whether to render the material's color. This can be used in conjunction with a mesh's .renderOrder property to create invisible objects that occlude other objects. Default is true. - */ - colorWrite: boolean; - - /** - * Which depth function to use. Default is {@link LessEqualDepth}. See the depth mode constants for all possible values. - */ - depthFunc: DepthModes; - - /** - * Whether to have depth test enabled when rendering this material. Default is true. - */ - depthTest: boolean; - - /** - * Whether rendering this material has any effect on the depth buffer. Default is true. - * When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts. - */ - depthWrite: boolean; - - /** - * Whether the material is affected by fog. Default is true. - */ - fog: boolean; - - /** - * Unique number of this material instance. - */ - id: number; - - /** - * Whether rendering this material has any effect on the stencil buffer. Default is *false*. - */ - stencilWrite: boolean; - - /** - * The stencil comparison function to use. Default is {@link AlwaysStencilFunc}. See stencil operation constants for all possible values. - */ - stencilFunc: StencilFunc; - - /** - * The value to use when performing stencil comparisons or stencil operations. Default is *0*. - */ - stencilRef: number; - - /** - * The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*. - */ - stencilMask: number; - - /** - * Which stencil operation to perform when the comparison function returns false. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values. - */ - stencilFail: StencilOp; - - /** - * Which stencil operation to perform when the comparison function returns true but the depth test fails. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values. - */ - stencilZFail: StencilOp; - - /** - * Which stencil operation to perform when the comparison function returns true and the depth test passes. Default is {@link KeepStencilOp}. See the stencil operation constants for all possible values. - */ - stencilZPass: StencilOp; - - /** - * Used to check whether this or derived classes are materials. Default is true. - * You should not change this, as it used internally for optimisation. - */ - isMaterial: boolean; - - /** - * Whether the material is affected by lights. Default is true. - */ - lights: boolean; - - /** - * Material name. Default is an empty string. - */ - name: string; - - /** - * Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL. - * This property is automatically set to true when instancing a new material. - */ - needsUpdate: boolean; - - /** - * Opacity. Default is 1. - */ - opacity: number; - - /** - * Enables/disables overdraw. If greater than zero, polygons are drawn slightly bigger in order to fix antialiasing gaps when using the CanvasRenderer. Default is 0. - */ - overdraw: number; - - /** - * Whether to use polygon offset. Default is false. This corresponds to the POLYGON_OFFSET_FILL WebGL feature. - */ - polygonOffset: boolean; - - /** - * Sets the polygon offset factor. Default is 0. - */ - polygonOffsetFactor: number; - - /** - * Sets the polygon offset units. Default is 0. - */ - polygonOffsetUnits: number; - - /** - * Override the renderer's default precision for this material. Can be "highp", "mediump" or "lowp". Defaults is null. - */ - precision: 'highp' | 'mediump' | 'lowp' | null; - - /** - * Whether to premultiply the alpha (transparency) value. See WebGL / Materials / Transparency for an example of the difference. Default is false. - */ - premultipliedAlpha: boolean; - - /** - * Whether to apply dithering to the color to remove the appearance of banding. Default is false. - */ - dithering: boolean; - - /** - * Define whether the material is rendered with flat shading. Default is false. - */ - flatShading: boolean; - - /** - * Defines which of the face sides will be rendered - front, back or both. - * Default is THREE.FrontSide. Other options are THREE.BackSide and THREE.DoubleSide. - */ - side: Side; - - /** - * Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects. - * When set to true, the extent to which the material is transparent is controlled by setting it's .opacity property. - * Default is false. - */ - transparent: boolean; - - /** - * Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene. - */ - type: string; - - /** - * UUID of this material instance. This gets automatically assigned, so this shouldn't be edited. - */ - uuid: string; - - /** - * Defines whether vertex coloring is used. Default is THREE.NoColors. Other options are THREE.VertexColors and THREE.FaceColors. - */ - vertexColors: Colors; - - /** - * Defines whether precomputed vertex tangents are used. Default is false. - */ - vertexTangents: boolean; - - /** - * Defines whether this material is visible. Default is true. - */ - visible: boolean; - - /** - * An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned. - */ - userData: any; - - /** - * Return a new material with the same parameters as this material. - */ - clone(): this; - - /** - * Copy the parameters from the passed material into this material. - * @param material - */ - copy( material: Material ): this; - - /** - * This disposes the material. Textures of a material don't get disposed. These needs to be disposed by {@link Texture}. - */ - dispose(): void; - - /** - * An optional callback that is executed immediately before the shader program is compiled. This function is called with the shader source code as a parameter. Useful for the modification of built-in materials. - * @param shader Source code of the shader - * @param renderer WebGLRenderer Context that is initializing the material - */ - onBeforeCompile ( shader : Shader, renderer : WebGLRenderer ) : void; - - /** - * Sets the properties based on the values. - * @param values A container with parameters. - */ - setValues( values: MaterialParameters ): void; - - /** - * Convert the material to three.js JSON format. - * @param meta Object containing metadata such as textures or images for the material. - */ - toJSON( meta?: any ): any; - -} diff --git a/cases/esbuild-three/src/base/materials/Material.js b/cases/esbuild-three/src/base/materials/Material.js deleted file mode 100644 index 0469bc2542..0000000000 --- a/cases/esbuild-three/src/base/materials/Material.js +++ /dev/null @@ -1,424 +0,0 @@ -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { NoColors, FrontSide, FlatShading, NormalBlending, LessEqualDepth, AddEquation, OneMinusSrcAlphaFactor, SrcAlphaFactor, AlwaysStencilFunc, KeepStencilOp } from '../constants.js'; -import { _Math } from '../math/Math.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -var materialId = 0; - -function Material() { - - Object.defineProperty( this, 'id', { value: materialId ++ } ); - - this.uuid = _Math.generateUUID(); - - this.name = ''; - this.type = 'Material'; - - this.fog = true; - this.lights = true; - - this.blending = NormalBlending; - this.side = FrontSide; - this.flatShading = false; - this.vertexTangents = false; - this.vertexColors = NoColors; // THREE.NoColors, THREE.VertexColors, THREE.FaceColors - - this.opacity = 1; - this.transparent = false; - - this.blendSrc = SrcAlphaFactor; - this.blendDst = OneMinusSrcAlphaFactor; - this.blendEquation = AddEquation; - this.blendSrcAlpha = null; - this.blendDstAlpha = null; - this.blendEquationAlpha = null; - - this.depthFunc = LessEqualDepth; - this.depthTest = true; - this.depthWrite = true; - - this.stencilFunc = AlwaysStencilFunc; - this.stencilRef = 0; - this.stencilMask = 0xff; - this.stencilFail = KeepStencilOp; - this.stencilZFail = KeepStencilOp; - this.stencilZPass = KeepStencilOp; - this.stencilWrite = false; - - this.clippingPlanes = null; - this.clipIntersection = false; - this.clipShadows = false; - - this.shadowSide = null; - - this.colorWrite = true; - - this.precision = null; // override the renderer's default precision for this material - - this.polygonOffset = false; - this.polygonOffsetFactor = 0; - this.polygonOffsetUnits = 0; - - this.dithering = false; - - this.alphaTest = 0; - this.premultipliedAlpha = false; - - this.visible = true; - - this.toneMapped = true; - - this.userData = {}; - - this.needsUpdate = true; - -} - -Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: Material, - - isMaterial: true, - - onBeforeCompile: function () {}, - - setValues: function ( values ) { - - if ( values === undefined ) return; - - for ( var key in values ) { - - var newValue = values[ key ]; - - if ( newValue === undefined ) { - - console.warn( "THREE.Material: '" + key + "' parameter is undefined." ); - continue; - - } - - // for backward compatability if shading is set in the constructor - if ( key === 'shading' ) { - - console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); - this.flatShading = ( newValue === FlatShading ) ? true : false; - continue; - - } - - var currentValue = this[ key ]; - - if ( currentValue === undefined ) { - - console.warn( "THREE." + this.type + ": '" + key + "' is not a property of this material." ); - continue; - - } - - if ( currentValue && currentValue.isColor ) { - - currentValue.set( newValue ); - - } else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) { - - currentValue.copy( newValue ); - - } else { - - this[ key ] = newValue; - - } - - } - - }, - - toJSON: function ( meta ) { - - var isRoot = ( meta === undefined || typeof meta === 'string' ); - - if ( isRoot ) { - - meta = { - textures: {}, - images: {} - }; - - } - - var data = { - metadata: { - version: 4.5, - type: 'Material', - generator: 'Material.toJSON' - } - }; - - // standard Material serialization - data.uuid = this.uuid; - data.type = this.type; - - if ( this.name !== '' ) data.name = this.name; - - if ( this.color && this.color.isColor ) data.color = this.color.getHex(); - - if ( this.roughness !== undefined ) data.roughness = this.roughness; - if ( this.metalness !== undefined ) data.metalness = this.metalness; - - if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex(); - if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity; - - if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex(); - if ( this.shininess !== undefined ) data.shininess = this.shininess; - if ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat; - if ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness; - - if ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) { - - data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid; - data.clearcoatNormalScale = this.clearcoatNormalScale.toArray(); - - } - - if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid; - if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid; - if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid; - if ( this.lightMap && this.lightMap.isTexture ) data.lightMap = this.lightMap.toJSON( meta ).uuid; - - if ( this.aoMap && this.aoMap.isTexture ) { - - data.aoMap = this.aoMap.toJSON( meta ).uuid; - data.aoMapIntensity = this.aoMapIntensity; - - } - - if ( this.bumpMap && this.bumpMap.isTexture ) { - - data.bumpMap = this.bumpMap.toJSON( meta ).uuid; - data.bumpScale = this.bumpScale; - - } - - if ( this.normalMap && this.normalMap.isTexture ) { - - data.normalMap = this.normalMap.toJSON( meta ).uuid; - data.normalMapType = this.normalMapType; - data.normalScale = this.normalScale.toArray(); - - } - - if ( this.displacementMap && this.displacementMap.isTexture ) { - - data.displacementMap = this.displacementMap.toJSON( meta ).uuid; - data.displacementScale = this.displacementScale; - data.displacementBias = this.displacementBias; - - } - - if ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid; - if ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid; - - if ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid; - if ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid; - - if ( this.envMap && this.envMap.isTexture ) { - - data.envMap = this.envMap.toJSON( meta ).uuid; - data.reflectivity = this.reflectivity; // Scale behind envMap - data.refractionRatio = this.refractionRatio; - - if ( this.combine !== undefined ) data.combine = this.combine; - if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity; - - } - - if ( this.gradientMap && this.gradientMap.isTexture ) { - - data.gradientMap = this.gradientMap.toJSON( meta ).uuid; - - } - - if ( this.size !== undefined ) data.size = this.size; - if ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation; - - if ( this.blending !== NormalBlending ) data.blending = this.blending; - if ( this.flatShading === true ) data.flatShading = this.flatShading; - if ( this.side !== FrontSide ) data.side = this.side; - if ( this.vertexColors !== NoColors ) data.vertexColors = this.vertexColors; - - if ( this.opacity < 1 ) data.opacity = this.opacity; - if ( this.transparent === true ) data.transparent = this.transparent; - - data.depthFunc = this.depthFunc; - data.depthTest = this.depthTest; - data.depthWrite = this.depthWrite; - - data.stencilWrite = this.stencilWrite; - data.stencilFunc = this.stencilFunc; - data.stencilRef = this.stencilRef; - data.stencilMask = this.stencilMask; - data.stencilFail = this.stencilFail; - data.stencilZFail = this.stencilZFail; - data.stencilZPass = this.stencilZPass; - - // rotation (SpriteMaterial) - if ( this.rotation && this.rotation !== 0 ) data.rotation = this.rotation; - - if ( this.polygonOffset === true ) data.polygonOffset = true; - if ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor; - if ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits; - - if ( this.linewidth && this.linewidth !== 1 ) data.linewidth = this.linewidth; - if ( this.dashSize !== undefined ) data.dashSize = this.dashSize; - if ( this.gapSize !== undefined ) data.gapSize = this.gapSize; - if ( this.scale !== undefined ) data.scale = this.scale; - - if ( this.dithering === true ) data.dithering = true; - - if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest; - if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha; - - if ( this.wireframe === true ) data.wireframe = this.wireframe; - if ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth; - if ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap; - if ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin; - - if ( this.morphTargets === true ) data.morphTargets = true; - if ( this.morphNormals === true ) data.morphNormals = true; - if ( this.skinning === true ) data.skinning = true; - - if ( this.visible === false ) data.visible = false; - - if ( this.toneMapped === false ) data.toneMapped = false; - - if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData; - - // TODO: Copied from Object3D.toJSON - - function extractFromCache( cache ) { - - var values = []; - - for ( var key in cache ) { - - var data = cache[ key ]; - delete data.metadata; - values.push( data ); - - } - - return values; - - } - - if ( isRoot ) { - - var textures = extractFromCache( meta.textures ); - var images = extractFromCache( meta.images ); - - if ( textures.length > 0 ) data.textures = textures; - if ( images.length > 0 ) data.images = images; - - } - - return data; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( source ) { - - this.name = source.name; - - this.fog = source.fog; - this.lights = source.lights; - - this.blending = source.blending; - this.side = source.side; - this.flatShading = source.flatShading; - this.vertexColors = source.vertexColors; - - this.opacity = source.opacity; - this.transparent = source.transparent; - - this.blendSrc = source.blendSrc; - this.blendDst = source.blendDst; - this.blendEquation = source.blendEquation; - this.blendSrcAlpha = source.blendSrcAlpha; - this.blendDstAlpha = source.blendDstAlpha; - this.blendEquationAlpha = source.blendEquationAlpha; - - this.depthFunc = source.depthFunc; - this.depthTest = source.depthTest; - this.depthWrite = source.depthWrite; - - this.stencilWrite = source.stencilWrite; - this.stencilFunc = source.stencilFunc; - this.stencilRef = source.stencilRef; - this.stencilMask = source.stencilMask; - this.stencilFail = source.stencilFail; - this.stencilZFail = source.stencilZFail; - this.stencilZPass = source.stencilZPass; - - this.colorWrite = source.colorWrite; - - this.precision = source.precision; - - this.polygonOffset = source.polygonOffset; - this.polygonOffsetFactor = source.polygonOffsetFactor; - this.polygonOffsetUnits = source.polygonOffsetUnits; - - this.dithering = source.dithering; - - this.alphaTest = source.alphaTest; - this.premultipliedAlpha = source.premultipliedAlpha; - - this.visible = source.visible; - - this.toneMapped = source.toneMapped; - - this.userData = JSON.parse( JSON.stringify( source.userData ) ); - - this.clipShadows = source.clipShadows; - this.clipIntersection = source.clipIntersection; - - var srcPlanes = source.clippingPlanes, - dstPlanes = null; - - if ( srcPlanes !== null ) { - - var n = srcPlanes.length; - dstPlanes = new Array( n ); - - for ( var i = 0; i !== n; ++ i ) - dstPlanes[ i ] = srcPlanes[ i ].clone(); - - } - - this.clippingPlanes = dstPlanes; - - this.shadowSide = source.shadowSide; - - return this; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - } - -} ); - - -export { Material }; diff --git a/cases/esbuild-three/src/base/materials/Materials.d.ts b/cases/esbuild-three/src/base/materials/Materials.d.ts deleted file mode 100644 index ff7faa9d47..0000000000 --- a/cases/esbuild-three/src/base/materials/Materials.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from './ShadowMaterial'; -export * from './SpriteMaterial'; -export * from './RawShaderMaterial'; -export * from './ShaderMaterial'; -export * from './PointsMaterial'; -export * from './MeshPhysicalMaterial'; -export * from './MeshStandardMaterial'; -export * from './MeshPhongMaterial'; -export * from './MeshToonMaterial'; -export * from './MeshNormalMaterial'; -export * from './MeshLambertMaterial'; -export * from './MeshDepthMaterial'; -export * from './MeshDistanceMaterial'; -export * from './MeshBasicMaterial'; -export * from './MeshMatcapMaterial'; -export * from './LineDashedMaterial'; -export * from './LineBasicMaterial'; -export * from './Material'; diff --git a/cases/esbuild-three/src/base/materials/Materials.js b/cases/esbuild-three/src/base/materials/Materials.js deleted file mode 100644 index 28844e9588..0000000000 --- a/cases/esbuild-three/src/base/materials/Materials.js +++ /dev/null @@ -1,18 +0,0 @@ -export { ShadowMaterial } from './ShadowMaterial.js'; -export { SpriteMaterial } from './SpriteMaterial.js'; -export { RawShaderMaterial } from './RawShaderMaterial.js'; -export { ShaderMaterial } from './ShaderMaterial.js'; -export { PointsMaterial } from './PointsMaterial.js'; -export { MeshPhysicalMaterial } from './MeshPhysicalMaterial.js'; -export { MeshStandardMaterial } from './MeshStandardMaterial.js'; -export { MeshPhongMaterial } from './MeshPhongMaterial.js'; -export { MeshToonMaterial } from './MeshToonMaterial.js'; -export { MeshNormalMaterial } from './MeshNormalMaterial.js'; -export { MeshLambertMaterial } from './MeshLambertMaterial.js'; -export { MeshDepthMaterial } from './MeshDepthMaterial.js'; -export { MeshDistanceMaterial } from './MeshDistanceMaterial.js'; -export { MeshBasicMaterial } from './MeshBasicMaterial.js'; -export { MeshMatcapMaterial } from './MeshMatcapMaterial.js'; -export { LineDashedMaterial } from './LineDashedMaterial.js'; -export { LineBasicMaterial } from './LineBasicMaterial.js'; -export { Material } from './Material.js'; diff --git a/cases/esbuild-three/src/base/materials/MeshBasicMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshBasicMaterial.d.ts deleted file mode 100644 index 10e7906961..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshBasicMaterial.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { MaterialParameters, Material } from './Material'; -import { Combine } from '../constants'; -/** - * parameters is an object with one or more properties defining the material's appearance. - */ -export interface MeshBasicMaterialParameters extends MaterialParameters { - color?: Color | string | number; - opacity?: number; - map?: Texture; - aoMap?: Texture; - aoMapIntensity?: number; - specularMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - combine?: Combine; - reflectivity?: number; - refractionRatio?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; - skinning?: boolean; - morphTargets?: boolean; -} - -export class MeshBasicMaterial extends Material { - - constructor( parameters?: MeshBasicMaterialParameters ); - - color: Color; - map: Texture | null; - aoMap: Texture | null; - aoMapIntensity: number; - specularMap: Texture | null; - alphaMap: Texture | null; - envMap: Texture | null; - combine: Combine; - reflectivity: number; - refractionRatio: number; - wireframe: boolean; - wireframeLinewidth: number; - wireframeLinecap: string; - wireframeLinejoin: string; - skinning: boolean; - morphTargets: boolean; - - setValues( parameters: MeshBasicMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshBasicMaterial.js b/cases/esbuild-three/src/base/materials/MeshBasicMaterial.js deleted file mode 100644 index 207cf6a9c5..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshBasicMaterial.js +++ /dev/null @@ -1,120 +0,0 @@ -import { Material } from './Material.js'; -import { MultiplyOperation } from '../constants.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * depthTest: , - * depthWrite: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: - * } - */ - -function MeshBasicMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshBasicMaterial'; - - this.color = new Color( 0xffffff ); // emissive - - this.map = null; - - this.lightMap = null; - this.lightMapIntensity = 1.0; - - this.aoMap = null; - this.aoMapIntensity = 1.0; - - this.specularMap = null; - - this.alphaMap = null; - - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; - - this.skinning = false; - this.morphTargets = false; - - this.lights = false; - - this.setValues( parameters ); - -} - -MeshBasicMaterial.prototype = Object.create( Material.prototype ); -MeshBasicMaterial.prototype.constructor = MeshBasicMaterial; - -MeshBasicMaterial.prototype.isMeshBasicMaterial = true; - -MeshBasicMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - - this.map = source.map; - - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - - this.specularMap = source.specularMap; - - this.alphaMap = source.alphaMap; - - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - - return this; - -}; - - -export { MeshBasicMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshDepthMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshDepthMaterial.d.ts deleted file mode 100644 index 275047de22..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshDepthMaterial.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { DepthPackingStrategies } from '../constants'; -import { MaterialParameters, Material } from './Material'; -import { Texture } from './../textures/Texture'; - -export interface MeshDepthMaterialParameters extends MaterialParameters { - depthPacking?: DepthPackingStrategies; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; - wireframe?: boolean; - wireframeLinewidth?: number; -} - -export class MeshDepthMaterial extends Material { - - constructor( parameters?: MeshDepthMaterialParameters ); - - depthPacking: DepthPackingStrategies; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - wireframe: boolean; - wireframeLinewidth: number; - - setValues( parameters: MeshDepthMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshDepthMaterial.js b/cases/esbuild-three/src/base/materials/MeshDepthMaterial.js deleted file mode 100644 index 2a143dfde5..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshDepthMaterial.js +++ /dev/null @@ -1,86 +0,0 @@ -import { Material } from './Material.js'; -import { BasicDepthPacking } from '../constants.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author bhouston / https://clara.io - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * - * opacity: , - * - * map: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * wireframe: , - * wireframeLinewidth: - * } - */ - -function MeshDepthMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshDepthMaterial'; - - this.depthPacking = BasicDepthPacking; - - this.skinning = false; - this.morphTargets = false; - - this.map = null; - - this.alphaMap = null; - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.wireframe = false; - this.wireframeLinewidth = 1; - - this.fog = false; - this.lights = false; - - this.setValues( parameters ); - -} - -MeshDepthMaterial.prototype = Object.create( Material.prototype ); -MeshDepthMaterial.prototype.constructor = MeshDepthMaterial; - -MeshDepthMaterial.prototype.isMeshDepthMaterial = true; - -MeshDepthMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.depthPacking = source.depthPacking; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - - this.map = source.map; - - this.alphaMap = source.alphaMap; - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - - return this; - -}; - - -export { MeshDepthMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.d.ts deleted file mode 100644 index 69373685f5..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { MaterialParameters, Material } from './Material'; -import { Vector3 } from './../math/Vector3'; -import { Texture } from './../textures/Texture'; - -export interface MeshDistanceMaterialParameters extends MaterialParameters { - referencePosition?: Vector3; - nearDistance?: number; - farDistance?: number; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; -} - -export class MeshDistanceMaterial extends Material { - - constructor( parameters?: MeshDistanceMaterialParameters ); - - referencePosition: Vector3; - nearDistance: number; - farDistance: number; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - - setValues( parameters: MeshDistanceMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.js b/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.js deleted file mode 100644 index 2fa54c5e77..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshDistanceMaterial.js +++ /dev/null @@ -1,84 +0,0 @@ -import { Material } from './Material.js'; -import { Vector3 } from '../math/Vector3.js'; - -/** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * - * referencePosition: , - * nearDistance: , - * farDistance: , - * - * skinning: , - * morphTargets: , - * - * map: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: - * - * } - */ - -function MeshDistanceMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshDistanceMaterial'; - - this.referencePosition = new Vector3(); - this.nearDistance = 1; - this.farDistance = 1000; - - this.skinning = false; - this.morphTargets = false; - - this.map = null; - - this.alphaMap = null; - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.fog = false; - this.lights = false; - - this.setValues( parameters ); - -} - -MeshDistanceMaterial.prototype = Object.create( Material.prototype ); -MeshDistanceMaterial.prototype.constructor = MeshDistanceMaterial; - -MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true; - -MeshDistanceMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.referencePosition.copy( source.referencePosition ); - this.nearDistance = source.nearDistance; - this.farDistance = source.farDistance; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - - this.map = source.map; - - this.alphaMap = source.alphaMap; - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - return this; - -}; - - -export { MeshDistanceMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshLambertMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshLambertMaterial.d.ts deleted file mode 100644 index 7d4c6e47ce..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshLambertMaterial.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { MaterialParameters, Material } from './Material'; -import { Combine } from '../constants'; - -export interface MeshLambertMaterialParameters extends MaterialParameters { - color?: Color | string | number; - emissive?: Color | string | number; - emissiveIntensity?: number; - emissiveMap?: Texture; - map?: Texture; - lightMap?: Texture; - lightMapIntensity?: number; - aoMap?: Texture; - aoMapIntensity?: number; - specularMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - combine?: Combine; - reflectivity?: number; - refractionRatio?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class MeshLambertMaterial extends Material { - - constructor( parameters?: MeshLambertMaterialParameters ); - - color: Color; - emissive: Color; - emissiveIntensity: number; - emissiveMap: Texture | null; - map: Texture | null; - lightMap: Texture | null; - lightMapIntensity: number; - aoMap: Texture | null; - aoMapIntensity: number; - specularMap: Texture | null; - alphaMap: Texture | null; - envMap: Texture | null; - combine: Combine; - reflectivity: number; - refractionRatio: number; - wireframe: boolean; - wireframeLinewidth: number; - wireframeLinecap: string; - wireframeLinejoin: string; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - - setValues( parameters: MeshLambertMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshLambertMaterial.js b/cases/esbuild-three/src/base/materials/MeshLambertMaterial.js deleted file mode 100644 index 949310e3cd..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshLambertMaterial.js +++ /dev/null @@ -1,131 +0,0 @@ -import { Material } from './Material.js'; -import { MultiplyOperation } from '../constants.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -function MeshLambertMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshLambertMaterial'; - - this.color = new Color( 0xffffff ); // diffuse - - this.map = null; - - this.lightMap = null; - this.lightMapIntensity = 1.0; - - this.aoMap = null; - this.aoMapIntensity = 1.0; - - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; - - this.specularMap = null; - - this.alphaMap = null; - - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; - - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; - - this.setValues( parameters ); - -} - -MeshLambertMaterial.prototype = Object.create( Material.prototype ); -MeshLambertMaterial.prototype.constructor = MeshLambertMaterial; - -MeshLambertMaterial.prototype.isMeshLambertMaterial = true; - -MeshLambertMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - - this.map = source.map; - - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - - this.specularMap = source.specularMap; - - this.alphaMap = source.alphaMap; - - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - return this; - -}; - - -export { MeshLambertMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.d.ts deleted file mode 100644 index f51b3b2d5c..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { Vector2 } from './../math/Vector2'; -import { MaterialParameters, Material } from './Material'; -import { NormalMapTypes } from '../constants'; - -export interface MeshMatcapMaterialParameters extends MaterialParameters { - - color?: Color | string | number; - matcap?: Texture; - map?: Texture; - bumpMap?: Texture; - bumpScale?: number; - normalMap?: Texture; - normalMapType?: NormalMapTypes; - normalScale?: Vector2; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; - alphaMap?: Texture; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class MeshMatcapMaterial extends Material { - - constructor( parameters?: MeshMatcapMaterialParameters ); - - color: Color; - matcap: Texture | null; - map: Texture | null; - bumpMap: Texture | null; - bumpScale: number; - normalMap: Texture | null; - normalMapType: NormalMapTypes; - normalScale: Vector2; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - alphaMap: Texture | null; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - - setValues( parameters: MeshMatcapMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.js b/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.js deleted file mode 100644 index df77f2ef0a..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshMatcapMaterial.js +++ /dev/null @@ -1,112 +0,0 @@ -import { TangentSpaceNormalMap } from '../constants.js'; -import { Material } from './Material.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; - -/** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * color: , - * opacity: , - * - * matcap: new THREE.Texture( ), - * - * map: new THREE.Texture( ), - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalMapType: THREE.TangentSpaceNormalMap, - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * alphaMap: new THREE.Texture( ), - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -function MeshMatcapMaterial( parameters ) { - - Material.call( this ); - - this.defines = { 'MATCAP': '' }; - - this.type = 'MeshMatcapMaterial'; - - this.color = new Color( 0xffffff ); // diffuse - - this.matcap = null; - - this.map = null; - - this.bumpMap = null; - this.bumpScale = 1; - - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2( 1, 1 ); - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.alphaMap = null; - - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; - - this.lights = false; - - this.setValues( parameters ); - -} - -MeshMatcapMaterial.prototype = Object.create( Material.prototype ); -MeshMatcapMaterial.prototype.constructor = MeshMatcapMaterial; - -MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true; - -MeshMatcapMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.defines = { 'MATCAP': '' }; - - this.color.copy( source.color ); - - this.matcap = source.matcap; - - this.map = source.map; - - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy( source.normalScale ); - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - this.alphaMap = source.alphaMap; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - return this; - -}; - - -export { MeshMatcapMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshNormalMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshNormalMaterial.d.ts deleted file mode 100644 index 0560ea4b62..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshNormalMaterial.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { MaterialParameters, Material } from './Material'; -import { Texture } from './../textures/Texture'; -import { Vector2 } from './../math/Vector2'; -import { NormalMapTypes } from '../constants'; - -export interface MeshNormalMaterialParameters extends MaterialParameters { - - bumpMap?: Texture; - bumpScale?: number; - normalMap?: Texture; - normalMapType?: NormalMapTypes; - normalScale?: Vector2; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class MeshNormalMaterial extends Material { - - constructor( parameters?: MeshNormalMaterialParameters ); - - bumpMap: Texture | null; - bumpScale: number; - normalMap: Texture | null; - normalMapType: NormalMapTypes; - normalScale: Vector2; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - wireframe: boolean; - wireframeLinewidth: number; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - - setValues( parameters: MeshNormalMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshNormalMaterial.js b/cases/esbuild-three/src/base/materials/MeshNormalMaterial.js deleted file mode 100644 index c95f335dd0..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshNormalMaterial.js +++ /dev/null @@ -1,95 +0,0 @@ -import { TangentSpaceNormalMap } from '../constants.js'; -import { Material } from './Material.js'; -import { Vector2 } from '../math/Vector2.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * opacity: , - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalMapType: THREE.TangentSpaceNormalMap, - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * wireframe: , - * wireframeLinewidth: - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -function MeshNormalMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshNormalMaterial'; - - this.bumpMap = null; - this.bumpScale = 1; - - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2( 1, 1 ); - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.wireframe = false; - this.wireframeLinewidth = 1; - - this.fog = false; - this.lights = false; - - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; - - this.setValues( parameters ); - -} - -MeshNormalMaterial.prototype = Object.create( Material.prototype ); -MeshNormalMaterial.prototype.constructor = MeshNormalMaterial; - -MeshNormalMaterial.prototype.isMeshNormalMaterial = true; - -MeshNormalMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy( source.normalScale ); - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - return this; - -}; - - -export { MeshNormalMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshPhongMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshPhongMaterial.d.ts deleted file mode 100644 index cc312cd6e2..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshPhongMaterial.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { Vector2 } from './../math/Vector2'; -import { MaterialParameters, Material } from './Material'; -import { Combine, NormalMapTypes } from '../constants'; - -export interface MeshPhongMaterialParameters extends MaterialParameters { - /** geometry color in hexadecimal. Default is 0xffffff. */ - color?: Color | string | number; - specular?: Color | string | number; - shininess?: number; - opacity?: number; - map?: Texture; - lightMap?: Texture; - lightMapIntensity?: number; - aoMap?: Texture; - aoMapIntensity?: number; - emissive?: Color | string | number; - emissiveIntensity?: number; - emissiveMap?: Texture; - bumpMap?: Texture; - bumpScale?: number; - normalMap?: Texture; - normalMapType?: NormalMapTypes; - normalScale?: Vector2; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; - specularMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - combine?: Combine; - reflectivity?: number; - refractionRatio?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - wireframeLinecap?: string; - wireframeLinejoin?: string; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class MeshPhongMaterial extends Material { - - constructor( parameters?: MeshPhongMaterialParameters ); - - color: Color; - specular: Color; - shininess: number; - map: Texture | null; - lightMap: Texture | null; - lightMapIntensity: number; - aoMap: Texture | null; - aoMapIntensity: number; - emissive: Color; - emissiveIntensity: number; - emissiveMap: Texture | null; - bumpMap: Texture | null; - bumpScale: number; - normalMap: Texture | null; - normalMapType: NormalMapTypes; - normalScale: Vector2; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - specularMap: Texture | null; - alphaMap: Texture | null; - envMap: Texture | null; - combine: Combine; - reflectivity: number; - refractionRatio: number; - wireframe: boolean; - wireframeLinewidth: number; - wireframeLinecap: string; - wireframeLinejoin: string; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - /** - * @deprecated Use {@link MeshStandardMaterial THREE.MeshStandardMaterial} instead. - */ - metal: boolean; - - setValues( parameters: MeshPhongMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshPhongMaterial.js b/cases/esbuild-three/src/base/materials/MeshPhongMaterial.js deleted file mode 100644 index e040b1fd03..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshPhongMaterial.js +++ /dev/null @@ -1,171 +0,0 @@ -import { MultiplyOperation, TangentSpaceNormalMap } from '../constants.js'; -import { Material } from './Material.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * specular: , - * shininess: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalMapType: THREE.TangentSpaceNormalMap, - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * specularMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -function MeshPhongMaterial( parameters ) { - - Material.call( this ); - - this.type = 'MeshPhongMaterial'; - - this.color = new Color( 0xffffff ); // diffuse - this.specular = new Color( 0x111111 ); - this.shininess = 30; - - this.map = null; - - this.lightMap = null; - this.lightMapIntensity = 1.0; - - this.aoMap = null; - this.aoMapIntensity = 1.0; - - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; - - this.bumpMap = null; - this.bumpScale = 1; - - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2( 1, 1 ); - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.specularMap = null; - - this.alphaMap = null; - - this.envMap = null; - this.combine = MultiplyOperation; - this.reflectivity = 1; - this.refractionRatio = 0.98; - - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; - - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; - - this.setValues( parameters ); - -} - -MeshPhongMaterial.prototype = Object.create( Material.prototype ); -MeshPhongMaterial.prototype.constructor = MeshPhongMaterial; - -MeshPhongMaterial.prototype.isMeshPhongMaterial = true; - -MeshPhongMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - this.specular.copy( source.specular ); - this.shininess = source.shininess; - - this.map = source.map; - - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy( source.normalScale ); - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - this.specularMap = source.specularMap; - - this.alphaMap = source.alphaMap; - - this.envMap = source.envMap; - this.combine = source.combine; - this.reflectivity = source.reflectivity; - this.refractionRatio = source.refractionRatio; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - return this; - -}; - - -export { MeshPhongMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.d.ts deleted file mode 100644 index 07399cc9ef..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Texture } from './../textures/Texture'; -import { Vector2 } from './../math/Vector2'; -import { - MeshStandardMaterialParameters, - MeshStandardMaterial, -} from './MeshStandardMaterial'; -import { Color } from './../math/Color'; - -export interface MeshPhysicalMaterialParameters - extends MeshStandardMaterialParameters { - reflectivity?: number; - clearcoat?: number; - clearcoatRoughness?: number; - - sheen?: Color; - - clearcoatNormalScale?: Vector2; - clearcoatNormalMap?: Texture; -} - -export class MeshPhysicalMaterial extends MeshStandardMaterial { - - constructor( parameters: MeshPhysicalMaterialParameters ); - - defines: any; - reflectivity: number; - clearcoat: number; - clearcoatRoughness: number; - - sheen: Color | null; - - clearcoatNormalScale: Vector2; - clearcoatNormalMap: Texture | null; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.js b/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.js deleted file mode 100644 index 09e1469f2a..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshPhysicalMaterial.js +++ /dev/null @@ -1,82 +0,0 @@ -import { Vector2 } from '../math/Vector2.js'; -import { MeshStandardMaterial } from './MeshStandardMaterial.js'; -import { Color } from '../math/Color.js'; - -/** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * reflectivity: - * clearcoat: - * clearcoatRoughness: - * - * sheen: - * - * clearcoatNormalScale: , - * clearcoatNormalMap: new THREE.Texture( ), - * } - */ - -function MeshPhysicalMaterial( parameters ) { - - MeshStandardMaterial.call( this ); - - this.defines = { - - 'STANDARD': '', - 'PHYSICAL': '' - - }; - - this.type = 'MeshPhysicalMaterial'; - - this.reflectivity = 0.5; // maps to F0 = 0.04 - - this.clearcoat = 0.0; - this.clearcoatRoughness = 0.0; - - this.sheen = null; // null will disable sheen bsdf - - this.clearcoatNormalScale = new Vector2( 1, 1 ); - this.clearcoatNormalMap = null; - - this.transparency = 0.0; - - this.setValues( parameters ); - -} - -MeshPhysicalMaterial.prototype = Object.create( MeshStandardMaterial.prototype ); -MeshPhysicalMaterial.prototype.constructor = MeshPhysicalMaterial; - -MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true; - -MeshPhysicalMaterial.prototype.copy = function ( source ) { - - MeshStandardMaterial.prototype.copy.call( this, source ); - - this.defines = { - - 'STANDARD': '', - 'PHYSICAL': '' - - }; - - this.reflectivity = source.reflectivity; - - this.clearcoat = source.clearcoat; - this.clearcoatRoughness = source.clearcoatRoughness; - - if ( source.sheen ) this.sheen = ( this.sheen || new Color() ).copy( source.sheen ); - else this.sheen = null; - - this.clearcoatNormalMap = source.clearcoatNormalMap; - this.clearcoatNormalScale.copy( source.clearcoatNormalScale ); - - this.transparency = source.transparency; - - return this; - -}; - -export { MeshPhysicalMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshStandardMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshStandardMaterial.d.ts deleted file mode 100644 index a9c1eb1f4c..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshStandardMaterial.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { Vector2 } from './../math/Vector2'; -import { MaterialParameters, Material } from './Material'; -import { NormalMapTypes } from '../constants'; - -export interface MeshStandardMaterialParameters extends MaterialParameters { - color?: Color | string | number; - roughness?: number; - metalness?: number; - map?: Texture; - lightMap?: Texture; - lightMapIntensity?: number; - aoMap?: Texture; - aoMapIntensity?: number; - emissive?: Color | string | number; - emissiveIntensity?: number; - emissiveMap?: Texture; - bumpMap?: Texture; - bumpScale?: number; - normalMap?: Texture; - normalMapType?: NormalMapTypes; - normalScale?: Vector2; - displacementMap?: Texture; - displacementScale?: number; - displacementBias?: number; - roughnessMap?: Texture; - metalnessMap?: Texture; - alphaMap?: Texture; - envMap?: Texture; - envMapIntensity?: number; - refractionRatio?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class MeshStandardMaterial extends Material { - - constructor( parameters?: MeshStandardMaterialParameters ); - - defines: any; - color: Color; - roughness: number; - metalness: number; - map: Texture | null; - lightMap: Texture | null; - lightMapIntensity: number; - aoMap: Texture | null; - aoMapIntensity: number; - emissive: Color; - emissiveIntensity: number; - emissiveMap: Texture | null; - bumpMap: Texture | null; - bumpScale: number; - normalMap: Texture | null; - normalMapType: NormalMapTypes; - normalScale: Vector2; - displacementMap: Texture | null; - displacementScale: number; - displacementBias: number; - roughnessMap: Texture | null; - metalnessMap: Texture | null; - alphaMap: Texture | null; - envMap: Texture | null; - envMapIntensity: number; - refractionRatio: number; - wireframe: boolean; - wireframeLinewidth: number; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - - setValues( parameters: MeshStandardMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshStandardMaterial.js b/cases/esbuild-three/src/base/materials/MeshStandardMaterial.js deleted file mode 100644 index cbbe32dc34..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshStandardMaterial.js +++ /dev/null @@ -1,180 +0,0 @@ -import { TangentSpaceNormalMap } from '../constants.js'; -import { Material } from './Material.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; - -/** - * @author WestLangley / http://github.com/WestLangley - * - * parameters = { - * color: , - * roughness: , - * metalness: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * lightMapIntensity: - * - * aoMap: new THREE.Texture( ), - * aoMapIntensity: - * - * emissive: , - * emissiveIntensity: - * emissiveMap: new THREE.Texture( ), - * - * bumpMap: new THREE.Texture( ), - * bumpScale: , - * - * normalMap: new THREE.Texture( ), - * normalMapType: THREE.TangentSpaceNormalMap, - * normalScale: , - * - * displacementMap: new THREE.Texture( ), - * displacementScale: , - * displacementBias: , - * - * roughnessMap: new THREE.Texture( ), - * - * metalnessMap: new THREE.Texture( ), - * - * alphaMap: new THREE.Texture( ), - * - * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ), - * envMapIntensity: - * - * refractionRatio: , - * - * wireframe: , - * wireframeLinewidth: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -function MeshStandardMaterial( parameters ) { - - Material.call( this ); - - this.defines = { 'STANDARD': '' }; - - this.type = 'MeshStandardMaterial'; - - this.color = new Color( 0xffffff ); // diffuse - this.roughness = 0.5; - this.metalness = 0.5; - - this.map = null; - - this.lightMap = null; - this.lightMapIntensity = 1.0; - - this.aoMap = null; - this.aoMapIntensity = 1.0; - - this.emissive = new Color( 0x000000 ); - this.emissiveIntensity = 1.0; - this.emissiveMap = null; - - this.bumpMap = null; - this.bumpScale = 1; - - this.normalMap = null; - this.normalMapType = TangentSpaceNormalMap; - this.normalScale = new Vector2( 1, 1 ); - - this.displacementMap = null; - this.displacementScale = 1; - this.displacementBias = 0; - - this.roughnessMap = null; - - this.metalnessMap = null; - - this.alphaMap = null; - - this.envMap = null; - this.envMapIntensity = 1.0; - - this.refractionRatio = 0.98; - - this.wireframe = false; - this.wireframeLinewidth = 1; - this.wireframeLinecap = 'round'; - this.wireframeLinejoin = 'round'; - - this.skinning = false; - this.morphTargets = false; - this.morphNormals = false; - - this.setValues( parameters ); - -} - -MeshStandardMaterial.prototype = Object.create( Material.prototype ); -MeshStandardMaterial.prototype.constructor = MeshStandardMaterial; - -MeshStandardMaterial.prototype.isMeshStandardMaterial = true; - -MeshStandardMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.defines = { 'STANDARD': '' }; - - this.color.copy( source.color ); - this.roughness = source.roughness; - this.metalness = source.metalness; - - this.map = source.map; - - this.lightMap = source.lightMap; - this.lightMapIntensity = source.lightMapIntensity; - - this.aoMap = source.aoMap; - this.aoMapIntensity = source.aoMapIntensity; - - this.emissive.copy( source.emissive ); - this.emissiveMap = source.emissiveMap; - this.emissiveIntensity = source.emissiveIntensity; - - this.bumpMap = source.bumpMap; - this.bumpScale = source.bumpScale; - - this.normalMap = source.normalMap; - this.normalMapType = source.normalMapType; - this.normalScale.copy( source.normalScale ); - - this.displacementMap = source.displacementMap; - this.displacementScale = source.displacementScale; - this.displacementBias = source.displacementBias; - - this.roughnessMap = source.roughnessMap; - - this.metalnessMap = source.metalnessMap; - - this.alphaMap = source.alphaMap; - - this.envMap = source.envMap; - this.envMapIntensity = source.envMapIntensity; - - this.refractionRatio = source.refractionRatio; - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - this.wireframeLinecap = source.wireframeLinecap; - this.wireframeLinejoin = source.wireframeLinejoin; - - this.skinning = source.skinning; - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - return this; - -}; - - -export { MeshStandardMaterial }; diff --git a/cases/esbuild-three/src/base/materials/MeshToonMaterial.d.ts b/cases/esbuild-three/src/base/materials/MeshToonMaterial.d.ts deleted file mode 100644 index 2dde05d558..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshToonMaterial.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Texture } from './../textures/Texture'; -import { MeshPhongMaterialParameters, MeshPhongMaterial } from './MeshPhongMaterial'; - -export interface MeshToonMaterialParameters extends MeshPhongMaterialParameters { - gradientMap?: Texture; -} - -export class MeshToonMaterial extends MeshPhongMaterial { - - constructor( parameters?: MeshToonMaterialParameters ); - - gradientMap: Texture | null; - - setValues( parameters: MeshToonMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/MeshToonMaterial.js b/cases/esbuild-three/src/base/materials/MeshToonMaterial.js deleted file mode 100644 index fbb77e1ef8..0000000000 --- a/cases/esbuild-three/src/base/materials/MeshToonMaterial.js +++ /dev/null @@ -1,41 +0,0 @@ -import { MeshPhongMaterial } from './MeshPhongMaterial.js'; - -/** - * @author takahirox / http://github.com/takahirox - * - * parameters = { - * gradientMap: new THREE.Texture( ) - * } - */ - -function MeshToonMaterial( parameters ) { - - MeshPhongMaterial.call( this ); - - this.defines = { 'TOON': '' }; - - this.type = 'MeshToonMaterial'; - - this.gradientMap = null; - - this.setValues( parameters ); - -} - -MeshToonMaterial.prototype = Object.create( MeshPhongMaterial.prototype ); -MeshToonMaterial.prototype.constructor = MeshToonMaterial; - -MeshToonMaterial.prototype.isMeshToonMaterial = true; - -MeshToonMaterial.prototype.copy = function ( source ) { - - MeshPhongMaterial.prototype.copy.call( this, source ); - - this.gradientMap = source.gradientMap; - - return this; - -}; - - -export { MeshToonMaterial }; diff --git a/cases/esbuild-three/src/base/materials/PointsMaterial.d.ts b/cases/esbuild-three/src/base/materials/PointsMaterial.d.ts deleted file mode 100644 index ede6df850c..0000000000 --- a/cases/esbuild-three/src/base/materials/PointsMaterial.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Material, MaterialParameters } from './Material'; -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; - -// MultiMaterial does not inherit the Material class in the original code. However, it should treat as Material class. -// See tests/canvas/canvas_materials.ts. -/** - * @deprecated Use an Array instead. - */ -export class MultiMaterial extends Material { - - constructor( materials?: Material[] ); - - isMultiMaterial: true; - - materials: Material[]; - - toJSON( meta: any ): any; - -} - -/** - * @deprecated Use {@link MultiMaterial} instead. - */ - -export interface PointsMaterialParameters extends MaterialParameters { - color?: Color | string | number; - map?: Texture; - size?: number; - sizeAttenuation?: boolean; -} - -export class PointsMaterial extends Material { - - constructor( parameters?: PointsMaterialParameters ); - - color: Color; - map: Texture | null; - size: number; - sizeAttenuation: boolean; - - setValues( parameters: PointsMaterialParameters ): void; - -} diff --git a/cases/esbuild-three/src/base/materials/PointsMaterial.js b/cases/esbuild-three/src/base/materials/PointsMaterial.js deleted file mode 100644 index ec4cae4e3a..0000000000 --- a/cases/esbuild-three/src/base/materials/PointsMaterial.js +++ /dev/null @@ -1,64 +0,0 @@ -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * size: , - * sizeAttenuation: - * - * morphTargets: - * } - */ - -function PointsMaterial( parameters ) { - - Material.call( this ); - - this.type = 'PointsMaterial'; - - this.color = new Color( 0xffffff ); - - this.map = null; - - this.size = 1; - this.sizeAttenuation = true; - - this.morphTargets = false; - - this.lights = false; - - this.setValues( parameters ); - -} - -PointsMaterial.prototype = Object.create( Material.prototype ); -PointsMaterial.prototype.constructor = PointsMaterial; - -PointsMaterial.prototype.isPointsMaterial = true; - -PointsMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - - this.map = source.map; - - this.size = source.size; - this.sizeAttenuation = source.sizeAttenuation; - - this.morphTargets = source.morphTargets; - - return this; - -}; - - -export { PointsMaterial }; diff --git a/cases/esbuild-three/src/base/materials/RawShaderMaterial.d.ts b/cases/esbuild-three/src/base/materials/RawShaderMaterial.d.ts deleted file mode 100644 index 24a279157b..0000000000 --- a/cases/esbuild-three/src/base/materials/RawShaderMaterial.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ShaderMaterialParameters, ShaderMaterial } from './ShaderMaterial'; - -export class RawShaderMaterial extends ShaderMaterial { - - constructor( parameters?: ShaderMaterialParameters ); - -} diff --git a/cases/esbuild-three/src/base/materials/RawShaderMaterial.js b/cases/esbuild-three/src/base/materials/RawShaderMaterial.js deleted file mode 100644 index 1f35bac9c3..0000000000 --- a/cases/esbuild-three/src/base/materials/RawShaderMaterial.js +++ /dev/null @@ -1,21 +0,0 @@ -import { ShaderMaterial } from './ShaderMaterial.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function RawShaderMaterial( parameters ) { - - ShaderMaterial.call( this, parameters ); - - this.type = 'RawShaderMaterial'; - -} - -RawShaderMaterial.prototype = Object.create( ShaderMaterial.prototype ); -RawShaderMaterial.prototype.constructor = RawShaderMaterial; - -RawShaderMaterial.prototype.isRawShaderMaterial = true; - - -export { RawShaderMaterial }; diff --git a/cases/esbuild-three/src/base/materials/ShaderMaterial.d.ts b/cases/esbuild-three/src/base/materials/ShaderMaterial.d.ts deleted file mode 100644 index 0bbe299655..0000000000 --- a/cases/esbuild-three/src/base/materials/ShaderMaterial.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ShaderMaterialParameters } from './ShaderMaterial'; -import { IUniform } from '../renderers/shaders/UniformsLib'; -import { MaterialParameters, Material } from './Material'; - -/** - * @deprecated Use {@link PointsMaterial THREE.PointsMaterial} instead - */ -/** - * @deprecated Use {@link PointsMaterial THREE.PointsMaterial} instead - */ -/** - * @deprecated Use {@link PointsMaterial THREE.PointsMaterial} instead - */ - -export interface ShaderMaterialParameters extends MaterialParameters { - defines?: any; - uniforms?: any; - vertexShader?: string; - fragmentShader?: string; - linewidth?: number; - wireframe?: boolean; - wireframeLinewidth?: number; - lights?: boolean; - clipping?: boolean; - skinning?: boolean; - morphTargets?: boolean; - morphNormals?: boolean; -} - -export class ShaderMaterial extends Material { - - constructor( parameters?: ShaderMaterialParameters ); - - defines: any; - uniforms: { [uniform: string]: IUniform }; - vertexShader: string; - fragmentShader: string; - linewidth: number; - wireframe: boolean; - wireframeLinewidth: number; - lights: boolean; - clipping: boolean; - skinning: boolean; - morphTargets: boolean; - morphNormals: boolean; - /** - * @deprecated Use {@link ShaderMaterial#extensions.derivatives extensions.derivatives} instead. - */ - derivatives: any; - extensions: { - derivatives: boolean; - fragDepth: boolean; - drawBuffers: boolean; - shaderTextureLOD: boolean; - }; - defaultAttributeValues: any; - index0AttributeName: string | undefined; - - setValues( parameters: ShaderMaterialParameters ): void; - toJSON( meta: any ): any; - -} diff --git a/cases/esbuild-three/src/base/materials/ShaderMaterial.js b/cases/esbuild-three/src/base/materials/ShaderMaterial.js deleted file mode 100644 index 533ddaec75..0000000000 --- a/cases/esbuild-three/src/base/materials/ShaderMaterial.js +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * defines: { "label" : "value" }, - * uniforms: { "parameter1": { value: 1.0 }, "parameter2": { value2: 2 } }, - * - * fragmentShader: , - * vertexShader: , - * - * wireframe: , - * wireframeLinewidth: , - * - * lights: , - * - * skinning: , - * morphTargets: , - * morphNormals: - * } - */ - -import { Material } from './Material.js'; -import { cloneUniforms } from '../renderers/shaders/UniformsUtils.js'; - -import default_vertex from '../renderers/shaders/ShaderChunk/default_vertex.glsl.js'; -import default_fragment from '../renderers/shaders/ShaderChunk/default_fragment.glsl.js'; - -function ShaderMaterial( parameters ) { - - Material.call( this ); - - this.type = 'ShaderMaterial'; - - this.defines = {}; - this.uniforms = {}; - - this.vertexShader = default_vertex; - this.fragmentShader = default_fragment; - - this.linewidth = 1; - - this.wireframe = false; - this.wireframeLinewidth = 1; - - this.fog = false; // set to use scene fog - this.lights = false; // set to use scene lights - this.clipping = false; // set to use user-defined clipping planes - - this.skinning = false; // set to use skinning attribute streams - this.morphTargets = false; // set to use morph targets - this.morphNormals = false; // set to use morph normals - - this.extensions = { - derivatives: false, // set to use derivatives - fragDepth: false, // set to use fragment depth values - drawBuffers: false, // set to use draw buffers - shaderTextureLOD: false // set to use shader texture LOD - }; - - // When rendered geometry doesn't include these attributes but the material does, - // use these default values in WebGL. This avoids errors when buffer data is missing. - this.defaultAttributeValues = { - 'color': [ 1, 1, 1 ], - 'uv': [ 0, 0 ], - 'uv2': [ 0, 0 ] - }; - - this.index0AttributeName = undefined; - this.uniformsNeedUpdate = false; - - if ( parameters !== undefined ) { - - if ( parameters.attributes !== undefined ) { - - console.error( 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.' ); - - } - - this.setValues( parameters ); - - } - -} - -ShaderMaterial.prototype = Object.create( Material.prototype ); -ShaderMaterial.prototype.constructor = ShaderMaterial; - -ShaderMaterial.prototype.isShaderMaterial = true; - -ShaderMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.fragmentShader = source.fragmentShader; - this.vertexShader = source.vertexShader; - - this.uniforms = cloneUniforms( source.uniforms ); - - this.defines = Object.assign( {}, source.defines ); - - this.wireframe = source.wireframe; - this.wireframeLinewidth = source.wireframeLinewidth; - - this.lights = source.lights; - this.clipping = source.clipping; - - this.skinning = source.skinning; - - this.morphTargets = source.morphTargets; - this.morphNormals = source.morphNormals; - - this.extensions = source.extensions; - - return this; - -}; - -ShaderMaterial.prototype.toJSON = function ( meta ) { - - var data = Material.prototype.toJSON.call( this, meta ); - - data.uniforms = {}; - - for ( var name in this.uniforms ) { - - var uniform = this.uniforms[ name ]; - var value = uniform.value; - - if ( value && value.isTexture ) { - - data.uniforms[ name ] = { - type: 't', - value: value.toJSON( meta ).uuid - }; - - } else if ( value && value.isColor ) { - - data.uniforms[ name ] = { - type: 'c', - value: value.getHex() - }; - - } else if ( value && value.isVector2 ) { - - data.uniforms[ name ] = { - type: 'v2', - value: value.toArray() - }; - - } else if ( value && value.isVector3 ) { - - data.uniforms[ name ] = { - type: 'v3', - value: value.toArray() - }; - - } else if ( value && value.isVector4 ) { - - data.uniforms[ name ] = { - type: 'v4', - value: value.toArray() - }; - - } else if ( value && value.isMatrix3 ) { - - data.uniforms[ name ] = { - type: 'm3', - value: value.toArray() - }; - - } else if ( value && value.isMatrix4 ) { - - data.uniforms[ name ] = { - type: 'm4', - value: value.toArray() - }; - - } else { - - data.uniforms[ name ] = { - value: value - }; - - // note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far - - } - - } - - if ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines; - - data.vertexShader = this.vertexShader; - data.fragmentShader = this.fragmentShader; - - var extensions = {}; - - for ( var key in this.extensions ) { - - if ( this.extensions[ key ] === true ) extensions[ key ] = true; - - } - - if ( Object.keys( extensions ).length > 0 ) data.extensions = extensions; - - return data; - -}; - - -export { ShaderMaterial }; diff --git a/cases/esbuild-three/src/base/materials/ShadowMaterial.d.ts b/cases/esbuild-three/src/base/materials/ShadowMaterial.d.ts deleted file mode 100644 index 4133c7e042..0000000000 --- a/cases/esbuild-three/src/base/materials/ShadowMaterial.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ShaderMaterialParameters, ShaderMaterial } from './ShaderMaterial'; - -export class ShadowMaterial extends ShaderMaterial { - - constructor( parameters?: ShaderMaterialParameters ); - -} diff --git a/cases/esbuild-three/src/base/materials/ShadowMaterial.js b/cases/esbuild-three/src/base/materials/ShadowMaterial.js deleted file mode 100644 index b4622c150a..0000000000 --- a/cases/esbuild-three/src/base/materials/ShadowMaterial.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * - * parameters = { - * color: - * } - */ - -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; - -function ShadowMaterial( parameters ) { - - Material.call( this ); - - this.type = 'ShadowMaterial'; - - this.color = new Color( 0x000000 ); - this.transparent = true; - - this.setValues( parameters ); - -} - -ShadowMaterial.prototype = Object.create( Material.prototype ); -ShadowMaterial.prototype.constructor = ShadowMaterial; - -ShadowMaterial.prototype.isShadowMaterial = true; - -ShadowMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - - return this; - -}; - - -export { ShadowMaterial }; diff --git a/cases/esbuild-three/src/base/materials/SpriteMaterial.d.ts b/cases/esbuild-three/src/base/materials/SpriteMaterial.d.ts deleted file mode 100644 index e58fe166b5..0000000000 --- a/cases/esbuild-three/src/base/materials/SpriteMaterial.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Color } from './../math/Color'; -import { Texture } from './../textures/Texture'; -import { MaterialParameters, Material } from './Material'; - -export interface SpriteMaterialParameters extends MaterialParameters { - color?: Color | string | number; - map?: Texture; - rotation?: number; - sizeAttenuation?: boolean; -} - -export class SpriteMaterial extends Material { - - constructor( parameters?: SpriteMaterialParameters ); - - color: Color; - map: Texture | null; - rotation: number; - sizeAttenuation: boolean; - isSpriteMaterial: true; - - setValues( parameters: SpriteMaterialParameters ): void; - copy( source: SpriteMaterial ): this; - -} diff --git a/cases/esbuild-three/src/base/materials/SpriteMaterial.js b/cases/esbuild-three/src/base/materials/SpriteMaterial.js deleted file mode 100644 index 73e9d52fa3..0000000000 --- a/cases/esbuild-three/src/base/materials/SpriteMaterial.js +++ /dev/null @@ -1,55 +0,0 @@ -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * map: new THREE.Texture( ), - * rotation: , - * sizeAttenuation: - * } - */ - -function SpriteMaterial( parameters ) { - - Material.call( this ); - - this.type = 'SpriteMaterial'; - - this.color = new Color( 0xffffff ); - this.map = null; - - this.rotation = 0; - - this.sizeAttenuation = true; - - this.lights = false; - this.transparent = true; - - this.setValues( parameters ); - -} - -SpriteMaterial.prototype = Object.create( Material.prototype ); -SpriteMaterial.prototype.constructor = SpriteMaterial; -SpriteMaterial.prototype.isSpriteMaterial = true; - -SpriteMaterial.prototype.copy = function ( source ) { - - Material.prototype.copy.call( this, source ); - - this.color.copy( source.color ); - this.map = source.map; - - this.rotation = source.rotation; - - this.sizeAttenuation = source.sizeAttenuation; - - return this; - -}; - - -export { SpriteMaterial }; diff --git a/cases/esbuild-three/src/base/math/Box2.d.ts b/cases/esbuild-three/src/base/math/Box2.d.ts deleted file mode 100644 index 49827ea918..0000000000 --- a/cases/esbuild-three/src/base/math/Box2.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Vector2 } from './Vector2'; - -// Math ////////////////////////////////////////////////////////////////////////////////// - -export class Box2 { - - constructor( min?: Vector2, max?: Vector2 ); - - max: Vector2; - min: Vector2; - - set( min: Vector2, max: Vector2 ): Box2; - setFromPoints( points: Vector2[] ): Box2; - setFromCenterAndSize( center: Vector2, size: Vector2 ): Box2; - clone(): this; - copy( box: Box2 ): this; - makeEmpty(): Box2; - isEmpty(): boolean; - getCenter( target: Vector2 ): Vector2; - getSize( target: Vector2 ): Vector2; - expandByPoint( point: Vector2 ): Box2; - expandByVector( vector: Vector2 ): Box2; - expandByScalar( scalar: number ): Box2; - containsPoint( point: Vector2 ): boolean; - containsBox( box: Box2 ): boolean; - getParameter( point: Vector2 ): Vector2; - intersectsBox( box: Box2 ): boolean; - clampPoint( point: Vector2, target: Vector2 ): Vector2; - distanceToPoint( point: Vector2 ): number; - intersect( box: Box2 ): Box2; - union( box: Box2 ): Box2; - translate( offset: Vector2 ): Box2; - equals( box: Box2 ): boolean; - /** - * @deprecated Use {@link Box2#isEmpty .isEmpty()} instead. - */ - empty(): any; - /** - * @deprecated Use {@link Box2#intersectsBox .intersectsBox()} instead. - */ - isIntersectionBox( b: any ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Box2.js b/cases/esbuild-three/src/base/math/Box2.js deleted file mode 100644 index c8e75b1117..0000000000 --- a/cases/esbuild-three/src/base/math/Box2.js +++ /dev/null @@ -1,234 +0,0 @@ -import { Vector2 } from './Vector2.js'; - -/** - * @author bhouston / http://clara.io - */ - -var _vector = new Vector2(); - -function Box2( min, max ) { - - this.min = ( min !== undefined ) ? min : new Vector2( + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector2( - Infinity, - Infinity ); - -} - -Object.assign( Box2.prototype, { - - set: function ( min, max ) { - - this.min.copy( min ); - this.max.copy( max ); - - return this; - - }, - - setFromPoints: function ( points ) { - - this.makeEmpty(); - - for ( var i = 0, il = points.length; i < il; i ++ ) { - - this.expandByPoint( points[ i ] ); - - } - - return this; - - }, - - setFromCenterAndSize: function ( center, size ) { - - var halfSize = _vector.copy( size ).multiplyScalar( 0.5 ); - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( box ) { - - this.min.copy( box.min ); - this.max.copy( box.max ); - - return this; - - }, - - makeEmpty: function () { - - this.min.x = this.min.y = + Infinity; - this.max.x = this.max.y = - Infinity; - - return this; - - }, - - isEmpty: function () { - - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ); - - }, - - getCenter: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box2: .getCenter() target is now required' ); - target = new Vector2(); - - } - - return this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - - }, - - getSize: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box2: .getSize() target is now required' ); - target = new Vector2(); - - } - - return this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min ); - - }, - - expandByPoint: function ( point ) { - - this.min.min( point ); - this.max.max( point ); - - return this; - - }, - - expandByVector: function ( vector ) { - - this.min.sub( vector ); - this.max.add( vector ); - - return this; - - }, - - expandByScalar: function ( scalar ) { - - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); - - return this; - - }, - - containsPoint: function ( point ) { - - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y ? false : true; - - }, - - containsBox: function ( box ) { - - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y; - - }, - - getParameter: function ( point, target ) { - - // This can potentially have a divide by zero if the box - // has a size dimension of 0. - - if ( target === undefined ) { - - console.warn( 'THREE.Box2: .getParameter() target is now required' ); - target = new Vector2(); - - } - - return target.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ) - ); - - }, - - intersectsBox: function ( box ) { - - // using 4 splitting planes to rule out intersections - - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y ? false : true; - - }, - - clampPoint: function ( point, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box2: .clampPoint() target is now required' ); - target = new Vector2(); - - } - - return target.copy( point ).clamp( this.min, this.max ); - - }, - - distanceToPoint: function ( point ) { - - var clampedPoint = _vector.copy( point ).clamp( this.min, this.max ); - return clampedPoint.sub( point ).length(); - - }, - - intersect: function ( box ) { - - this.min.max( box.min ); - this.max.min( box.max ); - - return this; - - }, - - union: function ( box ) { - - this.min.min( box.min ); - this.max.max( box.max ); - - return this; - - }, - - translate: function ( offset ) { - - this.min.add( offset ); - this.max.add( offset ); - - return this; - - }, - - equals: function ( box ) { - - return box.min.equals( this.min ) && box.max.equals( this.max ); - - } - -} ); - - -export { Box2 }; diff --git a/cases/esbuild-three/src/base/math/Box3.d.ts b/cases/esbuild-three/src/base/math/Box3.d.ts deleted file mode 100644 index 69008e6023..0000000000 --- a/cases/esbuild-three/src/base/math/Box3.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Object3D } from './../core/Object3D'; -import { Sphere } from './Sphere'; -import { Plane } from './Plane'; -import { Matrix4 } from './Matrix4'; -import { Triangle } from './Triangle'; - -export class Box3 { - - constructor( min?: Vector3, max?: Vector3 ); - - max: Vector3; - min: Vector3; - - set( min: Vector3, max: Vector3 ): this; - setFromArray( array: ArrayLike ): this; - setFromPoints( points: Vector3[] ): this; - setFromCenterAndSize( center: Vector3, size: Vector3 ): this; - setFromObject( object: Object3D ): this; - clone(): this; - copy( box: Box3 ): this; - makeEmpty(): this; - isEmpty(): boolean; - getCenter( target: Vector3 ): Vector3; - getSize( target: Vector3 ): Vector3; - expandByPoint( point: Vector3 ): this; - expandByVector( vector: Vector3 ): this; - expandByScalar( scalar: number ): this; - expandByObject( object: Object3D ): this; - containsPoint( point: Vector3 ): boolean; - containsBox( box: Box3 ): boolean; - getParameter( point: Vector3 ): Vector3; - intersectsBox( box: Box3 ): boolean; - intersectsSphere( sphere: Sphere ): boolean; - intersectsPlane( plane: Plane ): boolean; - intersectsTriangle( triangle: Triangle ): boolean; - clampPoint( point: Vector3, target: Vector3 ): Vector3; - distanceToPoint( point: Vector3 ): number; - getBoundingSphere( target: Sphere ): Sphere; - intersect( box: Box3 ): this; - union( box: Box3 ): this; - applyMatrix4( matrix: Matrix4 ): this; - translate( offset: Vector3 ): this; - equals( box: Box3 ): boolean; - /** - * @deprecated Use {@link Box3#isEmpty .isEmpty()} instead. - */ - empty(): any; - /** - * @deprecated Use {@link Box3#intersectsBox .intersectsBox()} instead. - */ - isIntersectionBox( b: any ): any; - /** - * @deprecated Use {@link Box3#intersectsSphere .intersectsSphere()} instead. - */ - isIntersectionSphere( s: any ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Box3.js b/cases/esbuild-three/src/base/math/Box3.js deleted file mode 100644 index eb1aea375c..0000000000 --- a/cases/esbuild-three/src/base/math/Box3.js +++ /dev/null @@ -1,581 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -var _points = [ - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3(), - new Vector3() -]; -var _vector = new Vector3(); - -// triangle centered vertices - -var _v0 = new Vector3(); -var _v1 = new Vector3(); -var _v2 = new Vector3(); - -// triangle edge vectors - -var _f0 = new Vector3(); -var _f1 = new Vector3(); -var _f2 = new Vector3(); - -var _center = new Vector3(); -var _extents = new Vector3(); -var _triangleNormal = new Vector3(); -var _testAxis = new Vector3(); - -/** - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - */ - -function Box3( min, max ) { - - this.min = ( min !== undefined ) ? min : new Vector3( + Infinity, + Infinity, + Infinity ); - this.max = ( max !== undefined ) ? max : new Vector3( - Infinity, - Infinity, - Infinity ); - -} - -Object.assign( Box3.prototype, { - - isBox3: true, - - set: function ( min, max ) { - - this.min.copy( min ); - this.max.copy( max ); - - return this; - - }, - - setFromArray: function ( array ) { - - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; - - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; - - for ( var i = 0, l = array.length; i < l; i += 3 ) { - - var x = array[ i ]; - var y = array[ i + 1 ]; - var z = array[ i + 2 ]; - - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; - - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; - - } - - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); - - return this; - - }, - - setFromBufferAttribute: function ( attribute ) { - - var minX = + Infinity; - var minY = + Infinity; - var minZ = + Infinity; - - var maxX = - Infinity; - var maxY = - Infinity; - var maxZ = - Infinity; - - for ( var i = 0, l = attribute.count; i < l; i ++ ) { - - var x = attribute.getX( i ); - var y = attribute.getY( i ); - var z = attribute.getZ( i ); - - if ( x < minX ) minX = x; - if ( y < minY ) minY = y; - if ( z < minZ ) minZ = z; - - if ( x > maxX ) maxX = x; - if ( y > maxY ) maxY = y; - if ( z > maxZ ) maxZ = z; - - } - - this.min.set( minX, minY, minZ ); - this.max.set( maxX, maxY, maxZ ); - - return this; - - }, - - setFromPoints: function ( points ) { - - this.makeEmpty(); - - for ( var i = 0, il = points.length; i < il; i ++ ) { - - this.expandByPoint( points[ i ] ); - - } - - return this; - - }, - - setFromCenterAndSize: function ( center, size ) { - - var halfSize = _vector.copy( size ).multiplyScalar( 0.5 ); - - this.min.copy( center ).sub( halfSize ); - this.max.copy( center ).add( halfSize ); - - return this; - - }, - - setFromObject: function ( object ) { - - this.makeEmpty(); - - return this.expandByObject( object ); - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( box ) { - - this.min.copy( box.min ); - this.max.copy( box.max ); - - return this; - - }, - - makeEmpty: function () { - - this.min.x = this.min.y = this.min.z = + Infinity; - this.max.x = this.max.y = this.max.z = - Infinity; - - return this; - - }, - - isEmpty: function () { - - // this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes - - return ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z ); - - }, - - getCenter: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box3: .getCenter() target is now required' ); - target = new Vector3(); - - } - - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 ); - - }, - - getSize: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box3: .getSize() target is now required' ); - target = new Vector3(); - - } - - return this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min ); - - }, - - expandByPoint: function ( point ) { - - this.min.min( point ); - this.max.max( point ); - - return this; - - }, - - expandByVector: function ( vector ) { - - this.min.sub( vector ); - this.max.add( vector ); - - return this; - - }, - - expandByScalar: function ( scalar ) { - - this.min.addScalar( - scalar ); - this.max.addScalar( scalar ); - - return this; - - }, - - expandByObject: function ( object ) { - - var i, l; - - // Computes the world-axis-aligned bounding box of an object (including its children), - // accounting for both the object's, and children's, world transforms - - object.updateWorldMatrix( false, false ); - - var geometry = object.geometry; - - if ( geometry !== undefined ) { - - if ( geometry.isGeometry ) { - - var vertices = geometry.vertices; - - for ( i = 0, l = vertices.length; i < l; i ++ ) { - - _vector.copy( vertices[ i ] ); - _vector.applyMatrix4( object.matrixWorld ); - - this.expandByPoint( _vector ); - - } - - } else if ( geometry.isBufferGeometry ) { - - var attribute = geometry.attributes.position; - - if ( attribute !== undefined ) { - - for ( i = 0, l = attribute.count; i < l; i ++ ) { - - _vector.fromBufferAttribute( attribute, i ).applyMatrix4( object.matrixWorld ); - - this.expandByPoint( _vector ); - - } - - } - - } - - } - - // - - var children = object.children; - - for ( i = 0, l = children.length; i < l; i ++ ) { - - this.expandByObject( children[ i ] ); - - } - - return this; - - }, - - containsPoint: function ( point ) { - - return point.x < this.min.x || point.x > this.max.x || - point.y < this.min.y || point.y > this.max.y || - point.z < this.min.z || point.z > this.max.z ? false : true; - - }, - - containsBox: function ( box ) { - - return this.min.x <= box.min.x && box.max.x <= this.max.x && - this.min.y <= box.min.y && box.max.y <= this.max.y && - this.min.z <= box.min.z && box.max.z <= this.max.z; - - }, - - getParameter: function ( point, target ) { - - // This can potentially have a divide by zero if the box - // has a size dimension of 0. - - if ( target === undefined ) { - - console.warn( 'THREE.Box3: .getParameter() target is now required' ); - target = new Vector3(); - - } - - return target.set( - ( point.x - this.min.x ) / ( this.max.x - this.min.x ), - ( point.y - this.min.y ) / ( this.max.y - this.min.y ), - ( point.z - this.min.z ) / ( this.max.z - this.min.z ) - ); - - }, - - intersectsBox: function ( box ) { - - // using 6 splitting planes to rule out intersections. - return box.max.x < this.min.x || box.min.x > this.max.x || - box.max.y < this.min.y || box.min.y > this.max.y || - box.max.z < this.min.z || box.min.z > this.max.z ? false : true; - - }, - - intersectsSphere: function ( sphere ) { - - // Find the point on the AABB closest to the sphere center. - this.clampPoint( sphere.center, _vector ); - - // If that point is inside the sphere, the AABB and sphere intersect. - return _vector.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius ); - - }, - - intersectsPlane: function ( plane ) { - - // We compute the minimum and maximum dot product values. If those values - // are on the same side (back or front) of the plane, then there is no intersection. - - var min, max; - - if ( plane.normal.x > 0 ) { - - min = plane.normal.x * this.min.x; - max = plane.normal.x * this.max.x; - - } else { - - min = plane.normal.x * this.max.x; - max = plane.normal.x * this.min.x; - - } - - if ( plane.normal.y > 0 ) { - - min += plane.normal.y * this.min.y; - max += plane.normal.y * this.max.y; - - } else { - - min += plane.normal.y * this.max.y; - max += plane.normal.y * this.min.y; - - } - - if ( plane.normal.z > 0 ) { - - min += plane.normal.z * this.min.z; - max += plane.normal.z * this.max.z; - - } else { - - min += plane.normal.z * this.max.z; - max += plane.normal.z * this.min.z; - - } - - return ( min <= - plane.constant && max >= - plane.constant ); - - }, - - intersectsTriangle: function ( triangle ) { - - if ( this.isEmpty() ) { - - return false; - - } - - // compute box center and extents - this.getCenter( _center ); - _extents.subVectors( this.max, _center ); - - // translate triangle to aabb origin - _v0.subVectors( triangle.a, _center ); - _v1.subVectors( triangle.b, _center ); - _v2.subVectors( triangle.c, _center ); - - // compute edge vectors for triangle - _f0.subVectors( _v1, _v0 ); - _f1.subVectors( _v2, _v1 ); - _f2.subVectors( _v0, _v2 ); - - // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb - // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation - // axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned) - var axes = [ - 0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y, - _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, - - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 - ]; - if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - - return false; - - } - - // test 3 face normals from the aabb - axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; - if ( ! satForAxes( axes, _v0, _v1, _v2, _extents ) ) { - - return false; - - } - - // finally testing the face normal of the triangle - // use already existing triangle edge vectors here - _triangleNormal.crossVectors( _f0, _f1 ); - axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; - - return satForAxes( axes, _v0, _v1, _v2, _extents ); - - }, - - clampPoint: function ( point, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Box3: .clampPoint() target is now required' ); - target = new Vector3(); - - } - - return target.copy( point ).clamp( this.min, this.max ); - - }, - - distanceToPoint: function ( point ) { - - var clampedPoint = _vector.copy( point ).clamp( this.min, this.max ); - - return clampedPoint.sub( point ).length(); - - }, - - getBoundingSphere: function ( target ) { - - if ( target === undefined ) { - - console.error( 'THREE.Box3: .getBoundingSphere() target is now required' ); - //target = new Sphere(); // removed to avoid cyclic dependency - - } - - this.getCenter( target.center ); - - target.radius = this.getSize( _vector ).length() * 0.5; - - return target; - - }, - - intersect: function ( box ) { - - this.min.max( box.min ); - this.max.min( box.max ); - - // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values. - if ( this.isEmpty() ) this.makeEmpty(); - - return this; - - }, - - union: function ( box ) { - - this.min.min( box.min ); - this.max.max( box.max ); - - return this; - - }, - - applyMatrix4: function ( matrix ) { - - // transform of empty box is an empty box. - if ( this.isEmpty() ) return this; - - // NOTE: I am using a binary pattern to specify all 2^3 combinations below - _points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000 - _points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001 - _points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010 - _points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011 - _points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100 - _points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101 - _points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110 - _points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111 - - this.setFromPoints( _points ); - - return this; - - }, - - translate: function ( offset ) { - - this.min.add( offset ); - this.max.add( offset ); - - return this; - - }, - - equals: function ( box ) { - - return box.min.equals( this.min ) && box.max.equals( this.max ); - - } - -} ); - -function satForAxes( axes, v0, v1, v2, extents ) { - - var i, j; - - for ( i = 0, j = axes.length - 3; i <= j; i += 3 ) { - - _testAxis.fromArray( axes, i ); - // project the aabb onto the seperating axis - var r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z ); - // project all 3 vertices of the triangle onto the seperating axis - var p0 = v0.dot( _testAxis ); - var p1 = v1.dot( _testAxis ); - var p2 = v2.dot( _testAxis ); - // actual test, basically see if either of the most extreme of the triangle points intersects r - if ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) { - - // points of the projected triangle are outside the projected half-length of the aabb - // the axis is seperating and we can exit - return false; - - } - - } - - return true; - -} - -export { Box3 }; diff --git a/cases/esbuild-three/src/base/math/Color.d.ts b/cases/esbuild-three/src/base/math/Color.d.ts deleted file mode 100644 index 94b3a712ac..0000000000 --- a/cases/esbuild-three/src/base/math/Color.d.ts +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @author Joe Pea / http://github.com/trusktr - */ - -export interface HSL { - h: number; - s: number; - l: number; -} - -/** - * Represents a color. See also {@link ColorUtils}. - * - * @example - * var color = new THREE.Color( 0xff0000 ); - * - * @see src/math/Color.js - */ -export class Color { - - constructor( color?: Color | string | number ); - constructor( r: number, g: number, b: number ); - - isColor: boolean; - - /** - * Red channel value between 0 and 1. Default is 1. - */ - r: number; - - /** - * Green channel value between 0 and 1. Default is 1. - */ - g: number; - - /** - * Blue channel value between 0 and 1. Default is 1. - */ - b: number; - - set( color: Color ): Color; - set( color: number ): Color; - set( color: string ): Color; - setScalar( scalar: number ): Color; - setHex( hex: number ): Color; - - /** - * Sets this color from RGB values. - * @param r Red channel value between 0 and 1. - * @param g Green channel value between 0 and 1. - * @param b Blue channel value between 0 and 1. - */ - setRGB( r: number, g: number, b: number ): Color; - - /** - * Sets this color from HSL values. - * Based on MochiKit implementation by Bob Ippolito. - * - * @param h Hue channel value between 0 and 1. - * @param s Saturation value channel between 0 and 1. - * @param l Value channel value between 0 and 1. - */ - setHSL( h: number, s: number, l: number ): Color; - - /** - * Sets this color from a CSS context style string. - * @param contextStyle Color in CSS context style format. - */ - setStyle( style: string ): Color; - - /** - * Clones this color. - */ - clone(): this; - - /** - * Copies given color. - * @param color Color to copy. - */ - copy( color: Color ): this; - - /** - * Copies given color making conversion from gamma to linear space. - * @param color Color to copy. - */ - copyGammaToLinear( color: Color, gammaFactor?: number ): Color; - - /** - * Copies given color making conversion from linear to gamma space. - * @param color Color to copy. - */ - copyLinearToGamma( color: Color, gammaFactor?: number ): Color; - - /** - * Converts this color from gamma to linear space. - */ - convertGammaToLinear( gammaFactor?: number ): Color; - - /** - * Converts this color from linear to gamma space. - */ - convertLinearToGamma( gammaFactor?: number ): Color; - - /** - * Copies given color making conversion from sRGB to linear space. - * @param color Color to copy. - */ - copySRGBToLinear( color: Color ): Color; - - /** - * Copies given color making conversion from linear to sRGB space. - * @param color Color to copy. - */ - copyLinearToSRGB( color: Color ): Color; - - /** - * Converts this color from sRGB to linear space. - */ - convertSRGBToLinear(): Color; - - /** - * Converts this color from linear to sRGB space. - */ - convertLinearToSRGB(): Color; - - /** - * Returns the hexadecimal value of this color. - */ - getHex(): number; - - /** - * Returns the string formated hexadecimal value of this color. - */ - getHexString(): string; - - getHSL( target: HSL ): HSL; - - /** - * Returns the value of this color in CSS context style. - * Example: rgb(r, g, b) - */ - getStyle(): string; - - offsetHSL( h: number, s: number, l: number ): this; - - add( color: Color ): this; - addColors( color1: Color, color2: Color ): this; - addScalar( s: number ): this; - sub( color: Color ): this; - multiply( color: Color ): this; - multiplyScalar( s: number ): this; - lerp( color: Color, alpha: number ): this; - lerpHSL( color: Color, alpha: number ): this; - equals( color: Color ): boolean; - - /** - * Sets this color's red, green and blue value from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets this color's red, green and blue value from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array [red, green, blue], or copies red, green and blue into the provided array. - * @param array (optional) array to store the color to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies red, green and blue into the provided array-like. - * @param array array-like to store the color to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( xyz: ArrayLike, offset?: number ): ArrayLike; - -} diff --git a/cases/esbuild-three/src/base/math/Color.js b/cases/esbuild-three/src/base/math/Color.js deleted file mode 100644 index e489d4c7ee..0000000000 --- a/cases/esbuild-three/src/base/math/Color.js +++ /dev/null @@ -1,584 +0,0 @@ -import { _Math } from './Math.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -var _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF, - 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2, - 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50, - 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B, - 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B, - 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F, - 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3, - 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222, - 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700, - 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4, - 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00, - 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3, - 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA, - 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32, - 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3, - 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC, - 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD, - 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6, - 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9, - 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F, - 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE, - 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA, - 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0, - 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 }; - -var _hslA = { h: 0, s: 0, l: 0 }; -var _hslB = { h: 0, s: 0, l: 0 }; - -function Color( r, g, b ) { - - if ( g === undefined && b === undefined ) { - - // r is THREE.Color, hex or string - return this.set( r ); - - } - - return this.setRGB( r, g, b ); - -} - -function hue2rgb( p, q, t ) { - - if ( t < 0 ) t += 1; - if ( t > 1 ) t -= 1; - if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t; - if ( t < 1 / 2 ) return q; - if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t ); - return p; - -} - -function SRGBToLinear( c ) { - - return ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 ); - -} - -function LinearToSRGB( c ) { - - return ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055; - -} - -Object.assign( Color.prototype, { - - isColor: true, - - r: 1, g: 1, b: 1, - - set: function ( value ) { - - if ( value && value.isColor ) { - - this.copy( value ); - - } else if ( typeof value === 'number' ) { - - this.setHex( value ); - - } else if ( typeof value === 'string' ) { - - this.setStyle( value ); - - } - - return this; - - }, - - setScalar: function ( scalar ) { - - this.r = scalar; - this.g = scalar; - this.b = scalar; - - return this; - - }, - - setHex: function ( hex ) { - - hex = Math.floor( hex ); - - this.r = ( hex >> 16 & 255 ) / 255; - this.g = ( hex >> 8 & 255 ) / 255; - this.b = ( hex & 255 ) / 255; - - return this; - - }, - - setRGB: function ( r, g, b ) { - - this.r = r; - this.g = g; - this.b = b; - - return this; - - }, - - setHSL: function ( h, s, l ) { - - // h,s,l ranges are in 0.0 - 1.0 - h = _Math.euclideanModulo( h, 1 ); - s = _Math.clamp( s, 0, 1 ); - l = _Math.clamp( l, 0, 1 ); - - if ( s === 0 ) { - - this.r = this.g = this.b = l; - - } else { - - var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s ); - var q = ( 2 * l ) - p; - - this.r = hue2rgb( q, p, h + 1 / 3 ); - this.g = hue2rgb( q, p, h ); - this.b = hue2rgb( q, p, h - 1 / 3 ); - - } - - return this; - - }, - - setStyle: function ( style ) { - - function handleAlpha( string ) { - - if ( string === undefined ) return; - - if ( parseFloat( string ) < 1 ) { - - console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' ); - - } - - } - - - var m; - - if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) { - - // rgb / hsl - - var color; - var name = m[ 1 ]; - var components = m[ 2 ]; - - switch ( name ) { - - case 'rgb': - case 'rgba': - - if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - - // rgb(255,0,0) rgba(255,0,0,0.5) - this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255; - this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255; - this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255; - - handleAlpha( color[ 5 ] ); - - return this; - - } - - if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - - // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) - this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100; - this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100; - this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100; - - handleAlpha( color[ 5 ] ); - - return this; - - } - - break; - - case 'hsl': - case 'hsla': - - if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) { - - // hsl(120,50%,50%) hsla(120,50%,50%,0.5) - var h = parseFloat( color[ 1 ] ) / 360; - var s = parseInt( color[ 2 ], 10 ) / 100; - var l = parseInt( color[ 3 ], 10 ) / 100; - - handleAlpha( color[ 5 ] ); - - return this.setHSL( h, s, l ); - - } - - break; - - } - - } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) { - - // hex color - - var hex = m[ 1 ]; - var size = hex.length; - - if ( size === 3 ) { - - // #ff0 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255; - - return this; - - } else if ( size === 6 ) { - - // #ff0000 - this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255; - this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255; - this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255; - - return this; - - } - - } - - if ( style && style.length > 0 ) { - - // color keywords - var hex = _colorKeywords[ style ]; - - if ( hex !== undefined ) { - - // red - this.setHex( hex ); - - } else { - - // unknown color - console.warn( 'THREE.Color: Unknown color ' + style ); - - } - - } - - return this; - - }, - - clone: function () { - - return new this.constructor( this.r, this.g, this.b ); - - }, - - copy: function ( color ) { - - this.r = color.r; - this.g = color.g; - this.b = color.b; - - return this; - - }, - - copyGammaToLinear: function ( color, gammaFactor ) { - - if ( gammaFactor === undefined ) gammaFactor = 2.0; - - this.r = Math.pow( color.r, gammaFactor ); - this.g = Math.pow( color.g, gammaFactor ); - this.b = Math.pow( color.b, gammaFactor ); - - return this; - - }, - - copyLinearToGamma: function ( color, gammaFactor ) { - - if ( gammaFactor === undefined ) gammaFactor = 2.0; - - var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0; - - this.r = Math.pow( color.r, safeInverse ); - this.g = Math.pow( color.g, safeInverse ); - this.b = Math.pow( color.b, safeInverse ); - - return this; - - }, - - convertGammaToLinear: function ( gammaFactor ) { - - this.copyGammaToLinear( this, gammaFactor ); - - return this; - - }, - - convertLinearToGamma: function ( gammaFactor ) { - - this.copyLinearToGamma( this, gammaFactor ); - - return this; - - }, - - copySRGBToLinear: function ( color ) { - - this.r = SRGBToLinear( color.r ); - this.g = SRGBToLinear( color.g ); - this.b = SRGBToLinear( color.b ); - - return this; - - }, - - copyLinearToSRGB: function ( color ) { - - this.r = LinearToSRGB( color.r ); - this.g = LinearToSRGB( color.g ); - this.b = LinearToSRGB( color.b ); - - return this; - - }, - - convertSRGBToLinear: function () { - - this.copySRGBToLinear( this ); - - return this; - - }, - - convertLinearToSRGB: function () { - - this.copyLinearToSRGB( this ); - - return this; - - }, - - getHex: function () { - - return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0; - - }, - - getHexString: function () { - - return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 ); - - }, - - getHSL: function ( target ) { - - // h,s,l ranges are in 0.0 - 1.0 - - if ( target === undefined ) { - - console.warn( 'THREE.Color: .getHSL() target is now required' ); - target = { h: 0, s: 0, l: 0 }; - - } - - var r = this.r, g = this.g, b = this.b; - - var max = Math.max( r, g, b ); - var min = Math.min( r, g, b ); - - var hue, saturation; - var lightness = ( min + max ) / 2.0; - - if ( min === max ) { - - hue = 0; - saturation = 0; - - } else { - - var delta = max - min; - - saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min ); - - switch ( max ) { - - case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break; - case g: hue = ( b - r ) / delta + 2; break; - case b: hue = ( r - g ) / delta + 4; break; - - } - - hue /= 6; - - } - - target.h = hue; - target.s = saturation; - target.l = lightness; - - return target; - - }, - - getStyle: function () { - - return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')'; - - }, - - offsetHSL: function ( h, s, l ) { - - this.getHSL( _hslA ); - - _hslA.h += h; _hslA.s += s; _hslA.l += l; - - this.setHSL( _hslA.h, _hslA.s, _hslA.l ); - - return this; - - }, - - add: function ( color ) { - - this.r += color.r; - this.g += color.g; - this.b += color.b; - - return this; - - }, - - addColors: function ( color1, color2 ) { - - this.r = color1.r + color2.r; - this.g = color1.g + color2.g; - this.b = color1.b + color2.b; - - return this; - - }, - - addScalar: function ( s ) { - - this.r += s; - this.g += s; - this.b += s; - - return this; - - }, - - sub: function ( color ) { - - this.r = Math.max( 0, this.r - color.r ); - this.g = Math.max( 0, this.g - color.g ); - this.b = Math.max( 0, this.b - color.b ); - - return this; - - }, - - multiply: function ( color ) { - - this.r *= color.r; - this.g *= color.g; - this.b *= color.b; - - return this; - - }, - - multiplyScalar: function ( s ) { - - this.r *= s; - this.g *= s; - this.b *= s; - - return this; - - }, - - lerp: function ( color, alpha ) { - - this.r += ( color.r - this.r ) * alpha; - this.g += ( color.g - this.g ) * alpha; - this.b += ( color.b - this.b ) * alpha; - - return this; - - }, - - lerpHSL: function ( color, alpha ) { - - this.getHSL( _hslA ); - color.getHSL( _hslB ); - - var h = _Math.lerp( _hslA.h, _hslB.h, alpha ); - var s = _Math.lerp( _hslA.s, _hslB.s, alpha ); - var l = _Math.lerp( _hslA.l, _hslB.l, alpha ); - - this.setHSL( h, s, l ); - - return this; - - }, - - equals: function ( c ) { - - return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - this.r = array[ offset ]; - this.g = array[ offset + 1 ]; - this.b = array[ offset + 2 ]; - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this.r; - array[ offset + 1 ] = this.g; - array[ offset + 2 ] = this.b; - - return array; - - }, - - toJSON: function () { - - return this.getHex(); - - } - -} ); - - -export { Color }; diff --git a/cases/esbuild-three/src/base/math/Cylindrical.d.ts b/cases/esbuild-three/src/base/math/Cylindrical.d.ts deleted file mode 100644 index 29fe5117c1..0000000000 --- a/cases/esbuild-three/src/base/math/Cylindrical.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Vector3 } from './Vector3'; - -export class Cylindrical { - - constructor( radius?: number, theta?: number, y?: number ); - - radius: number; - theta: number; - y: number; - - clone(): this; - copy( other: Cylindrical ): this; - set( radius: number, theta: number, y: number ): this; - setFromVector3( vec3: Vector3 ): this; - setFromCartesianCoords( x: number, y: number, z: number ): this; - -} diff --git a/cases/esbuild-three/src/base/math/Cylindrical.js b/cases/esbuild-three/src/base/math/Cylindrical.js deleted file mode 100644 index 8b7452f487..0000000000 --- a/cases/esbuild-three/src/base/math/Cylindrical.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - * - * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system - * - */ - -function Cylindrical( radius, theta, y ) { - - this.radius = ( radius !== undefined ) ? radius : 1.0; // distance from the origin to a point in the x-z plane - this.theta = ( theta !== undefined ) ? theta : 0; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis - this.y = ( y !== undefined ) ? y : 0; // height above the x-z plane - - return this; - -} - -Object.assign( Cylindrical.prototype, { - - set: function ( radius, theta, y ) { - - this.radius = radius; - this.theta = theta; - this.y = y; - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( other ) { - - this.radius = other.radius; - this.theta = other.theta; - this.y = other.y; - - return this; - - }, - - setFromVector3: function ( v ) { - - return this.setFromCartesianCoords( v.x, v.y, v.z ); - - }, - - setFromCartesianCoords: function ( x, y, z ) { - - this.radius = Math.sqrt( x * x + z * z ); - this.theta = Math.atan2( x, z ); - this.y = y; - - return this; - - } - -} ); - - -export { Cylindrical }; diff --git a/cases/esbuild-three/src/base/math/Euler.d.ts b/cases/esbuild-three/src/base/math/Euler.d.ts deleted file mode 100644 index e8e1b87417..0000000000 --- a/cases/esbuild-three/src/base/math/Euler.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Matrix4 } from './Matrix4'; -import { Quaternion } from './Quaternion'; -import { Vector3 } from './Vector3'; - -export class Euler { - - constructor( x?: number, y?: number, z?: number, order?: string ); - - x: number; - y: number; - z: number; - order: string; - _onChangeCallback: Function; - - set( x: number, y: number, z: number, order?: string ): Euler; - clone(): this; - copy( euler: Euler ): this; - setFromRotationMatrix( m: Matrix4, order?: string ): Euler; - setFromQuaternion( q: Quaternion, order?: string ): Euler; - setFromVector3( v: Vector3, order?: string ): Euler; - reorder( newOrder: string ): Euler; - equals( euler: Euler ): boolean; - fromArray( xyzo: any[] ): Euler; - toArray( array?: number[], offset?: number ): number[]; - toVector3( optionalResult?: Vector3 ): Vector3; - _onChange( callback: Function ): this; - - static RotationOrders: string[]; - static DefaultOrder: string; - -} diff --git a/cases/esbuild-three/src/base/math/Euler.js b/cases/esbuild-three/src/base/math/Euler.js deleted file mode 100644 index 76d70af137..0000000000 --- a/cases/esbuild-three/src/base/math/Euler.js +++ /dev/null @@ -1,343 +0,0 @@ -import { Quaternion } from './Quaternion.js'; -import { Vector3 } from './Vector3.js'; -import { Matrix4 } from './Matrix4.js'; -import { _Math } from './Math.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - */ - -var _matrix = new Matrix4(); -var _quaternion = new Quaternion(); - -function Euler( x, y, z, order ) { - - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._order = order || Euler.DefaultOrder; - -} - -Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]; - -Euler.DefaultOrder = 'XYZ'; - -Object.defineProperties( Euler.prototype, { - - x: { - - get: function () { - - return this._x; - - }, - - set: function ( value ) { - - this._x = value; - this._onChangeCallback(); - - } - - }, - - y: { - - get: function () { - - return this._y; - - }, - - set: function ( value ) { - - this._y = value; - this._onChangeCallback(); - - } - - }, - - z: { - - get: function () { - - return this._z; - - }, - - set: function ( value ) { - - this._z = value; - this._onChangeCallback(); - - } - - }, - - order: { - - get: function () { - - return this._order; - - }, - - set: function ( value ) { - - this._order = value; - this._onChangeCallback(); - - } - - } - -} ); - -Object.assign( Euler.prototype, { - - isEuler: true, - - set: function ( x, y, z, order ) { - - this._x = x; - this._y = y; - this._z = z; - this._order = order || this._order; - - this._onChangeCallback(); - - return this; - - }, - - clone: function () { - - return new this.constructor( this._x, this._y, this._z, this._order ); - - }, - - copy: function ( euler ) { - - this._x = euler._x; - this._y = euler._y; - this._z = euler._z; - this._order = euler._order; - - this._onChangeCallback(); - - return this; - - }, - - setFromRotationMatrix: function ( m, order, update ) { - - var clamp = _Math.clamp; - - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - - var te = m.elements; - var m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ]; - var m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ]; - var m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - - order = order || this._order; - - if ( order === 'XYZ' ) { - - this._y = Math.asin( clamp( m13, - 1, 1 ) ); - - if ( Math.abs( m13 ) < 0.9999999 ) { - - this._x = Math.atan2( - m23, m33 ); - this._z = Math.atan2( - m12, m11 ); - - } else { - - this._x = Math.atan2( m32, m22 ); - this._z = 0; - - } - - } else if ( order === 'YXZ' ) { - - this._x = Math.asin( - clamp( m23, - 1, 1 ) ); - - if ( Math.abs( m23 ) < 0.9999999 ) { - - this._y = Math.atan2( m13, m33 ); - this._z = Math.atan2( m21, m22 ); - - } else { - - this._y = Math.atan2( - m31, m11 ); - this._z = 0; - - } - - } else if ( order === 'ZXY' ) { - - this._x = Math.asin( clamp( m32, - 1, 1 ) ); - - if ( Math.abs( m32 ) < 0.9999999 ) { - - this._y = Math.atan2( - m31, m33 ); - this._z = Math.atan2( - m12, m22 ); - - } else { - - this._y = 0; - this._z = Math.atan2( m21, m11 ); - - } - - } else if ( order === 'ZYX' ) { - - this._y = Math.asin( - clamp( m31, - 1, 1 ) ); - - if ( Math.abs( m31 ) < 0.9999999 ) { - - this._x = Math.atan2( m32, m33 ); - this._z = Math.atan2( m21, m11 ); - - } else { - - this._x = 0; - this._z = Math.atan2( - m12, m22 ); - - } - - } else if ( order === 'YZX' ) { - - this._z = Math.asin( clamp( m21, - 1, 1 ) ); - - if ( Math.abs( m21 ) < 0.9999999 ) { - - this._x = Math.atan2( - m23, m22 ); - this._y = Math.atan2( - m31, m11 ); - - } else { - - this._x = 0; - this._y = Math.atan2( m13, m33 ); - - } - - } else if ( order === 'XZY' ) { - - this._z = Math.asin( - clamp( m12, - 1, 1 ) ); - - if ( Math.abs( m12 ) < 0.9999999 ) { - - this._x = Math.atan2( m32, m22 ); - this._y = Math.atan2( m13, m11 ); - - } else { - - this._x = Math.atan2( - m23, m33 ); - this._y = 0; - - } - - } else { - - console.warn( 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + order ); - - } - - this._order = order; - - if ( update !== false ) this._onChangeCallback(); - - return this; - - }, - - setFromQuaternion: function ( q, order, update ) { - - _matrix.makeRotationFromQuaternion( q ); - - return this.setFromRotationMatrix( _matrix, order, update ); - - }, - - setFromVector3: function ( v, order ) { - - return this.set( v.x, v.y, v.z, order || this._order ); - - }, - - reorder: function ( newOrder ) { - - // WARNING: this discards revolution information -bhouston - - _quaternion.setFromEuler( this ); - - return this.setFromQuaternion( _quaternion, newOrder ); - - }, - - equals: function ( euler ) { - - return ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order ); - - }, - - fromArray: function ( array ) { - - this._x = array[ 0 ]; - this._y = array[ 1 ]; - this._z = array[ 2 ]; - if ( array[ 3 ] !== undefined ) this._order = array[ 3 ]; - - this._onChangeCallback(); - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._order; - - return array; - - }, - - toVector3: function ( optionalResult ) { - - if ( optionalResult ) { - - return optionalResult.set( this._x, this._y, this._z ); - - } else { - - return new Vector3( this._x, this._y, this._z ); - - } - - }, - - _onChange: function ( callback ) { - - this._onChangeCallback = callback; - - return this; - - }, - - _onChangeCallback: function () {} - -} ); - - -export { Euler }; diff --git a/cases/esbuild-three/src/base/math/Frustum.d.ts b/cases/esbuild-three/src/base/math/Frustum.d.ts deleted file mode 100644 index 6689e1fa3e..0000000000 --- a/cases/esbuild-three/src/base/math/Frustum.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Plane } from './Plane'; -import { Matrix4 } from './Matrix4'; -import { Object3D } from './../core/Object3D'; -import { Sprite } from './../objects/Sprite'; -import { Sphere } from './Sphere'; -import { Box3 } from './Box3'; -import { Vector3 } from './Vector3'; - -/** - * Frustums are used to determine what is inside the camera's field of view. They help speed up the rendering process. - */ -export class Frustum { - - constructor( - p0?: Plane, - p1?: Plane, - p2?: Plane, - p3?: Plane, - p4?: Plane, - p5?: Plane - ); - - /** - * Array of 6 vectors. - */ - planes: Plane[]; - - set( - p0?: number, - p1?: number, - p2?: number, - p3?: number, - p4?: number, - p5?: number - ): Frustum; - clone(): this; - copy( frustum: Frustum ): this; - setFromMatrix( m: Matrix4 ): Frustum; - intersectsObject( object: Object3D ): boolean; - intersectsSprite( sprite: Sprite ): boolean; - intersectsSphere( sphere: Sphere ): boolean; - intersectsBox( box: Box3 ): boolean; - containsPoint( point: Vector3 ): boolean; - -} diff --git a/cases/esbuild-three/src/base/math/Frustum.js b/cases/esbuild-three/src/base/math/Frustum.js deleted file mode 100644 index 5451f62d95..0000000000 --- a/cases/esbuild-three/src/base/math/Frustum.js +++ /dev/null @@ -1,177 +0,0 @@ -import { Vector3 } from './Vector3.js'; -import { Sphere } from './Sphere.js'; -import { Plane } from './Plane.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author bhouston / http://clara.io - */ - -var _sphere = new Sphere(); -var _vector = new Vector3(); - -function Frustum( p0, p1, p2, p3, p4, p5 ) { - - this.planes = [ - - ( p0 !== undefined ) ? p0 : new Plane(), - ( p1 !== undefined ) ? p1 : new Plane(), - ( p2 !== undefined ) ? p2 : new Plane(), - ( p3 !== undefined ) ? p3 : new Plane(), - ( p4 !== undefined ) ? p4 : new Plane(), - ( p5 !== undefined ) ? p5 : new Plane() - - ]; - -} - -Object.assign( Frustum.prototype, { - - set: function ( p0, p1, p2, p3, p4, p5 ) { - - var planes = this.planes; - - planes[ 0 ].copy( p0 ); - planes[ 1 ].copy( p1 ); - planes[ 2 ].copy( p2 ); - planes[ 3 ].copy( p3 ); - planes[ 4 ].copy( p4 ); - planes[ 5 ].copy( p5 ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( frustum ) { - - var planes = this.planes; - - for ( var i = 0; i < 6; i ++ ) { - - planes[ i ].copy( frustum.planes[ i ] ); - - } - - return this; - - }, - - setFromMatrix: function ( m ) { - - var planes = this.planes; - var me = m.elements; - var me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ]; - var me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ]; - var me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ]; - var me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ]; - - planes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize(); - planes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize(); - planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize(); - planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize(); - planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); - planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); - - return this; - - }, - - intersectsObject: function ( object ) { - - var geometry = object.geometry; - - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - - _sphere.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld ); - - return this.intersectsSphere( _sphere ); - - }, - - intersectsSprite: function ( sprite ) { - - _sphere.center.set( 0, 0, 0 ); - _sphere.radius = 0.7071067811865476; - _sphere.applyMatrix4( sprite.matrixWorld ); - - return this.intersectsSphere( _sphere ); - - }, - - intersectsSphere: function ( sphere ) { - - var planes = this.planes; - var center = sphere.center; - var negRadius = - sphere.radius; - - for ( var i = 0; i < 6; i ++ ) { - - var distance = planes[ i ].distanceToPoint( center ); - - if ( distance < negRadius ) { - - return false; - - } - - } - - return true; - - }, - - intersectsBox: function ( box ) { - - var planes = this.planes; - - for ( var i = 0; i < 6; i ++ ) { - - var plane = planes[ i ]; - - // corner at max distance - - _vector.x = plane.normal.x > 0 ? box.max.x : box.min.x; - _vector.y = plane.normal.y > 0 ? box.max.y : box.min.y; - _vector.z = plane.normal.z > 0 ? box.max.z : box.min.z; - - if ( plane.distanceToPoint( _vector ) < 0 ) { - - return false; - - } - - } - - return true; - - }, - - containsPoint: function ( point ) { - - var planes = this.planes; - - for ( var i = 0; i < 6; i ++ ) { - - if ( planes[ i ].distanceToPoint( point ) < 0 ) { - - return false; - - } - - } - - return true; - - } - -} ); - - -export { Frustum }; diff --git a/cases/esbuild-three/src/base/math/Interpolant.d.ts b/cases/esbuild-three/src/base/math/Interpolant.d.ts deleted file mode 100644 index cd9f367d95..0000000000 --- a/cases/esbuild-three/src/base/math/Interpolant.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export abstract class Interpolant { - - constructor( - parameterPositions: any, - samplesValues: any, - sampleSize: number, - resultBuffer?: any - ); - - parameterPositions: any; - samplesValues: any; - valueSize: number; - resultBuffer: any; - - evaluate( time: number ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Interpolant.js b/cases/esbuild-three/src/base/math/Interpolant.js deleted file mode 100644 index 4fbe74bcbf..0000000000 --- a/cases/esbuild-three/src/base/math/Interpolant.js +++ /dev/null @@ -1,259 +0,0 @@ -/** - * Abstract base class of interpolants over parametric samples. - * - * The parameter domain is one dimensional, typically the time or a path - * along a curve defined by the data. - * - * The sample values can have any dimensionality and derived classes may - * apply special interpretations to the data. - * - * This class provides the interval seek in a Template Method, deferring - * the actual interpolation to derived classes. - * - * Time complexity is O(1) for linear access crossing at most two points - * and O(log N) for random access, where N is the number of positions. - * - * References: - * - * http://www.oodesign.com/template-method-pattern.html - * - * @author tschw - */ - -function Interpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - this.parameterPositions = parameterPositions; - this._cachedIndex = 0; - - this.resultBuffer = resultBuffer !== undefined ? - resultBuffer : new sampleValues.constructor( sampleSize ); - this.sampleValues = sampleValues; - this.valueSize = sampleSize; - -} - -Object.assign( Interpolant.prototype, { - - evaluate: function ( t ) { - - var pp = this.parameterPositions, - i1 = this._cachedIndex, - - t1 = pp[ i1 ], - t0 = pp[ i1 - 1 ]; - - validate_interval: { - - seek: { - - var right; - - linear_scan: { - - //- See http://jsperf.com/comparison-to-undefined/3 - //- slower code: - //- - //- if ( t >= t1 || t1 === undefined ) { - forward_scan: if ( ! ( t < t1 ) ) { - - for ( var giveUpAt = i1 + 2; ; ) { - - if ( t1 === undefined ) { - - if ( t < t0 ) break forward_scan; - - // after end - - i1 = pp.length; - this._cachedIndex = i1; - return this.afterEnd_( i1 - 1, t, t0 ); - - } - - if ( i1 === giveUpAt ) break; // this loop - - t0 = t1; - t1 = pp[ ++ i1 ]; - - if ( t < t1 ) { - - // we have arrived at the sought interval - break seek; - - } - - } - - // prepare binary search on the right side of the index - right = pp.length; - break linear_scan; - - } - - //- slower code: - //- if ( t < t0 || t0 === undefined ) { - if ( ! ( t >= t0 ) ) { - - // looping? - - var t1global = pp[ 1 ]; - - if ( t < t1global ) { - - i1 = 2; // + 1, using the scan for the details - t0 = t1global; - - } - - // linear reverse scan - - for ( var giveUpAt = i1 - 2; ; ) { - - if ( t0 === undefined ) { - - // before start - - this._cachedIndex = 0; - return this.beforeStart_( 0, t, t1 ); - - } - - if ( i1 === giveUpAt ) break; // this loop - - t1 = t0; - t0 = pp[ -- i1 - 1 ]; - - if ( t >= t0 ) { - - // we have arrived at the sought interval - break seek; - - } - - } - - // prepare binary search on the left side of the index - right = i1; - i1 = 0; - break linear_scan; - - } - - // the interval is valid - - break validate_interval; - - } // linear scan - - // binary search - - while ( i1 < right ) { - - var mid = ( i1 + right ) >>> 1; - - if ( t < pp[ mid ] ) { - - right = mid; - - } else { - - i1 = mid + 1; - - } - - } - - t1 = pp[ i1 ]; - t0 = pp[ i1 - 1 ]; - - // check boundary cases, again - - if ( t0 === undefined ) { - - this._cachedIndex = 0; - return this.beforeStart_( 0, t, t1 ); - - } - - if ( t1 === undefined ) { - - i1 = pp.length; - this._cachedIndex = i1; - return this.afterEnd_( i1 - 1, t0, t ); - - } - - } // seek - - this._cachedIndex = i1; - - this.intervalChanged_( i1, t0, t1 ); - - } // validate_interval - - return this.interpolate_( i1, t0, t, t1 ); - - }, - - settings: null, // optional, subclass-specific settings structure - // Note: The indirection allows central control of many interpolants. - - // --- Protected interface - - DefaultSettings_: {}, - - getSettings_: function () { - - return this.settings || this.DefaultSettings_; - - }, - - copySampleValue_: function ( index ) { - - // copies a sample value to the result buffer - - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, - offset = index * stride; - - for ( var i = 0; i !== stride; ++ i ) { - - result[ i ] = values[ offset + i ]; - - } - - return result; - - }, - - // Template methods for derived classes: - - interpolate_: function ( /* i1, t0, t, t1 */ ) { - - throw new Error( 'call to abstract method' ); - // implementations shall return this.resultBuffer - - }, - - intervalChanged_: function ( /* i1, t0, t1 */ ) { - - // empty - - } - -} ); - -//!\ DECLARE ALIAS AFTER assign prototype ! -Object.assign( Interpolant.prototype, { - - //( 0, t, t0 ), returns this.resultBuffer - beforeStart_: Interpolant.prototype.copySampleValue_, - - //( N-1, tN-1, t ), returns this.resultBuffer - afterEnd_: Interpolant.prototype.copySampleValue_, - -} ); - - -export { Interpolant }; diff --git a/cases/esbuild-three/src/base/math/Line3.d.ts b/cases/esbuild-three/src/base/math/Line3.d.ts deleted file mode 100644 index f4b9b1c026..0000000000 --- a/cases/esbuild-three/src/base/math/Line3.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Matrix4 } from './Matrix4'; - -export class Line3 { - - constructor( start?: Vector3, end?: Vector3 ); - - start: Vector3; - end: Vector3; - - set( start?: Vector3, end?: Vector3 ): Line3; - clone(): this; - copy( line: Line3 ): this; - getCenter( target: Vector3 ): Vector3; - delta( target: Vector3 ): Vector3; - distanceSq(): number; - distance(): number; - at( t: number, target: Vector3 ): Vector3; - closestPointToPointParameter( point: Vector3, clampToLine?: boolean ): number; - closestPointToPoint( - point: Vector3, - clampToLine: boolean, - target: Vector3 - ): Vector3; - applyMatrix4( matrix: Matrix4 ): Line3; - equals( line: Line3 ): boolean; - -} diff --git a/cases/esbuild-three/src/base/math/Line3.js b/cases/esbuild-three/src/base/math/Line3.js deleted file mode 100644 index be56b6d168..0000000000 --- a/cases/esbuild-three/src/base/math/Line3.js +++ /dev/null @@ -1,148 +0,0 @@ -import { Vector3 } from './Vector3.js'; -import { _Math } from './Math.js'; - -/** - * @author bhouston / http://clara.io - */ - -var _startP = new Vector3(); -var _startEnd = new Vector3(); - -function Line3( start, end ) { - - this.start = ( start !== undefined ) ? start : new Vector3(); - this.end = ( end !== undefined ) ? end : new Vector3(); - -} - -Object.assign( Line3.prototype, { - - set: function ( start, end ) { - - this.start.copy( start ); - this.end.copy( end ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( line ) { - - this.start.copy( line.start ); - this.end.copy( line.end ); - - return this; - - }, - - getCenter: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Line3: .getCenter() target is now required' ); - target = new Vector3(); - - } - - return target.addVectors( this.start, this.end ).multiplyScalar( 0.5 ); - - }, - - delta: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Line3: .delta() target is now required' ); - target = new Vector3(); - - } - - return target.subVectors( this.end, this.start ); - - }, - - distanceSq: function () { - - return this.start.distanceToSquared( this.end ); - - }, - - distance: function () { - - return this.start.distanceTo( this.end ); - - }, - - at: function ( t, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Line3: .at() target is now required' ); - target = new Vector3(); - - } - - return this.delta( target ).multiplyScalar( t ).add( this.start ); - - }, - - closestPointToPointParameter: function ( point, clampToLine ) { - - _startP.subVectors( point, this.start ); - _startEnd.subVectors( this.end, this.start ); - - var startEnd2 = _startEnd.dot( _startEnd ); - var startEnd_startP = _startEnd.dot( _startP ); - - var t = startEnd_startP / startEnd2; - - if ( clampToLine ) { - - t = _Math.clamp( t, 0, 1 ); - - } - - return t; - - }, - - closestPointToPoint: function ( point, clampToLine, target ) { - - var t = this.closestPointToPointParameter( point, clampToLine ); - - if ( target === undefined ) { - - console.warn( 'THREE.Line3: .closestPointToPoint() target is now required' ); - target = new Vector3(); - - } - - return this.delta( target ).multiplyScalar( t ).add( this.start ); - - }, - - applyMatrix4: function ( matrix ) { - - this.start.applyMatrix4( matrix ); - this.end.applyMatrix4( matrix ); - - return this; - - }, - - equals: function ( line ) { - - return line.start.equals( this.start ) && line.end.equals( this.end ); - - } - -} ); - - -export { Line3 }; diff --git a/cases/esbuild-three/src/base/math/Math.d.ts b/cases/esbuild-three/src/base/math/Math.d.ts deleted file mode 100644 index 23bbe8d3a1..0000000000 --- a/cases/esbuild-three/src/base/math/Math.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * - * @see src/math/Math.js - */ -export namespace _Math { - export const DEG2RAD: number; - export const RAD2DEG: number; - - export function generateUUID(): string; - - /** - * Clamps the x to be between a and b. - * - * @param value Value to be clamped. - * @param min Minimum value - * @param max Maximum value. - */ - export function clamp( value: number, min: number, max: number ): number; - export function euclideanModulo( n: number, m: number ): number; - - /** - * Linear mapping of x from range [a1, a2] to range [b1, b2]. - * - * @param x Value to be mapped. - * @param a1 Minimum value for range A. - * @param a2 Maximum value for range A. - * @param b1 Minimum value for range B. - * @param b2 Maximum value for range B. - */ - export function mapLinear( - x: number, - a1: number, - a2: number, - b1: number, - b2: number - ): number; - - export function smoothstep( x: number, min: number, max: number ): number; - - export function smootherstep( x: number, min: number, max: number ): number; - - /** - * Random float from 0 to 1 with 16 bits of randomness. - * Standard Math.random() creates repetitive patterns when applied over larger space. - * - * @deprecated Use {@link Math#random Math.random()} - */ - export function random16(): number; - - /** - * Random integer from low to high interval. - */ - export function randInt( low: number, high: number ): number; - - /** - * Random float from low to high interval. - */ - export function randFloat( low: number, high: number ): number; - - /** - * Random float from - range / 2 to range / 2 interval. - */ - export function randFloatSpread( range: number ): number; - - export function degToRad( degrees: number ): number; - - export function radToDeg( radians: number ): number; - - export function isPowerOfTwo( value: number ): boolean; - - /** - * Returns a value linearly interpolated from two known points based - * on the given interval - t = 0 will return x and t = 1 will return y. - * - * @param x Start point. - * @param y End point. - * @param t interpolation factor in the closed interval [0, 1] - * @return {number} - */ - export function lerp( x: number, y: number, t: number ): number; - - /** - * @deprecated Use {@link Math#floorPowerOfTwo .floorPowerOfTwo()} - */ - export function nearestPowerOfTwo( value: number ): number; - - /** - * @deprecated Use {@link Math#ceilPowerOfTwo .ceilPowerOfTwo()} - */ - export function nextPowerOfTwo( value: number ): number; - - export function floorPowerOfTwo( value: number ): number; - - export function ceilPowerOfTwo( value: number ): number; -} diff --git a/cases/esbuild-three/src/base/math/Math.js b/cases/esbuild-three/src/base/math/Math.js deleted file mode 100644 index 5925f68b10..0000000000 --- a/cases/esbuild-three/src/base/math/Math.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -var _lut = []; - -for ( var i = 0; i < 256; i ++ ) { - - _lut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 ); - -} - -var _Math = { - - DEG2RAD: Math.PI / 180, - RAD2DEG: 180 / Math.PI, - - generateUUID: function () { - - // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136 - - var d0 = Math.random() * 0xffffffff | 0; - var d1 = Math.random() * 0xffffffff | 0; - var d2 = Math.random() * 0xffffffff | 0; - var d3 = Math.random() * 0xffffffff | 0; - var uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' + - _lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' + - _lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] + - _lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ]; - - // .toUpperCase() here flattens concatenated strings to save heap memory space. - return uuid.toUpperCase(); - - }, - - clamp: function ( value, min, max ) { - - return Math.max( min, Math.min( max, value ) ); - - }, - - // compute euclidian modulo of m % n - // https://en.wikipedia.org/wiki/Modulo_operation - - euclideanModulo: function ( n, m ) { - - return ( ( n % m ) + m ) % m; - - }, - - // Linear mapping from range to range - - mapLinear: function ( x, a1, a2, b1, b2 ) { - - return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); - - }, - - // https://en.wikipedia.org/wiki/Linear_interpolation - - lerp: function ( x, y, t ) { - - return ( 1 - t ) * x + t * y; - - }, - - // http://en.wikipedia.org/wiki/Smoothstep - - smoothstep: function ( x, min, max ) { - - if ( x <= min ) return 0; - if ( x >= max ) return 1; - - x = ( x - min ) / ( max - min ); - - return x * x * ( 3 - 2 * x ); - - }, - - smootherstep: function ( x, min, max ) { - - if ( x <= min ) return 0; - if ( x >= max ) return 1; - - x = ( x - min ) / ( max - min ); - - return x * x * x * ( x * ( x * 6 - 15 ) + 10 ); - - }, - - // Random integer from interval - - randInt: function ( low, high ) { - - return low + Math.floor( Math.random() * ( high - low + 1 ) ); - - }, - - // Random float from interval - - randFloat: function ( low, high ) { - - return low + Math.random() * ( high - low ); - - }, - - // Random float from <-range/2, range/2> interval - - randFloatSpread: function ( range ) { - - return range * ( 0.5 - Math.random() ); - - }, - - degToRad: function ( degrees ) { - - return degrees * _Math.DEG2RAD; - - }, - - radToDeg: function ( radians ) { - - return radians * _Math.RAD2DEG; - - }, - - isPowerOfTwo: function ( value ) { - - return ( value & ( value - 1 ) ) === 0 && value !== 0; - - }, - - ceilPowerOfTwo: function ( value ) { - - return Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) ); - - }, - - floorPowerOfTwo: function ( value ) { - - return Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) ); - - } - -}; - - -export { _Math }; diff --git a/cases/esbuild-three/src/base/math/Matrix3.d.ts b/cases/esbuild-three/src/base/math/Matrix3.d.ts deleted file mode 100644 index 9879dfec95..0000000000 --- a/cases/esbuild-three/src/base/math/Matrix3.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { Matrix4 } from './Matrix4'; -import { BufferAttribute } from './../core/BufferAttribute'; -import { Vector3 } from './Vector3'; - -/** - * ( interface Matrix<T> ) - */ -export interface Matrix { - /** - * Array with matrix values. - */ - elements: number[]; - - /** - * identity():T; - */ - identity(): Matrix; - - /** - * copy(m:T):T; - */ - copy( m: this ): this; - - /** - * multiplyScalar(s:number):T; - */ - multiplyScalar( s: number ): Matrix; - - determinant(): number; - - /** - * getInverse(matrix:T, throwOnInvertible?:boolean):T; - */ - getInverse( matrix: Matrix, throwOnInvertible?: boolean ): Matrix; - - /** - * transpose():T; - */ - transpose(): Matrix; - - /** - * clone():T; - */ - clone(): this; -} - -/** - * ( class Matrix3 implements Matrix<Matrix3> ) - */ -export class Matrix3 implements Matrix { - - /** - * Creates an identity matrix. - */ - constructor(); - - /** - * Array with matrix values. - */ - elements: number[]; - - set( - n11: number, - n12: number, - n13: number, - n21: number, - n22: number, - n23: number, - n31: number, - n32: number, - n33: number - ): Matrix3; - identity(): Matrix3; - clone(): this; - copy( m: Matrix3 ): this; - setFromMatrix4( m: Matrix4 ): Matrix3; - - /** - * @deprecated Use {@link Matrix3#applyToBufferAttribute matrix3.applyToBufferAttribute( attribute )} instead. - */ - applyToBuffer( - buffer: BufferAttribute, - offset?: number, - length?: number - ): BufferAttribute; - - applyToBufferAttribute( attribute: BufferAttribute ): BufferAttribute; - - multiplyScalar( s: number ): Matrix3; - determinant(): number; - getInverse( matrix: Matrix3, throwOnDegenerate?: boolean ): Matrix3; - - /** - * Transposes this matrix in place. - */ - transpose(): Matrix3; - getNormalMatrix( matrix4: Matrix4 ): Matrix3; - - /** - * Transposes this matrix into the supplied array r, and returns itself. - */ - transposeIntoArray( r: number[] ): number[]; - - setUvTransform( tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number ): Matrix3; - - scale( sx: number, sy: number ): Matrix3; - - rotate( theta: number ): Matrix3; - - translate( tx: number, ty: number ): Matrix3; - - equals( matrix: Matrix3 ): boolean; - - /** - * Sets the values of this matrix from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): Matrix3; - - /** - * Sets the values of this matrix from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): Matrix3; - - /** - * Returns an array with the values of this matrix, or copies them into the provided array. - * @param array (optional) array to store the matrix to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies he values of this matrix into the provided array-like. - * @param array array-like to store the matrix to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( array?: ArrayLike, offset?: number ): ArrayLike; - - /** - * Multiplies this matrix by m. - */ - multiply( m: Matrix3 ): Matrix3; - - premultiply( m: Matrix3 ): Matrix3; - - /** - * Sets this matrix to a x b. - */ - multiplyMatrices( a: Matrix3, b: Matrix3 ): Matrix3; - - /** - * @deprecated Use {@link Vector3.applyMatrix3 vector.applyMatrix3( matrix )} instead. - */ - multiplyVector3( vector: Vector3 ): any; - - /** - * @deprecated This method has been removed completely. - */ - multiplyVector3Array( a: any ): any; - getInverse( matrix: Matrix4, throwOnDegenerate?: boolean ): Matrix3; - - /** - * @deprecated Use {@link Matrix3#toArray .toArray()} instead. - */ - flattenToArrayOffset( array: number[], offset: number ): number[]; - -} diff --git a/cases/esbuild-three/src/base/math/Matrix3.js b/cases/esbuild-three/src/base/math/Matrix3.js deleted file mode 100644 index 5654a8d9fc..0000000000 --- a/cases/esbuild-three/src/base/math/Matrix3.js +++ /dev/null @@ -1,384 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - * @author tschw - */ - -var _vector = new Vector3(); - -function Matrix3() { - - this.elements = [ - - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 - - ]; - - if ( arguments.length > 0 ) { - - console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' ); - - } - -} - -Object.assign( Matrix3.prototype, { - - isMatrix3: true, - - set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) { - - var te = this.elements; - - te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31; - te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32; - te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33; - - return this; - - }, - - identity: function () { - - this.set( - - 1, 0, 0, - 0, 1, 0, - 0, 0, 1 - - ); - - return this; - - }, - - clone: function () { - - return new this.constructor().fromArray( this.elements ); - - }, - - copy: function ( m ) { - - var te = this.elements; - var me = m.elements; - - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; - te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; - te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ]; - - return this; - - }, - - setFromMatrix4: function ( m ) { - - var me = m.elements; - - this.set( - - me[ 0 ], me[ 4 ], me[ 8 ], - me[ 1 ], me[ 5 ], me[ 9 ], - me[ 2 ], me[ 6 ], me[ 10 ] - - ); - - return this; - - }, - - applyToBufferAttribute: function ( attribute ) { - - for ( var i = 0, l = attribute.count; i < l; i ++ ) { - - _vector.x = attribute.getX( i ); - _vector.y = attribute.getY( i ); - _vector.z = attribute.getZ( i ); - - _vector.applyMatrix3( this ); - - attribute.setXYZ( i, _vector.x, _vector.y, _vector.z ); - - } - - return attribute; - - }, - - multiply: function ( m ) { - - return this.multiplyMatrices( this, m ); - - }, - - premultiply: function ( m ) { - - return this.multiplyMatrices( m, this ); - - }, - - multiplyMatrices: function ( a, b ) { - - var ae = a.elements; - var be = b.elements; - var te = this.elements; - - var a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ]; - var a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ]; - var a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ]; - - var b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ]; - var b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ]; - var b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ]; - - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31; - te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32; - te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33; - - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31; - te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32; - te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33; - - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31; - te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32; - te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33; - - return this; - - }, - - multiplyScalar: function ( s ) { - - var te = this.elements; - - te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s; - te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s; - te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s; - - return this; - - }, - - determinant: function () { - - var te = this.elements; - - var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ], - d = te[ 3 ], e = te[ 4 ], f = te[ 5 ], - g = te[ 6 ], h = te[ 7 ], i = te[ 8 ]; - - return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g; - - }, - - getInverse: function ( matrix, throwOnDegenerate ) { - - if ( matrix && matrix.isMatrix4 ) { - - console.error( "THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument." ); - - } - - var me = matrix.elements, - te = this.elements, - - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], - n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ], - n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ], - - t11 = n33 * n22 - n32 * n23, - t12 = n32 * n13 - n33 * n12, - t13 = n23 * n12 - n22 * n13, - - det = n11 * t11 + n21 * t12 + n31 * t13; - - if ( det === 0 ) { - - var msg = "THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0"; - - if ( throwOnDegenerate === true ) { - - throw new Error( msg ); - - } else { - - console.warn( msg ); - - } - - return this.identity(); - - } - - var detInv = 1 / det; - - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv; - te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv; - - te[ 3 ] = t12 * detInv; - te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv; - te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv; - - te[ 6 ] = t13 * detInv; - te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv; - te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv; - - return this; - - }, - - transpose: function () { - - var tmp, m = this.elements; - - tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp; - tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp; - tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp; - - return this; - - }, - - getNormalMatrix: function ( matrix4 ) { - - return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose(); - - }, - - transposeIntoArray: function ( r ) { - - var m = this.elements; - - r[ 0 ] = m[ 0 ]; - r[ 1 ] = m[ 3 ]; - r[ 2 ] = m[ 6 ]; - r[ 3 ] = m[ 1 ]; - r[ 4 ] = m[ 4 ]; - r[ 5 ] = m[ 7 ]; - r[ 6 ] = m[ 2 ]; - r[ 7 ] = m[ 5 ]; - r[ 8 ] = m[ 8 ]; - - return this; - - }, - - setUvTransform: function ( tx, ty, sx, sy, rotation, cx, cy ) { - - var c = Math.cos( rotation ); - var s = Math.sin( rotation ); - - this.set( - sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx, - - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty, - 0, 0, 1 - ); - - }, - - scale: function ( sx, sy ) { - - var te = this.elements; - - te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx; - te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy; - - return this; - - }, - - rotate: function ( theta ) { - - var c = Math.cos( theta ); - var s = Math.sin( theta ); - - var te = this.elements; - - var a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ]; - var a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ]; - - te[ 0 ] = c * a11 + s * a21; - te[ 3 ] = c * a12 + s * a22; - te[ 6 ] = c * a13 + s * a23; - - te[ 1 ] = - s * a11 + c * a21; - te[ 4 ] = - s * a12 + c * a22; - te[ 7 ] = - s * a13 + c * a23; - - return this; - - }, - - translate: function ( tx, ty ) { - - var te = this.elements; - - te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ]; - te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ]; - - return this; - - }, - - equals: function ( matrix ) { - - var te = this.elements; - var me = matrix.elements; - - for ( var i = 0; i < 9; i ++ ) { - - if ( te[ i ] !== me[ i ] ) return false; - - } - - return true; - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - for ( var i = 0; i < 9; i ++ ) { - - this.elements[ i ] = array[ i + offset ]; - - } - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - var te = this.elements; - - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; - - array[ offset + 3 ] = te[ 3 ]; - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; - - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; - array[ offset + 8 ] = te[ 8 ]; - - return array; - - } - -} ); - - -export { Matrix3 }; diff --git a/cases/esbuild-three/src/base/math/Matrix4.d.ts b/cases/esbuild-three/src/base/math/Matrix4.d.ts deleted file mode 100644 index 41dade6ab9..0000000000 --- a/cases/esbuild-three/src/base/math/Matrix4.d.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Euler } from './Euler'; -import { Quaternion } from './Quaternion'; -import { BufferAttribute } from './../core/BufferAttribute'; -import { Matrix } from './Matrix3'; -/** - * A 4x4 Matrix. - * - * @example - * // Simple rig for rotating around 3 axes - * var m = new THREE.Matrix4(); - * var m1 = new THREE.Matrix4(); - * var m2 = new THREE.Matrix4(); - * var m3 = new THREE.Matrix4(); - * var alpha = 0; - * var beta = Math.PI; - * var gamma = Math.PI/2; - * m1.makeRotationX( alpha ); - * m2.makeRotationY( beta ); - * m3.makeRotationZ( gamma ); - * m.multiplyMatrices( m1, m2 ); - * m.multiply( m3 ); - */ -export class Matrix4 implements Matrix { - - constructor(); - - /** - * Array with matrix values. - */ - elements: number[]; - - /** - * Sets all fields of this matrix. - */ - set( - n11: number, - n12: number, - n13: number, - n14: number, - n21: number, - n22: number, - n23: number, - n24: number, - n31: number, - n32: number, - n33: number, - n34: number, - n41: number, - n42: number, - n43: number, - n44: number - ): Matrix4; - - /** - * Resets this matrix to identity. - */ - identity(): Matrix4; - clone(): this; - copy( m: Matrix4 ): this; - copyPosition( m: Matrix4 ): Matrix4; - extractBasis( xAxis: Vector3, yAxis: Vector3, zAxis: Vector3 ): Matrix4; - makeBasis( xAxis: Vector3, yAxis: Vector3, zAxis: Vector3 ): Matrix4; - - /** - * Copies the rotation component of the supplied matrix m into this matrix rotation component. - */ - extractRotation( m: Matrix4 ): Matrix4; - makeRotationFromEuler( euler: Euler ): Matrix4; - makeRotationFromQuaternion( q: Quaternion ): Matrix4; - /** - * Constructs a rotation matrix, looking from eye towards center with defined up vector. - */ - lookAt( eye: Vector3, target: Vector3, up: Vector3 ): Matrix4; - - /** - * Multiplies this matrix by m. - */ - multiply( m: Matrix4 ): Matrix4; - - premultiply( m: Matrix4 ): Matrix4; - - /** - * Sets this matrix to a x b. - */ - multiplyMatrices( a: Matrix4, b: Matrix4 ): Matrix4; - - /** - * Sets this matrix to a x b and stores the result into the flat array r. - * r can be either a regular Array or a TypedArray. - * - * @deprecated This method has been removed completely. - */ - multiplyToArray( a: Matrix4, b: Matrix4, r: number[] ): Matrix4; - - /** - * Multiplies this matrix by s. - */ - multiplyScalar( s: number ): Matrix4; - - /** - * @deprecated Use {@link Matrix4#applyToBufferAttribute matrix4.applyToBufferAttribute( attribute )} instead. - */ - applyToBuffer( - buffer: BufferAttribute, - offset?: number, - length?: number - ): BufferAttribute; - - applyToBufferAttribute( attribute: BufferAttribute ): BufferAttribute; - - /** - * Computes determinant of this matrix. - * Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - */ - determinant(): number; - - /** - * Transposes this matrix. - */ - transpose(): Matrix4; - - /** - * Sets the position component for this matrix from vector v. - */ - setPosition( v: Vector3 | number, y?: number, z?: number ): Matrix4; - - /** - * Sets this matrix to the inverse of matrix m. - * Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm. - */ - getInverse( m: Matrix4, throwOnDegeneratee?: boolean ): Matrix4; - - /** - * Multiplies the columns of this matrix by vector v. - */ - scale( v: Vector3 ): Matrix4; - - getMaxScaleOnAxis(): number; - /** - * Sets this matrix as translation transform. - */ - makeTranslation( x: number, y: number, z: number ): Matrix4; - - /** - * Sets this matrix as rotation transform around x axis by theta radians. - * - * @param theta Rotation angle in radians. - */ - makeRotationX( theta: number ): Matrix4; - - /** - * Sets this matrix as rotation transform around y axis by theta radians. - * - * @param theta Rotation angle in radians. - */ - makeRotationY( theta: number ): Matrix4; - - /** - * Sets this matrix as rotation transform around z axis by theta radians. - * - * @param theta Rotation angle in radians. - */ - makeRotationZ( theta: number ): Matrix4; - - /** - * Sets this matrix as rotation transform around axis by angle radians. - * Based on http://www.gamedev.net/reference/articles/article1199.asp. - * - * @param axis Rotation axis. - * @param theta Rotation angle in radians. - */ - makeRotationAxis( axis: Vector3, angle: number ): Matrix4; - - /** - * Sets this matrix as scale transform. - */ - makeScale( x: number, y: number, z: number ): Matrix4; - - /** - * Sets this matrix to the transformation composed of translation, rotation and scale. - */ - compose( translation: Vector3, rotation: Quaternion, scale: Vector3 ): Matrix4; - - /** - * Decomposes this matrix into the translation, rotation and scale components. - * If parameters are not passed, new instances will be created. - */ - decompose( - translation?: Vector3, - rotation?: Quaternion, - scale?: Vector3 - ): Object[]; // [Vector3, Quaternion, Vector3] - - /** - * Creates a frustum matrix. - */ - makePerspective( - left: number, - right: number, - bottom: number, - top: number, - near: number, - far: number - ): Matrix4; - - /** - * Creates a perspective projection matrix. - */ - makePerspective( - fov: number, - aspect: number, - near: number, - far: number - ): Matrix4; - - /** - * Creates an orthographic projection matrix. - */ - makeOrthographic( - left: number, - right: number, - top: number, - bottom: number, - near: number, - far: number - ): Matrix4; - equals( matrix: Matrix4 ): boolean; - - /** - * Sets the values of this matrix from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): Matrix4; - - /** - * Sets the values of this matrix from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): Matrix4; - - /** - * Returns an array with the values of this matrix, or copies them into the provided array. - * @param array (optional) array to store the matrix to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies he values of this matrix into the provided array-like. - * @param array array-like to store the matrix to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( array?: ArrayLike, offset?: number ): ArrayLike; - - /** - * @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead. - */ - extractPosition( m: Matrix4 ): Matrix4; - - /** - * @deprecated Use {@link Matrix4#makeRotationFromQuaternion .makeRotationFromQuaternion()} instead. - */ - setRotationFromQuaternion( q: Quaternion ): Matrix4; - - /** - * @deprecated Use {@link Vector3#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - multiplyVector3( v: any ): any; - - /** - * @deprecated Use {@link Vector4#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - multiplyVector4( v: any ): any; - - /** - * @deprecated This method has been removed completely. - */ - multiplyVector3Array( array: number[] ): number[]; - - /** - * @deprecated Use {@link Vector3#transformDirection Vector3.transformDirection( matrix )} instead. - */ - rotateAxis( v: any ): void; - - /** - * @deprecated Use {@link Vector3#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - crossVector( v: any ): void; - - /** - * @deprecated Use {@link Matrix4#toArray .toArray()} instead. - */ - flattenToArrayOffset( array: number[], offset: number ): number[]; - -} diff --git a/cases/esbuild-three/src/base/math/Matrix4.js b/cases/esbuild-three/src/base/math/Matrix4.js deleted file mode 100644 index b0d92b3b93..0000000000 --- a/cases/esbuild-three/src/base/math/Matrix4.js +++ /dev/null @@ -1,922 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -var _v1 = new Vector3(); -var _m1 = new Matrix4(); -var _zero = new Vector3( 0, 0, 0 ); -var _one = new Vector3( 1, 1, 1 ); -var _x = new Vector3(); -var _y = new Vector3(); -var _z = new Vector3(); - -/** - * @author mrdoob / http://mrdoob.com/ - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author jordi_ros / http://plattsoft.com - * @author D1plo1d / http://github.com/D1plo1d - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author timknip / http://www.floorplanner.com/ - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - */ - -function Matrix4() { - - this.elements = [ - - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - - ]; - - if ( arguments.length > 0 ) { - - console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' ); - - } - -} - -Object.assign( Matrix4.prototype, { - - isMatrix4: true, - - set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - - var te = this.elements; - - te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14; - te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24; - te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34; - te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44; - - return this; - - }, - - identity: function () { - - this.set( - - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - clone: function () { - - return new Matrix4().fromArray( this.elements ); - - }, - - copy: function ( m ) { - - var te = this.elements; - var me = m.elements; - - te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ]; - te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; - te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ]; - te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ]; - - return this; - - }, - - copyPosition: function ( m ) { - - var te = this.elements, me = m.elements; - - te[ 12 ] = me[ 12 ]; - te[ 13 ] = me[ 13 ]; - te[ 14 ] = me[ 14 ]; - - return this; - - }, - - extractBasis: function ( xAxis, yAxis, zAxis ) { - - xAxis.setFromMatrixColumn( this, 0 ); - yAxis.setFromMatrixColumn( this, 1 ); - zAxis.setFromMatrixColumn( this, 2 ); - - return this; - - }, - - makeBasis: function ( xAxis, yAxis, zAxis ) { - - this.set( - xAxis.x, yAxis.x, zAxis.x, 0, - xAxis.y, yAxis.y, zAxis.y, 0, - xAxis.z, yAxis.z, zAxis.z, 0, - 0, 0, 0, 1 - ); - - return this; - - }, - - extractRotation: function ( m ) { - - // this method does not support reflection matrices - - var te = this.elements; - var me = m.elements; - - var scaleX = 1 / _v1.setFromMatrixColumn( m, 0 ).length(); - var scaleY = 1 / _v1.setFromMatrixColumn( m, 1 ).length(); - var scaleZ = 1 / _v1.setFromMatrixColumn( m, 2 ).length(); - - te[ 0 ] = me[ 0 ] * scaleX; - te[ 1 ] = me[ 1 ] * scaleX; - te[ 2 ] = me[ 2 ] * scaleX; - te[ 3 ] = 0; - - te[ 4 ] = me[ 4 ] * scaleY; - te[ 5 ] = me[ 5 ] * scaleY; - te[ 6 ] = me[ 6 ] * scaleY; - te[ 7 ] = 0; - - te[ 8 ] = me[ 8 ] * scaleZ; - te[ 9 ] = me[ 9 ] * scaleZ; - te[ 10 ] = me[ 10 ] * scaleZ; - te[ 11 ] = 0; - - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; - - return this; - - }, - - makeRotationFromEuler: function ( euler ) { - - if ( ! ( euler && euler.isEuler ) ) { - - console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' ); - - } - - var te = this.elements; - - var x = euler.x, y = euler.y, z = euler.z; - var a = Math.cos( x ), b = Math.sin( x ); - var c = Math.cos( y ), d = Math.sin( y ); - var e = Math.cos( z ), f = Math.sin( z ); - - if ( euler.order === 'XYZ' ) { - - var ae = a * e, af = a * f, be = b * e, bf = b * f; - - te[ 0 ] = c * e; - te[ 4 ] = - c * f; - te[ 8 ] = d; - - te[ 1 ] = af + be * d; - te[ 5 ] = ae - bf * d; - te[ 9 ] = - b * c; - - te[ 2 ] = bf - ae * d; - te[ 6 ] = be + af * d; - te[ 10 ] = a * c; - - } else if ( euler.order === 'YXZ' ) { - - var ce = c * e, cf = c * f, de = d * e, df = d * f; - - te[ 0 ] = ce + df * b; - te[ 4 ] = de * b - cf; - te[ 8 ] = a * d; - - te[ 1 ] = a * f; - te[ 5 ] = a * e; - te[ 9 ] = - b; - - te[ 2 ] = cf * b - de; - te[ 6 ] = df + ce * b; - te[ 10 ] = a * c; - - } else if ( euler.order === 'ZXY' ) { - - var ce = c * e, cf = c * f, de = d * e, df = d * f; - - te[ 0 ] = ce - df * b; - te[ 4 ] = - a * f; - te[ 8 ] = de + cf * b; - - te[ 1 ] = cf + de * b; - te[ 5 ] = a * e; - te[ 9 ] = df - ce * b; - - te[ 2 ] = - a * d; - te[ 6 ] = b; - te[ 10 ] = a * c; - - } else if ( euler.order === 'ZYX' ) { - - var ae = a * e, af = a * f, be = b * e, bf = b * f; - - te[ 0 ] = c * e; - te[ 4 ] = be * d - af; - te[ 8 ] = ae * d + bf; - - te[ 1 ] = c * f; - te[ 5 ] = bf * d + ae; - te[ 9 ] = af * d - be; - - te[ 2 ] = - d; - te[ 6 ] = b * c; - te[ 10 ] = a * c; - - } else if ( euler.order === 'YZX' ) { - - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; - - te[ 0 ] = c * e; - te[ 4 ] = bd - ac * f; - te[ 8 ] = bc * f + ad; - - te[ 1 ] = f; - te[ 5 ] = a * e; - te[ 9 ] = - b * e; - - te[ 2 ] = - d * e; - te[ 6 ] = ad * f + bc; - te[ 10 ] = ac - bd * f; - - } else if ( euler.order === 'XZY' ) { - - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; - - te[ 0 ] = c * e; - te[ 4 ] = - f; - te[ 8 ] = d * e; - - te[ 1 ] = ac * f + bd; - te[ 5 ] = a * e; - te[ 9 ] = ad * f - bc; - - te[ 2 ] = bc * f - ad; - te[ 6 ] = b * e; - te[ 10 ] = bd * f + ac; - - } - - // bottom row - te[ 3 ] = 0; - te[ 7 ] = 0; - te[ 11 ] = 0; - - // last column - te[ 12 ] = 0; - te[ 13 ] = 0; - te[ 14 ] = 0; - te[ 15 ] = 1; - - return this; - - }, - - makeRotationFromQuaternion: function ( q ) { - - return this.compose( _zero, q, _one ); - - }, - - lookAt: function ( eye, target, up ) { - - var te = this.elements; - - _z.subVectors( eye, target ); - - if ( _z.lengthSq() === 0 ) { - - // eye and target are in the same position - - _z.z = 1; - - } - - _z.normalize(); - _x.crossVectors( up, _z ); - - if ( _x.lengthSq() === 0 ) { - - // up and z are parallel - - if ( Math.abs( up.z ) === 1 ) { - - _z.x += 0.0001; - - } else { - - _z.z += 0.0001; - - } - - _z.normalize(); - _x.crossVectors( up, _z ); - - } - - _x.normalize(); - _y.crossVectors( _z, _x ); - - te[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x; - te[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y; - te[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z; - - return this; - - }, - - multiply: function ( m, n ) { - - if ( n !== undefined ) { - - console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' ); - return this.multiplyMatrices( m, n ); - - } - - return this.multiplyMatrices( this, m ); - - }, - - premultiply: function ( m ) { - - return this.multiplyMatrices( m, this ); - - }, - - multiplyMatrices: function ( a, b ) { - - var ae = a.elements; - var be = b.elements; - var te = this.elements; - - var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ]; - var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ]; - var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ]; - var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ]; - - var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ]; - var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ]; - var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ]; - var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ]; - - te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - - te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - - te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - - te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - - return this; - - }, - - multiplyScalar: function ( s ) { - - var te = this.elements; - - te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s; - te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s; - te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s; - te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s; - - return this; - - }, - - applyToBufferAttribute: function ( attribute ) { - - for ( var i = 0, l = attribute.count; i < l; i ++ ) { - - _v1.x = attribute.getX( i ); - _v1.y = attribute.getY( i ); - _v1.z = attribute.getZ( i ); - - _v1.applyMatrix4( this ); - - attribute.setXYZ( i, _v1.x, _v1.y, _v1.z ); - - } - - return attribute; - - }, - - determinant: function () { - - var te = this.elements; - - var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ]; - var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ]; - var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ]; - var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ]; - - //TODO: make this more efficient - //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) - - return ( - n41 * ( - + n14 * n23 * n32 - - n13 * n24 * n32 - - n14 * n22 * n33 - + n12 * n24 * n33 - + n13 * n22 * n34 - - n12 * n23 * n34 - ) + - n42 * ( - + n11 * n23 * n34 - - n11 * n24 * n33 - + n14 * n21 * n33 - - n13 * n21 * n34 - + n13 * n24 * n31 - - n14 * n23 * n31 - ) + - n43 * ( - + n11 * n24 * n32 - - n11 * n22 * n34 - - n14 * n21 * n32 - + n12 * n21 * n34 - + n14 * n22 * n31 - - n12 * n24 * n31 - ) + - n44 * ( - - n13 * n22 * n31 - - n11 * n23 * n32 - + n11 * n22 * n33 - + n13 * n21 * n32 - - n12 * n21 * n33 - + n12 * n23 * n31 - ) - - ); - - }, - - transpose: function () { - - var te = this.elements; - var tmp; - - tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp; - tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp; - tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp; - - tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp; - tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp; - tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp; - - return this; - - }, - - setPosition: function ( x, y, z ) { - - var te = this.elements; - - if ( x.isVector3 ) { - - te[ 12 ] = x.x; - te[ 13 ] = x.y; - te[ 14 ] = x.z; - - } else { - - te[ 12 ] = x; - te[ 13 ] = y; - te[ 14 ] = z; - - } - - return this; - - }, - - getInverse: function ( m, throwOnDegenerate ) { - - // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - var te = this.elements, - me = m.elements, - - n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ], - n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ], - n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ], - n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ], - - t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, - t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, - t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, - t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - - var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14; - - if ( det === 0 ) { - - var msg = "THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0"; - - if ( throwOnDegenerate === true ) { - - throw new Error( msg ); - - } else { - - console.warn( msg ); - - } - - return this.identity(); - - } - - var detInv = 1 / det; - - te[ 0 ] = t11 * detInv; - te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv; - te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv; - te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv; - - te[ 4 ] = t12 * detInv; - te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv; - te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv; - te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv; - - te[ 8 ] = t13 * detInv; - te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv; - te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv; - te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv; - - te[ 12 ] = t14 * detInv; - te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv; - te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv; - te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv; - - return this; - - }, - - scale: function ( v ) { - - var te = this.elements; - var x = v.x, y = v.y, z = v.z; - - te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z; - te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z; - te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z; - te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z; - - return this; - - }, - - getMaxScaleOnAxis: function () { - - var te = this.elements; - - var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ]; - var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ]; - var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ]; - - return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) ); - - }, - - makeTranslation: function ( x, y, z ) { - - this.set( - - 1, 0, 0, x, - 0, 1, 0, y, - 0, 0, 1, z, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeRotationX: function ( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - 1, 0, 0, 0, - 0, c, - s, 0, - 0, s, c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeRotationY: function ( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - c, 0, s, 0, - 0, 1, 0, 0, - - s, 0, c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeRotationZ: function ( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - c, - s, 0, 0, - s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeRotationAxis: function ( axis, angle ) { - - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos( angle ); - var s = Math.sin( angle ); - var t = 1 - c; - var x = axis.x, y = axis.y, z = axis.z; - var tx = t * x, ty = t * y; - - this.set( - - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeScale: function ( x, y, z ) { - - this.set( - - x, 0, 0, 0, - 0, y, 0, 0, - 0, 0, z, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - makeShear: function ( x, y, z ) { - - this.set( - - 1, y, z, 0, - x, 1, z, 0, - x, y, 1, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - compose: function ( position, quaternion, scale ) { - - var te = this.elements; - - var x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w; - var x2 = x + x, y2 = y + y, z2 = z + z; - var xx = x * x2, xy = x * y2, xz = x * z2; - var yy = y * y2, yz = y * z2, zz = z * z2; - var wx = w * x2, wy = w * y2, wz = w * z2; - - var sx = scale.x, sy = scale.y, sz = scale.z; - - te[ 0 ] = ( 1 - ( yy + zz ) ) * sx; - te[ 1 ] = ( xy + wz ) * sx; - te[ 2 ] = ( xz - wy ) * sx; - te[ 3 ] = 0; - - te[ 4 ] = ( xy - wz ) * sy; - te[ 5 ] = ( 1 - ( xx + zz ) ) * sy; - te[ 6 ] = ( yz + wx ) * sy; - te[ 7 ] = 0; - - te[ 8 ] = ( xz + wy ) * sz; - te[ 9 ] = ( yz - wx ) * sz; - te[ 10 ] = ( 1 - ( xx + yy ) ) * sz; - te[ 11 ] = 0; - - te[ 12 ] = position.x; - te[ 13 ] = position.y; - te[ 14 ] = position.z; - te[ 15 ] = 1; - - return this; - - }, - - decompose: function ( position, quaternion, scale ) { - - var te = this.elements; - - var sx = _v1.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length(); - var sy = _v1.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length(); - var sz = _v1.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length(); - - // if determine is negative, we need to invert one scale - var det = this.determinant(); - if ( det < 0 ) sx = - sx; - - position.x = te[ 12 ]; - position.y = te[ 13 ]; - position.z = te[ 14 ]; - - // scale the rotation part - _m1.copy( this ); - - var invSX = 1 / sx; - var invSY = 1 / sy; - var invSZ = 1 / sz; - - _m1.elements[ 0 ] *= invSX; - _m1.elements[ 1 ] *= invSX; - _m1.elements[ 2 ] *= invSX; - - _m1.elements[ 4 ] *= invSY; - _m1.elements[ 5 ] *= invSY; - _m1.elements[ 6 ] *= invSY; - - _m1.elements[ 8 ] *= invSZ; - _m1.elements[ 9 ] *= invSZ; - _m1.elements[ 10 ] *= invSZ; - - quaternion.setFromRotationMatrix( _m1 ); - - scale.x = sx; - scale.y = sy; - scale.z = sz; - - return this; - - }, - - makePerspective: function ( left, right, top, bottom, near, far ) { - - if ( far === undefined ) { - - console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' ); - - } - - var te = this.elements; - var x = 2 * near / ( right - left ); - var y = 2 * near / ( top - bottom ); - - var a = ( right + left ) / ( right - left ); - var b = ( top + bottom ) / ( top - bottom ); - var c = - ( far + near ) / ( far - near ); - var d = - 2 * far * near / ( far - near ); - - te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0; - te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0; - - return this; - - }, - - makeOrthographic: function ( left, right, top, bottom, near, far ) { - - var te = this.elements; - var w = 1.0 / ( right - left ); - var h = 1.0 / ( top - bottom ); - var p = 1.0 / ( far - near ); - - var x = ( right + left ) * w; - var y = ( top + bottom ) * h; - var z = ( far + near ) * p; - - te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x; - te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y; - te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z; - te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1; - - return this; - - }, - - equals: function ( matrix ) { - - var te = this.elements; - var me = matrix.elements; - - for ( var i = 0; i < 16; i ++ ) { - - if ( te[ i ] !== me[ i ] ) return false; - - } - - return true; - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - for ( var i = 0; i < 16; i ++ ) { - - this.elements[ i ] = array[ i + offset ]; - - } - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - var te = this.elements; - - array[ offset ] = te[ 0 ]; - array[ offset + 1 ] = te[ 1 ]; - array[ offset + 2 ] = te[ 2 ]; - array[ offset + 3 ] = te[ 3 ]; - - array[ offset + 4 ] = te[ 4 ]; - array[ offset + 5 ] = te[ 5 ]; - array[ offset + 6 ] = te[ 6 ]; - array[ offset + 7 ] = te[ 7 ]; - - array[ offset + 8 ] = te[ 8 ]; - array[ offset + 9 ] = te[ 9 ]; - array[ offset + 10 ] = te[ 10 ]; - array[ offset + 11 ] = te[ 11 ]; - - array[ offset + 12 ] = te[ 12 ]; - array[ offset + 13 ] = te[ 13 ]; - array[ offset + 14 ] = te[ 14 ]; - array[ offset + 15 ] = te[ 15 ]; - - return array; - - } - -} ); - - -export { Matrix4 }; diff --git a/cases/esbuild-three/src/base/math/Plane.d.ts b/cases/esbuild-three/src/base/math/Plane.d.ts deleted file mode 100644 index afed2fc986..0000000000 --- a/cases/esbuild-three/src/base/math/Plane.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Sphere } from './Sphere'; -import { Line3 } from './Line3'; -import { Box3 } from './Box3'; -import { Matrix4 } from './Matrix4'; -import { Matrix3 } from './Matrix3'; - -export class Plane { - - constructor( normal?: Vector3, constant?: number ); - - normal: Vector3; - constant: number; - - set( normal: Vector3, constant: number ): Plane; - setComponents( x: number, y: number, z: number, w: number ): Plane; - setFromNormalAndCoplanarPoint( normal: Vector3, point: Vector3 ): Plane; - setFromCoplanarPoints( a: Vector3, b: Vector3, c: Vector3 ): Plane; - clone(): this; - copy( plane: Plane ): this; - normalize(): Plane; - negate(): Plane; - distanceToPoint( point: Vector3 ): number; - distanceToSphere( sphere: Sphere ): number; - projectPoint( point: Vector3, target: Vector3 ): Vector3; - orthoPoint( point: Vector3, target: Vector3 ): Vector3; - intersectLine( line: Line3, target: Vector3 ): Vector3; - intersectsLine( line: Line3 ): boolean; - intersectsBox( box: Box3 ): boolean; - intersectsSphere( sphere: Sphere ): boolean; - coplanarPoint( target: Vector3 ): Vector3; - applyMatrix4( matrix: Matrix4, optionalNormalMatrix?: Matrix3 ): Plane; - translate( offset: Vector3 ): Plane; - equals( plane: Plane ): boolean; - - /** - * @deprecated Use {@link Plane#intersectsLine .intersectsLine()} instead. - */ - isIntersectionLine( l: any ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Plane.js b/cases/esbuild-three/src/base/math/Plane.js deleted file mode 100644 index 2e2baeb5e9..0000000000 --- a/cases/esbuild-three/src/base/math/Plane.js +++ /dev/null @@ -1,231 +0,0 @@ -import { Matrix3 } from './Matrix3.js'; -import { Vector3 } from './Vector3.js'; - -/** - * @author bhouston / http://clara.io - */ - -var _vector1 = new Vector3(); -var _vector2 = new Vector3(); -var _normalMatrix = new Matrix3(); - -function Plane( normal, constant ) { - - // normal is assumed to be normalized - - this.normal = ( normal !== undefined ) ? normal : new Vector3( 1, 0, 0 ); - this.constant = ( constant !== undefined ) ? constant : 0; - -} - -Object.assign( Plane.prototype, { - - isPlane: true, - - set: function ( normal, constant ) { - - this.normal.copy( normal ); - this.constant = constant; - - return this; - - }, - - setComponents: function ( x, y, z, w ) { - - this.normal.set( x, y, z ); - this.constant = w; - - return this; - - }, - - setFromNormalAndCoplanarPoint: function ( normal, point ) { - - this.normal.copy( normal ); - this.constant = - point.dot( this.normal ); - - return this; - - }, - - setFromCoplanarPoints: function ( a, b, c ) { - - var normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize(); - - // Q: should an error be thrown if normal is zero (e.g. degenerate plane)? - - this.setFromNormalAndCoplanarPoint( normal, a ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( plane ) { - - this.normal.copy( plane.normal ); - this.constant = plane.constant; - - return this; - - }, - - normalize: function () { - - // Note: will lead to a divide by zero if the plane is invalid. - - var inverseNormalLength = 1.0 / this.normal.length(); - this.normal.multiplyScalar( inverseNormalLength ); - this.constant *= inverseNormalLength; - - return this; - - }, - - negate: function () { - - this.constant *= - 1; - this.normal.negate(); - - return this; - - }, - - distanceToPoint: function ( point ) { - - return this.normal.dot( point ) + this.constant; - - }, - - distanceToSphere: function ( sphere ) { - - return this.distanceToPoint( sphere.center ) - sphere.radius; - - }, - - projectPoint: function ( point, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Plane: .projectPoint() target is now required' ); - target = new Vector3(); - - } - - return target.copy( this.normal ).multiplyScalar( - this.distanceToPoint( point ) ).add( point ); - - }, - - intersectLine: function ( line, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Plane: .intersectLine() target is now required' ); - target = new Vector3(); - - } - - var direction = line.delta( _vector1 ); - - var denominator = this.normal.dot( direction ); - - if ( denominator === 0 ) { - - // line is coplanar, return origin - if ( this.distanceToPoint( line.start ) === 0 ) { - - return target.copy( line.start ); - - } - - // Unsure if this is the correct method to handle this case. - return undefined; - - } - - var t = - ( line.start.dot( this.normal ) + this.constant ) / denominator; - - if ( t < 0 || t > 1 ) { - - return undefined; - - } - - return target.copy( direction ).multiplyScalar( t ).add( line.start ); - - }, - - intersectsLine: function ( line ) { - - // Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it. - - var startSign = this.distanceToPoint( line.start ); - var endSign = this.distanceToPoint( line.end ); - - return ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 ); - - }, - - intersectsBox: function ( box ) { - - return box.intersectsPlane( this ); - - }, - - intersectsSphere: function ( sphere ) { - - return sphere.intersectsPlane( this ); - - }, - - coplanarPoint: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Plane: .coplanarPoint() target is now required' ); - target = new Vector3(); - - } - - return target.copy( this.normal ).multiplyScalar( - this.constant ); - - }, - - applyMatrix4: function ( matrix, optionalNormalMatrix ) { - - var normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix ); - - var referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix ); - - var normal = this.normal.applyMatrix3( normalMatrix ).normalize(); - - this.constant = - referencePoint.dot( normal ); - - return this; - - }, - - translate: function ( offset ) { - - this.constant -= offset.dot( this.normal ); - - return this; - - }, - - equals: function ( plane ) { - - return plane.normal.equals( this.normal ) && ( plane.constant === this.constant ); - - } - -} ); - - -export { Plane }; diff --git a/cases/esbuild-three/src/base/math/Quaternion.d.ts b/cases/esbuild-three/src/base/math/Quaternion.d.ts deleted file mode 100644 index dba3b27cbd..0000000000 --- a/cases/esbuild-three/src/base/math/Quaternion.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { Euler } from './Euler'; -import { Vector3 } from './Vector3'; -import { Matrix4 } from './Matrix4'; - -/** - * Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages. - * - * @example - * var quaternion = new THREE.Quaternion(); - * quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); - * var vector = new THREE.Vector3( 1, 0, 0 ); - * vector.applyQuaternion( quaternion ); - */ -export class Quaternion { - - /** - * @param x x coordinate - * @param y y coordinate - * @param z z coordinate - * @param w w coordinate - */ - constructor( x?: number, y?: number, z?: number, w?: number ); - - x: number; - y: number; - z: number; - w: number; - - /** - * Sets values of this quaternion. - */ - set( x: number, y: number, z: number, w: number ): Quaternion; - - /** - * Clones this quaternion. - */ - clone(): this; - - /** - * Copies values of q to this quaternion. - */ - copy( q: Quaternion ): this; - - /** - * Sets this quaternion from rotation specified by Euler angles. - */ - setFromEuler( euler: Euler ): Quaternion; - - /** - * Sets this quaternion from rotation specified by axis and angle. - * Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm. - * Axis have to be normalized, angle is in radians. - */ - setFromAxisAngle( axis: Vector3, angle: number ): Quaternion; - - /** - * Sets this quaternion from rotation component of m. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm. - */ - setFromRotationMatrix( m: Matrix4 ): Quaternion; - setFromUnitVectors( vFrom: Vector3, vTo: Vector3 ): Quaternion; - angleTo( q: Quaternion ): number; - rotateTowards( q: Quaternion, step: number ): Quaternion; - - /** - * Inverts this quaternion. - */ - inverse(): Quaternion; - - conjugate(): Quaternion; - dot( v: Quaternion ): number; - lengthSq(): number; - - /** - * Computes length of this quaternion. - */ - length(): number; - - /** - * Normalizes this quaternion. - */ - normalize(): Quaternion; - - /** - * Multiplies this quaternion by b. - */ - multiply( q: Quaternion ): Quaternion; - premultiply( q: Quaternion ): Quaternion; - - /** - * Sets this quaternion to a x b - * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm. - */ - multiplyQuaternions( a: Quaternion, b: Quaternion ): Quaternion; - - slerp( qb: Quaternion, t: number ): Quaternion; - equals( v: Quaternion ): boolean; - - /** - * Sets this quaternion's x, y, z and w value from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets this quaternion's x, y, z and w value from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array [x, y, z, w], or copies x, y, z and w into the provided array. - * @param array (optional) array to store the quaternion to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies x, y, z and w into the provided array-like. - * @param array array-like to store the quaternion to. - * @param offset (optional) optional offset into the array. - * @return The provided array-like. - */ - toArray( array: ArrayLike, offset?: number ): ArrayLike; - - _onChange( callback: Function ): Quaternion; - _onChangeCallback: Function; - - /** - * Adapted from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/. - */ - static slerp( - qa: Quaternion, - qb: Quaternion, - qm: Quaternion, - t: number - ): Quaternion; - - static slerpFlat( - dst: number[], - dstOffset: number, - src0: number[], - srcOffset: number, - src1: number[], - stcOffset1: number, - t: number - ): Quaternion; - - /** - * @deprecated Use {@link Vector#applyQuaternion vector.applyQuaternion( quaternion )} instead. - */ - multiplyVector3( v: any ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Quaternion.js b/cases/esbuild-three/src/base/math/Quaternion.js deleted file mode 100644 index 48a78a8f5b..0000000000 --- a/cases/esbuild-three/src/base/math/Quaternion.js +++ /dev/null @@ -1,636 +0,0 @@ -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author WestLangley / http://github.com/WestLangley - * @author bhouston / http://clara.io - */ - -import { _Math } from './Math.js'; - -function Quaternion( x, y, z, w ) { - - this._x = x || 0; - this._y = y || 0; - this._z = z || 0; - this._w = ( w !== undefined ) ? w : 1; - -} - -Object.assign( Quaternion, { - - slerp: function ( qa, qb, qm, t ) { - - return qm.copy( qa ).slerp( qb, t ); - - }, - - slerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) { - - // fuzz-free, array-based Quaternion SLERP operation - - var x0 = src0[ srcOffset0 + 0 ], - y0 = src0[ srcOffset0 + 1 ], - z0 = src0[ srcOffset0 + 2 ], - w0 = src0[ srcOffset0 + 3 ], - - x1 = src1[ srcOffset1 + 0 ], - y1 = src1[ srcOffset1 + 1 ], - z1 = src1[ srcOffset1 + 2 ], - w1 = src1[ srcOffset1 + 3 ]; - - if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) { - - var s = 1 - t, - - cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, - - dir = ( cos >= 0 ? 1 : - 1 ), - sqrSin = 1 - cos * cos; - - // Skip the Slerp for tiny steps to avoid numeric problems: - if ( sqrSin > Number.EPSILON ) { - - var sin = Math.sqrt( sqrSin ), - len = Math.atan2( sin, cos * dir ); - - s = Math.sin( s * len ) / sin; - t = Math.sin( t * len ) / sin; - - } - - var tDir = t * dir; - - x0 = x0 * s + x1 * tDir; - y0 = y0 * s + y1 * tDir; - z0 = z0 * s + z1 * tDir; - w0 = w0 * s + w1 * tDir; - - // Normalize in case we just did a lerp: - if ( s === 1 - t ) { - - var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 ); - - x0 *= f; - y0 *= f; - z0 *= f; - w0 *= f; - - } - - } - - dst[ dstOffset ] = x0; - dst[ dstOffset + 1 ] = y0; - dst[ dstOffset + 2 ] = z0; - dst[ dstOffset + 3 ] = w0; - - } - -} ); - -Object.defineProperties( Quaternion.prototype, { - - x: { - - get: function () { - - return this._x; - - }, - - set: function ( value ) { - - this._x = value; - this._onChangeCallback(); - - } - - }, - - y: { - - get: function () { - - return this._y; - - }, - - set: function ( value ) { - - this._y = value; - this._onChangeCallback(); - - } - - }, - - z: { - - get: function () { - - return this._z; - - }, - - set: function ( value ) { - - this._z = value; - this._onChangeCallback(); - - } - - }, - - w: { - - get: function () { - - return this._w; - - }, - - set: function ( value ) { - - this._w = value; - this._onChangeCallback(); - - } - - } - -} ); - -Object.assign( Quaternion.prototype, { - - isQuaternion: true, - - set: function ( x, y, z, w ) { - - this._x = x; - this._y = y; - this._z = z; - this._w = w; - - this._onChangeCallback(); - - return this; - - }, - - clone: function () { - - return new this.constructor( this._x, this._y, this._z, this._w ); - - }, - - copy: function ( quaternion ) { - - this._x = quaternion.x; - this._y = quaternion.y; - this._z = quaternion.z; - this._w = quaternion.w; - - this._onChangeCallback(); - - return this; - - }, - - setFromEuler: function ( euler, update ) { - - if ( ! ( euler && euler.isEuler ) ) { - - throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' ); - - } - - var x = euler._x, y = euler._y, z = euler._z, order = euler.order; - - // http://www.mathworks.com/matlabcentral/fileexchange/ - // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/ - // content/SpinCalc.m - - var cos = Math.cos; - var sin = Math.sin; - - var c1 = cos( x / 2 ); - var c2 = cos( y / 2 ); - var c3 = cos( z / 2 ); - - var s1 = sin( x / 2 ); - var s2 = sin( y / 2 ); - var s3 = sin( z / 2 ); - - if ( order === 'XYZ' ) { - - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'YXZ' ) { - - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - - } else if ( order === 'ZXY' ) { - - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'ZYX' ) { - - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - - } else if ( order === 'YZX' ) { - - this._x = s1 * c2 * c3 + c1 * s2 * s3; - this._y = c1 * s2 * c3 + s1 * c2 * s3; - this._z = c1 * c2 * s3 - s1 * s2 * c3; - this._w = c1 * c2 * c3 - s1 * s2 * s3; - - } else if ( order === 'XZY' ) { - - this._x = s1 * c2 * c3 - c1 * s2 * s3; - this._y = c1 * s2 * c3 - s1 * c2 * s3; - this._z = c1 * c2 * s3 + s1 * s2 * c3; - this._w = c1 * c2 * c3 + s1 * s2 * s3; - - } - - if ( update !== false ) this._onChangeCallback(); - - return this; - - }, - - setFromAxisAngle: function ( axis, angle ) { - - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm - - // assumes axis is normalized - - var halfAngle = angle / 2, s = Math.sin( halfAngle ); - - this._x = axis.x * s; - this._y = axis.y * s; - this._z = axis.z * s; - this._w = Math.cos( halfAngle ); - - this._onChangeCallback(); - - return this; - - }, - - setFromRotationMatrix: function ( m ) { - - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm - - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - - var te = m.elements, - - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ], - - trace = m11 + m22 + m33, - s; - - if ( trace > 0 ) { - - s = 0.5 / Math.sqrt( trace + 1.0 ); - - this._w = 0.25 / s; - this._x = ( m32 - m23 ) * s; - this._y = ( m13 - m31 ) * s; - this._z = ( m21 - m12 ) * s; - - } else if ( m11 > m22 && m11 > m33 ) { - - s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 ); - - this._w = ( m32 - m23 ) / s; - this._x = 0.25 * s; - this._y = ( m12 + m21 ) / s; - this._z = ( m13 + m31 ) / s; - - } else if ( m22 > m33 ) { - - s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 ); - - this._w = ( m13 - m31 ) / s; - this._x = ( m12 + m21 ) / s; - this._y = 0.25 * s; - this._z = ( m23 + m32 ) / s; - - } else { - - s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 ); - - this._w = ( m21 - m12 ) / s; - this._x = ( m13 + m31 ) / s; - this._y = ( m23 + m32 ) / s; - this._z = 0.25 * s; - - } - - this._onChangeCallback(); - - return this; - - }, - - setFromUnitVectors: function ( vFrom, vTo ) { - - // assumes direction vectors vFrom and vTo are normalized - - var EPS = 0.000001; - - var r = vFrom.dot( vTo ) + 1; - - if ( r < EPS ) { - - r = 0; - - if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) { - - this._x = - vFrom.y; - this._y = vFrom.x; - this._z = 0; - this._w = r; - - } else { - - this._x = 0; - this._y = - vFrom.z; - this._z = vFrom.y; - this._w = r; - - } - - } else { - - // crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3 - - this._x = vFrom.y * vTo.z - vFrom.z * vTo.y; - this._y = vFrom.z * vTo.x - vFrom.x * vTo.z; - this._z = vFrom.x * vTo.y - vFrom.y * vTo.x; - this._w = r; - - } - - return this.normalize(); - - }, - - angleTo: function ( q ) { - - return 2 * Math.acos( Math.abs( _Math.clamp( this.dot( q ), - 1, 1 ) ) ); - - }, - - rotateTowards: function ( q, step ) { - - var angle = this.angleTo( q ); - - if ( angle === 0 ) return this; - - var t = Math.min( 1, step / angle ); - - this.slerp( q, t ); - - return this; - - }, - - inverse: function () { - - // quaternion is assumed to have unit length - - return this.conjugate(); - - }, - - conjugate: function () { - - this._x *= - 1; - this._y *= - 1; - this._z *= - 1; - - this._onChangeCallback(); - - return this; - - }, - - dot: function ( v ) { - - return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w; - - }, - - lengthSq: function () { - - return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w; - - }, - - length: function () { - - return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w ); - - }, - - normalize: function () { - - var l = this.length(); - - if ( l === 0 ) { - - this._x = 0; - this._y = 0; - this._z = 0; - this._w = 1; - - } else { - - l = 1 / l; - - this._x = this._x * l; - this._y = this._y * l; - this._z = this._z * l; - this._w = this._w * l; - - } - - this._onChangeCallback(); - - return this; - - }, - - multiply: function ( q, p ) { - - if ( p !== undefined ) { - - console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' ); - return this.multiplyQuaternions( q, p ); - - } - - return this.multiplyQuaternions( this, q ); - - }, - - premultiply: function ( q ) { - - return this.multiplyQuaternions( q, this ); - - }, - - multiplyQuaternions: function ( a, b ) { - - // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm - - var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w; - var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w; - - this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - - this._onChangeCallback(); - - return this; - - }, - - slerp: function ( qb, t ) { - - if ( t === 0 ) return this; - if ( t === 1 ) return this.copy( qb ); - - var x = this._x, y = this._y, z = this._z, w = this._w; - - // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ - - var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z; - - if ( cosHalfTheta < 0 ) { - - this._w = - qb._w; - this._x = - qb._x; - this._y = - qb._y; - this._z = - qb._z; - - cosHalfTheta = - cosHalfTheta; - - } else { - - this.copy( qb ); - - } - - if ( cosHalfTheta >= 1.0 ) { - - this._w = w; - this._x = x; - this._y = y; - this._z = z; - - return this; - - } - - var sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; - - if ( sqrSinHalfTheta <= Number.EPSILON ) { - - var s = 1 - t; - this._w = s * w + t * this._w; - this._x = s * x + t * this._x; - this._y = s * y + t * this._y; - this._z = s * z + t * this._z; - - this.normalize(); - this._onChangeCallback(); - - return this; - - } - - var sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); - var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); - var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, - ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; - - this._w = ( w * ratioA + this._w * ratioB ); - this._x = ( x * ratioA + this._x * ratioB ); - this._y = ( y * ratioA + this._y * ratioB ); - this._z = ( z * ratioA + this._z * ratioB ); - - this._onChangeCallback(); - - return this; - - }, - - equals: function ( quaternion ) { - - return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - this._x = array[ offset ]; - this._y = array[ offset + 1 ]; - this._z = array[ offset + 2 ]; - this._w = array[ offset + 3 ]; - - this._onChangeCallback(); - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this._x; - array[ offset + 1 ] = this._y; - array[ offset + 2 ] = this._z; - array[ offset + 3 ] = this._w; - - return array; - - }, - - _onChange: function ( callback ) { - - this._onChangeCallback = callback; - - return this; - - }, - - _onChangeCallback: function () {} - -} ); - - -export { Quaternion }; diff --git a/cases/esbuild-three/src/base/math/Ray.d.ts b/cases/esbuild-three/src/base/math/Ray.d.ts deleted file mode 100644 index 177a621f4f..0000000000 --- a/cases/esbuild-three/src/base/math/Ray.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Sphere } from './Sphere'; -import { Plane } from './Plane'; -import { Box3 } from './Box3'; -import { Matrix4 } from './Matrix4'; - -export class Ray { - - constructor( origin?: Vector3, direction?: Vector3 ); - - origin: Vector3; - direction: Vector3; - - set( origin: Vector3, direction: Vector3 ): Ray; - clone(): this; - copy( ray: Ray ): this; - at( t: number, target: Vector3 ): Vector3; - lookAt( v: Vector3 ): Vector3; - recast( t: number ): Ray; - closestPointToPoint( point: Vector3, target: Vector3 ): Vector3; - distanceToPoint( point: Vector3 ): number; - distanceSqToPoint( point: Vector3 ): number; - distanceSqToSegment( - v0: Vector3, - v1: Vector3, - optionalPointOnRay?: Vector3, - optionalPointOnSegment?: Vector3 - ): number; - intersectSphere( sphere: Sphere, target: Vector3 ): Vector3; - intersectsSphere( sphere: Sphere ): boolean; - distanceToPlane( plane: Plane ): number; - intersectPlane( plane: Plane, target: Vector3 ): Vector3; - intersectsPlane( plane: Plane ): boolean; - intersectBox( box: Box3, target: Vector3 ): Vector3; - intersectsBox( box: Box3 ): boolean; - intersectTriangle( - a: Vector3, - b: Vector3, - c: Vector3, - backfaceCulling: boolean, - target: Vector3 - ): Vector3; - applyMatrix4( matrix4: Matrix4 ): Ray; - equals( ray: Ray ): boolean; - - /** - * @deprecated Use {@link Ray#intersectsBox .intersectsBox()} instead. - */ - isIntersectionBox( b: any ): any; - - /** - * @deprecated Use {@link Ray#intersectsPlane .intersectsPlane()} instead. - */ - isIntersectionPlane( p: any ): any; - - /** - * @deprecated Use {@link Ray#intersectsSphere .intersectsSphere()} instead. - */ - isIntersectionSphere( s: any ): any; - -} diff --git a/cases/esbuild-three/src/base/math/Ray.js b/cases/esbuild-three/src/base/math/Ray.js deleted file mode 100644 index fa58a0ad34..0000000000 --- a/cases/esbuild-three/src/base/math/Ray.js +++ /dev/null @@ -1,515 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -var _vector = new Vector3(); -var _segCenter = new Vector3(); -var _segDir = new Vector3(); -var _diff = new Vector3(); - -var _edge1 = new Vector3(); -var _edge2 = new Vector3(); -var _normal = new Vector3(); - -/** - * @author bhouston / http://clara.io - */ - -function Ray( origin, direction ) { - - this.origin = ( origin !== undefined ) ? origin : new Vector3(); - this.direction = ( direction !== undefined ) ? direction : new Vector3(); - -} - -Object.assign( Ray.prototype, { - - set: function ( origin, direction ) { - - this.origin.copy( origin ); - this.direction.copy( direction ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( ray ) { - - this.origin.copy( ray.origin ); - this.direction.copy( ray.direction ); - - return this; - - }, - - at: function ( t, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Ray: .at() target is now required' ); - target = new Vector3(); - - } - - return target.copy( this.direction ).multiplyScalar( t ).add( this.origin ); - - }, - - lookAt: function ( v ) { - - this.direction.copy( v ).sub( this.origin ).normalize(); - - return this; - - }, - - recast: function ( t ) { - - this.origin.copy( this.at( t, _vector ) ); - - return this; - - }, - - closestPointToPoint: function ( point, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Ray: .closestPointToPoint() target is now required' ); - target = new Vector3(); - - } - - target.subVectors( point, this.origin ); - - var directionDistance = target.dot( this.direction ); - - if ( directionDistance < 0 ) { - - return target.copy( this.origin ); - - } - - return target.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - - }, - - distanceToPoint: function ( point ) { - - return Math.sqrt( this.distanceSqToPoint( point ) ); - - }, - - distanceSqToPoint: function ( point ) { - - var directionDistance = _vector.subVectors( point, this.origin ).dot( this.direction ); - - // point behind the ray - - if ( directionDistance < 0 ) { - - return this.origin.distanceToSquared( point ); - - } - - _vector.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin ); - - return _vector.distanceToSquared( point ); - - }, - - distanceSqToSegment: function ( v0, v1, optionalPointOnRay, optionalPointOnSegment ) { - - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h - // It returns the min distance between the ray and the segment - // defined by v0 and v1 - // It can also set two optional targets : - // - The closest point on the ray - // - The closest point on the segment - - _segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 ); - _segDir.copy( v1 ).sub( v0 ).normalize(); - _diff.copy( this.origin ).sub( _segCenter ); - - var segExtent = v0.distanceTo( v1 ) * 0.5; - var a01 = - this.direction.dot( _segDir ); - var b0 = _diff.dot( this.direction ); - var b1 = - _diff.dot( _segDir ); - var c = _diff.lengthSq(); - var det = Math.abs( 1 - a01 * a01 ); - var s0, s1, sqrDist, extDet; - - if ( det > 0 ) { - - // The ray and segment are not parallel. - - s0 = a01 * b1 - b0; - s1 = a01 * b0 - b1; - extDet = segExtent * det; - - if ( s0 >= 0 ) { - - if ( s1 >= - extDet ) { - - if ( s1 <= extDet ) { - - // region 0 - // Minimum at interior points of ray and segment. - - var invDet = 1 / det; - s0 *= invDet; - s1 *= invDet; - sqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c; - - } else { - - // region 1 - - s1 = segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } - - } else { - - // region 5 - - s1 = - segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } - - } else { - - if ( s1 <= - extDet ) { - - // region 4 - - s0 = Math.max( 0, - ( - a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } else if ( s1 <= extDet ) { - - // region 3 - - s0 = 0; - s1 = Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = s1 * ( s1 + 2 * b1 ) + c; - - } else { - - // region 2 - - s0 = Math.max( 0, - ( a01 * segExtent + b0 ) ); - s1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } - - } - - } else { - - // Ray and segment are parallel. - - s1 = ( a01 > 0 ) ? - segExtent : segExtent; - s0 = Math.max( 0, - ( a01 * s1 + b0 ) ); - sqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c; - - } - - if ( optionalPointOnRay ) { - - optionalPointOnRay.copy( this.direction ).multiplyScalar( s0 ).add( this.origin ); - - } - - if ( optionalPointOnSegment ) { - - optionalPointOnSegment.copy( _segDir ).multiplyScalar( s1 ).add( _segCenter ); - - } - - return sqrDist; - - }, - - intersectSphere: function ( sphere, target ) { - - _vector.subVectors( sphere.center, this.origin ); - var tca = _vector.dot( this.direction ); - var d2 = _vector.dot( _vector ) - tca * tca; - var radius2 = sphere.radius * sphere.radius; - - if ( d2 > radius2 ) return null; - - var thc = Math.sqrt( radius2 - d2 ); - - // t0 = first intersect point - entrance on front of sphere - var t0 = tca - thc; - - // t1 = second intersect point - exit point on back of sphere - var t1 = tca + thc; - - // test to see if both t0 and t1 are behind the ray - if so, return null - if ( t0 < 0 && t1 < 0 ) return null; - - // test to see if t0 is behind the ray: - // if it is, the ray is inside the sphere, so return the second exit point scaled by t1, - // in order to always return an intersect point that is in front of the ray. - if ( t0 < 0 ) return this.at( t1, target ); - - // else t0 is in front of the ray, so return the first collision point scaled by t0 - return this.at( t0, target ); - - }, - - intersectsSphere: function ( sphere ) { - - return this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius ); - - }, - - distanceToPlane: function ( plane ) { - - var denominator = plane.normal.dot( this.direction ); - - if ( denominator === 0 ) { - - // line is coplanar, return origin - if ( plane.distanceToPoint( this.origin ) === 0 ) { - - return 0; - - } - - // Null is preferable to undefined since undefined means.... it is undefined - - return null; - - } - - var t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator; - - // Return if the ray never intersects the plane - - return t >= 0 ? t : null; - - }, - - intersectPlane: function ( plane, target ) { - - var t = this.distanceToPlane( plane ); - - if ( t === null ) { - - return null; - - } - - return this.at( t, target ); - - }, - - intersectsPlane: function ( plane ) { - - // check if the ray lies on the plane first - - var distToPoint = plane.distanceToPoint( this.origin ); - - if ( distToPoint === 0 ) { - - return true; - - } - - var denominator = plane.normal.dot( this.direction ); - - if ( denominator * distToPoint < 0 ) { - - return true; - - } - - // ray origin is behind the plane (and is pointing behind it) - - return false; - - }, - - intersectBox: function ( box, target ) { - - var tmin, tmax, tymin, tymax, tzmin, tzmax; - - var invdirx = 1 / this.direction.x, - invdiry = 1 / this.direction.y, - invdirz = 1 / this.direction.z; - - var origin = this.origin; - - if ( invdirx >= 0 ) { - - tmin = ( box.min.x - origin.x ) * invdirx; - tmax = ( box.max.x - origin.x ) * invdirx; - - } else { - - tmin = ( box.max.x - origin.x ) * invdirx; - tmax = ( box.min.x - origin.x ) * invdirx; - - } - - if ( invdiry >= 0 ) { - - tymin = ( box.min.y - origin.y ) * invdiry; - tymax = ( box.max.y - origin.y ) * invdiry; - - } else { - - tymin = ( box.max.y - origin.y ) * invdiry; - tymax = ( box.min.y - origin.y ) * invdiry; - - } - - if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null; - - // These lines also handle the case where tmin or tmax is NaN - // (result of 0 * Infinity). x !== x returns true if x is NaN - - if ( tymin > tmin || tmin !== tmin ) tmin = tymin; - - if ( tymax < tmax || tmax !== tmax ) tmax = tymax; - - if ( invdirz >= 0 ) { - - tzmin = ( box.min.z - origin.z ) * invdirz; - tzmax = ( box.max.z - origin.z ) * invdirz; - - } else { - - tzmin = ( box.max.z - origin.z ) * invdirz; - tzmax = ( box.min.z - origin.z ) * invdirz; - - } - - if ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null; - - if ( tzmin > tmin || tmin !== tmin ) tmin = tzmin; - - if ( tzmax < tmax || tmax !== tmax ) tmax = tzmax; - - //return point closest to the ray (positive side) - - if ( tmax < 0 ) return null; - - return this.at( tmin >= 0 ? tmin : tmax, target ); - - }, - - intersectsBox: function ( box ) { - - return this.intersectBox( box, _vector ) !== null; - - }, - - intersectTriangle: function ( a, b, c, backfaceCulling, target ) { - - // Compute the offset origin, edges, and normal. - - // from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h - - _edge1.subVectors( b, a ); - _edge2.subVectors( c, a ); - _normal.crossVectors( _edge1, _edge2 ); - - // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction, - // E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by - // |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2)) - // |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q)) - // |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N) - var DdN = this.direction.dot( _normal ); - var sign; - - if ( DdN > 0 ) { - - if ( backfaceCulling ) return null; - sign = 1; - - } else if ( DdN < 0 ) { - - sign = - 1; - DdN = - DdN; - - } else { - - return null; - - } - - _diff.subVectors( this.origin, a ); - var DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) ); - - // b1 < 0, no intersection - if ( DdQxE2 < 0 ) { - - return null; - - } - - var DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) ); - - // b2 < 0, no intersection - if ( DdE1xQ < 0 ) { - - return null; - - } - - // b1+b2 > 1, no intersection - if ( DdQxE2 + DdE1xQ > DdN ) { - - return null; - - } - - // Line intersects triangle, check if ray does. - var QdN = - sign * _diff.dot( _normal ); - - // t < 0, no intersection - if ( QdN < 0 ) { - - return null; - - } - - // Ray intersects triangle. - return this.at( QdN / DdN, target ); - - }, - - applyMatrix4: function ( matrix4 ) { - - this.origin.applyMatrix4( matrix4 ); - this.direction.transformDirection( matrix4 ); - - return this; - - }, - - equals: function ( ray ) { - - return ray.origin.equals( this.origin ) && ray.direction.equals( this.direction ); - - } - -} ); - - -export { Ray }; diff --git a/cases/esbuild-three/src/base/math/Sphere.d.ts b/cases/esbuild-three/src/base/math/Sphere.d.ts deleted file mode 100644 index cc6f4c7537..0000000000 --- a/cases/esbuild-three/src/base/math/Sphere.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Vector3 } from './Vector3'; -import { Box3 } from './Box3'; -import { Plane } from './Plane'; -import { Matrix4 } from './Matrix4'; - -export class Sphere { - - constructor( center?: Vector3, radius?: number ); - - center: Vector3; - radius: number; - - set( center: Vector3, radius: number ): Sphere; - setFromPoints( points: Vector3[], optionalCenter?: Vector3 ): Sphere; - clone(): this; - copy( sphere: Sphere ): this; - empty(): boolean; - containsPoint( point: Vector3 ): boolean; - distanceToPoint( point: Vector3 ): number; - intersectsSphere( sphere: Sphere ): boolean; - intersectsBox( box: Box3 ): boolean; - intersectsPlane( plane: Plane ): boolean; - clampPoint( point: Vector3, target: Vector3 ): Vector3; - getBoundingBox( target: Box3 ): Box3; - applyMatrix4( matrix: Matrix4 ): Sphere; - translate( offset: Vector3 ): Sphere; - equals( sphere: Sphere ): boolean; - -} diff --git a/cases/esbuild-three/src/base/math/Sphere.js b/cases/esbuild-three/src/base/math/Sphere.js deleted file mode 100644 index 52db669514..0000000000 --- a/cases/esbuild-three/src/base/math/Sphere.js +++ /dev/null @@ -1,176 +0,0 @@ -import { Box3 } from './Box3.js'; -import { Vector3 } from './Vector3.js'; - -var _box = new Box3(); - -/** - * @author bhouston / http://clara.io - * @author mrdoob / http://mrdoob.com/ - */ - -function Sphere( center, radius ) { - - this.center = ( center !== undefined ) ? center : new Vector3(); - this.radius = ( radius !== undefined ) ? radius : 0; - -} - -Object.assign( Sphere.prototype, { - - set: function ( center, radius ) { - - this.center.copy( center ); - this.radius = radius; - - return this; - - }, - - setFromPoints: function ( points, optionalCenter ) { - - var center = this.center; - - if ( optionalCenter !== undefined ) { - - center.copy( optionalCenter ); - - } else { - - _box.setFromPoints( points ).getCenter( center ); - - } - - var maxRadiusSq = 0; - - for ( var i = 0, il = points.length; i < il; i ++ ) { - - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) ); - - } - - this.radius = Math.sqrt( maxRadiusSq ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( sphere ) { - - this.center.copy( sphere.center ); - this.radius = sphere.radius; - - return this; - - }, - - empty: function () { - - return ( this.radius <= 0 ); - - }, - - containsPoint: function ( point ) { - - return ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) ); - - }, - - distanceToPoint: function ( point ) { - - return ( point.distanceTo( this.center ) - this.radius ); - - }, - - intersectsSphere: function ( sphere ) { - - var radiusSum = this.radius + sphere.radius; - - return sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum ); - - }, - - intersectsBox: function ( box ) { - - return box.intersectsSphere( this ); - - }, - - intersectsPlane: function ( plane ) { - - return Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius; - - }, - - clampPoint: function ( point, target ) { - - var deltaLengthSq = this.center.distanceToSquared( point ); - - if ( target === undefined ) { - - console.warn( 'THREE.Sphere: .clampPoint() target is now required' ); - target = new Vector3(); - - } - - target.copy( point ); - - if ( deltaLengthSq > ( this.radius * this.radius ) ) { - - target.sub( this.center ).normalize(); - target.multiplyScalar( this.radius ).add( this.center ); - - } - - return target; - - }, - - getBoundingBox: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Sphere: .getBoundingBox() target is now required' ); - target = new Box3(); - - } - - target.set( this.center, this.center ); - target.expandByScalar( this.radius ); - - return target; - - }, - - applyMatrix4: function ( matrix ) { - - this.center.applyMatrix4( matrix ); - this.radius = this.radius * matrix.getMaxScaleOnAxis(); - - return this; - - }, - - translate: function ( offset ) { - - this.center.add( offset ); - - return this; - - }, - - equals: function ( sphere ) { - - return sphere.center.equals( this.center ) && ( sphere.radius === this.radius ); - - } - -} ); - - -export { Sphere }; diff --git a/cases/esbuild-three/src/base/math/Spherical.d.ts b/cases/esbuild-three/src/base/math/Spherical.d.ts deleted file mode 100644 index 5e402f02c6..0000000000 --- a/cases/esbuild-three/src/base/math/Spherical.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Vector3 } from './Vector3'; - -export class Spherical { - - constructor( radius?: number, phi?: number, theta?: number ); - - radius: number; - phi: number; - theta: number; - - set( radius: number, phi: number, theta: number ): this; - clone(): this; - copy( other: Spherical ): this; - makeSafe(): void; - setFromVector3( v: Vector3 ): this; - setFromCartesianCoords( x: number, y: number, z: number ): this; - -} diff --git a/cases/esbuild-three/src/base/math/Spherical.js b/cases/esbuild-three/src/base/math/Spherical.js deleted file mode 100644 index 75fd25e710..0000000000 --- a/cases/esbuild-three/src/base/math/Spherical.js +++ /dev/null @@ -1,90 +0,0 @@ -import { _Math } from './Math.js'; - -/** - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - * - * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system - * - * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up. - * The azimuthal angle (theta) is measured from the positive z-axiz. - */ - -function Spherical( radius, phi, theta ) { - - this.radius = ( radius !== undefined ) ? radius : 1.0; - this.phi = ( phi !== undefined ) ? phi : 0; // polar angle - this.theta = ( theta !== undefined ) ? theta : 0; // azimuthal angle - - return this; - -} - -Object.assign( Spherical.prototype, { - - set: function ( radius, phi, theta ) { - - this.radius = radius; - this.phi = phi; - this.theta = theta; - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( other ) { - - this.radius = other.radius; - this.phi = other.phi; - this.theta = other.theta; - - return this; - - }, - - // restrict phi to be betwee EPS and PI-EPS - makeSafe: function () { - - var EPS = 0.000001; - this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) ); - - return this; - - }, - - setFromVector3: function ( v ) { - - return this.setFromCartesianCoords( v.x, v.y, v.z ); - - }, - - setFromCartesianCoords: function ( x, y, z ) { - - this.radius = Math.sqrt( x * x + y * y + z * z ); - - if ( this.radius === 0 ) { - - this.theta = 0; - this.phi = 0; - - } else { - - this.theta = Math.atan2( x, z ); - this.phi = Math.acos( _Math.clamp( y / this.radius, - 1, 1 ) ); - - } - - return this; - - } - -} ); - - -export { Spherical }; diff --git a/cases/esbuild-three/src/base/math/SphericalHarmonics3.d.ts b/cases/esbuild-three/src/base/math/SphericalHarmonics3.d.ts deleted file mode 100644 index 97c63dad52..0000000000 --- a/cases/esbuild-three/src/base/math/SphericalHarmonics3.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -export class SphericalHarmonics3 { - - constructor(); - - coefficients: Vector3[]; - isSphericalHarmonics3: boolean; - - set ( coefficients: Vector3[] ): SphericalHarmonics3; - zero(): SphericalHarmonics3; - add( sh: SphericalHarmonics3 ): SphericalHarmonics3; - scale( s: number ): SphericalHarmonics3; - lerp( sh: SphericalHarmonics3, alpha: number ): SphericalHarmonics3; - equals( sh: SphericalHarmonics3 ): boolean; - copy( sh: SphericalHarmonics3 ): SphericalHarmonics3; - clone(): SphericalHarmonics3; - - /** - * Sets the values of this spherical harmonics from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets the values of this spherical harmonics from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array with the values of this spherical harmonics, or copies them into the provided array. - * @param array (optional) array to store the spherical harmonics to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Returns an array with the values of this spherical harmonics, or copies them into the provided array-like. - * @param array array-like to store the spherical harmonics to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( array: ArrayLike, offset?: number ): ArrayLike; - - getAt( normal: Vector3, target: Vector3 ) : Vector3; - getIrradianceAt( normal: Vector3, target: Vector3 ) : Vector3; - - static getBasisAt( normal: Vector3, shBasis: number[] ): void; - -} diff --git a/cases/esbuild-three/src/base/math/SphericalHarmonics3.js b/cases/esbuild-three/src/base/math/SphericalHarmonics3.js deleted file mode 100644 index 68c9132981..0000000000 --- a/cases/esbuild-three/src/base/math/SphericalHarmonics3.js +++ /dev/null @@ -1,244 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -/** - * @author bhouston / http://clara.io - * @author WestLangley / http://github.com/WestLangley - * - * Primary reference: - * https://graphics.stanford.edu/papers/envmap/envmap.pdf - * - * Secondary reference: - * https://www.ppsloan.org/publications/StupidSH36.pdf - */ - -// 3-band SH defined by 9 coefficients - -function SphericalHarmonics3() { - - this.coefficients = []; - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients.push( new Vector3() ); - - } - -} - -Object.assign( SphericalHarmonics3.prototype, { - - isSphericalHarmonics3: true, - - set: function ( coefficients ) { - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients[ i ].copy( coefficients[ i ] ); - - } - - return this; - - }, - - zero: function () { - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients[ i ].set( 0, 0, 0 ); - - } - - return this; - - }, - - // get the radiance in the direction of the normal - // target is a Vector3 - getAt: function ( normal, target ) { - - // normal is assumed to be unit length - - var x = normal.x, y = normal.y, z = normal.z; - - var coeff = this.coefficients; - - // band 0 - target.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 ); - - // band 1 - target.addScale( coeff[ 1 ], 0.488603 * y ); - target.addScale( coeff[ 2 ], 0.488603 * z ); - target.addScale( coeff[ 3 ], 0.488603 * x ); - - // band 2 - target.addScale( coeff[ 4 ], 1.092548 * ( x * y ) ); - target.addScale( coeff[ 5 ], 1.092548 * ( y * z ) ); - target.addScale( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) ); - target.addScale( coeff[ 7 ], 1.092548 * ( x * z ) ); - target.addScale( coeff[ 8 ], 0.546274 * ( x * x - y * y ) ); - - return target; - - }, - - // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal - // target is a Vector3 - // https://graphics.stanford.edu/papers/envmap/envmap.pdf - getIrradianceAt: function ( normal, target ) { - - // normal is assumed to be unit length - - var x = normal.x, y = normal.y, z = normal.z; - - var coeff = this.coefficients; - - // band 0 - target.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095 - - // band 1 - target.addScale( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603 - target.addScale( coeff[ 2 ], 2.0 * 0.511664 * z ); - target.addScale( coeff[ 3 ], 2.0 * 0.511664 * x ); - - // band 2 - target.addScale( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548 - target.addScale( coeff[ 5 ], 2.0 * 0.429043 * y * z ); - target.addScale( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3 - target.addScale( coeff[ 7 ], 2.0 * 0.429043 * x * z ); - target.addScale( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274 - - return target; - - }, - - add: function ( sh ) { - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients[ i ].add( sh.coefficients[ i ] ); - - } - - return this; - - }, - - - scale: function ( s ) { - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients[ i ].multiplyScalar( s ); - - } - - return this; - - }, - - lerp: function ( sh, alpha ) { - - for ( var i = 0; i < 9; i ++ ) { - - this.coefficients[ i ].lerp( sh.coefficients[ i ], alpha ); - - } - - return this; - - }, - - equals: function ( sh ) { - - for ( var i = 0; i < 9; i ++ ) { - - if ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) { - - return false; - - } - - } - - return true; - - }, - - copy: function ( sh ) { - - return this.set( sh.coefficients ); - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - var coefficients = this.coefficients; - - for ( var i = 0; i < 9; i ++ ) { - - coefficients[ i ].fromArray( array, offset + ( i * 3 ) ); - - } - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - var coefficients = this.coefficients; - - for ( var i = 0; i < 9; i ++ ) { - - coefficients[ i ].toArray( array, offset + ( i * 3 ) ); - - } - - return array; - - } - -} ); - -Object.assign( SphericalHarmonics3, { - - // evaluate the basis functions - // shBasis is an Array[ 9 ] - getBasisAt: function ( normal, shBasis ) { - - // normal is assumed to be unit length - - var x = normal.x, y = normal.y, z = normal.z; - - // band 0 - shBasis[ 0 ] = 0.282095; - - // band 1 - shBasis[ 1 ] = 0.488603 * y; - shBasis[ 2 ] = 0.488603 * z; - shBasis[ 3 ] = 0.488603 * x; - - // band 2 - shBasis[ 4 ] = 1.092548 * x * y; - shBasis[ 5 ] = 1.092548 * y * z; - shBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 ); - shBasis[ 7 ] = 1.092548 * x * z; - shBasis[ 8 ] = 0.546274 * ( x * x - y * y ); - - } - -} ); - -export { SphericalHarmonics3 }; diff --git a/cases/esbuild-three/src/base/math/Triangle.d.ts b/cases/esbuild-three/src/base/math/Triangle.d.ts deleted file mode 100644 index e7c1747145..0000000000 --- a/cases/esbuild-three/src/base/math/Triangle.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Vector2 } from './Vector2'; -import { Vector3 } from './Vector3'; -import { Plane } from './Plane'; -import { Box3 } from './Box3'; - -export interface SplineControlPoint { - x: number; - y: number; - z: number; -} - -export class Triangle { - - constructor( a?: Vector3, b?: Vector3, c?: Vector3 ); - - a: Vector3; - b: Vector3; - c: Vector3; - - set( a: Vector3, b: Vector3, c: Vector3 ): Triangle; - setFromPointsAndIndices( - points: Vector3[], - i0: number, - i1: number, - i2: number - ): Triangle; - clone(): this; - copy( triangle: Triangle ): this; - getArea(): number; - getMidpoint( target: Vector3 ): Vector3; - getNormal( target: Vector3 ): Vector3; - getPlane( target: Vector3 ): Plane; - getBarycoord( point: Vector3, target: Vector3 ): Vector3; - getUV( point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2 ): Vector2; - containsPoint( point: Vector3 ): boolean; - intersectsBox( box: Box3 ): boolean; - isFrontFacing( direction: Vector3 ): boolean; - closestPointToPoint( point: Vector3, target: Vector3 ): Vector3; - equals( triangle: Triangle ): boolean; - - static getNormal( - a: Vector3, - b: Vector3, - c: Vector3, - target: Vector3 - ): Vector3; - static getBarycoord( - point: Vector3, - a: Vector3, - b: Vector3, - c: Vector3, - target: Vector3 - ): Vector3; - static containsPoint( - point: Vector3, - a: Vector3, - b: Vector3, - c: Vector3 - ): boolean; - static getUV( - point: Vector3, - p1: Vector3, - p2: Vector3, - p3: Vector3, - uv1: Vector2, - uv2: Vector2, - uv3: Vector2, - target: Vector2 - ): Vector2; - static isFrontFacing( - a: Vector3, - b: Vector3, - c: Vector3, - direction: Vector3 - ): boolean; - -} diff --git a/cases/esbuild-three/src/base/math/Triangle.js b/cases/esbuild-three/src/base/math/Triangle.js deleted file mode 100644 index 12f23ef116..0000000000 --- a/cases/esbuild-three/src/base/math/Triangle.js +++ /dev/null @@ -1,334 +0,0 @@ -import { Vector3 } from './Vector3.js'; - -/** - * @author bhouston / http://clara.io - * @author mrdoob / http://mrdoob.com/ - */ - -var _v0 = new Vector3(); -var _v1 = new Vector3(); -var _v2 = new Vector3(); -var _v3 = new Vector3(); - -var _vab = new Vector3(); -var _vac = new Vector3(); -var _vbc = new Vector3(); -var _vap = new Vector3(); -var _vbp = new Vector3(); -var _vcp = new Vector3(); - -function Triangle( a, b, c ) { - - this.a = ( a !== undefined ) ? a : new Vector3(); - this.b = ( b !== undefined ) ? b : new Vector3(); - this.c = ( c !== undefined ) ? c : new Vector3(); - -} - -Object.assign( Triangle, { - - getNormal: function ( a, b, c, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .getNormal() target is now required' ); - target = new Vector3(); - - } - - target.subVectors( c, b ); - _v0.subVectors( a, b ); - target.cross( _v0 ); - - var targetLengthSq = target.lengthSq(); - if ( targetLengthSq > 0 ) { - - return target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) ); - - } - - return target.set( 0, 0, 0 ); - - }, - - // static/instance method to calculate barycentric coordinates - // based on: http://www.blackpawn.com/texts/pointinpoly/default.html - getBarycoord: function ( point, a, b, c, target ) { - - _v0.subVectors( c, a ); - _v1.subVectors( b, a ); - _v2.subVectors( point, a ); - - var dot00 = _v0.dot( _v0 ); - var dot01 = _v0.dot( _v1 ); - var dot02 = _v0.dot( _v2 ); - var dot11 = _v1.dot( _v1 ); - var dot12 = _v1.dot( _v2 ); - - var denom = ( dot00 * dot11 - dot01 * dot01 ); - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .getBarycoord() target is now required' ); - target = new Vector3(); - - } - - // collinear or singular triangle - if ( denom === 0 ) { - - // arbitrary location outside of triangle? - // not sure if this is the best idea, maybe should be returning undefined - return target.set( - 2, - 1, - 1 ); - - } - - var invDenom = 1 / denom; - var u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; - var v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; - - // barycentric coordinates must always sum to 1 - return target.set( 1 - u - v, v, u ); - - }, - - containsPoint: function ( point, a, b, c ) { - - Triangle.getBarycoord( point, a, b, c, _v3 ); - - return ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 ); - - }, - - getUV: function ( point, p1, p2, p3, uv1, uv2, uv3, target ) { - - this.getBarycoord( point, p1, p2, p3, _v3 ); - - target.set( 0, 0 ); - target.addScaledVector( uv1, _v3.x ); - target.addScaledVector( uv2, _v3.y ); - target.addScaledVector( uv3, _v3.z ); - - return target; - - }, - - isFrontFacing: function ( a, b, c, direction ) { - - _v0.subVectors( c, b ); - _v1.subVectors( a, b ); - - // strictly front facing - return ( _v0.cross( _v1 ).dot( direction ) < 0 ) ? true : false; - - } - -} ); - -Object.assign( Triangle.prototype, { - - set: function ( a, b, c ) { - - this.a.copy( a ); - this.b.copy( b ); - this.c.copy( c ); - - return this; - - }, - - setFromPointsAndIndices: function ( points, i0, i1, i2 ) { - - this.a.copy( points[ i0 ] ); - this.b.copy( points[ i1 ] ); - this.c.copy( points[ i2 ] ); - - return this; - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( triangle ) { - - this.a.copy( triangle.a ); - this.b.copy( triangle.b ); - this.c.copy( triangle.c ); - - return this; - - }, - - getArea: function () { - - _v0.subVectors( this.c, this.b ); - _v1.subVectors( this.a, this.b ); - - return _v0.cross( _v1 ).length() * 0.5; - - }, - - getMidpoint: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .getMidpoint() target is now required' ); - target = new Vector3(); - - } - - return target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 ); - - }, - - getNormal: function ( target ) { - - return Triangle.getNormal( this.a, this.b, this.c, target ); - - }, - - getPlane: function ( target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .getPlane() target is now required' ); - target = new Vector3(); - - } - - return target.setFromCoplanarPoints( this.a, this.b, this.c ); - - }, - - getBarycoord: function ( point, target ) { - - return Triangle.getBarycoord( point, this.a, this.b, this.c, target ); - - }, - - getUV: function ( point, uv1, uv2, uv3, target ) { - - return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target ); - - }, - - containsPoint: function ( point ) { - - return Triangle.containsPoint( point, this.a, this.b, this.c ); - - }, - - isFrontFacing: function ( direction ) { - - return Triangle.isFrontFacing( this.a, this.b, this.c, direction ); - - }, - - intersectsBox: function ( box ) { - - return box.intersectsTriangle( this ); - - }, - - closestPointToPoint: function ( p, target ) { - - if ( target === undefined ) { - - console.warn( 'THREE.Triangle: .closestPointToPoint() target is now required' ); - target = new Vector3(); - - } - - var a = this.a, b = this.b, c = this.c; - var v, w; - - // algorithm thanks to Real-Time Collision Detection by Christer Ericson, - // published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc., - // under the accompanying license; see chapter 5.1.5 for detailed explanation. - // basically, we're distinguishing which of the voronoi regions of the triangle - // the point lies in with the minimum amount of redundant computation. - - _vab.subVectors( b, a ); - _vac.subVectors( c, a ); - _vap.subVectors( p, a ); - var d1 = _vab.dot( _vap ); - var d2 = _vac.dot( _vap ); - if ( d1 <= 0 && d2 <= 0 ) { - - // vertex region of A; barycentric coords (1, 0, 0) - return target.copy( a ); - - } - - _vbp.subVectors( p, b ); - var d3 = _vab.dot( _vbp ); - var d4 = _vac.dot( _vbp ); - if ( d3 >= 0 && d4 <= d3 ) { - - // vertex region of B; barycentric coords (0, 1, 0) - return target.copy( b ); - - } - - var vc = d1 * d4 - d3 * d2; - if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) { - - v = d1 / ( d1 - d3 ); - // edge region of AB; barycentric coords (1-v, v, 0) - return target.copy( a ).addScaledVector( _vab, v ); - - } - - _vcp.subVectors( p, c ); - var d5 = _vab.dot( _vcp ); - var d6 = _vac.dot( _vcp ); - if ( d6 >= 0 && d5 <= d6 ) { - - // vertex region of C; barycentric coords (0, 0, 1) - return target.copy( c ); - - } - - var vb = d5 * d2 - d1 * d6; - if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) { - - w = d2 / ( d2 - d6 ); - // edge region of AC; barycentric coords (1-w, 0, w) - return target.copy( a ).addScaledVector( _vac, w ); - - } - - var va = d3 * d6 - d5 * d4; - if ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) { - - _vbc.subVectors( c, b ); - w = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) ); - // edge region of BC; barycentric coords (0, 1-w, w) - return target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC - - } - - // face region - var denom = 1 / ( va + vb + vc ); - // u = va * denom - v = vb * denom; - w = vc * denom; - - return target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w ); - - }, - - equals: function ( triangle ) { - - return triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c ); - - } - -} ); - - -export { Triangle }; diff --git a/cases/esbuild-three/src/base/math/Vector2.d.ts b/cases/esbuild-three/src/base/math/Vector2.d.ts deleted file mode 100644 index 72d0eac11c..0000000000 --- a/cases/esbuild-three/src/base/math/Vector2.d.ts +++ /dev/null @@ -1,462 +0,0 @@ -import { Matrix3 } from './Matrix3'; -import { BufferAttribute } from './../core/BufferAttribute'; - -/** - * ( interface Vector<T> ) - * - * Abstract interface of Vector2, Vector3 and Vector4. - * Currently the members of Vector is NOT type safe because it accepts different typed vectors. - * Those definitions will be changed when TypeScript innovates Generics to be type safe. - * - * @example - * var v:THREE.Vector = new THREE.Vector3(); - * v.addVectors(new THREE.Vector2(0, 1), new THREE.Vector2(2, 3)); // invalid but compiled successfully - */ -export interface Vector { - setComponent( index: number, value: number ): this; - - getComponent( index: number ): number; - - set( ...args: number[] ): this; - - setScalar( scalar: number ): this; - - /** - * copy(v:T):T; - */ - copy( v: Vector ): this; - - /** - * NOTE: The second argument is deprecated. - * - * add(v:T):T; - */ - add( v: Vector, w?: Vector ): this; - - /** - * addVectors(a:T, b:T):T; - */ - addVectors( a: Vector, b: Vector ): this; - - addScaledVector( vector: Vector, scale: number ): this; - - /** - * Adds the scalar value s to this vector's values. - */ - addScalar( scalar: number ): this; - - /** - * sub(v:T):T; - */ - sub( v: Vector ): this; - - /** - * subVectors(a:T, b:T):T; - */ - subVectors( a: Vector, b: Vector ): this; - - /** - * multiplyScalar(s:number):T; - */ - multiplyScalar( s: number ): this; - - /** - * divideScalar(s:number):T; - */ - divideScalar( s: number ): this; - - /** - * negate():T; - */ - negate(): this; - - /** - * dot(v:T):T; - */ - dot( v: Vector ): number; - - /** - * lengthSq():number; - */ - lengthSq(): number; - - /** - * length():number; - */ - length(): number; - - /** - * normalize():T; - */ - normalize(): this; - - /** - * NOTE: Vector4 doesn't have the property. - * - * distanceTo(v:T):number; - */ - distanceTo?( v: Vector ): number; - - /** - * NOTE: Vector4 doesn't have the property. - * - * distanceToSquared(v:T):number; - */ - distanceToSquared?( v: Vector ): number; - - /** - * setLength(l:number):T; - */ - setLength( l: number ): this; - - /** - * lerp(v:T, alpha:number):T; - */ - lerp( v: Vector, alpha: number ): this; - - /** - * equals(v:T):boolean; - */ - equals( v: Vector ): boolean; - - /** - * clone():T; - */ - clone(): this; -} - -/** - * 2D vector. - * - * ( class Vector2 implements Vector ) - */ -export class Vector2 implements Vector { - - constructor( x?: number, y?: number ); - - x: number; - y: number; - width: number; - height: number; - isVector2: true; - - /** - * Sets value of this vector. - */ - set( x: number, y: number ): this; - - /** - * Sets the x and y values of this vector both equal to scalar. - */ - setScalar( scalar: number ): this; - - /** - * Sets X component of this vector. - */ - setX( x: number ): this; - - /** - * Sets Y component of this vector. - */ - setY( y: number ): this; - - /** - * Sets a component of this vector. - */ - setComponent( index: number, value: number ): this; - - /** - * Gets a component of this vector. - */ - getComponent( index: number ): number; - - /** - * Returns a new Vector2 instance with the same `x` and `y` values. - */ - clone(): this; - - /** - * Copies value of v to this vector. - */ - copy( v: Vector2 ): this; - - /** - * Adds v to this vector. - */ - add( v: Vector2, w?: Vector2 ): this; - - /** - * Adds the scalar value s to this vector's x and y values. - */ - addScalar( s: number ): this; - - /** - * Sets this vector to a + b. - */ - addVectors( a: Vector2, b: Vector2 ): this; - - /** - * Adds the multiple of v and s to this vector. - */ - addScaledVector( v: Vector2, s: number ): this; - - /** - * Subtracts v from this vector. - */ - sub( v: Vector2 ): this; - - /** - * Subtracts s from this vector's x and y components. - */ - subScalar( s: number ): this; - - /** - * Sets this vector to a - b. - */ - subVectors( a: Vector2, b: Vector2 ): this; - - /** - * Multiplies this vector by v. - */ - multiply( v: Vector2 ): this; - - /** - * Multiplies this vector by scalar s. - */ - multiplyScalar( scalar: number ): this; - - /** - * Divides this vector by v. - */ - divide( v: Vector2 ): this; - - /** - * Divides this vector by scalar s. - * Set vector to ( 0, 0 ) if s == 0. - */ - divideScalar( s: number ): this; - - /** - * Multiplies this vector (with an implicit 1 as the 3rd component) by m. - */ - applyMatrix3( m: Matrix3 ): this; - - /** - * If this vector's x or y value is greater than v's x or y value, replace that value with the corresponding min value. - */ - min( v: Vector2 ): this; - - /** - * If this vector's x or y value is less than v's x or y value, replace that value with the corresponding max value. - */ - max( v: Vector2 ): this; - - /** - * If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. - * If this vector's x or y value is less than the min vector's x or y value, it is replaced by the corresponding value. - * @param min the minimum x and y values. - * @param max the maximum x and y values in the desired range. - */ - clamp( min: Vector2, max: Vector2 ): this; - - /** - * If this vector's x or y values are greater than the max value, they are replaced by the max value. - * If this vector's x or y values are less than the min value, they are replaced by the min value. - * @param min the minimum value the components will be clamped to. - * @param max the maximum value the components will be clamped to. - */ - clampScalar( min: number, max: number ): this; - - /** - * If this vector's length is greater than the max value, it is replaced by the max value. - * If this vector's length is less than the min value, it is replaced by the min value. - * @param min the minimum value the length will be clamped to. - * @param max the maximum value the length will be clamped to. - */ - clampLength( min: number, max: number ): this; - - /** - * The components of the vector are rounded down to the nearest integer value. - */ - floor(): this; - - /** - * The x and y components of the vector are rounded up to the nearest integer value. - */ - ceil(): this; - - /** - * The components of the vector are rounded to the nearest integer value. - */ - round(): this; - - /** - * The components of the vector are rounded towards zero (up if negative, down if positive) to an integer value. - */ - roundToZero(): this; - - /** - * Inverts this vector. - */ - negate(): this; - - /** - * Computes dot product of this vector and v. - */ - dot( v: Vector2 ): number; - - /** - * Computes cross product of this vector and v. - */ - cross( v: Vector2 ): number; - - /** - * Computes squared length of this vector. - */ - lengthSq(): number; - - /** - * Computes length of this vector. - */ - length(): number; - - /** - * @deprecated Use {@link Vector2#manhattanLength .manhattanLength()} instead. - */ - lengthManhattan(): number; - - /** - * Computes the Manhattan length of this vector. - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanLength(): number; - - /** - * Normalizes this vector. - */ - normalize(): this; - - /** - * computes the angle in radians with respect to the positive x-axis - */ - angle(): number; - - /** - * Computes distance of this vector to v. - */ - distanceTo( v: Vector2 ): number; - - /** - * Computes squared distance of this vector to v. - */ - distanceToSquared( v: Vector2 ): number; - - /** - * @deprecated Use {@link Vector2#manhattanDistanceTo .manhattanDistanceTo()} instead. - */ - distanceToManhattan( v: Vector2 ): number; - - /** - * Computes the Manhattan length (distance) from this vector to the given vector v - * - * @param {Vector2} v - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanDistanceTo( v: Vector2 ): number; - - /** - * Normalizes this vector and multiplies it by l. - */ - setLength( length: number ): this; - - /** - * Linearly interpolates between this vector and v, where alpha is the distance along the line - alpha = 0 will be this vector, and alpha = 1 will be v. - * @param v vector to interpolate towards. - * @param alpha interpolation factor in the closed interval [0, 1]. - */ - lerp( v: Vector2, alpha: number ): this; - - /** - * Sets this vector to be the vector linearly interpolated between v1 and v2 where alpha is the distance along the line connecting the two vectors - alpha = 0 will be v1, and alpha = 1 will be v2. - * @param v1 the starting vector. - * @param v2 vector to interpolate towards. - * @param alpha interpolation factor in the closed interval [0, 1]. - */ - lerpVectors( v1: Vector2, v2: Vector2, alpha: number ): this; - - /** - * Checks for strict equality of this vector and v. - */ - equals( v: Vector2 ): boolean; - - /** - * Sets this vector's x and y value from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets this vector's x and y value from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array [x, y], or copies x and y into the provided array. - * @param array (optional) array to store the vector to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies x and y into the provided array-like. - * @param array array-like to store the vector to. - * @param offset (optional) optional offset into the array. - * @return The provided array-like. - */ - toArray( array: ArrayLike, offset?: number ): ArrayLike; - - /** - * Sets this vector's x and y values from the attribute. - * @param attribute the source attribute. - * @param index index in the attribute. - */ - fromBufferAttribute( attribute: BufferAttribute, index: number ): this; - - /** - * Rotates the vector around center by angle radians. - * @param center the point around which to rotate. - * @param angle the angle to rotate, in radians. - */ - rotateAround( center: Vector2, angle: number ): this; - - /** - * Computes the Manhattan length of this vector. - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanLength(): number; - - /** - * Computes the Manhattan length (distance) from this vector to the given vector v - * - * @param {Vector2} v - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanDistanceTo( v: Vector2 ): number; - -} diff --git a/cases/esbuild-three/src/base/math/Vector2.js b/cases/esbuild-three/src/base/math/Vector2.js deleted file mode 100644 index 9b42c72d8c..0000000000 --- a/cases/esbuild-three/src/base/math/Vector2.js +++ /dev/null @@ -1,492 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author philogb / http://blog.thejit.org/ - * @author egraether / http://egraether.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - */ - -function Vector2( x, y ) { - - this.x = x || 0; - this.y = y || 0; - -} - -Object.defineProperties( Vector2.prototype, { - - "width": { - - get: function () { - - return this.x; - - }, - - set: function ( value ) { - - this.x = value; - - } - - }, - - "height": { - - get: function () { - - return this.y; - - }, - - set: function ( value ) { - - this.y = value; - - } - - } - -} ); - -Object.assign( Vector2.prototype, { - - isVector2: true, - - set: function ( x, y ) { - - this.x = x; - this.y = y; - - return this; - - }, - - setScalar: function ( scalar ) { - - this.x = scalar; - this.y = scalar; - - return this; - - }, - - setX: function ( x ) { - - this.x = x; - - return this; - - }, - - setY: function ( y ) { - - this.y = y; - - return this; - - }, - - setComponent: function ( index, value ) { - - switch ( index ) { - - case 0: this.x = value; break; - case 1: this.y = value; break; - default: throw new Error( 'index is out of range: ' + index ); - - } - - return this; - - }, - - getComponent: function ( index ) { - - switch ( index ) { - - case 0: return this.x; - case 1: return this.y; - default: throw new Error( 'index is out of range: ' + index ); - - } - - }, - - clone: function () { - - return new this.constructor( this.x, this.y ); - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - - return this; - - }, - - add: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); - - } - - this.x += v.x; - this.y += v.y; - - return this; - - }, - - addScalar: function ( s ) { - - this.x += s; - this.y += s; - - return this; - - }, - - addVectors: function ( a, b ) { - - this.x = a.x + b.x; - this.y = a.y + b.y; - - return this; - - }, - - addScaledVector: function ( v, s ) { - - this.x += v.x * s; - this.y += v.y * s; - - return this; - - }, - - sub: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); - - } - - this.x -= v.x; - this.y -= v.y; - - return this; - - }, - - subScalar: function ( s ) { - - this.x -= s; - this.y -= s; - - return this; - - }, - - subVectors: function ( a, b ) { - - this.x = a.x - b.x; - this.y = a.y - b.y; - - return this; - - }, - - multiply: function ( v ) { - - this.x *= v.x; - this.y *= v.y; - - return this; - - }, - - multiplyScalar: function ( scalar ) { - - this.x *= scalar; - this.y *= scalar; - - return this; - - }, - - divide: function ( v ) { - - this.x /= v.x; - this.y /= v.y; - - return this; - - }, - - divideScalar: function ( scalar ) { - - return this.multiplyScalar( 1 / scalar ); - - }, - - applyMatrix3: function ( m ) { - - var x = this.x, y = this.y; - var e = m.elements; - - this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ]; - this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ]; - - return this; - - }, - - min: function ( v ) { - - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - - return this; - - }, - - max: function ( v ) { - - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - - return this; - - }, - - clamp: function ( min, max ) { - - // assumes min < max, componentwise - - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - - return this; - - }, - - clampScalar: function ( minVal, maxVal ) { - - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - - return this; - - }, - - clampLength: function ( min, max ) { - - var length = this.length(); - - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - - }, - - floor: function () { - - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - - return this; - - }, - - ceil: function () { - - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - - return this; - - }, - - round: function () { - - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - - return this; - - }, - - roundToZero: function () { - - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - - return this; - - }, - - negate: function () { - - this.x = - this.x; - this.y = - this.y; - - return this; - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y; - - }, - - cross: function ( v ) { - - return this.x * v.y - this.y * v.x; - - }, - - lengthSq: function () { - - return this.x * this.x + this.y * this.y; - - }, - - length: function () { - - return Math.sqrt( this.x * this.x + this.y * this.y ); - - }, - - manhattanLength: function () { - - return Math.abs( this.x ) + Math.abs( this.y ); - - }, - - normalize: function () { - - return this.divideScalar( this.length() || 1 ); - - }, - - angle: function () { - - // computes the angle in radians with respect to the positive x-axis - - var angle = Math.atan2( this.y, this.x ); - - if ( angle < 0 ) angle += 2 * Math.PI; - - return angle; - - }, - - distanceTo: function ( v ) { - - return Math.sqrt( this.distanceToSquared( v ) ); - - }, - - distanceToSquared: function ( v ) { - - var dx = this.x - v.x, dy = this.y - v.y; - return dx * dx + dy * dy; - - }, - - manhattanDistanceTo: function ( v ) { - - return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ); - - }, - - setLength: function ( length ) { - - return this.normalize().multiplyScalar( length ); - - }, - - lerp: function ( v, alpha ) { - - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - - return this; - - }, - - lerpVectors: function ( v1, v2, alpha ) { - - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); - - }, - - equals: function ( v ) { - - return ( ( v.x === this.x ) && ( v.y === this.y ) ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - - return array; - - }, - - fromBufferAttribute: function ( attribute, index, offset ) { - - if ( offset !== undefined ) { - - console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' ); - - } - - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - - return this; - - }, - - rotateAround: function ( center, angle ) { - - var c = Math.cos( angle ), s = Math.sin( angle ); - - var x = this.x - center.x; - var y = this.y - center.y; - - this.x = x * c - y * s + center.x; - this.y = x * s + y * c + center.y; - - return this; - - } - -} ); - - -export { Vector2 }; diff --git a/cases/esbuild-three/src/base/math/Vector3.d.ts b/cases/esbuild-three/src/base/math/Vector3.d.ts deleted file mode 100644 index 69288a63e9..0000000000 --- a/cases/esbuild-three/src/base/math/Vector3.d.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { Euler } from './Euler'; -import { Matrix3 } from './Matrix3'; -import { Matrix4 } from './Matrix4'; -import { Quaternion } from './Quaternion'; -import { Camera } from './../cameras/Camera'; -import { Spherical } from './Spherical'; -import { Cylindrical } from './Cylindrical'; -import { BufferAttribute } from './../core/BufferAttribute'; -import { Vector } from './Vector2'; -/** - * 3D vector. - * - * @example - * var a = new THREE.Vector3( 1, 0, 0 ); - * var b = new THREE.Vector3( 0, 1, 0 ); - * var c = new THREE.Vector3(); - * c.crossVectors( a, b ); - * - * @see src/math/Vector3.js - * - * ( class Vector3 implements Vector ) - */ -export class Vector3 implements Vector { - - constructor( x?: number, y?: number, z?: number ); - - x: number; - y: number; - z: number; - isVector3: true; - - /** - * Sets value of this vector. - */ - set( x: number, y: number, z: number ): this; - - /** - * Sets all values of this vector. - */ - setScalar( scalar: number ): this; - - /** - * Sets x value of this vector. - */ - setX( x: number ): Vector3; - - /** - * Sets y value of this vector. - */ - setY( y: number ): Vector3; - - /** - * Sets z value of this vector. - */ - setZ( z: number ): Vector3; - - setComponent( index: number, value: number ): this; - - getComponent( index: number ): number; - - /** - * Clones this vector. - */ - clone(): this; - - /** - * Copies value of v to this vector. - */ - copy( v: Vector3 ): this; - - /** - * Adds v to this vector. - */ - add( a: Vector3, b?: Vector3 ): this; - - addScalar( s: number ): this; - - addScaledVector( v: Vector3, s: number ): this; - - /** - * Sets this vector to a + b. - */ - addVectors( a: Vector3, b: Vector3 ): this; - - /** - * Subtracts v from this vector. - */ - sub( a: Vector3 ): this; - - subScalar( s: number ): this; - - /** - * Sets this vector to a - b. - */ - subVectors( a: Vector3, b: Vector3 ): this; - - multiply( v: Vector3 ): this; - - /** - * Multiplies this vector by scalar s. - */ - multiplyScalar( s: number ): this; - - multiplyVectors( a: Vector3, b: Vector3 ): this; - - applyEuler( euler: Euler ): this; - - applyAxisAngle( axis: Vector3, angle: number ): this; - - applyMatrix3( m: Matrix3 ): this; - - applyMatrix4( m: Matrix4 ): this; - - applyQuaternion( q: Quaternion ): this; - - project( camera: Camera ): this; - - unproject( camera: Camera ): this; - - transformDirection( m: Matrix4 ): this; - - divide( v: Vector3 ): this; - - /** - * Divides this vector by scalar s. - * Set vector to ( 0, 0, 0 ) if s == 0. - */ - divideScalar( s: number ): this; - - min( v: Vector3 ): this; - - max( v: Vector3 ): this; - - clamp( min: Vector3, max: Vector3 ): this; - - clampScalar( min: number, max: number ): this; - - clampLength( min: number, max: number ): this; - - floor(): this; - - ceil(): this; - - round(): this; - - roundToZero(): this; - - /** - * Inverts this vector. - */ - negate(): this; - - /** - * Computes dot product of this vector and v. - */ - dot( v: Vector3 ): number; - - /** - * Computes squared length of this vector. - */ - lengthSq(): number; - - /** - * Computes length of this vector. - */ - length(): number; - - /** - * Computes Manhattan length of this vector. - * http://en.wikipedia.org/wiki/Taxicab_geometry - * - * @deprecated Use {@link Vector3#manhattanLength .manhattanLength()} instead. - */ - lengthManhattan(): number; - - /** - * Computes the Manhattan length of this vector. - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanLength(): number; - - /** - * Computes the Manhattan length (distance) from this vector to the given vector v - * - * @param {Vector3} v - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanDistanceTo( v: Vector3 ): number; - - /** - * Normalizes this vector. - */ - normalize(): this; - - /** - * Normalizes this vector and multiplies it by l. - */ - setLength( l: number ): this; - lerp( v: Vector3, alpha: number ): this; - - lerpVectors( v1: Vector3, v2: Vector3, alpha: number ): this; - - /** - * Sets this vector to cross product of itself and v. - */ - cross( a: Vector3, w?: Vector3 ): this; - - /** - * Sets this vector to cross product of a and b. - */ - crossVectors( a: Vector3, b: Vector3 ): this; - projectOnVector( v: Vector3 ): this; - projectOnPlane( planeNormal: Vector3 ): this; - reflect( vector: Vector3 ): this; - angleTo( v: Vector3 ): number; - - /** - * Computes distance of this vector to v. - */ - distanceTo( v: Vector3 ): number; - - /** - * Computes squared distance of this vector to v. - */ - distanceToSquared( v: Vector3 ): number; - - /** - * @deprecated Use {@link Vector3#manhattanDistanceTo .manhattanDistanceTo()} instead. - */ - distanceToManhattan( v: Vector3 ): number; - - setFromSpherical( s: Spherical ): this; - setFromSphericalCoords( r: number, phi: number, theta:number ): this; - setFromCylindrical( s: Cylindrical ): this; - setFromCylindricalCoords( radius: number, theta: number, y: number ): this; - setFromMatrixPosition( m: Matrix4 ): this; - setFromMatrixScale( m: Matrix4 ): this; - setFromMatrixColumn( matrix: Matrix4, index: number ): this; - - /** - * Checks for strict equality of this vector and v. - */ - equals( v: Vector3 ): boolean; - - /** - * Sets this vector's x, y and z value from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets this vector's x, y and z value from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array [x, y, z], or copies x, y and z into the provided array. - * @param array (optional) array to store the vector to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies x, y and z into the provided array-like. - * @param array array-like to store the vector to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( array: ArrayLike, offset?: number ): ArrayLike; - - fromBufferAttribute( - attribute: BufferAttribute, - index: number, - offset?: number - ): this; - -} diff --git a/cases/esbuild-three/src/base/math/Vector3.js b/cases/esbuild-three/src/base/math/Vector3.js deleted file mode 100644 index d1c4dffe3d..0000000000 --- a/cases/esbuild-three/src/base/math/Vector3.js +++ /dev/null @@ -1,700 +0,0 @@ -import { _Math } from './Math.js'; -import { Quaternion } from './Quaternion.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -var _vector = new Vector3(); -var _quaternion = new Quaternion(); - -function Vector3( x, y, z ) { - - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - -} - -Object.assign( Vector3.prototype, { - - isVector3: true, - - set: function ( x, y, z ) { - - this.x = x; - this.y = y; - this.z = z; - - return this; - - }, - - setScalar: function ( scalar ) { - - this.x = scalar; - this.y = scalar; - this.z = scalar; - - return this; - - }, - - setX: function ( x ) { - - this.x = x; - - return this; - - }, - - setY: function ( y ) { - - this.y = y; - - return this; - - }, - - setZ: function ( z ) { - - this.z = z; - - return this; - - }, - - setComponent: function ( index, value ) { - - switch ( index ) { - - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - default: throw new Error( 'index is out of range: ' + index ); - - } - - return this; - - }, - - getComponent: function ( index ) { - - switch ( index ) { - - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - default: throw new Error( 'index is out of range: ' + index ); - - } - - }, - - clone: function () { - - return new this.constructor( this.x, this.y, this.z ); - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - this.z = v.z; - - return this; - - }, - - add: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); - - } - - this.x += v.x; - this.y += v.y; - this.z += v.z; - - return this; - - }, - - addScalar: function ( s ) { - - this.x += s; - this.y += s; - this.z += s; - - return this; - - }, - - addVectors: function ( a, b ) { - - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - - return this; - - }, - - addScaledVector: function ( v, s ) { - - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - - return this; - - }, - - sub: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); - - } - - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - - return this; - - }, - - subScalar: function ( s ) { - - this.x -= s; - this.y -= s; - this.z -= s; - - return this; - - }, - - subVectors: function ( a, b ) { - - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - - return this; - - }, - - multiply: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' ); - return this.multiplyVectors( v, w ); - - } - - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; - - return this; - - }, - - multiplyScalar: function ( scalar ) { - - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - - return this; - - }, - - multiplyVectors: function ( a, b ) { - - this.x = a.x * b.x; - this.y = a.y * b.y; - this.z = a.z * b.z; - - return this; - - }, - - applyEuler: function ( euler ) { - - if ( ! ( euler && euler.isEuler ) ) { - - console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' ); - - } - - return this.applyQuaternion( _quaternion.setFromEuler( euler ) ); - - }, - - applyAxisAngle: function ( axis, angle ) { - - return this.applyQuaternion( _quaternion.setFromAxisAngle( axis, angle ) ); - - }, - - applyMatrix3: function ( m ) { - - var x = this.x, y = this.y, z = this.z; - var e = m.elements; - - this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z; - this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z; - this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z; - - return this; - - }, - - applyMatrix4: function ( m ) { - - var x = this.x, y = this.y, z = this.z; - var e = m.elements; - - var w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] ); - - this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w; - this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w; - this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w; - - return this; - - }, - - applyQuaternion: function ( q ) { - - var x = this.x, y = this.y, z = this.z; - var qx = q.x, qy = q.y, qz = q.z, qw = q.w; - - // calculate quat * vector - - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = - qx * x - qy * y - qz * z; - - // calculate result * inverse quat - - this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy; - this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz; - this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx; - - return this; - - }, - - project: function ( camera ) { - - return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix ); - - }, - - unproject: function ( camera ) { - - return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld ); - - }, - - transformDirection: function ( m ) { - - // input: THREE.Matrix4 affine matrix - // vector interpreted as a direction - - var x = this.x, y = this.y, z = this.z; - var e = m.elements; - - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z; - - return this.normalize(); - - }, - - divide: function ( v ) { - - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; - - return this; - - }, - - divideScalar: function ( scalar ) { - - return this.multiplyScalar( 1 / scalar ); - - }, - - min: function ( v ) { - - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); - - return this; - - }, - - max: function ( v ) { - - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); - - return this; - - }, - - clamp: function ( min, max ) { - - // assumes min < max, componentwise - - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - - return this; - - }, - - clampScalar: function ( minVal, maxVal ) { - - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); - - return this; - - }, - - clampLength: function ( min, max ) { - - var length = this.length(); - - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - - }, - - floor: function () { - - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); - - return this; - - }, - - ceil: function () { - - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); - - return this; - - }, - - round: function () { - - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); - - return this; - - }, - - roundToZero: function () { - - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - - return this; - - }, - - negate: function () { - - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; - - return this; - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y + this.z * v.z; - - }, - - // TODO lengthSquared? - - lengthSq: function () { - - return this.x * this.x + this.y * this.y + this.z * this.z; - - }, - - length: function () { - - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z ); - - }, - - manhattanLength: function () { - - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); - - }, - - normalize: function () { - - return this.divideScalar( this.length() || 1 ); - - }, - - setLength: function ( length ) { - - return this.normalize().multiplyScalar( length ); - - }, - - lerp: function ( v, alpha ) { - - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; - - return this; - - }, - - lerpVectors: function ( v1, v2, alpha ) { - - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); - - }, - - cross: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' ); - return this.crossVectors( v, w ); - - } - - return this.crossVectors( this, v ); - - }, - - crossVectors: function ( a, b ) { - - var ax = a.x, ay = a.y, az = a.z; - var bx = b.x, by = b.y, bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - - }, - - projectOnVector: function ( vector ) { - - var scalar = vector.dot( this ) / vector.lengthSq(); - - return this.copy( vector ).multiplyScalar( scalar ); - - }, - - projectOnPlane: function ( planeNormal ) { - - _vector.copy( this ).projectOnVector( planeNormal ); - - return this.sub( _vector ); - - }, - - reflect: function ( normal ) { - - // reflect incident vector off plane orthogonal to normal - // normal is assumed to have unit length - - return this.sub( _vector.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) ); - - }, - - angleTo: function ( v ) { - - var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) ); - - // clamp, to handle numerical problems - - return Math.acos( _Math.clamp( theta, - 1, 1 ) ); - - }, - - distanceTo: function ( v ) { - - return Math.sqrt( this.distanceToSquared( v ) ); - - }, - - distanceToSquared: function ( v ) { - - var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z; - - return dx * dx + dy * dy + dz * dz; - - }, - - manhattanDistanceTo: function ( v ) { - - return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z ); - - }, - - setFromSpherical: function ( s ) { - - return this.setFromSphericalCoords( s.radius, s.phi, s.theta ); - - }, - - setFromSphericalCoords: function ( radius, phi, theta ) { - - var sinPhiRadius = Math.sin( phi ) * radius; - - this.x = sinPhiRadius * Math.sin( theta ); - this.y = Math.cos( phi ) * radius; - this.z = sinPhiRadius * Math.cos( theta ); - - return this; - - }, - - setFromCylindrical: function ( c ) { - - return this.setFromCylindricalCoords( c.radius, c.theta, c.y ); - - }, - - setFromCylindricalCoords: function ( radius, theta, y ) { - - this.x = radius * Math.sin( theta ); - this.y = y; - this.z = radius * Math.cos( theta ); - - return this; - - }, - - setFromMatrixPosition: function ( m ) { - - var e = m.elements; - - this.x = e[ 12 ]; - this.y = e[ 13 ]; - this.z = e[ 14 ]; - - return this; - - }, - - setFromMatrixScale: function ( m ) { - - var sx = this.setFromMatrixColumn( m, 0 ).length(); - var sy = this.setFromMatrixColumn( m, 1 ).length(); - var sz = this.setFromMatrixColumn( m, 2 ).length(); - - this.x = sx; - this.y = sy; - this.z = sz; - - return this; - - }, - - setFromMatrixColumn: function ( m, index ) { - - return this.fromArray( m.elements, index * 4 ); - - }, - - equals: function ( v ) { - - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; - - return array; - - }, - - fromBufferAttribute: function ( attribute, index, offset ) { - - if ( offset !== undefined ) { - - console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' ); - - } - - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); - - return this; - - } - -} ); - - -export { Vector3 }; diff --git a/cases/esbuild-three/src/base/math/Vector4.d.ts b/cases/esbuild-three/src/base/math/Vector4.d.ts deleted file mode 100644 index 33d12aaaa7..0000000000 --- a/cases/esbuild-three/src/base/math/Vector4.d.ts +++ /dev/null @@ -1,213 +0,0 @@ -import { Matrix4 } from './Matrix4'; -import { Quaternion } from './Quaternion'; -import { Matrix3 } from './Matrix3'; -import { BufferAttribute } from './../core/BufferAttribute'; -import { Vector } from './Vector2'; - -/** - * 4D vector. - * - * ( class Vector4 implements Vector ) - */ -export class Vector4 implements Vector { - - constructor( x?: number, y?: number, z?: number, w?: number ); - - x: number; - y: number; - z: number; - w: number; - width: number; - height: number; - isVector4: true; - - /** - * Sets value of this vector. - */ - set( x: number, y: number, z: number, w: number ): this; - - /** - * Sets all values of this vector. - */ - setScalar( scalar: number ): this; - - /** - * Sets X component of this vector. - */ - setX( x: number ): this; - - /** - * Sets Y component of this vector. - */ - setY( y: number ): this; - - /** - * Sets Z component of this vector. - */ - setZ( z: number ): this; - - /** - * Sets w component of this vector. - */ - setW( w: number ): this; - - setComponent( index: number, value: number ): this; - - getComponent( index: number ): number; - - /** - * Clones this vector. - */ - clone(): this; - - /** - * Copies value of v to this vector. - */ - copy( v: Vector4 ): this; - - /** - * Adds v to this vector. - */ - add( v: Vector4, w?: Vector4 ): this; - - addScalar( scalar: number ): this; - - /** - * Sets this vector to a + b. - */ - addVectors( a: Vector4, b: Vector4 ): this; - - addScaledVector( v: Vector4, s: number ): this; - /** - * Subtracts v from this vector. - */ - sub( v: Vector4 ): this; - - subScalar( s: number ): this; - - /** - * Sets this vector to a - b. - */ - subVectors( a: Vector4, b: Vector4 ): this; - - /** - * Multiplies this vector by scalar s. - */ - multiplyScalar( s: number ): this; - - applyMatrix4( m: Matrix4 ): this; - - /** - * Divides this vector by scalar s. - * Set vector to ( 0, 0, 0 ) if s == 0. - */ - divideScalar( s: number ): this; - - /** - * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm - * @param q is assumed to be normalized - */ - setAxisAngleFromQuaternion( q: Quaternion ): this; - - /** - * http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm - * @param m assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - */ - setAxisAngleFromRotationMatrix( m: Matrix3 ): this; - - min( v: Vector4 ): this; - max( v: Vector4 ): this; - clamp( min: Vector4, max: Vector4 ): this; - clampScalar( min: number, max: number ): this; - floor(): this; - ceil(): this; - round(): this; - roundToZero(): this; - - /** - * Inverts this vector. - */ - negate(): this; - - /** - * Computes dot product of this vector and v. - */ - dot( v: Vector4 ): number; - - /** - * Computes squared length of this vector. - */ - lengthSq(): number; - - /** - * Computes length of this vector. - */ - length(): number; - - /** - * Computes the Manhattan length of this vector. - * - * @return {number} - * - * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry} - */ - manhattanLength(): number; - - /** - * Normalizes this vector. - */ - normalize(): this; - /** - * Normalizes this vector and multiplies it by l. - */ - setLength( length: number ): this; - - /** - * Linearly interpolate between this vector and v with alpha factor. - */ - lerp( v: Vector4, alpha: number ): this; - - lerpVectors( v1: Vector4, v2: Vector4, alpha: number ): this; - - /** - * Checks for strict equality of this vector and v. - */ - equals( v: Vector4 ): boolean; - - /** - * Sets this vector's x, y, z and w value from the provided array. - * @param array the source array. - * @param offset (optional) offset into the array. Default is 0. - */ - fromArray( array: number[], offset?: number ): this; - - /** - * Sets this vector's x, y, z and w value from the provided array-like. - * @param array the source array-like. - * @param offset (optional) offset into the array-like. Default is 0. - */ - fromArray( array: ArrayLike, offset?: number ): this; - - /** - * Returns an array [x, y, z, w], or copies x, y, z and w into the provided array. - * @param array (optional) array to store the vector to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray( array?: number[], offset?: number ): number[]; - - /** - * Copies x, y, z and w into the provided array-like. - * @param array array-like to store the vector to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray( array: ArrayLike, offset?: number ): ArrayLike; - - fromBufferAttribute( - attribute: BufferAttribute, - index: number, - offset?: number - ): this; - -} diff --git a/cases/esbuild-three/src/base/math/Vector4.js b/cases/esbuild-three/src/base/math/Vector4.js deleted file mode 100644 index 2a22f807fb..0000000000 --- a/cases/esbuild-three/src/base/math/Vector4.js +++ /dev/null @@ -1,654 +0,0 @@ -/** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - * @author WestLangley / http://github.com/WestLangley - */ - -function Vector4( x, y, z, w ) { - - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = ( w !== undefined ) ? w : 1; - -} - -Object.defineProperties( Vector4.prototype, { - - "width": { - - get: function () { - - return this.z; - - }, - - set: function ( value ) { - - this.z = value; - - } - - }, - - "height": { - - get: function () { - - return this.w; - - }, - - set: function ( value ) { - - this.w = value; - - } - - } - -} ); - -Object.assign( Vector4.prototype, { - - isVector4: true, - - set: function ( x, y, z, w ) { - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - - }, - - setScalar: function ( scalar ) { - - this.x = scalar; - this.y = scalar; - this.z = scalar; - this.w = scalar; - - return this; - - }, - - setX: function ( x ) { - - this.x = x; - - return this; - - }, - - setY: function ( y ) { - - this.y = y; - - return this; - - }, - - setZ: function ( z ) { - - this.z = z; - - return this; - - }, - - setW: function ( w ) { - - this.w = w; - - return this; - - }, - - setComponent: function ( index, value ) { - - switch ( index ) { - - case 0: this.x = value; break; - case 1: this.y = value; break; - case 2: this.z = value; break; - case 3: this.w = value; break; - default: throw new Error( 'index is out of range: ' + index ); - - } - - return this; - - }, - - getComponent: function ( index ) { - - switch ( index ) { - - case 0: return this.x; - case 1: return this.y; - case 2: return this.z; - case 3: return this.w; - default: throw new Error( 'index is out of range: ' + index ); - - } - - }, - - clone: function () { - - return new this.constructor( this.x, this.y, this.z, this.w ); - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = ( v.w !== undefined ) ? v.w : 1; - - return this; - - }, - - add: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' ); - return this.addVectors( v, w ); - - } - - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; - - return this; - - }, - - addScalar: function ( s ) { - - this.x += s; - this.y += s; - this.z += s; - this.w += s; - - return this; - - }, - - addVectors: function ( a, b ) { - - this.x = a.x + b.x; - this.y = a.y + b.y; - this.z = a.z + b.z; - this.w = a.w + b.w; - - return this; - - }, - - addScaledVector: function ( v, s ) { - - this.x += v.x * s; - this.y += v.y * s; - this.z += v.z * s; - this.w += v.w * s; - - return this; - - }, - - sub: function ( v, w ) { - - if ( w !== undefined ) { - - console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' ); - return this.subVectors( v, w ); - - } - - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; - - return this; - - }, - - subScalar: function ( s ) { - - this.x -= s; - this.y -= s; - this.z -= s; - this.w -= s; - - return this; - - }, - - subVectors: function ( a, b ) { - - this.x = a.x - b.x; - this.y = a.y - b.y; - this.z = a.z - b.z; - this.w = a.w - b.w; - - return this; - - }, - - multiplyScalar: function ( scalar ) { - - this.x *= scalar; - this.y *= scalar; - this.z *= scalar; - this.w *= scalar; - - return this; - - }, - - applyMatrix4: function ( m ) { - - var x = this.x, y = this.y, z = this.z, w = this.w; - var e = m.elements; - - this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w; - this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w; - this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w; - this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w; - - return this; - - }, - - divideScalar: function ( scalar ) { - - return this.multiplyScalar( 1 / scalar ); - - }, - - setAxisAngleFromQuaternion: function ( q ) { - - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm - - // q is assumed to be normalized - - this.w = 2 * Math.acos( q.w ); - - var s = Math.sqrt( 1 - q.w * q.w ); - - if ( s < 0.0001 ) { - - this.x = 1; - this.y = 0; - this.z = 0; - - } else { - - this.x = q.x / s; - this.y = q.y / s; - this.z = q.z / s; - - } - - return this; - - }, - - setAxisAngleFromRotationMatrix: function ( m ) { - - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm - - // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) - - var angle, x, y, z, // variables for result - epsilon = 0.01, // margin to allow for rounding errors - epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees - - te = m.elements, - - m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ], - m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ], - m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ]; - - if ( ( Math.abs( m12 - m21 ) < epsilon ) && - ( Math.abs( m13 - m31 ) < epsilon ) && - ( Math.abs( m23 - m32 ) < epsilon ) ) { - - // singularity found - // first check for identity matrix which must have +1 for all terms - // in leading diagonal and zero in other terms - - if ( ( Math.abs( m12 + m21 ) < epsilon2 ) && - ( Math.abs( m13 + m31 ) < epsilon2 ) && - ( Math.abs( m23 + m32 ) < epsilon2 ) && - ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) { - - // this singularity is identity matrix so angle = 0 - - this.set( 1, 0, 0, 0 ); - - return this; // zero angle, arbitrary axis - - } - - // otherwise this singularity is angle = 180 - - angle = Math.PI; - - var xx = ( m11 + 1 ) / 2; - var yy = ( m22 + 1 ) / 2; - var zz = ( m33 + 1 ) / 2; - var xy = ( m12 + m21 ) / 4; - var xz = ( m13 + m31 ) / 4; - var yz = ( m23 + m32 ) / 4; - - if ( ( xx > yy ) && ( xx > zz ) ) { - - // m11 is the largest diagonal term - - if ( xx < epsilon ) { - - x = 0; - y = 0.707106781; - z = 0.707106781; - - } else { - - x = Math.sqrt( xx ); - y = xy / x; - z = xz / x; - - } - - } else if ( yy > zz ) { - - // m22 is the largest diagonal term - - if ( yy < epsilon ) { - - x = 0.707106781; - y = 0; - z = 0.707106781; - - } else { - - y = Math.sqrt( yy ); - x = xy / y; - z = yz / y; - - } - - } else { - - // m33 is the largest diagonal term so base result on this - - if ( zz < epsilon ) { - - x = 0.707106781; - y = 0.707106781; - z = 0; - - } else { - - z = Math.sqrt( zz ); - x = xz / z; - y = yz / z; - - } - - } - - this.set( x, y, z, angle ); - - return this; // return 180 deg rotation - - } - - // as we have reached here there are no singularities so we can handle normally - - var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) + - ( m13 - m31 ) * ( m13 - m31 ) + - ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize - - if ( Math.abs( s ) < 0.001 ) s = 1; - - // prevent divide by zero, should not happen if matrix is orthogonal and should be - // caught by singularity test above, but I've left it in just in case - - this.x = ( m32 - m23 ) / s; - this.y = ( m13 - m31 ) / s; - this.z = ( m21 - m12 ) / s; - this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 ); - - return this; - - }, - - min: function ( v ) { - - this.x = Math.min( this.x, v.x ); - this.y = Math.min( this.y, v.y ); - this.z = Math.min( this.z, v.z ); - this.w = Math.min( this.w, v.w ); - - return this; - - }, - - max: function ( v ) { - - this.x = Math.max( this.x, v.x ); - this.y = Math.max( this.y, v.y ); - this.z = Math.max( this.z, v.z ); - this.w = Math.max( this.w, v.w ); - - return this; - - }, - - clamp: function ( min, max ) { - - // assumes min < max, componentwise - - this.x = Math.max( min.x, Math.min( max.x, this.x ) ); - this.y = Math.max( min.y, Math.min( max.y, this.y ) ); - this.z = Math.max( min.z, Math.min( max.z, this.z ) ); - this.w = Math.max( min.w, Math.min( max.w, this.w ) ); - - return this; - - }, - - clampScalar: function ( minVal, maxVal ) { - - this.x = Math.max( minVal, Math.min( maxVal, this.x ) ); - this.y = Math.max( minVal, Math.min( maxVal, this.y ) ); - this.z = Math.max( minVal, Math.min( maxVal, this.z ) ); - this.w = Math.max( minVal, Math.min( maxVal, this.w ) ); - - return this; - - }, - - clampLength: function ( min, max ) { - - var length = this.length(); - - return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) ); - - }, - - floor: function () { - - this.x = Math.floor( this.x ); - this.y = Math.floor( this.y ); - this.z = Math.floor( this.z ); - this.w = Math.floor( this.w ); - - return this; - - }, - - ceil: function () { - - this.x = Math.ceil( this.x ); - this.y = Math.ceil( this.y ); - this.z = Math.ceil( this.z ); - this.w = Math.ceil( this.w ); - - return this; - - }, - - round: function () { - - this.x = Math.round( this.x ); - this.y = Math.round( this.y ); - this.z = Math.round( this.z ); - this.w = Math.round( this.w ); - - return this; - - }, - - roundToZero: function () { - - this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x ); - this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y ); - this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z ); - this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w ); - - return this; - - }, - - negate: function () { - - this.x = - this.x; - this.y = - this.y; - this.z = - this.z; - this.w = - this.w; - - return this; - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - - }, - - lengthSq: function () { - - return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w; - - }, - - length: function () { - - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - - }, - - manhattanLength: function () { - - return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w ); - - }, - - normalize: function () { - - return this.divideScalar( this.length() || 1 ); - - }, - - setLength: function ( length ) { - - return this.normalize().multiplyScalar( length ); - - }, - - lerp: function ( v, alpha ) { - - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; - this.w += ( v.w - this.w ) * alpha; - - return this; - - }, - - lerpVectors: function ( v1, v2, alpha ) { - - return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 ); - - }, - - equals: function ( v ) { - - return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) ); - - }, - - fromArray: function ( array, offset ) { - - if ( offset === undefined ) offset = 0; - - this.x = array[ offset ]; - this.y = array[ offset + 1 ]; - this.z = array[ offset + 2 ]; - this.w = array[ offset + 3 ]; - - return this; - - }, - - toArray: function ( array, offset ) { - - if ( array === undefined ) array = []; - if ( offset === undefined ) offset = 0; - - array[ offset ] = this.x; - array[ offset + 1 ] = this.y; - array[ offset + 2 ] = this.z; - array[ offset + 3 ] = this.w; - - return array; - - }, - - fromBufferAttribute: function ( attribute, index, offset ) { - - if ( offset !== undefined ) { - - console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' ); - - } - - this.x = attribute.getX( index ); - this.y = attribute.getY( index ); - this.z = attribute.getZ( index ); - this.w = attribute.getW( index ); - - return this; - - } - -} ); - - -export { Vector4 }; diff --git a/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.d.ts b/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.d.ts deleted file mode 100644 index 435d476fc4..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Interpolant } from '../Interpolant'; - -export class CubicInterpolant extends Interpolant { - - constructor( - parameterPositions: any, - samplesValues: any, - sampleSize: number, - resultBuffer?: any - ); - - interpolate_( i1: number, t0: number, t: number, t1: number ): any; - -} diff --git a/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.js b/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.js deleted file mode 100644 index 152505d8fc..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/CubicInterpolant.js +++ /dev/null @@ -1,156 +0,0 @@ -import { ZeroCurvatureEnding } from '../../constants.js'; -import { Interpolant } from '../Interpolant.js'; -import { WrapAroundEnding, ZeroSlopeEnding } from '../../constants.js'; - -/** - * Fast and simple cubic spline interpolant. - * - * It was derived from a Hermitian construction setting the first derivative - * at each sample position to the linear slope between neighboring positions - * over their parameter interval. - * - * @author tschw - */ - -function CubicInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); - - this._weightPrev = - 0; - this._offsetPrev = - 0; - this._weightNext = - 0; - this._offsetNext = - 0; - -} - -CubicInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { - - constructor: CubicInterpolant, - - DefaultSettings_: { - - endingStart: ZeroCurvatureEnding, - endingEnd: ZeroCurvatureEnding - - }, - - intervalChanged_: function ( i1, t0, t1 ) { - - var pp = this.parameterPositions, - iPrev = i1 - 2, - iNext = i1 + 1, - - tPrev = pp[ iPrev ], - tNext = pp[ iNext ]; - - if ( tPrev === undefined ) { - - switch ( this.getSettings_().endingStart ) { - - case ZeroSlopeEnding: - - // f'(t0) = 0 - iPrev = i1; - tPrev = 2 * t0 - t1; - - break; - - case WrapAroundEnding: - - // use the other end of the curve - iPrev = pp.length - 2; - tPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ]; - - break; - - default: // ZeroCurvatureEnding - - // f''(t0) = 0 a.k.a. Natural Spline - iPrev = i1; - tPrev = t1; - - } - - } - - if ( tNext === undefined ) { - - switch ( this.getSettings_().endingEnd ) { - - case ZeroSlopeEnding: - - // f'(tN) = 0 - iNext = i1; - tNext = 2 * t1 - t0; - - break; - - case WrapAroundEnding: - - // use the other end of the curve - iNext = 1; - tNext = t1 + pp[ 1 ] - pp[ 0 ]; - - break; - - default: // ZeroCurvatureEnding - - // f''(tN) = 0, a.k.a. Natural Spline - iNext = i1 - 1; - tNext = t0; - - } - - } - - var halfDt = ( t1 - t0 ) * 0.5, - stride = this.valueSize; - - this._weightPrev = halfDt / ( t0 - tPrev ); - this._weightNext = halfDt / ( tNext - t1 ); - this._offsetPrev = iPrev * stride; - this._offsetNext = iNext * stride; - - }, - - interpolate_: function ( i1, t0, t, t1 ) { - - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, - - o1 = i1 * stride, o0 = o1 - stride, - oP = this._offsetPrev, oN = this._offsetNext, - wP = this._weightPrev, wN = this._weightNext, - - p = ( t - t0 ) / ( t1 - t0 ), - pp = p * p, - ppp = pp * p; - - // evaluate polynomials - - var sP = - wP * ppp + 2 * wP * pp - wP * p; - var s0 = ( 1 + wP ) * ppp + ( - 1.5 - 2 * wP ) * pp + ( - 0.5 + wP ) * p + 1; - var s1 = ( - 1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p; - var sN = wN * ppp - wN * pp; - - // combine data linearly - - for ( var i = 0; i !== stride; ++ i ) { - - result[ i ] = - sP * values[ oP + i ] + - s0 * values[ o0 + i ] + - s1 * values[ o1 + i ] + - sN * values[ oN + i ]; - - } - - return result; - - } - -} ); - - -export { CubicInterpolant }; diff --git a/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.d.ts b/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.d.ts deleted file mode 100644 index f553d17c4a..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Interpolant } from '../Interpolant'; - -export class DiscreteInterpolant extends Interpolant { - - constructor( - parameterPositions: any, - samplesValues: any, - sampleSize: number, - resultBuffer?: any - ); - - interpolate_( i1: number, t0: number, t: number, t1: number ): any; - -} diff --git a/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.js b/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.js deleted file mode 100644 index 5d3f8e6005..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/DiscreteInterpolant.js +++ /dev/null @@ -1,30 +0,0 @@ -import { Interpolant } from '../Interpolant.js'; - -/** - * - * Interpolant that evaluates to the sample value at the position preceeding - * the parameter. - * - * @author tschw - */ - -function DiscreteInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); - -} - -DiscreteInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { - - constructor: DiscreteInterpolant, - - interpolate_: function ( i1 /*, t0, t, t1 */ ) { - - return this.copySampleValue_( i1 - 1 ); - - } - -} ); - - -export { DiscreteInterpolant }; diff --git a/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.d.ts b/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.d.ts deleted file mode 100644 index e539a0960b..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Interpolant } from '../Interpolant'; - -export class LinearInterpolant extends Interpolant { - - constructor( - parameterPositions: any, - samplesValues: any, - sampleSize: number, - resultBuffer?: any - ); - - interpolate_( i1: number, t0: number, t: number, t1: number ): any; - -} diff --git a/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.js b/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.js deleted file mode 100644 index 32d6aee9bf..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/LinearInterpolant.js +++ /dev/null @@ -1,44 +0,0 @@ -import { Interpolant } from '../Interpolant.js'; - -/** - * @author tschw - */ - -function LinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); - -} - -LinearInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { - - constructor: LinearInterpolant, - - interpolate_: function ( i1, t0, t, t1 ) { - - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, - - offset1 = i1 * stride, - offset0 = offset1 - stride, - - weight1 = ( t - t0 ) / ( t1 - t0 ), - weight0 = 1 - weight1; - - for ( var i = 0; i !== stride; ++ i ) { - - result[ i ] = - values[ offset0 + i ] * weight0 + - values[ offset1 + i ] * weight1; - - } - - return result; - - } - -} ); - - -export { LinearInterpolant }; diff --git a/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.d.ts b/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.d.ts deleted file mode 100644 index 6519fd9180..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Interpolant } from '../Interpolant'; - -export class QuaternionLinearInterpolant extends Interpolant { - - constructor( - parameterPositions: any, - samplesValues: any, - sampleSize: number, - resultBuffer?: any - ); - - interpolate_( i1: number, t0: number, t: number, t1: number ): any; - -} diff --git a/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.js b/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.js deleted file mode 100644 index d90bbff726..0000000000 --- a/cases/esbuild-three/src/base/math/interpolants/QuaternionLinearInterpolant.js +++ /dev/null @@ -1,43 +0,0 @@ -import { Interpolant } from '../Interpolant.js'; -import { Quaternion } from '../Quaternion.js'; - -/** - * Spherical linear unit quaternion interpolant. - * - * @author tschw - */ - -function QuaternionLinearInterpolant( parameterPositions, sampleValues, sampleSize, resultBuffer ) { - - Interpolant.call( this, parameterPositions, sampleValues, sampleSize, resultBuffer ); - -} - -QuaternionLinearInterpolant.prototype = Object.assign( Object.create( Interpolant.prototype ), { - - constructor: QuaternionLinearInterpolant, - - interpolate_: function ( i1, t0, t, t1 ) { - - var result = this.resultBuffer, - values = this.sampleValues, - stride = this.valueSize, - - offset = i1 * stride, - - alpha = ( t - t0 ) / ( t1 - t0 ); - - for ( var end = offset + stride; offset !== end; offset += 4 ) { - - Quaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha ); - - } - - return result; - - } - -} ); - - -export { QuaternionLinearInterpolant }; diff --git a/cases/esbuild-three/src/base/objects/Bone.d.ts b/cases/esbuild-three/src/base/objects/Bone.d.ts deleted file mode 100644 index d6fe386cb1..0000000000 --- a/cases/esbuild-three/src/base/objects/Bone.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Object3D } from './../core/Object3D'; - -// Objects ////////////////////////////////////////////////////////////////////////////////// - -export class Bone extends Object3D { - - constructor(); - isBone: true; - type: 'Bone'; - -} diff --git a/cases/esbuild-three/src/base/objects/Bone.js b/cases/esbuild-three/src/base/objects/Bone.js deleted file mode 100644 index bbe66db0cc..0000000000 --- a/cases/esbuild-three/src/base/objects/Bone.js +++ /dev/null @@ -1,26 +0,0 @@ -import { Object3D } from '../core/Object3D.js'; - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author ikerr / http://verold.com - */ - -function Bone() { - - Object3D.call( this ); - - this.type = 'Bone'; - -} - -Bone.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Bone, - - isBone: true - -} ); - - -export { Bone }; diff --git a/cases/esbuild-three/src/base/objects/Group.d.ts b/cases/esbuild-three/src/base/objects/Group.d.ts deleted file mode 100644 index 294a40e152..0000000000 --- a/cases/esbuild-three/src/base/objects/Group.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Object3D } from './../core/Object3D'; - -export class Group extends Object3D { - - constructor(); - type: 'Group'; - isGroup: true; - -} diff --git a/cases/esbuild-three/src/base/objects/Group.js b/cases/esbuild-three/src/base/objects/Group.js deleted file mode 100644 index d4ded34d68..0000000000 --- a/cases/esbuild-three/src/base/objects/Group.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Object3D } from '../core/Object3D.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function Group() { - - Object3D.call( this ); - - this.type = 'Group'; - -} - -Group.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Group, - - isGroup: true - -} ); - - -export { Group }; diff --git a/cases/esbuild-three/src/base/objects/LOD.d.ts b/cases/esbuild-three/src/base/objects/LOD.d.ts deleted file mode 100644 index b0aed1ed77..0000000000 --- a/cases/esbuild-three/src/base/objects/LOD.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Object3D } from './../core/Object3D'; -import { Raycaster } from './../core/Raycaster'; -import { Camera } from './../cameras/Camera'; -import { Intersection } from '../core/Raycaster'; - -export class LOD extends Object3D { - - constructor(); - - type: 'LOD'; - - levels: { distance: number; object: Object3D }[]; - - addLevel( object: Object3D, distance?: number ): this; - getObjectForDistance( distance: number ): Object3D; - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - update( camera: Camera ): void; - toJSON( meta: any ): any; - - /** - * @deprecated Use {@link LOD#levels .levels} instead. - */ - objects: any[]; - -} diff --git a/cases/esbuild-three/src/base/objects/LOD.js b/cases/esbuild-three/src/base/objects/LOD.js deleted file mode 100644 index 098ec8a0db..0000000000 --- a/cases/esbuild-three/src/base/objects/LOD.js +++ /dev/null @@ -1,172 +0,0 @@ -import { Vector3 } from '../math/Vector3.js'; -import { Object3D } from '../core/Object3D.js'; - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -var _v1 = new Vector3(); -var _v2 = new Vector3(); - -function LOD() { - - Object3D.call( this ); - - this.type = 'LOD'; - - Object.defineProperties( this, { - levels: { - enumerable: true, - value: [] - } - } ); - - this.autoUpdate = true; - -} - -LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: LOD, - - isLOD: true, - - copy: function ( source ) { - - Object3D.prototype.copy.call( this, source, false ); - - var levels = source.levels; - - for ( var i = 0, l = levels.length; i < l; i ++ ) { - - var level = levels[ i ]; - - this.addLevel( level.object.clone(), level.distance ); - - } - - return this; - - }, - - addLevel: function ( object, distance ) { - - if ( distance === undefined ) distance = 0; - - distance = Math.abs( distance ); - - var levels = this.levels; - - for ( var l = 0; l < levels.length; l ++ ) { - - if ( distance < levels[ l ].distance ) { - - break; - - } - - } - - levels.splice( l, 0, { distance: distance, object: object } ); - - this.add( object ); - - return this; - - }, - - getObjectForDistance: function ( distance ) { - - var levels = this.levels; - - for ( var i = 1, l = levels.length; i < l; i ++ ) { - - if ( distance < levels[ i ].distance ) { - - break; - - } - - } - - return levels[ i - 1 ].object; - - }, - - raycast: function ( raycaster, intersects ) { - - _v1.setFromMatrixPosition( this.matrixWorld ); - - var distance = raycaster.ray.origin.distanceTo( _v1 ); - - this.getObjectForDistance( distance ).raycast( raycaster, intersects ); - - }, - - update: function ( camera ) { - - var levels = this.levels; - - if ( levels.length > 1 ) { - - _v1.setFromMatrixPosition( camera.matrixWorld ); - _v2.setFromMatrixPosition( this.matrixWorld ); - - var distance = _v1.distanceTo( _v2 ); - - levels[ 0 ].object.visible = true; - - for ( var i = 1, l = levels.length; i < l; i ++ ) { - - if ( distance >= levels[ i ].distance ) { - - levels[ i - 1 ].object.visible = false; - levels[ i ].object.visible = true; - - } else { - - break; - - } - - } - - for ( ; i < l; i ++ ) { - - levels[ i ].object.visible = false; - - } - - } - - }, - - toJSON: function ( meta ) { - - var data = Object3D.prototype.toJSON.call( this, meta ); - - data.object.levels = []; - - var levels = this.levels; - - for ( var i = 0, l = levels.length; i < l; i ++ ) { - - var level = levels[ i ]; - - data.object.levels.push( { - object: level.object.uuid, - distance: level.distance - } ); - - } - - return data; - - } - -} ); - - -export { LOD }; diff --git a/cases/esbuild-three/src/base/objects/Line.d.ts b/cases/esbuild-three/src/base/objects/Line.d.ts deleted file mode 100644 index 853074cd2f..0000000000 --- a/cases/esbuild-three/src/base/objects/Line.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { Raycaster } from './../core/Raycaster'; -import { Object3D } from './../core/Object3D'; -import { BufferGeometry } from '../core/BufferGeometry'; -import { Intersection } from '../core/Raycaster'; - -export class Line extends Object3D { - - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[], - mode?: number - ); - - geometry: Geometry | BufferGeometry; - material: Material | Material[]; - - type: 'Line' | 'LineLoop' | 'LineSegments'; - isLine: true; - - computeLineDistances(): this; - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - -} diff --git a/cases/esbuild-three/src/base/objects/Line.js b/cases/esbuild-three/src/base/objects/Line.js deleted file mode 100644 index b1ee1f56cb..0000000000 --- a/cases/esbuild-three/src/base/objects/Line.js +++ /dev/null @@ -1,247 +0,0 @@ -import { Sphere } from '../math/Sphere.js'; -import { Ray } from '../math/Ray.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Object3D } from '../core/Object3D.js'; -import { Vector3 } from '../math/Vector3.js'; -import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -var _start = new Vector3(); -var _end = new Vector3(); -var _inverseMatrix = new Matrix4(); -var _ray = new Ray(); -var _sphere = new Sphere(); - -function Line( geometry, material, mode ) { - - if ( mode === 1 ) { - - console.error( 'THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead.' ); - - } - - Object3D.call( this ); - - this.type = 'Line'; - - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new LineBasicMaterial( { color: Math.random() * 0xffffff } ); - -} - -Line.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Line, - - isLine: true, - - computeLineDistances: function () { - - var geometry = this.geometry; - - if ( geometry.isBufferGeometry ) { - - // we assume non-indexed geometry - - if ( geometry.index === null ) { - - var positionAttribute = geometry.attributes.position; - var lineDistances = [ 0 ]; - - for ( var i = 1, l = positionAttribute.count; i < l; i ++ ) { - - _start.fromBufferAttribute( positionAttribute, i - 1 ); - _end.fromBufferAttribute( positionAttribute, i ); - - lineDistances[ i ] = lineDistances[ i - 1 ]; - lineDistances[ i ] += _start.distanceTo( _end ); - - } - - geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); - - } else { - - console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); - - } - - } else if ( geometry.isGeometry ) { - - var vertices = geometry.vertices; - var lineDistances = geometry.lineDistances; - - lineDistances[ 0 ] = 0; - - for ( var i = 1, l = vertices.length; i < l; i ++ ) { - - lineDistances[ i ] = lineDistances[ i - 1 ]; - lineDistances[ i ] += vertices[ i - 1 ].distanceTo( vertices[ i ] ); - - } - - } - - return this; - - }, - - raycast: function ( raycaster, intersects ) { - - var precision = raycaster.linePrecision; - - var geometry = this.geometry; - var matrixWorld = this.matrixWorld; - - // Checking boundingSphere distance to ray - - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - - _sphere.copy( geometry.boundingSphere ); - _sphere.applyMatrix4( matrixWorld ); - _sphere.radius += precision; - - if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return; - - // - - _inverseMatrix.getInverse( matrixWorld ); - _ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix ); - - var localPrecision = precision / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); - var localPrecisionSq = localPrecision * localPrecision; - - var vStart = new Vector3(); - var vEnd = new Vector3(); - var interSegment = new Vector3(); - var interRay = new Vector3(); - var step = ( this && this.isLineSegments ) ? 2 : 1; - - if ( geometry.isBufferGeometry ) { - - var index = geometry.index; - var attributes = geometry.attributes; - var positions = attributes.position.array; - - if ( index !== null ) { - - var indices = index.array; - - for ( var i = 0, l = indices.length - 1; i < l; i += step ) { - - var a = indices[ i ]; - var b = indices[ i + 1 ]; - - vStart.fromArray( positions, a * 3 ); - vEnd.fromArray( positions, b * 3 ); - - var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); - - if ( distSq > localPrecisionSq ) continue; - - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation - - var distance = raycaster.ray.origin.distanceTo( interRay ); - - if ( distance < raycaster.near || distance > raycaster.far ) continue; - - intersects.push( { - - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this - - } ); - - } - - } else { - - for ( var i = 0, l = positions.length / 3 - 1; i < l; i += step ) { - - vStart.fromArray( positions, 3 * i ); - vEnd.fromArray( positions, 3 * i + 3 ); - - var distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment ); - - if ( distSq > localPrecisionSq ) continue; - - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation - - var distance = raycaster.ray.origin.distanceTo( interRay ); - - if ( distance < raycaster.near || distance > raycaster.far ) continue; - - intersects.push( { - - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this - - } ); - - } - - } - - } else if ( geometry.isGeometry ) { - - var vertices = geometry.vertices; - var nbVertices = vertices.length; - - for ( var i = 0; i < nbVertices - 1; i += step ) { - - var distSq = _ray.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment ); - - if ( distSq > localPrecisionSq ) continue; - - interRay.applyMatrix4( this.matrixWorld ); //Move back to world space for distance calculation - - var distance = raycaster.ray.origin.distanceTo( interRay ); - - if ( distance < raycaster.near || distance > raycaster.far ) continue; - - intersects.push( { - - distance: distance, - // What do we want? intersection point on the ray or on the segment?? - // point: raycaster.ray.at( distance ), - point: interSegment.clone().applyMatrix4( this.matrixWorld ), - index: i, - face: null, - faceIndex: null, - object: this - - } ); - - } - - } - - }, - - clone: function () { - - return new this.constructor( this.geometry, this.material ).copy( this ); - - } - -} ); - - -export { Line }; diff --git a/cases/esbuild-three/src/base/objects/LineLoop.d.ts b/cases/esbuild-three/src/base/objects/LineLoop.d.ts deleted file mode 100644 index 37bd91b1db..0000000000 --- a/cases/esbuild-three/src/base/objects/LineLoop.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Line } from './Line'; -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { BufferGeometry } from '../core/BufferGeometry'; - -export class LineLoop extends Line { - - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[] - ); - - type: 'LineLoop'; - isLineLoop: true; - -} diff --git a/cases/esbuild-three/src/base/objects/LineLoop.js b/cases/esbuild-three/src/base/objects/LineLoop.js deleted file mode 100644 index 9fc29cd88d..0000000000 --- a/cases/esbuild-three/src/base/objects/LineLoop.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Line } from './Line.js'; - -/** - * @author mgreter / http://github.com/mgreter - */ - -function LineLoop( geometry, material ) { - - Line.call( this, geometry, material ); - - this.type = 'LineLoop'; - -} - -LineLoop.prototype = Object.assign( Object.create( Line.prototype ), { - - constructor: LineLoop, - - isLineLoop: true, - -} ); - - -export { LineLoop }; diff --git a/cases/esbuild-three/src/base/objects/LineSegments.d.ts b/cases/esbuild-three/src/base/objects/LineSegments.d.ts deleted file mode 100644 index 94381cc6c8..0000000000 --- a/cases/esbuild-three/src/base/objects/LineSegments.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { Line } from './Line'; -import { BufferGeometry } from '../core/BufferGeometry'; - -/** - * @deprecated - */ -export const LineStrip: number; -/** - * @deprecated - */ -export const LinePieces: number; - -export class LineSegments extends Line { - - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[], - mode?: number - ); - - type: 'LineSegments'; - isLineSegments: true; - -} diff --git a/cases/esbuild-three/src/base/objects/LineSegments.js b/cases/esbuild-three/src/base/objects/LineSegments.js deleted file mode 100644 index 6bbb7e2e96..0000000000 --- a/cases/esbuild-three/src/base/objects/LineSegments.js +++ /dev/null @@ -1,81 +0,0 @@ -import { Line } from './Line.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Float32BufferAttribute } from '../core/BufferAttribute.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -var _start = new Vector3(); -var _end = new Vector3(); - -function LineSegments( geometry, material ) { - - Line.call( this, geometry, material ); - - this.type = 'LineSegments'; - -} - -LineSegments.prototype = Object.assign( Object.create( Line.prototype ), { - - constructor: LineSegments, - - isLineSegments: true, - - computeLineDistances: function () { - - var geometry = this.geometry; - - if ( geometry.isBufferGeometry ) { - - // we assume non-indexed geometry - - if ( geometry.index === null ) { - - var positionAttribute = geometry.attributes.position; - var lineDistances = []; - - for ( var i = 0, l = positionAttribute.count; i < l; i += 2 ) { - - _start.fromBufferAttribute( positionAttribute, i ); - _end.fromBufferAttribute( positionAttribute, i + 1 ); - - lineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ]; - lineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end ); - - } - - geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) ); - - } else { - - console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' ); - - } - - } else if ( geometry.isGeometry ) { - - var vertices = geometry.vertices; - var lineDistances = geometry.lineDistances; - - for ( var i = 0, l = vertices.length; i < l; i += 2 ) { - - _start.copy( vertices[ i ] ); - _end.copy( vertices[ i + 1 ] ); - - lineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ]; - lineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end ); - - } - - } - - return this; - - } - -} ); - - -export { LineSegments }; diff --git a/cases/esbuild-three/src/base/objects/Mesh.d.ts b/cases/esbuild-three/src/base/objects/Mesh.d.ts deleted file mode 100644 index 3a8b6176ff..0000000000 --- a/cases/esbuild-three/src/base/objects/Mesh.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { Raycaster } from './../core/Raycaster'; -import { Object3D } from './../core/Object3D'; -import { BufferGeometry } from '../core/BufferGeometry'; -import { Intersection } from '../core/Raycaster'; -import { TrianglesDrawModes } from '../constants'; - -export class Mesh extends Object3D { - - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[] - ); - - geometry: Geometry | BufferGeometry; - material: Material | Material[]; - drawMode: TrianglesDrawModes; - morphTargetInfluences?: number[]; - morphTargetDictionary?: { [key: string]: number }; - isMesh: true; - type: string; - - setDrawMode( drawMode: TrianglesDrawModes ): void; - updateMorphTargets(): void; - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - -} diff --git a/cases/esbuild-three/src/base/objects/Mesh.js b/cases/esbuild-three/src/base/objects/Mesh.js deleted file mode 100644 index 6f16a21c20..0000000000 --- a/cases/esbuild-three/src/base/objects/Mesh.js +++ /dev/null @@ -1,463 +0,0 @@ -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Sphere } from '../math/Sphere.js'; -import { Ray } from '../math/Ray.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Object3D } from '../core/Object3D.js'; -import { Triangle } from '../math/Triangle.js'; -import { Face3 } from '../core/Face3.js'; -import { DoubleSide, BackSide, TrianglesDrawMode } from '../constants.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author jonobr1 / http://jonobr1.com/ - */ - -var _inverseMatrix = new Matrix4(); -var _ray = new Ray(); -var _sphere = new Sphere(); - -var _vA = new Vector3(); -var _vB = new Vector3(); -var _vC = new Vector3(); - -var _tempA = new Vector3(); -var _tempB = new Vector3(); -var _tempC = new Vector3(); - -var _morphA = new Vector3(); -var _morphB = new Vector3(); -var _morphC = new Vector3(); - -var _uvA = new Vector2(); -var _uvB = new Vector2(); -var _uvC = new Vector2(); - -var _intersectionPoint = new Vector3(); -var _intersectionPointWorld = new Vector3(); - -function Mesh( geometry, material ) { - - Object3D.call( this ); - - this.type = 'Mesh'; - - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new MeshBasicMaterial( { color: Math.random() * 0xffffff } ); - - this.drawMode = TrianglesDrawMode; - - this.updateMorphTargets(); - -} - -Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Mesh, - - isMesh: true, - - setDrawMode: function ( value ) { - - this.drawMode = value; - - }, - - copy: function ( source ) { - - Object3D.prototype.copy.call( this, source ); - - this.drawMode = source.drawMode; - - if ( source.morphTargetInfluences !== undefined ) { - - this.morphTargetInfluences = source.morphTargetInfluences.slice(); - - } - - if ( source.morphTargetDictionary !== undefined ) { - - this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary ); - - } - - return this; - - }, - - updateMorphTargets: function () { - - var geometry = this.geometry; - var m, ml, name; - - if ( geometry.isBufferGeometry ) { - - var morphAttributes = geometry.morphAttributes; - var keys = Object.keys( morphAttributes ); - - if ( keys.length > 0 ) { - - var morphAttribute = morphAttributes[ keys[ 0 ] ]; - - if ( morphAttribute !== undefined ) { - - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - - for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - - name = morphAttribute[ m ].name || String( m ); - - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ name ] = m; - - } - - } - - } - - } else { - - var morphTargets = geometry.morphTargets; - - if ( morphTargets !== undefined && morphTargets.length > 0 ) { - - console.error( 'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); - - } - - } - - }, - - raycast: function ( raycaster, intersects ) { - - var geometry = this.geometry; - var material = this.material; - var matrixWorld = this.matrixWorld; - - if ( material === undefined ) return; - - // Checking boundingSphere distance to ray - - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - - _sphere.copy( geometry.boundingSphere ); - _sphere.applyMatrix4( matrixWorld ); - - if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return; - - // - - _inverseMatrix.getInverse( matrixWorld ); - _ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix ); - - // Check boundingBox before continuing - - if ( geometry.boundingBox !== null ) { - - if ( _ray.intersectsBox( geometry.boundingBox ) === false ) return; - - } - - var intersection; - - if ( geometry.isBufferGeometry ) { - - var a, b, c; - var index = geometry.index; - var position = geometry.attributes.position; - var morphPosition = geometry.morphAttributes.position; - var uv = geometry.attributes.uv; - var uv2 = geometry.attributes.uv2; - var groups = geometry.groups; - var drawRange = geometry.drawRange; - var i, j, il, jl; - var group, groupMaterial; - var start, end; - - if ( index !== null ) { - - // indexed buffer geometry - - if ( Array.isArray( material ) ) { - - for ( i = 0, il = groups.length; i < il; i ++ ) { - - group = groups[ i ]; - groupMaterial = material[ group.materialIndex ]; - - start = Math.max( group.start, drawRange.start ); - end = Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ); - - for ( j = start, jl = end; j < jl; j += 3 ) { - - a = index.getX( j ); - b = index.getX( j + 1 ); - c = index.getX( j + 2 ); - - intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray, position, morphPosition, uv, uv2, a, b, c ); - - if ( intersection ) { - - intersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics - intersection.face.materialIndex = group.materialIndex; - intersects.push( intersection ); - - } - - } - - } - - } else { - - start = Math.max( 0, drawRange.start ); - end = Math.min( index.count, ( drawRange.start + drawRange.count ) ); - - for ( i = start, il = end; i < il; i += 3 ) { - - a = index.getX( i ); - b = index.getX( i + 1 ); - c = index.getX( i + 2 ); - - intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray, position, morphPosition, uv, uv2, a, b, c ); - - if ( intersection ) { - - intersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics - intersects.push( intersection ); - - } - - } - - } - - } else if ( position !== undefined ) { - - // non-indexed buffer geometry - - if ( Array.isArray( material ) ) { - - for ( i = 0, il = groups.length; i < il; i ++ ) { - - group = groups[ i ]; - groupMaterial = material[ group.materialIndex ]; - - start = Math.max( group.start, drawRange.start ); - end = Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ); - - for ( j = start, jl = end; j < jl; j += 3 ) { - - a = j; - b = j + 1; - c = j + 2; - - intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray, position, morphPosition, uv, uv2, a, b, c ); - - if ( intersection ) { - - intersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics - intersection.face.materialIndex = group.materialIndex; - intersects.push( intersection ); - - } - - } - - } - - } else { - - start = Math.max( 0, drawRange.start ); - end = Math.min( position.count, ( drawRange.start + drawRange.count ) ); - - for ( i = start, il = end; i < il; i += 3 ) { - - a = i; - b = i + 1; - c = i + 2; - - intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray, position, morphPosition, uv, uv2, a, b, c ); - - if ( intersection ) { - - intersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics - intersects.push( intersection ); - - } - - } - - } - - } - - } else if ( geometry.isGeometry ) { - - var fvA, fvB, fvC; - var isMultiMaterial = Array.isArray( material ); - - var vertices = geometry.vertices; - var faces = geometry.faces; - var uvs; - - var faceVertexUvs = geometry.faceVertexUvs[ 0 ]; - if ( faceVertexUvs.length > 0 ) uvs = faceVertexUvs; - - for ( var f = 0, fl = faces.length; f < fl; f ++ ) { - - var face = faces[ f ]; - var faceMaterial = isMultiMaterial ? material[ face.materialIndex ] : material; - - if ( faceMaterial === undefined ) continue; - - fvA = vertices[ face.a ]; - fvB = vertices[ face.b ]; - fvC = vertices[ face.c ]; - - intersection = checkIntersection( this, faceMaterial, raycaster, _ray, fvA, fvB, fvC, _intersectionPoint ); - - if ( intersection ) { - - if ( uvs && uvs[ f ] ) { - - var uvs_f = uvs[ f ]; - _uvA.copy( uvs_f[ 0 ] ); - _uvB.copy( uvs_f[ 1 ] ); - _uvC.copy( uvs_f[ 2 ] ); - - intersection.uv = Triangle.getUV( _intersectionPoint, fvA, fvB, fvC, _uvA, _uvB, _uvC, new Vector2() ); - - } - - intersection.face = face; - intersection.faceIndex = f; - intersects.push( intersection ); - - } - - } - - } - - }, - - clone: function () { - - return new this.constructor( this.geometry, this.material ).copy( this ); - - } - -} ); - -function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) { - - var intersect; - - if ( material.side === BackSide ) { - - intersect = ray.intersectTriangle( pC, pB, pA, true, point ); - - } else { - - intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point ); - - } - - if ( intersect === null ) return null; - - _intersectionPointWorld.copy( point ); - _intersectionPointWorld.applyMatrix4( object.matrixWorld ); - - var distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld ); - - if ( distance < raycaster.near || distance > raycaster.far ) return null; - - return { - distance: distance, - point: _intersectionPointWorld.clone(), - object: object - }; - -} - -function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, uv2, a, b, c ) { - - _vA.fromBufferAttribute( position, a ); - _vB.fromBufferAttribute( position, b ); - _vC.fromBufferAttribute( position, c ); - - var morphInfluences = object.morphTargetInfluences; - - if ( material.morphTargets && morphPosition && morphInfluences ) { - - _morphA.set( 0, 0, 0 ); - _morphB.set( 0, 0, 0 ); - _morphC.set( 0, 0, 0 ); - - for ( var i = 0, il = morphPosition.length; i < il; i ++ ) { - - var influence = morphInfluences[ i ]; - var morphAttribute = morphPosition[ i ]; - - if ( influence === 0 ) continue; - - _tempA.fromBufferAttribute( morphAttribute, a ); - _tempB.fromBufferAttribute( morphAttribute, b ); - _tempC.fromBufferAttribute( morphAttribute, c ); - - _morphA.addScaledVector( _tempA.sub( _vA ), influence ); - _morphB.addScaledVector( _tempB.sub( _vB ), influence ); - _morphC.addScaledVector( _tempC.sub( _vC ), influence ); - - } - - _vA.add( _morphA ); - _vB.add( _morphB ); - _vC.add( _morphC ); - - } - - var intersection = checkIntersection( object, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint ); - - if ( intersection ) { - - if ( uv ) { - - _uvA.fromBufferAttribute( uv, a ); - _uvB.fromBufferAttribute( uv, b ); - _uvC.fromBufferAttribute( uv, c ); - - intersection.uv = Triangle.getUV( _intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ); - - } - - if ( uv2 ) { - - _uvA.fromBufferAttribute( uv2, a ); - _uvB.fromBufferAttribute( uv2, b ); - _uvC.fromBufferAttribute( uv2, c ); - - intersection.uv2 = Triangle.getUV( _intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ); - - } - - var face = new Face3( a, b, c ); - Triangle.getNormal( _vA, _vB, _vC, face.normal ); - - intersection.face = face; - - } - - return intersection; - -} - -export { Mesh }; diff --git a/cases/esbuild-three/src/base/objects/Points.d.ts b/cases/esbuild-three/src/base/objects/Points.d.ts deleted file mode 100644 index c31f20e0f3..0000000000 --- a/cases/esbuild-three/src/base/objects/Points.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { Raycaster } from './../core/Raycaster'; -import { Object3D } from './../core/Object3D'; -import { BufferGeometry } from '../core/BufferGeometry'; -import { Intersection } from '../core/Raycaster'; - -/** - * A class for displaying particles in the form of variable size points. For example, if using the WebGLRenderer, the particles are displayed using GL_POINTS. - * - * @see src/objects/ParticleSystem.js - */ -export class Points extends Object3D { - - /** - * @param geometry An instance of Geometry or BufferGeometry. - * @param material An instance of Material (optional). - */ - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[] - ); - - type: 'Points'; - morphTargetInfluences?: number[]; - morphTargetDictionary?: { [key: string]: number }; - isPoints: true; - - /** - * An instance of Geometry or BufferGeometry, where each vertex designates the position of a particle in the system. - */ - geometry: Geometry | BufferGeometry; - - /** - * An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour. - */ - material: Material | Material[]; - - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - updateMorphTargets(): void; - -} diff --git a/cases/esbuild-three/src/base/objects/Points.js b/cases/esbuild-three/src/base/objects/Points.js deleted file mode 100644 index 63ff08036c..0000000000 --- a/cases/esbuild-three/src/base/objects/Points.js +++ /dev/null @@ -1,191 +0,0 @@ -import { Sphere } from '../math/Sphere.js'; -import { Ray } from '../math/Ray.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Object3D } from '../core/Object3D.js'; -import { Vector3 } from '../math/Vector3.js'; -import { PointsMaterial } from '../materials/PointsMaterial.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -var _inverseMatrix = new Matrix4(); -var _ray = new Ray(); -var _sphere = new Sphere(); -var _position = new Vector3(); - -function Points( geometry, material ) { - - Object3D.call( this ); - - this.type = 'Points'; - - this.geometry = geometry !== undefined ? geometry : new BufferGeometry(); - this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } ); - - this.updateMorphTargets(); - -} - -Points.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Points, - - isPoints: true, - - raycast: function ( raycaster, intersects ) { - - var geometry = this.geometry; - var matrixWorld = this.matrixWorld; - var threshold = raycaster.params.Points.threshold; - - // Checking boundingSphere distance to ray - - if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere(); - - _sphere.copy( geometry.boundingSphere ); - _sphere.applyMatrix4( matrixWorld ); - _sphere.radius += threshold; - - if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return; - - // - - _inverseMatrix.getInverse( matrixWorld ); - _ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix ); - - var localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 ); - var localThresholdSq = localThreshold * localThreshold; - - if ( geometry.isBufferGeometry ) { - - var index = geometry.index; - var attributes = geometry.attributes; - var positions = attributes.position.array; - - if ( index !== null ) { - - var indices = index.array; - - for ( var i = 0, il = indices.length; i < il; i ++ ) { - - var a = indices[ i ]; - - _position.fromArray( positions, a * 3 ); - - testPoint( _position, a, localThresholdSq, matrixWorld, raycaster, intersects, this ); - - } - - } else { - - for ( var i = 0, l = positions.length / 3; i < l; i ++ ) { - - _position.fromArray( positions, i * 3 ); - - testPoint( _position, i, localThresholdSq, matrixWorld, raycaster, intersects, this ); - - } - - } - - } else { - - var vertices = geometry.vertices; - - for ( var i = 0, l = vertices.length; i < l; i ++ ) { - - testPoint( vertices[ i ], i, localThresholdSq, matrixWorld, raycaster, intersects, this ); - - } - - } - - }, - - updateMorphTargets: function () { - - var geometry = this.geometry; - var m, ml, name; - - if ( geometry.isBufferGeometry ) { - - var morphAttributes = geometry.morphAttributes; - var keys = Object.keys( morphAttributes ); - - if ( keys.length > 0 ) { - - var morphAttribute = morphAttributes[ keys[ 0 ] ]; - - if ( morphAttribute !== undefined ) { - - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - - for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - - name = morphAttribute[ m ].name || String( m ); - - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ name ] = m; - - } - - } - - } - - } else { - - var morphTargets = geometry.morphTargets; - - if ( morphTargets !== undefined && morphTargets.length > 0 ) { - - console.error( 'THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.' ); - - } - - } - - }, - - clone: function () { - - return new this.constructor( this.geometry, this.material ).copy( this ); - - } - -} ); - -function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) { - - var rayPointDistanceSq = _ray.distanceSqToPoint( point ); - - if ( rayPointDistanceSq < localThresholdSq ) { - - var intersectPoint = new Vector3(); - - _ray.closestPointToPoint( point, intersectPoint ); - intersectPoint.applyMatrix4( matrixWorld ); - - var distance = raycaster.ray.origin.distanceTo( intersectPoint ); - - if ( distance < raycaster.near || distance > raycaster.far ) return; - - intersects.push( { - - distance: distance, - distanceToRay: Math.sqrt( rayPointDistanceSq ), - point: intersectPoint, - index: index, - face: null, - object: object - - } ); - - } - -} - -export { Points }; diff --git a/cases/esbuild-three/src/base/objects/Skeleton.d.ts b/cases/esbuild-three/src/base/objects/Skeleton.d.ts deleted file mode 100644 index 44cc3835d9..0000000000 --- a/cases/esbuild-three/src/base/objects/Skeleton.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Bone } from './Bone'; -import { Matrix4 } from './../math/Matrix4'; -import { DataTexture } from './../textures/DataTexture'; - -/** - * @deprecated Use {@link Points THREE.Points} instead. - */ -/** - * @deprecated Use {@link Points THREE.Points} instead. - */ - -export class Skeleton { - - constructor( bones: Bone[], boneInverses?: Matrix4[] ); - - /** - * @deprecated This property has been removed completely. - */ - useVertexTexture: boolean; - identityMatrix: Matrix4; - bones: Bone[]; - boneTextureWidth: number; - boneTextureHeight: number; - boneMatrices: Float32Array; - boneTexture: DataTexture; - boneInverses: Matrix4[]; - - calculateInverses( bone: Bone ): void; - pose(): void; - update(): void; - clone(): this; - -} diff --git a/cases/esbuild-three/src/base/objects/Skeleton.js b/cases/esbuild-three/src/base/objects/Skeleton.js deleted file mode 100644 index 7ea99fb420..0000000000 --- a/cases/esbuild-three/src/base/objects/Skeleton.js +++ /dev/null @@ -1,174 +0,0 @@ -import { Matrix4 } from '../math/Matrix4.js'; - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author michael guerrero / http://realitymeltdown.com - * @author ikerr / http://verold.com - */ - -var _offsetMatrix = new Matrix4(); -var _identityMatrix = new Matrix4(); - -function Skeleton( bones, boneInverses ) { - - // copy the bone array - - bones = bones || []; - - this.bones = bones.slice( 0 ); - this.boneMatrices = new Float32Array( this.bones.length * 16 ); - - // use the supplied bone inverses or calculate the inverses - - if ( boneInverses === undefined ) { - - this.calculateInverses(); - - } else { - - if ( this.bones.length === boneInverses.length ) { - - this.boneInverses = boneInverses.slice( 0 ); - - } else { - - console.warn( 'THREE.Skeleton boneInverses is the wrong length.' ); - - this.boneInverses = []; - - for ( var i = 0, il = this.bones.length; i < il; i ++ ) { - - this.boneInverses.push( new Matrix4() ); - - } - - } - - } - -} - -Object.assign( Skeleton.prototype, { - - calculateInverses: function () { - - this.boneInverses = []; - - for ( var i = 0, il = this.bones.length; i < il; i ++ ) { - - var inverse = new Matrix4(); - - if ( this.bones[ i ] ) { - - inverse.getInverse( this.bones[ i ].matrixWorld ); - - } - - this.boneInverses.push( inverse ); - - } - - }, - - pose: function () { - - var bone, i, il; - - // recover the bind-time world matrices - - for ( i = 0, il = this.bones.length; i < il; i ++ ) { - - bone = this.bones[ i ]; - - if ( bone ) { - - bone.matrixWorld.getInverse( this.boneInverses[ i ] ); - - } - - } - - // compute the local matrices, positions, rotations and scales - - for ( i = 0, il = this.bones.length; i < il; i ++ ) { - - bone = this.bones[ i ]; - - if ( bone ) { - - if ( bone.parent && bone.parent.isBone ) { - - bone.matrix.getInverse( bone.parent.matrixWorld ); - bone.matrix.multiply( bone.matrixWorld ); - - } else { - - bone.matrix.copy( bone.matrixWorld ); - - } - - bone.matrix.decompose( bone.position, bone.quaternion, bone.scale ); - - } - - } - - }, - - update: function () { - - var bones = this.bones; - var boneInverses = this.boneInverses; - var boneMatrices = this.boneMatrices; - var boneTexture = this.boneTexture; - - // flatten bone matrices to array - - for ( var i = 0, il = bones.length; i < il; i ++ ) { - - // compute the offset between the current and the original transform - - var matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix; - - _offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] ); - _offsetMatrix.toArray( boneMatrices, i * 16 ); - - } - - if ( boneTexture !== undefined ) { - - boneTexture.needsUpdate = true; - - } - - }, - - clone: function () { - - return new Skeleton( this.bones, this.boneInverses ); - - }, - - getBoneByName: function ( name ) { - - for ( var i = 0, il = this.bones.length; i < il; i ++ ) { - - var bone = this.bones[ i ]; - - if ( bone.name === name ) { - - return bone; - - } - - } - - return undefined; - - } - -} ); - - -export { Skeleton }; diff --git a/cases/esbuild-three/src/base/objects/SkinnedMesh.d.ts b/cases/esbuild-three/src/base/objects/SkinnedMesh.d.ts deleted file mode 100644 index fca0dacb00..0000000000 --- a/cases/esbuild-three/src/base/objects/SkinnedMesh.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Geometry } from './../core/Geometry'; -import { Material } from './../materials/Material'; -import { Matrix4 } from './../math/Matrix4'; -import { Skeleton } from './Skeleton'; -import { Mesh } from './Mesh'; -import { BufferGeometry } from '../core/BufferGeometry'; - -export class SkinnedMesh extends Mesh { - - constructor( - geometry?: Geometry | BufferGeometry, - material?: Material | Material[], - useVertexTexture?: boolean - ); - - bindMode: string; - bindMatrix: Matrix4; - bindMatrixInverse: Matrix4; - skeleton: Skeleton; - - bind( skeleton: Skeleton, bindMatrix?: Matrix4 ): void; - pose(): void; - normalizeSkinWeights(): void; - updateMatrixWorld( force?: boolean ): void; - -} diff --git a/cases/esbuild-three/src/base/objects/SkinnedMesh.js b/cases/esbuild-three/src/base/objects/SkinnedMesh.js deleted file mode 100644 index 1f2250d9fc..0000000000 --- a/cases/esbuild-three/src/base/objects/SkinnedMesh.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author ikerr / http://verold.com - */ - -import { Mesh } from './Mesh.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Vector4 } from '../math/Vector4.js'; - -function SkinnedMesh( geometry, material ) { - - if ( geometry && geometry.isGeometry ) { - - console.error( 'THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); - - } - - Mesh.call( this, geometry, material ); - - this.type = 'SkinnedMesh'; - - this.bindMode = 'attached'; - this.bindMatrix = new Matrix4(); - this.bindMatrixInverse = new Matrix4(); - -} - -SkinnedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), { - - constructor: SkinnedMesh, - - isSkinnedMesh: true, - - bind: function ( skeleton, bindMatrix ) { - - this.skeleton = skeleton; - - if ( bindMatrix === undefined ) { - - this.updateMatrixWorld( true ); - - this.skeleton.calculateInverses(); - - bindMatrix = this.matrixWorld; - - } - - this.bindMatrix.copy( bindMatrix ); - this.bindMatrixInverse.getInverse( bindMatrix ); - - }, - - pose: function () { - - this.skeleton.pose(); - - }, - - normalizeSkinWeights: function () { - - var vector = new Vector4(); - - var skinWeight = this.geometry.attributes.skinWeight; - - for ( var i = 0, l = skinWeight.count; i < l; i ++ ) { - - vector.x = skinWeight.getX( i ); - vector.y = skinWeight.getY( i ); - vector.z = skinWeight.getZ( i ); - vector.w = skinWeight.getW( i ); - - var scale = 1.0 / vector.manhattanLength(); - - if ( scale !== Infinity ) { - - vector.multiplyScalar( scale ); - - } else { - - vector.set( 1, 0, 0, 0 ); // do something reasonable - - } - - skinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w ); - - } - - }, - - updateMatrixWorld: function ( force ) { - - Mesh.prototype.updateMatrixWorld.call( this, force ); - - if ( this.bindMode === 'attached' ) { - - this.bindMatrixInverse.getInverse( this.matrixWorld ); - - } else if ( this.bindMode === 'detached' ) { - - this.bindMatrixInverse.getInverse( this.bindMatrix ); - - } else { - - console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode ); - - } - - }, - - clone: function () { - - return new this.constructor( this.geometry, this.material ).copy( this ); - - } - -} ); - - -export { SkinnedMesh }; diff --git a/cases/esbuild-three/src/base/objects/Sprite.d.ts b/cases/esbuild-three/src/base/objects/Sprite.d.ts deleted file mode 100644 index 5b901d40e4..0000000000 --- a/cases/esbuild-three/src/base/objects/Sprite.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Vector2 } from './../math/Vector2'; -import { Raycaster } from './../core/Raycaster'; -import { Object3D } from './../core/Object3D'; -import { Intersection } from '../core/Raycaster'; -import { SpriteMaterial } from '../materials/Materials'; -import { BufferGeometry } from '../core/BufferGeometry'; - -export class Sprite extends Object3D { - - constructor( material?: SpriteMaterial ); - - type: 'Sprite'; - isSprite: true; - - geometry: BufferGeometry; - material: SpriteMaterial; - center: Vector2; - - raycast( raycaster: Raycaster, intersects: Intersection[] ): void; - copy( source: this ): this; - -} diff --git a/cases/esbuild-three/src/base/objects/Sprite.js b/cases/esbuild-three/src/base/objects/Sprite.js deleted file mode 100644 index 0518effd72..0000000000 --- a/cases/esbuild-three/src/base/objects/Sprite.js +++ /dev/null @@ -1,192 +0,0 @@ -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Triangle } from '../math/Triangle.js'; -import { Object3D } from '../core/Object3D.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { InterleavedBuffer } from '../core/InterleavedBuffer.js'; -import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js'; -import { SpriteMaterial } from '../materials/SpriteMaterial.js'; - -var _geometry; - -var _intersectPoint = new Vector3(); -var _worldScale = new Vector3(); -var _mvPosition = new Vector3(); - -var _alignedPosition = new Vector2(); -var _rotatedPosition = new Vector2(); -var _viewWorldMatrix = new Matrix4(); - -var _vA = new Vector3(); -var _vB = new Vector3(); -var _vC = new Vector3(); - -var _uvA = new Vector2(); -var _uvB = new Vector2(); -var _uvC = new Vector2(); - -function Sprite( material ) { - - Object3D.call( this ); - - this.type = 'Sprite'; - - if ( _geometry === undefined ) { - - _geometry = new BufferGeometry(); - - var float32Array = new Float32Array( [ - - 0.5, - 0.5, 0, 0, 0, - 0.5, - 0.5, 0, 1, 0, - 0.5, 0.5, 0, 1, 1, - - 0.5, 0.5, 0, 0, 1 - ] ); - - var interleavedBuffer = new InterleavedBuffer( float32Array, 5 ); - - _geometry.setIndex( [ 0, 1, 2, 0, 2, 3 ] ); - _geometry.addAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) ); - _geometry.addAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) ); - - } - - this.geometry = _geometry; - this.material = ( material !== undefined ) ? material : new SpriteMaterial(); - - this.center = new Vector2( 0.5, 0.5 ); - -} - -Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Sprite, - - isSprite: true, - - raycast: function ( raycaster, intersects ) { - - if ( raycaster.camera === null ) { - - console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' ); - - } - - _worldScale.setFromMatrixScale( this.matrixWorld ); - - _viewWorldMatrix.copy( raycaster.camera.matrixWorld ); - this.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld ); - - _mvPosition.setFromMatrixPosition( this.modelViewMatrix ); - - if ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) { - - _worldScale.multiplyScalar( - _mvPosition.z ); - - } - - var rotation = this.material.rotation; - var sin, cos; - if ( rotation !== 0 ) { - - cos = Math.cos( rotation ); - sin = Math.sin( rotation ); - - } - - var center = this.center; - - transformVertex( _vA.set( - 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); - transformVertex( _vB.set( 0.5, - 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); - transformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); - - _uvA.set( 0, 0 ); - _uvB.set( 1, 0 ); - _uvC.set( 1, 1 ); - - // check first triangle - var intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint ); - - if ( intersect === null ) { - - // check second triangle - transformVertex( _vB.set( - 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos ); - _uvB.set( 0, 1 ); - - intersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint ); - if ( intersect === null ) { - - return; - - } - - } - - var distance = raycaster.ray.origin.distanceTo( _intersectPoint ); - - if ( distance < raycaster.near || distance > raycaster.far ) return; - - intersects.push( { - - distance: distance, - point: _intersectPoint.clone(), - uv: Triangle.getUV( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ), - face: null, - object: this - - } ); - - }, - - clone: function () { - - return new this.constructor( this.material ).copy( this ); - - }, - - copy: function ( source ) { - - Object3D.prototype.copy.call( this, source ); - - if ( source.center !== undefined ) this.center.copy( source.center ); - - return this; - - } - - -} ); - -function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) { - - // compute position in camera space - _alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale ); - - // to check if rotation is not zero - if ( sin !== undefined ) { - - _rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y ); - _rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y ); - - } else { - - _rotatedPosition.copy( _alignedPosition ); - - } - - - vertexPosition.copy( mvPosition ); - vertexPosition.x += _rotatedPosition.x; - vertexPosition.y += _rotatedPosition.y; - - // transform to world space - vertexPosition.applyMatrix4( _viewWorldMatrix ); - -} - -export { Sprite }; diff --git a/cases/esbuild-three/src/base/polyfills.d.ts b/cases/esbuild-three/src/base/polyfills.d.ts deleted file mode 100644 index 46ad994ffb..0000000000 --- a/cases/esbuild-three/src/base/polyfills.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// log handlers -export function warn( message?: any, ...optionalParams: any[] ): void; -export function error( message?: any, ...optionalParams: any[] ): void; -export function log( message?: any, ...optionalParams: any[] ): void; - -// typed array parameters -export type TypedArray = - | Int8Array - | Uint8Array - | Uint8ClampedArray - | Int16Array - | Uint16Array - | Int32Array - | Uint32Array - | Float32Array - | Float64Array; diff --git a/cases/esbuild-three/src/base/polyfills.js b/cases/esbuild-three/src/base/polyfills.js deleted file mode 100644 index c165a89a59..0000000000 --- a/cases/esbuild-three/src/base/polyfills.js +++ /dev/null @@ -1,94 +0,0 @@ -// Polyfills - -if ( Number.EPSILON === undefined ) { - - Number.EPSILON = Math.pow( 2, - 52 ); - -} - -if ( Number.isInteger === undefined ) { - - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger - - Number.isInteger = function ( value ) { - - return typeof value === 'number' && isFinite( value ) && Math.floor( value ) === value; - - }; - -} - -// - -if ( Math.sign === undefined ) { - - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign - - Math.sign = function ( x ) { - - return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x; - - }; - -} - -if ( 'name' in Function.prototype === false ) { - - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name - - Object.defineProperty( Function.prototype, 'name', { - - get: function () { - - return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ]; - - } - - } ); - -} - -if ( Object.assign === undefined ) { - - // Missing in IE - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - - Object.assign = function ( target ) { - - 'use strict'; - - if ( target === undefined || target === null ) { - - throw new TypeError( 'Cannot convert undefined or null to object' ); - - } - - var output = Object( target ); - - for ( var index = 1; index < arguments.length; index ++ ) { - - var source = arguments[ index ]; - - if ( source !== undefined && source !== null ) { - - for ( var nextKey in source ) { - - if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) { - - output[ nextKey ] = source[ nextKey ]; - - } - - } - - } - - } - - return output; - - }; - -} diff --git a/cases/esbuild-three/src/base/renderers/WebGL2Renderer.js b/cases/esbuild-three/src/base/renderers/WebGL2Renderer.js deleted file mode 100644 index 89362257c0..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGL2Renderer.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { REVISION } from '../constants.js'; -import { WebGLExtensions } from './webgl/WebGLExtensions.js'; -import { WebGLState } from './webgl/WebGLState.js'; -import { Color } from '../math/Color.js'; -import { Vector4 } from '../math/Vector4.js'; - -function WebGL2Renderer( parameters ) { - - console.log( 'THREE.WebGL2Renderer', REVISION ); - - parameters = parameters || {}; - - var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ), - _context = parameters.context !== undefined ? parameters.context : null, - - _alpha = parameters.alpha !== undefined ? parameters.alpha : false, - _depth = parameters.depth !== undefined ? parameters.depth : true, - _stencil = parameters.stencil !== undefined ? parameters.stencil : true, - _antialias = parameters.antialias !== undefined ? parameters.antialias : false, - _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, - _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false, - _powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default', - _failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false; - - // initialize - - var gl; - - try { - - var attributes = { - alpha: _alpha, - depth: _depth, - stencil: _stencil, - antialias: _antialias, - premultipliedAlpha: _premultipliedAlpha, - preserveDrawingBuffer: _preserveDrawingBuffer, - powerPreference: _powerPreference, - failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat - }; - - // event listeners must be registered before WebGL context is created, see #12753 - - _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); - _canvas.addEventListener( 'webglcontextrestored', function () { } ); - - gl = _context || _canvas.getContext( 'webgl2', attributes ); - - if ( gl === null ) { - - if ( _canvas.getContext( 'webgl2' ) !== null ) { - - throw new Error( 'Error creating WebGL2 context with your selected attributes.' ); - - } else { - - throw new Error( 'Error creating WebGL2 context.' ); - - } - - } - - } catch ( error ) { - - console.error( 'THREE.WebGL2Renderer: ' + error.message ); - - } - - // - - var _autoClear = true, - _autoClearColor = true, - _autoClearDepth = true, - _autoClearStencil = true, - - _clearColor = new Color( 0x000000 ), - _clearAlpha = 0, - - _width = _canvas.width, - _height = _canvas.height, - - _pixelRatio = 1, - - _viewport = new Vector4( 0, 0, _width, _height ); - - var extensions = new WebGLExtensions( gl ); - var state = new WebGLState( gl, extensions, function () {} ); - - // - - function clear( color, depth, stencil ) { - - var bits = 0; - - if ( color === undefined || color ) bits |= gl.COLOR_BUFFER_BIT; - if ( depth === undefined || depth ) bits |= gl.DEPTH_BUFFER_BIT; - if ( stencil === undefined || stencil ) bits |= gl.STENCIL_BUFFER_BIT; - - gl.clear( bits ); - - } - - function setPixelRatio( value ) { - - if ( value === undefined ) return; - - _pixelRatio = value; - - setSize( _viewport.z, _viewport.w, false ); - - } - - function setSize( width, height, updateStyle ) { - - _width = width; - _height = height; - - _canvas.width = width * _pixelRatio; - _canvas.height = height * _pixelRatio; - - if ( updateStyle !== false ) { - - _canvas.style.width = width + 'px'; - _canvas.style.height = height + 'px'; - - } - - setViewport( 0, 0, width, height ); - - } - - function setViewport( x, y, width, height ) { - - state.viewport( _viewport.set( x, y, width, height ) ); - - } - - function render( scene, camera ) { - - if ( camera !== undefined && camera.isCamera !== true ) { - - console.error( 'THREE.WebGL2Renderer.render: camera is not an instance of THREE.Camera.' ); - return; - - } - - var background = scene.background; - var forceClear = false; - - if ( background === null ) { - - state.buffers.color.setClear( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha, _premultipliedAlpha ); - - } else if ( background && background.isColor ) { - - state.buffers.color.setClear( background.r, background.g, background.b, 1, _premultipliedAlpha ); - forceClear = true; - - } - - if ( _autoClear || forceClear ) { - - this.clear( _autoClearColor, _autoClearDepth, _autoClearStencil ); - - } - - } - - function onContextLost( event ) { - - event.preventDefault(); - - } - - return { - domElement: _canvas, - - clear: clear, - setPixelRatio: setPixelRatio, - setSize: setSize, - render: render - }; - -} - - -export { WebGL2Renderer }; diff --git a/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.d.ts b/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.d.ts deleted file mode 100644 index 7592f6364a..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - WebGLRenderTarget, - WebGLRenderTargetOptions, -} from './WebGLRenderTarget'; - -export class WebGLMultisampleRenderTarget extends WebGLRenderTarget { - - constructor( - width: number, - height: number, - options?: WebGLRenderTargetOptions - ); - -} diff --git a/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.js b/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.js deleted file mode 100644 index 1cc028184c..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLMultisampleRenderTarget.js +++ /dev/null @@ -1,35 +0,0 @@ -import { WebGLRenderTarget } from './WebGLRenderTarget.js'; - -/** - * @author Mugen87 / https://github.com/Mugen87 - * @author Matt DesLauriers / @mattdesl - */ - -function WebGLMultisampleRenderTarget( width, height, options ) { - - WebGLRenderTarget.call( this, width, height, options ); - - this.samples = 4; - -} - -WebGLMultisampleRenderTarget.prototype = Object.assign( Object.create( WebGLRenderTarget.prototype ), { - - constructor: WebGLMultisampleRenderTarget, - - isWebGLMultisampleRenderTarget: true, - - copy: function ( source ) { - - WebGLRenderTarget.prototype.copy.call( this, source ); - - this.samples = source.samples; - - return this; - - } - -} ); - - -export { WebGLMultisampleRenderTarget }; diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.d.ts b/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.d.ts deleted file mode 100644 index 1a4ef3c4ff..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Vector4 } from './../math/Vector4'; -import { Texture } from './../textures/Texture'; -import { EventDispatcher } from './../core/EventDispatcher'; -import { Wrapping, TextureFilter, TextureDataType } from '../constants'; - -export interface WebGLRenderTargetOptions { - wrapS?: Wrapping; - wrapT?: Wrapping; - magFilter?: TextureFilter; - minFilter?: TextureFilter; - format?: number; // RGBAFormat; - type?: TextureDataType; // UnsignedByteType; - anisotropy?: number; // 1; - depthBuffer?: boolean; // true; - stencilBuffer?: boolean; // true; - generateMipmaps?: boolean; // true; -} - -export class WebGLRenderTarget extends EventDispatcher { - - constructor( - width: number, - height: number, - options?: WebGLRenderTargetOptions - ); - - uuid: string; - width: number; - height: number; - scissor: Vector4; - scissorTest: boolean; - viewport: Vector4; - texture: Texture; - depthBuffer: boolean; - stencilBuffer: boolean; - depthTexture: Texture; - /** - * @deprecated Use {@link Texture#wrapS texture.wrapS} instead. - */ - wrapS: any; - /** - * @deprecated Use {@link Texture#wrapT texture.wrapT} instead. - */ - wrapT: any; - /** - * @deprecated Use {@link Texture#magFilter texture.magFilter} instead. - */ - magFilter: any; - /** - * @deprecated Use {@link Texture#minFilter texture.minFilter} instead. - */ - minFilter: any; - /** - * @deprecated Use {@link Texture#anisotropy texture.anisotropy} instead. - */ - anisotropy: any; - /** - * @deprecated Use {@link Texture#offset texture.offset} instead. - */ - offset: any; - /** - * @deprecated Use {@link Texture#repeat texture.repeat} instead. - */ - repeat: any; - /** - * @deprecated Use {@link Texture#format texture.format} instead. - */ - format: any; - /** - * @deprecated Use {@link Texture#type texture.type} instead. - */ - type: any; - /** - * @deprecated Use {@link Texture#generateMipmaps texture.generateMipmaps} instead. - */ - generateMipmaps: any; - - setSize( width: number, height: number ): void; - clone(): this; - copy( source: WebGLRenderTarget ): this; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.js b/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.js deleted file mode 100644 index 4e54fa1d40..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderTarget.js +++ /dev/null @@ -1,101 +0,0 @@ -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { Texture } from '../textures/Texture.js'; -import { LinearFilter } from '../constants.js'; -import { Vector4 } from '../math/Vector4.js'; - -/** - * @author szimek / https://github.com/szimek/ - * @author alteredq / http://alteredqualia.com/ - * @author Marius Kintel / https://github.com/kintel - */ - -/* - In options, we can specify: - * Texture parameters for an auto-generated target texture - * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers -*/ -function WebGLRenderTarget( width, height, options ) { - - this.width = width; - this.height = height; - - this.scissor = new Vector4( 0, 0, width, height ); - this.scissorTest = false; - - this.viewport = new Vector4( 0, 0, width, height ); - - options = options || {}; - - this.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding ); - - this.texture.image = {}; - this.texture.image.width = width; - this.texture.image.height = height; - - this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false; - this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter; - - this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; - this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; - this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null; - -} - -WebGLRenderTarget.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: WebGLRenderTarget, - - isWebGLRenderTarget: true, - - setSize: function ( width, height ) { - - if ( this.width !== width || this.height !== height ) { - - this.width = width; - this.height = height; - - this.texture.image.width = width; - this.texture.image.height = height; - - this.dispose(); - - } - - this.viewport.set( 0, 0, width, height ); - this.scissor.set( 0, 0, width, height ); - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( source ) { - - this.width = source.width; - this.height = source.height; - - this.viewport.copy( source.viewport ); - - this.texture = source.texture.clone(); - - this.depthBuffer = source.depthBuffer; - this.stencilBuffer = source.stencilBuffer; - this.depthTexture = source.depthTexture; - - return this; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - } - -} ); - - -export { WebGLRenderTarget }; diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.d.ts b/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.d.ts deleted file mode 100644 index cef8ae54fb..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - WebGLRenderTargetOptions, - WebGLRenderTarget, -} from './WebGLRenderTarget'; - -export class WebGLRenderTargetCube extends WebGLRenderTarget { - - constructor( - width: number, - height: number, - options?: WebGLRenderTargetOptions - ); - -} diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.js b/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.js deleted file mode 100644 index 436879e883..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderTargetCube.js +++ /dev/null @@ -1,119 +0,0 @@ -import { BackSide, NoBlending } from '../constants.js'; -import { Scene } from '../scenes/Scene.js'; -import { Mesh } from '../objects/Mesh.js'; -import { BoxBufferGeometry } from '../geometries/BoxGeometry.js'; -import { ShaderMaterial } from '../materials/ShaderMaterial.js'; -import { cloneUniforms } from './shaders/UniformsUtils.js'; -import { WebGLRenderTarget } from './WebGLRenderTarget.js'; -import { CubeCamera } from '../cameras/CubeCamera.js'; - -/** - * @author alteredq / http://alteredqualia.com - * @author WestLangley / http://github.com/WestLangley - */ - -function WebGLRenderTargetCube( width, height, options ) { - - WebGLRenderTarget.call( this, width, height, options ); - -} - -WebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype ); -WebGLRenderTargetCube.prototype.constructor = WebGLRenderTargetCube; - -WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube = true; - -WebGLRenderTargetCube.prototype.fromEquirectangularTexture = function ( renderer, texture ) { - - this.texture.type = texture.type; - this.texture.format = texture.format; - this.texture.encoding = texture.encoding; - - var scene = new Scene(); - - var shader = { - - uniforms: { - tEquirect: { value: null }, - }, - - vertexShader: [ - - "varying vec3 vWorldDirection;", - - "vec3 transformDirection( in vec3 dir, in mat4 matrix ) {", - - " return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );", - - "}", - - "void main() {", - - " vWorldDirection = transformDirection( position, modelMatrix );", - - " #include ", - " #include ", - - "}" - - ].join( '\n' ), - - fragmentShader: [ - - "uniform sampler2D tEquirect;", - - "varying vec3 vWorldDirection;", - - "#define RECIPROCAL_PI 0.31830988618", - "#define RECIPROCAL_PI2 0.15915494", - - "void main() {", - - " vec3 direction = normalize( vWorldDirection );", - - " vec2 sampleUV;", - - " sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;", - - " sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;", - - " gl_FragColor = texture2D( tEquirect, sampleUV );", - - "}" - - ].join( '\n' ), - }; - - var material = new ShaderMaterial( { - - type: 'CubemapFromEquirect', - - uniforms: cloneUniforms( shader.uniforms ), - vertexShader: shader.vertexShader, - fragmentShader: shader.fragmentShader, - side: BackSide, - blending: NoBlending - - } ); - - material.uniforms.tEquirect.value = texture; - - var mesh = new Mesh( new BoxBufferGeometry( 5, 5, 5 ), material ); - - scene.add( mesh ); - - var camera = new CubeCamera( 1, 10, 1 ); - - camera.renderTarget = this; - camera.renderTarget.texture.name = 'CubeCameraTexture'; - - camera.update( renderer, scene ); - - mesh.geometry.dispose(); - mesh.material.dispose(); - - return this; - -}; - -export { WebGLRenderTargetCube }; diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderer.d.ts b/cases/esbuild-three/src/base/renderers/WebGLRenderer.d.ts deleted file mode 100644 index db02dcbb81..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderer.d.ts +++ /dev/null @@ -1,464 +0,0 @@ -import { Scene } from './../scenes/Scene'; -import { Camera } from './../cameras/Camera'; -import { WebGLExtensions } from './webgl/WebGLExtensions'; -import { WebGLInfo } from './webgl/WebGLInfo'; -import { WebGLShadowMap } from './webgl/WebGLShadowMap'; -import { WebGLCapabilities } from './webgl/WebGLCapabilities'; -import { WebGLProperties } from './webgl/WebGLProperties'; -import { WebGLRenderLists } from './webgl/WebGLRenderLists'; -import { WebGLState } from './webgl/WebGLState'; -import { Vector2 } from './../math/Vector2'; -import { Vector4 } from './../math/Vector4'; -import { Color } from './../math/Color'; -import { WebGLRenderTarget } from './WebGLRenderTarget'; -import { Object3D } from './../core/Object3D'; -import { Material } from './../materials/Material'; -import { Fog } from './../scenes/Fog'; -import { ToneMapping, ShadowMapType, CullFace } from '../constants'; -import { WebVRManager } from '../renderers/webvr/WebVRManager'; -import { RenderTarget } from './webgl/WebGLRenderLists'; -import { Geometry } from './../core/Geometry'; -import { BufferGeometry } from './../core/BufferGeometry'; - -export interface Renderer { - domElement: HTMLCanvasElement; - - render( scene: Scene, camera: Camera ): void; - setSize( width: number, height: number, updateStyle?: boolean ): void; -} - -export interface WebGLRendererParameters { - /** - * A Canvas where the renderer draws its output. - */ - canvas?: HTMLCanvasElement; - - /** - * A WebGL Rendering Context. - * (https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) - * Default is null - */ - context?: WebGLRenderingContext; - - /** - * shader precision. Can be "highp", "mediump" or "lowp". - */ - precision?: string; - - /** - * default is true. - */ - alpha?: boolean; - - /** - * default is true. - */ - premultipliedAlpha?: boolean; - - /** - * default is false. - */ - antialias?: boolean; - - /** - * default is true. - */ - stencil?: boolean; - - /** - * default is false. - */ - preserveDrawingBuffer?: boolean; - - /** - * Can be "high-performance", "low-power" or "default" - */ - powerPreference?: string; - - /** - * default is true. - */ - depth?: boolean; - - /** - * default is false. - */ - logarithmicDepthBuffer?: boolean; -} - -export interface WebGLDebug { - - /** - * Enables error checking and reporting when shader programs are being compiled. - */ - checkShaderErrors: boolean; - -} - -/** - * The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it. - * This renderer has way better performance than CanvasRenderer. - * - * @see src/renderers/WebGLRenderer.js - */ -export class WebGLRenderer implements Renderer { - - /** - * parameters is an optional object with properties defining the renderer's behaviour. The constructor also accepts no parameters at all. In all cases, it will assume sane defaults when parameters are missing. - */ - constructor( parameters?: WebGLRendererParameters ); - - /** - * A Canvas where the renderer draws its output. - * This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page. - */ - domElement: HTMLCanvasElement; - - /** - * The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw. - */ - context: WebGLRenderingContext; - - /** - * Defines whether the renderer should automatically clear its output before rendering. - */ - autoClear: boolean; - - /** - * If autoClear is true, defines whether the renderer should clear the color buffer. Default is true. - */ - autoClearColor: boolean; - - /** - * If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true. - */ - autoClearDepth: boolean; - - /** - * If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true. - */ - autoClearStencil: boolean; - - /** - * Debug configurations. - */ - debug: WebGLDebug; - - /** - * Defines whether the renderer should sort objects. Default is true. - */ - sortObjects: boolean; - - clippingPlanes: any[]; - localClippingEnabled: boolean; - - extensions: WebGLExtensions; - - /** - * Default is false. - */ - gammaInput: boolean; - - /** - * Default is false. - */ - gammaOutput: boolean; - - physicallyCorrectLights: boolean; - toneMapping: ToneMapping; - toneMappingExposure: number; - toneMappingWhitePoint: number; - - /** - * Default is false. - */ - shadowMapDebug: boolean; - - /** - * Default is 8. - */ - maxMorphTargets: number; - - /** - * Default is 4. - */ - maxMorphNormals: number; - - info: WebGLInfo; - - shadowMap: WebGLShadowMap; - - pixelRation: number; - - capabilities: WebGLCapabilities; - properties: WebGLProperties; - renderLists: WebGLRenderLists; - state: WebGLState; - - vr: WebVRManager; - - /** - * Return the WebGL context. - */ - getContext(): WebGLRenderingContext; - getContextAttributes(): any; - forceContextLoss(): void; - - /** - * @deprecated Use {@link WebGLCapabilities#getMaxAnisotropy .capabilities.getMaxAnisotropy()} instead. - */ - getMaxAnisotropy(): number; - - /** - * @deprecated Use {@link WebGLCapabilities#precision .capabilities.precision} instead. - */ - getPrecision(): string; - - getPixelRatio(): number; - setPixelRatio( value: number ): void; - - getDrawingBufferSize( target: Vector2 ): Vector2; - setDrawingBufferSize( width: number, height: number, pixelRatio: number ): void; - - getSize( target: Vector2 ): Vector2; - - /** - * Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0). - */ - setSize( width: number, height: number, updateStyle?: boolean ): void; - - getCurrentViewport( target: Vector4 ): Vector4; - - /** - * Copies the viewport into target. - */ - getViewport( target: Vector4 ): Vector4; - - /** - * Sets the viewport to render from (x, y) to (x + width, y + height). - * (x, y) is the lower-left corner of the region. - */ - setViewport( x: Vector4 | number, y?: number, width?: number, height?: number ): void; - - /** - * Copies the scissor area into target. - */ - getScissor( target: Vector4 ): Vector4; - - /** - * Sets the scissor area from (x, y) to (x + width, y + height). - */ - setScissor( x: Vector4 | number, y?: number, width?: number, height?: number ): void; - - /** - * Returns true if scissor test is enabled; returns false otherwise. - */ - getScissorTest(): boolean; - - /** - * Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions. - */ - setScissorTest( enable: boolean ): void; - - /** - * Returns a THREE.Color instance with the current clear color. - */ - getClearColor(): Color; - - /** - * Sets the clear color, using color for the color and alpha for the opacity. - */ - setClearColor( color: Color, alpha?: number ): void; - setClearColor( color: string, alpha?: number ): void; - setClearColor( color: number, alpha?: number ): void; - - /** - * Returns a float with the current clear alpha. Ranges from 0 to 1. - */ - getClearAlpha(): number; - - setClearAlpha( alpha: number ): void; - - /** - * Tells the renderer to clear its color, depth or stencil drawing buffer(s). - * Arguments default to true - */ - clear( color?: boolean, depth?: boolean, stencil?: boolean ): void; - - clearColor(): void; - clearDepth(): void; - clearStencil(): void; - clearTarget( - renderTarget: WebGLRenderTarget, - color: boolean, - depth: boolean, - stencil: boolean - ): void; - - /** - * @deprecated Use {@link WebGLState#reset .state.reset()} instead. - */ - resetGLState(): void; - dispose(): void; - - /** - * Tells the shadow map plugin to update using the passed scene and camera parameters. - * - * @param scene an instance of Scene - * @param camera — an instance of Camera - */ - renderBufferImmediate( - object: Object3D, - program: Object, - material: Material - ): void; - - renderBufferDirect( - camera: Camera, - fog: Fog, - geometry: Geometry | BufferGeometry, - material: Material, - object: Object3D, - geometryGroup: any - ): void; - - /** - * A build in function that can be used instead of requestAnimationFrame. For WebVR projects this function must be used. - * @param callback The function will be called every available frame. If `null` is passed it will stop any already ongoing animation. - */ - setAnimationLoop( callback: Function ): void; - - /** - * @deprecated Use {@link WebGLRenderer#setAnimationLoop .setAnimationLoop()} instead. - */ - animate( callback: Function ): void; - - /** - * Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering. - */ - compile( - scene: Scene, - camera: Camera - ): void; - - /** - * Render a scene using a camera. - * The render is done to a previously specified {@link WebGLRenderTarget#renderTarget .renderTarget} set by calling - * {@link WebGLRenderer#setRenderTarget .setRenderTarget} or to the canvas as usual. - * - * By default render buffers are cleared before rendering but you can prevent this by setting the property - * {@link WebGLRenderer#autoClear autoClear} to false. If you want to prevent only certain buffers being cleared - * you can set either the {@link WebGLRenderer#autoClearColor autoClearColor}, - * {@link WebGLRenderer#autoClearStencil autoClearStencil} or {@link WebGLRenderer#autoClearDepth autoClearDepth} - * properties to false. To forcibly clear one ore more buffers call {@link WebGLRenderer#clear .clear}. - */ - render( - scene: Scene, - camera: Camera - ): void; - - /** - * Returns the current active cube face. - */ - getActiveCubeFace(): number; - - /** - * Returns the current active mipmap level. - */ - getActiveMipmapLevel(): number; - - /** - * Returns the current render target. If no render target is set, null is returned. - */ - getRenderTarget(): RenderTarget | null; - - /** - * @deprecated Use {@link WebGLRenderer#getRenderTarget .getRenderTarget()} instead. - */ - getCurrentRenderTarget(): RenderTarget | null; - - /** - * Sets the active render target. - * - * @param renderTarget The {@link WebGLRenderTarget renderTarget} that needs to be activated. When `null` is given, the canvas is set as the active render target instead. - * @param activeCubeFace Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of {@link WebGLRenderTargetCube}. - * @param activeMipmapLevel Specifies the active mipmap level. - */ - setRenderTarget( renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number ): void; - - readRenderTargetPixels( - renderTarget: RenderTarget, - x: number, - y: number, - width: number, - height: number, - buffer: any, - activeCubeFaceIndex?: number - ): void; - - /** - * @deprecated - */ - gammaFactor: number; - - /** - * @deprecated Use {@link WebGLShadowMap#enabled .shadowMap.enabled} instead. - */ - shadowMapEnabled: boolean; - - /** - * @deprecated Use {@link WebGLShadowMap#type .shadowMap.type} instead. - */ - shadowMapType: ShadowMapType; - - /** - * @deprecated Use {@link WebGLShadowMap#cullFace .shadowMap.cullFace} instead. - */ - shadowMapCullFace: CullFace; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_texture_float' )} instead. - */ - supportsFloatTextures(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_texture_half_float' )} instead. - */ - supportsHalfFloatTextures(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'OES_standard_derivatives' )} instead. - */ - supportsStandardDerivatives(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_s3tc' )} instead. - */ - supportsCompressedTextureS3TC(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'WEBGL_compressed_texture_pvrtc' )} instead. - */ - supportsCompressedTexturePVRTC(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'EXT_blend_minmax' )} instead. - */ - supportsBlendMinMax(): any; - - /** - * @deprecated Use {@link WebGLCapabilities#vertexTextures .capabilities.vertexTextures} instead. - */ - supportsVertexTextures(): any; - - /** - * @deprecated Use {@link WebGLExtensions#get .extensions.get( 'ANGLE_instanced_arrays' )} instead. - */ - supportsInstancedArrays(): any; - - /** - * @deprecated Use {@link WebGLRenderer#setScissorTest .setScissorTest()} instead. - */ - enableScissorTest( boolean: any ): any; - -} diff --git a/cases/esbuild-three/src/base/renderers/WebGLRenderer.js b/cases/esbuild-three/src/base/renderers/WebGLRenderer.js deleted file mode 100644 index 2d15ed7f15..0000000000 --- a/cases/esbuild-three/src/base/renderers/WebGLRenderer.js +++ /dev/null @@ -1,2613 +0,0 @@ -import { - RGBAFormat, - HalfFloatType, - FloatType, - UnsignedByteType, - TriangleFanDrawMode, - TriangleStripDrawMode, - TrianglesDrawMode, - LinearToneMapping, - BackSide -} from '../constants.js'; -import { _Math } from '../math/Math.js'; -import { DataTexture } from '../textures/DataTexture.js'; -import { Frustum } from '../math/Frustum.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { ShaderLib } from './shaders/ShaderLib.js'; -import { UniformsLib } from './shaders/UniformsLib.js'; -import { cloneUniforms } from './shaders/UniformsUtils.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector4 } from '../math/Vector4.js'; -import { WebGLAnimation } from './webgl/WebGLAnimation.js'; -import { WebGLAttributes } from './webgl/WebGLAttributes.js'; -import { WebGLBackground } from './webgl/WebGLBackground.js'; -import { WebGLBufferRenderer } from './webgl/WebGLBufferRenderer.js'; -import { WebGLCapabilities } from './webgl/WebGLCapabilities.js'; -import { WebGLClipping } from './webgl/WebGLClipping.js'; -import { WebGLExtensions } from './webgl/WebGLExtensions.js'; -import { WebGLGeometries } from './webgl/WebGLGeometries.js'; -import { WebGLIndexedBufferRenderer } from './webgl/WebGLIndexedBufferRenderer.js'; -import { WebGLInfo } from './webgl/WebGLInfo.js'; -import { WebGLMorphtargets } from './webgl/WebGLMorphtargets.js'; -import { WebGLObjects } from './webgl/WebGLObjects.js'; -import { WebGLPrograms } from './webgl/WebGLPrograms.js'; -import { WebGLProperties } from './webgl/WebGLProperties.js'; -import { WebGLRenderLists } from './webgl/WebGLRenderLists.js'; -import { WebGLRenderStates } from './webgl/WebGLRenderStates.js'; -import { WebGLShadowMap } from './webgl/WebGLShadowMap.js'; -import { WebGLState } from './webgl/WebGLState.js'; -import { WebGLTextures } from './webgl/WebGLTextures.js'; -import { WebGLUniforms } from './webgl/WebGLUniforms.js'; -import { WebGLUtils } from './webgl/WebGLUtils.js'; -import { WebVRManager } from './webvr/WebVRManager.js'; -import { WebXRManager } from './webvr/WebXRManager.js'; - -/** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - * @author tschw - */ - -function WebGLRenderer( parameters ) { - - parameters = parameters || {}; - - var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ), - _context = parameters.context !== undefined ? parameters.context : null, - - _alpha = parameters.alpha !== undefined ? parameters.alpha : false, - _depth = parameters.depth !== undefined ? parameters.depth : true, - _stencil = parameters.stencil !== undefined ? parameters.stencil : true, - _antialias = parameters.antialias !== undefined ? parameters.antialias : false, - _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, - _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false, - _powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default', - _failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false; - - var currentRenderList = null; - var currentRenderState = null; - - // public properties - - this.domElement = _canvas; - - // Debug configuration container - this.debug = { - - /** - * Enables error checking and reporting when shader programs are being compiled - * @type {boolean} - */ - checkShaderErrors: true - }; - - // clearing - - this.autoClear = true; - this.autoClearColor = true; - this.autoClearDepth = true; - this.autoClearStencil = true; - - // scene graph - - this.sortObjects = true; - - // user-defined clipping - - this.clippingPlanes = []; - this.localClippingEnabled = false; - - // physically based shading - - this.gammaFactor = 2.0; // for backwards compatibility - this.gammaInput = false; - this.gammaOutput = false; - - // physical lights - - this.physicallyCorrectLights = false; - - // tone mapping - - this.toneMapping = LinearToneMapping; - this.toneMappingExposure = 1.0; - this.toneMappingWhitePoint = 1.0; - - // morphs - - this.maxMorphTargets = 8; - this.maxMorphNormals = 4; - - // internal properties - - var _this = this, - - _isContextLost = false, - - // internal state cache - - _framebuffer = null, - - _currentActiveCubeFace = 0, - _currentActiveMipmapLevel = 0, - _currentRenderTarget = null, - _currentFramebuffer = null, - _currentMaterialId = - 1, - - // geometry and program caching - - _currentGeometryProgram = { - geometry: null, - program: null, - wireframe: false - }, - - _currentCamera = null, - _currentArrayCamera = null, - - _currentViewport = new Vector4(), - _currentScissor = new Vector4(), - _currentScissorTest = null, - - // - - _width = _canvas.width, - _height = _canvas.height, - - _pixelRatio = 1, - - _viewport = new Vector4( 0, 0, _width, _height ), - _scissor = new Vector4( 0, 0, _width, _height ), - _scissorTest = false, - - // frustum - - _frustum = new Frustum(), - - // clipping - - _clipping = new WebGLClipping(), - _clippingEnabled = false, - _localClippingEnabled = false, - - // camera matrices cache - - _projScreenMatrix = new Matrix4(), - - _vector3 = new Vector3(); - - function getTargetPixelRatio() { - - return _currentRenderTarget === null ? _pixelRatio : 1; - - } - - // initialize - - var _gl; - - try { - - var contextAttributes = { - alpha: _alpha, - depth: _depth, - stencil: _stencil, - antialias: _antialias, - premultipliedAlpha: _premultipliedAlpha, - preserveDrawingBuffer: _preserveDrawingBuffer, - powerPreference: _powerPreference, - failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat, - xrCompatible: true - }; - - // event listeners must be registered before WebGL context is created, see #12753 - - _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); - _canvas.addEventListener( 'webglcontextrestored', onContextRestore, false ); - - _gl = _context || _canvas.getContext( 'webgl', contextAttributes ) || _canvas.getContext( 'experimental-webgl', contextAttributes ); - - if ( _gl === null ) { - - if ( _canvas.getContext( 'webgl' ) !== null ) { - - throw new Error( 'Error creating WebGL context with your selected attributes.' ); - - } else { - - throw new Error( 'Error creating WebGL context.' ); - - } - - } - - // Some experimental-webgl implementations do not have getShaderPrecisionFormat - - if ( _gl.getShaderPrecisionFormat === undefined ) { - - _gl.getShaderPrecisionFormat = function () { - - return { 'rangeMin': 1, 'rangeMax': 1, 'precision': 1 }; - - }; - - } - - } catch ( error ) { - - console.error( 'THREE.WebGLRenderer: ' + error.message ); - throw error; - - } - - var extensions, capabilities, state, info; - var properties, textures, attributes, geometries, objects; - var programCache, renderLists, renderStates; - - var background, morphtargets, bufferRenderer, indexedBufferRenderer; - - var utils; - - function initGLContext() { - - extensions = new WebGLExtensions( _gl ); - - capabilities = new WebGLCapabilities( _gl, extensions, parameters ); - - if ( ! capabilities.isWebGL2 ) { - - extensions.get( 'WEBGL_depth_texture' ); - extensions.get( 'OES_texture_float' ); - extensions.get( 'OES_texture_half_float' ); - extensions.get( 'OES_texture_half_float_linear' ); - extensions.get( 'OES_standard_derivatives' ); - extensions.get( 'OES_element_index_uint' ); - extensions.get( 'ANGLE_instanced_arrays' ); - - } - - extensions.get( 'OES_texture_float_linear' ); - - utils = new WebGLUtils( _gl, extensions, capabilities ); - - state = new WebGLState( _gl, extensions, utils, capabilities ); - state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() ); - state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() ); - - info = new WebGLInfo( _gl ); - properties = new WebGLProperties(); - textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ); - attributes = new WebGLAttributes( _gl ); - geometries = new WebGLGeometries( _gl, attributes, info ); - objects = new WebGLObjects( geometries, info ); - morphtargets = new WebGLMorphtargets( _gl ); - programCache = new WebGLPrograms( _this, extensions, capabilities ); - renderLists = new WebGLRenderLists(); - renderStates = new WebGLRenderStates(); - - background = new WebGLBackground( _this, state, objects, _premultipliedAlpha ); - - bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities ); - indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities ); - - info.programs = programCache.programs; - - _this.capabilities = capabilities; - _this.extensions = extensions; - _this.properties = properties; - _this.renderLists = renderLists; - _this.state = state; - _this.info = info; - - } - - initGLContext(); - - // vr - - var vr = ( typeof navigator !== 'undefined' && 'xr' in navigator && 'supportsSession' in navigator.xr ) ? new WebXRManager( _this, _gl ) : new WebVRManager( _this ); - - this.vr = vr; - - // shadow map - - var shadowMap = new WebGLShadowMap( _this, objects, capabilities.maxTextureSize ); - - this.shadowMap = shadowMap; - - // API - - this.getContext = function () { - - return _gl; - - }; - - this.getContextAttributes = function () { - - return _gl.getContextAttributes(); - - }; - - this.forceContextLoss = function () { - - var extension = extensions.get( 'WEBGL_lose_context' ); - if ( extension ) extension.loseContext(); - - }; - - this.forceContextRestore = function () { - - var extension = extensions.get( 'WEBGL_lose_context' ); - if ( extension ) extension.restoreContext(); - - }; - - this.getPixelRatio = function () { - - return _pixelRatio; - - }; - - this.setPixelRatio = function ( value ) { - - if ( value === undefined ) return; - - _pixelRatio = value; - - this.setSize( _width, _height, false ); - - }; - - this.getSize = function ( target ) { - - if ( target === undefined ) { - - console.warn( 'WebGLRenderer: .getsize() now requires a Vector2 as an argument' ); - - target = new Vector2(); - - } - - return target.set( _width, _height ); - - }; - - this.setSize = function ( width, height, updateStyle ) { - - if ( vr.isPresenting() ) { - - console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' ); - return; - - } - - _width = width; - _height = height; - - _canvas.width = Math.floor( width * _pixelRatio ); - _canvas.height = Math.floor( height * _pixelRatio ); - - if ( updateStyle !== false ) { - - _canvas.style.width = width + 'px'; - _canvas.style.height = height + 'px'; - - } - - this.setViewport( 0, 0, width, height ); - - }; - - this.getDrawingBufferSize = function ( target ) { - - if ( target === undefined ) { - - console.warn( 'WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument' ); - - target = new Vector2(); - - } - - return target.set( _width * _pixelRatio, _height * _pixelRatio ).floor(); - - }; - - this.setDrawingBufferSize = function ( width, height, pixelRatio ) { - - _width = width; - _height = height; - - _pixelRatio = pixelRatio; - - _canvas.width = Math.floor( width * pixelRatio ); - _canvas.height = Math.floor( height * pixelRatio ); - - this.setViewport( 0, 0, width, height ); - - }; - - this.getCurrentViewport = function ( target ) { - - if ( target === undefined ) { - - console.warn( 'WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument' ); - - target = new Vector4(); - - } - - return target.copy( _currentViewport ); - - }; - - this.getViewport = function ( target ) { - - return target.copy( _viewport ); - - }; - - this.setViewport = function ( x, y, width, height ) { - - if ( x.isVector4 ) { - - _viewport.set( x.x, x.y, x.z, x.w ); - - } else { - - _viewport.set( x, y, width, height ); - - } - - state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() ); - - }; - - this.getScissor = function ( target ) { - - return target.copy( _scissor ); - - }; - - this.setScissor = function ( x, y, width, height ) { - - if ( x.isVector4 ) { - - _scissor.set( x.x, x.y, x.z, x.w ); - - } else { - - _scissor.set( x, y, width, height ); - - } - - state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() ); - - }; - - this.getScissorTest = function () { - - return _scissorTest; - - }; - - this.setScissorTest = function ( boolean ) { - - state.setScissorTest( _scissorTest = boolean ); - - }; - - // Clearing - - this.getClearColor = function () { - - return background.getClearColor(); - - }; - - this.setClearColor = function () { - - background.setClearColor.apply( background, arguments ); - - }; - - this.getClearAlpha = function () { - - return background.getClearAlpha(); - - }; - - this.setClearAlpha = function () { - - background.setClearAlpha.apply( background, arguments ); - - }; - - this.clear = function ( color, depth, stencil ) { - - var bits = 0; - - if ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT; - if ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT; - if ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT; - - _gl.clear( bits ); - - }; - - this.clearColor = function () { - - this.clear( true, false, false ); - - }; - - this.clearDepth = function () { - - this.clear( false, true, false ); - - }; - - this.clearStencil = function () { - - this.clear( false, false, true ); - - }; - - // - - this.dispose = function () { - - _canvas.removeEventListener( 'webglcontextlost', onContextLost, false ); - _canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false ); - - renderLists.dispose(); - renderStates.dispose(); - properties.dispose(); - objects.dispose(); - - vr.dispose(); - - animation.stop(); - - }; - - // Events - - function onContextLost( event ) { - - event.preventDefault(); - - console.log( 'THREE.WebGLRenderer: Context Lost.' ); - - _isContextLost = true; - - } - - function onContextRestore( /* event */ ) { - - console.log( 'THREE.WebGLRenderer: Context Restored.' ); - - _isContextLost = false; - - initGLContext(); - - } - - function onMaterialDispose( event ) { - - var material = event.target; - - material.removeEventListener( 'dispose', onMaterialDispose ); - - deallocateMaterial( material ); - - } - - // Buffer deallocation - - function deallocateMaterial( material ) { - - releaseMaterialProgramReference( material ); - - properties.remove( material ); - - } - - - function releaseMaterialProgramReference( material ) { - - var programInfo = properties.get( material ).program; - - material.program = undefined; - - if ( programInfo !== undefined ) { - - programCache.releaseProgram( programInfo ); - - } - - } - - // Buffer rendering - - function renderObjectImmediate( object, program ) { - - object.render( function ( object ) { - - _this.renderBufferImmediate( object, program ); - - } ); - - } - - this.renderBufferImmediate = function ( object, program ) { - - state.initAttributes(); - - var buffers = properties.get( object ); - - if ( object.hasPositions && ! buffers.position ) buffers.position = _gl.createBuffer(); - if ( object.hasNormals && ! buffers.normal ) buffers.normal = _gl.createBuffer(); - if ( object.hasUvs && ! buffers.uv ) buffers.uv = _gl.createBuffer(); - if ( object.hasColors && ! buffers.color ) buffers.color = _gl.createBuffer(); - - var programAttributes = program.getAttributes(); - - if ( object.hasPositions ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.position ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW ); - - state.enableAttribute( programAttributes.position ); - _gl.vertexAttribPointer( programAttributes.position, 3, _gl.FLOAT, false, 0, 0 ); - - } - - if ( object.hasNormals ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW ); - - state.enableAttribute( programAttributes.normal ); - _gl.vertexAttribPointer( programAttributes.normal, 3, _gl.FLOAT, false, 0, 0 ); - - } - - if ( object.hasUvs ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.uv ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW ); - - state.enableAttribute( programAttributes.uv ); - _gl.vertexAttribPointer( programAttributes.uv, 2, _gl.FLOAT, false, 0, 0 ); - - } - - if ( object.hasColors ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.color ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW ); - - state.enableAttribute( programAttributes.color ); - _gl.vertexAttribPointer( programAttributes.color, 3, _gl.FLOAT, false, 0, 0 ); - - } - - state.disableUnusedAttributes(); - - _gl.drawArrays( _gl.TRIANGLES, 0, object.count ); - - object.count = 0; - - }; - - this.renderBufferDirect = function ( camera, fog, geometry, material, object, group ) { - - var frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 ); - - state.setMaterial( material, frontFaceCW ); - - var program = setProgram( camera, fog, material, object ); - - var updateBuffers = false; - - if ( _currentGeometryProgram.geometry !== geometry.id || - _currentGeometryProgram.program !== program.id || - _currentGeometryProgram.wireframe !== ( material.wireframe === true ) ) { - - _currentGeometryProgram.geometry = geometry.id; - _currentGeometryProgram.program = program.id; - _currentGeometryProgram.wireframe = material.wireframe === true; - updateBuffers = true; - - } - - if ( object.morphTargetInfluences ) { - - morphtargets.update( object, geometry, material, program ); - - updateBuffers = true; - - } - - // - - var index = geometry.index; - var position = geometry.attributes.position; - var rangeFactor = 1; - - if ( material.wireframe === true ) { - - index = geometries.getWireframeAttribute( geometry ); - rangeFactor = 2; - - } - - var attribute; - var renderer = bufferRenderer; - - if ( index !== null ) { - - attribute = attributes.get( index ); - - renderer = indexedBufferRenderer; - renderer.setIndex( attribute ); - - } - - if ( updateBuffers ) { - - setupVertexAttributes( material, program, geometry ); - - if ( index !== null ) { - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, attribute.buffer ); - - } - - } - - // - - var dataCount = Infinity; - - if ( index !== null ) { - - dataCount = index.count; - - } else if ( position !== undefined ) { - - dataCount = position.count; - - } - - var rangeStart = geometry.drawRange.start * rangeFactor; - var rangeCount = geometry.drawRange.count * rangeFactor; - - var groupStart = group !== null ? group.start * rangeFactor : 0; - var groupCount = group !== null ? group.count * rangeFactor : Infinity; - - var drawStart = Math.max( rangeStart, groupStart ); - var drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1; - - var drawCount = Math.max( 0, drawEnd - drawStart + 1 ); - - if ( drawCount === 0 ) return; - - // - - if ( object.isMesh ) { - - if ( material.wireframe === true ) { - - state.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() ); - renderer.setMode( _gl.LINES ); - - } else { - - switch ( object.drawMode ) { - - case TrianglesDrawMode: - renderer.setMode( _gl.TRIANGLES ); - break; - - case TriangleStripDrawMode: - renderer.setMode( _gl.TRIANGLE_STRIP ); - break; - - case TriangleFanDrawMode: - renderer.setMode( _gl.TRIANGLE_FAN ); - break; - - } - - } - - - } else if ( object.isLine ) { - - var lineWidth = material.linewidth; - - if ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material - - state.setLineWidth( lineWidth * getTargetPixelRatio() ); - - if ( object.isLineSegments ) { - - renderer.setMode( _gl.LINES ); - - } else if ( object.isLineLoop ) { - - renderer.setMode( _gl.LINE_LOOP ); - - } else { - - renderer.setMode( _gl.LINE_STRIP ); - - } - - } else if ( object.isPoints ) { - - renderer.setMode( _gl.POINTS ); - - } else if ( object.isSprite ) { - - renderer.setMode( _gl.TRIANGLES ); - - } - - if ( geometry && geometry.isInstancedBufferGeometry ) { - - if ( geometry.maxInstancedCount > 0 ) { - - renderer.renderInstances( geometry, drawStart, drawCount ); - - } - - } else { - - renderer.render( drawStart, drawCount ); - - } - - }; - - function setupVertexAttributes( material, program, geometry ) { - - if ( geometry && geometry.isInstancedBufferGeometry && ! capabilities.isWebGL2 ) { - - if ( extensions.get( 'ANGLE_instanced_arrays' ) === null ) { - - console.error( 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; - - } - - } - - state.initAttributes(); - - var geometryAttributes = geometry.attributes; - - var programAttributes = program.getAttributes(); - - var materialDefaultAttributeValues = material.defaultAttributeValues; - - for ( var name in programAttributes ) { - - var programAttribute = programAttributes[ name ]; - - if ( programAttribute >= 0 ) { - - var geometryAttribute = geometryAttributes[ name ]; - - if ( geometryAttribute !== undefined ) { - - var normalized = geometryAttribute.normalized; - var size = geometryAttribute.itemSize; - - var attribute = attributes.get( geometryAttribute ); - - // TODO Attribute may not be available on context restore - - if ( attribute === undefined ) continue; - - var buffer = attribute.buffer; - var type = attribute.type; - var bytesPerElement = attribute.bytesPerElement; - - if ( geometryAttribute.isInterleavedBufferAttribute ) { - - var data = geometryAttribute.data; - var stride = data.stride; - var offset = geometryAttribute.offset; - - if ( data && data.isInstancedInterleavedBuffer ) { - - state.enableAttributeAndDivisor( programAttribute, data.meshPerAttribute ); - - if ( geometry.maxInstancedCount === undefined ) { - - geometry.maxInstancedCount = data.meshPerAttribute * data.count; - - } - - } else { - - state.enableAttribute( programAttribute ); - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); - _gl.vertexAttribPointer( programAttribute, size, type, normalized, stride * bytesPerElement, offset * bytesPerElement ); - - } else { - - if ( geometryAttribute.isInstancedBufferAttribute ) { - - state.enableAttributeAndDivisor( programAttribute, geometryAttribute.meshPerAttribute ); - - if ( geometry.maxInstancedCount === undefined ) { - - geometry.maxInstancedCount = geometryAttribute.meshPerAttribute * geometryAttribute.count; - - } - - } else { - - state.enableAttribute( programAttribute ); - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, buffer ); - _gl.vertexAttribPointer( programAttribute, size, type, normalized, 0, 0 ); - - } - - } else if ( materialDefaultAttributeValues !== undefined ) { - - var value = materialDefaultAttributeValues[ name ]; - - if ( value !== undefined ) { - - switch ( value.length ) { - - case 2: - _gl.vertexAttrib2fv( programAttribute, value ); - break; - - case 3: - _gl.vertexAttrib3fv( programAttribute, value ); - break; - - case 4: - _gl.vertexAttrib4fv( programAttribute, value ); - break; - - default: - _gl.vertexAttrib1fv( programAttribute, value ); - - } - - } - - } - - } - - } - - state.disableUnusedAttributes(); - - } - - // Compile - - this.compile = function ( scene, camera ) { - - currentRenderState = renderStates.get( scene, camera ); - currentRenderState.init(); - - scene.traverse( function ( object ) { - - if ( object.isLight ) { - - currentRenderState.pushLight( object ); - - if ( object.castShadow ) { - - currentRenderState.pushShadow( object ); - - } - - } - - } ); - - currentRenderState.setupLights( camera ); - - scene.traverse( function ( object ) { - - if ( object.material ) { - - if ( Array.isArray( object.material ) ) { - - for ( var i = 0; i < object.material.length; i ++ ) { - - initMaterial( object.material[ i ], scene.fog, object ); - - } - - } else { - - initMaterial( object.material, scene.fog, object ); - - } - - } - - } ); - - }; - - // Animation Loop - - var onAnimationFrameCallback = null; - - function onAnimationFrame( time ) { - - if ( vr.isPresenting() ) return; - if ( onAnimationFrameCallback ) onAnimationFrameCallback( time ); - - } - - var animation = new WebGLAnimation(); - animation.setAnimationLoop( onAnimationFrame ); - - if ( typeof window !== 'undefined' ) animation.setContext( window ); - - this.setAnimationLoop = function ( callback ) { - - onAnimationFrameCallback = callback; - vr.setAnimationLoop( callback ); - - animation.start(); - - }; - - // Rendering - - this.render = function ( scene, camera ) { - - var renderTarget, forceClear; - - if ( arguments[ 2 ] !== undefined ) { - - console.warn( 'THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.' ); - renderTarget = arguments[ 2 ]; - - } - - if ( arguments[ 3 ] !== undefined ) { - - console.warn( 'THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.' ); - forceClear = arguments[ 3 ]; - - } - - if ( ! ( camera && camera.isCamera ) ) { - - console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' ); - return; - - } - - if ( _isContextLost ) return; - - // reset caching for this frame - - _currentGeometryProgram.geometry = null; - _currentGeometryProgram.program = null; - _currentGeometryProgram.wireframe = false; - _currentMaterialId = - 1; - _currentCamera = null; - - // update scene graph - - if ( scene.autoUpdate === true ) scene.updateMatrixWorld(); - - // update camera matrices and frustum - - if ( camera.parent === null ) camera.updateMatrixWorld(); - - if ( vr.enabled ) { - - camera = vr.getCamera( camera ); - - } - - // - - currentRenderState = renderStates.get( scene, camera ); - currentRenderState.init(); - - scene.onBeforeRender( _this, scene, camera, renderTarget || _currentRenderTarget ); - - _projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); - - _localClippingEnabled = this.localClippingEnabled; - _clippingEnabled = _clipping.init( this.clippingPlanes, _localClippingEnabled, camera ); - - currentRenderList = renderLists.get( scene, camera ); - currentRenderList.init(); - - projectObject( scene, camera, 0, _this.sortObjects ); - - if ( _this.sortObjects === true ) { - - currentRenderList.sort(); - - } - - // - - if ( _clippingEnabled ) _clipping.beginShadows(); - - var shadowsArray = currentRenderState.state.shadowsArray; - - shadowMap.render( shadowsArray, scene, camera ); - - currentRenderState.setupLights( camera ); - - if ( _clippingEnabled ) _clipping.endShadows(); - - // - - if ( this.info.autoReset ) this.info.reset(); - - if ( renderTarget !== undefined ) { - - this.setRenderTarget( renderTarget ); - - } - - // - - background.render( currentRenderList, scene, camera, forceClear ); - - // render scene - - var opaqueObjects = currentRenderList.opaque; - var transparentObjects = currentRenderList.transparent; - - if ( scene.overrideMaterial ) { - - var overrideMaterial = scene.overrideMaterial; - - if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera, overrideMaterial ); - if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera, overrideMaterial ); - - } else { - - // opaque pass (front-to-back order) - - if ( opaqueObjects.length ) renderObjects( opaqueObjects, scene, camera ); - - // transparent pass (back-to-front order) - - if ( transparentObjects.length ) renderObjects( transparentObjects, scene, camera ); - - } - - // - - scene.onAfterRender( _this, scene, camera ); - - // - - if ( _currentRenderTarget !== null ) { - - // Generate mipmap if we're using any kind of mipmap filtering - - textures.updateRenderTargetMipmap( _currentRenderTarget ); - - // resolve multisample renderbuffers to a single-sample texture if necessary - - textures.updateMultisampleRenderTarget( _currentRenderTarget ); - - } - - // Ensure depth buffer writing is enabled so it can be cleared on next render - - state.buffers.depth.setTest( true ); - state.buffers.depth.setMask( true ); - state.buffers.color.setMask( true ); - - state.setPolygonOffset( false ); - - if ( vr.enabled ) { - - vr.submitFrame(); - - } - - // _gl.finish(); - - currentRenderList = null; - currentRenderState = null; - - }; - - function projectObject( object, camera, groupOrder, sortObjects ) { - - if ( object.visible === false ) return; - - var visible = object.layers.test( camera.layers ); - - if ( visible ) { - - if ( object.isGroup ) { - - groupOrder = object.renderOrder; - - } else if ( object.isLOD ) { - - if ( object.autoUpdate === true ) object.update( camera ); - - } else if ( object.isLight ) { - - currentRenderState.pushLight( object ); - - if ( object.castShadow ) { - - currentRenderState.pushShadow( object ); - - } - - } else if ( object.isSprite ) { - - if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) { - - if ( sortObjects ) { - - _vector3.setFromMatrixPosition( object.matrixWorld ) - .applyMatrix4( _projScreenMatrix ); - - } - - var geometry = objects.update( object ); - var material = object.material; - - if ( material.visible ) { - - currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); - - } - - } - - } else if ( object.isImmediateRenderObject ) { - - if ( sortObjects ) { - - _vector3.setFromMatrixPosition( object.matrixWorld ) - .applyMatrix4( _projScreenMatrix ); - - } - - currentRenderList.push( object, null, object.material, groupOrder, _vector3.z, null ); - - } else if ( object.isMesh || object.isLine || object.isPoints ) { - - if ( object.isSkinnedMesh ) { - - object.skeleton.update(); - - } - - if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) { - - if ( sortObjects ) { - - _vector3.setFromMatrixPosition( object.matrixWorld ) - .applyMatrix4( _projScreenMatrix ); - - } - - var geometry = objects.update( object ); - var material = object.material; - - if ( Array.isArray( material ) ) { - - var groups = geometry.groups; - - for ( var i = 0, l = groups.length; i < l; i ++ ) { - - var group = groups[ i ]; - var groupMaterial = material[ group.materialIndex ]; - - if ( groupMaterial && groupMaterial.visible ) { - - currentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector3.z, group ); - - } - - } - - } else if ( material.visible ) { - - currentRenderList.push( object, geometry, material, groupOrder, _vector3.z, null ); - - } - - } - - } - - } - - var children = object.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - projectObject( children[ i ], camera, groupOrder, sortObjects ); - - } - - } - - function renderObjects( renderList, scene, camera, overrideMaterial ) { - - for ( var i = 0, l = renderList.length; i < l; i ++ ) { - - var renderItem = renderList[ i ]; - - var object = renderItem.object; - var geometry = renderItem.geometry; - var material = overrideMaterial === undefined ? renderItem.material : overrideMaterial; - var group = renderItem.group; - - if ( camera.isArrayCamera ) { - - _currentArrayCamera = camera; - - var cameras = camera.cameras; - - for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { - - var camera2 = cameras[ j ]; - - if ( object.layers.test( camera2.layers ) ) { - - state.viewport( _currentViewport.copy( camera2.viewport ) ); - - currentRenderState.setupLights( camera2 ); - - renderObject( object, scene, camera2, geometry, material, group ); - - } - - } - - } else { - - _currentArrayCamera = null; - - renderObject( object, scene, camera, geometry, material, group ); - - } - - } - - } - - function renderObject( object, scene, camera, geometry, material, group ) { - - object.onBeforeRender( _this, scene, camera, geometry, material, group ); - currentRenderState = renderStates.get( scene, _currentArrayCamera || camera ); - - object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld ); - object.normalMatrix.getNormalMatrix( object.modelViewMatrix ); - - if ( object.isImmediateRenderObject ) { - - state.setMaterial( material ); - - var program = setProgram( camera, scene.fog, material, object ); - - _currentGeometryProgram.geometry = null; - _currentGeometryProgram.program = null; - _currentGeometryProgram.wireframe = false; - - renderObjectImmediate( object, program ); - - } else { - - _this.renderBufferDirect( camera, scene.fog, geometry, material, object, group ); - - } - - object.onAfterRender( _this, scene, camera, geometry, material, group ); - currentRenderState = renderStates.get( scene, _currentArrayCamera || camera ); - - } - - function initMaterial( material, fog, object ) { - - var materialProperties = properties.get( material ); - - var lights = currentRenderState.state.lights; - var shadowsArray = currentRenderState.state.shadowsArray; - - var lightsStateVersion = lights.state.version; - - var parameters = programCache.getParameters( - material, lights.state, shadowsArray, fog, _clipping.numPlanes, _clipping.numIntersection, object ); - - var code = programCache.getProgramCode( material, parameters ); - - var program = materialProperties.program; - var programChange = true; - - if ( program === undefined ) { - - // new material - material.addEventListener( 'dispose', onMaterialDispose ); - - } else if ( program.code !== code ) { - - // changed glsl or parameters - releaseMaterialProgramReference( material ); - - } else if ( materialProperties.lightsStateVersion !== lightsStateVersion ) { - - materialProperties.lightsStateVersion = lightsStateVersion; - - programChange = false; - - } else if ( parameters.shaderID !== undefined ) { - - // same glsl and uniform list - return; - - } else { - - // only rebuild uniform list - programChange = false; - - } - - if ( programChange ) { - - if ( parameters.shaderID ) { - - var shader = ShaderLib[ parameters.shaderID ]; - - materialProperties.shader = { - name: material.type, - uniforms: cloneUniforms( shader.uniforms ), - vertexShader: shader.vertexShader, - fragmentShader: shader.fragmentShader - }; - - } else { - - materialProperties.shader = { - name: material.type, - uniforms: material.uniforms, - vertexShader: material.vertexShader, - fragmentShader: material.fragmentShader - }; - - } - - material.onBeforeCompile( materialProperties.shader, _this ); - - // Computing code again as onBeforeCompile may have changed the shaders - code = programCache.getProgramCode( material, parameters ); - - program = programCache.acquireProgram( material, materialProperties.shader, parameters, code ); - - materialProperties.program = program; - material.program = program; - - } - - var programAttributes = program.getAttributes(); - - if ( material.morphTargets ) { - - material.numSupportedMorphTargets = 0; - - for ( var i = 0; i < _this.maxMorphTargets; i ++ ) { - - if ( programAttributes[ 'morphTarget' + i ] >= 0 ) { - - material.numSupportedMorphTargets ++; - - } - - } - - } - - if ( material.morphNormals ) { - - material.numSupportedMorphNormals = 0; - - for ( var i = 0; i < _this.maxMorphNormals; i ++ ) { - - if ( programAttributes[ 'morphNormal' + i ] >= 0 ) { - - material.numSupportedMorphNormals ++; - - } - - } - - } - - var uniforms = materialProperties.shader.uniforms; - - if ( ! material.isShaderMaterial && - ! material.isRawShaderMaterial || - material.clipping === true ) { - - materialProperties.numClippingPlanes = _clipping.numPlanes; - materialProperties.numIntersection = _clipping.numIntersection; - uniforms.clippingPlanes = _clipping.uniform; - - } - - materialProperties.fog = fog; - - // store the light setup it was created for - - materialProperties.lightsStateVersion = lightsStateVersion; - - if ( material.lights ) { - - // wire up the material to this renderer's lighting state - - uniforms.ambientLightColor.value = lights.state.ambient; - uniforms.lightProbe.value = lights.state.probe; - uniforms.directionalLights.value = lights.state.directional; - uniforms.spotLights.value = lights.state.spot; - uniforms.rectAreaLights.value = lights.state.rectArea; - uniforms.pointLights.value = lights.state.point; - uniforms.hemisphereLights.value = lights.state.hemi; - - uniforms.directionalShadowMap.value = lights.state.directionalShadowMap; - uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix; - uniforms.spotShadowMap.value = lights.state.spotShadowMap; - uniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix; - uniforms.pointShadowMap.value = lights.state.pointShadowMap; - uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; - // TODO (abelnation): add area lights shadow info to uniforms - - } - - var progUniforms = materialProperties.program.getUniforms(), - uniformsList = - WebGLUniforms.seqWithValue( progUniforms.seq, uniforms ); - - materialProperties.uniformsList = uniformsList; - - } - - function setProgram( camera, fog, material, object ) { - - textures.resetTextureUnits(); - - var materialProperties = properties.get( material ); - var lights = currentRenderState.state.lights; - - if ( _clippingEnabled ) { - - if ( _localClippingEnabled || camera !== _currentCamera ) { - - var useCache = - camera === _currentCamera && - material.id === _currentMaterialId; - - // we might want to call this function with some ClippingGroup - // object instead of the material, once it becomes feasible - // (#8465, #8379) - _clipping.setState( - material.clippingPlanes, material.clipIntersection, material.clipShadows, - camera, materialProperties, useCache ); - - } - - } - - if ( material.needsUpdate === false ) { - - if ( materialProperties.program === undefined ) { - - material.needsUpdate = true; - - } else if ( material.fog && materialProperties.fog !== fog ) { - - material.needsUpdate = true; - - } else if ( material.lights && materialProperties.lightsStateVersion !== lights.state.version ) { - - material.needsUpdate = true; - - } else if ( materialProperties.numClippingPlanes !== undefined && - ( materialProperties.numClippingPlanes !== _clipping.numPlanes || - materialProperties.numIntersection !== _clipping.numIntersection ) ) { - - material.needsUpdate = true; - - } - - } - - if ( material.needsUpdate ) { - - initMaterial( material, fog, object ); - material.needsUpdate = false; - - } - - var refreshProgram = false; - var refreshMaterial = false; - var refreshLights = false; - - var program = materialProperties.program, - p_uniforms = program.getUniforms(), - m_uniforms = materialProperties.shader.uniforms; - - if ( state.useProgram( program.program ) ) { - - refreshProgram = true; - refreshMaterial = true; - refreshLights = true; - - } - - if ( material.id !== _currentMaterialId ) { - - _currentMaterialId = material.id; - - refreshMaterial = true; - - } - - if ( refreshProgram || _currentCamera !== camera ) { - - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); - - if ( capabilities.logarithmicDepthBuffer ) { - - p_uniforms.setValue( _gl, 'logDepthBufFC', - 2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) ); - - } - - if ( _currentCamera !== camera ) { - - _currentCamera = camera; - - // lighting uniforms depend on the camera so enforce an update - // now, in case this material supports lights - or later, when - // the next material that does gets activated: - - refreshMaterial = true; // set to true on material change - refreshLights = true; // remains set until update done - - } - - // load material specific uniforms - // (shader material also gets them for the sake of genericity) - - if ( material.isShaderMaterial || - material.isMeshPhongMaterial || - material.isMeshStandardMaterial || - material.envMap ) { - - var uCamPos = p_uniforms.map.cameraPosition; - - if ( uCamPos !== undefined ) { - - uCamPos.setValue( _gl, - _vector3.setFromMatrixPosition( camera.matrixWorld ) ); - - } - - } - - if ( material.isMeshPhongMaterial || - material.isMeshLambertMaterial || - material.isMeshBasicMaterial || - material.isMeshStandardMaterial || - material.isShaderMaterial || - material.skinning ) { - - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); - - } - - } - - // skinning uniforms must be set even if material didn't change - // auto-setting of texture unit for bone texture must go before other textures - // not sure why, but otherwise weird things happen - - if ( material.skinning ) { - - p_uniforms.setOptional( _gl, object, 'bindMatrix' ); - p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' ); - - var skeleton = object.skeleton; - - if ( skeleton ) { - - var bones = skeleton.bones; - - if ( capabilities.floatVertexTextures ) { - - if ( skeleton.boneTexture === undefined ) { - - // layout (1 matrix = 4 pixels) - // RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4) - // with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8) - // 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16) - // 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32) - // 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64) - - - var size = Math.sqrt( bones.length * 4 ); // 4 pixels needed for 1 matrix - size = _Math.ceilPowerOfTwo( size ); - size = Math.max( size, 4 ); - - var boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel - boneMatrices.set( skeleton.boneMatrices ); // copy current values - - var boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType ); - boneTexture.needsUpdate = true; - - skeleton.boneMatrices = boneMatrices; - skeleton.boneTexture = boneTexture; - skeleton.boneTextureSize = size; - - } - - p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures ); - p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); - - } else { - - p_uniforms.setOptional( _gl, skeleton, 'boneMatrices' ); - - } - - } - - } - - if ( refreshMaterial ) { - - p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure ); - p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint ); - - if ( material.lights ) { - - // the current material requires lighting info - - // note: all lighting uniforms are always set correctly - // they simply reference the renderer's state for their - // values - // - // use the current material's .needsUpdate flags to set - // the GL state when required - - markUniformsLightsNeedsUpdate( m_uniforms, refreshLights ); - - } - - // refresh uniforms common to several materials - - if ( fog && material.fog ) { - - refreshUniformsFog( m_uniforms, fog ); - - } - - if ( material.isMeshBasicMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - - } else if ( material.isMeshLambertMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - refreshUniformsLambert( m_uniforms, material ); - - } else if ( material.isMeshPhongMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - - if ( material.isMeshToonMaterial ) { - - refreshUniformsToon( m_uniforms, material ); - - } else { - - refreshUniformsPhong( m_uniforms, material ); - - } - - } else if ( material.isMeshStandardMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - - if ( material.isMeshPhysicalMaterial ) { - - refreshUniformsPhysical( m_uniforms, material ); - - } else { - - refreshUniformsStandard( m_uniforms, material ); - - } - - } else if ( material.isMeshMatcapMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - - refreshUniformsMatcap( m_uniforms, material ); - - } else if ( material.isMeshDepthMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - refreshUniformsDepth( m_uniforms, material ); - - } else if ( material.isMeshDistanceMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - refreshUniformsDistance( m_uniforms, material ); - - } else if ( material.isMeshNormalMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - refreshUniformsNormal( m_uniforms, material ); - - } else if ( material.isLineBasicMaterial ) { - - refreshUniformsLine( m_uniforms, material ); - - if ( material.isLineDashedMaterial ) { - - refreshUniformsDash( m_uniforms, material ); - - } - - } else if ( material.isPointsMaterial ) { - - refreshUniformsPoints( m_uniforms, material ); - - } else if ( material.isSpriteMaterial ) { - - refreshUniformsSprites( m_uniforms, material ); - - } else if ( material.isShadowMaterial ) { - - m_uniforms.color.value.copy( material.color ); - m_uniforms.opacity.value = material.opacity; - - } - - // RectAreaLight Texture - // TODO (mrdoob): Find a nicer implementation - - if ( m_uniforms.ltc_1 !== undefined ) m_uniforms.ltc_1.value = UniformsLib.LTC_1; - if ( m_uniforms.ltc_2 !== undefined ) m_uniforms.ltc_2.value = UniformsLib.LTC_2; - - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); - - } - - if ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) { - - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); - material.uniformsNeedUpdate = false; - - } - - if ( material.isSpriteMaterial ) { - - p_uniforms.setValue( _gl, 'center', object.center ); - - } - - // common matrices - - p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); - p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); - p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); - - return program; - - } - - // Uniforms (refresh uniforms objects) - - function refreshUniformsCommon( uniforms, material ) { - - uniforms.opacity.value = material.opacity; - - if ( material.color ) { - - uniforms.diffuse.value.copy( material.color ); - - } - - if ( material.emissive ) { - - uniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity ); - - } - - if ( material.map ) { - - uniforms.map.value = material.map; - - } - - if ( material.alphaMap ) { - - uniforms.alphaMap.value = material.alphaMap; - - } - - if ( material.specularMap ) { - - uniforms.specularMap.value = material.specularMap; - - } - - if ( material.envMap ) { - - uniforms.envMap.value = material.envMap; - - // don't flip CubeTexture envMaps, flip everything else: - // WebGLRenderTargetCube will be flipped for backwards compatibility - // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture - // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future - uniforms.flipEnvMap.value = material.envMap.isCubeTexture ? - 1 : 1; - - uniforms.reflectivity.value = material.reflectivity; - uniforms.refractionRatio.value = material.refractionRatio; - - uniforms.maxMipLevel.value = properties.get( material.envMap ).__maxMipLevel; - - } - - if ( material.lightMap ) { - - uniforms.lightMap.value = material.lightMap; - uniforms.lightMapIntensity.value = material.lightMapIntensity; - - } - - if ( material.aoMap ) { - - uniforms.aoMap.value = material.aoMap; - uniforms.aoMapIntensity.value = material.aoMapIntensity; - - } - - // uv repeat and offset setting priorities - // 1. color map - // 2. specular map - // 3. normal map - // 4. bump map - // 5. alpha map - // 6. emissive map - - var uvScaleMap; - - if ( material.map ) { - - uvScaleMap = material.map; - - } else if ( material.specularMap ) { - - uvScaleMap = material.specularMap; - - } else if ( material.displacementMap ) { - - uvScaleMap = material.displacementMap; - - } else if ( material.normalMap ) { - - uvScaleMap = material.normalMap; - - } else if ( material.bumpMap ) { - - uvScaleMap = material.bumpMap; - - } else if ( material.roughnessMap ) { - - uvScaleMap = material.roughnessMap; - - } else if ( material.metalnessMap ) { - - uvScaleMap = material.metalnessMap; - - } else if ( material.alphaMap ) { - - uvScaleMap = material.alphaMap; - - } else if ( material.emissiveMap ) { - - uvScaleMap = material.emissiveMap; - - } - - if ( uvScaleMap !== undefined ) { - - // backwards compatibility - if ( uvScaleMap.isWebGLRenderTarget ) { - - uvScaleMap = uvScaleMap.texture; - - } - - if ( uvScaleMap.matrixAutoUpdate === true ) { - - uvScaleMap.updateMatrix(); - - } - - uniforms.uvTransform.value.copy( uvScaleMap.matrix ); - - } - - } - - function refreshUniformsLine( uniforms, material ) { - - uniforms.diffuse.value.copy( material.color ); - uniforms.opacity.value = material.opacity; - - } - - function refreshUniformsDash( uniforms, material ) { - - uniforms.dashSize.value = material.dashSize; - uniforms.totalSize.value = material.dashSize + material.gapSize; - uniforms.scale.value = material.scale; - - } - - function refreshUniformsPoints( uniforms, material ) { - - uniforms.diffuse.value.copy( material.color ); - uniforms.opacity.value = material.opacity; - uniforms.size.value = material.size * _pixelRatio; - uniforms.scale.value = _height * 0.5; - - uniforms.map.value = material.map; - - if ( material.map !== null ) { - - if ( material.map.matrixAutoUpdate === true ) { - - material.map.updateMatrix(); - - } - - uniforms.uvTransform.value.copy( material.map.matrix ); - - } - - } - - function refreshUniformsSprites( uniforms, material ) { - - uniforms.diffuse.value.copy( material.color ); - uniforms.opacity.value = material.opacity; - uniforms.rotation.value = material.rotation; - uniforms.map.value = material.map; - - if ( material.map !== null ) { - - if ( material.map.matrixAutoUpdate === true ) { - - material.map.updateMatrix(); - - } - - uniforms.uvTransform.value.copy( material.map.matrix ); - - } - - } - - function refreshUniformsFog( uniforms, fog ) { - - uniforms.fogColor.value.copy( fog.color ); - - if ( fog.isFog ) { - - uniforms.fogNear.value = fog.near; - uniforms.fogFar.value = fog.far; - - } else if ( fog.isFogExp2 ) { - - uniforms.fogDensity.value = fog.density; - - } - - } - - function refreshUniformsLambert( uniforms, material ) { - - if ( material.emissiveMap ) { - - uniforms.emissiveMap.value = material.emissiveMap; - - } - - } - - function refreshUniformsPhong( uniforms, material ) { - - uniforms.specular.value.copy( material.specular ); - uniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 ) - - if ( material.emissiveMap ) { - - uniforms.emissiveMap.value = material.emissiveMap; - - } - - if ( material.bumpMap ) { - - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; - if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; - - } - - if ( material.normalMap ) { - - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); - if ( material.side === BackSide ) uniforms.normalScale.value.negate(); - - } - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - } - - function refreshUniformsToon( uniforms, material ) { - - refreshUniformsPhong( uniforms, material ); - - if ( material.gradientMap ) { - - uniforms.gradientMap.value = material.gradientMap; - - } - - } - - function refreshUniformsStandard( uniforms, material ) { - - uniforms.roughness.value = material.roughness; - uniforms.metalness.value = material.metalness; - - if ( material.roughnessMap ) { - - uniforms.roughnessMap.value = material.roughnessMap; - - } - - if ( material.metalnessMap ) { - - uniforms.metalnessMap.value = material.metalnessMap; - - } - - if ( material.emissiveMap ) { - - uniforms.emissiveMap.value = material.emissiveMap; - - } - - if ( material.bumpMap ) { - - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; - if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; - - } - - if ( material.normalMap ) { - - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); - if ( material.side === BackSide ) uniforms.normalScale.value.negate(); - - } - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - if ( material.envMap ) { - - //uniforms.envMap.value = material.envMap; // part of uniforms common - uniforms.envMapIntensity.value = material.envMapIntensity; - - } - - } - - function refreshUniformsPhysical( uniforms, material ) { - - refreshUniformsStandard( uniforms, material ); - - uniforms.reflectivity.value = material.reflectivity; // also part of uniforms common - - uniforms.clearcoat.value = material.clearcoat; - uniforms.clearcoatRoughness.value = material.clearcoatRoughness; - if ( material.sheen ) uniforms.sheen.value.copy( material.sheen ); - - if ( material.clearcoatNormalMap ) { - - uniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale ); - uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap; - - if ( material.side === BackSide ) { - - uniforms.clearcoatNormalScale.value.negate(); - - } - - } - - uniforms.transparency.value = material.transparency; - - } - - function refreshUniformsMatcap( uniforms, material ) { - - if ( material.matcap ) { - - uniforms.matcap.value = material.matcap; - - } - - if ( material.bumpMap ) { - - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; - if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; - - } - - if ( material.normalMap ) { - - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); - if ( material.side === BackSide ) uniforms.normalScale.value.negate(); - - } - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - } - - function refreshUniformsDepth( uniforms, material ) { - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - } - - function refreshUniformsDistance( uniforms, material ) { - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - uniforms.referencePosition.value.copy( material.referencePosition ); - uniforms.nearDistance.value = material.nearDistance; - uniforms.farDistance.value = material.farDistance; - - } - - function refreshUniformsNormal( uniforms, material ) { - - if ( material.bumpMap ) { - - uniforms.bumpMap.value = material.bumpMap; - uniforms.bumpScale.value = material.bumpScale; - if ( material.side === BackSide ) uniforms.bumpScale.value *= - 1; - - } - - if ( material.normalMap ) { - - uniforms.normalMap.value = material.normalMap; - uniforms.normalScale.value.copy( material.normalScale ); - if ( material.side === BackSide ) uniforms.normalScale.value.negate(); - - } - - if ( material.displacementMap ) { - - uniforms.displacementMap.value = material.displacementMap; - uniforms.displacementScale.value = material.displacementScale; - uniforms.displacementBias.value = material.displacementBias; - - } - - } - - // If uniforms are marked as clean, they don't need to be loaded to the GPU. - - function markUniformsLightsNeedsUpdate( uniforms, value ) { - - uniforms.ambientLightColor.needsUpdate = value; - uniforms.lightProbe.needsUpdate = value; - - uniforms.directionalLights.needsUpdate = value; - uniforms.pointLights.needsUpdate = value; - uniforms.spotLights.needsUpdate = value; - uniforms.rectAreaLights.needsUpdate = value; - uniforms.hemisphereLights.needsUpdate = value; - - } - - // - this.setFramebuffer = function ( value ) { - - if ( _framebuffer !== value ) _gl.bindFramebuffer( _gl.FRAMEBUFFER, value ); - - _framebuffer = value; - - }; - - this.getActiveCubeFace = function () { - - return _currentActiveCubeFace; - - }; - - this.getActiveMipmapLevel = function () { - - return _currentActiveMipmapLevel; - - }; - - this.getRenderTarget = function () { - - return _currentRenderTarget; - - }; - - this.setRenderTarget = function ( renderTarget, activeCubeFace, activeMipmapLevel ) { - - _currentRenderTarget = renderTarget; - _currentActiveCubeFace = activeCubeFace; - _currentActiveMipmapLevel = activeMipmapLevel; - - if ( renderTarget && properties.get( renderTarget ).__webglFramebuffer === undefined ) { - - textures.setupRenderTarget( renderTarget ); - - } - - var framebuffer = _framebuffer; - var isCube = false; - - if ( renderTarget ) { - - var __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer; - - if ( renderTarget.isWebGLRenderTargetCube ) { - - framebuffer = __webglFramebuffer[ activeCubeFace || 0 ]; - isCube = true; - - } else if ( renderTarget.isWebGLMultisampleRenderTarget ) { - - framebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer; - - } else { - - framebuffer = __webglFramebuffer; - - } - - _currentViewport.copy( renderTarget.viewport ); - _currentScissor.copy( renderTarget.scissor ); - _currentScissorTest = renderTarget.scissorTest; - - } else { - - _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor(); - _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor(); - _currentScissorTest = _scissorTest; - - } - - if ( _currentFramebuffer !== framebuffer ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _currentFramebuffer = framebuffer; - - } - - state.viewport( _currentViewport ); - state.scissor( _currentScissor ); - state.setScissorTest( _currentScissorTest ); - - if ( isCube ) { - - var textureProperties = properties.get( renderTarget.texture ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + ( activeCubeFace || 0 ), textureProperties.__webglTexture, activeMipmapLevel || 0 ); - - } - - }; - - this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex ) { - - if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) { - - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' ); - return; - - } - - var framebuffer = properties.get( renderTarget ).__webglFramebuffer; - - if ( renderTarget.isWebGLRenderTargetCube && activeCubeFaceIndex !== undefined ) { - - framebuffer = framebuffer[ activeCubeFaceIndex ]; - - } - - if ( framebuffer ) { - - var restore = false; - - if ( framebuffer !== _currentFramebuffer ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - - restore = true; - - } - - try { - - var texture = renderTarget.texture; - var textureFormat = texture.format; - var textureType = texture.type; - - if ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) { - - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' ); - return; - - } - - if ( textureType !== UnsignedByteType && utils.convert( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513) - ! ( textureType === FloatType && ( capabilities.isWebGL2 || extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox - ! ( textureType === HalfFloatType && ( capabilities.isWebGL2 ? extensions.get( 'EXT_color_buffer_float' ) : extensions.get( 'EXT_color_buffer_half_float' ) ) ) ) { - - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' ); - return; - - } - - if ( _gl.checkFramebufferStatus( _gl.FRAMEBUFFER ) === _gl.FRAMEBUFFER_COMPLETE ) { - - // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604) - - if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) { - - _gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer ); - - } - - } else { - - console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.' ); - - } - - } finally { - - if ( restore ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, _currentFramebuffer ); - - } - - } - - } - - }; - - this.copyFramebufferToTexture = function ( position, texture, level ) { - - var width = texture.image.width; - var height = texture.image.height; - var glFormat = utils.convert( texture.format ); - - textures.setTexture2D( texture, 0 ); - - _gl.copyTexImage2D( _gl.TEXTURE_2D, level || 0, glFormat, position.x, position.y, width, height, 0 ); - - }; - - this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) { - - var width = srcTexture.image.width; - var height = srcTexture.image.height; - var glFormat = utils.convert( dstTexture.format ); - var glType = utils.convert( dstTexture.type ); - - textures.setTexture2D( dstTexture, 0 ); - - if ( srcTexture.isDataTexture ) { - - _gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data ); - - } else { - - _gl.texSubImage2D( _gl.TEXTURE_2D, level || 0, position.x, position.y, glFormat, glType, srcTexture.image ); - - } - - }; - - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { - - __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef - - } - -} - -export { WebGLRenderer }; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.d.ts b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.d.ts deleted file mode 100644 index 683c4060f3..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -// Renderers / Shaders ///////////////////////////////////////////////////////////////////// -export let ShaderChunk: { - [name: string]: string; - - alphamap_fragment: string; - alphamap_pars_fragment: string; - alphatest_fragment: string; - aomap_fragment: string; - aomap_pars_fragment: string; - begin_vertex: string; - beginnormal_vertex: string; - bsdfs: string; - bumpmap_pars_fragment: string; - clipping_planes_fragment: string; - clipping_planes_pars_fragment: string; - clipping_planes_pars_vertex: string; - clipping_planes_vertex: string; - color_fragment: string; - color_pars_fragment: string; - color_pars_vertex: string; - color_vertex: string; - common: string; - cube_frag: string; - cube_vert: string; - cube_uv_reflection_fragment: string; - defaultnormal_vertex: string; - depth_frag: string; - depth_vert: string; - distanceRGBA_frag: string; - distanceRGBA_vert: string; - displacementmap_vertex: string; - displacementmap_pars_vertex: string; - emissivemap_fragment: string; - emissivemap_pars_fragment: string; - encodings_pars_fragment: string; - encodings_fragment: string; - envmap_fragment: string; - envmap_common_pars_fragment: string - envmap_pars_fragment: string; - envmap_pars_vertex: string; - envmap_vertex: string; - equirect_frag: string; - equirect_vert: string; - fog_fragment: string; - fog_pars_fragment: string; - linedashed_frag: string; - linedashed_vert: string; - lightmap_fragment: string; - lightmap_pars_fragment: string; - lights_lambert_vertex: string; - lights_pars_begin: string; - envmap_physical_pars_fragment: string; - lights_pars_map: string; - lights_phong_fragment: string; - lights_phong_pars_fragment: string; - lights_physical_fragment: string; - lights_physical_pars_fragment: string; - lights_fragment_begin: string; - lights_fragment_maps: string; - lights_fragment_end: string; - logdepthbuf_fragment: string; - logdepthbuf_pars_fragment: string; - logdepthbuf_pars_vertex: string; - logdepthbuf_vertex: string; - map_fragment: string; - map_pars_fragment: string; - map_particle_fragment: string; - map_particle_pars_fragment: string; - meshbasic_frag: string; - meshbasic_vert: string; - meshlambert_frag: string; - meshlambert_vert: string; - meshphong_frag: string; - meshphong_vert: string; - meshphysical_frag: string; - meshphysical_vert: string; - metalnessmap_fragment: string; - metalnessmap_pars_fragment: string; - morphnormal_vertex: string; - morphtarget_pars_vertex: string; - morphtarget_vertex: string; - normal_flip: string; - normal_frag: string; - normal_fragment_begin: string; - normal_fragment_maps: string; - normal_vert: string; - normalmap_pars_fragment: string; - clearcoat_normal_fragment_begin: string; - clearcoat_normal_fragment_maps: string; - clearcoat_normalmap_pars_fragment: string; - packing: string; - points_frag: string; - points_vert: string; - shadow_frag: string; - shadow_vert: string; - - premultiplied_alpha_fragment: string; - project_vertex: string; - roughnessmap_fragment: string; - roughnessmap_pars_fragment: string; - shadowmap_pars_fragment: string; - shadowmap_pars_vertex: string; - shadowmap_vertex: string; - shadowmask_pars_fragment: string; - skinbase_vertex: string; - skinning_pars_vertex: string; - skinning_vertex: string; - skinnormal_vertex: string; - specularmap_fragment: string; - specularmap_pars_fragment: string; - tonemapping_fragment: string; - tonemapping_pars_fragment: string; - uv2_pars_fragment: string; - uv2_pars_vertex: string; - uv2_vertex: string; - uv_pars_fragment: string; - uv_pars_vertex: string; - uv_vertex: string; - worldpos_vertex: string; -}; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.js deleted file mode 100644 index 15a9777f4b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk.js +++ /dev/null @@ -1,251 +0,0 @@ -import alphamap_fragment from './ShaderChunk/alphamap_fragment.glsl.js'; -import alphamap_pars_fragment from './ShaderChunk/alphamap_pars_fragment.glsl.js'; -import alphatest_fragment from './ShaderChunk/alphatest_fragment.glsl.js'; -import aomap_fragment from './ShaderChunk/aomap_fragment.glsl.js'; -import aomap_pars_fragment from './ShaderChunk/aomap_pars_fragment.glsl.js'; -import begin_vertex from './ShaderChunk/begin_vertex.glsl.js'; -import beginnormal_vertex from './ShaderChunk/beginnormal_vertex.glsl.js'; -import bsdfs from './ShaderChunk/bsdfs.glsl.js'; -import bumpmap_pars_fragment from './ShaderChunk/bumpmap_pars_fragment.glsl.js'; -import clipping_planes_fragment from './ShaderChunk/clipping_planes_fragment.glsl.js'; -import clipping_planes_pars_fragment from './ShaderChunk/clipping_planes_pars_fragment.glsl.js'; -import clipping_planes_pars_vertex from './ShaderChunk/clipping_planes_pars_vertex.glsl.js'; -import clipping_planes_vertex from './ShaderChunk/clipping_planes_vertex.glsl.js'; -import color_fragment from './ShaderChunk/color_fragment.glsl.js'; -import color_pars_fragment from './ShaderChunk/color_pars_fragment.glsl.js'; -import color_pars_vertex from './ShaderChunk/color_pars_vertex.glsl.js'; -import color_vertex from './ShaderChunk/color_vertex.glsl.js'; -import common from './ShaderChunk/common.glsl.js'; -import cube_uv_reflection_fragment from './ShaderChunk/cube_uv_reflection_fragment.glsl.js'; -import defaultnormal_vertex from './ShaderChunk/defaultnormal_vertex.glsl.js'; -import displacementmap_pars_vertex from './ShaderChunk/displacementmap_pars_vertex.glsl.js'; -import displacementmap_vertex from './ShaderChunk/displacementmap_vertex.glsl.js'; -import emissivemap_fragment from './ShaderChunk/emissivemap_fragment.glsl.js'; -import emissivemap_pars_fragment from './ShaderChunk/emissivemap_pars_fragment.glsl.js'; -import encodings_fragment from './ShaderChunk/encodings_fragment.glsl.js'; -import encodings_pars_fragment from './ShaderChunk/encodings_pars_fragment.glsl.js'; -import envmap_fragment from './ShaderChunk/envmap_fragment.glsl.js'; -import envmap_common_pars_fragment from './ShaderChunk/envmap_common_pars_fragment.glsl.js'; -import envmap_pars_fragment from './ShaderChunk/envmap_pars_fragment.glsl.js'; -import envmap_pars_vertex from './ShaderChunk/envmap_pars_vertex.glsl.js'; -import envmap_vertex from './ShaderChunk/envmap_vertex.glsl.js'; -import fog_vertex from './ShaderChunk/fog_vertex.glsl.js'; -import fog_pars_vertex from './ShaderChunk/fog_pars_vertex.glsl.js'; -import fog_fragment from './ShaderChunk/fog_fragment.glsl.js'; -import fog_pars_fragment from './ShaderChunk/fog_pars_fragment.glsl.js'; -import gradientmap_pars_fragment from './ShaderChunk/gradientmap_pars_fragment.glsl.js'; -import lightmap_fragment from './ShaderChunk/lightmap_fragment.glsl.js'; -import lightmap_pars_fragment from './ShaderChunk/lightmap_pars_fragment.glsl.js'; -import lights_lambert_vertex from './ShaderChunk/lights_lambert_vertex.glsl.js'; -import lights_pars_begin from './ShaderChunk/lights_pars_begin.glsl.js'; -import envmap_physical_pars_fragment from './ShaderChunk/envmap_physical_pars_fragment.glsl.js'; -import lights_phong_fragment from './ShaderChunk/lights_phong_fragment.glsl.js'; -import lights_phong_pars_fragment from './ShaderChunk/lights_phong_pars_fragment.glsl.js'; -import lights_physical_fragment from './ShaderChunk/lights_physical_fragment.glsl.js'; -import lights_physical_pars_fragment from './ShaderChunk/lights_physical_pars_fragment.glsl.js'; -import lights_fragment_begin from './ShaderChunk/lights_fragment_begin.glsl.js'; -import lights_fragment_maps from './ShaderChunk/lights_fragment_maps.glsl.js'; -import lights_fragment_end from './ShaderChunk/lights_fragment_end.glsl.js'; -import logdepthbuf_fragment from './ShaderChunk/logdepthbuf_fragment.glsl.js'; -import logdepthbuf_pars_fragment from './ShaderChunk/logdepthbuf_pars_fragment.glsl.js'; -import logdepthbuf_pars_vertex from './ShaderChunk/logdepthbuf_pars_vertex.glsl.js'; -import logdepthbuf_vertex from './ShaderChunk/logdepthbuf_vertex.glsl.js'; -import map_fragment from './ShaderChunk/map_fragment.glsl.js'; -import map_pars_fragment from './ShaderChunk/map_pars_fragment.glsl.js'; -import map_particle_fragment from './ShaderChunk/map_particle_fragment.glsl.js'; -import map_particle_pars_fragment from './ShaderChunk/map_particle_pars_fragment.glsl.js'; -import metalnessmap_fragment from './ShaderChunk/metalnessmap_fragment.glsl.js'; -import metalnessmap_pars_fragment from './ShaderChunk/metalnessmap_pars_fragment.glsl.js'; -import morphnormal_vertex from './ShaderChunk/morphnormal_vertex.glsl.js'; -import morphtarget_pars_vertex from './ShaderChunk/morphtarget_pars_vertex.glsl.js'; -import morphtarget_vertex from './ShaderChunk/morphtarget_vertex.glsl.js'; -import normal_fragment_begin from './ShaderChunk/normal_fragment_begin.glsl.js'; -import normal_fragment_maps from './ShaderChunk/normal_fragment_maps.glsl.js'; -import normalmap_pars_fragment from './ShaderChunk/normalmap_pars_fragment.glsl.js'; -import clearcoat_normal_fragment_begin from './ShaderChunk/clearcoat_normal_fragment_begin.glsl.js'; -import clearcoat_normal_fragment_maps from './ShaderChunk/clearcoat_normal_fragment_maps.glsl.js'; -import clearcoat_normalmap_pars_fragment from './ShaderChunk/clearcoat_normalmap_pars_fragment.glsl.js'; -import packing from './ShaderChunk/packing.glsl.js'; -import premultiplied_alpha_fragment from './ShaderChunk/premultiplied_alpha_fragment.glsl.js'; -import project_vertex from './ShaderChunk/project_vertex.glsl.js'; -import dithering_fragment from './ShaderChunk/dithering_fragment.glsl.js'; -import dithering_pars_fragment from './ShaderChunk/dithering_pars_fragment.glsl.js'; -import roughnessmap_fragment from './ShaderChunk/roughnessmap_fragment.glsl.js'; -import roughnessmap_pars_fragment from './ShaderChunk/roughnessmap_pars_fragment.glsl.js'; -import shadowmap_pars_fragment from './ShaderChunk/shadowmap_pars_fragment.glsl.js'; -import shadowmap_pars_vertex from './ShaderChunk/shadowmap_pars_vertex.glsl.js'; -import shadowmap_vertex from './ShaderChunk/shadowmap_vertex.glsl.js'; -import shadowmask_pars_fragment from './ShaderChunk/shadowmask_pars_fragment.glsl.js'; -import skinbase_vertex from './ShaderChunk/skinbase_vertex.glsl.js'; -import skinning_pars_vertex from './ShaderChunk/skinning_pars_vertex.glsl.js'; -import skinning_vertex from './ShaderChunk/skinning_vertex.glsl.js'; -import skinnormal_vertex from './ShaderChunk/skinnormal_vertex.glsl.js'; -import specularmap_fragment from './ShaderChunk/specularmap_fragment.glsl.js'; -import specularmap_pars_fragment from './ShaderChunk/specularmap_pars_fragment.glsl.js'; -import tonemapping_fragment from './ShaderChunk/tonemapping_fragment.glsl.js'; -import tonemapping_pars_fragment from './ShaderChunk/tonemapping_pars_fragment.glsl.js'; -import uv_pars_fragment from './ShaderChunk/uv_pars_fragment.glsl.js'; -import uv_pars_vertex from './ShaderChunk/uv_pars_vertex.glsl.js'; -import uv_vertex from './ShaderChunk/uv_vertex.glsl.js'; -import uv2_pars_fragment from './ShaderChunk/uv2_pars_fragment.glsl.js'; -import uv2_pars_vertex from './ShaderChunk/uv2_pars_vertex.glsl.js'; -import uv2_vertex from './ShaderChunk/uv2_vertex.glsl.js'; -import worldpos_vertex from './ShaderChunk/worldpos_vertex.glsl.js'; - -import background_frag from './ShaderLib/background_frag.glsl.js'; -import background_vert from './ShaderLib/background_vert.glsl.js'; -import cube_frag from './ShaderLib/cube_frag.glsl.js'; -import cube_vert from './ShaderLib/cube_vert.glsl.js'; -import depth_frag from './ShaderLib/depth_frag.glsl.js'; -import depth_vert from './ShaderLib/depth_vert.glsl.js'; -import distanceRGBA_frag from './ShaderLib/distanceRGBA_frag.glsl.js'; -import distanceRGBA_vert from './ShaderLib/distanceRGBA_vert.glsl.js'; -import equirect_frag from './ShaderLib/equirect_frag.glsl.js'; -import equirect_vert from './ShaderLib/equirect_vert.glsl.js'; -import linedashed_frag from './ShaderLib/linedashed_frag.glsl.js'; -import linedashed_vert from './ShaderLib/linedashed_vert.glsl.js'; -import meshbasic_frag from './ShaderLib/meshbasic_frag.glsl.js'; -import meshbasic_vert from './ShaderLib/meshbasic_vert.glsl.js'; -import meshlambert_frag from './ShaderLib/meshlambert_frag.glsl.js'; -import meshlambert_vert from './ShaderLib/meshlambert_vert.glsl.js'; -import meshmatcap_frag from './ShaderLib/meshmatcap_frag.glsl.js'; -import meshmatcap_vert from './ShaderLib/meshmatcap_vert.glsl.js'; -import meshphong_frag from './ShaderLib/meshphong_frag.glsl.js'; -import meshphong_vert from './ShaderLib/meshphong_vert.glsl.js'; -import meshphysical_frag from './ShaderLib/meshphysical_frag.glsl.js'; -import meshphysical_vert from './ShaderLib/meshphysical_vert.glsl.js'; -import normal_frag from './ShaderLib/normal_frag.glsl.js'; -import normal_vert from './ShaderLib/normal_vert.glsl.js'; -import points_frag from './ShaderLib/points_frag.glsl.js'; -import points_vert from './ShaderLib/points_vert.glsl.js'; -import shadow_frag from './ShaderLib/shadow_frag.glsl.js'; -import shadow_vert from './ShaderLib/shadow_vert.glsl.js'; -import sprite_frag from './ShaderLib/sprite_frag.glsl.js'; -import sprite_vert from './ShaderLib/sprite_vert.glsl.js'; - -export var ShaderChunk = { - alphamap_fragment: alphamap_fragment, - alphamap_pars_fragment: alphamap_pars_fragment, - alphatest_fragment: alphatest_fragment, - aomap_fragment: aomap_fragment, - aomap_pars_fragment: aomap_pars_fragment, - begin_vertex: begin_vertex, - beginnormal_vertex: beginnormal_vertex, - bsdfs: bsdfs, - bumpmap_pars_fragment: bumpmap_pars_fragment, - clipping_planes_fragment: clipping_planes_fragment, - clipping_planes_pars_fragment: clipping_planes_pars_fragment, - clipping_planes_pars_vertex: clipping_planes_pars_vertex, - clipping_planes_vertex: clipping_planes_vertex, - color_fragment: color_fragment, - color_pars_fragment: color_pars_fragment, - color_pars_vertex: color_pars_vertex, - color_vertex: color_vertex, - common: common, - cube_uv_reflection_fragment: cube_uv_reflection_fragment, - defaultnormal_vertex: defaultnormal_vertex, - displacementmap_pars_vertex: displacementmap_pars_vertex, - displacementmap_vertex: displacementmap_vertex, - emissivemap_fragment: emissivemap_fragment, - emissivemap_pars_fragment: emissivemap_pars_fragment, - encodings_fragment: encodings_fragment, - encodings_pars_fragment: encodings_pars_fragment, - envmap_fragment: envmap_fragment, - envmap_common_pars_fragment: envmap_common_pars_fragment, - envmap_pars_fragment: envmap_pars_fragment, - envmap_pars_vertex: envmap_pars_vertex, - envmap_physical_pars_fragment: envmap_physical_pars_fragment, - envmap_vertex: envmap_vertex, - fog_vertex: fog_vertex, - fog_pars_vertex: fog_pars_vertex, - fog_fragment: fog_fragment, - fog_pars_fragment: fog_pars_fragment, - gradientmap_pars_fragment: gradientmap_pars_fragment, - lightmap_fragment: lightmap_fragment, - lightmap_pars_fragment: lightmap_pars_fragment, - lights_lambert_vertex: lights_lambert_vertex, - lights_pars_begin: lights_pars_begin, - lights_phong_fragment: lights_phong_fragment, - lights_phong_pars_fragment: lights_phong_pars_fragment, - lights_physical_fragment: lights_physical_fragment, - lights_physical_pars_fragment: lights_physical_pars_fragment, - lights_fragment_begin: lights_fragment_begin, - lights_fragment_maps: lights_fragment_maps, - lights_fragment_end: lights_fragment_end, - logdepthbuf_fragment: logdepthbuf_fragment, - logdepthbuf_pars_fragment: logdepthbuf_pars_fragment, - logdepthbuf_pars_vertex: logdepthbuf_pars_vertex, - logdepthbuf_vertex: logdepthbuf_vertex, - map_fragment: map_fragment, - map_pars_fragment: map_pars_fragment, - map_particle_fragment: map_particle_fragment, - map_particle_pars_fragment: map_particle_pars_fragment, - metalnessmap_fragment: metalnessmap_fragment, - metalnessmap_pars_fragment: metalnessmap_pars_fragment, - morphnormal_vertex: morphnormal_vertex, - morphtarget_pars_vertex: morphtarget_pars_vertex, - morphtarget_vertex: morphtarget_vertex, - normal_fragment_begin: normal_fragment_begin, - normal_fragment_maps: normal_fragment_maps, - normalmap_pars_fragment: normalmap_pars_fragment, - clearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin, - clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps, - clearcoat_normalmap_pars_fragment: clearcoat_normalmap_pars_fragment, - packing: packing, - premultiplied_alpha_fragment: premultiplied_alpha_fragment, - project_vertex: project_vertex, - dithering_fragment: dithering_fragment, - dithering_pars_fragment: dithering_pars_fragment, - roughnessmap_fragment: roughnessmap_fragment, - roughnessmap_pars_fragment: roughnessmap_pars_fragment, - shadowmap_pars_fragment: shadowmap_pars_fragment, - shadowmap_pars_vertex: shadowmap_pars_vertex, - shadowmap_vertex: shadowmap_vertex, - shadowmask_pars_fragment: shadowmask_pars_fragment, - skinbase_vertex: skinbase_vertex, - skinning_pars_vertex: skinning_pars_vertex, - skinning_vertex: skinning_vertex, - skinnormal_vertex: skinnormal_vertex, - specularmap_fragment: specularmap_fragment, - specularmap_pars_fragment: specularmap_pars_fragment, - tonemapping_fragment: tonemapping_fragment, - tonemapping_pars_fragment: tonemapping_pars_fragment, - uv_pars_fragment: uv_pars_fragment, - uv_pars_vertex: uv_pars_vertex, - uv_vertex: uv_vertex, - uv2_pars_fragment: uv2_pars_fragment, - uv2_pars_vertex: uv2_pars_vertex, - uv2_vertex: uv2_vertex, - worldpos_vertex: worldpos_vertex, - - background_frag: background_frag, - background_vert: background_vert, - cube_frag: cube_frag, - cube_vert: cube_vert, - depth_frag: depth_frag, - depth_vert: depth_vert, - distanceRGBA_frag: distanceRGBA_frag, - distanceRGBA_vert: distanceRGBA_vert, - equirect_frag: equirect_frag, - equirect_vert: equirect_vert, - linedashed_frag: linedashed_frag, - linedashed_vert: linedashed_vert, - meshbasic_frag: meshbasic_frag, - meshbasic_vert: meshbasic_vert, - meshlambert_frag: meshlambert_frag, - meshlambert_vert: meshlambert_vert, - meshmatcap_frag: meshmatcap_frag, - meshmatcap_vert: meshmatcap_vert, - meshphong_frag: meshphong_frag, - meshphong_vert: meshphong_vert, - meshphysical_frag: meshphysical_frag, - meshphysical_vert: meshphysical_vert, - normal_frag: normal_frag, - normal_vert: normal_vert, - points_frag: points_frag, - points_vert: points_vert, - shadow_frag: shadow_frag, - shadow_vert: shadow_vert, - sprite_frag: sprite_frag, - sprite_vert: sprite_vert -}; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js deleted file mode 100644 index 81c5796588..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_ALPHAMAP - - diffuseColor.a *= texture2D( alphaMap, vUv ).g; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js deleted file mode 100644 index ae6f46deaa..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_ALPHAMAP - - uniform sampler2D alphaMap; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js deleted file mode 100644 index 5ad0429f68..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef ALPHATEST - - if ( diffuseColor.a < ALPHATEST ) discard; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js deleted file mode 100644 index 7be3e32408..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +++ /dev/null @@ -1,18 +0,0 @@ -export default /* glsl */` -#ifdef USE_AOMAP - - // reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture - float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; - - reflectedLight.indirectDiffuse *= ambientOcclusion; - - #if defined( USE_ENVMAP ) && defined( STANDARD ) - - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - - reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness ); - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js deleted file mode 100644 index 7c2eadc7ed..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef USE_AOMAP - - uniform sampler2D aoMap; - uniform float aoMapIntensity; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/begin_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/begin_vertex.glsl.js deleted file mode 100644 index 9777ba0bb7..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +++ /dev/null @@ -1,3 +0,0 @@ -export default /* glsl */` -vec3 transformed = vec3( position ); -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js deleted file mode 100644 index 7286cbaa5e..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js +++ /dev/null @@ -1,9 +0,0 @@ -export default /* glsl */` -vec3 objectNormal = vec3( normal ); - -#ifdef USE_TANGENT - - vec3 objectTangent = vec3( tangent.xyz ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bsdfs.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bsdfs.glsl.js deleted file mode 100644 index 9e479c6c61..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bsdfs.glsl.js +++ /dev/null @@ -1,370 +0,0 @@ -export default /* glsl */` - -// Analytical approximation of the DFG LUT, one half of the -// split-sum approximation used in indirect specular lighting. -// via 'environmentBRDF' from "Physically Based Shading on Mobile" -// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile -vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) { - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - - vec4 r = roughness * c0 + c1; - - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - - return vec2( -1.04, 1.04 ) * a004 + r.zw; - -} - -float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - -#if defined ( PHYSICALLY_CORRECT_LIGHTS ) - - // based upon Frostbite 3 Moving to Physically-based Rendering - // page 32, equation 26: E[window1] - // https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf - // this is intended to be used on spot and point lights who are represented as luminous intensity - // but who must be converted to luminous irradiance for surface lighting calculation - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - - if( cutoffDistance > 0.0 ) { - - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - - } - - return distanceFalloff; - -#else - - if( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - - return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent ); - - } - - return 1.0; - -#endif - -} - -vec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) { - - return RECIPROCAL_PI * diffuseColor; - -} // validated - -vec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) { - - // Original approximation by Christophe Schlick '94 - // float fresnel = pow( 1.0 - dotLH, 5.0 ); - - // Optimized variant (presented by Epic at SIGGRAPH '13) - // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf - float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH ); - - return ( 1.0 - specularColor ) * fresnel + specularColor; - -} // validated - -vec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) { - - // See F_Schlick - float fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV ); - vec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0; - - return Fr * fresnel + F0; - -} - - -// Microfacet Models for Refraction through Rough Surfaces - equation (34) -// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html -// alpha is "roughness squared" in Disney’s reparameterization -float G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) { - - // geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v) - // also see #12151 - - float a2 = pow2( alpha ); - - float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - - return 1.0 / ( gl * gv ); - -} // validated - -// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2 -// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf -float G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - - float a2 = pow2( alpha ); - - // dotNL and dotNV are explicitly swapped. This is not a mistake. - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - - return 0.5 / max( gv + gl, EPSILON ); - -} - -// Microfacet Models for Refraction through Rough Surfaces - equation (33) -// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html -// alpha is "roughness squared" in Disney’s reparameterization -float D_GGX( const in float alpha, const in float dotNH ) { - - float a2 = pow2( alpha ); - - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1 - - return RECIPROCAL_PI * a2 / pow2( denom ); - -} - -// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility -vec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - - float alpha = pow2( roughness ); // UE4's roughness - - vec3 halfDir = normalize( incidentLight.direction + viewDir ); - - float dotNL = saturate( dot( normal, incidentLight.direction ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - - vec3 F = F_Schlick( specularColor, dotLH ); - - float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - - float D = D_GGX( alpha, dotNH ); - - return F * ( G * D ); - -} // validated - -// Rect Area Light - -// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines -// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt -// code: https://github.com/selfshadow/ltc_code/ - -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - - float dotNV = saturate( dot( N, V ) ); - - // texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) ) - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - - uv = uv * LUT_SCALE + LUT_BIAS; - - return uv; - -} - -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - - // Real-Time Area Lighting: a Journey from Research to Production (p.102) - // An approximation of the form factor of a horizon-clipped rectangle. - - float l = length( f ); - - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); - -} - -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - - float x = dot( v1, v2 ); - - float y = abs( x ); - - // rational polynomial approximation to theta / sin( theta ) / 2PI - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - - return cross( v1, v2 ) * theta_sintheta; - -} - -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - - // bail if point is on back side of plane of light - // assumes ccw winding order of light vertices - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - - // construct orthonormal basis around N - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system - - // compute transform - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - - // transform rect - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - - // project rect onto sphere - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - - // calculate vector form factor - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - - // adjust for horizon clipping - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - -/* - // alternate method of adjusting for horizon clipping (see referece) - // refactoring required - float len = length( vectorFormFactor ); - float z = vectorFormFactor.z / len; - - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - - // tabulated horizon-clipped sphere, apparently... - vec2 uv = vec2( z * 0.5 + 0.5, len ); - uv = uv * LUT_SCALE + LUT_BIAS; - - float scale = texture2D( ltc_2, uv ).w; - - float result = len * scale; -*/ - - return vec3( result ); - -} - -// End Rect Area Light - -// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile -vec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) { - - float dotNV = saturate( dot( normal, viewDir ) ); - - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - - return specularColor * brdf.x + brdf.y; - -} // validated - -// Fdez-Agüera's "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting" -// Approximates multiscattering in order to preserve energy. -// http://www.jcgt.org/published/0008/01/03/ -void BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { - - float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - - vec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness ); - vec2 brdf = integrateSpecularBRDF( dotNV, roughness ); - vec3 FssEss = F * brdf.x + brdf.y; - - float Ess = brdf.x + brdf.y; - float Ems = 1.0 - Ess; - - vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21 - vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - - singleScatter += FssEss; - multiScatter += Fms * Ems; - -} - -float G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) { - - // geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v) - return 0.25; - -} - -float D_BlinnPhong( const in float shininess, const in float dotNH ) { - - return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); - -} - -vec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) { - - vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir ); - - //float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) ); - //float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); - float dotNH = saturate( dot( geometry.normal, halfDir ) ); - float dotLH = saturate( dot( incidentLight.direction, halfDir ) ); - - vec3 F = F_Schlick( specularColor, dotLH ); - - float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ ); - - float D = D_BlinnPhong( shininess, dotNH ); - - return F * ( G * D ); - -} // validated - -// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html -float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) { - return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 ); -} - -float BlinnExponentToGGXRoughness( const in float blinnExponent ) { - return sqrt( 2.0 / ( blinnExponent + 2.0 ) ); -} - -#if defined( USE_SHEEN ) - -// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94 -float D_Charlie(float roughness, float NoH) { - // Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF" - float invAlpha = 1.0 / roughness; - float cos2h = NoH * NoH; - float sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16 - return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI); -} - -// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136 -float V_Neubelt(float NoV, float NoL) { - // Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886" - return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV))); -} - -vec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) { - - vec3 N = geometry.normal; - vec3 V = geometry.viewDir; - - vec3 H = normalize( V + L ); - float dotNH = saturate( dot( N, H ) ); - - return specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) ); - -} - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js deleted file mode 100644 index a3d05938d3..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +++ /dev/null @@ -1,46 +0,0 @@ -export default /* glsl */` -#ifdef USE_BUMPMAP - - uniform sampler2D bumpMap; - uniform float bumpScale; - - // Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen - // http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf - - // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2) - - vec2 dHdxy_fwd() { - - vec2 dSTdx = dFdx( vUv ); - vec2 dSTdy = dFdy( vUv ); - - float Hll = bumpScale * texture2D( bumpMap, vUv ).x; - float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; - float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; - - return vec2( dBx, dBy ); - - } - - vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) { - - // Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988 - - vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) ); - vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) ); - vec3 vN = surf_norm; // normalized - - vec3 R1 = cross( vSigmaY, vN ); - vec3 R2 = cross( vN, vSigmaX ); - - float fDet = dot( vSigmaX, R1 ); - - fDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - - vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); - return normalize( abs( fDet ) * surf_norm - vGrad ); - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js deleted file mode 100644 index 7bfa08c848..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef CLEARCOAT - - vec3 clearcoatNormal = geometryNormal; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js deleted file mode 100644 index d6ea42a110..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js +++ /dev/null @@ -1,18 +0,0 @@ -export default /* glsl */` -#ifdef USE_CLEARCOAT_NORMALMAP - - #ifdef USE_TANGENT - - mat3 vTBN = mat3( tangent, bitangent, clearcoatNormal ); - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy = clearcoatNormalScale * mapN.xy; - clearcoatNormal = normalize( vTBN * mapN ); - - #else - - clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatNormalScale, clearcoatNormalMap ); - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normalmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normalmap_pars_fragment.glsl.js deleted file mode 100644 index d4f32b0fb7..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clearcoat_normalmap_pars_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef USE_CLEARCOAT_NORMALMAP - - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js deleted file mode 100644 index 72a77ba1b8..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js +++ /dev/null @@ -1,31 +0,0 @@ -export default /* glsl */` -#if NUM_CLIPPING_PLANES > 0 - - vec4 plane; - - #pragma unroll_loop - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - - plane = clippingPlanes[ i ]; - if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard; - - } - - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - - bool clipped = true; - - #pragma unroll_loop - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - - plane = clippingPlanes[ i ]; - clipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped; - - } - - if ( clipped ) discard; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js deleted file mode 100644 index 6785ac70d1..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js +++ /dev/null @@ -1,11 +0,0 @@ -export default /* glsl */` -#if NUM_CLIPPING_PLANES > 0 - - #if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP ) - varying vec3 vViewPosition; - #endif - - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js deleted file mode 100644 index 088eb062b3..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js +++ /dev/null @@ -1,5 +0,0 @@ -export default /* glsl */` -#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP ) - varying vec3 vViewPosition; -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js deleted file mode 100644 index d4662bfe10..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js +++ /dev/null @@ -1,5 +0,0 @@ -export default /* glsl */` -#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP ) - vViewPosition = - mvPosition.xyz; -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_fragment.glsl.js deleted file mode 100644 index 6b62d5429f..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_COLOR - - diffuseColor.rgb *= vColor; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js deleted file mode 100644 index d006578261..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_COLOR - - varying vec3 vColor; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js deleted file mode 100644 index d006578261..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_COLOR - - varying vec3 vColor; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_vertex.glsl.js deleted file mode 100644 index 9bb6d738ae..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/color_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_COLOR - - vColor.xyz = color.xyz; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/common.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/common.glsl.js deleted file mode 100644 index ad0453e0e2..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/common.glsl.js +++ /dev/null @@ -1,110 +0,0 @@ -export default /* glsl */` -#define PI 3.14159265359 -#define PI2 6.28318530718 -#define PI_HALF 1.5707963267949 -#define RECIPROCAL_PI 0.31830988618 -#define RECIPROCAL_PI2 0.15915494 -#define LOG2 1.442695 -#define EPSILON 1e-6 - -#define saturate(a) clamp( a, 0.0, 1.0 ) -#define whiteComplement(a) ( 1.0 - saturate( a ) ) - -float pow2( const in float x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); } -// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range. -// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/ -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract(sin(sn) * c); -} - -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); } - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif - -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; - -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; - -struct GeometricContext { - vec3 position; - vec3 normal; - vec3 viewDir; -#ifdef CLEARCOAT - vec3 clearcoatNormal; -#endif -}; - -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - -} - -// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); - -} - -vec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - - float distance = dot( planeNormal, point - pointOnPlane ); - - return - distance * planeNormal + point; - -} - -float sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) { - - return sign( dot( point - pointOnPlane, planeNormal ) ); - -} - -vec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) { - - return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine; - -} - -mat3 transposeMat3( const in mat3 m ) { - - mat3 tmp; - - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - - return tmp; - -} - -// https://en.wikipedia.org/wiki/Relative_luminance -float linearToRelativeLuminance( const in vec3 color ) { - - vec3 weights = vec3( 0.2126, 0.7152, 0.0722 ); - - return dot( weights, color.rgb ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js deleted file mode 100644 index ca8711068e..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +++ /dev/null @@ -1,130 +0,0 @@ -export default /* glsl */` -#ifdef ENVMAP_TYPE_CUBE_UV - -#define cubeUV_textureSize (1024.0) - -int getFaceFromDirection(vec3 direction) { - vec3 absDirection = abs(direction); - int face = -1; - if( absDirection.x > absDirection.z ) { - if(absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0 : 3; - else - face = direction.y > 0.0 ? 1 : 4; - } - else { - if(absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2 : 5; - else - face = direction.y > 0.0 ? 1 : 4; - } - return face; -} -#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0) -#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0)) - -vec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) { - float scale = exp2(cubeUV_maxLods1 - roughnessLevel); - float dxRoughness = dFdx(roughness); - float dyRoughness = dFdy(roughness); - vec3 dx = dFdx( vec * scale * dxRoughness ); - vec3 dy = dFdy( vec * scale * dyRoughness ); - float d = max( dot( dx, dx ), dot( dy, dy ) ); - // Clamp the value to the max mip level counts. hard coded to 6 mips - d = clamp(d, 1.0, cubeUV_rangeClamp); - float mipLevel = 0.5 * log2(d); - return vec2(floor(mipLevel), fract(mipLevel)); -} - -#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0) -#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize) - -vec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) { - mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel; - float a = 16.0 * cubeUV_rcpTextureSize; - - vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) ); - vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed; - // float powScale = exp2(roughnessLevel + mipLevel); - float powScale = exp2_packed.x * exp2_packed.y; - // float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel); - float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25; - // float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel); - float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x; - - bool bRes = mipLevel == 0.0; - scale = bRes && (scale < a) ? a : scale; - - vec3 r; - vec2 offset; - int face = getFaceFromDirection(direction); - - float rcpPowScale = 1.0 / powScale; - - if( face == 0) { - r = vec3(direction.x, -direction.z, direction.y); - offset = vec2(0.0+mipOffset,0.75 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y; - } - else if( face == 1) { - r = vec3(direction.y, direction.x, direction.z); - offset = vec2(scale+mipOffset, 0.75 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y; - } - else if( face == 2) { - r = vec3(direction.z, direction.x, direction.y); - offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y; - } - else if( face == 3) { - r = vec3(direction.x, direction.z, direction.y); - offset = vec2(0.0+mipOffset,0.5 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y; - } - else if( face == 4) { - r = vec3(direction.y, direction.x, -direction.z); - offset = vec2(scale+mipOffset, 0.5 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y; - } - else { - r = vec3(direction.z, -direction.x, direction.y); - offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale); - offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y; - } - r = normalize(r); - float texelOffset = 0.5 * cubeUV_rcpTextureSize; - vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5; - vec2 base = offset + vec2( texelOffset ); - return base + s * ( scale - 2.0 * texelOffset ); -} - -#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0) - -vec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) { - float roughnessVal = roughness* cubeUV_maxLods3; - float r1 = floor(roughnessVal); - float r2 = r1 + 1.0; - float t = fract(roughnessVal); - vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness); - float s = mipInfo.y; - float level0 = mipInfo.x; - float level1 = level0 + 1.0; - level1 = level1 > 5.0 ? 5.0 : level1; - - // round to nearest mipmap if we are not interpolating. - level0 += min( floor( s + 0.5 ), 5.0 ); - - // Tri linear interpolation. - vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0); - vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10)); - - vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0); - vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20)); - - vec4 result = mix(color10, color20, t); - - return vec4(result.rgb, 1.0); -} - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_fragment.glsl.js deleted file mode 100644 index a68ac369b7..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_fragment.glsl.js +++ /dev/null @@ -1,5 +0,0 @@ -export default /* glsl */` -void main() { - gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_vertex.glsl.js deleted file mode 100644 index 0ce0b03b6d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/default_vertex.glsl.js +++ /dev/null @@ -1,5 +0,0 @@ -export default /* glsl */` -void main() { - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js deleted file mode 100644 index 7e02c01a71..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +++ /dev/null @@ -1,21 +0,0 @@ -export default /* glsl */` -vec3 transformedNormal = normalMatrix * objectNormal; - -#ifdef FLIP_SIDED - - transformedNormal = - transformedNormal; - -#endif - -#ifdef USE_TANGENT - - vec3 transformedTangent = normalMatrix * objectTangent; - - #ifdef FLIP_SIDED - - transformedTangent = - transformedTangent; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js deleted file mode 100644 index b8ac0759a9..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js +++ /dev/null @@ -1,9 +0,0 @@ -export default /* glsl */` -#ifdef USE_DISPLACEMENTMAP - - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js deleted file mode 100644 index 2349e2535f..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_DISPLACEMENTMAP - - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js deleted file mode 100644 index 25d801a678..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef DITHERING - - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js deleted file mode 100644 index 2217fbc5d8..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js +++ /dev/null @@ -1,20 +0,0 @@ -export default /* glsl */` -#ifdef DITHERING - - // based on https://www.shadertoy.com/view/MslGR8 - vec3 dithering( vec3 color ) { - //Calculate grid position - float grid_position = rand( gl_FragCoord.xy ); - - //Shift the individual colors differently, thus making it even harder to see the dithering pattern - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - - //modify shift acording to grid position. - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - - //shift the color by dither_shift - return color + dither_shift_RGB; - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js deleted file mode 100644 index 3c28556279..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +++ /dev/null @@ -1,11 +0,0 @@ -export default /* glsl */` -#ifdef USE_EMISSIVEMAP - - vec4 emissiveColor = texture2D( emissiveMap, vUv ); - - emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; - - totalEmissiveRadiance *= emissiveColor.rgb; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js deleted file mode 100644 index 3a9b02d612..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_EMISSIVEMAP - - uniform sampler2D emissiveMap; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_fragment.glsl.js deleted file mode 100644 index 3072c76cd8..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_fragment.glsl.js +++ /dev/null @@ -1,3 +0,0 @@ -export default /* glsl */` -gl_FragColor = linearToOutputTexel( gl_FragColor ); -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js deleted file mode 100644 index 11be08c91e..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js +++ /dev/null @@ -1,85 +0,0 @@ -export default /* glsl */` -// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/ - -vec4 LinearToLinear( in vec4 value ) { - return value; -} - -vec4 GammaToLinear( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a ); -} - -vec4 LinearToGamma( in vec4 value, in float gammaFactor ) { - return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a ); -} - -vec4 sRGBToLinear( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} - -vec4 LinearTosRGB( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} - -vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); -} - -vec4 LinearToRGBE( in vec4 value ) { - float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); -// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 ); -} - -// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html -vec4 RGBMToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * value.a * maxRange, 1.0 ); -} - -vec4 LinearToRGBM( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float M = clamp( maxRGB / maxRange, 0.0, 1.0 ); - M = ceil( M * 255.0 ) / 255.0; - return vec4( value.rgb / ( M * maxRange ), M ); -} - -// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html -vec4 RGBDToLinear( in vec4 value, in float maxRange ) { - return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 ); -} - -vec4 LinearToRGBD( in vec4 value, in float maxRange ) { - float maxRGB = max( value.r, max( value.g, value.b ) ); - float D = max( maxRange / maxRGB, 1.0 ); - D = min( floor( D ) / 255.0, 1.0 ); - return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D ); -} - -// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html - -// M matrix, for encoding -const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); -vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; - Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); - vec4 vResult; - vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z; - float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0; - vResult.w = fract( Le ); - vResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0; - return vResult; -} - -// Inverse M matrix, for decoding -const mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 ); -vec4 LogLuvToLinear( in vec4 value ) { - float Le = value.z * 255.0 + value.w; - vec3 Xp_Y_XYZp; - Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); - Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; - Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; - return vec4( max( vRGB, 0.0 ), 1.0 ); -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js deleted file mode 100644 index e57198dd9a..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +++ /dev/null @@ -1,15 +0,0 @@ -export default /* glsl */` -#ifdef USE_ENVMAP - - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform int maxMipLevel; - - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js deleted file mode 100644 index a5ef073f9b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +++ /dev/null @@ -1,74 +0,0 @@ -export default /* glsl */` -#ifdef USE_ENVMAP - - #ifdef ENV_WORLDPOS - - vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition ); - - // Transforming Normal Vectors with the Inverse Transformation - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - - #ifdef ENVMAP_MODE_REFLECTION - - vec3 reflectVec = reflect( cameraToVertex, worldNormal ); - - #else - - vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio ); - - #endif - - #else - - vec3 reflectVec = vReflect; - - #endif - - #ifdef ENVMAP_TYPE_CUBE - - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - - #elif defined( ENVMAP_TYPE_EQUIREC ) - - vec2 sampleUV; - - reflectVec = normalize( reflectVec ); - - sampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - - sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5; - - vec4 envColor = texture2D( envMap, sampleUV ); - - #elif defined( ENVMAP_TYPE_SPHERE ) - - reflectVec = normalize( reflectVec ); - - vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ); - - vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 ); - - #else - - vec4 envColor = vec4( 0.0 ); - - #endif - - envColor = envMapTexelToLinear( envColor ); - - #ifdef ENVMAP_BLENDING_MULTIPLY - - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - - #elif defined( ENVMAP_BLENDING_MIX ) - - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - - #elif defined( ENVMAP_BLENDING_ADD ) - - outgoingLight += envColor.xyz * specularStrength * reflectivity; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js deleted file mode 100644 index a8e8e1c6b0..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js +++ /dev/null @@ -1,21 +0,0 @@ -export default /* glsl */` -#ifdef USE_ENVMAP - - uniform float reflectivity; - - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) - - #define ENV_WORLDPOS - - #endif - - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js deleted file mode 100644 index 6932df497a..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js +++ /dev/null @@ -1,22 +0,0 @@ -export default /* glsl */` -#ifdef USE_ENVMAP - - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG ) - - #define ENV_WORLDPOS - - #endif - - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - - #else - - varying vec3 vReflect; - uniform float refractionRatio; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js deleted file mode 100644 index 05f6804e21..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +++ /dev/null @@ -1,141 +0,0 @@ -export default /* glsl */` -#if defined( USE_ENVMAP ) - - #ifdef ENVMAP_MODE_REFRACTION - uniform float refractionRatio; - #endif - - vec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) { - - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - - #ifdef ENVMAP_TYPE_CUBE - - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - - // TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level - // of a specular cubemap, or just the default level of a specially created irradiance cubemap. - - #ifdef TEXTURE_LOD_EXT - - vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) ); - - #else - - // force the bias high to get the last LOD level as it is the most blurred. - vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) ); - - #endif - - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - - #elif defined( ENVMAP_TYPE_CUBE_UV ) - - vec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz ); - vec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 ); - - #else - - vec4 envMapColor = vec4( 0.0 ); - - #endif - - return PI * envMapColor.rgb * envMapIntensity; - - } - - // Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html - float getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) { - - float maxMIPLevelScalar = float( maxMIPLevel ); - - float sigma = PI * roughness * roughness / ( 1.0 + roughness ); - float desiredMIPLevel = maxMIPLevelScalar + log2( sigma ); - - // clamp to allowable LOD ranges. - return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar ); - - } - - vec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) { - - #ifdef ENVMAP_MODE_REFLECTION - - vec3 reflectVec = reflect( -viewDir, normal ); - - // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane. - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - - #else - - vec3 reflectVec = refract( -viewDir, normal, refractionRatio ); - - #endif - - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - - float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel ); - - #ifdef ENVMAP_TYPE_CUBE - - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - - #ifdef TEXTURE_LOD_EXT - - vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel ); - - #else - - vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel ); - - #endif - - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - - #elif defined( ENVMAP_TYPE_CUBE_UV ) - - vec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz ); - vec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness ); - - #elif defined( ENVMAP_TYPE_EQUIREC ) - - vec2 sampleUV; - sampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5; - - #ifdef TEXTURE_LOD_EXT - - vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel ); - - #else - - vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel ); - - #endif - - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - - #elif defined( ENVMAP_TYPE_SPHERE ) - - vec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) ); - - #ifdef TEXTURE_LOD_EXT - - vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel ); - - #else - - vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel ); - - #endif - - envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb; - - #endif - - return envMapColor.rgb * envMapIntensity; - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js deleted file mode 100644 index 75955c728b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +++ /dev/null @@ -1,27 +0,0 @@ -export default /* glsl */` -#ifdef USE_ENVMAP - - #ifdef ENV_WORLDPOS - - vWorldPosition = worldPosition.xyz; - - #else - - vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - - #ifdef ENVMAP_MODE_REFLECTION - - vReflect = reflect( cameraToVertex, worldNormal ); - - #else - - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - - #endif - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_fragment.glsl.js deleted file mode 100644 index 996a17e149..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_fragment.glsl.js +++ /dev/null @@ -1,17 +0,0 @@ -export default /* glsl */` -#ifdef USE_FOG - - #ifdef FOG_EXP2 - - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth ); - - #else - - float fogFactor = smoothstep( fogNear, fogFar, fogDepth ); - - #endif - - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js deleted file mode 100644 index 808c7c55cc..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js +++ /dev/null @@ -1,19 +0,0 @@ -export default /* glsl */` -#ifdef USE_FOG - - uniform vec3 fogColor; - varying float fogDepth; - - #ifdef FOG_EXP2 - - uniform float fogDensity; - - #else - - uniform float fogNear; - uniform float fogFar; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js deleted file mode 100644 index 284d460f48..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_FOG - - varying float fogDepth; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_vertex.glsl.js deleted file mode 100644 index ecfc773911..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/fog_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_FOG - - fogDepth = -mvPosition.z; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js deleted file mode 100644 index d8ccc5b681..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +++ /dev/null @@ -1,26 +0,0 @@ -export default /* glsl */` -#ifdef TOON - - uniform sampler2D gradientMap; - - vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - - // dotNL will be from -1.0 to 1.0 - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - - #ifdef USE_GRADIENTMAP - - return texture2D( gradientMap, coord ).rgb; - - #else - - return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 ); - - #endif - - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js deleted file mode 100644 index 7cf7cbd00f..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_LIGHTMAP - - reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js deleted file mode 100644 index f5fd898d22..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef USE_LIGHTMAP - - uniform sampler2D lightMap; - uniform float lightMapIntensity; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js deleted file mode 100644 index 29ae92c971..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +++ /dev/null @@ -1,135 +0,0 @@ -export default /* glsl */` -/** - * This is a template that can be used to light a material, it uses pluggable - * RenderEquations (RE)for specific lighting scenarios. - * - * Instructions for use: - * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined - * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ??? - * - Create a material parameter that is to be passed as the third parameter to your lighting functions. - * - * TODO: - * - Add area light support. - * - Add sphere light support. - * - Add diffuse light probe (irradiance cubemap) support. - */ - -GeometricContext geometry; - -geometry.position = - vViewPosition; -geometry.normal = normal; -geometry.viewDir = normalize( vViewPosition ); - -#ifdef CLEARCOAT - - geometry.clearcoatNormal = clearcoatNormal; - -#endif - -IncidentLight directLight; - -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - - PointLight pointLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - - pointLight = pointLights[ i ]; - - getPointDirectLightIrradiance( pointLight, geometry, directLight ); - - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - directLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - #endif - - RE_Direct( directLight, geometry, material, reflectedLight ); - - } - -#endif - -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - - SpotLight spotLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - - spotLight = spotLights[ i ]; - - getSpotDirectLightIrradiance( spotLight, geometry, directLight ); - - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - directLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - - RE_Direct( directLight, geometry, material, reflectedLight ); - - } - -#endif - -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - - DirectionalLight directionalLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - - directionalLight = directionalLights[ i ]; - - getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight ); - - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - - RE_Direct( directLight, geometry, material, reflectedLight ); - - } - -#endif - -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - - RectAreaLight rectAreaLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); - - } - -#endif - -#if defined( RE_IndirectDiffuse ) - - vec3 iblIrradiance = vec3( 0.0 ); - - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - - irradiance += getLightProbeIrradiance( lightProbe, geometry ); - - #if ( NUM_HEMI_LIGHTS > 0 ) - - #pragma unroll_loop - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - - } - - #endif - -#endif - -#if defined( RE_IndirectSpecular ) - - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js deleted file mode 100644 index fc0b5ebc7e..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +++ /dev/null @@ -1,13 +0,0 @@ -export default /* glsl */` -#if defined( RE_IndirectDiffuse ) - - RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); - -#endif - -#if defined( RE_IndirectSpecular ) - - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js deleted file mode 100644 index da6fe3e611..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +++ /dev/null @@ -1,37 +0,0 @@ -export default /* glsl */` -#if defined( RE_IndirectDiffuse ) - - #ifdef USE_LIGHTMAP - - vec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - lightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage - - #endif - - irradiance += lightMapIrradiance; - - #endif - - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - - iblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel ); - - #endif - -#endif - -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - - radiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel ); - - #ifdef CLEARCOAT - - clearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel ); - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl.js deleted file mode 100644 index e503a878d7..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl.js +++ /dev/null @@ -1,119 +0,0 @@ -export default /* glsl */` -vec3 diffuse = vec3( 1.0 ); - -GeometricContext geometry; -geometry.position = mvPosition.xyz; -geometry.normal = normalize( transformedNormal ); -geometry.viewDir = normalize( -mvPosition.xyz ); - -GeometricContext backGeometry; -backGeometry.position = geometry.position; -backGeometry.normal = -geometry.normal; -backGeometry.viewDir = geometry.viewDir; - -vLightFront = vec3( 0.0 ); -vIndirectFront = vec3( 0.0 ); - -#ifdef DOUBLE_SIDED - vLightBack = vec3( 0.0 ); - vIndirectBack = vec3( 0.0 ); -#endif - -IncidentLight directLight; -float dotNL; -vec3 directLightColor_Diffuse; - -#if NUM_POINT_LIGHTS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - - getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight ); - - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - - #ifdef DOUBLE_SIDED - - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - - #endif - - } - -#endif - -#if NUM_SPOT_LIGHTS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - - getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight ); - - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - - #ifdef DOUBLE_SIDED - - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - - #endif - } - -#endif - -/* -#if NUM_RECT_AREA_LIGHTS > 0 - - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - - // TODO (abelnation): implement - - } - -#endif -*/ - -#if NUM_DIR_LIGHTS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - - getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight ); - - dotNL = dot( geometry.normal, directLight.direction ); - directLightColor_Diffuse = PI * directLight.color; - - vLightFront += saturate( dotNL ) * directLightColor_Diffuse; - - #ifdef DOUBLE_SIDED - - vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; - - #endif - - } - -#endif - -#if NUM_HEMI_LIGHTS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - - vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry ); - - #ifdef DOUBLE_SIDED - - vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry ); - - #endif - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js deleted file mode 100644 index 7c520211f6..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +++ /dev/null @@ -1,210 +0,0 @@ -export default /* glsl */` -uniform vec3 ambientLightColor; -uniform vec3 lightProbe[ 9 ]; - -// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere -// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - - // normal is assumed to have unit length - - float x = normal.x, y = normal.y, z = normal.z; - - // band 0 - vec3 result = shCoefficients[ 0 ] * 0.886227; - - // band 1 - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - - // band 2 - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - - return result; - -} - -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) { - - vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix ); - - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - - return irradiance; - -} - -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - - vec3 irradiance = ambientLightColor; - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - irradiance *= PI; - - #endif - - return irradiance; - -} - -#if NUM_DIR_LIGHTS > 0 - - struct DirectionalLight { - vec3 direction; - vec3 color; - - int shadow; - float shadowBias; - float shadowRadius; - vec2 shadowMapSize; - }; - - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - - void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) { - - directLight.color = directionalLight.color; - directLight.direction = directionalLight.direction; - directLight.visible = true; - - } - -#endif - - -#if NUM_POINT_LIGHTS > 0 - - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - - int shadow; - float shadowBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - - // directLight is an out parameter as having it as a return value caused compiler errors on some devices - void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) { - - vec3 lVector = pointLight.position - geometry.position; - directLight.direction = normalize( lVector ); - - float lightDistance = length( lVector ); - - directLight.color = pointLight.color; - directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay ); - directLight.visible = ( directLight.color != vec3( 0.0 ) ); - - } - -#endif - - -#if NUM_SPOT_LIGHTS > 0 - - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - - int shadow; - float shadowBias; - float shadowRadius; - vec2 shadowMapSize; - }; - - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - - // directLight is an out parameter as having it as a return value caused compiler errors on some devices - void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) { - - vec3 lVector = spotLight.position - geometry.position; - directLight.direction = normalize( lVector ); - - float lightDistance = length( lVector ); - float angleCos = dot( directLight.direction, spotLight.direction ); - - if ( angleCos > spotLight.coneCos ) { - - float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - - directLight.color = spotLight.color; - directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay ); - directLight.visible = true; - - } else { - - directLight.color = vec3( 0.0 ); - directLight.visible = false; - - } - } - -#endif - - -#if NUM_RECT_AREA_LIGHTS > 0 - - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - - // Pre-computed values of LinearTransformedCosine approximation of BRDF - // BRDF approximation Texture is 64x64 - uniform sampler2D ltc_1; // RGBA Float - uniform sampler2D ltc_2; // RGBA Float - - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; - -#endif - - -#if NUM_HEMI_LIGHTS > 0 - - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) { - - float dotNL = dot( geometry.normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - irradiance *= PI; - - #endif - - return irradiance; - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js deleted file mode 100644 index b9cfe42148..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength; -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js deleted file mode 100644 index e4e01e9f18..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +++ /dev/null @@ -1,55 +0,0 @@ -export default /* glsl */` -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - -#endif - - -struct BlinnPhongMaterial { - - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; - -}; - -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - - #ifdef TOON - - vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; - - #else - - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - - #endif - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - irradiance *= PI; // punctual light - - #endif - - reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - - reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength; - -} - -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - -} - -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong - -#define Material_LightProbeLOD( material ) (0) -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js deleted file mode 100644 index e6edda523c..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +++ /dev/null @@ -1,27 +0,0 @@ -export default /* glsl */` -PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 ); - -#ifdef REFLECTIVITY - - material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor ); - -#else - - material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor ); - -#endif - -#ifdef CLEARCOAT - - material.clearcoat = saturate( clearcoat ); // Burley clearcoat model - material.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 ); - -#endif -#ifdef USE_SHEEN - - material.sheenColor = sheen; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js deleted file mode 100644 index d9868e417d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +++ /dev/null @@ -1,171 +0,0 @@ -export default /* glsl */` -struct PhysicalMaterial { - - vec3 diffuseColor; - float specularRoughness; - vec3 specularColor; - -#ifdef CLEARCOAT - float clearcoat; - float clearcoatRoughness; -#endif -#ifdef USE_SHEEN - vec3 sheenColor; -#endif - -}; - -#define MAXIMUM_SPECULAR_COEFFICIENT 0.16 -#define DEFAULT_SPECULAR_COEFFICIENT 0.04 - -// Clear coat directional hemishperical reflectance (this approximation should be improved) -float clearcoatDHRApprox( const in float roughness, const in float dotNL ) { - - return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) ); - -} - -#if NUM_RECT_AREA_LIGHTS > 0 - - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - - vec3 normal = geometry.normal; - vec3 viewDir = geometry.viewDir; - vec3 position = geometry.position; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.specularRoughness; - - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction - rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - - // LTC Fresnel Approximation by Stephen Hill - // http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - - } - -#endif - -void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - - float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); - - vec3 irradiance = dotNL * directLight.color; - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - irradiance *= PI; // punctual light - - #endif - - #ifdef CLEARCOAT - - float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); - - vec3 ccIrradiance = ccDotNL * directLight.color; - - #ifndef PHYSICALLY_CORRECT_LIGHTS - - ccIrradiance *= PI; // punctual light - - #endif - - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - - reflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - - #else - - float clearcoatDHR = 0.0; - - #endif - - #ifdef USE_SHEEN - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen( - material.specularRoughness, - directLight.direction, - geometry, - material.sheenColor - ); - #else - reflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness); - #endif - - reflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); -} - -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - - reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor ); - -} - -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - - #ifdef CLEARCOAT - - float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); - - reflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness ); - - float ccDotNL = ccDotNV; - float clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL ); - - #else - - float clearcoatDHR = 0.0; - - #endif - - float clearcoatInv = 1.0 - clearcoatDHR; - - // Both indirect specular and diffuse light accumulate here - // if energy preservation enabled, and PMREM provided. - - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - - BRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering ); - - vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) ); - - reflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering; - reflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; - -} - -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical - -// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js deleted file mode 100644 index 723396878d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - - gl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js deleted file mode 100644 index 2e4417d406..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - - uniform float logDepthBufFC; - varying float vFragDepth; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js deleted file mode 100644 index 748289ea35..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +++ /dev/null @@ -1,15 +0,0 @@ -export default /* glsl */` -#ifdef USE_LOGDEPTHBUF - - #ifdef USE_LOGDEPTHBUF_EXT - - varying float vFragDepth; - - #else - - uniform float logDepthBufFC; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js deleted file mode 100644 index 1631661a9b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +++ /dev/null @@ -1,17 +0,0 @@ -export default /* glsl */` -#ifdef USE_LOGDEPTHBUF - - #ifdef USE_LOGDEPTHBUF_EXT - - vFragDepth = 1.0 + gl_Position.w; - - #else - - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - - gl_Position.z *= gl_Position.w; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_fragment.glsl.js deleted file mode 100644 index 5938668d59..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_fragment.glsl.js +++ /dev/null @@ -1,10 +0,0 @@ -export default /* glsl */` -#ifdef USE_MAP - - vec4 texelColor = texture2D( map, vUv ); - - texelColor = mapTexelToLinear( texelColor ); - diffuseColor *= texelColor; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js deleted file mode 100644 index 3410bc3c59..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_MAP - - uniform sampler2D map; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js deleted file mode 100644 index 20dbaab554..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js +++ /dev/null @@ -1,9 +0,0 @@ -export default /* glsl */` -#ifdef USE_MAP - - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - vec4 mapTexel = texture2D( map, uv ); - diffuseColor *= mapTexelToLinear( mapTexel ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js deleted file mode 100644 index 3bf8eb0072..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef USE_MAP - - uniform mat3 uvTransform; - uniform sampler2D map; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js deleted file mode 100644 index 0cac7d113c..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js +++ /dev/null @@ -1,12 +0,0 @@ -export default /* glsl */` -float metalnessFactor = metalness; - -#ifdef USE_METALNESSMAP - - vec4 texelMetalness = texture2D( metalnessMap, vUv ); - - // reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture - metalnessFactor *= texelMetalness.b; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js deleted file mode 100644 index ac89c0b371..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_METALNESSMAP - - uniform sampler2D metalnessMap; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js deleted file mode 100644 index c1c633a526..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +++ /dev/null @@ -1,10 +0,0 @@ -export default /* glsl */` -#ifdef USE_MORPHNORMALS - - objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ]; - objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ]; - objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ]; - objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ]; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js deleted file mode 100644 index 0f59c2147f..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +++ /dev/null @@ -1,15 +0,0 @@ -export default /* glsl */` -#ifdef USE_MORPHTARGETS - - #ifndef USE_MORPHNORMALS - - uniform float morphTargetInfluences[ 8 ]; - - #else - - uniform float morphTargetInfluences[ 4 ]; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js deleted file mode 100644 index 5c33df864d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +++ /dev/null @@ -1,19 +0,0 @@ -export default /* glsl */` -#ifdef USE_MORPHTARGETS - - transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ]; - transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ]; - transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ]; - transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ]; - - #ifndef USE_MORPHNORMALS - - transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ]; - transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ]; - transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ]; - transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ]; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js deleted file mode 100644 index 4e8cbc0ed4..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +++ /dev/null @@ -1,40 +0,0 @@ -export default /* glsl */` -#ifdef FLAT_SHADED - - // Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ... - - vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); - vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); - vec3 normal = normalize( cross( fdx, fdy ) ); - -#else - - vec3 normal = normalize( vNormal ); - - #ifdef DOUBLE_SIDED - - normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - - #endif - - #ifdef USE_TANGENT - - vec3 tangent = normalize( vTangent ); - vec3 bitangent = normalize( vBitangent ); - - #ifdef DOUBLE_SIDED - - tangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - bitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - - #endif - - #endif - -#endif - -// non perturbed normal for clearcoat among others - -vec3 geometryNormal = normal; - -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js deleted file mode 100644 index 2c683127b0..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +++ /dev/null @@ -1,41 +0,0 @@ -export default /* glsl */` - -#ifdef OBJECTSPACE_NORMALMAP - - normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals - - #ifdef FLIP_SIDED - - normal = - normal; - - #endif - - #ifdef DOUBLE_SIDED - - normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - - #endif - - normal = normalize( normalMatrix * normal ); - -#elif defined( TANGENTSPACE_NORMALMAP ) - - #ifdef USE_TANGENT - - mat3 vTBN = mat3( tangent, bitangent, normal ); - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - mapN.xy = normalScale * mapN.xy; - normal = normalize( vTBN * mapN ); - - #else - - normal = perturbNormal2Arb( -vViewPosition, normal, normalScale, normalMap ); - - #endif - -#elif defined( USE_BUMPMAP ) - - normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js deleted file mode 100644 index 418c431551..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +++ /dev/null @@ -1,63 +0,0 @@ -export default /* glsl */` -#ifdef USE_NORMALMAP - - uniform sampler2D normalMap; - uniform vec2 normalScale; - -#endif - -#ifdef OBJECTSPACE_NORMALMAP - - uniform mat3 normalMatrix; - -#endif - -#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) - - // Per-Pixel Tangent Space Normal Mapping - // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html - - vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 normalScale, in sampler2D normalMap ) { - - // Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988 - - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( vUv.st ); - vec2 st1 = dFdy( vUv.st ); - - float scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude - - vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale ); - vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale ); - vec3 N = normalize( surf_norm ); - - vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; - - mapN.xy *= normalScale; - - #ifdef DOUBLE_SIDED - - // Workaround for Adreno GPUs gl_FrontFacing bug. See #15850 and #10331 - // http://hacksoflife.blogspot.com/2009/11/per-pixel-tangent-space-normal-mapping.html?showComment=1522254677437#c5087545147696715943 - vec3 NfromST = cross( S, T ); - if( dot( NfromST, N ) > 0.0 ) { - - S *= -1.0; - T *= -1.0; - - } - - #else - - mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 ); - - #endif - - mat3 tsn = mat3( S, T, N ); - return normalize( tsn * mapN ); - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/packing.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/packing.glsl.js deleted file mode 100644 index 1a4ec36bcf..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/packing.glsl.js +++ /dev/null @@ -1,60 +0,0 @@ -export default /* glsl */` -vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} - -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} - -const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1) -const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1) - -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); - -const float ShiftRight8 = 1. / 256.; - -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; // tidy overflow - return r * PackUpscale; -} - -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} - -vec4 encodeHalfRGBA ( vec2 v ) { - vec4 encoded = vec4( 0.0 ); - const vec2 offset = vec2( 1.0 / 255.0, 0.0 ); - - encoded.xy = vec2( v.x, fract( v.x * 255.0 ) ); - encoded.xy = encoded.xy - ( encoded.yy * offset ); - - encoded.zw = vec2( v.y, fract( v.y * 255.0 ) ); - encoded.zw = encoded.zw - ( encoded.ww * offset ); - - return encoded; -} - -vec2 decodeHalfRGBA( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} - -// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions - -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { - return linearClipZ * ( near - far ) - near; -} - -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * invClipZ - far ); -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js deleted file mode 100644 index a183739943..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef PREMULTIPLIED_ALPHA - - // Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation. - gl_FragColor.rgb *= gl_FragColor.a; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/project_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/project_vertex.glsl.js deleted file mode 100644 index 54416c502f..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/project_vertex.glsl.js +++ /dev/null @@ -1,5 +0,0 @@ -export default /* glsl */` -vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 ); - -gl_Position = projectionMatrix * mvPosition; -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js deleted file mode 100644 index db5b69872b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js +++ /dev/null @@ -1,12 +0,0 @@ -export default /* glsl */` -float roughnessFactor = roughness; - -#ifdef USE_ROUGHNESSMAP - - vec4 texelRoughness = texture2D( roughnessMap, vUv ); - - // reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture - roughnessFactor *= texelRoughness.g; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js deleted file mode 100644 index cea3ecd812..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_ROUGHNESSMAP - - uniform sampler2D roughnessMap; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js deleted file mode 100644 index c24a6114b5..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +++ /dev/null @@ -1,288 +0,0 @@ -export default /* glsl */` -#ifdef USE_SHADOWMAP - - #if NUM_DIR_LIGHT_SHADOWS > 0 - - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - - #endif - - #if NUM_SPOT_LIGHT_SHADOWS > 0 - - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - - #endif - - #if NUM_POINT_LIGHT_SHADOWS > 0 - - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - - #endif - - /* - #if NUM_RECT_AREA_LIGHTS > 0 - - // TODO (abelnation): create uniforms for area light shadows - - #endif - */ - - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - - } - - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - - return decodeHalfRGBA( texture2D( shadow, uv ) ); - - } - - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - - float occlusion = 1.0; - - vec2 distribution = texture2DDistribution( shadow, uv ); - - float hard_shadow = step( compare , distribution.x ); // Hard Shadow - - if (hard_shadow != 1.0 ) { - - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality - softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed - occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - - } - return occlusion; - - } - - float texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) { - - const vec2 offset = vec2( 0.0, 1.0 ); - - vec2 texelSize = vec2( 1.0 ) / size; - vec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize; - - float lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare ); - float lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare ); - float rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare ); - float rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare ); - - vec2 f = fract( uv * size + 0.5 ); - - float a = mix( lb, lt, f.y ); - float b = mix( rb, rt, f.y ); - float c = mix( a, b, f.x ); - - return c; - - } - - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - - float shadow = 1.0; - - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - - // if ( something && something ) breaks ATI OpenGL shader compiler - // if ( all( something, something ) ) using this instead - - bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); - bool inFrustum = all( inFrustumVec ); - - bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); - - bool frustumTest = all( frustumTestVec ); - - if ( frustumTest ) { - - #if defined( SHADOWMAP_TYPE_PCF ) - - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - - shadow = ( - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 9.0 ); - - #elif defined( SHADOWMAP_TYPE_VSM ) - - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - - #else // no percentage-closer filtering: - - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - - #endif - - } - - return shadow; - - } - - // cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D - // vector suitable for 2D texture mapping. This code uses the following layout for the - // 2D texture: - // - // xzXZ - // y Y - // - // Y - Positive y direction - // y - Negative y direction - // X - Positive x direction - // x - Negative x direction - // Z - Positive z direction - // z - Negative z direction - // - // Source and test bed: - // https://gist.github.com/tschw/da10c43c467ce8afd0c4 - - vec2 cubeToUV( vec3 v, float texelSizeY ) { - - // Number of texels to avoid at the edge of each square - - vec3 absV = abs( v ); - - // Intersect unit cube - - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - - // Apply scale to avoid seams - - // two texels less per square (one texel will do for NEAREST) - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - - // Unwrap - - // space: -1 ... 1 range for each square - // - // #X## dim := ( 4 , 2 ) - // # # center := ( 1 , 1 ) - - vec2 planar = v.xy; - - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - - if ( absV.z >= almostOne ) { - - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - - } else if ( absV.x >= almostOne ) { - - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - - } else if ( absV.y >= almostOne ) { - - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - - } - - // Transform to UV space - - // scale := 0.5 / dim - // translate := ( center + 0.5 ) / dim - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - - } - - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - - // for point lights, the uniform @vShadowCoord is re-purposed to hold - // the vector from the light to the world-space position of the fragment. - vec3 lightToPosition = shadowCoord.xyz; - - // dp = normalized distance from light to fragment position - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp? - dp += shadowBias; - - // bd3D = base direction 3D - vec3 bd3D = normalize( lightToPosition ); - - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - - #else // no percentage-closer filtering - - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - - #endif - - } - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js deleted file mode 100644 index 80fdb0a4f9..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +++ /dev/null @@ -1,34 +0,0 @@ -export default /* glsl */` -#ifdef USE_SHADOWMAP - - #if NUM_DIR_LIGHT_SHADOWS > 0 - - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - - #endif - - #if NUM_SPOT_LIGHT_SHADOWS > 0 - - uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ]; - varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ]; - - #endif - - #if NUM_POINT_LIGHT_SHADOWS > 0 - - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - - #endif - - /* - #if NUM_RECT_AREA_LIGHTS > 0 - - // TODO (abelnation): uniforms for area light shadows - - #endif - */ - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js deleted file mode 100644 index 4a888a0b35..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +++ /dev/null @@ -1,46 +0,0 @@ -export default /* glsl */` -#ifdef USE_SHADOWMAP - - #if NUM_DIR_LIGHT_SHADOWS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition; - - } - - #endif - - #if NUM_SPOT_LIGHT_SHADOWS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - - vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition; - - } - - #endif - - #if NUM_POINT_LIGHT_SHADOWS > 0 - - #pragma unroll_loop - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition; - - } - - #endif - - /* - #if NUM_RECT_AREA_LIGHTS > 0 - - // TODO (abelnation): update vAreaShadowCoord with area light info - - #endif - */ - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js deleted file mode 100644 index 1c4f27e1cb..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +++ /dev/null @@ -1,63 +0,0 @@ -export default /* glsl */` -float getShadowMask() { - - float shadow = 1.0; - - #ifdef USE_SHADOWMAP - - #if NUM_DIR_LIGHT_SHADOWS > 0 - - DirectionalLight directionalLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - - directionalLight = directionalLights[ i ]; - shadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - - } - - #endif - - #if NUM_SPOT_LIGHT_SHADOWS > 0 - - SpotLight spotLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - - spotLight = spotLights[ i ]; - shadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - - } - - #endif - - #if NUM_POINT_LIGHT_SHADOWS > 0 - - PointLight pointLight; - - #pragma unroll_loop - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - - pointLight = pointLights[ i ]; - shadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - - } - - #endif - - /* - #if NUM_RECT_AREA_LIGHTS > 0 - - // TODO (abelnation): update shadow for Area light - - #endif - */ - - #endif - - return shadow; - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js deleted file mode 100644 index 17d8f40acb..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js +++ /dev/null @@ -1,10 +0,0 @@ -export default /* glsl */` -#ifdef USE_SKINNING - - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js deleted file mode 100644 index 9f90971456..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js +++ /dev/null @@ -1,48 +0,0 @@ -export default /* glsl */` -#ifdef USE_SKINNING - - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - - #ifdef BONE_TEXTURE - - uniform highp sampler2D boneTexture; - uniform int boneTextureSize; - - mat4 getBoneMatrix( const in float i ) { - - float j = i * 4.0; - float x = mod( j, float( boneTextureSize ) ); - float y = floor( j / float( boneTextureSize ) ); - - float dx = 1.0 / float( boneTextureSize ); - float dy = 1.0 / float( boneTextureSize ); - - y = dy * ( y + 0.5 ); - - vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); - vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); - vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); - vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); - - mat4 bone = mat4( v1, v2, v3, v4 ); - - return bone; - - } - - #else - - uniform mat4 boneMatrices[ MAX_BONES ]; - - mat4 getBoneMatrix( const in float i ) { - - mat4 bone = boneMatrices[ int(i) ]; - return bone; - - } - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js deleted file mode 100644 index a07418c479..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js +++ /dev/null @@ -1,15 +0,0 @@ -export default /* glsl */` -#ifdef USE_SKINNING - - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - - transformed = ( bindMatrixInverse * skinned ).xyz; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js deleted file mode 100644 index 2b8e5cc84c..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js +++ /dev/null @@ -1,20 +0,0 @@ -export default /* glsl */` -#ifdef USE_SKINNING - - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - - #ifdef USE_TANGENT - - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - - #endif - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js deleted file mode 100644 index 9f7cf8383b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js +++ /dev/null @@ -1,14 +0,0 @@ -export default /* glsl */` -float specularStrength; - -#ifdef USE_SPECULARMAP - - vec4 texelSpecular = texture2D( specularMap, vUv ); - specularStrength = texelSpecular.r; - -#else - - specularStrength = 1.0; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js deleted file mode 100644 index bead42d2cf..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_SPECULARMAP - - uniform sampler2D specularMap; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js deleted file mode 100644 index 46944f4ba1..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#if defined( TONE_MAPPING ) - - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js deleted file mode 100644 index 09322f12a4..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +++ /dev/null @@ -1,51 +0,0 @@ -export default /* glsl */` -#ifndef saturate - #define saturate(a) clamp( a, 0.0, 1.0 ) -#endif - -uniform float toneMappingExposure; -uniform float toneMappingWhitePoint; - -// exposure only -vec3 LinearToneMapping( vec3 color ) { - - return toneMappingExposure * color; - -} - -// source: https://www.cs.utah.edu/~reinhard/cdrom/ -vec3 ReinhardToneMapping( vec3 color ) { - - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); - -} - -// source: http://filmicgames.com/archives/75 -#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) ) -vec3 Uncharted2ToneMapping( vec3 color ) { - - // John Hable's filmic operator from Uncharted 2 video game - color *= toneMappingExposure; - return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) ); - -} - -// source: http://filmicgames.com/archives/75 -vec3 OptimizedCineonToneMapping( vec3 color ) { - - // optimized filmic operator by Jim Hejl and Richard Burgess-Dawson - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); - -} - -// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ -vec3 ACESFilmicToneMapping( vec3 color ) { - - color *= toneMappingExposure; - return saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_fragment.glsl.js deleted file mode 100644 index c9e03d0438..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - - varying vec2 vUv2; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl.js deleted file mode 100644 index 6a5a771676..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - - attribute vec2 uv2; - varying vec2 vUv2; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_vertex.glsl.js deleted file mode 100644 index 0c9fb86482..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv2_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - - vUv2 = uv2; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js deleted file mode 100644 index ecdf15b7d9..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_UV - - varying vec2 vUv; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js deleted file mode 100644 index fd918927e9..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +++ /dev/null @@ -1,8 +0,0 @@ -export default /* glsl */` -#ifdef USE_UV - - varying vec2 vUv; - uniform mat3 uvTransform; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_vertex.glsl.js deleted file mode 100644 index ca031fe1af..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#ifdef USE_UV - - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js deleted file mode 100644 index 2bf384df75..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js +++ /dev/null @@ -1,7 +0,0 @@ -export default /* glsl */` -#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) - - vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 ); - -#endif -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.d.ts b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.d.ts deleted file mode 100644 index e2c31b9423..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { IUniform } from './UniformsLib'; - -export interface Shader { - uniforms: { [uniform: string]: IUniform }; - vertexShader: string; - fragmentShader: string; -} - -export let ShaderLib: { - [name: string]: Shader; - basic: Shader; - lambert: Shader; - phong: Shader; - standard: Shader; - matcap: Shader; - points: Shader; - dashed: Shader; - depth: Shader; - normal: Shader; - sprite: Shader; - background: Shader; - cube: Shader; - equirect: Shader; - distanceRGBA: Shader; - shadow: Shader; - physical: Shader; -}; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.js deleted file mode 100644 index 0f9fd033fa..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib.js +++ /dev/null @@ -1,291 +0,0 @@ -import { ShaderChunk } from './ShaderChunk.js'; -import { mergeUniforms } from './UniformsUtils.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Vector3 } from '../../math/Vector3.js'; -import { UniformsLib } from './UniformsLib.js'; -import { Color } from '../../math/Color.js'; -import { Matrix3 } from '../../math/Matrix3.js'; - -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - */ - -var ShaderLib = { - - basic: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.fog - ] ), - - vertexShader: ShaderChunk.meshbasic_vert, - fragmentShader: ShaderChunk.meshbasic_frag - - }, - - lambert: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) } - } - ] ), - - vertexShader: ShaderChunk.meshlambert_vert, - fragmentShader: ShaderChunk.meshlambert_frag - - }, - - phong: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.specularmap, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.gradientmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) }, - specular: { value: new Color( 0x111111 ) }, - shininess: { value: 30 } - } - ] ), - - vertexShader: ShaderChunk.meshphong_vert, - fragmentShader: ShaderChunk.meshphong_frag - - }, - - standard: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.envmap, - UniformsLib.aomap, - UniformsLib.lightmap, - UniformsLib.emissivemap, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.roughnessmap, - UniformsLib.metalnessmap, - UniformsLib.fog, - UniformsLib.lights, - { - emissive: { value: new Color( 0x000000 ) }, - roughness: { value: 0.5 }, - metalness: { value: 0.5 }, - envMapIntensity: { value: 1 } // temporary - } - ] ), - - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag - - }, - - matcap: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - UniformsLib.fog, - { - matcap: { value: null } - } - ] ), - - vertexShader: ShaderChunk.meshmatcap_vert, - fragmentShader: ShaderChunk.meshmatcap_frag - - }, - - points: { - - uniforms: mergeUniforms( [ - UniformsLib.points, - UniformsLib.fog - ] ), - - vertexShader: ShaderChunk.points_vert, - fragmentShader: ShaderChunk.points_frag - - }, - - dashed: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.fog, - { - scale: { value: 1 }, - dashSize: { value: 1 }, - totalSize: { value: 2 } - } - ] ), - - vertexShader: ShaderChunk.linedashed_vert, - fragmentShader: ShaderChunk.linedashed_frag - - }, - - depth: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.displacementmap - ] ), - - vertexShader: ShaderChunk.depth_vert, - fragmentShader: ShaderChunk.depth_frag - - }, - - normal: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.bumpmap, - UniformsLib.normalmap, - UniformsLib.displacementmap, - { - opacity: { value: 1.0 } - } - ] ), - - vertexShader: ShaderChunk.normal_vert, - fragmentShader: ShaderChunk.normal_frag - - }, - - sprite: { - - uniforms: mergeUniforms( [ - UniformsLib.sprite, - UniformsLib.fog - ] ), - - vertexShader: ShaderChunk.sprite_vert, - fragmentShader: ShaderChunk.sprite_frag - - }, - - background: { - - uniforms: { - uvTransform: { value: new Matrix3() }, - t2D: { value: null }, - }, - - vertexShader: ShaderChunk.background_vert, - fragmentShader: ShaderChunk.background_frag - - }, - /* ------------------------------------------------------------------------- - // Cube map shader - ------------------------------------------------------------------------- */ - - cube: { - - uniforms: { - tCube: { value: null }, - tFlip: { value: - 1 }, - opacity: { value: 1.0 } - }, - - vertexShader: ShaderChunk.cube_vert, - fragmentShader: ShaderChunk.cube_frag - - }, - - equirect: { - - uniforms: { - tEquirect: { value: null }, - }, - - vertexShader: ShaderChunk.equirect_vert, - fragmentShader: ShaderChunk.equirect_frag - - }, - - distanceRGBA: { - - uniforms: mergeUniforms( [ - UniformsLib.common, - UniformsLib.displacementmap, - { - referencePosition: { value: new Vector3() }, - nearDistance: { value: 1 }, - farDistance: { value: 1000 } - } - ] ), - - vertexShader: ShaderChunk.distanceRGBA_vert, - fragmentShader: ShaderChunk.distanceRGBA_frag - - }, - - shadow: { - - uniforms: mergeUniforms( [ - UniformsLib.lights, - UniformsLib.fog, - { - color: { value: new Color( 0x00000 ) }, - opacity: { value: 1.0 } - }, - ] ), - - vertexShader: ShaderChunk.shadow_vert, - fragmentShader: ShaderChunk.shadow_frag - - } - -}; - -ShaderLib.physical = { - - uniforms: mergeUniforms( [ - ShaderLib.standard.uniforms, - { - transparency: { value: 0 }, - clearcoat: { value: 0 }, - clearcoatRoughness: { value: 0 }, - sheen: { value: new Color( 0x000000 ) }, - clearcoatNormalScale: { value: new Vector2( 1, 1 ) }, - clearcoatNormalMap: { value: null }, - } - ] ), - - vertexShader: ShaderChunk.meshphysical_vert, - fragmentShader: ShaderChunk.meshphysical_frag - -}; - - -export { ShaderLib }; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_frag.glsl.js deleted file mode 100644 index 45ced12921..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_frag.glsl.js +++ /dev/null @@ -1,16 +0,0 @@ -export default /* glsl */` -uniform sampler2D t2D; - -varying vec2 vUv; - -void main() { - - vec4 texColor = texture2D( t2D, vUv ); - - gl_FragColor = mapTexelToLinear( texColor ); - - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_vert.glsl.js deleted file mode 100644 index 49f6d64e6d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/background_vert.glsl.js +++ /dev/null @@ -1,12 +0,0 @@ -export default /* glsl */` -varying vec2 vUv; -uniform mat3 uvTransform; - -void main() { - - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - - gl_Position = vec4( position.xy, 1.0, 1.0 ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_frag.glsl.js deleted file mode 100644 index 0a53ba08ec..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_frag.glsl.js +++ /dev/null @@ -1,19 +0,0 @@ -export default /* glsl */` -uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; - -varying vec3 vWorldDirection; - -void main() { - - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - - gl_FragColor = mapTexelToLinear( texColor ); - gl_FragColor.a *= opacity; - - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_vert.glsl.js deleted file mode 100644 index 66f1c4302c..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/cube_vert.glsl.js +++ /dev/null @@ -1,16 +0,0 @@ -export default /* glsl */` -varying vec3 vWorldDirection; - -#include - -void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - gl_Position.z = gl_Position.w; // set z to camera.far - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_frag.glsl.js deleted file mode 100644 index c1a75b1caf..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_frag.glsl.js +++ /dev/null @@ -1,45 +0,0 @@ -export default /* glsl */` -#if DEPTH_PACKING == 3200 - - uniform float opacity; - -#endif - -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( 1.0 ); - - #if DEPTH_PACKING == 3200 - - diffuseColor.a = opacity; - - #endif - - #include - #include - #include - - #include - - #if DEPTH_PACKING == 3200 - - gl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity ); - - #elif DEPTH_PACKING == 3201 - - gl_FragColor = packDepthToRGBA( gl_FragCoord.z ); - - #endif - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_vert.glsl.js deleted file mode 100644 index 4705257b06..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/depth_vert.glsl.js +++ /dev/null @@ -1,33 +0,0 @@ -export default /* glsl */` -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - #include - - #ifdef USE_DISPLACEMENTMAP - - #include - #include - #include - - #endif - - #include - #include - #include - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl.js deleted file mode 100644 index 7c78545b38..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl.js +++ /dev/null @@ -1,33 +0,0 @@ -export default /* glsl */` -#define DISTANCE - -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; - -#include -#include -#include -#include -#include -#include - -void main () { - - #include - - vec4 diffuseColor = vec4( 1.0 ); - - #include - #include - #include - - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); // clamp to [ 0, 1 ] - - gl_FragColor = packDepthToRGBA( dist ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl.js deleted file mode 100644 index 6610c28cb5..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl.js +++ /dev/null @@ -1,38 +0,0 @@ -export default /* glsl */` -#define DISTANCE - -varying vec3 vWorldPosition; - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - #include - - #ifdef USE_DISPLACEMENTMAP - - #include - #include - #include - - #endif - - #include - #include - #include - #include - #include - #include - #include - - vWorldPosition = worldPosition.xyz; - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_frag.glsl.js deleted file mode 100644 index 52269daba1..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_frag.glsl.js +++ /dev/null @@ -1,26 +0,0 @@ -export default /* glsl */` -uniform sampler2D tEquirect; - -varying vec3 vWorldDirection; - -#include - -void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV; - - sampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - - sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5; - - vec4 texColor = texture2D( tEquirect, sampleUV ); - - gl_FragColor = mapTexelToLinear( texColor ); - - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_vert.glsl.js deleted file mode 100644 index dc86f3bde5..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/equirect_vert.glsl.js +++ /dev/null @@ -1,14 +0,0 @@ -export default /* glsl */` -varying vec3 vWorldDirection; - -#include - -void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_frag.glsl.js deleted file mode 100644 index 9942f531d5..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_frag.glsl.js +++ /dev/null @@ -1,42 +0,0 @@ -export default /* glsl */` -uniform vec3 diffuse; -uniform float opacity; - -uniform float dashSize; -uniform float totalSize; - -varying float vLineDistance; - -#include -#include -#include -#include -#include - -void main() { - - #include - - if ( mod( vLineDistance, totalSize ) > dashSize ) { - - discard; - - } - - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - - #include - #include - - outgoingLight = diffuseColor.rgb; // simple shader - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_vert.glsl.js deleted file mode 100644 index 4a7a7a4b74..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/linedashed_vert.glsl.js +++ /dev/null @@ -1,27 +0,0 @@ -export default /* glsl */` -uniform float scale; -attribute float lineDistance; - -varying float vLineDistance; - -#include -#include -#include -#include -#include - -void main() { - - #include - - vLineDistance = scale * lineDistance; - - vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); - gl_Position = projectionMatrix * mvPosition; - - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_frag.glsl.js deleted file mode 100644 index 18e6c9649c..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_frag.glsl.js +++ /dev/null @@ -1,69 +0,0 @@ -export default /* glsl */` -uniform vec3 diffuse; -uniform float opacity; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( diffuse, opacity ); - - #include - #include - #include - #include - #include - #include - - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - - // accumulation (baked indirect lighting only) - #ifdef USE_LIGHTMAP - - reflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; - - #else - - reflectedLight.indirectDiffuse += vec3( 1.0 ); - - #endif - - // modulation - #include - - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - - vec3 outgoingLight = reflectedLight.indirectDiffuse; - - #include - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js deleted file mode 100644 index 4e00da5405..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js +++ /dev/null @@ -1,41 +0,0 @@ -export default /* glsl */` -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - #include - - #ifdef USE_ENVMAP - - #include - #include - #include - #include - - #endif - - #include - #include - #include - #include - #include - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_frag.glsl.js deleted file mode 100644 index f00305c709..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_frag.glsl.js +++ /dev/null @@ -1,97 +0,0 @@ -export default /* glsl */` -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; - -varying vec3 vLightFront; -varying vec3 vIndirectFront; - -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - - #include - #include - #include - #include - #include - #include - #include - - // accumulation - reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor ); - - #ifdef DOUBLE_SIDED - - reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack; - - #else - - reflectedLight.indirectDiffuse += vIndirectFront; - - #endif - - #include - - reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ); - - #ifdef DOUBLE_SIDED - - reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack; - - #else - - reflectedLight.directDiffuse = vLightFront; - - #endif - - reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask(); - - // modulation - #include - - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - - #include - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - #include -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_vert.glsl.js deleted file mode 100644 index 9b11a19923..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshlambert_vert.glsl.js +++ /dev/null @@ -1,51 +0,0 @@ -export default /* glsl */` -#define LAMBERT - -varying vec3 vLightFront; -varying vec3 vIndirectFront; - -#ifdef DOUBLE_SIDED - varying vec3 vLightBack; - varying vec3 vIndirectBack; -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - - #include - #include - #include - #include - #include - - #include - #include - #include - #include - #include - #include - - #include - #include - #include - #include - #include -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_frag.glsl.js deleted file mode 100644 index b1e4bbefb6..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_frag.glsl.js +++ /dev/null @@ -1,66 +0,0 @@ -export default /* glsl */` -#define MATCAP - -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - -#endif - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( diffuse, opacity ); - - #include - #include - #include - #include - #include - #include - - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks - - #ifdef USE_MATCAP - - vec4 matcapColor = texture2D( matcap, uv ); - matcapColor = matcapTexelToLinear( matcapColor ); - - #else - - vec4 matcapColor = vec4( 1.0 ); - - #endif - - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_vert.glsl.js deleted file mode 100644 index 3ef9252f9d..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshmatcap_vert.glsl.js +++ /dev/null @@ -1,51 +0,0 @@ -export default /* glsl */` -#define MATCAP - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -void main() { - - #include - - #include - #include - #include - #include - #include - - #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - - vNormal = normalize( transformedNormal ); - - #endif - - #include - #include - #include - #include - #include - - #include - #include - #include - - vViewPosition = - mvPosition.xyz; - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_frag.glsl.js deleted file mode 100644 index 80a93b682a..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_frag.glsl.js +++ /dev/null @@ -1,75 +0,0 @@ -export default /* glsl */` -#define PHONG - -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - - #include - #include - #include - #include - #include - #include - #include - #include - #include - - // accumulation - #include - #include - #include - #include - - // modulation - #include - - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - - #include - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_vert.glsl.js deleted file mode 100644 index 1058890582..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphong_vert.glsl.js +++ /dev/null @@ -1,59 +0,0 @@ -export default /* glsl */` -#define PHONG - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - - #include - #include - #include - #include - #include - -#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - - vNormal = normalize( transformedNormal ); - -#endif - - #include - #include - #include - #include - #include - #include - #include - - vViewPosition = - mvPosition.xyz; - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js deleted file mode 100644 index 3b3453f47b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js +++ /dev/null @@ -1,121 +0,0 @@ -export default /* glsl */` -#define STANDARD - -#ifdef PHYSICAL - #define REFLECTIVITY - #define CLEARCOAT - #define TRANSPARENCY -#endif - -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; - -#ifdef TRANSPARENCY - uniform float transparency; -#endif - -#ifdef REFLECTIVITY - uniform float reflectivity; -#endif - -#ifdef CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif - -#ifdef USE_SHEEN - uniform vec3 sheen; -#endif - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - - #ifdef USE_TANGENT - - varying vec3 vTangent; - varying vec3 vBitangent; - - #endif - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 diffuseColor = vec4( diffuse, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - - // accumulation - #include - #include - #include - #include - - // modulation - #include - - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - - // this is a stub for the transparency model - #ifdef TRANSPARENCY - diffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ); - #endif - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js deleted file mode 100644 index 3f73e2cd10..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js +++ /dev/null @@ -1,71 +0,0 @@ -export default /* glsl */` -#define STANDARD - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - - #ifdef USE_TANGENT - - varying vec3 vTangent; - varying vec3 vBitangent; - - #endif - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - - #include - #include - #include - #include - #include - -#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - - vNormal = normalize( transformedNormal ); - - #ifdef USE_TANGENT - - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - - #endif - -#endif - - #include - #include - #include - #include - #include - #include - #include - - vViewPosition = - mvPosition.xyz; - - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_frag.glsl.js deleted file mode 100644 index 598a028e84..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_frag.glsl.js +++ /dev/null @@ -1,42 +0,0 @@ -export default /* glsl */` -#define NORMAL - -uniform float opacity; - -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - - varying vec3 vViewPosition; - -#endif - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - - #ifdef USE_TANGENT - - varying vec3 vTangent; - varying vec3 vBitangent; - - #endif - -#endif - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - #include - - gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_vert.glsl.js deleted file mode 100644 index bdadcaf339..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/normal_vert.glsl.js +++ /dev/null @@ -1,68 +0,0 @@ -export default /* glsl */` -#define NORMAL - -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - - varying vec3 vViewPosition; - -#endif - -#ifndef FLAT_SHADED - - varying vec3 vNormal; - - #ifdef USE_TANGENT - - varying vec3 vTangent; - varying vec3 vBitangent; - - #endif - -#endif - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - #include - #include - #include - #include - #include - -#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - - vNormal = normalize( transformedNormal ); - - #ifdef USE_TANGENT - - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - - #endif - -#endif - - #include - #include - #include - #include - #include - #include - #include - -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) - - vViewPosition = - mvPosition.xyz; - -#endif - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_frag.glsl.js deleted file mode 100644 index 68ecdfe2f8..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_frag.glsl.js +++ /dev/null @@ -1,34 +0,0 @@ -export default /* glsl */` -uniform vec3 diffuse; -uniform float opacity; - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - - #include - #include - #include - #include - - outgoingLight = diffuseColor.rgb; - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_vert.glsl.js deleted file mode 100644 index 58240755c7..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/points_vert.glsl.js +++ /dev/null @@ -1,35 +0,0 @@ -export default /* glsl */` -uniform float size; -uniform float scale; - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - #include - #include - #include - - gl_PointSize = size; - - #ifdef USE_SIZEATTENUATION - - bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); - - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - - #endif - - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_frag.glsl.js deleted file mode 100644 index 457ab748c4..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_frag.glsl.js +++ /dev/null @@ -1,20 +0,0 @@ -export default /* glsl */` -uniform vec3 color; -uniform float opacity; - -#include -#include -#include -#include -#include -#include -#include - -void main() { - - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_vert.glsl.js deleted file mode 100644 index 87458d4662..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/shadow_vert.glsl.js +++ /dev/null @@ -1,14 +0,0 @@ -export default /* glsl */` -#include -#include - -void main() { - - #include - #include - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_frag.glsl.js deleted file mode 100644 index f215219855..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_frag.glsl.js +++ /dev/null @@ -1,32 +0,0 @@ -export default /* glsl */` -uniform vec3 diffuse; -uniform float opacity; - -#include -#include -#include -#include -#include -#include - -void main() { - - #include - - vec3 outgoingLight = vec3( 0.0 ); - vec4 diffuseColor = vec4( diffuse, opacity ); - - #include - #include - #include - - outgoingLight = diffuseColor.rgb; - - gl_FragColor = vec4( outgoingLight, diffuseColor.a ); - - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_vert.glsl.js deleted file mode 100644 index bffda7c897..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/sprite_vert.glsl.js +++ /dev/null @@ -1,44 +0,0 @@ -export default /* glsl */` -uniform float rotation; -uniform vec2 center; - -#include -#include -#include -#include -#include - -void main() { - - #include - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - #ifndef USE_SIZEATTENUATION - - bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); - - if ( isPerspective ) scale *= - mvPosition.z; - - #endif - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; - - #include - #include - #include - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_frag.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_frag.glsl.js deleted file mode 100644 index 1d5db3d3a5..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_frag.glsl.js +++ /dev/null @@ -1,42 +0,0 @@ -export default /* glsl */` -uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; - -#include - -void main() { - - float mean = 0.0; - float squared_mean = 0.0; - - // This seems totally useless but it's a crazy work around for a Adreno compiler bug - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) ); - - for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) { - - #ifdef HORIZONAL_PASS - - vec2 distribution = decodeHalfRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - - #else - - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - - #endif - - } - - mean = mean * HALF_SAMPLE_RATE; - squared_mean = squared_mean * HALF_SAMPLE_RATE; - - float std_dev = pow( squared_mean - mean * mean, 0.5 ); - - gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) ); - -} -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_vert.glsl.js b/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_vert.glsl.js deleted file mode 100644 index ee0c7f8b74..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/ShaderLib/vsm_vert.glsl.js +++ /dev/null @@ -1,9 +0,0 @@ -export default /* glsl */` - -void main() { - - gl_Position = vec4( position, 1.0 ); - -} - -`; diff --git a/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.d.ts b/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.d.ts deleted file mode 100644 index ec3644054b..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -export interface IUniform { - value: any; -} - -export let UniformsLib: { - common: { - diffuse: IUniform; - opacity: IUniform; - map: IUniform; - uvTransform: IUniform; - alphaMap: IUniform; - }; - specularmap: { - specularMap: IUniform; - }; - envmap: { - envMap: IUniform; - flipEnvMap: IUniform; - reflectivity: IUniform; - refractionRatio: IUniform; - maxMipLevel: IUniform; - }; - aomap: { - aoMap: IUniform; - aoMapIntensity: IUniform; - }; - lightmap: { - lightMap: IUniform; - lightMapIntensity: IUniform; - }; - emissivemap: { - emissiveMap: IUniform; - }; - bumpmap: { - bumpMap: IUniform; - bumpScale: IUniform; - }; - normalmap: { - normalMap: IUniform; - normalScale: IUniform; - }; - displacementmap: { - displacementMap: IUniform; - displacementScale: IUniform; - displacementBias: IUniform; - }; - roughnessmap: { - roughnessMap: IUniform; - }; - metalnessmap: { - metalnessMap: IUniform; - }; - gradientmap: { - gradientMap: IUniform; - }; - fog: { - fogDensity: IUniform; - fogNear: IUniform; - fogFar: IUniform; - fogColor: IUniform; - }; - lights: { - ambientLightColor: IUniform; - directionalLights: { - value: any[]; - properties: { - direction: {}; - color: {}; - shadow: {}; - shadowBias: {}; - shadowRadius: {}; - shadowMapSize: {}; - }; - }; - directionalShadowMap: IUniform; - directionalShadowMatrix: IUniform; - spotLights: { - value: any[]; - properties: { - color: {}; - position: {}; - direction: {}; - distance: {}; - coneCos: {}; - penumbraCos: {}; - decay: {}; - shadow: {}; - shadowBias: {}; - shadowRadius: {}; - shadowMapSize: {}; - }; - }; - spotShadowMap: IUniform; - spotShadowMatrix: IUniform; - pointLights: { - value: any[]; - properties: { - color: {}; - position: {}; - decay: {}; - distance: {}; - shadow: {}; - shadowBias: {}; - shadowRadius: {}; - shadowMapSize: {}; - }; - }; - pointShadowMap: IUniform; - pointShadowMatrix: IUniform; - hemisphereLights: { - value: any[]; - properties: { - direction: {}; - skycolor: {}; - groundColor: {}; - }; - }; - rectAreaLights: { - value: any[]; - properties: { - color: {}; - position: {}; - width: {}; - height: {}; - }; - }; - }; - points: { - diffuse: IUniform; - opacity: IUniform; - size: IUniform; - scale: IUniform; - map: IUniform; - uvTransform: IUniform; - }; -}; diff --git a/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.js b/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.js deleted file mode 100644 index 5ff270e4ed..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/UniformsLib.js +++ /dev/null @@ -1,202 +0,0 @@ -import { Color } from '../../math/Color.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Matrix3 } from '../../math/Matrix3.js'; - -/** - * Uniforms library for shared webgl shaders - */ - -var UniformsLib = { - - common: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - - map: { value: null }, - uvTransform: { value: new Matrix3() }, - - alphaMap: { value: null }, - - }, - - specularmap: { - - specularMap: { value: null }, - - }, - - envmap: { - - envMap: { value: null }, - flipEnvMap: { value: - 1 }, - reflectivity: { value: 1.0 }, - refractionRatio: { value: 0.98 }, - maxMipLevel: { value: 0 } - - }, - - aomap: { - - aoMap: { value: null }, - aoMapIntensity: { value: 1 } - - }, - - lightmap: { - - lightMap: { value: null }, - lightMapIntensity: { value: 1 } - - }, - - emissivemap: { - - emissiveMap: { value: null } - - }, - - bumpmap: { - - bumpMap: { value: null }, - bumpScale: { value: 1 } - - }, - - normalmap: { - - normalMap: { value: null }, - normalScale: { value: new Vector2( 1, 1 ) } - - }, - - displacementmap: { - - displacementMap: { value: null }, - displacementScale: { value: 1 }, - displacementBias: { value: 0 } - - }, - - roughnessmap: { - - roughnessMap: { value: null } - - }, - - metalnessmap: { - - metalnessMap: { value: null } - - }, - - gradientmap: { - - gradientMap: { value: null } - - }, - - fog: { - - fogDensity: { value: 0.00025 }, - fogNear: { value: 1 }, - fogFar: { value: 2000 }, - fogColor: { value: new Color( 0xffffff ) } - - }, - - lights: { - - ambientLightColor: { value: [] }, - - lightProbe: { value: [] }, - - directionalLights: { value: [], properties: { - direction: {}, - color: {}, - - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - directionalShadowMap: { value: [] }, - directionalShadowMatrix: { value: [] }, - - spotLights: { value: [], properties: { - color: {}, - position: {}, - direction: {}, - distance: {}, - coneCos: {}, - penumbraCos: {}, - decay: {}, - - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {} - } }, - - spotShadowMap: { value: [] }, - spotShadowMatrix: { value: [] }, - - pointLights: { value: [], properties: { - color: {}, - position: {}, - decay: {}, - distance: {}, - - shadow: {}, - shadowBias: {}, - shadowRadius: {}, - shadowMapSize: {}, - shadowCameraNear: {}, - shadowCameraFar: {} - } }, - - pointShadowMap: { value: [] }, - pointShadowMatrix: { value: [] }, - - hemisphereLights: { value: [], properties: { - direction: {}, - skyColor: {}, - groundColor: {} - } }, - - // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src - rectAreaLights: { value: [], properties: { - color: {}, - position: {}, - width: {}, - height: {} - } } - - }, - - points: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - size: { value: 1.0 }, - scale: { value: 1.0 }, - map: { value: null }, - uvTransform: { value: new Matrix3() } - - }, - - sprite: { - - diffuse: { value: new Color( 0xeeeeee ) }, - opacity: { value: 1.0 }, - center: { value: new Vector2( 0.5, 0.5 ) }, - rotation: { value: 0.0 }, - map: { value: null }, - uvTransform: { value: new Matrix3() } - - } - -}; - -export { UniformsLib }; diff --git a/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.d.ts b/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.d.ts deleted file mode 100644 index c8118b8f88..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function cloneUniforms( uniforms_src: any ): any; -export function mergeUniforms( uniforms: any[] ): any; - -export namespace UniformsUtils { - export { - mergeUniforms as merge, - cloneUniforms as clone, - }; -} diff --git a/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.js b/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.js deleted file mode 100644 index a9fed401db..0000000000 --- a/cases/esbuild-three/src/base/renderers/shaders/UniformsUtils.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Uniform Utilities - */ - -export function cloneUniforms( src ) { - - var dst = {}; - - for ( var u in src ) { - - dst[ u ] = {}; - - for ( var p in src[ u ] ) { - - var property = src[ u ][ p ]; - - if ( property && ( property.isColor || - property.isMatrix3 || property.isMatrix4 || - property.isVector2 || property.isVector3 || property.isVector4 || - property.isTexture ) ) { - - dst[ u ][ p ] = property.clone(); - - } else if ( Array.isArray( property ) ) { - - dst[ u ][ p ] = property.slice(); - - } else { - - dst[ u ][ p ] = property; - - } - - } - - } - - return dst; - -} - -export function mergeUniforms( uniforms ) { - - var merged = {}; - - for ( var u = 0; u < uniforms.length; u ++ ) { - - var tmp = cloneUniforms( uniforms[ u ] ); - - for ( var p in tmp ) { - - merged[ p ] = tmp[ p ]; - - } - - } - - return merged; - -} - -// Legacy - -var UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms }; - -export { UniformsUtils }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.d.ts deleted file mode 100644 index 0ffe0fd77c..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class WebGLAnimation { - - start(): void; - - stop(): void; - - setAnimationLoop( callback: Function ): void; - - setContext( value: WebGLRenderingContext | WebGL2RenderingContext ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.js deleted file mode 100644 index 3943d991c8..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLAnimation.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLAnimation() { - - var context = null; - var isAnimating = false; - var animationLoop = null; - - function onAnimationFrame( time, frame ) { - - if ( isAnimating === false ) return; - - animationLoop( time, frame ); - - context.requestAnimationFrame( onAnimationFrame ); - - } - - return { - - start: function () { - - if ( isAnimating === true ) return; - if ( animationLoop === null ) return; - - context.requestAnimationFrame( onAnimationFrame ); - - isAnimating = true; - - }, - - stop: function () { - - isAnimating = false; - - }, - - setAnimationLoop: function ( callback ) { - - animationLoop = callback; - - }, - - setContext: function ( value ) { - - context = value; - - } - - }; - -} - -export { WebGLAnimation }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.d.ts deleted file mode 100644 index 06e21a59ad..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export class WebGLAttributes { - - constructor( gl: WebGLRenderingContext | WebGL2RenderingContext ); - - get( attribute: any ): any; - - remove( attribute: any ): void; - - update( attribute: any, bufferType: Array ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.js deleted file mode 100644 index 586ef5853c..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLAttributes.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLAttributes( gl ) { - - var buffers = new WeakMap(); - - function createBuffer( attribute, bufferType ) { - - var array = attribute.array; - var usage = attribute.dynamic ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW; - - var buffer = gl.createBuffer(); - - gl.bindBuffer( bufferType, buffer ); - gl.bufferData( bufferType, array, usage ); - - attribute.onUploadCallback(); - - var type = gl.FLOAT; - - if ( array instanceof Float32Array ) { - - type = gl.FLOAT; - - } else if ( array instanceof Float64Array ) { - - console.warn( 'THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.' ); - - } else if ( array instanceof Uint16Array ) { - - type = gl.UNSIGNED_SHORT; - - } else if ( array instanceof Int16Array ) { - - type = gl.SHORT; - - } else if ( array instanceof Uint32Array ) { - - type = gl.UNSIGNED_INT; - - } else if ( array instanceof Int32Array ) { - - type = gl.INT; - - } else if ( array instanceof Int8Array ) { - - type = gl.BYTE; - - } else if ( array instanceof Uint8Array ) { - - type = gl.UNSIGNED_BYTE; - - } - - return { - buffer: buffer, - type: type, - bytesPerElement: array.BYTES_PER_ELEMENT, - version: attribute.version - }; - - } - - function updateBuffer( buffer, attribute, bufferType ) { - - var array = attribute.array; - var updateRange = attribute.updateRange; - - gl.bindBuffer( bufferType, buffer ); - - if ( attribute.dynamic === false ) { - - gl.bufferData( bufferType, array, gl.STATIC_DRAW ); - - } else if ( updateRange.count === - 1 ) { - - // Not using update ranges - - gl.bufferSubData( bufferType, 0, array ); - - } else if ( updateRange.count === 0 ) { - - console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' ); - - } else { - - gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, - array.subarray( updateRange.offset, updateRange.offset + updateRange.count ) ); - - updateRange.count = - 1; // reset range - - } - - } - - // - - function get( attribute ) { - - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - - return buffers.get( attribute ); - - } - - function remove( attribute ) { - - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - - var data = buffers.get( attribute ); - - if ( data ) { - - gl.deleteBuffer( data.buffer ); - - buffers.delete( attribute ); - - } - - } - - function update( attribute, bufferType ) { - - if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data; - - var data = buffers.get( attribute ); - - if ( data === undefined ) { - - buffers.set( attribute, createBuffer( attribute, bufferType ) ); - - } else if ( data.version < attribute.version ) { - - updateBuffer( data.buffer, attribute, bufferType ); - - data.version = attribute.version; - - } - - } - - return { - - get: get, - remove: remove, - update: update - - }; - -} - - -export { WebGLAttributes }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.d.ts deleted file mode 100644 index 2cc24caced..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -import { Color } from "../../math/Color.js"; -import { WebGLRenderer } from "../WebGLRenderer.js"; -import { WebGLState } from "./WebGLState.js"; -import { WebGLObjects } from "./WebGLObjects.js"; -import { WebGLRenderLists } from "./WebGLRenderLists.js"; -import { Scene } from "../../scenes/Scene.js"; - -export class WebGLBackground { - - constructor( renderer: WebGLRenderer, state: WebGLState, objects: WebGLObjects, premultipliedAlpha: any ); - - getClearColor(): void; - setClearColor( color: Color, alpha: any ): void; - getClearAlpha(): void; - setClearAlpha( alpha: any ): void; - render( renderList: WebGLRenderLists, scene: Scene, camera: any, forceClear: any ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.js deleted file mode 100644 index 95a4f0677f..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLBackground.js +++ /dev/null @@ -1,223 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { BackSide, FrontSide } from '../../constants.js'; -import { BoxBufferGeometry } from '../../geometries/BoxGeometry.js'; -import { PlaneBufferGeometry } from '../../geometries/PlaneGeometry.js'; -import { ShaderMaterial } from '../../materials/ShaderMaterial.js'; -import { Color } from '../../math/Color.js'; -import { Mesh } from '../../objects/Mesh.js'; -import { ShaderLib } from '../shaders/ShaderLib.js'; -import { cloneUniforms } from '../shaders/UniformsUtils.js'; - -function WebGLBackground( renderer, state, objects, premultipliedAlpha ) { - - var clearColor = new Color( 0x000000 ); - var clearAlpha = 0; - - var planeMesh; - var boxMesh; - // Store the current background texture and its `version` - // so we can recompile the material accordingly. - var currentBackground = null; - var currentBackgroundVersion = 0; - - function render( renderList, scene, camera, forceClear ) { - - var background = scene.background; - - // Ignore background in AR - // TODO: Reconsider this. - - var vr = renderer.vr; - var session = vr.getSession && vr.getSession(); - - if ( session && session.environmentBlendMode === 'additive' ) { - - background = null; - - } - - if ( background === null ) { - - setClear( clearColor, clearAlpha ); - currentBackground = null; - currentBackgroundVersion = 0; - - } else if ( background && background.isColor ) { - - setClear( background, 1 ); - forceClear = true; - currentBackground = null; - currentBackgroundVersion = 0; - - } - - if ( renderer.autoClear || forceClear ) { - - renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil ); - - } - - if ( background && ( background.isCubeTexture || background.isWebGLRenderTargetCube ) ) { - - if ( boxMesh === undefined ) { - - boxMesh = new Mesh( - new BoxBufferGeometry( 1, 1, 1 ), - new ShaderMaterial( { - type: 'BackgroundCubeMaterial', - uniforms: cloneUniforms( ShaderLib.cube.uniforms ), - vertexShader: ShaderLib.cube.vertexShader, - fragmentShader: ShaderLib.cube.fragmentShader, - side: BackSide, - depthTest: false, - depthWrite: false, - fog: false - } ) - ); - - boxMesh.geometry.removeAttribute( 'normal' ); - boxMesh.geometry.removeAttribute( 'uv' ); - - boxMesh.onBeforeRender = function ( renderer, scene, camera ) { - - this.matrixWorld.copyPosition( camera.matrixWorld ); - - }; - - // enable code injection for non-built-in material - Object.defineProperty( boxMesh.material, 'map', { - - get: function () { - - return this.uniforms.tCube.value; - - } - - } ); - - objects.update( boxMesh ); - - } - - var texture = background.isWebGLRenderTargetCube ? background.texture : background; - boxMesh.material.uniforms.tCube.value = texture; - boxMesh.material.uniforms.tFlip.value = ( background.isWebGLRenderTargetCube ) ? 1 : - 1; - - if ( currentBackground !== background || - currentBackgroundVersion !== texture.version ) { - - boxMesh.material.needsUpdate = true; - - currentBackground = background; - currentBackgroundVersion = texture.version; - - } - - // push to the pre-sorted opaque render list - renderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null ); - - } else if ( background && background.isTexture ) { - - if ( planeMesh === undefined ) { - - planeMesh = new Mesh( - new PlaneBufferGeometry( 2, 2 ), - new ShaderMaterial( { - type: 'BackgroundMaterial', - uniforms: cloneUniforms( ShaderLib.background.uniforms ), - vertexShader: ShaderLib.background.vertexShader, - fragmentShader: ShaderLib.background.fragmentShader, - side: FrontSide, - depthTest: false, - depthWrite: false, - fog: false - } ) - ); - - planeMesh.geometry.removeAttribute( 'normal' ); - - // enable code injection for non-built-in material - Object.defineProperty( planeMesh.material, 'map', { - - get: function () { - - return this.uniforms.t2D.value; - - } - - } ); - - objects.update( planeMesh ); - - } - - planeMesh.material.uniforms.t2D.value = background; - - if ( background.matrixAutoUpdate === true ) { - - background.updateMatrix(); - - } - - planeMesh.material.uniforms.uvTransform.value.copy( background.matrix ); - - if ( currentBackground !== background || - currentBackgroundVersion !== background.version ) { - - planeMesh.material.needsUpdate = true; - - currentBackground = background; - currentBackgroundVersion = background.version; - - } - - - // push to the pre-sorted opaque render list - renderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null ); - - } - - } - - function setClear( color, alpha ) { - - state.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha ); - - } - - return { - - getClearColor: function () { - - return clearColor; - - }, - setClearColor: function ( color, alpha ) { - - clearColor.set( color ); - clearAlpha = alpha !== undefined ? alpha : 1; - setClear( clearColor, clearAlpha ); - - }, - getClearAlpha: function () { - - return clearAlpha; - - }, - setClearAlpha: function ( alpha ) { - - clearAlpha = alpha; - setClear( clearColor, clearAlpha ); - - }, - render: render - - }; - -} - - -export { WebGLBackground }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.d.ts deleted file mode 100644 index 974f4a4fcb..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Renderers / WebGL ///////////////////////////////////////////////////////////////////// -export class WebGLBufferRenderer { - - constructor( _gl: WebGLRenderingContext, extensions: any, _infoRender: any ); - - setMode( value: any ): void; - render( start: any, count: number ): void; - renderInstances( geometry: any ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.js deleted file mode 100644 index c630098bfa..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLBufferRenderer.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLBufferRenderer( gl, extensions, info, capabilities ) { - - var mode; - - function setMode( value ) { - - mode = value; - - } - - function render( start, count ) { - - gl.drawArrays( mode, start, count ); - - info.update( count, mode ); - - } - - function renderInstances( geometry, start, count ) { - - var extension, methodName; - - if ( capabilities.isWebGL2 ) { - - extension = gl; - methodName = 'drawArraysInstanced'; - - } else { - - extension = extensions.get( 'ANGLE_instanced_arrays' ); - methodName = 'drawArraysInstancedANGLE'; - - if ( extension === null ) { - - console.error( 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; - - } - - } - - extension[ methodName ]( mode, start, count, geometry.maxInstancedCount ); - - info.update( count, mode, geometry.maxInstancedCount ); - - } - - // - - this.setMode = setMode; - this.render = render; - this.renderInstances = renderInstances; - -} - - -export { WebGLBufferRenderer }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.d.ts deleted file mode 100644 index 37a3085696..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export interface WebGLCapabilitiesParameters { - precision?: any; - logarithmicDepthBuffer?: any; -} - -export class WebGLCapabilities { - - constructor( - gl: WebGLRenderingContext, - extensions: any, - parameters: WebGLCapabilitiesParameters - ); - - precision: any; - logarithmicDepthBuffer: any; - maxTextures: any; - maxVertexTextures: any; - maxTextureSize: any; - maxCubemapSize: any; - maxAttributes: any; - maxVertexUniforms: any; - maxVaryings: any; - maxFragmentUniforms: any; - vertexTextures: any; - floatFragmentTextures: any; - floatVertexTextures: any; - - getMaxAnisotropy(): number; - getMaxPrecision( precision: string ): string; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.js deleted file mode 100644 index 4eafd2132f..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLCapabilities.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLCapabilities( gl, extensions, parameters ) { - - var maxAnisotropy; - - function getMaxAnisotropy() { - - if ( maxAnisotropy !== undefined ) return maxAnisotropy; - - var extension = extensions.get( 'EXT_texture_filter_anisotropic' ); - - if ( extension !== null ) { - - maxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ); - - } else { - - maxAnisotropy = 0; - - } - - return maxAnisotropy; - - } - - function getMaxPrecision( precision ) { - - if ( precision === 'highp' ) { - - if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 && - gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) { - - return 'highp'; - - } - - precision = 'mediump'; - - } - - if ( precision === 'mediump' ) { - - if ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 && - gl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) { - - return 'mediump'; - - } - - } - - return 'lowp'; - - } - - var isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext; - - var precision = parameters.precision !== undefined ? parameters.precision : 'highp'; - var maxPrecision = getMaxPrecision( precision ); - - if ( maxPrecision !== precision ) { - - console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' ); - precision = maxPrecision; - - } - - var logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true; - - var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); - var maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ); - var maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE ); - var maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE ); - - var maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); - var maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS ); - var maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS ); - var maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS ); - - var vertexTextures = maxVertexTextures > 0; - var floatFragmentTextures = isWebGL2 || !! extensions.get( 'OES_texture_float' ); - var floatVertexTextures = vertexTextures && floatFragmentTextures; - - var maxSamples = isWebGL2 ? gl.getParameter( gl.MAX_SAMPLES ) : 0; - - return { - - isWebGL2: isWebGL2, - - getMaxAnisotropy: getMaxAnisotropy, - getMaxPrecision: getMaxPrecision, - - precision: precision, - logarithmicDepthBuffer: logarithmicDepthBuffer, - - maxTextures: maxTextures, - maxVertexTextures: maxVertexTextures, - maxTextureSize: maxTextureSize, - maxCubemapSize: maxCubemapSize, - - maxAttributes: maxAttributes, - maxVertexUniforms: maxVertexUniforms, - maxVaryings: maxVaryings, - maxFragmentUniforms: maxFragmentUniforms, - - vertexTextures: vertexTextures, - floatFragmentTextures: floatFragmentTextures, - floatVertexTextures: floatVertexTextures, - - maxSamples: maxSamples - - }; - -} - - -export { WebGLCapabilities }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.d.ts deleted file mode 100644 index fa93aaadbb..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Camera } from './../../cameras/Camera'; - -export class WebGLClipping { - - uniform: { value: any; needsUpdate: boolean }; - numPlanes: number; - - init( planes: any[], enableLocalClipping: boolean, camera: Camera ): boolean; - beginShadows(): void; - endShadows(): void; - setState( - planes: any[], - clipShadows: boolean, - camera: Camera, - cache: boolean, - fromCache: boolean - ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.js deleted file mode 100644 index 9107fbc635..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLClipping.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * @author tschw - */ - -import { Matrix3 } from '../../math/Matrix3.js'; -import { Plane } from '../../math/Plane.js'; - -function WebGLClipping() { - - var scope = this, - - globalState = null, - numGlobalPlanes = 0, - localClippingEnabled = false, - renderingShadows = false, - - plane = new Plane(), - viewNormalMatrix = new Matrix3(), - - uniform = { value: null, needsUpdate: false }; - - this.uniform = uniform; - this.numPlanes = 0; - this.numIntersection = 0; - - this.init = function ( planes, enableLocalClipping, camera ) { - - var enabled = - planes.length !== 0 || - enableLocalClipping || - // enable state of previous frame - the clipping code has to - // run another frame in order to reset the state: - numGlobalPlanes !== 0 || - localClippingEnabled; - - localClippingEnabled = enableLocalClipping; - - globalState = projectPlanes( planes, camera, 0 ); - numGlobalPlanes = planes.length; - - return enabled; - - }; - - this.beginShadows = function () { - - renderingShadows = true; - projectPlanes( null ); - - }; - - this.endShadows = function () { - - renderingShadows = false; - resetGlobalState(); - - }; - - this.setState = function ( planes, clipIntersection, clipShadows, camera, cache, fromCache ) { - - if ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) { - - // there's no local clipping - - if ( renderingShadows ) { - - // there's no global clipping - - projectPlanes( null ); - - } else { - - resetGlobalState(); - - } - - } else { - - var nGlobal = renderingShadows ? 0 : numGlobalPlanes, - lGlobal = nGlobal * 4, - - dstArray = cache.clippingState || null; - - uniform.value = dstArray; // ensure unique state - - dstArray = projectPlanes( planes, camera, lGlobal, fromCache ); - - for ( var i = 0; i !== lGlobal; ++ i ) { - - dstArray[ i ] = globalState[ i ]; - - } - - cache.clippingState = dstArray; - this.numIntersection = clipIntersection ? this.numPlanes : 0; - this.numPlanes += nGlobal; - - } - - - }; - - function resetGlobalState() { - - if ( uniform.value !== globalState ) { - - uniform.value = globalState; - uniform.needsUpdate = numGlobalPlanes > 0; - - } - - scope.numPlanes = numGlobalPlanes; - scope.numIntersection = 0; - - } - - function projectPlanes( planes, camera, dstOffset, skipTransform ) { - - var nPlanes = planes !== null ? planes.length : 0, - dstArray = null; - - if ( nPlanes !== 0 ) { - - dstArray = uniform.value; - - if ( skipTransform !== true || dstArray === null ) { - - var flatSize = dstOffset + nPlanes * 4, - viewMatrix = camera.matrixWorldInverse; - - viewNormalMatrix.getNormalMatrix( viewMatrix ); - - if ( dstArray === null || dstArray.length < flatSize ) { - - dstArray = new Float32Array( flatSize ); - - } - - for ( var i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) { - - plane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix ); - - plane.normal.toArray( dstArray, i4 ); - dstArray[ i4 + 3 ] = plane.constant; - - } - - } - - uniform.value = dstArray; - uniform.needsUpdate = true; - - } - - scope.numPlanes = nPlanes; - - return dstArray; - - } - -} - - -export { WebGLClipping }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.d.ts deleted file mode 100644 index 50a094cc7d..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class WebGLExtensions { - - constructor( gl: WebGLRenderingContext ); - - get( name: string ): any; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.js deleted file mode 100644 index bff3fd828a..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLExtensions.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLExtensions( gl ) { - - var extensions = {}; - - return { - - get: function ( name ) { - - if ( extensions[ name ] !== undefined ) { - - return extensions[ name ]; - - } - - var extension; - - switch ( name ) { - - case 'WEBGL_depth_texture': - extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' ); - break; - - case 'EXT_texture_filter_anisotropic': - extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); - break; - - case 'WEBGL_compressed_texture_s3tc': - extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' ); - break; - - case 'WEBGL_compressed_texture_pvrtc': - extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' ); - break; - - default: - extension = gl.getExtension( name ); - - } - - if ( extension === null ) { - - console.warn( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' ); - - } - - extensions[ name ] = extension; - - return extension; - - } - - }; - -} - - -export { WebGLExtensions }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.d.ts deleted file mode 100644 index cf1d59d57c..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class WebGLGeometries { - - constructor( gl: WebGLRenderingContext, extensions: any, _infoRender: any ); - - get( object: any ): any; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.js deleted file mode 100644 index 281a075b7b..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLGeometries.js +++ /dev/null @@ -1,216 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../core/BufferAttribute.js'; -import { BufferGeometry } from '../../core/BufferGeometry.js'; -import { arrayMax } from '../../utils.js'; - -function WebGLGeometries( gl, attributes, info ) { - - var geometries = new WeakMap(); - var wireframeAttributes = new WeakMap(); - - function onGeometryDispose( event ) { - - var geometry = event.target; - var buffergeometry = geometries.get( geometry ); - - if ( buffergeometry.index !== null ) { - - attributes.remove( buffergeometry.index ); - - } - - for ( var name in buffergeometry.attributes ) { - - attributes.remove( buffergeometry.attributes[ name ] ); - - } - - geometry.removeEventListener( 'dispose', onGeometryDispose ); - - geometries.delete( geometry ); - - var attribute = wireframeAttributes.get( buffergeometry ); - - if ( attribute ) { - - attributes.remove( attribute ); - wireframeAttributes.delete( buffergeometry ); - - } - - // - - info.memory.geometries --; - - } - - function get( object, geometry ) { - - var buffergeometry = geometries.get( geometry ); - - if ( buffergeometry ) return buffergeometry; - - geometry.addEventListener( 'dispose', onGeometryDispose ); - - if ( geometry.isBufferGeometry ) { - - buffergeometry = geometry; - - } else if ( geometry.isGeometry ) { - - if ( geometry._bufferGeometry === undefined ) { - - geometry._bufferGeometry = new BufferGeometry().setFromObject( object ); - - } - - buffergeometry = geometry._bufferGeometry; - - } - - geometries.set( geometry, buffergeometry ); - - info.memory.geometries ++; - - return buffergeometry; - - } - - function update( geometry ) { - - var index = geometry.index; - var geometryAttributes = geometry.attributes; - - if ( index !== null ) { - - attributes.update( index, gl.ELEMENT_ARRAY_BUFFER ); - - } - - for ( var name in geometryAttributes ) { - - attributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER ); - - } - - // morph targets - - var morphAttributes = geometry.morphAttributes; - - for ( var name in morphAttributes ) { - - var array = morphAttributes[ name ]; - - for ( var i = 0, l = array.length; i < l; i ++ ) { - - attributes.update( array[ i ], gl.ARRAY_BUFFER ); - - } - - } - - } - - function updateWireframeAttribute( geometry ) { - - var indices = []; - - var geometryIndex = geometry.index; - var geometryPosition = geometry.attributes.position; - var version = 0; - - if ( geometryIndex !== null ) { - - var array = geometryIndex.array; - version = geometryIndex.version; - - for ( var i = 0, l = array.length; i < l; i += 3 ) { - - var a = array[ i + 0 ]; - var b = array[ i + 1 ]; - var c = array[ i + 2 ]; - - indices.push( a, b, b, c, c, a ); - - } - - } else { - - var array = geometryPosition.array; - version = geometryPosition.version; - - for ( var i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) { - - var a = i + 0; - var b = i + 1; - var c = i + 2; - - indices.push( a, b, b, c, c, a ); - - } - - } - - var attribute = new ( arrayMax( indices ) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 ); - attribute.version = version; - - attributes.update( attribute, gl.ELEMENT_ARRAY_BUFFER ); - - // - - var previousAttribute = wireframeAttributes.get( geometry ); - - if ( previousAttribute ) attributes.remove( previousAttribute ); - - // - - wireframeAttributes.set( geometry, attribute ); - - } - - function getWireframeAttribute( geometry ) { - - var currentAttribute = wireframeAttributes.get( geometry ); - - if ( currentAttribute ) { - - var geometryIndex = geometry.index; - - if ( geometryIndex !== null ) { - - // if the attribute is obsolete, create a new one - - if ( currentAttribute.version < geometryIndex.version ) { - - updateWireframeAttribute( geometry ); - - } - - } - - } else { - - updateWireframeAttribute( geometry ); - - } - - return wireframeAttributes.get( geometry ); - - } - - return { - - get: get, - update: update, - - getWireframeAttribute: getWireframeAttribute - - }; - -} - - -export { WebGLGeometries }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.d.ts deleted file mode 100644 index 21a2b17bb7..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export class WebGLIndexedBufferRenderer { - - constructor( gl: WebGLRenderingContext, properties: any, info: any ); - - setMode( value: any ): void; - setIndex( index: any ): void; - render( start: any, count: number ): void; - renderInstances( geometry: any, start: any, count: number ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.js deleted file mode 100644 index a3d4322f02..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLIndexedBufferRenderer.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLIndexedBufferRenderer( gl, extensions, info, capabilities ) { - - var mode; - - function setMode( value ) { - - mode = value; - - } - - var type, bytesPerElement; - - function setIndex( value ) { - - type = value.type; - bytesPerElement = value.bytesPerElement; - - } - - function render( start, count ) { - - gl.drawElements( mode, count, type, start * bytesPerElement ); - - info.update( count, mode ); - - } - - function renderInstances( geometry, start, count ) { - - var extension, methodName; - - if ( capabilities.isWebGL2 ) { - - extension = gl; - methodName = 'drawElementsInstanced'; - - } else { - - extension = extensions.get( 'ANGLE_instanced_arrays' ); - methodName = 'drawElementsInstancedANGLE'; - - if ( extension === null ) { - - console.error( 'THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.' ); - return; - - } - - } - - extension[ methodName ]( mode, count, type, start * bytesPerElement, geometry.maxInstancedCount ); - - info.update( count, mode, geometry.maxInstancedCount ); - - } - - // - - this.setMode = setMode; - this.setIndex = setIndex; - this.render = render; - this.renderInstances = renderInstances; - -} - - -export { WebGLIndexedBufferRenderer }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.d.ts deleted file mode 100644 index f21fcbcd6b..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WebGLProgram } from './WebGLProgram'; - -/** - * An object with a series of statistical information about the graphics board memory and the rendering process. - */ -export class WebGLInfo { - - autoReset: boolean; - memory: { - geometries: number; - textures: number; - }; - programs: WebGLProgram[] | null; - render: { - calls: number; - frame: number; - lines: number; - points: number; - triangles: number; - }; - reset(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.js deleted file mode 100644 index de30b40a48..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLInfo.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - */ - -function WebGLInfo( gl ) { - - var memory = { - geometries: 0, - textures: 0 - }; - - var render = { - frame: 0, - calls: 0, - triangles: 0, - points: 0, - lines: 0 - }; - - function update( count, mode, instanceCount ) { - - instanceCount = instanceCount || 1; - - render.calls ++; - - switch ( mode ) { - - case gl.TRIANGLES: - render.triangles += instanceCount * ( count / 3 ); - break; - - case gl.TRIANGLE_STRIP: - case gl.TRIANGLE_FAN: - render.triangles += instanceCount * ( count - 2 ); - break; - - case gl.LINES: - render.lines += instanceCount * ( count / 2 ); - break; - - case gl.LINE_STRIP: - render.lines += instanceCount * ( count - 1 ); - break; - - case gl.LINE_LOOP: - render.lines += instanceCount * count; - break; - - case gl.POINTS: - render.points += instanceCount * count; - break; - - default: - console.error( 'THREE.WebGLInfo: Unknown draw mode:', mode ); - break; - - } - - } - - function reset() { - - render.frame ++; - render.calls = 0; - render.triangles = 0; - render.points = 0; - render.lines = 0; - - } - - return { - memory: memory, - render: render, - programs: null, - autoReset: true, - reset: reset, - update: update - }; - -} - - -export { WebGLInfo }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.d.ts deleted file mode 100644 index 6665944165..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class WebGLLights { - - constructor( gl: WebGLRenderingContext, properties: any, info: any ); - - get( light: any ): any; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.js deleted file mode 100644 index 78d942f44d..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLLights.js +++ /dev/null @@ -1,409 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Color } from '../../math/Color.js'; -import { Matrix4 } from '../../math/Matrix4.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Vector3 } from '../../math/Vector3.js'; - -function UniformsCache() { - - var lights = {}; - - return { - - get: function ( light ) { - - if ( lights[ light.id ] !== undefined ) { - - return lights[ light.id ]; - - } - - var uniforms; - - switch ( light.type ) { - - case 'DirectionalLight': - uniforms = { - direction: new Vector3(), - color: new Color(), - - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; - - case 'SpotLight': - uniforms = { - position: new Vector3(), - direction: new Vector3(), - color: new Color(), - distance: 0, - coneCos: 0, - penumbraCos: 0, - decay: 0, - - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2() - }; - break; - - case 'PointLight': - uniforms = { - position: new Vector3(), - color: new Color(), - distance: 0, - decay: 0, - - shadow: false, - shadowBias: 0, - shadowRadius: 1, - shadowMapSize: new Vector2(), - shadowCameraNear: 1, - shadowCameraFar: 1000 - }; - break; - - case 'HemisphereLight': - uniforms = { - direction: new Vector3(), - skyColor: new Color(), - groundColor: new Color() - }; - break; - - case 'RectAreaLight': - uniforms = { - color: new Color(), - position: new Vector3(), - halfWidth: new Vector3(), - halfHeight: new Vector3() - // TODO (abelnation): set RectAreaLight shadow uniforms - }; - break; - - } - - lights[ light.id ] = uniforms; - - return uniforms; - - } - - }; - -} - -var nextVersion = 0; - -function shadowCastingLightsFirst( lightA, lightB ) { - - return ( lightB.castShadow ? 1 : 0 ) - ( lightA.castShadow ? 1 : 0 ); - -} - -function WebGLLights() { - - var cache = new UniformsCache(); - - var state = { - - version: 0, - - hash: { - directionalLength: - 1, - pointLength: - 1, - spotLength: - 1, - rectAreaLength: - 1, - hemiLength: - 1, - - numDirectionalShadows: - 1, - numPointShadows: - 1, - numSpotShadows: - 1, - }, - - ambient: [ 0, 0, 0 ], - probe: [], - directional: [], - directionalShadowMap: [], - directionalShadowMatrix: [], - spot: [], - spotShadowMap: [], - spotShadowMatrix: [], - rectArea: [], - point: [], - pointShadowMap: [], - pointShadowMatrix: [], - hemi: [], - - numDirectionalShadows: - 1, - numPointShadows: - 1, - numSpotShadows: - 1 - - }; - - for ( var i = 0; i < 9; i ++ ) state.probe.push( new Vector3() ); - - var vector3 = new Vector3(); - var matrix4 = new Matrix4(); - var matrix42 = new Matrix4(); - - function setup( lights, shadows, camera ) { - - var r = 0, g = 0, b = 0; - - for ( var i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 ); - - var directionalLength = 0; - var pointLength = 0; - var spotLength = 0; - var rectAreaLength = 0; - var hemiLength = 0; - - var numDirectionalShadows = 0; - var numPointShadows = 0; - var numSpotShadows = 0; - - var viewMatrix = camera.matrixWorldInverse; - - lights.sort( shadowCastingLightsFirst ); - - for ( var i = 0, l = lights.length; i < l; i ++ ) { - - var light = lights[ i ]; - - var color = light.color; - var intensity = light.intensity; - var distance = light.distance; - - var shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null; - - if ( light.isAmbientLight ) { - - r += color.r * intensity; - g += color.g * intensity; - b += color.b * intensity; - - } else if ( light.isLightProbe ) { - - for ( var j = 0; j < 9; j ++ ) { - - state.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity ); - - } - - } else if ( light.isDirectionalLight ) { - - var uniforms = cache.get( light ); - - uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - vector3.setFromMatrixPosition( light.target.matrixWorld ); - uniforms.direction.sub( vector3 ); - uniforms.direction.transformDirection( viewMatrix ); - - uniforms.shadow = light.castShadow; - - if ( light.castShadow ) { - - var shadow = light.shadow; - - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; - - state.directionalShadowMap[ directionalLength ] = shadowMap; - state.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix; - - numDirectionalShadows ++; - - } - - state.directional[ directionalLength ] = uniforms; - - directionalLength ++; - - } else if ( light.isSpotLight ) { - - var uniforms = cache.get( light ); - - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); - - uniforms.color.copy( color ).multiplyScalar( intensity ); - uniforms.distance = distance; - - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - vector3.setFromMatrixPosition( light.target.matrixWorld ); - uniforms.direction.sub( vector3 ); - uniforms.direction.transformDirection( viewMatrix ); - - uniforms.coneCos = Math.cos( light.angle ); - uniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) ); - uniforms.decay = light.decay; - - uniforms.shadow = light.castShadow; - - if ( light.castShadow ) { - - var shadow = light.shadow; - - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; - - state.spotShadowMap[ spotLength ] = shadowMap; - state.spotShadowMatrix[ spotLength ] = light.shadow.matrix; - - numSpotShadows ++; - - } - - state.spot[ spotLength ] = uniforms; - - spotLength ++; - - } else if ( light.isRectAreaLight ) { - - var uniforms = cache.get( light ); - - // (a) intensity is the total visible light emitted - //uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) ); - - // (b) intensity is the brightness of the light - uniforms.color.copy( color ).multiplyScalar( intensity ); - - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); - - // extract local rotation of light to derive width/height half vectors - matrix42.identity(); - matrix4.copy( light.matrixWorld ); - matrix4.premultiply( viewMatrix ); - matrix42.extractRotation( matrix4 ); - - uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 ); - uniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 ); - - uniforms.halfWidth.applyMatrix4( matrix42 ); - uniforms.halfHeight.applyMatrix4( matrix42 ); - - // TODO (abelnation): RectAreaLight distance? - // uniforms.distance = distance; - - state.rectArea[ rectAreaLength ] = uniforms; - - rectAreaLength ++; - - } else if ( light.isPointLight ) { - - var uniforms = cache.get( light ); - - uniforms.position.setFromMatrixPosition( light.matrixWorld ); - uniforms.position.applyMatrix4( viewMatrix ); - - uniforms.color.copy( light.color ).multiplyScalar( light.intensity ); - uniforms.distance = light.distance; - uniforms.decay = light.decay; - - uniforms.shadow = light.castShadow; - - if ( light.castShadow ) { - - var shadow = light.shadow; - - uniforms.shadowBias = shadow.bias; - uniforms.shadowRadius = shadow.radius; - uniforms.shadowMapSize = shadow.mapSize; - uniforms.shadowCameraNear = shadow.camera.near; - uniforms.shadowCameraFar = shadow.camera.far; - - state.pointShadowMap[ pointLength ] = shadowMap; - state.pointShadowMatrix[ pointLength ] = light.shadow.matrix; - - numPointShadows ++; - - } - - state.point[ pointLength ] = uniforms; - - pointLength ++; - - } else if ( light.isHemisphereLight ) { - - var uniforms = cache.get( light ); - - uniforms.direction.setFromMatrixPosition( light.matrixWorld ); - uniforms.direction.transformDirection( viewMatrix ); - uniforms.direction.normalize(); - - uniforms.skyColor.copy( light.color ).multiplyScalar( intensity ); - uniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity ); - - state.hemi[ hemiLength ] = uniforms; - - hemiLength ++; - - } - - } - - state.ambient[ 0 ] = r; - state.ambient[ 1 ] = g; - state.ambient[ 2 ] = b; - - var hash = state.hash; - - if ( hash.directionalLength !== directionalLength || - hash.pointLength !== pointLength || - hash.spotLength !== spotLength || - hash.rectAreaLength !== rectAreaLength || - hash.hemiLength !== hemiLength || - hash.numDirectionalShadows !== numDirectionalShadows || - hash.numPointShadows !== numPointShadows || - hash.numSpotShadows !== numSpotShadows ) { - - state.directional.length = directionalLength; - state.spot.length = spotLength; - state.rectArea.length = rectAreaLength; - state.point.length = pointLength; - state.hemi.length = hemiLength; - - state.directionalShadowMap.length = numDirectionalShadows; - state.pointShadowMap.length = numPointShadows; - state.spotShadowMap.length = numSpotShadows; - state.directionalShadowMatrix.length = numDirectionalShadows; - state.pointShadowMatrix.length = numPointShadows; - state.spotShadowMatrix.length = numSpotShadows; - - hash.directionalLength = directionalLength; - hash.pointLength = pointLength; - hash.spotLength = spotLength; - hash.rectAreaLength = rectAreaLength; - hash.hemiLength = hemiLength; - - hash.numDirectionalShadows = numDirectionalShadows; - hash.numPointShadows = numPointShadows; - hash.numSpotShadows = numSpotShadows; - - state.version = nextVersion ++; - - } - - } - - return { - setup: setup, - state: state - }; - -} - - -export { WebGLLights }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.d.ts deleted file mode 100644 index 473112c04e..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Object3D } from '../../core/Object3D'; -import { BufferGeometry } from '../../core/BufferGeometry'; -import { Material } from '../../materials/Material'; -import { WebGLProgram } from './WebGLProgram'; - -export class WebGLMorphtargets { - - constructor( gl: WebGLRenderingContext ); - - update( object: Object3D, geometry: BufferGeometry, material: Material, program: WebGLProgram ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.js deleted file mode 100644 index 8a2ae10e82..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLMorphtargets.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function absNumericalSort( a, b ) { - - return Math.abs( b[ 1 ] ) - Math.abs( a[ 1 ] ); - -} - -function WebGLMorphtargets( gl ) { - - var influencesList = {}; - var morphInfluences = new Float32Array( 8 ); - - function update( object, geometry, material, program ) { - - var objectInfluences = object.morphTargetInfluences; - - var length = objectInfluences.length; - - var influences = influencesList[ geometry.id ]; - - if ( influences === undefined ) { - - // initialise list - - influences = []; - - for ( var i = 0; i < length; i ++ ) { - - influences[ i ] = [ i, 0 ]; - - } - - influencesList[ geometry.id ] = influences; - - } - - var morphTargets = material.morphTargets && geometry.morphAttributes.position; - var morphNormals = material.morphNormals && geometry.morphAttributes.normal; - - // Remove current morphAttributes - - for ( var i = 0; i < length; i ++ ) { - - var influence = influences[ i ]; - - if ( influence[ 1 ] !== 0 ) { - - if ( morphTargets ) geometry.removeAttribute( 'morphTarget' + i ); - if ( morphNormals ) geometry.removeAttribute( 'morphNormal' + i ); - - } - - } - - // Collect influences - - for ( var i = 0; i < length; i ++ ) { - - var influence = influences[ i ]; - - influence[ 0 ] = i; - influence[ 1 ] = objectInfluences[ i ]; - - } - - influences.sort( absNumericalSort ); - - // Add morphAttributes - - for ( var i = 0; i < 8; i ++ ) { - - var influence = influences[ i ]; - - if ( influence ) { - - var index = influence[ 0 ]; - var value = influence[ 1 ]; - - if ( value ) { - - if ( morphTargets ) geometry.addAttribute( 'morphTarget' + i, morphTargets[ index ] ); - if ( morphNormals ) geometry.addAttribute( 'morphNormal' + i, morphNormals[ index ] ); - - morphInfluences[ i ] = value; - continue; - - } - - } - - morphInfluences[ i ] = 0; - - } - - program.getUniforms().setValue( gl, 'morphTargetInfluences', morphInfluences ); - - } - - return { - - update: update - - }; - -} - - -export { WebGLMorphtargets }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.d.ts deleted file mode 100644 index 534b7a8245..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class WebGLObjects { - - constructor( gl: WebGLRenderingContext, properties: any, info: any ); - - getAttributeBuffer( attribute: any ): any; - getWireframeAttribute( geometry: any ): any; - update( object: any ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.js deleted file mode 100644 index 8a2528e27f..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLObjects.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLObjects( geometries, info ) { - - var updateList = {}; - - function update( object ) { - - var frame = info.render.frame; - - var geometry = object.geometry; - var buffergeometry = geometries.get( object, geometry ); - - // Update once per frame - - if ( updateList[ buffergeometry.id ] !== frame ) { - - if ( geometry.isGeometry ) { - - buffergeometry.updateFromObject( object ); - - } - - geometries.update( buffergeometry ); - - updateList[ buffergeometry.id ] = frame; - - } - - return buffergeometry; - - } - - function dispose() { - - updateList = {}; - - } - - return { - - update: update, - dispose: dispose - - }; - -} - - -export { WebGLObjects }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.d.ts deleted file mode 100644 index 4da3e77ebc..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { WebGLRenderer, WebGLRendererParameters } from './../WebGLRenderer'; -import { ShaderMaterial } from './../../materials/ShaderMaterial'; -import { WebGLShader } from './WebGLShader'; -import { WebGLCapabilities } from './WebGLCapabilities'; -import { WebGLExtensions } from './WebGLExtensions'; -import { WebGLUniforms } from './WebGLUniforms'; - -export class WebGLProgram { - - constructor( - renderer: WebGLRenderer, - extensions: WebGLExtensions, - code: string, - material: ShaderMaterial, - shader: WebGLShader, - parameters: WebGLRendererParameters, - capabilities: WebGLCapabilities - ); - - id: number; - code: string; - usedTimes: number; - program: any; - vertexShader: WebGLShader; - fragmentShader: WebGLShader; - /** - * @deprecated Use {@link WebGLProgram#getUniforms getUniforms()} instead. - */ - uniforms: any; - /** - * @deprecated Use {@link WebGLProgram#getAttributes getAttributes()} instead. - */ - attributes: any; - - getUniforms(): WebGLUniforms; - getAttributes(): any; - destroy(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.js deleted file mode 100644 index 81b47a2866..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLProgram.js +++ /dev/null @@ -1,779 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { WebGLUniforms } from './WebGLUniforms.js'; -import { WebGLShader } from './WebGLShader.js'; -import { ShaderChunk } from '../shaders/ShaderChunk.js'; -import { NoToneMapping, AddOperation, MixOperation, MultiplyOperation, EquirectangularRefractionMapping, CubeRefractionMapping, SphericalReflectionMapping, EquirectangularReflectionMapping, CubeUVRefractionMapping, CubeUVReflectionMapping, CubeReflectionMapping, PCFSoftShadowMap, PCFShadowMap, VSMShadowMap, ACESFilmicToneMapping, CineonToneMapping, Uncharted2ToneMapping, ReinhardToneMapping, LinearToneMapping, GammaEncoding, RGBDEncoding, RGBM16Encoding, RGBM7Encoding, RGBEEncoding, sRGBEncoding, LinearEncoding, LogLuvEncoding } from '../../constants.js'; - -var programIdCount = 0; - -function addLineNumbers( string ) { - - var lines = string.split( '\n' ); - - for ( var i = 0; i < lines.length; i ++ ) { - - lines[ i ] = ( i + 1 ) + ': ' + lines[ i ]; - - } - - return lines.join( '\n' ); - -} - -function getEncodingComponents( encoding ) { - - switch ( encoding ) { - - case LinearEncoding: - return [ 'Linear', '( value )' ]; - case sRGBEncoding: - return [ 'sRGB', '( value )' ]; - case RGBEEncoding: - return [ 'RGBE', '( value )' ]; - case RGBM7Encoding: - return [ 'RGBM', '( value, 7.0 )' ]; - case RGBM16Encoding: - return [ 'RGBM', '( value, 16.0 )' ]; - case RGBDEncoding: - return [ 'RGBD', '( value, 256.0 )' ]; - case GammaEncoding: - return [ 'Gamma', '( value, float( GAMMA_FACTOR ) )' ]; - case LogLuvEncoding: - return [ 'LogLuv', '( value )' ]; - default: - throw new Error( 'unsupported encoding: ' + encoding ); - - } - -} - -function getShaderErrors( gl, shader, type ) { - - var status = gl.getShaderParameter( shader, gl.COMPILE_STATUS ); - var log = gl.getShaderInfoLog( shader ).trim(); - - if ( status && log === '' ) return ''; - - // --enable-privileged-webgl-extension - // console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) ); - - var source = gl.getShaderSource( shader ); - - return 'THREE.WebGLShader: gl.getShaderInfoLog() ' + type + '\n' + log + addLineNumbers( source ); - -} - -function getTexelDecodingFunction( functionName, encoding ) { - - var components = getEncodingComponents( encoding ); - return 'vec4 ' + functionName + '( vec4 value ) { return ' + components[ 0 ] + 'ToLinear' + components[ 1 ] + '; }'; - -} - -function getTexelEncodingFunction( functionName, encoding ) { - - var components = getEncodingComponents( encoding ); - return 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[ 0 ] + components[ 1 ] + '; }'; - -} - -function getToneMappingFunction( functionName, toneMapping ) { - - var toneMappingName; - - switch ( toneMapping ) { - - case LinearToneMapping: - toneMappingName = 'Linear'; - break; - - case ReinhardToneMapping: - toneMappingName = 'Reinhard'; - break; - - case Uncharted2ToneMapping: - toneMappingName = 'Uncharted2'; - break; - - case CineonToneMapping: - toneMappingName = 'OptimizedCineon'; - break; - - case ACESFilmicToneMapping: - toneMappingName = 'ACESFilmic'; - break; - - default: - throw new Error( 'unsupported toneMapping: ' + toneMapping ); - - } - - return 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }'; - -} - -function generateExtensions( extensions, parameters, rendererExtensions ) { - - extensions = extensions || {}; - - var chunks = [ - ( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '', - ( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '', - ( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '', - ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : '' - ]; - - return chunks.filter( filterEmptyLine ).join( '\n' ); - -} - -function generateDefines( defines ) { - - var chunks = []; - - for ( var name in defines ) { - - var value = defines[ name ]; - - if ( value === false ) continue; - - chunks.push( '#define ' + name + ' ' + value ); - - } - - return chunks.join( '\n' ); - -} - -function fetchAttributeLocations( gl, program ) { - - var attributes = {}; - - var n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES ); - - for ( var i = 0; i < n; i ++ ) { - - var info = gl.getActiveAttrib( program, i ); - var name = info.name; - - // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i ); - - attributes[ name ] = gl.getAttribLocation( program, name ); - - } - - return attributes; - -} - -function filterEmptyLine( string ) { - - return string !== ''; - -} - -function replaceLightNums( string, parameters ) { - - return string - .replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights ) - .replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights ) - .replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights ) - .replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights ) - .replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights ) - .replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows ) - .replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows ) - .replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows ); - -} - -function replaceClippingPlaneNums( string, parameters ) { - - return string - .replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes ) - .replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) ); - -} - -function parseIncludes( string ) { - - var pattern = /^[ \t]*#include +<([\w\d./]+)>/gm; - - function replace( match, include ) { - - var replace = ShaderChunk[ include ]; - - if ( replace === undefined ) { - - throw new Error( 'Can not resolve #include <' + include + '>' ); - - } - - return parseIncludes( replace ); - - } - - return string.replace( pattern, replace ); - -} - -function unrollLoops( string ) { - - var pattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g; - - function replace( match, start, end, snippet ) { - - var unroll = ''; - - for ( var i = parseInt( start ); i < parseInt( end ); i ++ ) { - - unroll += snippet - .replace( /\[ i \]/g, '[ ' + i + ' ]' ) - .replace( /UNROLLED_LOOP_INDEX/g, i ); - - } - - return unroll; - - } - - return string.replace( pattern, replace ); - -} - -function WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities ) { - - var gl = renderer.getContext(); - - var defines = material.defines; - - var vertexShader = shader.vertexShader; - var fragmentShader = shader.fragmentShader; - - var shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC'; - - if ( parameters.shadowMapType === PCFShadowMap ) { - - shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF'; - - } else if ( parameters.shadowMapType === PCFSoftShadowMap ) { - - shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT'; - - } else if ( parameters.shadowMapType === VSMShadowMap ) { - - shadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM'; - - } - - var envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; - var envMapModeDefine = 'ENVMAP_MODE_REFLECTION'; - var envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; - - if ( parameters.envMap ) { - - switch ( material.envMap.mapping ) { - - case CubeReflectionMapping: - case CubeRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; - break; - - case CubeUVReflectionMapping: - case CubeUVRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV'; - break; - - case EquirectangularReflectionMapping: - case EquirectangularRefractionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_EQUIREC'; - break; - - case SphericalReflectionMapping: - envMapTypeDefine = 'ENVMAP_TYPE_SPHERE'; - break; - - } - - switch ( material.envMap.mapping ) { - - case CubeRefractionMapping: - case EquirectangularRefractionMapping: - envMapModeDefine = 'ENVMAP_MODE_REFRACTION'; - break; - - } - - switch ( material.combine ) { - - case MultiplyOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; - break; - - case MixOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_MIX'; - break; - - case AddOperation: - envMapBlendingDefine = 'ENVMAP_BLENDING_ADD'; - break; - - } - - } - - var gammaFactorDefine = ( renderer.gammaFactor > 0 ) ? renderer.gammaFactor : 1.0; - - // console.log( 'building new program ' ); - - // - - var customExtensions = capabilities.isWebGL2 ? '' : generateExtensions( material.extensions, parameters, extensions ); - - var customDefines = generateDefines( defines ); - - // - - var program = gl.createProgram(); - - var prefixVertex, prefixFragment; - - if ( material.isRawShaderMaterial ) { - - prefixVertex = [ - - customDefines - - ].filter( filterEmptyLine ).join( '\n' ); - - if ( prefixVertex.length > 0 ) { - - prefixVertex += '\n'; - - } - - prefixFragment = [ - - customExtensions, - customDefines - - ].filter( filterEmptyLine ).join( '\n' ); - - if ( prefixFragment.length > 0 ) { - - prefixFragment += '\n'; - - } - - } else { - - prefixVertex = [ - - 'precision ' + parameters.precision + ' float;', - 'precision ' + parameters.precision + ' int;', - - ( parameters.precision === 'highp' ) ? '#define HIGH_PRECISION' : '', - - '#define SHADER_NAME ' + shader.name, - - customDefines, - - parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', - - '#define GAMMA_FACTOR ' + gammaFactorDefine, - - '#define MAX_BONES ' + parameters.maxBones, - ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', - ( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '', - - parameters.map ? '#define USE_MAP' : '', - parameters.envMap ? '#define USE_ENVMAP' : '', - parameters.envMap ? '#define ' + envMapModeDefine : '', - parameters.lightMap ? '#define USE_LIGHTMAP' : '', - parameters.aoMap ? '#define USE_AOMAP' : '', - parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - parameters.bumpMap ? '#define USE_BUMPMAP' : '', - parameters.normalMap ? '#define USE_NORMALMAP' : '', - ( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '', - ( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '', - - parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', - parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', - parameters.specularMap ? '#define USE_SPECULARMAP' : '', - parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', - parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', - parameters.alphaMap ? '#define USE_ALPHAMAP' : '', - - parameters.vertexTangents ? '#define USE_TANGENT' : '', - parameters.vertexColors ? '#define USE_COLOR' : '', - parameters.vertexUvs ? '#define USE_UV' : '', - - parameters.flatShading ? '#define FLAT_SHADED' : '', - - parameters.skinning ? '#define USE_SKINNING' : '', - parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', - - parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', - parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', - parameters.doubleSided ? '#define DOUBLE_SIDED' : '', - parameters.flipSided ? '#define FLIP_SIDED' : '', - - parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', - parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', - - parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', - - parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', - parameters.logarithmicDepthBuffer && ( capabilities.isWebGL2 || extensions.get( 'EXT_frag_depth' ) ) ? '#define USE_LOGDEPTHBUF_EXT' : '', - - 'uniform mat4 modelMatrix;', - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform mat4 viewMatrix;', - 'uniform mat3 normalMatrix;', - 'uniform vec3 cameraPosition;', - - 'attribute vec3 position;', - 'attribute vec3 normal;', - 'attribute vec2 uv;', - - '#ifdef USE_TANGENT', - - ' attribute vec4 tangent;', - - '#endif', - - '#ifdef USE_COLOR', - - ' attribute vec3 color;', - - '#endif', - - '#ifdef USE_MORPHTARGETS', - - ' attribute vec3 morphTarget0;', - ' attribute vec3 morphTarget1;', - ' attribute vec3 morphTarget2;', - ' attribute vec3 morphTarget3;', - - ' #ifdef USE_MORPHNORMALS', - - ' attribute vec3 morphNormal0;', - ' attribute vec3 morphNormal1;', - ' attribute vec3 morphNormal2;', - ' attribute vec3 morphNormal3;', - - ' #else', - - ' attribute vec3 morphTarget4;', - ' attribute vec3 morphTarget5;', - ' attribute vec3 morphTarget6;', - ' attribute vec3 morphTarget7;', - - ' #endif', - - '#endif', - - '#ifdef USE_SKINNING', - - ' attribute vec4 skinIndex;', - ' attribute vec4 skinWeight;', - - '#endif', - - '\n' - - ].filter( filterEmptyLine ).join( '\n' ); - - prefixFragment = [ - - customExtensions, - - 'precision ' + parameters.precision + ' float;', - 'precision ' + parameters.precision + ' int;', - - ( parameters.precision === 'highp' ) ? '#define HIGH_PRECISION' : '', - - '#define SHADER_NAME ' + shader.name, - - customDefines, - - parameters.alphaTest ? '#define ALPHATEST ' + parameters.alphaTest + ( parameters.alphaTest % 1 ? '' : '.0' ) : '', // add '.0' if integer - - '#define GAMMA_FACTOR ' + gammaFactorDefine, - - ( parameters.useFog && parameters.fog ) ? '#define USE_FOG' : '', - ( parameters.useFog && parameters.fogExp2 ) ? '#define FOG_EXP2' : '', - - parameters.map ? '#define USE_MAP' : '', - parameters.matcap ? '#define USE_MATCAP' : '', - parameters.envMap ? '#define USE_ENVMAP' : '', - parameters.envMap ? '#define ' + envMapTypeDefine : '', - parameters.envMap ? '#define ' + envMapModeDefine : '', - parameters.envMap ? '#define ' + envMapBlendingDefine : '', - parameters.lightMap ? '#define USE_LIGHTMAP' : '', - parameters.aoMap ? '#define USE_AOMAP' : '', - parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', - parameters.bumpMap ? '#define USE_BUMPMAP' : '', - parameters.normalMap ? '#define USE_NORMALMAP' : '', - ( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '', - ( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '', - parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', - parameters.specularMap ? '#define USE_SPECULARMAP' : '', - parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', - parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', - parameters.alphaMap ? '#define USE_ALPHAMAP' : '', - - parameters.sheen ? '#define USE_SHEEN' : '', - - parameters.vertexTangents ? '#define USE_TANGENT' : '', - parameters.vertexColors ? '#define USE_COLOR' : '', - parameters.vertexUvs ? '#define USE_UV' : '', - - parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', - - parameters.flatShading ? '#define FLAT_SHADED' : '', - - parameters.doubleSided ? '#define DOUBLE_SIDED' : '', - parameters.flipSided ? '#define FLIP_SIDED' : '', - - parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', - parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', - - parameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', - - parameters.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '', - - parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', - parameters.logarithmicDepthBuffer && ( capabilities.isWebGL2 || extensions.get( 'EXT_frag_depth' ) ) ? '#define USE_LOGDEPTHBUF_EXT' : '', - - ( ( material.extensions ? material.extensions.shaderTextureLOD : false ) || parameters.envMap ) && ( capabilities.isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) ) ? '#define TEXTURE_LOD_EXT' : '', - - 'uniform mat4 viewMatrix;', - 'uniform vec3 cameraPosition;', - - ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', - ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below - ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', - - parameters.dithering ? '#define DITHERING' : '', - - ( parameters.outputEncoding || parameters.mapEncoding || parameters.matcapEncoding || parameters.envMapEncoding || parameters.emissiveMapEncoding ) ? - ShaderChunk[ 'encodings_pars_fragment' ] : '', // this code is required here because it is used by the various encoding/decoding function defined below - parameters.mapEncoding ? getTexelDecodingFunction( 'mapTexelToLinear', parameters.mapEncoding ) : '', - parameters.matcapEncoding ? getTexelDecodingFunction( 'matcapTexelToLinear', parameters.matcapEncoding ) : '', - parameters.envMapEncoding ? getTexelDecodingFunction( 'envMapTexelToLinear', parameters.envMapEncoding ) : '', - parameters.emissiveMapEncoding ? getTexelDecodingFunction( 'emissiveMapTexelToLinear', parameters.emissiveMapEncoding ) : '', - parameters.outputEncoding ? getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputEncoding ) : '', - - parameters.depthPacking ? '#define DEPTH_PACKING ' + material.depthPacking : '', - - '\n' - - ].filter( filterEmptyLine ).join( '\n' ); - - } - - vertexShader = parseIncludes( vertexShader ); - vertexShader = replaceLightNums( vertexShader, parameters ); - vertexShader = replaceClippingPlaneNums( vertexShader, parameters ); - - fragmentShader = parseIncludes( fragmentShader ); - fragmentShader = replaceLightNums( fragmentShader, parameters ); - fragmentShader = replaceClippingPlaneNums( fragmentShader, parameters ); - - vertexShader = unrollLoops( vertexShader ); - fragmentShader = unrollLoops( fragmentShader ); - - if ( capabilities.isWebGL2 && ! material.isRawShaderMaterial ) { - - var isGLSL3ShaderMaterial = false; - - var versionRegex = /^\s*#version\s+300\s+es\s*\n/; - - if ( material.isShaderMaterial && - vertexShader.match( versionRegex ) !== null && - fragmentShader.match( versionRegex ) !== null ) { - - isGLSL3ShaderMaterial = true; - - vertexShader = vertexShader.replace( versionRegex, '' ); - fragmentShader = fragmentShader.replace( versionRegex, '' ); - - } - - // GLSL 3.0 conversion - prefixVertex = [ - '#version 300 es\n', - '#define attribute in', - '#define varying out', - '#define texture2D texture' - ].join( '\n' ) + '\n' + prefixVertex; - - prefixFragment = [ - '#version 300 es\n', - '#define varying in', - isGLSL3ShaderMaterial ? '' : 'out highp vec4 pc_fragColor;', - isGLSL3ShaderMaterial ? '' : '#define gl_FragColor pc_fragColor', - '#define gl_FragDepthEXT gl_FragDepth', - '#define texture2D texture', - '#define textureCube texture', - '#define texture2DProj textureProj', - '#define texture2DLodEXT textureLod', - '#define texture2DProjLodEXT textureProjLod', - '#define textureCubeLodEXT textureLod', - '#define texture2DGradEXT textureGrad', - '#define texture2DProjGradEXT textureProjGrad', - '#define textureCubeGradEXT textureGrad' - ].join( '\n' ) + '\n' + prefixFragment; - - } - - var vertexGlsl = prefixVertex + vertexShader; - var fragmentGlsl = prefixFragment + fragmentShader; - - // console.log( '*VERTEX*', vertexGlsl ); - // console.log( '*FRAGMENT*', fragmentGlsl ); - - var glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl ); - var glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl ); - - gl.attachShader( program, glVertexShader ); - gl.attachShader( program, glFragmentShader ); - - // Force a particular attribute to index 0. - - if ( material.index0AttributeName !== undefined ) { - - gl.bindAttribLocation( program, 0, material.index0AttributeName ); - - } else if ( parameters.morphTargets === true ) { - - // programs with morphTargets displace position out of attribute 0 - gl.bindAttribLocation( program, 0, 'position' ); - - } - - gl.linkProgram( program ); - - // check for link errors - if ( renderer.debug.checkShaderErrors ) { - - var programLog = gl.getProgramInfoLog( program ).trim(); - var vertexLog = gl.getShaderInfoLog( glVertexShader ).trim(); - var fragmentLog = gl.getShaderInfoLog( glFragmentShader ).trim(); - - var runnable = true; - var haveDiagnostics = true; - - if ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) { - - runnable = false; - - var vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' ); - var fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' ); - - console.error( 'THREE.WebGLProgram: shader error: ', gl.getError(), 'gl.VALIDATE_STATUS', gl.getProgramParameter( program, gl.VALIDATE_STATUS ), 'gl.getProgramInfoLog', programLog, vertexErrors, fragmentErrors ); - - } else if ( programLog !== '' ) { - - console.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', programLog ); - - } else if ( vertexLog === '' || fragmentLog === '' ) { - - haveDiagnostics = false; - - } - - if ( haveDiagnostics ) { - - this.diagnostics = { - - runnable: runnable, - material: material, - - programLog: programLog, - - vertexShader: { - - log: vertexLog, - prefix: prefixVertex - - }, - - fragmentShader: { - - log: fragmentLog, - prefix: prefixFragment - - } - - }; - - } - - } - - // clean up - - gl.deleteShader( glVertexShader ); - gl.deleteShader( glFragmentShader ); - - // set up caching for uniform locations - - var cachedUniforms; - - this.getUniforms = function () { - - if ( cachedUniforms === undefined ) { - - cachedUniforms = new WebGLUniforms( gl, program ); - - } - - return cachedUniforms; - - }; - - // set up caching for attribute locations - - var cachedAttributes; - - this.getAttributes = function () { - - if ( cachedAttributes === undefined ) { - - cachedAttributes = fetchAttributeLocations( gl, program ); - - } - - return cachedAttributes; - - }; - - // free resource - - this.destroy = function () { - - gl.deleteProgram( program ); - this.program = undefined; - - }; - - // - - this.name = shader.name; - this.id = programIdCount ++; - this.code = code; - this.usedTimes = 1; - this.program = program; - this.vertexShader = glVertexShader; - this.fragmentShader = glFragmentShader; - - return this; - -} - -export { WebGLProgram }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.d.ts deleted file mode 100644 index f0dd7dbaaf..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { WebGLRenderer } from './../WebGLRenderer'; -import { WebGLProgram } from './WebGLProgram'; -import { WebGLCapabilities } from './WebGLCapabilities'; -import { WebGLExtensions } from './WebGLExtensions'; -import { ShaderMaterial } from './../../materials/ShaderMaterial'; - -export class WebGLPrograms { - - constructor( renderer: WebGLRenderer, extensions: WebGLExtensions, capabilities: WebGLCapabilities ); - - programs: WebGLProgram[]; - - getParameters( - material: ShaderMaterial, - lights: any, - fog: any, - nClipPlanes: number, - object: any - ): any; - getProgramCode( material: ShaderMaterial, parameters: any ): string; - acquireProgram( - material: ShaderMaterial, - parameters: any, - code: string - ): WebGLProgram; - releaseProgram( program: WebGLProgram ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.js deleted file mode 100644 index c8a93646c4..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLPrograms.js +++ /dev/null @@ -1,323 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { BackSide, DoubleSide, CubeUVRefractionMapping, CubeUVReflectionMapping, GammaEncoding, LinearEncoding, ObjectSpaceNormalMap, TangentSpaceNormalMap, NoToneMapping } from '../../constants.js'; -import { WebGLProgram } from './WebGLProgram.js'; - -function WebGLPrograms( renderer, extensions, capabilities ) { - - var programs = []; - - var shaderIDs = { - MeshDepthMaterial: 'depth', - MeshDistanceMaterial: 'distanceRGBA', - MeshNormalMaterial: 'normal', - MeshBasicMaterial: 'basic', - MeshLambertMaterial: 'lambert', - MeshPhongMaterial: 'phong', - MeshToonMaterial: 'phong', - MeshStandardMaterial: 'physical', - MeshPhysicalMaterial: 'physical', - MeshMatcapMaterial: 'matcap', - LineBasicMaterial: 'basic', - LineDashedMaterial: 'dashed', - PointsMaterial: 'points', - ShadowMaterial: 'shadow', - SpriteMaterial: 'sprite' - }; - - var parameterNames = [ - "precision", "supportsVertexTextures", "map", "mapEncoding", "matcap", "matcapEncoding", "envMap", "envMapMode", "envMapEncoding", - "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatNormalMap", "displacementMap", "specularMap", - "roughnessMap", "metalnessMap", "gradientMap", - "alphaMap", "combine", "vertexColors", "vertexTangents", "fog", "useFog", "fogExp2", - "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", - "maxBones", "useVertexTexture", "morphTargets", "morphNormals", - "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", - "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "numRectAreaLights", - "shadowMapEnabled", "shadowMapType", "toneMapping", 'physicallyCorrectLights', - "alphaTest", "doubleSided", "flipSided", "numClippingPlanes", "numClipIntersection", "depthPacking", "dithering", - "sheen" - ]; - - - function allocateBones( object ) { - - var skeleton = object.skeleton; - var bones = skeleton.bones; - - if ( capabilities.floatVertexTextures ) { - - return 1024; - - } else { - - // default for when object is not specified - // ( for example when prebuilding shader to be used with multiple objects ) - // - // - leave some extra space for other uniforms - // - limit here is ANGLE's 254 max uniform vectors - // (up to 54 should be safe) - - var nVertexUniforms = capabilities.maxVertexUniforms; - var nVertexMatrices = Math.floor( ( nVertexUniforms - 20 ) / 4 ); - - var maxBones = Math.min( nVertexMatrices, bones.length ); - - if ( maxBones < bones.length ) { - - console.warn( 'THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.' ); - return 0; - - } - - return maxBones; - - } - - } - - function getTextureEncodingFromMap( map, gammaOverrideLinear ) { - - var encoding; - - if ( ! map ) { - - encoding = LinearEncoding; - - } else if ( map.isTexture ) { - - encoding = map.encoding; - - } else if ( map.isWebGLRenderTarget ) { - - console.warn( "THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead." ); - encoding = map.texture.encoding; - - } - - // add backwards compatibility for WebGLRenderer.gammaInput/gammaOutput parameter, should probably be removed at some point. - if ( encoding === LinearEncoding && gammaOverrideLinear ) { - - encoding = GammaEncoding; - - } - - return encoding; - - } - - this.getParameters = function ( material, lights, shadows, fog, nClipPlanes, nClipIntersection, object ) { - - var shaderID = shaderIDs[ material.type ]; - - // heuristics to create shader parameters according to lights in the scene - // (not to blow over maxLights budget) - - var maxBones = object.isSkinnedMesh ? allocateBones( object ) : 0; - var precision = capabilities.precision; - - if ( material.precision !== null ) { - - precision = capabilities.getMaxPrecision( material.precision ); - - if ( precision !== material.precision ) { - - console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' ); - - } - - } - - var currentRenderTarget = renderer.getRenderTarget(); - - var parameters = { - - shaderID: shaderID, - - precision: precision, - supportsVertexTextures: capabilities.vertexTextures, - outputEncoding: getTextureEncodingFromMap( ( ! currentRenderTarget ) ? null : currentRenderTarget.texture, renderer.gammaOutput ), - map: !! material.map, - mapEncoding: getTextureEncodingFromMap( material.map, renderer.gammaInput ), - matcap: !! material.matcap, - matcapEncoding: getTextureEncodingFromMap( material.matcap, renderer.gammaInput ), - envMap: !! material.envMap, - envMapMode: material.envMap && material.envMap.mapping, - envMapEncoding: getTextureEncodingFromMap( material.envMap, renderer.gammaInput ), - envMapCubeUV: ( !! material.envMap ) && ( ( material.envMap.mapping === CubeUVReflectionMapping ) || ( material.envMap.mapping === CubeUVRefractionMapping ) ), - lightMap: !! material.lightMap, - aoMap: !! material.aoMap, - emissiveMap: !! material.emissiveMap, - emissiveMapEncoding: getTextureEncodingFromMap( material.emissiveMap, renderer.gammaInput ), - bumpMap: !! material.bumpMap, - normalMap: !! material.normalMap, - objectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap, - tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap, - clearcoatNormalMap: !! material.clearcoatNormalMap, - displacementMap: !! material.displacementMap, - roughnessMap: !! material.roughnessMap, - metalnessMap: !! material.metalnessMap, - specularMap: !! material.specularMap, - alphaMap: !! material.alphaMap, - - gradientMap: !! material.gradientMap, - - sheen: !! material.sheen, - - combine: material.combine, - - vertexTangents: ( material.normalMap && material.vertexTangents ), - vertexColors: material.vertexColors, - vertexUvs: !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearcoatNormalMap, - - fog: !! fog, - useFog: material.fog, - fogExp2: ( fog && fog.isFogExp2 ), - - flatShading: material.flatShading, - - sizeAttenuation: material.sizeAttenuation, - logarithmicDepthBuffer: capabilities.logarithmicDepthBuffer, - - skinning: material.skinning && maxBones > 0, - maxBones: maxBones, - useVertexTexture: capabilities.floatVertexTextures, - - morphTargets: material.morphTargets, - morphNormals: material.morphNormals, - maxMorphTargets: renderer.maxMorphTargets, - maxMorphNormals: renderer.maxMorphNormals, - - numDirLights: lights.directional.length, - numPointLights: lights.point.length, - numSpotLights: lights.spot.length, - numRectAreaLights: lights.rectArea.length, - numHemiLights: lights.hemi.length, - - numDirLightShadows: lights.directionalShadowMap.length, - numPointLightShadows: lights.pointShadowMap.length, - numSpotLightShadows: lights.spotShadowMap.length, - - numClippingPlanes: nClipPlanes, - numClipIntersection: nClipIntersection, - - dithering: material.dithering, - - shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && shadows.length > 0, - shadowMapType: renderer.shadowMap.type, - - toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping, - physicallyCorrectLights: renderer.physicallyCorrectLights, - - premultipliedAlpha: material.premultipliedAlpha, - - alphaTest: material.alphaTest, - doubleSided: material.side === DoubleSide, - flipSided: material.side === BackSide, - - depthPacking: ( material.depthPacking !== undefined ) ? material.depthPacking : false - - }; - - return parameters; - - }; - - this.getProgramCode = function ( material, parameters ) { - - var array = []; - - if ( parameters.shaderID ) { - - array.push( parameters.shaderID ); - - } else { - - array.push( material.fragmentShader ); - array.push( material.vertexShader ); - - } - - if ( material.defines !== undefined ) { - - for ( var name in material.defines ) { - - array.push( name ); - array.push( material.defines[ name ] ); - - } - - } - - for ( var i = 0; i < parameterNames.length; i ++ ) { - - array.push( parameters[ parameterNames[ i ] ] ); - - } - - array.push( material.onBeforeCompile.toString() ); - - array.push( renderer.gammaOutput ); - - array.push( renderer.gammaFactor ); - - return array.join(); - - }; - - this.acquireProgram = function ( material, shader, parameters, code ) { - - var program; - - // Check if code has been already compiled - for ( var p = 0, pl = programs.length; p < pl; p ++ ) { - - var programInfo = programs[ p ]; - - if ( programInfo.code === code ) { - - program = programInfo; - ++ program.usedTimes; - - break; - - } - - } - - if ( program === undefined ) { - - program = new WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities ); - programs.push( program ); - - } - - return program; - - }; - - this.releaseProgram = function ( program ) { - - if ( -- program.usedTimes === 0 ) { - - // Remove from unordered set - var i = programs.indexOf( program ); - programs[ i ] = programs[ programs.length - 1 ]; - programs.pop(); - - // Free WebGL resources - program.destroy(); - - } - - }; - - // Exposed for resource monitoring & error feedback via renderer.info: - this.programs = programs; - -} - - -export { WebGLPrograms }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.d.ts deleted file mode 100644 index 8b932d1aaf..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class WebGLProperties { - - constructor(); - - get( object: any ): any; - delete( object: any ): void; - clear(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.js deleted file mode 100644 index e875912bfe..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLProperties.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @author fordacious / fordacious.github.io - */ - -function WebGLProperties() { - - var properties = new WeakMap(); - - function get( object ) { - - var map = properties.get( object ); - - if ( map === undefined ) { - - map = {}; - properties.set( object, map ); - - } - - return map; - - } - - function remove( object ) { - - properties.delete( object ); - - } - - function update( object, key, value ) { - - properties.get( object )[ key ] = value; - - } - - function dispose() { - - properties = new WeakMap(); - - } - - return { - get: get, - remove: remove, - update: update, - dispose: dispose - }; - -} - - -export { WebGLProperties }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.d.ts deleted file mode 100644 index 05c4ad7f2d..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Object3D } from './../../core/Object3D'; -import { Material } from './../../materials/Material'; -import { WebGLProgram } from './WebGLProgram'; -import { Group } from './../../objects/Group'; -import { Scene } from './../../scenes/Scene'; -import { Camera } from './../../cameras/Camera'; -import { BufferGeometry } from '../../core/BufferGeometry'; - -export interface RenderTarget {} // not defined in the code, used in LightShadow and WebGRenderer classes - -export interface RenderItem { - id: number; - object: Object3D; - geometry: BufferGeometry | null; - material: Material; - program: WebGLProgram; - groupOrder: number; - renderOrder: number; - z: number; - group: Group | null; -} - -export class WebGLRenderList { - - opaque: Array; - transparent: Array; - init(): void; - push( - object: Object3D, - geometry: BufferGeometry | null, - material: Material, - groupOrder: number, - z: number, - group: Group | null - ): void; - unshift( - object: Object3D, - geometry: BufferGeometry | null, - material: Material, - groupOrder: number, - z: number, - group: Group | null - ): void; - sort(): void; - -} - -export class WebGLRenderLists { - - dispose(): void; - get( scene: Scene, camera: Camera ): WebGLRenderList; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.js deleted file mode 100644 index 9f7456e22e..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderLists.js +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function painterSortStable( a, b ) { - - if ( a.groupOrder !== b.groupOrder ) { - - return a.groupOrder - b.groupOrder; - - } else if ( a.renderOrder !== b.renderOrder ) { - - return a.renderOrder - b.renderOrder; - - } else if ( a.program !== b.program ) { - - return a.program.id - b.program.id; - - } else if ( a.material.id !== b.material.id ) { - - return a.material.id - b.material.id; - - } else if ( a.z !== b.z ) { - - return a.z - b.z; - - } else { - - return a.id - b.id; - - } - -} - -function reversePainterSortStable( a, b ) { - - if ( a.groupOrder !== b.groupOrder ) { - - return a.groupOrder - b.groupOrder; - - } else if ( a.renderOrder !== b.renderOrder ) { - - return a.renderOrder - b.renderOrder; - - } else if ( a.z !== b.z ) { - - return b.z - a.z; - - } else { - - return a.id - b.id; - - } - -} - - -function WebGLRenderList() { - - var renderItems = []; - var renderItemsIndex = 0; - - var opaque = []; - var transparent = []; - - var defaultProgram = { id: - 1 }; - - function init() { - - renderItemsIndex = 0; - - opaque.length = 0; - transparent.length = 0; - - } - - function getNextRenderItem( object, geometry, material, groupOrder, z, group ) { - - var renderItem = renderItems[ renderItemsIndex ]; - - if ( renderItem === undefined ) { - - renderItem = { - id: object.id, - object: object, - geometry: geometry, - material: material, - program: material.program || defaultProgram, - groupOrder: groupOrder, - renderOrder: object.renderOrder, - z: z, - group: group - }; - - renderItems[ renderItemsIndex ] = renderItem; - - } else { - - renderItem.id = object.id; - renderItem.object = object; - renderItem.geometry = geometry; - renderItem.material = material; - renderItem.program = material.program || defaultProgram; - renderItem.groupOrder = groupOrder; - renderItem.renderOrder = object.renderOrder; - renderItem.z = z; - renderItem.group = group; - - } - - renderItemsIndex ++; - - return renderItem; - - } - - function push( object, geometry, material, groupOrder, z, group ) { - - var renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); - - ( material.transparent === true ? transparent : opaque ).push( renderItem ); - - } - - function unshift( object, geometry, material, groupOrder, z, group ) { - - var renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group ); - - ( material.transparent === true ? transparent : opaque ).unshift( renderItem ); - - } - - function sort() { - - if ( opaque.length > 1 ) opaque.sort( painterSortStable ); - if ( transparent.length > 1 ) transparent.sort( reversePainterSortStable ); - - } - - return { - opaque: opaque, - transparent: transparent, - - init: init, - push: push, - unshift: unshift, - - sort: sort - }; - -} - -function WebGLRenderLists() { - - var lists = new WeakMap(); - - function onSceneDispose( event ) { - - var scene = event.target; - - scene.removeEventListener( 'dispose', onSceneDispose ); - - lists.delete( scene ); - - } - - function get( scene, camera ) { - - var cameras = lists.get( scene ); - var list; - if ( cameras === undefined ) { - - list = new WebGLRenderList(); - lists.set( scene, new WeakMap() ); - lists.get( scene ).set( camera, list ); - - scene.addEventListener( 'dispose', onSceneDispose ); - - } else { - - list = cameras.get( camera ); - if ( list === undefined ) { - - list = new WebGLRenderList(); - cameras.set( camera, list ); - - } - - } - - return list; - - } - - function dispose() { - - lists = new WeakMap(); - - } - - return { - get: get, - dispose: dispose - }; - -} - - -export { WebGLRenderLists }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.d.ts deleted file mode 100644 index 5edb86725a..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Scene } from '../../scenes/Scene'; -import { Camera } from '../../cameras/Camera'; -import { Light } from '../../lights/Light'; -import { WebGLLights } from './WebGLLights'; - -interface WebGLRenderState { - - init(): void; - state: { - lightsArray: Light[]; - shadowsArray: Light[]; - lights: WebGLLights; - }; - setupLights( camera: Camera ): void; - pushLight( light: Light ): void; - pushShadow( shadowLight: Light ): void; - -} - -export class WebGLRenderStates { - - get( scene: Scene, camera: Camera ): WebGLRenderState; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.js deleted file mode 100644 index 818cff6467..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLRenderStates.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @author Mugen87 / https://github.com/Mugen87 - */ - -import { WebGLLights } from './WebGLLights.js'; - -function WebGLRenderState() { - - var lights = new WebGLLights(); - - var lightsArray = []; - var shadowsArray = []; - - function init() { - - lightsArray.length = 0; - shadowsArray.length = 0; - - } - - function pushLight( light ) { - - lightsArray.push( light ); - - } - - function pushShadow( shadowLight ) { - - shadowsArray.push( shadowLight ); - - } - - function setupLights( camera ) { - - lights.setup( lightsArray, shadowsArray, camera ); - - } - - var state = { - lightsArray: lightsArray, - shadowsArray: shadowsArray, - - lights: lights - }; - - return { - init: init, - state: state, - setupLights: setupLights, - - pushLight: pushLight, - pushShadow: pushShadow - }; - -} - -function WebGLRenderStates() { - - var renderStates = new WeakMap(); - - function onSceneDispose( event ) { - - var scene = event.target; - - scene.removeEventListener( 'dispose', onSceneDispose ); - - renderStates.delete( scene ); - - } - - function get( scene, camera ) { - - var renderState; - - if ( renderStates.has( scene ) === false ) { - - renderState = new WebGLRenderState(); - renderStates.set( scene, new WeakMap() ); - renderStates.get( scene ).set( camera, renderState ); - - scene.addEventListener( 'dispose', onSceneDispose ); - - } else { - - if ( renderStates.get( scene ).has( camera ) === false ) { - - renderState = new WebGLRenderState(); - renderStates.get( scene ).set( camera, renderState ); - - } else { - - renderState = renderStates.get( scene ).get( camera ); - - } - - } - - return renderState; - - } - - function dispose() { - - renderStates = new WeakMap(); - - } - - return { - get: get, - dispose: dispose - }; - -} - - -export { WebGLRenderStates }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.d.ts deleted file mode 100644 index c5259ef5b1..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class WebGLShader { - - constructor( gl: any, type: string, string: string ); - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.js deleted file mode 100644 index d32b5ecc1b..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLShader.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function WebGLShader( gl, type, string ) { - - var shader = gl.createShader( type ); - - gl.shaderSource( shader, string ); - gl.compileShader( shader ); - - return shader; - -} - -export { WebGLShader }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.d.ts deleted file mode 100644 index 2c0109cd05..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Scene } from './../../scenes/Scene'; -import { Camera } from './../../cameras/Camera'; -import { WebGLRenderer } from '../WebGLRenderer'; -import { ShadowMapType } from '../../constants'; - -export class WebGLShadowMap { - - constructor( - _renderer: WebGLRenderer, - _lights: any[], - _objects: any[], - capabilities: any - ); - - enabled: boolean; - autoUpdate: boolean; - needsUpdate: boolean; - type: ShadowMapType; - - render( scene: Scene, camera: Camera ): void; - - /** - * @deprecated Use {@link WebGLShadowMap#renderReverseSided .shadowMap.renderReverseSided} instead. - */ - cullFace: any; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.js deleted file mode 100644 index ea5931dfb8..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLShadowMap.js +++ /dev/null @@ -1,443 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -import { FrontSide, BackSide, DoubleSide, RGBAFormat, NearestFilter, LinearFilter, PCFShadowMap, VSMShadowMap, RGBADepthPacking, NoBlending } from '../../constants.js'; -import { WebGLRenderTarget } from '../WebGLRenderTarget.js'; -import { MeshDepthMaterial } from '../../materials/MeshDepthMaterial.js'; -import { MeshDistanceMaterial } from '../../materials/MeshDistanceMaterial.js'; -import { ShaderMaterial } from '../../materials/ShaderMaterial.js'; -import { BufferAttribute } from '../../core/BufferAttribute.js'; -import { BufferGeometry } from '../../core/BufferGeometry.js'; -import { Mesh } from '../../objects/Mesh.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Frustum } from '../../math/Frustum.js'; - -import vsm_frag from '../shaders/ShaderLib/vsm_frag.glsl.js'; -import vsm_vert from '../shaders/ShaderLib/vsm_vert.glsl.js'; - -function WebGLShadowMap( _renderer, _objects, maxTextureSize ) { - - var _frustum = new Frustum(), - - _shadowMapSize = new Vector2(), - _viewportSize = new Vector2(), - - _viewport = new Vector4(), - - _MorphingFlag = 1, - _SkinningFlag = 2, - - _NumberOfMaterialVariants = ( _MorphingFlag | _SkinningFlag ) + 1, - - _depthMaterials = new Array( _NumberOfMaterialVariants ), - _distanceMaterials = new Array( _NumberOfMaterialVariants ), - - _materialCache = {}; - - var shadowSide = { 0: BackSide, 1: FrontSide, 2: DoubleSide }; - - var shadowMaterialVertical = new ShaderMaterial( { - - defines: { - SAMPLE_RATE: 2.0 / 8.0, - HALF_SAMPLE_RATE: 1.0 / 8.0 - }, - - uniforms: { - shadow_pass: { value: null }, - resolution: { value: new Vector2() }, - radius: { value: 4.0 } - }, - - vertexShader: vsm_vert, - - fragmentShader: vsm_frag - - } ); - - var shadowMaterialHorizonal = shadowMaterialVertical.clone(); - shadowMaterialHorizonal.defines.HORIZONAL_PASS = 1; - - var fullScreenTri = new BufferGeometry(); - fullScreenTri.addAttribute( - "position", - new BufferAttribute( - new Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ), - 3 - ) - ); - - var fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical ); - - // init - - for ( var i = 0; i !== _NumberOfMaterialVariants; ++ i ) { - - var useMorphing = ( i & _MorphingFlag ) !== 0; - var useSkinning = ( i & _SkinningFlag ) !== 0; - - var depthMaterial = new MeshDepthMaterial( { - - depthPacking: RGBADepthPacking, - - morphTargets: useMorphing, - skinning: useSkinning - - } ); - - _depthMaterials[ i ] = depthMaterial; - - var distanceMaterial = new MeshDistanceMaterial( { - - morphTargets: useMorphing, - skinning: useSkinning - - } ); - - _distanceMaterials[ i ] = distanceMaterial; - - } - - var scope = this; - - this.enabled = false; - - this.autoUpdate = true; - this.needsUpdate = false; - - this.type = PCFShadowMap; - - this.render = function ( lights, scene, camera ) { - - if ( scope.enabled === false ) return; - if ( scope.autoUpdate === false && scope.needsUpdate === false ) return; - - if ( lights.length === 0 ) return; - - var currentRenderTarget = _renderer.getRenderTarget(); - var activeCubeFace = _renderer.getActiveCubeFace(); - var activeMipmapLevel = _renderer.getActiveMipmapLevel(); - - var _state = _renderer.state; - - // Set GL state for depth map. - _state.setBlending( NoBlending ); - _state.buffers.color.setClear( 1, 1, 1, 1 ); - _state.buffers.depth.setTest( true ); - _state.setScissorTest( false ); - - // render depth map - - for ( var i = 0, il = lights.length; i < il; i ++ ) { - - var light = lights[ i ]; - var shadow = light.shadow; - - if ( shadow === undefined ) { - - console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' ); - continue; - - } - - _shadowMapSize.copy( shadow.mapSize ); - - var shadowFrameExtents = shadow.getFrameExtents(); - - _shadowMapSize.multiply( shadowFrameExtents ); - - _viewportSize.copy( shadow.mapSize ); - - if ( _shadowMapSize.x > maxTextureSize || _shadowMapSize.y > maxTextureSize ) { - - console.warn( 'THREE.WebGLShadowMap:', light, 'has shadow exceeding max texture size, reducing' ); - - if ( _shadowMapSize.x > maxTextureSize ) { - - _viewportSize.x = Math.floor( maxTextureSize / shadowFrameExtents.x ); - _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x; - shadow.mapSize.x = _viewportSize.x; - - } - - if ( _shadowMapSize.y > maxTextureSize ) { - - _viewportSize.y = Math.floor( maxTextureSize / shadowFrameExtents.y ); - _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y; - shadow.mapSize.y = _viewportSize.y; - - } - - } - - if ( shadow.map === null && ! shadow.isPointLightShadow && this.type === VSMShadowMap ) { - - var pars = { minFilter: LinearFilter, magFilter: LinearFilter, format: RGBAFormat }; - - shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); - shadow.map.texture.name = light.name + ".shadowMap"; - - shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); - - shadow.camera.updateProjectionMatrix(); - - } - - if ( shadow.map === null ) { - - var pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat }; - - shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars ); - shadow.map.texture.name = light.name + ".shadowMap"; - - shadow.camera.updateProjectionMatrix(); - - } - - _renderer.setRenderTarget( shadow.map ); - _renderer.clear(); - - var viewportCount = shadow.getViewportCount(); - - for ( var vp = 0; vp < viewportCount; vp ++ ) { - - var viewport = shadow.getViewport( vp ); - - _viewport.set( - _viewportSize.x * viewport.x, - _viewportSize.y * viewport.y, - _viewportSize.x * viewport.z, - _viewportSize.y * viewport.w - ); - - _state.viewport( _viewport ); - - shadow.updateMatrices( light, camera, vp ); - - _frustum = shadow.getFrustum(); - - renderObject( scene, camera, shadow.camera, light, this.type ); - - } - - // do blur pass for VSM - - if ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) { - - VSMPass( shadow, camera ); - - } - - } - - scope.needsUpdate = false; - - _renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel ); - - }; - - function VSMPass( shadow, camera ) { - - var geometry = _objects.update( fullScreenMesh ); - - // vertical pass - - shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture; - shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize; - shadowMaterialVertical.uniforms.radius.value = shadow.radius; - _renderer.setRenderTarget( shadow.mapPass ); - _renderer.clear(); - _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null ); - - // horizonal pass - - shadowMaterialHorizonal.uniforms.shadow_pass.value = shadow.mapPass.texture; - shadowMaterialHorizonal.uniforms.resolution.value = shadow.mapSize; - shadowMaterialHorizonal.uniforms.radius.value = shadow.radius; - _renderer.setRenderTarget( shadow.map ); - _renderer.clear(); - _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizonal, fullScreenMesh, null ); - - } - - function getDepthMaterial( object, material, light, shadowCameraNear, shadowCameraFar, type ) { - - var geometry = object.geometry; - - var result = null; - - var materialVariants = _depthMaterials; - var customMaterial = object.customDepthMaterial; - - if ( light.isPointLight ) { - - materialVariants = _distanceMaterials; - customMaterial = object.customDistanceMaterial; - - } - - if ( ! customMaterial ) { - - var useMorphing = false; - - if ( material.morphTargets ) { - - if ( geometry && geometry.isBufferGeometry ) { - - useMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0; - - } else if ( geometry && geometry.isGeometry ) { - - useMorphing = geometry.morphTargets && geometry.morphTargets.length > 0; - - } - - } - - if ( object.isSkinnedMesh && material.skinning === false ) { - - console.warn( 'THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:', object ); - - } - - var useSkinning = object.isSkinnedMesh && material.skinning; - - var variantIndex = 0; - - if ( useMorphing ) variantIndex |= _MorphingFlag; - if ( useSkinning ) variantIndex |= _SkinningFlag; - - result = materialVariants[ variantIndex ]; - - } else { - - result = customMaterial; - - } - - if ( _renderer.localClippingEnabled && - material.clipShadows === true && - material.clippingPlanes.length !== 0 ) { - - // in this case we need a unique material instance reflecting the - // appropriate state - - var keyA = result.uuid, keyB = material.uuid; - - var materialsForVariant = _materialCache[ keyA ]; - - if ( materialsForVariant === undefined ) { - - materialsForVariant = {}; - _materialCache[ keyA ] = materialsForVariant; - - } - - var cachedMaterial = materialsForVariant[ keyB ]; - - if ( cachedMaterial === undefined ) { - - cachedMaterial = result.clone(); - materialsForVariant[ keyB ] = cachedMaterial; - - } - - result = cachedMaterial; - - } - - result.visible = material.visible; - result.wireframe = material.wireframe; - - if ( type === VSMShadowMap ) { - - result.side = ( material.shadowSide != null ) ? material.shadowSide : material.side; - - } else { - - result.side = ( material.shadowSide != null ) ? material.shadowSide : shadowSide[ material.side ]; - - } - - result.clipShadows = material.clipShadows; - result.clippingPlanes = material.clippingPlanes; - result.clipIntersection = material.clipIntersection; - - result.wireframeLinewidth = material.wireframeLinewidth; - result.linewidth = material.linewidth; - - if ( light.isPointLight && result.isMeshDistanceMaterial ) { - - result.referencePosition.setFromMatrixPosition( light.matrixWorld ); - result.nearDistance = shadowCameraNear; - result.farDistance = shadowCameraFar; - - } - - return result; - - } - - function renderObject( object, camera, shadowCamera, light, type ) { - - if ( object.visible === false ) return; - - var visible = object.layers.test( camera.layers ); - - if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) { - - if ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) { - - object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld ); - - var geometry = _objects.update( object ); - var material = object.material; - - if ( Array.isArray( material ) ) { - - var groups = geometry.groups; - - for ( var k = 0, kl = groups.length; k < kl; k ++ ) { - - var group = groups[ k ]; - var groupMaterial = material[ group.materialIndex ]; - - if ( groupMaterial && groupMaterial.visible ) { - - var depthMaterial = getDepthMaterial( object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type ); - - _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group ); - - } - - } - - } else if ( material.visible ) { - - var depthMaterial = getDepthMaterial( object, material, light, shadowCamera.near, shadowCamera.far, type ); - - _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null ); - - } - - } - - } - - var children = object.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - renderObject( children[ i ], camera, shadowCamera, light, type ); - - } - - } - -} - - -export { WebGLShadowMap }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLState.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLState.d.ts deleted file mode 100644 index 57c8f63b60..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLState.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { CullFace, Blending, BlendingEquation, BlendingSrcFactor, BlendingDstFactor, DepthModes } from '../../constants'; -import { WebGLCapabilities } from './WebGLCapabilities'; -import { WebGLExtensions } from './WebGLExtensions'; -import { Material } from '../../materials/Material'; -import { Vector4 } from '../../math/Vector4'; - -export class WebGLColorBuffer { - - constructor(); - - setMask( colorMask: boolean ): void; - setLocked( lock: boolean ): void; - setClear( r: number, g: number, b: number, a: number, premultipliedAlpha: boolean ): void; - reset(): void; - -} - -export class WebGLDepthBuffer { - - constructor(); - - setTest( depthTest: boolean ): void; - setMask( depthMask: boolean ): void; - setFunc( depthFunc: DepthModes ): void; - setLocked( lock: boolean ): void; - setClear( depth: number ): void; - reset(): void; - -} - -export class WebGLStencilBuffer { - - constructor(); - - setTest( stencilTest: boolean ): void; - setMask( stencilMask: number ): void; - setFunc( stencilFunc: number, stencilRef: number, stencilMask: number ): void; - setOp( stencilFail: number, stencilZFail: number, stencilZPass: number ): void; - setLocked( lock: boolean ): void; - setClear( stencil: number ): void; - reset(): void; - -} - -export class WebGLState { - - constructor( gl: WebGLRenderingContext, extensions: WebGLExtensions, utils: any, capabilities: WebGLCapabilities ); - - buffers: { - color: WebGLColorBuffer; - depth: WebGLDepthBuffer; - stencil: WebGLStencilBuffer; - }; - - initAttributes(): void; - enableAttribute( attribute: number ): void; - enableAttributeAndDivisor( attribute: number, meshPerAttribute: number ): void; - disableUnusedAttributes(): void; - enable( id: number ): void; - disable( id: number ): void; - getCompressedTextureFormats(): number[]; - useProgram( program: any ): boolean; - setBlending( - blending: Blending, - blendEquation?: BlendingEquation, - blendSrc?: BlendingSrcFactor, - blendDst?: BlendingDstFactor, - blendEquationAlpha?: BlendingEquation, - blendSrcAlpha?: BlendingSrcFactor, - blendDstAlpha?: BlendingDstFactor, - premultiplyAlpha?: boolean - ): void; - setMaterial( material: Material, frontFaceCW: boolean ): void; - setFlipSided( flipSided: boolean ): void; - setCullFace( cullFace: CullFace ): void; - setLineWidth( width: number ): void; - setPolygonOffset( polygonoffset: boolean, factor: number, units: number ): void; - setScissorTest( scissorTest: boolean ): void; - activeTexture( webglSlot: number ): void; - bindTexture( webglType: number, webglTexture: any ): void; - // Same interface as https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/compressedTexImage2D - compressedTexImage2D( - target: number, - level: number, - internalformat: number, - width: number, - height: number, - border: number, - data: ArrayBufferView - ): void; - // Same interface as https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D - texImage2D( - target: number, - level: number, - internalformat: number, - width: number, - height: number, - border: number, - format: number, - type: number, - pixels: ArrayBufferView | null - ): void; - texImage2D( - target: number, - level: number, - internalformat: number, - format: number, - type: number, - source: any - ): void; - texImage3D( - target: number, - level: number, - internalformat: number, - width: number, - height: number, - depth: number, - border: number, - format: number, - type: number, - pixels: any - ): void; - scissor( scissor: Vector4 ): void; - viewport( viewport: Vector4 ): void; - reset(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLState.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLState.js deleted file mode 100644 index 435e287290..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLState.js +++ /dev/null @@ -1,991 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessEqualDepth, LessDepth, AlwaysDepth, NeverDepth, CullFaceFront, CullFaceBack, CullFaceNone, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, NoBlending, NormalBlending, AddEquation, DoubleSide, BackSide } from '../../constants.js'; -import { Vector4 } from '../../math/Vector4.js'; - -function WebGLState( gl, extensions, utils, capabilities ) { - - function ColorBuffer() { - - var locked = false; - - var color = new Vector4(); - var currentColorMask = null; - var currentColorClear = new Vector4( 0, 0, 0, 0 ); - - return { - - setMask: function ( colorMask ) { - - if ( currentColorMask !== colorMask && ! locked ) { - - gl.colorMask( colorMask, colorMask, colorMask, colorMask ); - currentColorMask = colorMask; - - } - - }, - - setLocked: function ( lock ) { - - locked = lock; - - }, - - setClear: function ( r, g, b, a, premultipliedAlpha ) { - - if ( premultipliedAlpha === true ) { - - r *= a; g *= a; b *= a; - - } - - color.set( r, g, b, a ); - - if ( currentColorClear.equals( color ) === false ) { - - gl.clearColor( r, g, b, a ); - currentColorClear.copy( color ); - - } - - }, - - reset: function () { - - locked = false; - - currentColorMask = null; - currentColorClear.set( - 1, 0, 0, 0 ); // set to invalid state - - } - - }; - - } - - function DepthBuffer() { - - var locked = false; - - var currentDepthMask = null; - var currentDepthFunc = null; - var currentDepthClear = null; - - return { - - setTest: function ( depthTest ) { - - if ( depthTest ) { - - enable( gl.DEPTH_TEST ); - - } else { - - disable( gl.DEPTH_TEST ); - - } - - }, - - setMask: function ( depthMask ) { - - if ( currentDepthMask !== depthMask && ! locked ) { - - gl.depthMask( depthMask ); - currentDepthMask = depthMask; - - } - - }, - - setFunc: function ( depthFunc ) { - - if ( currentDepthFunc !== depthFunc ) { - - if ( depthFunc ) { - - switch ( depthFunc ) { - - case NeverDepth: - - gl.depthFunc( gl.NEVER ); - break; - - case AlwaysDepth: - - gl.depthFunc( gl.ALWAYS ); - break; - - case LessDepth: - - gl.depthFunc( gl.LESS ); - break; - - case LessEqualDepth: - - gl.depthFunc( gl.LEQUAL ); - break; - - case EqualDepth: - - gl.depthFunc( gl.EQUAL ); - break; - - case GreaterEqualDepth: - - gl.depthFunc( gl.GEQUAL ); - break; - - case GreaterDepth: - - gl.depthFunc( gl.GREATER ); - break; - - case NotEqualDepth: - - gl.depthFunc( gl.NOTEQUAL ); - break; - - default: - - gl.depthFunc( gl.LEQUAL ); - - } - - } else { - - gl.depthFunc( gl.LEQUAL ); - - } - - currentDepthFunc = depthFunc; - - } - - }, - - setLocked: function ( lock ) { - - locked = lock; - - }, - - setClear: function ( depth ) { - - if ( currentDepthClear !== depth ) { - - gl.clearDepth( depth ); - currentDepthClear = depth; - - } - - }, - - reset: function () { - - locked = false; - - currentDepthMask = null; - currentDepthFunc = null; - currentDepthClear = null; - - } - - }; - - } - - function StencilBuffer() { - - var locked = false; - - var currentStencilMask = null; - var currentStencilFunc = null; - var currentStencilRef = null; - var currentStencilFuncMask = null; - var currentStencilFail = null; - var currentStencilZFail = null; - var currentStencilZPass = null; - var currentStencilClear = null; - - return { - - setTest: function ( stencilTest ) { - - if ( ! locked ) { - - if ( stencilTest ) { - - enable( gl.STENCIL_TEST ); - - } else { - - disable( gl.STENCIL_TEST ); - - } - - } - - }, - - setMask: function ( stencilMask ) { - - if ( currentStencilMask !== stencilMask && ! locked ) { - - gl.stencilMask( stencilMask ); - currentStencilMask = stencilMask; - - } - - }, - - setFunc: function ( stencilFunc, stencilRef, stencilMask ) { - - if ( currentStencilFunc !== stencilFunc || - currentStencilRef !== stencilRef || - currentStencilFuncMask !== stencilMask ) { - - gl.stencilFunc( stencilFunc, stencilRef, stencilMask ); - - currentStencilFunc = stencilFunc; - currentStencilRef = stencilRef; - currentStencilFuncMask = stencilMask; - - } - - }, - - setOp: function ( stencilFail, stencilZFail, stencilZPass ) { - - if ( currentStencilFail !== stencilFail || - currentStencilZFail !== stencilZFail || - currentStencilZPass !== stencilZPass ) { - - gl.stencilOp( stencilFail, stencilZFail, stencilZPass ); - - currentStencilFail = stencilFail; - currentStencilZFail = stencilZFail; - currentStencilZPass = stencilZPass; - - } - - }, - - setLocked: function ( lock ) { - - locked = lock; - - }, - - setClear: function ( stencil ) { - - if ( currentStencilClear !== stencil ) { - - gl.clearStencil( stencil ); - currentStencilClear = stencil; - - } - - }, - - reset: function () { - - locked = false; - - currentStencilMask = null; - currentStencilFunc = null; - currentStencilRef = null; - currentStencilFuncMask = null; - currentStencilFail = null; - currentStencilZFail = null; - currentStencilZPass = null; - currentStencilClear = null; - - } - - }; - - } - - // - - var colorBuffer = new ColorBuffer(); - var depthBuffer = new DepthBuffer(); - var stencilBuffer = new StencilBuffer(); - - var maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS ); - var newAttributes = new Uint8Array( maxVertexAttributes ); - var enabledAttributes = new Uint8Array( maxVertexAttributes ); - var attributeDivisors = new Uint8Array( maxVertexAttributes ); - - var enabledCapabilities = {}; - - var compressedTextureFormats = null; - - var currentProgram = null; - - var currentBlendingEnabled = null; - var currentBlending = null; - var currentBlendEquation = null; - var currentBlendSrc = null; - var currentBlendDst = null; - var currentBlendEquationAlpha = null; - var currentBlendSrcAlpha = null; - var currentBlendDstAlpha = null; - var currentPremultipledAlpha = false; - - var currentFlipSided = null; - var currentCullFace = null; - - var currentLineWidth = null; - - var currentPolygonOffsetFactor = null; - var currentPolygonOffsetUnits = null; - - var maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS ); - - var lineWidthAvailable = false; - var version = 0; - var glVersion = gl.getParameter( gl.VERSION ); - - if ( glVersion.indexOf( 'WebGL' ) !== - 1 ) { - - version = parseFloat( /^WebGL\ ([0-9])/.exec( glVersion )[ 1 ] ); - lineWidthAvailable = ( version >= 1.0 ); - - } else if ( glVersion.indexOf( 'OpenGL ES' ) !== - 1 ) { - - version = parseFloat( /^OpenGL\ ES\ ([0-9])/.exec( glVersion )[ 1 ] ); - lineWidthAvailable = ( version >= 2.0 ); - - } - - var currentTextureSlot = null; - var currentBoundTextures = {}; - - var currentScissor = new Vector4(); - var currentViewport = new Vector4(); - - function createTexture( type, target, count ) { - - var data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4. - var texture = gl.createTexture(); - - gl.bindTexture( type, texture ); - gl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST ); - gl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST ); - - for ( var i = 0; i < count; i ++ ) { - - gl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data ); - - } - - return texture; - - } - - var emptyTextures = {}; - emptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 ); - emptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 ); - - // init - - colorBuffer.setClear( 0, 0, 0, 1 ); - depthBuffer.setClear( 1 ); - stencilBuffer.setClear( 0 ); - - enable( gl.DEPTH_TEST ); - depthBuffer.setFunc( LessEqualDepth ); - - setFlipSided( false ); - setCullFace( CullFaceBack ); - enable( gl.CULL_FACE ); - - setBlending( NoBlending ); - - // - - function initAttributes() { - - for ( var i = 0, l = newAttributes.length; i < l; i ++ ) { - - newAttributes[ i ] = 0; - - } - - } - - function enableAttribute( attribute ) { - - enableAttributeAndDivisor( attribute, 0 ); - - } - - function enableAttributeAndDivisor( attribute, meshPerAttribute ) { - - newAttributes[ attribute ] = 1; - - if ( enabledAttributes[ attribute ] === 0 ) { - - gl.enableVertexAttribArray( attribute ); - enabledAttributes[ attribute ] = 1; - - } - - if ( attributeDivisors[ attribute ] !== meshPerAttribute ) { - - var extension = capabilities.isWebGL2 ? gl : extensions.get( 'ANGLE_instanced_arrays' ); - - extension[ capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE' ]( attribute, meshPerAttribute ); - attributeDivisors[ attribute ] = meshPerAttribute; - - } - - } - - function disableUnusedAttributes() { - - for ( var i = 0, l = enabledAttributes.length; i !== l; ++ i ) { - - if ( enabledAttributes[ i ] !== newAttributes[ i ] ) { - - gl.disableVertexAttribArray( i ); - enabledAttributes[ i ] = 0; - - } - - } - - } - - function enable( id ) { - - if ( enabledCapabilities[ id ] !== true ) { - - gl.enable( id ); - enabledCapabilities[ id ] = true; - - } - - } - - function disable( id ) { - - if ( enabledCapabilities[ id ] !== false ) { - - gl.disable( id ); - enabledCapabilities[ id ] = false; - - } - - } - - function getCompressedTextureFormats() { - - if ( compressedTextureFormats === null ) { - - compressedTextureFormats = []; - - if ( extensions.get( 'WEBGL_compressed_texture_pvrtc' ) || - extensions.get( 'WEBGL_compressed_texture_s3tc' ) || - extensions.get( 'WEBGL_compressed_texture_etc1' ) || - extensions.get( 'WEBGL_compressed_texture_astc' ) ) { - - var formats = gl.getParameter( gl.COMPRESSED_TEXTURE_FORMATS ); - - for ( var i = 0; i < formats.length; i ++ ) { - - compressedTextureFormats.push( formats[ i ] ); - - } - - } - - } - - return compressedTextureFormats; - - } - - function useProgram( program ) { - - if ( currentProgram !== program ) { - - gl.useProgram( program ); - - currentProgram = program; - - return true; - - } - - return false; - - } - - function setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha ) { - - if ( blending === NoBlending ) { - - if ( currentBlendingEnabled ) { - - disable( gl.BLEND ); - currentBlendingEnabled = false; - - } - - return; - - } - - if ( ! currentBlendingEnabled ) { - - enable( gl.BLEND ); - currentBlendingEnabled = true; - - } - - if ( blending !== CustomBlending ) { - - if ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) { - - if ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) { - - gl.blendEquation( gl.FUNC_ADD ); - - currentBlendEquation = AddEquation; - currentBlendEquationAlpha = AddEquation; - - } - - if ( premultipliedAlpha ) { - - switch ( blending ) { - - case NormalBlending: - gl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); - break; - - case AdditiveBlending: - gl.blendFunc( gl.ONE, gl.ONE ); - break; - - case SubtractiveBlending: - gl.blendFuncSeparate( gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA ); - break; - - case MultiplyBlending: - gl.blendFuncSeparate( gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA ); - break; - - default: - console.error( 'THREE.WebGLState: Invalid blending: ', blending ); - break; - - } - - } else { - - switch ( blending ) { - - case NormalBlending: - gl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA ); - break; - - case AdditiveBlending: - gl.blendFunc( gl.SRC_ALPHA, gl.ONE ); - break; - - case SubtractiveBlending: - gl.blendFunc( gl.ZERO, gl.ONE_MINUS_SRC_COLOR ); - break; - - case MultiplyBlending: - gl.blendFunc( gl.ZERO, gl.SRC_COLOR ); - break; - - default: - console.error( 'THREE.WebGLState: Invalid blending: ', blending ); - break; - - } - - } - - currentBlendSrc = null; - currentBlendDst = null; - currentBlendSrcAlpha = null; - currentBlendDstAlpha = null; - - currentBlending = blending; - currentPremultipledAlpha = premultipliedAlpha; - - } - - return; - - } - - // custom blending - - blendEquationAlpha = blendEquationAlpha || blendEquation; - blendSrcAlpha = blendSrcAlpha || blendSrc; - blendDstAlpha = blendDstAlpha || blendDst; - - if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) { - - gl.blendEquationSeparate( utils.convert( blendEquation ), utils.convert( blendEquationAlpha ) ); - - currentBlendEquation = blendEquation; - currentBlendEquationAlpha = blendEquationAlpha; - - } - - if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) { - - gl.blendFuncSeparate( utils.convert( blendSrc ), utils.convert( blendDst ), utils.convert( blendSrcAlpha ), utils.convert( blendDstAlpha ) ); - - currentBlendSrc = blendSrc; - currentBlendDst = blendDst; - currentBlendSrcAlpha = blendSrcAlpha; - currentBlendDstAlpha = blendDstAlpha; - - } - - currentBlending = blending; - currentPremultipledAlpha = null; - - } - - function setMaterial( material, frontFaceCW ) { - - material.side === DoubleSide - ? disable( gl.CULL_FACE ) - : enable( gl.CULL_FACE ); - - var flipSided = ( material.side === BackSide ); - if ( frontFaceCW ) flipSided = ! flipSided; - - setFlipSided( flipSided ); - - ( material.blending === NormalBlending && material.transparent === false ) - ? setBlending( NoBlending ) - : setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha ); - - depthBuffer.setFunc( material.depthFunc ); - depthBuffer.setTest( material.depthTest ); - depthBuffer.setMask( material.depthWrite ); - colorBuffer.setMask( material.colorWrite ); - - var stencilWrite = material.stencilWrite; - stencilBuffer.setTest( stencilWrite ); - if ( stencilWrite ) { - - stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask ); - stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); - - } - - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - - } - - // - - function setFlipSided( flipSided ) { - - if ( currentFlipSided !== flipSided ) { - - if ( flipSided ) { - - gl.frontFace( gl.CW ); - - } else { - - gl.frontFace( gl.CCW ); - - } - - currentFlipSided = flipSided; - - } - - } - - function setCullFace( cullFace ) { - - if ( cullFace !== CullFaceNone ) { - - enable( gl.CULL_FACE ); - - if ( cullFace !== currentCullFace ) { - - if ( cullFace === CullFaceBack ) { - - gl.cullFace( gl.BACK ); - - } else if ( cullFace === CullFaceFront ) { - - gl.cullFace( gl.FRONT ); - - } else { - - gl.cullFace( gl.FRONT_AND_BACK ); - - } - - } - - } else { - - disable( gl.CULL_FACE ); - - } - - currentCullFace = cullFace; - - } - - function setLineWidth( width ) { - - if ( width !== currentLineWidth ) { - - if ( lineWidthAvailable ) gl.lineWidth( width ); - - currentLineWidth = width; - - } - - } - - function setPolygonOffset( polygonOffset, factor, units ) { - - if ( polygonOffset ) { - - enable( gl.POLYGON_OFFSET_FILL ); - - if ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) { - - gl.polygonOffset( factor, units ); - - currentPolygonOffsetFactor = factor; - currentPolygonOffsetUnits = units; - - } - - } else { - - disable( gl.POLYGON_OFFSET_FILL ); - - } - - } - - function setScissorTest( scissorTest ) { - - if ( scissorTest ) { - - enable( gl.SCISSOR_TEST ); - - } else { - - disable( gl.SCISSOR_TEST ); - - } - - } - - // texture - - function activeTexture( webglSlot ) { - - if ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1; - - if ( currentTextureSlot !== webglSlot ) { - - gl.activeTexture( webglSlot ); - currentTextureSlot = webglSlot; - - } - - } - - function bindTexture( webglType, webglTexture ) { - - if ( currentTextureSlot === null ) { - - activeTexture(); - - } - - var boundTexture = currentBoundTextures[ currentTextureSlot ]; - - if ( boundTexture === undefined ) { - - boundTexture = { type: undefined, texture: undefined }; - currentBoundTextures[ currentTextureSlot ] = boundTexture; - - } - - if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) { - - gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] ); - - boundTexture.type = webglType; - boundTexture.texture = webglTexture; - - } - - } - - function compressedTexImage2D() { - - try { - - gl.compressedTexImage2D.apply( gl, arguments ); - - } catch ( error ) { - - console.error( 'THREE.WebGLState:', error ); - - } - - } - - function texImage2D() { - - try { - - gl.texImage2D.apply( gl, arguments ); - - } catch ( error ) { - - console.error( 'THREE.WebGLState:', error ); - - } - - } - - function texImage3D() { - - try { - - gl.texImage3D.apply( gl, arguments ); - - } catch ( error ) { - - console.error( 'THREE.WebGLState:', error ); - - } - - } - - // - - function scissor( scissor ) { - - if ( currentScissor.equals( scissor ) === false ) { - - gl.scissor( scissor.x, scissor.y, scissor.z, scissor.w ); - currentScissor.copy( scissor ); - - } - - } - - function viewport( viewport ) { - - if ( currentViewport.equals( viewport ) === false ) { - - gl.viewport( viewport.x, viewport.y, viewport.z, viewport.w ); - currentViewport.copy( viewport ); - - } - - } - - // - - function reset() { - - for ( var i = 0; i < enabledAttributes.length; i ++ ) { - - if ( enabledAttributes[ i ] === 1 ) { - - gl.disableVertexAttribArray( i ); - enabledAttributes[ i ] = 0; - - } - - } - - enabledCapabilities = {}; - - compressedTextureFormats = null; - - currentTextureSlot = null; - currentBoundTextures = {}; - - currentProgram = null; - - currentBlending = null; - - currentFlipSided = null; - currentCullFace = null; - - colorBuffer.reset(); - depthBuffer.reset(); - stencilBuffer.reset(); - - } - - return { - - buffers: { - color: colorBuffer, - depth: depthBuffer, - stencil: stencilBuffer - }, - - initAttributes: initAttributes, - enableAttribute: enableAttribute, - enableAttributeAndDivisor: enableAttributeAndDivisor, - disableUnusedAttributes: disableUnusedAttributes, - enable: enable, - disable: disable, - getCompressedTextureFormats: getCompressedTextureFormats, - - useProgram: useProgram, - - setBlending: setBlending, - setMaterial: setMaterial, - - setFlipSided: setFlipSided, - setCullFace: setCullFace, - - setLineWidth: setLineWidth, - setPolygonOffset: setPolygonOffset, - - setScissorTest: setScissorTest, - - activeTexture: activeTexture, - bindTexture: bindTexture, - compressedTexImage2D: compressedTexImage2D, - texImage2D: texImage2D, - texImage3D: texImage3D, - - scissor: scissor, - viewport: viewport, - - reset: reset - - }; - -} - - -export { WebGLState }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.d.ts deleted file mode 100644 index f8ef23999f..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export class WebGLTextures { - - constructor( - gl: any, - extensions: any, - state: any, - properties: any, - capabilities: any, - paramThreeToGL: Function, - info: any - ); - - setTexture2D( texture: any, slot: number ): void; - setTextureCube( texture: any, slot: number ): void; - setTextureCubeDynamic( texture: any, slot: number ): void; - setupRenderTarget( renderTarget: any ): void; - updateRenderTargetMipmap( renderTarget: any ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.js deleted file mode 100644 index 238d51b5f9..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLTextures.js +++ /dev/null @@ -1,1197 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { LinearFilter, NearestFilter, RGBFormat, RGBAFormat, DepthFormat, DepthStencilFormat, UnsignedShortType, UnsignedIntType, UnsignedInt248Type, FloatType, HalfFloatType, ClampToEdgeWrapping, NearestMipmapLinearFilter, NearestMipmapNearestFilter } from '../../constants.js'; -import { _Math } from '../../math/Math.js'; - -function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) { - - var _videoTextures = new WeakMap(); - var _canvas; - - // - - var useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'; - - function createCanvas( width, height ) { - - // Use OffscreenCanvas when available. Specially needed in web workers - - return useOffscreenCanvas ? - new OffscreenCanvas( width, height ) : - document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' ); - - } - - function resizeImage( image, needsPowerOfTwo, needsNewCanvas, maxSize ) { - - var scale = 1; - - // handle case if texture exceeds max size - - if ( image.width > maxSize || image.height > maxSize ) { - - scale = maxSize / Math.max( image.width, image.height ); - - } - - // only perform resize if necessary - - if ( scale < 1 || needsPowerOfTwo === true ) { - - // only perform resize for certain image types - - if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) || - ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) || - ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) { - - var floor = needsPowerOfTwo ? _Math.floorPowerOfTwo : Math.floor; - - var width = floor( scale * image.width ); - var height = floor( scale * image.height ); - - if ( _canvas === undefined ) _canvas = createCanvas( width, height ); - - // cube textures can't reuse the same canvas - - var canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas; - - canvas.width = width; - canvas.height = height; - - var context = canvas.getContext( '2d' ); - context.drawImage( image, 0, 0, width, height ); - - console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' ); - - return canvas; - - } else { - - if ( 'data' in image ) { - - console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' ); - - } - - return image; - - } - - } - - return image; - - } - - function isPowerOfTwo( image ) { - - return _Math.isPowerOfTwo( image.width ) && _Math.isPowerOfTwo( image.height ); - - } - - function textureNeedsPowerOfTwo( texture ) { - - if ( capabilities.isWebGL2 ) return false; - - return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) || - ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ); - - } - - function textureNeedsGenerateMipmaps( texture, supportsMips ) { - - return texture.generateMipmaps && supportsMips && - texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter; - - } - - function generateMipmap( target, texture, width, height ) { - - _gl.generateMipmap( target ); - - var textureProperties = properties.get( texture ); - - // Note: Math.log( x ) * Math.LOG2E used instead of Math.log2( x ) which is not supported by IE11 - textureProperties.__maxMipLevel = Math.log( Math.max( width, height ) ) * Math.LOG2E; - - } - - function getInternalFormat( glFormat, glType ) { - - if ( ! capabilities.isWebGL2 ) return glFormat; - - var internalFormat = glFormat; - - if ( glFormat === _gl.RED ) { - - if ( glType === _gl.FLOAT ) internalFormat = _gl.R32F; - if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.R16F; - if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8; - - } - - if ( glFormat === _gl.RGB ) { - - if ( glType === _gl.FLOAT ) internalFormat = _gl.RGB32F; - if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGB16F; - if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGB8; - - } - - if ( glFormat === _gl.RGBA ) { - - if ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F; - if ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F; - if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGBA8; - - } - - if ( internalFormat === _gl.R16F || internalFormat === _gl.R32F || - internalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F ) { - - extensions.get( 'EXT_color_buffer_float' ); - - } else if ( internalFormat === _gl.RGB16F || internalFormat === _gl.RGB32F ) { - - console.warn( 'THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.' ); - - } - - return internalFormat; - - } - - // Fallback filters for non-power-of-2 textures - - function filterFallback( f ) { - - if ( f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter ) { - - return _gl.NEAREST; - - } - - return _gl.LINEAR; - - } - - // - - function onTextureDispose( event ) { - - var texture = event.target; - - texture.removeEventListener( 'dispose', onTextureDispose ); - - deallocateTexture( texture ); - - if ( texture.isVideoTexture ) { - - _videoTextures.delete( texture ); - - } - - info.memory.textures --; - - } - - function onRenderTargetDispose( event ) { - - var renderTarget = event.target; - - renderTarget.removeEventListener( 'dispose', onRenderTargetDispose ); - - deallocateRenderTarget( renderTarget ); - - info.memory.textures --; - - } - - // - - function deallocateTexture( texture ) { - - var textureProperties = properties.get( texture ); - - if ( textureProperties.__webglInit === undefined ) return; - - _gl.deleteTexture( textureProperties.__webglTexture ); - - properties.remove( texture ); - - } - - function deallocateRenderTarget( renderTarget ) { - - var renderTargetProperties = properties.get( renderTarget ); - var textureProperties = properties.get( renderTarget.texture ); - - if ( ! renderTarget ) return; - - if ( textureProperties.__webglTexture !== undefined ) { - - _gl.deleteTexture( textureProperties.__webglTexture ); - - } - - if ( renderTarget.depthTexture ) { - - renderTarget.depthTexture.dispose(); - - } - - if ( renderTarget.isWebGLRenderTargetCube ) { - - for ( var i = 0; i < 6; i ++ ) { - - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] ); - if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] ); - - } - - } else { - - _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer ); - if ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer ); - - } - - properties.remove( renderTarget.texture ); - properties.remove( renderTarget ); - - } - - // - - var textureUnits = 0; - - function resetTextureUnits() { - - textureUnits = 0; - - } - - function allocateTextureUnit() { - - var textureUnit = textureUnits; - - if ( textureUnit >= capabilities.maxTextures ) { - - console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); - - } - - textureUnits += 1; - - return textureUnit; - - } - - // - - function setTexture2D( texture, slot ) { - - var textureProperties = properties.get( texture ); - - if ( texture.isVideoTexture ) updateVideoTexture( texture ); - - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - - var image = texture.image; - - if ( image === undefined ) { - - console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined' ); - - } else if ( image.complete === false ) { - - console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' ); - - } else { - - uploadTexture( textureProperties, texture, slot ); - return; - - } - - } - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); - - } - - function setTexture2DArray( texture, slot ) { - - var textureProperties = properties.get( texture ); - - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - - uploadTexture( textureProperties, texture, slot ); - return; - - } - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture ); - - } - - function setTexture3D( texture, slot ) { - - var textureProperties = properties.get( texture ); - - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - - uploadTexture( textureProperties, texture, slot ); - return; - - } - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_3D, textureProperties.__webglTexture ); - - } - - function setTextureCube( texture, slot ) { - - if ( texture.image.length !== 6 ) return; - - var textureProperties = properties.get( texture ); - - if ( texture.version > 0 && textureProperties.__version !== texture.version ) { - - initTexture( textureProperties, texture ); - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); - - _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); - - var isCompressed = ( texture && texture.isCompressedTexture ); - var isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture ); - - var cubeImage = []; - - for ( var i = 0; i < 6; i ++ ) { - - if ( ! isCompressed && ! isDataTexture ) { - - cubeImage[ i ] = resizeImage( texture.image[ i ], false, true, capabilities.maxCubemapSize ); - - } else { - - cubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ]; - - } - - } - - var image = cubeImage[ 0 ], - supportsMips = isPowerOfTwo( image ) || capabilities.isWebGL2, - glFormat = utils.convert( texture.format ), - glType = utils.convert( texture.type ), - glInternalFormat = getInternalFormat( glFormat, glType ); - - setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips ); - - var mipmaps; - - if ( isCompressed ) { - - for ( var i = 0; i < 6; i ++ ) { - - mipmaps = cubeImage[ i ].mipmaps; - - for ( var j = 0; j < mipmaps.length; j ++ ) { - - var mipmap = mipmaps[ j ]; - - if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { - - if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { - - state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); - - } else { - - console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' ); - - } - - } else { - - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - - } - - } - - } - - textureProperties.__maxMipLevel = mipmaps.length - 1; - - } else { - - mipmaps = texture.mipmaps; - - for ( var i = 0; i < 6; i ++ ) { - - if ( isDataTexture ) { - - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); - - for ( var j = 0; j < mipmaps.length; j ++ ) { - - var mipmap = mipmaps[ j ]; - var mipmapImage = mipmap.image[ i ].image; - - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data ); - - } - - } else { - - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] ); - - for ( var j = 0; j < mipmaps.length; j ++ ) { - - var mipmap = mipmaps[ j ]; - - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] ); - - } - - } - - } - - textureProperties.__maxMipLevel = mipmaps.length; - - } - - if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - - // We assume images for cube map have the same size. - generateMipmap( _gl.TEXTURE_CUBE_MAP, texture, image.width, image.height ); - - } - - textureProperties.__version = texture.version; - - if ( texture.onUpdate ) texture.onUpdate( texture ); - - } else { - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); - - } - - } - - function setTextureCubeDynamic( texture, slot ) { - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( _gl.TEXTURE_CUBE_MAP, properties.get( texture ).__webglTexture ); - - } - - function setTextureParameters( textureType, texture, supportsMips ) { - - var extension; - - if ( supportsMips ) { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, utils.convert( texture.wrapS ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, utils.convert( texture.wrapT ) ); - - if ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, utils.convert( texture.wrapR ) ); - - } - - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, utils.convert( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, utils.convert( texture.minFilter ) ); - - } else { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - - if ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, _gl.CLAMP_TO_EDGE ); - - } - - if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) { - - console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' ); - - } - - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) ); - - if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) { - - console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.' ); - - } - - } - - extension = extensions.get( 'EXT_texture_filter_anisotropic' ); - - if ( extension ) { - - if ( texture.type === FloatType && extensions.get( 'OES_texture_float_linear' ) === null ) return; - if ( texture.type === HalfFloatType && ( capabilities.isWebGL2 || extensions.get( 'OES_texture_half_float_linear' ) ) === null ) return; - - if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) { - - _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) ); - properties.get( texture ).__currentAnisotropy = texture.anisotropy; - - } - - } - - } - - function initTexture( textureProperties, texture ) { - - if ( textureProperties.__webglInit === undefined ) { - - textureProperties.__webglInit = true; - - texture.addEventListener( 'dispose', onTextureDispose ); - - textureProperties.__webglTexture = _gl.createTexture(); - - info.memory.textures ++; - - } - - } - - function uploadTexture( textureProperties, texture, slot ) { - - var textureType = _gl.TEXTURE_2D; - - if ( texture.isDataTexture2DArray ) textureType = _gl.TEXTURE_2D_ARRAY; - if ( texture.isDataTexture3D ) textureType = _gl.TEXTURE_3D; - - initTexture( textureProperties, texture ); - - state.activeTexture( _gl.TEXTURE0 + slot ); - state.bindTexture( textureType, textureProperties.__webglTexture ); - - _gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY ); - _gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha ); - _gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment ); - - var needsPowerOfTwo = textureNeedsPowerOfTwo( texture ) && isPowerOfTwo( texture.image ) === false; - var image = resizeImage( texture.image, needsPowerOfTwo, false, capabilities.maxTextureSize ); - - var supportsMips = isPowerOfTwo( image ) || capabilities.isWebGL2, - glFormat = utils.convert( texture.format ), - glType = utils.convert( texture.type ), - glInternalFormat = getInternalFormat( glFormat, glType ); - - setTextureParameters( textureType, texture, supportsMips ); - - var mipmap, mipmaps = texture.mipmaps; - - if ( texture.isDepthTexture ) { - - // populate depth texture with dummy data - - glInternalFormat = _gl.DEPTH_COMPONENT; - - if ( texture.type === FloatType ) { - - if ( ! capabilities.isWebGL2 ) throw new Error( 'Float Depth Texture only supported in WebGL2.0' ); - glInternalFormat = _gl.DEPTH_COMPONENT32F; - - } else if ( capabilities.isWebGL2 ) { - - // WebGL 2.0 requires signed internalformat for glTexImage2D - glInternalFormat = _gl.DEPTH_COMPONENT16; - - } - - if ( texture.format === DepthFormat && glInternalFormat === _gl.DEPTH_COMPONENT ) { - - // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are - // DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.type !== UnsignedShortType && texture.type !== UnsignedIntType ) { - - console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ); - - texture.type = UnsignedShortType; - glType = utils.convert( texture.type ); - - } - - } - - // Depth stencil textures need the DEPTH_STENCIL internal format - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.format === DepthStencilFormat ) { - - glInternalFormat = _gl.DEPTH_STENCIL; - - // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are - // DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL. - // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) - if ( texture.type !== UnsignedInt248Type ) { - - console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ); - - texture.type = UnsignedInt248Type; - glType = utils.convert( texture.type ); - - } - - } - - state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null ); - - } else if ( texture.isDataTexture ) { - - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels - - if ( mipmaps.length > 0 && supportsMips ) { - - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { - - mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - - } - - texture.generateMipmaps = false; - textureProperties.__maxMipLevel = mipmaps.length - 1; - - } else { - - state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data ); - textureProperties.__maxMipLevel = 0; - - } - - } else if ( texture.isCompressedTexture ) { - - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { - - mipmap = mipmaps[ i ]; - - if ( texture.format !== RGBAFormat && texture.format !== RGBFormat ) { - - if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { - - state.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); - - } else { - - console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' ); - - } - - } else { - - state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); - - } - - } - - textureProperties.__maxMipLevel = mipmaps.length - 1; - - } else if ( texture.isDataTexture2DArray ) { - - state.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); - textureProperties.__maxMipLevel = 0; - - } else if ( texture.isDataTexture3D ) { - - state.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data ); - textureProperties.__maxMipLevel = 0; - - } else { - - // regular Texture (image, video, canvas) - - // use manually created mipmaps if available - // if there are no manual mipmaps - // set 0 level mipmap and then use GL to generate other mipmap levels - - if ( mipmaps.length > 0 && supportsMips ) { - - for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { - - mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap ); - - } - - texture.generateMipmaps = false; - textureProperties.__maxMipLevel = mipmaps.length - 1; - - } else { - - state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image ); - textureProperties.__maxMipLevel = 0; - - } - - } - - if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - - generateMipmap( _gl.TEXTURE_2D, texture, image.width, image.height ); - - } - - textureProperties.__version = texture.version; - - if ( texture.onUpdate ) texture.onUpdate( texture ); - - } - - // Render targets - - // Setup storage for target texture and bind it to correct framebuffer - function setupFrameBufferTexture( framebuffer, renderTarget, attachment, textureTarget ) { - - var glFormat = utils.convert( renderTarget.texture.format ); - var glType = utils.convert( renderTarget.texture.type ); - var glInternalFormat = getInternalFormat( glFormat, glType ); - state.texImage2D( textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 ); - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); - - } - - // Setup storage for internal depth/stencil buffers and bind to correct framebuffer - function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) { - - _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer ); - - if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { - - if ( isMultisample ) { - - var samples = getRenderTargetSamples( renderTarget ); - - _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height ); - - } else { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height ); - - } - - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - - } else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { - - if ( isMultisample ) { - - var samples = getRenderTargetSamples( renderTarget ); - - _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height ); - - } else { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height ); - - } - - - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - - } else { - - var glFormat = utils.convert( renderTarget.texture.format ); - var glType = utils.convert( renderTarget.texture.type ); - var glInternalFormat = getInternalFormat( glFormat, glType ); - - if ( isMultisample ) { - - var samples = getRenderTargetSamples( renderTarget ); - - _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - - } else { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height ); - - } - - } - - _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); - - } - - // Setup resources for a Depth Texture for a FBO (needs an extension) - function setupDepthTexture( framebuffer, renderTarget ) { - - var isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube ); - if ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' ); - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - - if ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) { - - throw new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' ); - - } - - // upload an empty depth texture with framebuffer size - if ( ! properties.get( renderTarget.depthTexture ).__webglTexture || - renderTarget.depthTexture.image.width !== renderTarget.width || - renderTarget.depthTexture.image.height !== renderTarget.height ) { - - renderTarget.depthTexture.image.width = renderTarget.width; - renderTarget.depthTexture.image.height = renderTarget.height; - renderTarget.depthTexture.needsUpdate = true; - - } - - setTexture2D( renderTarget.depthTexture, 0 ); - - var webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture; - - if ( renderTarget.depthTexture.format === DepthFormat ) { - - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); - - } else if ( renderTarget.depthTexture.format === DepthStencilFormat ) { - - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 ); - - } else { - - throw new Error( 'Unknown depthTexture format' ); - - } - - } - - // Setup GL resources for a non-texture depth buffer - function setupDepthRenderbuffer( renderTarget ) { - - var renderTargetProperties = properties.get( renderTarget ); - - var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); - - if ( renderTarget.depthTexture ) { - - if ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' ); - - setupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget ); - - } else { - - if ( isCube ) { - - renderTargetProperties.__webglDepthbuffer = []; - - for ( var i = 0; i < 6; i ++ ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] ); - renderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer(); - setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget ); - - } - - } else { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); - renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer(); - setupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget ); - - } - - } - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); - - } - - // Set up GL resources for the render target - function setupRenderTarget( renderTarget ) { - - var renderTargetProperties = properties.get( renderTarget ); - var textureProperties = properties.get( renderTarget.texture ); - - renderTarget.addEventListener( 'dispose', onRenderTargetDispose ); - - textureProperties.__webglTexture = _gl.createTexture(); - - info.memory.textures ++; - - var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); - var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true ); - var supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2; - - // Setup framebuffer - - if ( isCube ) { - - renderTargetProperties.__webglFramebuffer = []; - - for ( var i = 0; i < 6; i ++ ) { - - renderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer(); - - } - - } else { - - renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer(); - - if ( isMultisample ) { - - if ( capabilities.isWebGL2 ) { - - renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer(); - renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer(); - - _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer ); - var glFormat = utils.convert( renderTarget.texture.format ); - var glType = utils.convert( renderTarget.texture.type ); - var glInternalFormat = getInternalFormat( glFormat, glType ); - var samples = getRenderTargetSamples( renderTarget ); - _gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height ); - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer ); - _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); - - if ( renderTarget.depthBuffer ) { - - renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer(); - setupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true ); - - } - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); - - - } else { - - console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' ); - - } - - } - - } - - // Setup color buffer - - if ( isCube ) { - - state.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, supportsMips ); - - for ( var i = 0; i < 6; i ++ ) { - - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); - - } - - if ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) { - - generateMipmap( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, renderTarget.width, renderTarget.height ); - - } - - state.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); - - } else { - - state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); - setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, supportsMips ); - setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D ); - - if ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) { - - generateMipmap( _gl.TEXTURE_2D, renderTarget.texture, renderTarget.width, renderTarget.height ); - - } - - state.bindTexture( _gl.TEXTURE_2D, null ); - - } - - // Setup depth and stencil buffers - - if ( renderTarget.depthBuffer ) { - - setupDepthRenderbuffer( renderTarget ); - - } - - } - - function updateRenderTargetMipmap( renderTarget ) { - - var texture = renderTarget.texture; - var supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2; - - if ( textureNeedsGenerateMipmaps( texture, supportsMips ) ) { - - var target = renderTarget.isWebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D; - var webglTexture = properties.get( texture ).__webglTexture; - - state.bindTexture( target, webglTexture ); - generateMipmap( target, texture, renderTarget.width, renderTarget.height ); - state.bindTexture( target, null ); - - } - - } - - function updateMultisampleRenderTarget( renderTarget ) { - - if ( renderTarget.isWebGLMultisampleRenderTarget ) { - - if ( capabilities.isWebGL2 ) { - - var renderTargetProperties = properties.get( renderTarget ); - - _gl.bindFramebuffer( _gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer ); - _gl.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); - - var width = renderTarget.width; - var height = renderTarget.height; - var mask = _gl.COLOR_BUFFER_BIT; - - if ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT; - if ( renderTarget.stencilBuffer ) mask |= _gl.STENCIL_BUFFER_BIT; - - _gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST ); - - } else { - - console.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' ); - - } - - } - - } - - function getRenderTargetSamples( renderTarget ) { - - return ( capabilities.isWebGL2 && renderTarget.isWebGLMultisampleRenderTarget ) ? - Math.min( capabilities.maxSamples, renderTarget.samples ) : 0; - - } - - function updateVideoTexture( texture ) { - - var frame = info.render.frame; - - // Check the last frame we updated the VideoTexture - - if ( _videoTextures.get( texture ) !== frame ) { - - _videoTextures.set( texture, frame ); - texture.update(); - - } - - } - - // backwards compatibility - - var warnedTexture2D = false; - var warnedTextureCube = false; - - function safeSetTexture2D( texture, slot ) { - - if ( texture && texture.isWebGLRenderTarget ) { - - if ( warnedTexture2D === false ) { - - console.warn( "THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead." ); - warnedTexture2D = true; - - } - - texture = texture.texture; - - } - - setTexture2D( texture, slot ); - - } - - function safeSetTextureCube( texture, slot ) { - - if ( texture && texture.isWebGLRenderTargetCube ) { - - if ( warnedTextureCube === false ) { - - console.warn( "THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); - warnedTextureCube = true; - - } - - texture = texture.texture; - - } - - // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture - // TODO: unify these code paths - if ( ( texture && texture.isCubeTexture ) || - ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { - - // CompressedTexture can have Array in image :/ - - // this function alone should take care of cube textures - setTextureCube( texture, slot ); - - } else { - - // assumed: texture property of THREE.WebGLRenderTargetCube - setTextureCubeDynamic( texture, slot ); - - } - - } - - // - - this.allocateTextureUnit = allocateTextureUnit; - this.resetTextureUnits = resetTextureUnits; - - this.setTexture2D = setTexture2D; - this.setTexture2DArray = setTexture2DArray; - this.setTexture3D = setTexture3D; - this.setTextureCube = setTextureCube; - this.setTextureCubeDynamic = setTextureCubeDynamic; - this.setupRenderTarget = setupRenderTarget; - this.updateRenderTargetMipmap = updateRenderTargetMipmap; - this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; - - this.safeSetTexture2D = safeSetTexture2D; - this.safeSetTextureCube = safeSetTextureCube; - -} - -export { WebGLTextures }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.d.ts deleted file mode 100644 index 6cfd72e2b6..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { WebGLProgram } from './WebGLProgram'; -import { WebGLTextures } from './WebGLTextures'; - -export class WebGLUniforms { - - constructor( gl: any, program: WebGLProgram ); - - setValue( gl: any, name: string, value: any, textures: WebGLTextures ): void; - setOptional( gl: any, object: any, name: string ): void; - - static upload( gl: any, seq: any, values: any[], textures: WebGLTextures ): void; - static seqWithValue( seq: any, values: any[] ): any[]; - static splitDynamic( seq: any, values: any[] ): any[]; - static evalDynamic( seq: any, values: any[], object: any, camera: any ): any[]; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.js deleted file mode 100644 index 2da068c5d2..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLUniforms.js +++ /dev/null @@ -1,848 +0,0 @@ -/** - * @author tschw - * @author Mugen87 / https://github.com/Mugen87 - * @author mrdoob / http://mrdoob.com/ - * - * Uniforms of a program. - * Those form a tree structure with a special top-level container for the root, - * which you get by calling 'new WebGLUniforms( gl, program )'. - * - * - * Properties of inner nodes including the top-level container: - * - * .seq - array of nested uniforms - * .map - nested uniforms by name - * - * - * Methods of all nodes except the top-level container: - * - * .setValue( gl, value, [textures] ) - * - * uploads a uniform value(s) - * the 'textures' parameter is needed for sampler uniforms - * - * - * Static methods of the top-level container (textures factorizations): - * - * .upload( gl, seq, values, textures ) - * - * sets uniforms in 'seq' to 'values[id].value' - * - * .seqWithValue( seq, values ) : filteredSeq - * - * filters 'seq' entries with corresponding entry in values - * - * - * Methods of the top-level container (textures factorizations): - * - * .setValue( gl, name, value, textures ) - * - * sets uniform with name 'name' to 'value' - * - * .setOptional( gl, obj, prop ) - * - * like .set for an optional property of the object - * - */ - -import { CubeTexture } from '../../textures/CubeTexture.js'; -import { Texture } from '../../textures/Texture.js'; -import { DataTexture2DArray } from '../../textures/DataTexture2DArray.js'; -import { DataTexture3D } from '../../textures/DataTexture3D.js'; - -var emptyTexture = new Texture(); -var emptyTexture2dArray = new DataTexture2DArray(); -var emptyTexture3d = new DataTexture3D(); -var emptyCubeTexture = new CubeTexture(); - -// --- Utilities --- - -// Array Caches (provide typed arrays for temporary by size) - -var arrayCacheF32 = []; -var arrayCacheI32 = []; - -// Float32Array caches used for uploading Matrix uniforms - -var mat4array = new Float32Array( 16 ); -var mat3array = new Float32Array( 9 ); -var mat2array = new Float32Array( 4 ); - -// Flattening for arrays of vectors and matrices - -function flatten( array, nBlocks, blockSize ) { - - var firstElem = array[ 0 ]; - - if ( firstElem <= 0 || firstElem > 0 ) return array; - // unoptimized: ! isNaN( firstElem ) - // see http://jacksondunstan.com/articles/983 - - var n = nBlocks * blockSize, - r = arrayCacheF32[ n ]; - - if ( r === undefined ) { - - r = new Float32Array( n ); - arrayCacheF32[ n ] = r; - - } - - if ( nBlocks !== 0 ) { - - firstElem.toArray( r, 0 ); - - for ( var i = 1, offset = 0; i !== nBlocks; ++ i ) { - - offset += blockSize; - array[ i ].toArray( r, offset ); - - } - - } - - return r; - -} - -function arraysEqual( a, b ) { - - if ( a.length !== b.length ) return false; - - for ( var i = 0, l = a.length; i < l; i ++ ) { - - if ( a[ i ] !== b[ i ] ) return false; - - } - - return true; - -} - -function copyArray( a, b ) { - - for ( var i = 0, l = b.length; i < l; i ++ ) { - - a[ i ] = b[ i ]; - - } - -} - -// Texture unit allocation - -function allocTexUnits( textures, n ) { - - var r = arrayCacheI32[ n ]; - - if ( r === undefined ) { - - r = new Int32Array( n ); - arrayCacheI32[ n ] = r; - - } - - for ( var i = 0; i !== n; ++ i ) - r[ i ] = textures.allocateTextureUnit(); - - return r; - -} - -// --- Setters --- - -// Note: Defining these methods externally, because they come in a bunch -// and this way their names minify. - -// Single scalar - -function setValueV1f( gl, v ) { - - var cache = this.cache; - - if ( cache[ 0 ] === v ) return; - - gl.uniform1f( this.addr, v ); - - cache[ 0 ] = v; - -} - -// Single float vector (from flat array or THREE.VectorN) - -function setValueV2f( gl, v ) { - - var cache = this.cache; - - if ( v.x !== undefined ) { - - if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) { - - gl.uniform2f( this.addr, v.x, v.y ); - - cache[ 0 ] = v.x; - cache[ 1 ] = v.y; - - } - - } else { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform2fv( this.addr, v ); - - copyArray( cache, v ); - - } - -} - -function setValueV3f( gl, v ) { - - var cache = this.cache; - - if ( v.x !== undefined ) { - - if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) { - - gl.uniform3f( this.addr, v.x, v.y, v.z ); - - cache[ 0 ] = v.x; - cache[ 1 ] = v.y; - cache[ 2 ] = v.z; - - } - - } else if ( v.r !== undefined ) { - - if ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) { - - gl.uniform3f( this.addr, v.r, v.g, v.b ); - - cache[ 0 ] = v.r; - cache[ 1 ] = v.g; - cache[ 2 ] = v.b; - - } - - } else { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform3fv( this.addr, v ); - - copyArray( cache, v ); - - } - -} - -function setValueV4f( gl, v ) { - - var cache = this.cache; - - if ( v.x !== undefined ) { - - if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) { - - gl.uniform4f( this.addr, v.x, v.y, v.z, v.w ); - - cache[ 0 ] = v.x; - cache[ 1 ] = v.y; - cache[ 2 ] = v.z; - cache[ 3 ] = v.w; - - } - - } else { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform4fv( this.addr, v ); - - copyArray( cache, v ); - - } - -} - -// Single matrix (from flat array or MatrixN) - -function setValueM2( gl, v ) { - - var cache = this.cache; - var elements = v.elements; - - if ( elements === undefined ) { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniformMatrix2fv( this.addr, false, v ); - - copyArray( cache, v ); - - } else { - - if ( arraysEqual( cache, elements ) ) return; - - mat2array.set( elements ); - - gl.uniformMatrix2fv( this.addr, false, mat2array ); - - copyArray( cache, elements ); - - } - -} - -function setValueM3( gl, v ) { - - var cache = this.cache; - var elements = v.elements; - - if ( elements === undefined ) { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniformMatrix3fv( this.addr, false, v ); - - copyArray( cache, v ); - - } else { - - if ( arraysEqual( cache, elements ) ) return; - - mat3array.set( elements ); - - gl.uniformMatrix3fv( this.addr, false, mat3array ); - - copyArray( cache, elements ); - - } - -} - -function setValueM4( gl, v ) { - - var cache = this.cache; - var elements = v.elements; - - if ( elements === undefined ) { - - if ( arraysEqual( cache, v ) ) return; - - gl.uniformMatrix4fv( this.addr, false, v ); - - copyArray( cache, v ); - - } else { - - if ( arraysEqual( cache, elements ) ) return; - - mat4array.set( elements ); - - gl.uniformMatrix4fv( this.addr, false, mat4array ); - - copyArray( cache, elements ); - - } - -} - -// Single texture (2D / Cube) - -function setValueT1( gl, v, textures ) { - - var cache = this.cache; - var unit = textures.allocateTextureUnit(); - - if ( cache[ 0 ] !== unit ) { - - gl.uniform1i( this.addr, unit ); - cache[ 0 ] = unit; - - } - - textures.safeSetTexture2D( v || emptyTexture, unit ); - -} - -function setValueT2DArray1( gl, v, textures ) { - - var cache = this.cache; - var unit = textures.allocateTextureUnit(); - - if ( cache[ 0 ] !== unit ) { - - gl.uniform1i( this.addr, unit ); - cache[ 0 ] = unit; - - } - - textures.setTexture2DArray( v || emptyTexture2dArray, unit ); - -} - -function setValueT3D1( gl, v, textures ) { - - var cache = this.cache; - var unit = textures.allocateTextureUnit(); - - if ( cache[ 0 ] !== unit ) { - - gl.uniform1i( this.addr, unit ); - cache[ 0 ] = unit; - - } - - textures.setTexture3D( v || emptyTexture3d, unit ); - -} - -function setValueT6( gl, v, textures ) { - - var cache = this.cache; - var unit = textures.allocateTextureUnit(); - - if ( cache[ 0 ] !== unit ) { - - gl.uniform1i( this.addr, unit ); - cache[ 0 ] = unit; - - } - - textures.safeSetTextureCube( v || emptyCubeTexture, unit ); - -} - -// Integer / Boolean vectors or arrays thereof (always flat arrays) - -function setValueV1i( gl, v ) { - - var cache = this.cache; - - if ( cache[ 0 ] === v ) return; - - gl.uniform1i( this.addr, v ); - - cache[ 0 ] = v; - -} - -function setValueV2i( gl, v ) { - - var cache = this.cache; - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform2iv( this.addr, v ); - - copyArray( cache, v ); - -} - -function setValueV3i( gl, v ) { - - var cache = this.cache; - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform3iv( this.addr, v ); - - copyArray( cache, v ); - -} - -function setValueV4i( gl, v ) { - - var cache = this.cache; - - if ( arraysEqual( cache, v ) ) return; - - gl.uniform4iv( this.addr, v ); - - copyArray( cache, v ); - -} - -// Helper to pick the right setter for the singular case - -function getSingularSetter( type ) { - - switch ( type ) { - - case 0x1406: return setValueV1f; // FLOAT - case 0x8b50: return setValueV2f; // _VEC2 - case 0x8b51: return setValueV3f; // _VEC3 - case 0x8b52: return setValueV4f; // _VEC4 - - case 0x8b5a: return setValueM2; // _MAT2 - case 0x8b5b: return setValueM3; // _MAT3 - case 0x8b5c: return setValueM4; // _MAT4 - - case 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES - case 0x8b5f: return setValueT3D1; // SAMPLER_3D - case 0x8b60: return setValueT6; // SAMPLER_CUBE - case 0x8DC1: return setValueT2DArray1; // SAMPLER_2D_ARRAY - - case 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL - case 0x8b53: case 0x8b57: return setValueV2i; // _VEC2 - case 0x8b54: case 0x8b58: return setValueV3i; // _VEC3 - case 0x8b55: case 0x8b59: return setValueV4i; // _VEC4 - - } - -} - -// Array of scalars -function setValueV1fArray( gl, v ) { - - gl.uniform1fv( this.addr, v ); - -} - -// Integer / Boolean vectors or arrays thereof (always flat arrays) -function setValueV1iArray( gl, v ) { - - gl.uniform1iv( this.addr, v ); - -} - -function setValueV2iArray( gl, v ) { - - gl.uniform2iv( this.addr, v ); - -} - -function setValueV3iArray( gl, v ) { - - gl.uniform3iv( this.addr, v ); - -} - -function setValueV4iArray( gl, v ) { - - gl.uniform4iv( this.addr, v ); - -} - - -// Array of vectors (flat or from THREE classes) - -function setValueV2fArray( gl, v ) { - - var data = flatten( v, this.size, 2 ); - - gl.uniform2fv( this.addr, data ); - -} - -function setValueV3fArray( gl, v ) { - - var data = flatten( v, this.size, 3 ); - - gl.uniform3fv( this.addr, data ); - -} - -function setValueV4fArray( gl, v ) { - - var data = flatten( v, this.size, 4 ); - - gl.uniform4fv( this.addr, data ); - -} - -// Array of matrices (flat or from THREE clases) - -function setValueM2Array( gl, v ) { - - var data = flatten( v, this.size, 4 ); - - gl.uniformMatrix2fv( this.addr, false, data ); - -} - -function setValueM3Array( gl, v ) { - - var data = flatten( v, this.size, 9 ); - - gl.uniformMatrix3fv( this.addr, false, data ); - -} - -function setValueM4Array( gl, v ) { - - var data = flatten( v, this.size, 16 ); - - gl.uniformMatrix4fv( this.addr, false, data ); - -} - -// Array of textures (2D / Cube) - -function setValueT1Array( gl, v, textures ) { - - var n = v.length; - - var units = allocTexUnits( textures, n ); - - gl.uniform1iv( this.addr, units ); - - for ( var i = 0; i !== n; ++ i ) { - - textures.safeSetTexture2D( v[ i ] || emptyTexture, units[ i ] ); - - } - -} - -function setValueT6Array( gl, v, textures ) { - - var n = v.length; - - var units = allocTexUnits( textures, n ); - - gl.uniform1iv( this.addr, units ); - - for ( var i = 0; i !== n; ++ i ) { - - textures.safeSetTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); - - } - -} - -// Helper to pick the right setter for a pure (bottom-level) array - -function getPureArraySetter( type ) { - - switch ( type ) { - - case 0x1406: return setValueV1fArray; // FLOAT - case 0x8b50: return setValueV2fArray; // _VEC2 - case 0x8b51: return setValueV3fArray; // _VEC3 - case 0x8b52: return setValueV4fArray; // _VEC4 - - case 0x8b5a: return setValueM2Array; // _MAT2 - case 0x8b5b: return setValueM3Array; // _MAT3 - case 0x8b5c: return setValueM4Array; // _MAT4 - - case 0x8b5e: return setValueT1Array; // SAMPLER_2D - case 0x8b60: return setValueT6Array; // SAMPLER_CUBE - - case 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL - case 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2 - case 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3 - case 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4 - - } - -} - -// --- Uniform Classes --- - -function SingleUniform( id, activeInfo, addr ) { - - this.id = id; - this.addr = addr; - this.cache = []; - this.setValue = getSingularSetter( activeInfo.type ); - - // this.path = activeInfo.name; // DEBUG - -} - -function PureArrayUniform( id, activeInfo, addr ) { - - this.id = id; - this.addr = addr; - this.cache = []; - this.size = activeInfo.size; - this.setValue = getPureArraySetter( activeInfo.type ); - - // this.path = activeInfo.name; // DEBUG - -} - -PureArrayUniform.prototype.updateCache = function ( data ) { - - var cache = this.cache; - - if ( data instanceof Float32Array && cache.length !== data.length ) { - - this.cache = new Float32Array( data.length ); - - } - - copyArray( cache, data ); - -}; - -function StructuredUniform( id ) { - - this.id = id; - - this.seq = []; - this.map = {}; - -} - -StructuredUniform.prototype.setValue = function ( gl, value, textures ) { - - var seq = this.seq; - - for ( var i = 0, n = seq.length; i !== n; ++ i ) { - - var u = seq[ i ]; - u.setValue( gl, value[ u.id ], textures ); - - } - -}; - -// --- Top-level --- - -// Parser - builds up the property tree from the path strings - -var RePathPart = /([\w\d_]+)(\])?(\[|\.)?/g; - -// extracts -// - the identifier (member name or array index) -// - followed by an optional right bracket (found when array index) -// - followed by an optional left bracket or dot (type of subscript) -// -// Note: These portions can be read in a non-overlapping fashion and -// allow straightforward parsing of the hierarchy that WebGL encodes -// in the uniform names. - -function addUniform( container, uniformObject ) { - - container.seq.push( uniformObject ); - container.map[ uniformObject.id ] = uniformObject; - -} - -function parseUniform( activeInfo, addr, container ) { - - var path = activeInfo.name, - pathLength = path.length; - - // reset RegExp object, because of the early exit of a previous run - RePathPart.lastIndex = 0; - - while ( true ) { - - var match = RePathPart.exec( path ), - matchEnd = RePathPart.lastIndex, - - id = match[ 1 ], - idIsIndex = match[ 2 ] === ']', - subscript = match[ 3 ]; - - if ( idIsIndex ) id = id | 0; // convert to integer - - if ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) { - - // bare name or "pure" bottom-level array "[0]" suffix - - addUniform( container, subscript === undefined ? - new SingleUniform( id, activeInfo, addr ) : - new PureArrayUniform( id, activeInfo, addr ) ); - - break; - - } else { - - // step into inner node / create it in case it doesn't exist - - var map = container.map, next = map[ id ]; - - if ( next === undefined ) { - - next = new StructuredUniform( id ); - addUniform( container, next ); - - } - - container = next; - - } - - } - -} - -// Root Container - -function WebGLUniforms( gl, program ) { - - this.seq = []; - this.map = {}; - - var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS ); - - for ( var i = 0; i < n; ++ i ) { - - var info = gl.getActiveUniform( program, i ), - addr = gl.getUniformLocation( program, info.name ); - - parseUniform( info, addr, this ); - - } - -} - -WebGLUniforms.prototype.setValue = function ( gl, name, value, textures ) { - - var u = this.map[ name ]; - - if ( u !== undefined ) u.setValue( gl, value, textures ); - -}; - -WebGLUniforms.prototype.setOptional = function ( gl, object, name ) { - - var v = object[ name ]; - - if ( v !== undefined ) this.setValue( gl, name, v ); - -}; - - -// Static interface - -WebGLUniforms.upload = function ( gl, seq, values, textures ) { - - for ( var i = 0, n = seq.length; i !== n; ++ i ) { - - var u = seq[ i ], - v = values[ u.id ]; - - if ( v.needsUpdate !== false ) { - - // note: always updating when .needsUpdate is undefined - u.setValue( gl, v.value, textures ); - - } - - } - -}; - -WebGLUniforms.seqWithValue = function ( seq, values ) { - - var r = []; - - for ( var i = 0, n = seq.length; i !== n; ++ i ) { - - var u = seq[ i ]; - if ( u.id in values ) r.push( u ); - - } - - return r; - -}; - -export { WebGLUniforms }; diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.d.ts b/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.d.ts deleted file mode 100644 index a70856e140..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export class WebGLUtils { - - constructor( gl: WebGLRenderingContext | WebGL2RenderingContext, extensions: any, capabilities: any ); - - convert( p: any ): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.js b/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.js deleted file mode 100644 index c700b714fe..0000000000 --- a/cases/esbuild-three/src/base/renderers/webgl/WebGLUtils.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * @author thespite / http://www.twitter.com/thespite - */ - -import { MaxEquation, MinEquation, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGB_ETC1_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT5_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT1_Format, RGB_S3TC_DXT1_Format, SrcAlphaSaturateFactor, OneMinusDstColorFactor, DstColorFactor, OneMinusDstAlphaFactor, DstAlphaFactor, OneMinusSrcAlphaFactor, SrcAlphaFactor, OneMinusSrcColorFactor, SrcColorFactor, OneFactor, ZeroFactor, ReverseSubtractEquation, SubtractEquation, AddEquation, DepthFormat, DepthStencilFormat, LuminanceAlphaFormat, LuminanceFormat, RedFormat, RGBAFormat, RGBFormat, AlphaFormat, HalfFloatType, FloatType, UnsignedIntType, IntType, UnsignedShortType, ShortType, ByteType, UnsignedInt248Type, UnsignedShort565Type, UnsignedShort5551Type, UnsignedShort4444Type, UnsignedByteType, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NearestFilter, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping } from '../../constants.js'; - -function WebGLUtils( gl, extensions, capabilities ) { - - function convert( p ) { - - var extension; - - if ( p === RepeatWrapping ) return gl.REPEAT; - if ( p === ClampToEdgeWrapping ) return gl.CLAMP_TO_EDGE; - if ( p === MirroredRepeatWrapping ) return gl.MIRRORED_REPEAT; - - if ( p === NearestFilter ) return gl.NEAREST; - if ( p === NearestMipmapNearestFilter ) return gl.NEAREST_MIPMAP_NEAREST; - if ( p === NearestMipmapLinearFilter ) return gl.NEAREST_MIPMAP_LINEAR; - - if ( p === LinearFilter ) return gl.LINEAR; - if ( p === LinearMipmapNearestFilter ) return gl.LINEAR_MIPMAP_NEAREST; - if ( p === LinearMipmapLinearFilter ) return gl.LINEAR_MIPMAP_LINEAR; - - if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE; - if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4; - if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1; - if ( p === UnsignedShort565Type ) return gl.UNSIGNED_SHORT_5_6_5; - - if ( p === ByteType ) return gl.BYTE; - if ( p === ShortType ) return gl.SHORT; - if ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT; - if ( p === IntType ) return gl.INT; - if ( p === UnsignedIntType ) return gl.UNSIGNED_INT; - if ( p === FloatType ) return gl.FLOAT; - - if ( p === HalfFloatType ) { - - if ( capabilities.isWebGL2 ) return gl.HALF_FLOAT; - - extension = extensions.get( 'OES_texture_half_float' ); - - if ( extension !== null ) return extension.HALF_FLOAT_OES; - - } - - if ( p === AlphaFormat ) return gl.ALPHA; - if ( p === RGBFormat ) return gl.RGB; - if ( p === RGBAFormat ) return gl.RGBA; - if ( p === LuminanceFormat ) return gl.LUMINANCE; - if ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA; - if ( p === DepthFormat ) return gl.DEPTH_COMPONENT; - if ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL; - if ( p === RedFormat ) return gl.RED; - - if ( p === AddEquation ) return gl.FUNC_ADD; - if ( p === SubtractEquation ) return gl.FUNC_SUBTRACT; - if ( p === ReverseSubtractEquation ) return gl.FUNC_REVERSE_SUBTRACT; - - if ( p === ZeroFactor ) return gl.ZERO; - if ( p === OneFactor ) return gl.ONE; - if ( p === SrcColorFactor ) return gl.SRC_COLOR; - if ( p === OneMinusSrcColorFactor ) return gl.ONE_MINUS_SRC_COLOR; - if ( p === SrcAlphaFactor ) return gl.SRC_ALPHA; - if ( p === OneMinusSrcAlphaFactor ) return gl.ONE_MINUS_SRC_ALPHA; - if ( p === DstAlphaFactor ) return gl.DST_ALPHA; - if ( p === OneMinusDstAlphaFactor ) return gl.ONE_MINUS_DST_ALPHA; - - if ( p === DstColorFactor ) return gl.DST_COLOR; - if ( p === OneMinusDstColorFactor ) return gl.ONE_MINUS_DST_COLOR; - if ( p === SrcAlphaSaturateFactor ) return gl.SRC_ALPHA_SATURATE; - - if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || - p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) { - - extension = extensions.get( 'WEBGL_compressed_texture_s3tc' ); - - if ( extension !== null ) { - - if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT; - if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT; - if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT; - if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT; - - } - - } - - if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || - p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) { - - extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' ); - - if ( extension !== null ) { - - if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - - } - - } - - if ( p === RGB_ETC1_Format ) { - - extension = extensions.get( 'WEBGL_compressed_texture_etc1' ); - - if ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL; - - } - - if ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || - p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || - p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || - p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || - p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) { - - extension = extensions.get( 'WEBGL_compressed_texture_astc' ); - - if ( extension !== null ) { - - return p; - - } - - } - - if ( p === MinEquation || p === MaxEquation ) { - - if ( capabilities.isWebGL2 ) { - - if ( p === MinEquation ) return gl.MIN; - if ( p === MaxEquation ) return gl.MAX; - - } - - extension = extensions.get( 'EXT_blend_minmax' ); - - if ( extension !== null ) { - - if ( p === MinEquation ) return extension.MIN_EXT; - if ( p === MaxEquation ) return extension.MAX_EXT; - - } - - } - - if ( p === UnsignedInt248Type ) { - - if ( capabilities.isWebGL2 ) return gl.UNSIGNED_INT_24_8; - - extension = extensions.get( 'WEBGL_depth_texture' ); - - if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL; - - } - - return 0; - - } - - return { convert: convert }; - -} - - -export { WebGLUtils }; diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.d.ts b/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.d.ts deleted file mode 100644 index 6c2763b8a8..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Object3D } from '../../core/Object3D'; -import { Group } from '../../objects/Group'; -import { PerspectiveCamera } from '../../cameras/PerspectiveCamera'; -import { ArrayCamera } from '../../cameras/ArrayCamera'; -import { Matrix4 } from '../../math/Matrix4'; - -export class WebVRManager { - - constructor( renderer: any ); - - enabled: boolean; - getController( id: number ): Group; - getDevice(): VRDisplay | null; - setDevice( device: VRDisplay | null ): void; - setFramebufferScaleFactor( value: number ): void; - setReferenceSpaceType( value: string ): void; - setPoseTarget( object: Object3D | null ): void; - getCamera( camera: PerspectiveCamera ): PerspectiveCamera | ArrayCamera; - getStandingMatrix(): Matrix4; - isPresenting: () => boolean; - setAnimationLoop( callback: Function ): void; - submitFrame(): void; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.js b/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.js deleted file mode 100644 index 8f192e2b60..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebVRManager.js +++ /dev/null @@ -1,427 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { EventDispatcher } from '../../core/EventDispatcher.js'; -import { Group } from '../../objects/Group.js'; -import { Matrix4 } from '../../math/Matrix4.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Vector3 } from '../../math/Vector3.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { Quaternion } from '../../math/Quaternion.js'; -import { ArrayCamera } from '../../cameras/ArrayCamera.js'; -import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js'; -import { WebGLAnimation } from '../webgl/WebGLAnimation.js'; -import { setProjectionFromUnion } from './WebVRUtils.js'; - -function WebVRManager( renderer ) { - - var renderWidth, renderHeight; - var scope = this; - - var device = null; - var frameData = null; - - var poseTarget = null; - - var controllers = []; - var standingMatrix = new Matrix4(); - var standingMatrixInverse = new Matrix4(); - - var framebufferScaleFactor = 1.0; - - var referenceSpaceType = 'local-floor'; - - if ( typeof window !== 'undefined' && 'VRFrameData' in window ) { - - frameData = new window.VRFrameData(); - window.addEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange, false ); - - } - - var matrixWorldInverse = new Matrix4(); - var tempQuaternion = new Quaternion(); - var tempPosition = new Vector3(); - - var cameraL = new PerspectiveCamera(); - cameraL.viewport = new Vector4(); - cameraL.layers.enable( 1 ); - - var cameraR = new PerspectiveCamera(); - cameraR.viewport = new Vector4(); - cameraR.layers.enable( 2 ); - - var cameraVR = new ArrayCamera( [ cameraL, cameraR ] ); - cameraVR.layers.enable( 1 ); - cameraVR.layers.enable( 2 ); - - // - - function isPresenting() { - - return device !== null && device.isPresenting === true; - - } - - var currentSize = new Vector2(), currentPixelRatio; - - function onVRDisplayPresentChange() { - - if ( isPresenting() ) { - - var eyeParameters = device.getEyeParameters( 'left' ); - renderWidth = 2 * eyeParameters.renderWidth * framebufferScaleFactor; - renderHeight = eyeParameters.renderHeight * framebufferScaleFactor; - - currentPixelRatio = renderer.getPixelRatio(); - renderer.getSize( currentSize ); - - renderer.setDrawingBufferSize( renderWidth, renderHeight, 1 ); - - cameraL.viewport.set( 0, 0, renderWidth / 2, renderHeight ); - cameraR.viewport.set( renderWidth / 2, 0, renderWidth / 2, renderHeight ); - - animation.start(); - - scope.dispatchEvent( { type: 'sessionstart' } ); - - } else { - - if ( scope.enabled ) { - - renderer.setDrawingBufferSize( currentSize.width, currentSize.height, currentPixelRatio ); - - } - - animation.stop(); - - scope.dispatchEvent( { type: 'sessionend' } ); - - } - - } - - // - - var triggers = []; - - function findGamepad( id ) { - - var gamepads = navigator.getGamepads && navigator.getGamepads(); - - for ( var i = 0, j = 0, l = gamepads.length; i < l; i ++ ) { - - var gamepad = gamepads[ i ]; - - if ( gamepad && ( gamepad.id === 'Daydream Controller' || - gamepad.id === 'Gear VR Controller' || gamepad.id === 'Oculus Go Controller' || - gamepad.id === 'OpenVR Gamepad' || gamepad.id.startsWith( 'Oculus Touch' ) || - gamepad.id.startsWith( 'HTC Vive Focus' ) || - gamepad.id.startsWith( 'Spatial Controller' ) ) ) { - - if ( j === id ) return gamepad; - - j ++; - - } - - } - - } - - function updateControllers() { - - for ( var i = 0; i < controllers.length; i ++ ) { - - var controller = controllers[ i ]; - - var gamepad = findGamepad( i ); - - if ( gamepad !== undefined && gamepad.pose !== undefined ) { - - if ( gamepad.pose === null ) return; - - // Pose - - var pose = gamepad.pose; - - if ( pose.hasPosition === false ) controller.position.set( 0.2, - 0.6, - 0.05 ); - - if ( pose.position !== null ) controller.position.fromArray( pose.position ); - if ( pose.orientation !== null ) controller.quaternion.fromArray( pose.orientation ); - controller.matrix.compose( controller.position, controller.quaternion, controller.scale ); - controller.matrix.premultiply( standingMatrix ); - controller.matrix.decompose( controller.position, controller.quaternion, controller.scale ); - controller.matrixWorldNeedsUpdate = true; - controller.visible = true; - - // Trigger - - var buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1; - - if ( triggers[ i ] === undefined ) triggers[ i ] = false; - - if ( triggers[ i ] !== gamepad.buttons[ buttonId ].pressed ) { - - triggers[ i ] = gamepad.buttons[ buttonId ].pressed; - - if ( triggers[ i ] === true ) { - - controller.dispatchEvent( { type: 'selectstart' } ); - - } else { - - controller.dispatchEvent( { type: 'selectend' } ); - controller.dispatchEvent( { type: 'select' } ); - - } - - } - - } else { - - controller.visible = false; - - } - - } - - } - - function updateViewportFromBounds( viewport, bounds ) { - - if ( bounds !== null && bounds.length === 4 ) { - - viewport.set( bounds[ 0 ] * renderWidth, bounds[ 1 ] * renderHeight, bounds[ 2 ] * renderWidth, bounds[ 3 ] * renderHeight ); - - } - - } - - // - - this.enabled = false; - - this.getController = function ( id ) { - - var controller = controllers[ id ]; - - if ( controller === undefined ) { - - controller = new Group(); - controller.matrixAutoUpdate = false; - controller.visible = false; - - controllers[ id ] = controller; - - } - - return controller; - - }; - - this.getDevice = function () { - - return device; - - }; - - this.setDevice = function ( value ) { - - if ( value !== undefined ) device = value; - - animation.setContext( value ); - - }; - - this.setFramebufferScaleFactor = function ( value ) { - - framebufferScaleFactor = value; - - }; - - this.setReferenceSpaceType = function ( value ) { - - referenceSpaceType = value; - - }; - - this.setPoseTarget = function ( object ) { - - if ( object !== undefined ) poseTarget = object; - - }; - - this.getCamera = function ( camera ) { - - var userHeight = referenceSpaceType === 'local-floor' ? 1.6 : 0; - - if ( isPresenting() === false ) { - - camera.position.set( 0, userHeight, 0 ); - camera.rotation.set( 0, 0, 0 ); - - return camera; - - } - - device.depthNear = camera.near; - device.depthFar = camera.far; - - device.getFrameData( frameData ); - - // - - if ( referenceSpaceType === 'local-floor' ) { - - var stageParameters = device.stageParameters; - - if ( stageParameters ) { - - standingMatrix.fromArray( stageParameters.sittingToStandingTransform ); - - } else { - - standingMatrix.makeTranslation( 0, userHeight, 0 ); - - } - - } - - - var pose = frameData.pose; - var poseObject = poseTarget !== null ? poseTarget : camera; - - // We want to manipulate poseObject by its position and quaternion components since users may rely on them. - poseObject.matrix.copy( standingMatrix ); - poseObject.matrix.decompose( poseObject.position, poseObject.quaternion, poseObject.scale ); - - if ( pose.orientation !== null ) { - - tempQuaternion.fromArray( pose.orientation ); - poseObject.quaternion.multiply( tempQuaternion ); - - } - - if ( pose.position !== null ) { - - tempQuaternion.setFromRotationMatrix( standingMatrix ); - tempPosition.fromArray( pose.position ); - tempPosition.applyQuaternion( tempQuaternion ); - poseObject.position.add( tempPosition ); - - } - - poseObject.updateMatrixWorld(); - - // - - cameraL.near = camera.near; - cameraR.near = camera.near; - - cameraL.far = camera.far; - cameraR.far = camera.far; - - cameraL.matrixWorldInverse.fromArray( frameData.leftViewMatrix ); - cameraR.matrixWorldInverse.fromArray( frameData.rightViewMatrix ); - - // TODO (mrdoob) Double check this code - - standingMatrixInverse.getInverse( standingMatrix ); - - if ( referenceSpaceType === 'local-floor' ) { - - cameraL.matrixWorldInverse.multiply( standingMatrixInverse ); - cameraR.matrixWorldInverse.multiply( standingMatrixInverse ); - - } - - var parent = poseObject.parent; - - if ( parent !== null ) { - - matrixWorldInverse.getInverse( parent.matrixWorld ); - - cameraL.matrixWorldInverse.multiply( matrixWorldInverse ); - cameraR.matrixWorldInverse.multiply( matrixWorldInverse ); - - } - - // envMap and Mirror needs camera.matrixWorld - - cameraL.matrixWorld.getInverse( cameraL.matrixWorldInverse ); - cameraR.matrixWorld.getInverse( cameraR.matrixWorldInverse ); - - cameraL.projectionMatrix.fromArray( frameData.leftProjectionMatrix ); - cameraR.projectionMatrix.fromArray( frameData.rightProjectionMatrix ); - - setProjectionFromUnion( cameraVR, cameraL, cameraR ); - - // - - var layers = device.getLayers(); - - if ( layers.length ) { - - var layer = layers[ 0 ]; - - updateViewportFromBounds( cameraL.viewport, layer.leftBounds ); - updateViewportFromBounds( cameraR.viewport, layer.rightBounds ); - - } - - updateControllers(); - - return cameraVR; - - }; - - this.getStandingMatrix = function () { - - return standingMatrix; - - }; - - this.isPresenting = isPresenting; - - // Animation Loop - - var animation = new WebGLAnimation(); - - this.setAnimationLoop = function ( callback ) { - - animation.setAnimationLoop( callback ); - - if ( isPresenting() ) animation.start(); - - }; - - this.submitFrame = function () { - - if ( isPresenting() ) device.submitFrame(); - - }; - - this.dispose = function () { - - if ( typeof window !== 'undefined' ) { - - window.removeEventListener( 'vrdisplaypresentchange', onVRDisplayPresentChange ); - - } - - }; - - // DEPRECATED - - this.setFrameOfReferenceType = function () { - - console.warn( 'THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.' ); - - }; - -} - -Object.assign( WebVRManager.prototype, EventDispatcher.prototype ); - -export { WebVRManager }; diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.d.ts b/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.d.ts deleted file mode 100644 index 8e3e62a436..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Camera } from '../../cameras/Camera'; - -export function setProjectionFromUnion( camera: Camera, cameraL: Camera, cameraR: Camera ): void; diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.js b/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.js deleted file mode 100644 index d8b7b2d91a..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebVRUtils.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @author jsantell / https://www.jsantell.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -import { Vector3 } from '../../math/Vector3.js'; - -var cameraLPos = new Vector3(); -var cameraRPos = new Vector3(); - -/** - * Assumes 2 cameras that are parallel and share an X-axis, and that - * the cameras' projection and world matrices have already been set. - * And that near and far planes are identical for both cameras. - * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765 - */ -function setProjectionFromUnion( camera, cameraL, cameraR ) { - - cameraLPos.setFromMatrixPosition( cameraL.matrixWorld ); - cameraRPos.setFromMatrixPosition( cameraR.matrixWorld ); - - var ipd = cameraLPos.distanceTo( cameraRPos ); - - var projL = cameraL.projectionMatrix.elements; - var projR = cameraR.projectionMatrix.elements; - - // VR systems will have identical far and near planes, and - // most likely identical top and bottom frustum extents. - // Use the left camera for these values. - var near = projL[ 14 ] / ( projL[ 10 ] - 1 ); - var far = projL[ 14 ] / ( projL[ 10 ] + 1 ); - var topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ]; - var bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ]; - - var leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ]; - var rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ]; - var left = near * leftFov; - var right = near * rightFov; - - // Calculate the new camera's position offset from the - // left camera. xOffset should be roughly half `ipd`. - var zOffset = ipd / ( - leftFov + rightFov ); - var xOffset = zOffset * - leftFov; - - // TODO: Better way to apply this offset? - cameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale ); - camera.translateX( xOffset ); - camera.translateZ( zOffset ); - camera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale ); - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - // Find the union of the frustum values of the cameras and scale - // the values so that the near plane's position does not change in world space, - // although must now be relative to the new union camera. - var near2 = near + zOffset; - var far2 = far + zOffset; - var left2 = left - xOffset; - var right2 = right + ( ipd - xOffset ); - var top2 = topFov * far / far2 * near2; - var bottom2 = bottomFov * far / far2 * near2; - - camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 ); - -} - -export { setProjectionFromUnion }; diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.d.ts b/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.d.ts deleted file mode 100644 index 4cdfbd0284..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Group } from '../../objects/Group'; -import { Camera } from '../../cameras/Camera'; - -export class WebXRManager { - - constructor( renderer: any, gl: WebGLRenderingContext ); - - enabled: boolean; - getController( id: number ): Group; - setFramebufferScaleFactor( value: number ): void; - setReferenceSpaceType( value: string ): void; - getSession(): any; - setSession( value: any ): void; - getCamera( camera: Camera ): Camera; - isPresenting: () => boolean; - setAnimationLoop( callback: Function ): void; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.js b/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.js deleted file mode 100644 index 918c045aaa..0000000000 --- a/cases/esbuild-three/src/base/renderers/webvr/WebXRManager.js +++ /dev/null @@ -1,331 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { EventDispatcher } from '../../core/EventDispatcher.js'; -import { Group } from '../../objects/Group.js'; -import { Matrix4 } from '../../math/Matrix4.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { ArrayCamera } from '../../cameras/ArrayCamera.js'; -import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js'; -import { WebGLAnimation } from '../webgl/WebGLAnimation.js'; -import { setProjectionFromUnion } from './WebVRUtils.js'; - -function WebXRManager( renderer, gl ) { - - var scope = this; - - var session = null; - - var framebufferScaleFactor = 1.0; - - var referenceSpace = null; - var referenceSpaceType = 'local-floor'; - - var pose = null; - - var controllers = []; - var inputSources = []; - - function isPresenting() { - - return session !== null && referenceSpace !== null; - - } - - // - - var cameraL = new PerspectiveCamera(); - cameraL.layers.enable( 1 ); - cameraL.viewport = new Vector4(); - - var cameraR = new PerspectiveCamera(); - cameraR.layers.enable( 2 ); - cameraR.viewport = new Vector4(); - - var cameraVR = new ArrayCamera( [ cameraL, cameraR ] ); - cameraVR.layers.enable( 1 ); - cameraVR.layers.enable( 2 ); - - // - - this.enabled = false; - - this.getController = function ( id ) { - - var controller = controllers[ id ]; - - if ( controller === undefined ) { - - controller = new Group(); - controller.matrixAutoUpdate = false; - controller.visible = false; - - controllers[ id ] = controller; - - } - - return controller; - - }; - - // - - function onSessionEvent( event ) { - - for ( var i = 0; i < controllers.length; i ++ ) { - - if ( inputSources[ i ] === event.inputSource ) { - - controllers[ i ].dispatchEvent( { type: event.type } ); - - } - - } - - } - - function onSessionEnd() { - - renderer.setFramebuffer( null ); - renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830 - animation.stop(); - - scope.dispatchEvent( { type: 'sessionend' } ); - - } - - function onRequestReferenceSpace( value ) { - - referenceSpace = value; - - animation.setContext( session ); - animation.start(); - - scope.dispatchEvent( { type: 'sessionstart' } ); - - } - - this.setFramebufferScaleFactor = function ( value ) { - - framebufferScaleFactor = value; - - }; - - this.setReferenceSpaceType = function ( value ) { - - referenceSpaceType = value; - - }; - - this.getSession = function () { - - return session; - - }; - - this.setSession = function ( value ) { - - session = value; - - if ( session !== null ) { - - session.addEventListener( 'select', onSessionEvent ); - session.addEventListener( 'selectstart', onSessionEvent ); - session.addEventListener( 'selectend', onSessionEvent ); - session.addEventListener( 'end', onSessionEnd ); - - session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } ); - - session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace ); - - // - - inputSources = session.inputSources; - - session.addEventListener( 'inputsourceschange', function () { - - inputSources = session.inputSources; - console.log( inputSources ); - - for ( var i = 0; i < controllers.length; i ++ ) { - - var controller = controllers[ i ]; - controller.userData.inputSource = inputSources[ i ]; - - } - - } ); - - } - - }; - - function updateCamera( camera, parent ) { - - if ( parent === null ) { - - camera.matrixWorld.copy( camera.matrix ); - - } else { - - camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix ); - - } - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - } - - this.getCamera = function ( camera ) { - - if ( isPresenting() ) { - - var parent = camera.parent; - var cameras = cameraVR.cameras; - - updateCamera( cameraVR, parent ); - - for ( var i = 0; i < cameras.length; i ++ ) { - - updateCamera( cameras[ i ], parent ); - - } - - // update camera and its children - - camera.matrixWorld.copy( cameraVR.matrixWorld ); - - var children = camera.children; - - for ( var i = 0, l = children.length; i < l; i ++ ) { - - children[ i ].updateMatrixWorld( true ); - - } - - setProjectionFromUnion( cameraVR, cameraL, cameraR ); - - return cameraVR; - - } - - return camera; - - }; - - this.isPresenting = isPresenting; - - // Animation Loop - - var onAnimationFrameCallback = null; - - function onAnimationFrame( time, frame ) { - - pose = frame.getViewerPose( referenceSpace ); - - if ( pose !== null ) { - - var views = pose.views; - var baseLayer = session.renderState.baseLayer; - - renderer.setFramebuffer( baseLayer.framebuffer ); - - for ( var i = 0; i < views.length; i ++ ) { - - var view = views[ i ]; - var viewport = baseLayer.getViewport( view ); - var viewMatrix = view.transform.inverse.matrix; - - var camera = cameraVR.cameras[ i ]; - camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix ); - camera.projectionMatrix.fromArray( view.projectionMatrix ); - camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height ); - - if ( i === 0 ) { - - cameraVR.matrix.copy( camera.matrix ); - - } - - } - - } - - // - - for ( var i = 0; i < controllers.length; i ++ ) { - - var controller = controllers[ i ]; - - var inputSource = inputSources[ i ]; - - if ( inputSource ) { - - var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace ); - - if ( inputPose !== null ) { - - controller.matrix.fromArray( inputPose.transform.matrix ); - controller.matrix.decompose( controller.position, controller.rotation, controller.scale ); - controller.visible = true; - - continue; - - } - - } - - controller.visible = false; - - } - - if ( onAnimationFrameCallback ) onAnimationFrameCallback( time ); - - } - - var animation = new WebGLAnimation(); - animation.setAnimationLoop( onAnimationFrame ); - - this.setAnimationLoop = function ( callback ) { - - onAnimationFrameCallback = callback; - - }; - - this.dispose = function () {}; - - // DEPRECATED - - this.getStandingMatrix = function () { - - console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' ); - return new Matrix4(); - - }; - - this.getDevice = function () { - - console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' ); - - }; - - this.setDevice = function () { - - console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' ); - - }; - - this.setFrameOfReferenceType = function () { - - console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' ); - - }; - - this.submitFrame = function () {}; - -} - -Object.assign( WebXRManager.prototype, EventDispatcher.prototype ); - -export { WebXRManager }; diff --git a/cases/esbuild-three/src/base/scenes/Fog.d.ts b/cases/esbuild-three/src/base/scenes/Fog.d.ts deleted file mode 100644 index e992d145b7..0000000000 --- a/cases/esbuild-three/src/base/scenes/Fog.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Color } from './../math/Color'; - -export interface IFog { - name: string; - color: Color; - clone(): this; - toJSON(): any; -} - -/** - * This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance. - */ -export class Fog implements IFog { - - constructor( hex: number, near?: number, far?: number ); - - name: string; - - /** - * Fog color. - */ - color: Color; - - /** - * The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog. - */ - near: number; - - /** - * The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog. - * Default is 1000. - */ - far: number; - - clone(): this; - toJSON(): any; - -} diff --git a/cases/esbuild-three/src/base/scenes/Fog.js b/cases/esbuild-three/src/base/scenes/Fog.js deleted file mode 100644 index 2bcdfeff26..0000000000 --- a/cases/esbuild-three/src/base/scenes/Fog.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -import { Color } from '../math/Color.js'; - -function Fog( color, near, far ) { - - this.name = ''; - - this.color = new Color( color ); - - this.near = ( near !== undefined ) ? near : 1; - this.far = ( far !== undefined ) ? far : 1000; - -} - -Object.assign( Fog.prototype, { - - isFog: true, - - clone: function () { - - return new Fog( this.color, this.near, this.far ); - - }, - - toJSON: function ( /* meta */ ) { - - return { - type: 'Fog', - color: this.color.getHex(), - near: this.near, - far: this.far - }; - - } - -} ); - -export { Fog }; diff --git a/cases/esbuild-three/src/base/scenes/FogExp2.d.ts b/cases/esbuild-three/src/base/scenes/FogExp2.d.ts deleted file mode 100644 index b9897b29d9..0000000000 --- a/cases/esbuild-three/src/base/scenes/FogExp2.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Color } from './../math/Color'; -import { IFog } from './Fog'; -/** - * This class contains the parameters that define linear fog, i.e., that grows exponentially denser with the distance. - */ -export class FogExp2 implements IFog { - - constructor( hex: number | string, density?: number ); - - name: string; - color: Color; - - /** - * Defines how fast the fog will grow dense. - * Default is 0.00025. - */ - density: number; - - clone(): this; - toJSON(): any; - -} diff --git a/cases/esbuild-three/src/base/scenes/FogExp2.js b/cases/esbuild-three/src/base/scenes/FogExp2.js deleted file mode 100644 index 526e06446f..0000000000 --- a/cases/esbuild-three/src/base/scenes/FogExp2.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -import { Color } from '../math/Color.js'; - -function FogExp2( color, density ) { - - this.name = ''; - - this.color = new Color( color ); - this.density = ( density !== undefined ) ? density : 0.00025; - -} - -Object.assign( FogExp2.prototype, { - - isFogExp2: true, - - clone: function () { - - return new FogExp2( this.color, this.density ); - - }, - - toJSON: function ( /* meta */ ) { - - return { - type: 'FogExp2', - color: this.color.getHex(), - density: this.density - }; - - } - -} ); - -export { FogExp2 }; diff --git a/cases/esbuild-three/src/base/scenes/Scene.d.ts b/cases/esbuild-three/src/base/scenes/Scene.d.ts deleted file mode 100644 index 1e776724c9..0000000000 --- a/cases/esbuild-three/src/base/scenes/Scene.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { IFog } from './Fog'; -import { Material } from './../materials/Material'; -import { Object3D } from './../core/Object3D'; -import { Color } from '../math/Color'; -import { Texture } from '../textures/Texture'; -// Scenes ///////////////////////////////////////////////////////////////////// - -/** - * Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras. - */ -export class Scene extends Object3D { - - constructor(); - - type: 'Scene'; - - /** - * A fog instance defining the type of fog that affects everything rendered in the scene. Default is null. - */ - fog: IFog | null; - - /** - * If not null, it will force everything in the scene to be rendered with that material. Default is null. - */ - overrideMaterial: Material | null; - autoUpdate: boolean; - background: null | Color | Texture; - - toJSON( meta?: any ): any; - dispose(): void; - -} diff --git a/cases/esbuild-three/src/base/scenes/Scene.js b/cases/esbuild-three/src/base/scenes/Scene.js deleted file mode 100644 index 98352b694b..0000000000 --- a/cases/esbuild-three/src/base/scenes/Scene.js +++ /dev/null @@ -1,69 +0,0 @@ -import { Object3D } from '../core/Object3D.js'; - -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function Scene() { - - Object3D.call( this ); - - this.type = 'Scene'; - - this.background = null; - this.fog = null; - this.overrideMaterial = null; - - this.autoUpdate = true; // checked by the renderer - - if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { - - __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef - - } - -} - -Scene.prototype = Object.assign( Object.create( Object3D.prototype ), { - - constructor: Scene, - - isScene: true, - - copy: function ( source, recursive ) { - - Object3D.prototype.copy.call( this, source, recursive ); - - if ( source.background !== null ) this.background = source.background.clone(); - if ( source.fog !== null ) this.fog = source.fog.clone(); - if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone(); - - this.autoUpdate = source.autoUpdate; - this.matrixAutoUpdate = source.matrixAutoUpdate; - - return this; - - }, - - toJSON: function ( meta ) { - - var data = Object3D.prototype.toJSON.call( this, meta ); - - if ( this.background !== null ) data.object.background = this.background.toJSON( meta ); - if ( this.fog !== null ) data.object.fog = this.fog.toJSON(); - - return data; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - } - -} ); - - - -export { Scene }; diff --git a/cases/esbuild-three/src/base/textures/CanvasTexture.d.ts b/cases/esbuild-three/src/base/textures/CanvasTexture.d.ts deleted file mode 100644 index 67b0d27f16..0000000000 --- a/cases/esbuild-three/src/base/textures/CanvasTexture.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - PixelFormat, - TextureDataType, -} from '../constants'; - -export class CanvasTexture extends Texture { - - constructor( - canvas: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - format?: PixelFormat, - type?: TextureDataType, - anisotropy?: number - ); - -} diff --git a/cases/esbuild-three/src/base/textures/CanvasTexture.js b/cases/esbuild-three/src/base/textures/CanvasTexture.js deleted file mode 100644 index 5239619fbc..0000000000 --- a/cases/esbuild-three/src/base/textures/CanvasTexture.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Texture } from './Texture.js'; - -function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { - - Texture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - - this.needsUpdate = true; - -} - -CanvasTexture.prototype = Object.create( Texture.prototype ); -CanvasTexture.prototype.constructor = CanvasTexture; -CanvasTexture.prototype.isCanvasTexture = true; - -export { CanvasTexture }; diff --git a/cases/esbuild-three/src/base/textures/CompressedTexture.d.ts b/cases/esbuild-three/src/base/textures/CompressedTexture.d.ts deleted file mode 100644 index 00b8d519d5..0000000000 --- a/cases/esbuild-three/src/base/textures/CompressedTexture.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - CompressedPixelFormat, - TextureDataType, - TextureEncoding, -} from '../constants'; - -export class CompressedTexture extends Texture { - - constructor( - mipmaps: ImageData[], - width: number, - height: number, - format?: CompressedPixelFormat, - type?: TextureDataType, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - anisotropy?: number, - encoding?: TextureEncoding - ); - - image: { width: number; height: number }; - -} diff --git a/cases/esbuild-three/src/base/textures/CompressedTexture.js b/cases/esbuild-three/src/base/textures/CompressedTexture.js deleted file mode 100644 index 9e800e5974..0000000000 --- a/cases/esbuild-three/src/base/textures/CompressedTexture.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - */ - -import { Texture } from './Texture.js'; - -function CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { - - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); - - this.image = { width: width, height: height }; - this.mipmaps = mipmaps; - - // no flipping for cube textures - // (also flipping doesn't work for compressed textures ) - - this.flipY = false; - - // can't generate mipmaps for compressed textures - // mips must be embedded in DDS files - - this.generateMipmaps = false; - -} - -CompressedTexture.prototype = Object.create( Texture.prototype ); -CompressedTexture.prototype.constructor = CompressedTexture; - -CompressedTexture.prototype.isCompressedTexture = true; - - -export { CompressedTexture }; diff --git a/cases/esbuild-three/src/base/textures/CubeTexture.d.ts b/cases/esbuild-three/src/base/textures/CubeTexture.d.ts deleted file mode 100644 index b2ae0121dd..0000000000 --- a/cases/esbuild-three/src/base/textures/CubeTexture.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - PixelFormat, - TextureDataType, - TextureEncoding, -} from '../constants'; - -export class CubeTexture extends Texture { - - constructor( - images?: any[], // HTMLImageElement or HTMLCanvasElement - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - format?: PixelFormat, - type?: TextureDataType, - anisotropy?: number, - encoding?: TextureEncoding - ); - - images: any; // returns and sets the value of Texture.image in the codde ? - -} diff --git a/cases/esbuild-three/src/base/textures/CubeTexture.js b/cases/esbuild-three/src/base/textures/CubeTexture.js deleted file mode 100644 index 6d2e2946c9..0000000000 --- a/cases/esbuild-three/src/base/textures/CubeTexture.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { Texture } from './Texture.js'; -import { CubeReflectionMapping, RGBFormat } from '../constants.js'; - -function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { - - images = images !== undefined ? images : []; - mapping = mapping !== undefined ? mapping : CubeReflectionMapping; - format = format !== undefined ? format : RGBFormat; - - Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); - - this.flipY = false; - -} - -CubeTexture.prototype = Object.create( Texture.prototype ); -CubeTexture.prototype.constructor = CubeTexture; - -CubeTexture.prototype.isCubeTexture = true; - -Object.defineProperty( CubeTexture.prototype, 'images', { - - get: function () { - - return this.image; - - }, - - set: function ( value ) { - - this.image = value; - - } - -} ); - - -export { CubeTexture }; diff --git a/cases/esbuild-three/src/base/textures/DataTexture.d.ts b/cases/esbuild-three/src/base/textures/DataTexture.d.ts deleted file mode 100644 index d7781678fa..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - PixelFormat, - TextureDataType, - TextureEncoding, -} from '../constants'; -import { TypedArray } from '../polyfills'; - -export class DataTexture extends Texture { - - constructor( - data: TypedArray, - width: number, - height: number, - format?: PixelFormat, - type?: TextureDataType, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - anisotropy?: number, - encoding?: TextureEncoding - ); - - image: ImageData; - -} diff --git a/cases/esbuild-three/src/base/textures/DataTexture.js b/cases/esbuild-three/src/base/textures/DataTexture.js deleted file mode 100644 index 5544075553..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - */ - -import { Texture } from './Texture.js'; -import { NearestFilter } from '../constants.js'; - -function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) { - - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ); - - this.image = { data: data, width: width, height: height }; - - this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; - this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; - - this.generateMipmaps = false; - this.flipY = false; - this.unpackAlignment = 1; - -} - -DataTexture.prototype = Object.create( Texture.prototype ); -DataTexture.prototype.constructor = DataTexture; - -DataTexture.prototype.isDataTexture = true; - - -export { DataTexture }; diff --git a/cases/esbuild-three/src/base/textures/DataTexture2DArray.d.ts b/cases/esbuild-three/src/base/textures/DataTexture2DArray.d.ts deleted file mode 100644 index 62de15c765..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture2DArray.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Texture } from './Texture'; -import { TypedArray } from '../polyfills'; - -export class DataTexture2DArray extends Texture { - - constructor( - data: TypedArray, - width: number, - height: number, - depth: number - ); - -} diff --git a/cases/esbuild-three/src/base/textures/DataTexture2DArray.js b/cases/esbuild-three/src/base/textures/DataTexture2DArray.js deleted file mode 100644 index 2a90d4cc4f..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture2DArray.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @author Takahiro https://github.com/takahirox - */ - -import { Texture } from './Texture.js'; -import { ClampToEdgeWrapping, NearestFilter } from '../constants.js'; - -function DataTexture2DArray( data, width, height, depth ) { - - Texture.call( this, null ); - - this.image = { data: data, width: width, height: height, depth: depth }; - - this.magFilter = NearestFilter; - this.minFilter = NearestFilter; - - this.wrapR = ClampToEdgeWrapping; - - this.generateMipmaps = false; - this.flipY = false; - -} - -DataTexture2DArray.prototype = Object.create( Texture.prototype ); -DataTexture2DArray.prototype.constructor = DataTexture2DArray; -DataTexture2DArray.prototype.isDataTexture2DArray = true; - -export { DataTexture2DArray }; diff --git a/cases/esbuild-three/src/base/textures/DataTexture3D.d.ts b/cases/esbuild-three/src/base/textures/DataTexture3D.d.ts deleted file mode 100644 index 6bdcc9a190..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture3D.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Texture } from './Texture'; -import { TypedArray } from '../polyfills'; - -export class DataTexture3D extends Texture { - - constructor( - data: TypedArray, - width: number, - height: number, - depth: number - ); - -} diff --git a/cases/esbuild-three/src/base/textures/DataTexture3D.js b/cases/esbuild-three/src/base/textures/DataTexture3D.js deleted file mode 100644 index d34a3ab4e0..0000000000 --- a/cases/esbuild-three/src/base/textures/DataTexture3D.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @author Artur Trzesiok - */ - -import { Texture } from './Texture.js'; -import { ClampToEdgeWrapping, NearestFilter } from '../constants.js'; - -function DataTexture3D( data, width, height, depth ) { - - // We're going to add .setXXX() methods for setting properties later. - // Users can still set in DataTexture3D directly. - // - // var texture = new THREE.DataTexture3D( data, width, height, depth ); - // texture.anisotropy = 16; - // - // See #14839 - - Texture.call( this, null ); - - this.image = { data: data, width: width, height: height, depth: depth }; - - this.magFilter = NearestFilter; - this.minFilter = NearestFilter; - - this.wrapR = ClampToEdgeWrapping; - - this.generateMipmaps = false; - this.flipY = false; - -} - -DataTexture3D.prototype = Object.create( Texture.prototype ); -DataTexture3D.prototype.constructor = DataTexture3D; -DataTexture3D.prototype.isDataTexture3D = true; - -export { DataTexture3D }; diff --git a/cases/esbuild-three/src/base/textures/DepthTexture.d.ts b/cases/esbuild-three/src/base/textures/DepthTexture.d.ts deleted file mode 100644 index c9b4d3714d..0000000000 --- a/cases/esbuild-three/src/base/textures/DepthTexture.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - TextureDataType, -} from '../constants'; - -export class DepthTexture extends Texture { - - constructor( - width: number, - heighht: number, - type?: TextureDataType, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - anisotropy?: number - ); - - image: { width: number; height: number }; - -} diff --git a/cases/esbuild-three/src/base/textures/DepthTexture.js b/cases/esbuild-three/src/base/textures/DepthTexture.js deleted file mode 100644 index 9800e18583..0000000000 --- a/cases/esbuild-three/src/base/textures/DepthTexture.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @author Matt DesLauriers / @mattdesl - * @author atix / arthursilber.de - */ - -import { Texture } from './Texture.js'; -import { NearestFilter, UnsignedShortType, UnsignedInt248Type, DepthFormat, DepthStencilFormat } from '../constants.js'; - -function DepthTexture( width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format ) { - - format = format !== undefined ? format : DepthFormat; - - if ( format !== DepthFormat && format !== DepthStencilFormat ) { - - throw new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' ); - - } - - if ( type === undefined && format === DepthFormat ) type = UnsignedShortType; - if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type; - - Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - - this.image = { width: width, height: height }; - - this.magFilter = magFilter !== undefined ? magFilter : NearestFilter; - this.minFilter = minFilter !== undefined ? minFilter : NearestFilter; - - this.flipY = false; - this.generateMipmaps = false; - -} - -DepthTexture.prototype = Object.create( Texture.prototype ); -DepthTexture.prototype.constructor = DepthTexture; -DepthTexture.prototype.isDepthTexture = true; - -export { DepthTexture }; diff --git a/cases/esbuild-three/src/base/textures/Texture.d.ts b/cases/esbuild-three/src/base/textures/Texture.d.ts deleted file mode 100644 index 4854f6c52d..0000000000 --- a/cases/esbuild-three/src/base/textures/Texture.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Vector2, Vector } from './../math/Vector2'; -import { EventDispatcher } from './../core/EventDispatcher'; -import { - Mapping, - Wrapping, - TextureFilter, - PixelFormat, - TextureDataType, - TextureEncoding, -} from '../constants'; - -// Textures ///////////////////////////////////////////////////////////////////// -export let TextureIdCount: number; - -export class Texture extends EventDispatcher { - - constructor( - image?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - format?: PixelFormat, - type?: TextureDataType, - anisotropy?: number, - encoding?: TextureEncoding - ); - - id: number; - uuid: string; - name: string; - sourceFile: string; - image: any; // HTMLImageElement or ImageData or { width: number, height: number } in some children; - mipmaps: ImageData[]; - mapping: Mapping; - wrapS: Wrapping; - wrapT: Wrapping; - magFilter: TextureFilter; - minFilter: TextureFilter; - anisotropy: number; - format: PixelFormat; - type: TextureDataType; - offset: Vector2; - repeat: Vector2; - center: Vector2; - rotation: number; - generateMipmaps: boolean; - premultiplyAlpha: boolean; - flipY: boolean; - unpackAlignment: number; - encoding: TextureEncoding; - version: number; - needsUpdate: boolean; - onUpdate: () => void; - static DEFAULT_IMAGE: any; - static DEFAULT_MAPPING: any; - - clone(): this; - copy( source: Texture ): this; - toJSON( meta: any ): any; - dispose(): void; - transformUv( uv: Vector ): void; - -} diff --git a/cases/esbuild-three/src/base/textures/Texture.js b/cases/esbuild-three/src/base/textures/Texture.js deleted file mode 100644 index b31d761acf..0000000000 --- a/cases/esbuild-three/src/base/textures/Texture.js +++ /dev/null @@ -1,332 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - */ - -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { - MirroredRepeatWrapping, - ClampToEdgeWrapping, - RepeatWrapping, - LinearEncoding, - UnsignedByteType, - RGBAFormat, - LinearMipmapLinearFilter, - LinearFilter, - UVMapping -} from '../constants.js'; -import { _Math } from '../math/Math.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { ImageUtils } from '../extras/ImageUtils.js'; - -var textureId = 0; - -function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) { - - Object.defineProperty( this, 'id', { value: textureId ++ } ); - - this.uuid = _Math.generateUUID(); - - this.name = ''; - - this.image = image !== undefined ? image : Texture.DEFAULT_IMAGE; - this.mipmaps = []; - - this.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING; - - this.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping; - this.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping; - - this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; - this.minFilter = minFilter !== undefined ? minFilter : LinearMipmapLinearFilter; - - this.anisotropy = anisotropy !== undefined ? anisotropy : 1; - - this.format = format !== undefined ? format : RGBAFormat; - this.type = type !== undefined ? type : UnsignedByteType; - - this.offset = new Vector2( 0, 0 ); - this.repeat = new Vector2( 1, 1 ); - this.center = new Vector2( 0, 0 ); - this.rotation = 0; - - this.matrixAutoUpdate = true; - this.matrix = new Matrix3(); - - this.generateMipmaps = true; - this.premultiplyAlpha = false; - this.flipY = true; - this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml) - - // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap. - // - // Also changing the encoding after already used by a Material will not automatically make the Material - // update. You need to explicitly call Material.needsUpdate to trigger it to recompile. - this.encoding = encoding !== undefined ? encoding : LinearEncoding; - - this.version = 0; - this.onUpdate = null; - -} - -Texture.DEFAULT_IMAGE = undefined; -Texture.DEFAULT_MAPPING = UVMapping; - -Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), { - - constructor: Texture, - - isTexture: true, - - updateMatrix: function () { - - this.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y ); - - }, - - clone: function () { - - return new this.constructor().copy( this ); - - }, - - copy: function ( source ) { - - this.name = source.name; - - this.image = source.image; - this.mipmaps = source.mipmaps.slice( 0 ); - - this.mapping = source.mapping; - - this.wrapS = source.wrapS; - this.wrapT = source.wrapT; - - this.magFilter = source.magFilter; - this.minFilter = source.minFilter; - - this.anisotropy = source.anisotropy; - - this.format = source.format; - this.type = source.type; - - this.offset.copy( source.offset ); - this.repeat.copy( source.repeat ); - this.center.copy( source.center ); - this.rotation = source.rotation; - - this.matrixAutoUpdate = source.matrixAutoUpdate; - this.matrix.copy( source.matrix ); - - this.generateMipmaps = source.generateMipmaps; - this.premultiplyAlpha = source.premultiplyAlpha; - this.flipY = source.flipY; - this.unpackAlignment = source.unpackAlignment; - this.encoding = source.encoding; - - return this; - - }, - - toJSON: function ( meta ) { - - var isRootObject = ( meta === undefined || typeof meta === 'string' ); - - if ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) { - - return meta.textures[ this.uuid ]; - - } - - var output = { - - metadata: { - version: 4.5, - type: 'Texture', - generator: 'Texture.toJSON' - }, - - uuid: this.uuid, - name: this.name, - - mapping: this.mapping, - - repeat: [ this.repeat.x, this.repeat.y ], - offset: [ this.offset.x, this.offset.y ], - center: [ this.center.x, this.center.y ], - rotation: this.rotation, - - wrap: [ this.wrapS, this.wrapT ], - - format: this.format, - type: this.type, - encoding: this.encoding, - - minFilter: this.minFilter, - magFilter: this.magFilter, - anisotropy: this.anisotropy, - - flipY: this.flipY, - - premultiplyAlpha: this.premultiplyAlpha, - unpackAlignment: this.unpackAlignment - - }; - - if ( this.image !== undefined ) { - - // TODO: Move to THREE.Image - - var image = this.image; - - if ( image.uuid === undefined ) { - - image.uuid = _Math.generateUUID(); // UGH - - } - - if ( ! isRootObject && meta.images[ image.uuid ] === undefined ) { - - var url; - - if ( Array.isArray( image ) ) { - - // process array of images e.g. CubeTexture - - url = []; - - for ( var i = 0, l = image.length; i < l; i ++ ) { - - url.push( ImageUtils.getDataURL( image[ i ] ) ); - - } - - } else { - - // process single image - - url = ImageUtils.getDataURL( image ); - - } - - meta.images[ image.uuid ] = { - uuid: image.uuid, - url: url - }; - - } - - output.image = image.uuid; - - } - - if ( ! isRootObject ) { - - meta.textures[ this.uuid ] = output; - - } - - return output; - - }, - - dispose: function () { - - this.dispatchEvent( { type: 'dispose' } ); - - }, - - transformUv: function ( uv ) { - - if ( this.mapping !== UVMapping ) return uv; - - uv.applyMatrix3( this.matrix ); - - if ( uv.x < 0 || uv.x > 1 ) { - - switch ( this.wrapS ) { - - case RepeatWrapping: - - uv.x = uv.x - Math.floor( uv.x ); - break; - - case ClampToEdgeWrapping: - - uv.x = uv.x < 0 ? 0 : 1; - break; - - case MirroredRepeatWrapping: - - if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) { - - uv.x = Math.ceil( uv.x ) - uv.x; - - } else { - - uv.x = uv.x - Math.floor( uv.x ); - - } - break; - - } - - } - - if ( uv.y < 0 || uv.y > 1 ) { - - switch ( this.wrapT ) { - - case RepeatWrapping: - - uv.y = uv.y - Math.floor( uv.y ); - break; - - case ClampToEdgeWrapping: - - uv.y = uv.y < 0 ? 0 : 1; - break; - - case MirroredRepeatWrapping: - - if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) { - - uv.y = Math.ceil( uv.y ) - uv.y; - - } else { - - uv.y = uv.y - Math.floor( uv.y ); - - } - break; - - } - - } - - if ( this.flipY ) { - - uv.y = 1 - uv.y; - - } - - return uv; - - } - -} ); - -Object.defineProperty( Texture.prototype, "needsUpdate", { - - set: function ( value ) { - - if ( value === true ) this.version ++; - - } - -} ); - - -export { Texture }; diff --git a/cases/esbuild-three/src/base/textures/VideoTexture.d.ts b/cases/esbuild-three/src/base/textures/VideoTexture.d.ts deleted file mode 100644 index f64103a970..0000000000 --- a/cases/esbuild-three/src/base/textures/VideoTexture.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Texture } from './Texture'; -import { - Mapping, - Wrapping, - TextureFilter, - PixelFormat, - TextureDataType, -} from '../constants'; - -export class VideoTexture extends Texture { - - constructor( - video: HTMLVideoElement, - mapping?: Mapping, - wrapS?: Wrapping, - wrapT?: Wrapping, - magFilter?: TextureFilter, - minFilter?: TextureFilter, - format?: PixelFormat, - type?: TextureDataType, - anisotropy?: number - ); - -} diff --git a/cases/esbuild-three/src/base/textures/VideoTexture.js b/cases/esbuild-three/src/base/textures/VideoTexture.js deleted file mode 100644 index 59681997ee..0000000000 --- a/cases/esbuild-three/src/base/textures/VideoTexture.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -import { RGBFormat, LinearFilter } from '../constants.js'; -import { Texture } from './Texture.js'; - -function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { - - Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); - - this.format = format !== undefined ? format : RGBFormat; - - this.minFilter = minFilter !== undefined ? minFilter : LinearFilter; - this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; - - this.generateMipmaps = false; - -} - -VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), { - - constructor: VideoTexture, - - isVideoTexture: true, - - update: function () { - - var video = this.image; - - if ( video.readyState >= video.HAVE_CURRENT_DATA ) { - - this.needsUpdate = true; - - } - - } - -} ); - - -export { VideoTexture }; diff --git a/cases/esbuild-three/src/base/utils.js b/cases/esbuild-three/src/base/utils.js deleted file mode 100644 index 6783c51ad9..0000000000 --- a/cases/esbuild-three/src/base/utils.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @author mrdoob / http://mrdoob.com/ - */ - -function arrayMin( array ) { - - if ( array.length === 0 ) return Infinity; - - var min = array[ 0 ]; - - for ( var i = 1, l = array.length; i < l; ++ i ) { - - if ( array[ i ] < min ) min = array[ i ]; - - } - - return min; - -} - -function arrayMax( array ) { - - if ( array.length === 0 ) return - Infinity; - - var max = array[ 0 ]; - - for ( var i = 1, l = array.length; i < l; ++ i ) { - - if ( array[ i ] > max ) max = array[ i ]; - - } - - return max; - -} - -export { arrayMin, arrayMax }; diff --git a/cases/esbuild-three/src/index.js b/cases/esbuild-three/src/index.js deleted file mode 100644 index e280879d0e..0000000000 --- a/cases/esbuild-three/src/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import * as copy1 from "./copy1/Three.js"; -export { copy1 }; -import * as copy2 from "./copy2/Three.js"; -export { copy2 }; -import * as copy3 from "./copy3/Three.js"; -export { copy3 }; -import * as copy4 from "./copy4/Three.js"; -export { copy4 }; -import * as copy5 from "./copy5/Three.js"; -export { copy5 }; -import * as copy6 from "./copy6/Three.js"; -export { copy6 }; -import * as copy7 from "./copy7/Three.js"; -export { copy7 }; -import * as copy8 from "./copy8/Three.js"; -export { copy8 }; -import * as copy9 from "./copy9/Three.js"; -export { copy9 }; -import * as copy10 from "./copy10/Three.js"; -export { copy10 }; -console.log("Hello World"); diff --git a/cases/esbuild-three/webpack.config.js b/cases/esbuild-three/webpack.config.js deleted file mode 100644 index 94dd90d618..0000000000 --- a/cases/esbuild-three/webpack.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - output: { - library: "THREE", - libraryTarget: "commonjs-module", - }, -}; diff --git a/cases/minimal/package.json b/cases/minimal/package.json deleted file mode 100644 index 5b38afde93..0000000000 --- a/cases/minimal/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "minimal", - "dependenciesDate": "2021-02-15", - "dependencies": { - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "webpack": "*" - } -} diff --git a/cases/minimal/src/index.js b/cases/minimal/src/index.js deleted file mode 100644 index 7df7d571e6..0000000000 --- a/cases/minimal/src/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World"); \ No newline at end of file diff --git a/cases/minimal/webpack.config.js b/cases/minimal/webpack.config.js deleted file mode 100644 index f053ebf797..0000000000 --- a/cases/minimal/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/cases/rome/package.json b/cases/rome/package.json deleted file mode 100644 index 8f05b533fa..0000000000 --- a/cases/rome/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "rome", - "dependenciesDate": "2021-02-15", - "dependencies": { - "webpack-cli": "^4.5.0" - }, - "devDependencies": { - "ts-loader": "*", - "typescript": "*", - "webpack": "*" - }, - "scripts": { - "bench:setup": "node -e \"try { require('fs').statSync('src/rome') } catch { process.exitCode = 1 }\" || git clone --single-branch --branch v10.0.4-beta https://github.com/romejs/rome src/rome" - }, - "rebuildChangeFile": "src/index.ts" -} diff --git a/cases/rome/src/.gitignore b/cases/rome/src/.gitignore deleted file mode 100644 index 043b303e63..0000000000 --- a/cases/rome/src/.gitignore +++ /dev/null @@ -1 +0,0 @@ -rome diff --git a/cases/rome/src/index.ts b/cases/rome/src/index.ts deleted file mode 100644 index 8516af7e84..0000000000 --- a/cases/rome/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "./rome/internal/cli/cli"; - -console.log("Hello World"); diff --git a/cases/rome/tsconfig.json b/cases/rome/tsconfig.json deleted file mode 100644 index 86ea1c1e4b..0000000000 --- a/cases/rome/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "moduleResolution": "node", - "target": "es2019", - "module": "esnext", - "baseUrl": "." - }, - "include": [ - "./src/index.ts" - ], - "paths": { - "@internal/*": [ - "src/rome/internal/*" - ], - "@internal/virtual-*": [ - "src/rome/internal/virtual-packages/*" - ], - "rome": [ - "src/rome/internal/virtual-packages/rome" - ] - } -} diff --git a/cases/rome/webpack.config.js b/cases/rome/webpack.config.js deleted file mode 100644 index 0501741f66..0000000000 --- a/cases/rome/webpack.config.js +++ /dev/null @@ -1,28 +0,0 @@ -const { resolve } = require("path"); -/** @type {import("webpack").Configuration} */ -module.exports = { - entry: "./src/index.ts", - resolve: { - extensions: [".ts", ".tsx", ".js"], - alias: { - "@internal": resolve(__dirname, "src/rome/internal"), - // rome: resolve(__dirname, "src/rome/internal/virtual-packages/rome"), - }, - }, - module: { - rules: [ - { - test: /\.tsx?$/, - loader: "ts-loader", - options: { transpileOnly: true }, - }, - ], - }, -}; -if (require("webpack").version.startsWith("5")) { - module.exports.ignoreWarnings = [ - { - message: /export.+was not found/, - }, - ]; -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..81977cec71 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,14 @@ +import js from "@eslint/js"; +import { flatConfigs as importXConfigs } from "eslint-plugin-import-x"; +import globals from "globals"; + +export default [ + { ignores: ["fixtures"] }, + js.configs.recommended, + importXConfigs.recommended, + { + languageOptions: { + globals: globals.nodeBuiltin, + }, + }, +]; diff --git a/fixtures/minimal/main.js b/fixtures/minimal/main.js new file mode 100644 index 0000000000..1b7817fae5 --- /dev/null +++ b/fixtures/minimal/main.js @@ -0,0 +1,70 @@ +// Top-level variable +const message = "Hello, bundler!"; + +// Arrow function +const greet = (name = "World") => `Hello, ${name}`; + +// Named function +function add(a, b) { + return a + b; +} + +// Object using functions +const data = { + value: 42, + greet, + sum: add(10, 32), +}; + +// Immediately use default-like function +function main() { + console.log(greet()); + console.log(`Sum of 2 and 3 is ${add(2, 3)}`); + const cnt = new Counter(); + cnt.increment(); + console.log(`Counter after increment: ${cnt.count}`); + console.log(`Array length: ${arr.length}`); + console.log(`First: ${first}, Rest: ${rest}`); + console.log(`Optional chaining: ${arr?.length}`); + console.log(`Nullish coalescing: ${foo}`); + wait(10).then(() => console.log("Waited 10ms")); +} +main(); + +// Class with static and instance methods +class Counter { + static start = 0; + count = Counter.start; + increment() { + this.count++; + } +} + +// Destructuring + spread +const arr = [1, 2, 3]; +const [first, ...rest] = arr; + +// Optional chaining +const length = arr?.length; + +// Nullish coalescing +const foo = null ?? "fallback"; + +// Promise +const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + +// Export everything used +module.exports = { + message, + greet, + add, + data, + Counter, + arr, + first, + rest, + length, + foo, + wait, + main, +}; diff --git a/lib/build-plugin.cjs b/lib/build-plugin.cjs deleted file mode 100644 index af3d0a0fd3..0000000000 --- a/lib/build-plugin.cjs +++ /dev/null @@ -1,69 +0,0 @@ -const WARMUP_BUILDS = 10; -const TOTAL_BUILDS = 20; - -module.exports = class BuildPlugin { - apply(compiler) { - let counter = 0; - let isWatching = false; - compiler.hooks.watchRun.tap("BuildPlugin", () => { - isWatching = true; - }); - (compiler.hooks.afterDone || compiler.hooks.done).tap("BuildPlugin", () => { - setTimeout(() => { - if (counter === WARMUP_BUILDS) console.log("#!# start"); - if (isWatching && counter <= TOTAL_BUILDS) console.log("#!# next"); - }, 10); - }); - compiler.hooks.done.tap("BuildPlugin", (stats) => { - if (isWatching) { - counter++; - if (counter <= WARMUP_BUILDS) return; - if (counter > TOTAL_BUILDS) { - if (compiler.watching) { - compiler.watching.close(); - } else { - process.nextTick(() => process.exit(0)); - } - } - } - const { logging, time } = stats.toJson({ - all: false, - timings: true, - logging: "verbose", - }); - console.log(`#!# stats = ${time}`); - const memoryUsage = process.memoryUsage(); - console.log(`#!# heap memory = ${memoryUsage.heapUsed}`); - console.log(`#!# rss memory = ${memoryUsage.rss}`); - console.log(`#!# external memory = ${memoryUsage.external}`); - console.log(`#!# array buffers memory = ${memoryUsage.arrayBuffers}`); - for (const _name of Object.keys(logging)) { - const { entries } = logging[_name]; - const name = _name.replace(/^webpack\./, ""); - for (const { type, args, message } of entries) { - if (type !== "time") continue; - if (args) { - const ms = args[1] * 1000 + args[2] / 1000000; - console.log(`#!# ${name}.${args[0]} = ${ms}`); - } else { - const [, label, msStr] = /^(.+): ([\d.]+)ms$/.exec(message); - console.log(`#!# ${name}.${label} = ${msStr}`); - } - } - } - }); - const old = compiler.infrastructureLogger; - compiler.infrastructureLogger = (_name, type, args) => { - old(_name, type, args); - const name = _name.replace(/^webpack\./, ""); - if (type !== "time") return; - const ms = args[1] * 1000 + args[2] / 1000000; - console.log( - `#!# ${name}.${args[0].replace( - /restore cache content \d.+$/, - "restore cache content" - )} = ${ms}` - ); - }; - } -}; diff --git a/lib/build.js b/lib/build.js deleted file mode 100644 index 36ea0edc55..0000000000 --- a/lib/build.js +++ /dev/null @@ -1,115 +0,0 @@ -import { readFile } from "fs/promises"; -import { spawn } from "child_process"; -import { alterFile, revertFile, readFileSizes } from "./utils.js"; - -export default (args) => { - let rebuildChangeFile; - const run = async (options) => { - let start = Date.now(); - let currentArgs = args; - let nodeArgs = []; - for (const addon of options.addons) { - if (addon.args) currentArgs = currentArgs.concat(addon.args); - if (addon.nodeArgs) nodeArgs = nodeArgs.concat(addon.nodeArgs); - } - const p = spawn( - nodeArgs.length === 0 ? "yarn" : "node", - [ - ...nodeArgs, - nodeArgs.length === 0 - ? "webpack" - : "node_modules/webpack/bin/webpack.js", - ...currentArgs, - ...(options.progress ? ["--progress"] : []), - ], - { - shell: true, - stdio: options.verbose - ? ["inherit", "pipe", "inherit"] - : ["ignore", "pipe", "ignore"], - } - ); - let counter = 0; - let dataSetCounter = -1; - let promise = Promise.resolve(); - const data = {}; - const processLine = (line) => { - if (line === "#!# start") { - start = Date.now(); - dataSetCounter = 0; - } else if (line === "#!# next") { - promise = promise.then(async () => { - counter++; - if (dataSetCounter >= 0) dataSetCounter++; - await new Promise((r) => - setTimeout(r, Math.max(300, 1000 / counter)) - ); - await alterFile(rebuildChangeFile, (content) => - content.replace(/Hello World\d*/, `Hello World${counter}`) - ); - }); - } else if (line.startsWith("#!#")) { - const [, name, valueStr] = /^#!# (.+) = ((\d|\.|e|-)+)$/.exec(line); - data[name] = (data[name] || 0) + +valueStr; - } else if (options.verbose) { - console.log(line); - } - }; - let remainingLine = ""; - p.stdout.on("data", (chunk) => { - const lines = (remainingLine + chunk).split("\n"); - remainingLine = lines.pop(); - lines.forEach(processLine); - }); - const exitCode = await new Promise((resolve) => p.once("exit", resolve)); - data.exec = Date.now() - start; - await promise; - if (dataSetCounter > 1) { - for (const key of Object.keys(data)) { - data[key] /= dataSetCounter; - } - } - if (exitCode !== 0) throw new Error(`Build failed with ${exitCode}`); - Object.assign(data, await readFileSizes("dist")); - return data; - }; - const warmup = async (options) => { - const org = args; - args = args.filter((a) => a !== "--watch"); - await run({ - ...options, - verbose: true, - progress: process.env.CI ? false : true, - }); - args = org; - }; - const setup = async (options) => { - const pkg = JSON.parse(await readFile("package.json")); - rebuildChangeFile = pkg.rebuildChangeFile || "src/index.js"; - await revertFile(rebuildChangeFile); - await alterFile( - "webpack.config.js", - (content) => { - for (const addon of options.addons) { - if (addon.config) content = addon.config(content, options); - } - return `${content} - -module.exports.plugins = module.exports.plugins || []; -module.exports.plugins.push(new (require("../../lib/build-plugin.cjs"))()); -`; - }, - { past: true } - ); - }; - const teardown = async (options) => { - await revertFile(rebuildChangeFile); - await revertFile("webpack.config.js"); - }; - return { - run, - warmup, - setup, - teardown, - }; -}; diff --git a/lib/compare.js b/lib/compare.js deleted file mode 100644 index 5abc959bfb..0000000000 --- a/lib/compare.js +++ /dev/null @@ -1,49 +0,0 @@ -import { readFile, writeFile, mkdir } from "fs/promises"; -import { resolve } from "path"; -import { fileURLToPath } from "url"; -import measure from "./measure.js"; -import { compareStatistics } from "./utils.js"; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -const getResult = async (caseName, scenarioName, options) => { - const cacheIdentifier = `${caseName}-${scenarioName}-${ - options.dependencies - ? Buffer.from(JSON.stringify(options.dependencies)).toString("hex") - : "" - }.json`; - if (process.env.CACHE_COMPARE_MEASURE) { - try { - return JSON.parse( - await readFile(resolve(rootDir, ".cache", cacheIdentifier), "utf-8") - ); - } catch {} - } - const result = await measure(caseName, scenarioName, options); - await mkdir(resolve(rootDir, ".cache"), { - recursive: true, - }); - await writeFile( - resolve(rootDir, ".cache", cacheIdentifier), - JSON.stringify(result, null, 2) - ); - return result; -}; - -export default async (caseName, scenarioName, options) => { - const baselineDependencies = - options.baselineDependencies || options.dependencies; - const baselineScenario = options.baselineScenario || scenarioName; - const baselineDate = options.baselineDate || options.date; - const baselineResult = await getResult(caseName, baselineScenario, { - ...options, - dependencies: baselineDependencies, - date: baselineDate, - }); - const currentResult = await getResult(caseName, scenarioName, options); - return { - diff: compareStatistics(baselineResult, currentResult), - result: currentResult, - baseResult: baselineResult, - }; -}; diff --git a/lib/custom-registry.js b/lib/custom-registry.js deleted file mode 100644 index 7f0a11986d..0000000000 --- a/lib/custom-registry.js +++ /dev/null @@ -1,116 +0,0 @@ -import { createServer as createHttpServer } from "http"; -import { request, globalAgent } from "https"; -import { createGzip, createGunzip } from "zlib"; -import rootCas from "ssl-root-cas"; - -globalAgent.options.ca = rootCas.create(); - -export const createServer = (date) => { - const minDate = new Date(date).getTime(); - const server = createHttpServer((req, res) => { - const isInstallRequest = - req.headers.accept && - req.headers.accept.includes("application/vnd.npm.install-v1+json"); - const remoteReq = request( - `https://registry.yarnpkg.com${req.url}`, - { - headers: { - ...req.headers, - host: "registry.yarnpkg.com", - "accept-encoding": "gzip", - accept: isInstallRequest - ? "application/json" - : req.headers.accept || "", - }, - method: req.method, - rejectUnauthorized: false, - }, - (remoteRes) => { - for (const key of Object.keys(remoteRes.headers)) { - if ( - key !== "content-length" && - (!isInstallRequest || key !== "content-type") - ) - res.setHeader(key, remoteRes.headers[key]); - } - if (isInstallRequest) { - res.setHeader("content-type", "application/vnd.npm.install-v1+json"); - } - res.statusCode = remoteRes.statusCode; - res.statusMessage = remoteRes.statusMessage; - if (/^\/[^/]+$/.test(req.url) && remoteRes.statusCode === 200) { - var bufs = []; - if (remoteRes.headers["content-encoding"] === "gzip") { - const unzipped = createGunzip(); - const zipped = createGzip(); - remoteRes = remoteRes.pipe(unzipped); - zipped.pipe(res); - res = zipped; - } - remoteRes.on("data", (d) => bufs.push(d)); - remoteRes.on("end", () => { - const data = JSON.parse(Buffer.concat(bufs).toString("utf-8")); - if (data.time) { - const filteredVersions = new Set( - Object.keys(data.time).filter( - (key) => - key !== "modified" && - new Date(data.time[key]).getTime() > minDate - ) - ); - for (const version of filteredVersions) { - delete data.time[version]; - delete data.versions[version]; - } - const makeVersionComparable = (v) => - v.replace(/\d+/g, (v) => `0000000000${v}`.slice(-10)); - const compareVersions = (a, b) => - makeVersionComparable(a) < makeVersionComparable(b) ? 1 : -1; - for (const key of Object.keys(data["dist-tags"])) { - if (filteredVersions.has(data["dist-tags"][key])) { - if (key === "latest") { - const old = data["dist-tags"].latest; - data["dist-tags"].latest = Object.keys(data.versions) - .filter((v) => !v.includes("-")) - .sort(compareVersions)[0]; - } else { - delete data["dist-tags"][key]; - } - } - } - } - const result = Buffer.from( - JSON.stringify( - isInstallRequest - ? { - name: data.name, - "dist-tags": data["dist-tags"], - versions: data.versions, - modified: data.time.modified, - } - : data - ) - ); - res.end(result); - }); - } else { - remoteRes.pipe(res); - } - } - ); - req.pipe(remoteReq); - }); - - return new Promise((resolve) => { - server.close(); - server.listen(3333, () => - resolve( - () => - new Promise((resolve, reject) => - server.close((err) => (err ? reject(err) : resolve())) - ) - ) - ); - server.unref(); - }); -}; diff --git a/lib/measure.js b/lib/measure.js deleted file mode 100644 index 6cdde5cbea..0000000000 --- a/lib/measure.js +++ /dev/null @@ -1,159 +0,0 @@ -import { resolve } from "path"; -import { fileURLToPath } from "url"; -import { - alterFile, - revertFile, - install, - runScript, - clearCaches, - calcStatistics, - clearBuildCaches, -} from "./utils.js"; - -const rootDir = resolve(fileURLToPath(import.meta.url), "../.."); - -export default async (caseName, scenarioAndAddons, options) => { - const [scenarioName, ...addonNames] = scenarioAndAddons.split("+"); - const casePath = resolve(rootDir, "cases", caseName); - const pkg = resolve(casePath, "package.json"); - const lockfile = resolve(casePath, "yarn.lock"); - const rootPkg = resolve(rootDir, "package.json"); - const rootLockfile = resolve(rootDir, "yarn.lock"); - const scenarioModule = await import(`../scenarios/${scenarioName}.js`); - const scenario = { ...scenarioModule.default, ...scenarioModule }; - const addons = await Promise.all( - addonNames.map((name) => import(`../addons/${name}.js`)) - ); - options = { ...options, addons }; - await clearCaches(casePath); - let pkgData; - await alterFile(pkg, (content) => { - pkgData = JSON.parse(content); - for (const addon of addons) { - if (addon.prePackageJson) - pkgData = addon.prePackageJson(pkgData, options); - } - pkgData = { - ...pkgData, - devDependencies: undefined, - }; - return JSON.stringify(pkgData, null, 2); - }); - await alterFile(lockfile, () => null); - await alterFile(rootPkg, () => null); - await alterFile(rootLockfile, () => null); - - const cwd = process.cwd(); - try { - process.chdir(casePath); - let installOptions = {}; - - // addons - for (const addon of addons) { - if (addon.beforeInstall) await addon.beforeInstall(options); - if (addon.installOptions) - installOptions = { ...installOptions, ...addon.installOptions }; - } - - // pre install - if (options.install !== false) { - await install(installOptions, { - ...options, - date: pkgData.dependenciesDate, - }); - } - await alterFile(pkg, (content) => { - pkgData = JSON.parse(content); - for (const addon of addons) { - if (addon.packageJson) pkgData = addon.packageJson(pkgData, options); - } - pkgData = { - ...pkgData, - resolutions: { - ...pkgData.resolutions, - ...options.dependencies, - }, - }; - return JSON.stringify(pkgData, null, 2); - }); - - // install - if (options.install !== false) { - try { - await install(installOptions, options); - } catch { - await install(installOptions, options); - } - } - - // revert root files - await revertFile(rootPkg); - await revertFile(rootLockfile); - - // addons - for (const addon of addons) { - if (addon.beforeSetup) await addon.beforeSetup(options); - } - - // setup - if (pkgData.scripts && pkgData.scripts["bench:setup"]) - await runScript("bench:setup", options); - if (scenario.setup) await scenario.setup(options); - - let keepBuildCache = false; - // addons - for (const addon of addons) { - if (addon.setup) await addon.setup(options); - if (addon.keepBuildCache) keepBuildCache |= addon.keepBuildCache; - } - - // caching - await clearBuildCaches(casePath); - - if (options.warmup !== false) { - // warmup - console.log(`${caseName} ${scenarioAndAddons} warmup`); - console.time(`${caseName} ${scenarioAndAddons} warmup`); - await scenario.warmup(options); - console.timeEnd(`${caseName} ${scenarioAndAddons} warmup`); - if (addons.some((addon) => addon.warmupTwice)) { - console.time(`${caseName} ${scenarioAndAddons} second warmup`); - await scenario.warmup(options); - console.timeEnd(`${caseName} ${scenarioAndAddons} second warmup`); - } - } - - // measure - const results = []; - - const maxRuns = options.runs || 1; - const timeout = options.timeout || 5 * 60 * 1000; - - const start = Date.now(); - for (let i = 0; i < maxRuns; i++) { - // caching - if (!keepBuildCache) await clearBuildCaches(casePath); - - // run - results.push(await scenario.run(options)); - const runtime = Date.now() - start; - const percentage = Math.max(runtime / timeout, (i + 1) / maxRuns); - console.log( - `${caseName} ${scenarioAndAddons} ${Math.round(percentage * 100)}%` - ); - if (runtime > timeout) break; - } - return options.noStatistics ? results[0] : calcStatistics(results); - } finally { - if (scenario.teardown) await scenario.teardown(options); - // addons - for (const addon of addons) { - if (addon.teardown) await addon.teardown(options); - } - await revertFile(pkg); - await revertFile(lockfile); - await revertFile(rootPkg); - await revertFile(rootLockfile); - process.chdir(cwd); - } -}; diff --git a/lib/utils.js b/lib/utils.js deleted file mode 100644 index 7e2dd8c186..0000000000 --- a/lib/utils.js +++ /dev/null @@ -1,490 +0,0 @@ -import { - readFile, - readdir, - writeFile, - stat, - rename, - copyFile, - utimes, - unlink, -} from "fs/promises"; -import * as fs from "fs/promises"; -import { spawn } from "child_process"; -import { resolve } from "path"; -import { gzip as gzipCallback } from "zlib"; -import { promisify } from "util"; -import { createServer } from "./custom-registry.js"; -const gzip = promisify(gzipCallback); - -export const alterFile = async (filePath, fn, options = {}) => { - const orginalFile = `${filePath}.original`; - let baseFile = filePath; - try { - if ((await stat(orginalFile)).isFile()) { - baseFile = orginalFile; - } - } catch {} - let content = null; - try { - content = await readFile(baseFile, "utf-8"); - } catch {} - if (fn) { - if (baseFile === filePath && content !== null) { - await copyFile(filePath, orginalFile); - } - const newContent = fn(content); - if (content !== newContent || baseFile !== filePath) { - if (newContent === null) { - try { - await unlink(filePath); - } catch {} - } else { - await writeFile(filePath, newContent); - if (options.past) { - await utimes(filePath, 1, 1); - } - } - } - } else if (baseFile !== filePath) { - await rename(baseFile, filePath); - } -}; - -export const revertFile = (filePath) => - alterFile(filePath, null, { past: true }); - -export const runCommand = async (command, args, verbose, env) => { - const p = spawn(command, args, { - shell: true, - stdio: verbose ? "inherit" : "ignore", - env: env - ? { - ...process.env, - ...env, - } - : undefined, - }); - const exitCode = await new Promise((resolve) => p.once("exit", resolve)); - if (exitCode !== 0) - throw new Error(`${command} ${args.join(" ")} failed with ${exitCode}`); -}; - -export const install = async ({ pnp }, { verboseSetup, date }) => { - let close; - try { - if (pnp) { - await runCommand("yarn", ["set", "version", "berry"], verboseSetup); - } - - if (date) { - close = await createServer(date); - } - - if (date) console.log("Will install dependencies as of " + date); - await runCommand( - "yarn", - ["install"], - verboseSetup, - date - ? pnp - ? { - YARN_NPM_REGISTRY_SERVER: "http://localhost:3333", - YARN_UNSAFE_HTTP_WHITELIST: "localhost", - } - : { YARN_REGISTRY: "http://localhost:3333" } - : undefined - ); - } finally { - if (close) { - await close(); - } - } -}; - -export const runScript = async (name, options) => { - await runCommand("yarn", ["run", name], options.verboseSetup); -}; - -const rmdir = (p) => { - if (fs.rm) { - return fs.rm(p, { - force: true, - maxRetries: 10, - recursive: true, - }); - } else { - return fs.rmdir(p, { - maxRetries: 10, - recursive: true, - }); - } -}; - -export const clearCaches = async (directory) => { - const paths = [ - "node_modules/.cache", - ".yarn/.cache", - ".cache", - ".pnp.js", - "dist", - ".yarnrc.yml", - ]; - await Promise.all(paths.map((p) => rmdir(resolve(directory, p)))); -}; - -export const clearBuildCaches = async (directory) => { - const paths = ["node_modules/.cache", "dist"]; - await Promise.all(paths.map((p) => rmdir(resolve(directory, p)))); -}; - -export const readFileSizes = async (directory) => { - const result = {}; - const entries = await readdir(directory, { withFileTypes: true }); - for (const entry of entries) { - if (entry.isFile()) { - const stats = await stat(resolve(directory, entry.name)); - result[`${entry.name} size`] = stats.size; - result[`${entry.name} gzip size`] = ( - await gzip(await readFile(resolve(directory, entry.name)), { level: 9 }) - ).length; - } - } - return result; -}; - -const T_TABLE = [ - 12.71, - 4.303, - 3.182, - 2.776, - 2.571, - 2.447, - 2.365, - 2.306, - 2.262, - 2.228, - 2.201, - 2.179, - 2.16, - 2.145, - 2.131, - 2.12, - 2.11, - 2.101, - 2.093, - 2.086, - 2.08, - 2.074, - 2.069, - 2.064, - 2.06, - 2.056, - 2.052, - 2.048, - 2.045, - 2.042, -]; - -const tDist95Two = (n) => { - if (n <= 1) return 12.71; - if (n <= 30) return T_TABLE[n - 1]; - if (n <= 40) return 2.021; - if (n <= 50) return 2.009; - if (n <= 60) return 2.0; - if (n <= 80) return 1.99; - if (n <= 100) return 1.984; - if (n <= 120) return 1.98; - return 1.96; -}; - -export const calcStatistics = (results) => { - const stats = {}; - for (const key of Object.keys(results[0])) { - const values = results.map((r) => r[key] || 0); - if (typeof values[0] === "object") { - stats[key] = calcStatistics(values); - } else { - values.sort(); - const mean = values.reduce((sum, v) => sum + v, 0) / values.length; - const variance = - values.reduce((sum, v) => sum + (mean - v) ** 2, 0) / values.length; - const stdDev = Math.sqrt(variance); - const confidence = - (tDist95Two(values.length - 1) * stdDev) / Math.sqrt(values.length); - const low = Math.max(0, mean - confidence); - const high = mean + confidence; - stats[key] = { - min: Math.min(...values), - max: Math.max(...values), - mean, - median: - values.length % 2 === 0 - ? (values[values.length / 2 - 1] + values[values.length / 2]) / 2 - : values[(values.length - 1) / 2], - variance, - stdDev, - confidence: high - low, - low, - high, - count: values.length, - }; - } - } - return stats; -}; - -export const normalizeResult = (results, base) => { - const stats = {}; - for (const key of Object.keys(results)) { - const value = results[key]; - const normalizedValue = { ...value }; - normalizedValue.base = base; - stats[key] = normalizedValue; - } - return stats; -}; - -const getType = (name) => { - if (name.endsWith(" memory")) return "memory"; - if (name.endsWith(" gzip size")) return "gzip size"; - if (name.endsWith(" size")) return "size"; - return "time"; -}; - -const typeOrder = { - time: 0, - memory: 1, - size: 2, - "gzip size": 3, -}; - -export const compareStatistics = ( - base, - current, - totals = { - time: current.stats.mean, - size: Object.keys(current) - .filter((n) => getType(n) === "size") - .reduce((sum, key) => sum + current[key].mean, 0), - "gzip size": Object.keys(current) - .filter((n) => getType(n) === "gzip size") - .reduce((sum, key) => sum + current[key].mean, 0), - memory: Object.keys(current) - .filter((n) => getType(n) === "memory") - .reduce((sum, key) => sum + current[key].mean, 0), - } -) => { - const diff = {}; - for (const key of new Set([...Object.keys(base), ...Object.keys(current)])) { - const baseValue = base[key]; - const currentValue = current[key]; - if (baseValue === undefined || currentValue === undefined) continue; - if ("mean" in baseValue) { - const type = getType(key); - diff[key] = { - type, - relevance: currentValue.mean / totals[type], - }; - for (const k of Object.keys(baseValue)) { - diff[key][k] = - baseValue[k] === 0 && currentValue[k] === 0 - ? 1 - : currentValue[k] / baseValue[k]; - } - diff[key].lowHigh = currentValue.high / baseValue.low; - diff[key].highLow = currentValue.low / baseValue.high; - diff[key].baseStdDev = baseValue.stdDev / baseValue.mean; - diff[key].currentStdDev = currentValue.stdDev / currentValue.mean; - diff[key].baseConfidence = baseValue.confidence / baseValue.mean; - diff[key].currentConfidence = currentValue.confidence / currentValue.mean; - } else { - diff[key] = compareStatistics(baseValue, currentValue, totals); - } - } - return diff; -}; - -export const formatTable = (entries, columns, { postRow }) => { - if (entries.length === 0) return undefined; - const rows = entries.map((entry) => - Object.keys(columns).map((key) => columns[key](entry) || "") - ); - const header = Object.keys(columns); - const columnSizes = header.map((key, i) => - Math.max(key.length, ...rows.map((row) => row[i].length)) - ); - const getLine = (l) => - `| ${l - .map((item, i) => `${item}${" ".repeat(columnSizes[i] - item.length)}`) - .join(" | ")} |`; - return [ - getLine(header), - `| ${columnSizes.map((s) => "-".repeat(s)).join(" | ")} |`, - ...rows.map((row) => { - const line = getLine(row); - return postRow(line, row); - }), - ].join("\n"); -}; - -export const formatDiffTable = ( - diff, - { colors, verbose, limit, threshold } -) => { - let entries = Object.keys(diff).map((key) => ({ name: key, ...diff[key] })); - entries.sort((a, b) => { - if (a.type !== b.type) { - return typeOrder[a.type] - typeOrder[b.type]; - } - return b.relevance - a.relevance; - }); - if (!verbose) { - entries = entries.filter((e) => e.lowHigh < 1 || e.highLow > 1); - } - if (threshold) { - entries = entries.filter((e) => e.relevance >= threshold); - } - if (limit) { - entries = entries.slice(0, limit); - } - if (entries.length === 0) return undefined; - const offset = (factor) => { - if (factor > 10) return `${Math.round(factor * 10) / 10}x`; - if (factor > 1.1) return `+${Math.round(factor * 100 - 100)}%`; - if (factor > 1) return `+${Math.round(factor * 1000 - 1000) / 10}%`; - if (factor === 1) return `=`; - if (factor > 0.9) return `-${Math.round(1000 - factor * 1000) / 10}%`; - return `-${Math.round(100 - factor * 100)}%`; - }; - const percentage = (value) => { - if (value > 10) return `${Math.round(value * 10) / 10}x`; - if (value > 0.1) return `${Math.round(value * 100)}%`; - if (value > -0.1) return `${Math.round(value * 1000) / 10}%`; - return `${Math.round(value * 100)}%`; - }; - const columns = { - rel: (l) => `${Math.round(l.relevance * 10000) / 100}%`, - diff: (l) => - l.lowHigh && l.lowHigh < 1 - ? offset(l.lowHigh) - : l.highLow && l.highLow > 1 - ? offset(l.highLow) - : "unclear", - name: (l) => l.name, - mean: (l) => offset(l.mean), - ...(verbose - ? { - med: (l) => offset(l.median), - min: (l) => offset(l.min), - max: (l) => offset(l.max), - std: (l) => offset(l.stdDev), - con: (l) => offset(l.confidence), - } - : undefined), - baseCon: (l) => percentage(l.baseConfidence), - curCon: (l) => percentage(l.currentConfidence), - }; - return formatTable(entries, columns, { - postRow: (line, row) => { - if (colors) { - if (row[1].startsWith("+") || row[1].endsWith("x")) - return `\u001b[1m\u001b[31m${line}\u001b[39m\u001b[22m`; - if (row[1].startsWith("-")) - return `\u001b[1m\u001b[32m${line}\u001b[39m\u001b[22m`; - } - return line; - }, - }); -}; - -export const formatResultTable = ( - result, - { colors, verbose, limit, threshold } -) => { - let entries = Object.keys(result).map((key) => ({ - name: key, - ...result[key], - })); - entries.sort((a, b) => { - const aType = getType(a.name); - const bType = getType(b.name); - if (aType !== bType) { - return typeOrder[aType] - typeOrder[bType]; - } - return b.median - a.median; - }); - if (threshold) { - entries = entries.filter((e) => e.relevance >= threshold); - } - if (limit) { - entries = entries.slice(0, limit); - } - if (entries.length === 0) return undefined; - const f = (name, value) => { - if (name.endsWith(" size")) return bytes(value); - if (name.endsWith(" memory")) return bytes(value); - return ms(value); - }; - const bytes = (value) => { - if (value === 0) return `-`; - if (value > 1024 * 102400) return `${Math.round(value / 1024 / 1024)} MiB`; - if (value > 1024 * 10240) - return `${Math.round(value / 1024 / 102.4) / 10} MiB`; - if (value > 1024 * 1024) - return `${Math.round(value / 1024 / 10.24) / 100} MiB`; - if (value > 102400) return `${Math.round(value / 1024)} KiB`; - if (value > 10240) return `${Math.round(value / 102.4) / 10} KiB`; - if (value > 1024) return `${Math.round(value / 10.24) / 100} KiB`; - return `${Math.round(value)} bytes`; - }; - const ms = (value) => { - if (value === 0) return `0 ms`; - if (value > 100000) return `${Math.round(value / 1000)} s`; - if (value > 10000) return `${Math.round(value / 100) / 10} s`; - if (value > 1000) return `${Math.round(value / 10) / 100} s`; - if (value > 10) return `${Math.round(value)} ms`; - if (value > 1) return `${Math.round(value * 10) / 10} ms`; - if (value > 0.1) return `${Math.round(value * 100) / 100} ms`; - if (value > 0.01) return `${Math.round(value * 1000)} µs`; - return `${Math.round(value * 10000) / 10} µs`; - }; - const columns = { - name: (l) => l.name, - median: (l) => f(l.name, l.median), - mean: (l) => f(l.name, l.mean), - ...(verbose - ? { - stdDev: (l) => f(l.name, l.stdDev), - min: (l) => f(l.name, l.min), - max: (l) => f(l.name, l.max), - low: (l) => f(l.name, l.low), - high: (l) => f(l.name, l.high), - con: (l) => f(l.name, l.confidence), - con: (l) => f(l.name, l.confidence), - n: (l) => `${l.count}`, - } - : undefined), - }; - return formatTable(entries, columns, { - postRow: (line, row) => { - if (colors) { - if (row[1].startsWith("+") || row[1].endsWith("x")) - return `\u001b[1m\u001b[31m${line}\u001b[39m\u001b[22m`; - if (row[1].startsWith("-")) - return `\u001b[1m\u001b[32m${line}\u001b[39m\u001b[22m`; - } - return line; - }, - }); -}; - -export const parseDependencies = (value) => { - const deps = {}; - for (const str of value.split(",")) { - const match = /^([^@]+)@(.+)$/.exec(str.trim()); - if (!match) continue; - const [, key, value] = match; - deps[key] = value; - } - return deps; -}; diff --git a/package.json b/package.json index 9d37f55090..868dca5a6c 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,45 @@ { - "name": "webpack-benchmark", + "name": "@webpack/benchmark", "version": "1.0.0", + "description": "Webpack Benchmarker", "type": "module", - "description": "Run benchmarks for webpack.", - "repository": "https://github.com/webpack/benchmark", - "author": "Tobias Koppers ", + "main": "src/core/cli.mjs", + "author": "Aviv Keller ", "license": "MIT", - "private": true, + "keywords": [ + "bundler", + "benchmark", + "performance", + "cli" + ], + "repository": { + "type": "git", + "url": "https://github.com/webpack/benchmark.git" + }, + "bin": { + "benchmark": "./src/core/cli.mjs" + }, + "scripts": { + "format": "prettier --check .", + "format:fix": "prettier --write .", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "start": "node ./src/core/cli.mjs" + }, "dependencies": { - "ncp": "^2.0.0", - "ssl-root-cas": "^1.3.1" + "@parcel/core": "2.15.4", + "cli-table3": "^0.6.5", + "commander": "^14.0.1", + "consola": "^3.4.2", + "parcel": "^2.15.4", + "vite": "^7.1.5", + "webpack": "^5.101.3" + }, + "devDependencies": { + "@eslint/js": "^9.35.0", + "eslint": "^9.35.0", + "eslint-plugin-import-x": "^4.16.1", + "globals": "^16.4.0", + "prettier": "^3.6.2" } } diff --git a/scenarios/development-build.js b/scenarios/development-build.js deleted file mode 100644 index 59105bc83c..0000000000 --- a/scenarios/development-build.js +++ /dev/null @@ -1,3 +0,0 @@ -import build from "../lib/build.js"; - -export default build(["build", "--mode", "development"]); diff --git a/scenarios/development-rebuild.js b/scenarios/development-rebuild.js deleted file mode 100644 index 4e090ba301..0000000000 --- a/scenarios/development-rebuild.js +++ /dev/null @@ -1,3 +0,0 @@ -import build from "../lib/build.js"; - -export default build(["build", "--mode", "development", "--watch"]); diff --git a/scenarios/production-build.js b/scenarios/production-build.js deleted file mode 100644 index e80a9e5ec7..0000000000 --- a/scenarios/production-build.js +++ /dev/null @@ -1,3 +0,0 @@ -import build from "../lib/build.js"; - -export default build(["build", "--mode", "production"]); diff --git a/src/bundlers/parcel.mjs b/src/bundlers/parcel.mjs new file mode 100644 index 0000000000..86d772127a --- /dev/null +++ b/src/bundlers/parcel.mjs @@ -0,0 +1,47 @@ +import { Parcel } from "@parcel/core"; +import path from "node:path"; +import { removeIfExists } from "../core/utils/file.mjs"; + +const BUNDLER_NAME = "parcel"; +const OUTPUT_DIR = "parcel-dist"; + +export async function build(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + const config = createParcelConfig(fixture, outputPath); + + const bundler = new Parcel({ + entries: config.entries, + defaultConfig: "@parcel/config-default", + targets: config.targets, + logLevel: "error", + }); + + const { bundleGraph } = await bundler.run(); + + return { + bundler: BUNDLER_NAME, + outputPath, + success: true, + buildResult: bundleGraph, + }; +} + +export async function clean(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + await removeIfExists(outputPath); + await removeIfExists(".parcel-cache"); +} + +export function createParcelConfig(fixture, distDir) { + return { + entries: [path.join(fixture, "main.js")], + targets: { + default: { + distDir, + optimize: true, + scopeHoist: true, + sourceMap: false, + }, + }, + }; +} diff --git a/src/bundlers/vite.mjs b/src/bundlers/vite.mjs new file mode 100644 index 0000000000..ebd6917c85 --- /dev/null +++ b/src/bundlers/vite.mjs @@ -0,0 +1,39 @@ +import { build as vite } from "vite"; +import path from "node:path"; +import { removeIfExists } from "../core/utils/file.mjs"; + +const BUNDLER_NAME = "vite"; +const OUTPUT_DIR = "vite-dist"; + +export async function build(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + const config = createViteConfig(fixture, outputPath); + const result = await vite(config); + + return { + bundler: BUNDLER_NAME, + outputPath, + success: true, + buildResult: result, + }; +} + +export async function clean(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + await removeIfExists(outputPath); +} + +export function createViteConfig(fixture, outDir) { + return { + root: fixture, + build: { + outDir, + minify: true, + sourcemap: false, + rollupOptions: { + input: path.join(fixture, "main.js"), + }, + }, + logLevel: "error", + }; +} diff --git a/src/bundlers/webpack.mjs b/src/bundlers/webpack.mjs new file mode 100644 index 0000000000..d6ecba0ba2 --- /dev/null +++ b/src/bundlers/webpack.mjs @@ -0,0 +1,59 @@ +import webpack from "webpack"; +import path from "node:path"; +import { removeIfExists } from "../core/utils/file.mjs"; + +const BUNDLER_NAME = "webpack"; +const OUTPUT_DIR = "webpack-dist"; + +export async function build(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + const config = createWebpackConfig(fixture, outputPath); + const result = await runWebpack(config); + + return { + bundler: BUNDLER_NAME, + outputPath, + success: true, + buildResult: result, + }; +} + +function runWebpack(config) { + return new Promise((resolve, reject) => { + webpack(config, (err, stats) => { + if (err) { + reject(err); + return; + } + if (stats.hasErrors()) { + const errors = stats.toJson().errors; + reject( + new Error( + `Webpack compilation errors: ${errors.map((e) => e.message).join(", ")}`, + ), + ); + return; + } + resolve(stats); + }); + }); +} + +export async function clean(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + await removeIfExists(outputPath); +} + +export function createWebpackConfig(fixture, outputPath) { + return { + mode: "production", + entry: path.join(fixture, "main.js"), + output: { + path: outputPath, + }, + optimization: { + minimize: true, + }, + stats: "errors-only", // Reduce noise during benchmarking + }; +} diff --git a/src/core/cli.mjs b/src/core/cli.mjs new file mode 100644 index 0000000000..30842fa9f0 --- /dev/null +++ b/src/core/cli.mjs @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +import { Command } from "commander"; +import { BenchmarkRunner } from "./runner.mjs"; +import { consola } from "consola"; + +new Command() + .option("-b, --bundlers ", "Select bundlers to benchmark", [ + "vite", + "webpack", + ]) + .option("-m, --metrics ", "Choose metrics to collect", [ + "build-time", + "size", + ]) + .option("-r, --reporter ", "Choose output format", "console") + .option("--fixtures ", "Glob to fixtures", "./fixtures/*") + .option("--verbose", "Enable verbose logging") + .option("--silent", "Suppress all output except errors") + .action(async (options) => { + // Logger + if (options.silent) { + consola.level = -999; + } else if (options.verbose) { + consola.level = 999; + } + + consola.start("Starting bundler benchmarks..."); + const runner = new BenchmarkRunner(options); + await runner.run(); + + consola.success("Benchmarking completed successfully!"); + }) + .parse(); diff --git a/src/core/runner.mjs b/src/core/runner.mjs new file mode 100644 index 0000000000..771e2698a7 --- /dev/null +++ b/src/core/runner.mjs @@ -0,0 +1,105 @@ +import { performance } from "node:perf_hooks"; +import { glob } from "node:fs/promises"; +import { isAbsolute, join } from "node:path"; +import { consola } from "consola"; + +const cache = new Map(); + +export async function load(module, instantiate = false) { + let mod = cache.get(module); + + if (!mod) { + mod = await import(import.meta.resolve(module)); + cache.set(module, mod); + } + + return instantiate ? new mod.default() : (mod.default ?? mod); +} + +export class BenchmarkRunner { + constructor(options) { + this.bundlers = options.bundlers; + this.metrics = options.metrics; + this.reporter = options.reporter; + this.fixturesGlob = options.fixtures; + } + + // This is the new entry point + async run() { + consola.info( + `Benchmarking ${this.bundlers.join(", ")} with metrics: ${this.metrics.join(", ")} on fixtures: ${this.fixturesGlob}`, + ); + + // Resolve all fixtures from glob + const cwd = process.cwd(); + const fixturePaths = (await Array.fromAsync(glob(this.fixturesGlob))).map( + (fixturePath) => + isAbsolute(fixturePath) ? fixturePath : join(cwd, fixturePath), + ); + + // Load reporter + const report = await load(`../reporters/${this.reporter}.mjs`); + + // results will be: Map> + const allResults = new Map(); + + // Run for each fixture + for (const fixture of fixturePaths) { + consola.info(`Running benchmarks for fixture: ${fixture}`); + + const fixtureResults = await this.runForFixture(fixture); + allResults.set(fixture, fixtureResults); + } + + await report(allResults); + + return allResults; + } + + async runForFixture(fixture) { + const results = new Map(); + for (const bundler of this.bundlers) { + results.set(bundler, {}); + } + + for (const bundlerName of this.bundlers) { + const bundler = await load(`../bundlers/${bundlerName}.mjs`); + + const metrics = await Promise.all( + this.metrics.map((metric) => load(`../metrics/${metric}.mjs`, true)), + ); + + results.set( + bundlerName, + await this.runSingleBenchmark(bundler, metrics, fixture), + ); + } + + return results; + } + + async runSingleBenchmark(bundler, metrics, fixture) { + await bundler.clean(fixture); + + await Promise.all(metrics.map((metric) => metric.start?.())); + + const startTime = performance.now(); + const buildResult = await bundler.build(fixture); + const endTime = performance.now(); + + await Promise.all(metrics.map((metric) => metric.stop?.())); + + return new Map( + await Promise.all( + metrics.map(async (m) => [ + m.name, + await m.collect(buildResult, { + startTime, + endTime, + fixture, + }), + ]), + ), + ); + } +} diff --git a/src/core/utils/file.mjs b/src/core/utils/file.mjs new file mode 100644 index 0000000000..96f55f68ce --- /dev/null +++ b/src/core/utils/file.mjs @@ -0,0 +1,40 @@ +import fs from "node:fs/promises"; +import path from "node:path"; + +// Get the total size of a directory (recursively) +export async function getDirectorySize(dirPath) { + let totalSize = 0; + try { + const files = await fs.readdir(dirPath, { withFileTypes: true }); + for (const file of files) { + const filePath = path.join(dirPath, file.name); + if (file.isDirectory()) { + totalSize += await getDirectorySize(filePath); + } else { + const stats = await fs.stat(filePath); + totalSize += stats.size; + } + } + } catch { + // Just return the current (probable) size + } + + return totalSize; +} + +// Check if a file exists +async function exists(filePath) { + try { + await fs.access(filePath); + return true; + } catch { + return false; + } +} + +// Remove all contents +export async function removeIfExists(filePath) { + if (await exists(filePath)) { + await fs.rm(filePath, { recursive: true, force: true }); + } +} diff --git a/src/core/utils/formatting.mjs b/src/core/utils/formatting.mjs new file mode 100644 index 0000000000..423fa95bf2 --- /dev/null +++ b/src/core/utils/formatting.mjs @@ -0,0 +1,21 @@ +// Format milliseconds into a human-readable duration string +export function formatDuration(milliseconds) { + if (milliseconds < 1000) { + return `${Math.round(milliseconds)}ms`; + } else if (milliseconds < 60000) { + return `${(milliseconds / 1000).toFixed(2)}s`; + } else { + const minutes = Math.floor(milliseconds / 60000); + const seconds = ((milliseconds % 60000) / 1000).toFixed(2); + return `${minutes}m ${seconds}s`; + } +} + +// Format bytes to human-readable string +export function formatBytes(bytes) { + if (bytes === 0) return "0 B"; + const k = 1024; + const sizes = ["B", "KB", "MB", "GB"]; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; +} diff --git a/src/metrics/build-time.mjs b/src/metrics/build-time.mjs new file mode 100644 index 0000000000..70ebd5bf52 --- /dev/null +++ b/src/metrics/build-time.mjs @@ -0,0 +1,15 @@ +import { formatDuration } from "../core/utils/formatting.mjs"; + +export default class BuildTimeMetric { + name = "Build Time"; + + async collect(_, { startTime, endTime }) { + const buildTime = endTime - startTime; + + return { + value: buildTime, + unit: "ms", + formatted: formatDuration(buildTime), + }; + } +} diff --git a/src/metrics/size.mjs b/src/metrics/size.mjs new file mode 100644 index 0000000000..1117086234 --- /dev/null +++ b/src/metrics/size.mjs @@ -0,0 +1,17 @@ +import { formatBytes } from "../core/utils/formatting.mjs"; +import { getDirectorySize } from "../core/utils/file.mjs"; + +export default class SizeMetric { + name = "Size"; + + async collect({ outputPath }) { + // Get total directory size + const totalSize = await getDirectorySize(outputPath); + + return { + value: totalSize, + unit: "bytes", + formatted: formatBytes(totalSize), + }; + } +} diff --git a/src/reporters/console.mjs b/src/reporters/console.mjs new file mode 100644 index 0000000000..645ab44752 --- /dev/null +++ b/src/reporters/console.mjs @@ -0,0 +1,59 @@ +import Table from "cli-table3"; +import { consola } from "consola"; +import path from "path"; + +function extractMetrics(bundlerResults) { + const metrics = new Set(); + for (const [, bundlerMetrics] of bundlerResults) { + for (const metricName of bundlerMetrics.keys()) { + metrics.add(metricName); + } + } + return Array.from(metrics).sort(); +} + +function formatValue(metricData) { + if (!metricData) return "─"; + return metricData.formatted || String(metricData.value) || "─"; +} + +function createBundlerRow(bundler, bundlerMetrics, metricsList) { + const row = [bundler]; + + for (const metric of metricsList) { + const metricData = bundlerMetrics.get(metric); + row.push(formatValue(metricData)); + } + + return row; +} + +function printSummaryTable(bundlerResults, bundlers) { + const metricsList = extractMetrics(bundlerResults); + + const table = new Table({ + head: ["Bundler", ...metricsList], + colWidths: [15, ...Array(metricsList.length).fill(18)], + style: { head: ["cyan"], border: ["grey"] }, + }); + + for (const bundler of bundlers) { + const bundlerMetrics = bundlerResults.get(bundler); + table.push(createBundlerRow(bundler, bundlerMetrics, metricsList)); + } + + console.log(table.toString()); +} + +export default function displayResults(results) { + consola.info("Benchmark Results"); + console.log("=".repeat(60)); + + for (const [fixturePath, bundlerResults] of results) { + const fixtureName = path.basename(fixturePath); + consola.info(`Fixture: ${fixtureName}`); + + const bundlers = Array.from(bundlerResults.keys()); + printSummaryTable(bundlerResults, bundlers); + } +} diff --git a/yarn.lock b/yarn.lock index 6f8a318ffa..f551d896fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,19 +2,2922 @@ # yarn lockfile v1 -"@coolaj86/urequest@^1.3.6": - version "1.3.7" - resolved "https://registry.yarnpkg.com/@coolaj86/urequest/-/urequest-1.3.7.tgz#66a1d66378dd6534e9c8e68948bf09acf32bab77" - integrity sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA== +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -ncp@^2.0.0: +"@emnapi/core@^1.4.3": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.5.0.tgz#85cd84537ec989cebb2343606a1ee663ce4edaf0" + integrity sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg== + dependencies: + "@emnapi/wasi-threads" "1.1.0" + tslib "^2.4.0" + +"@emnapi/runtime@^1.4.3": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.5.0.tgz#9aebfcb9b17195dce3ab53c86787a6b7d058db73" + integrity sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ== + dependencies: + tslib "^2.4.0" + +"@emnapi/wasi-threads@1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz#60b2102fddc9ccb78607e4a3cf8403ea69be41bf" + integrity sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ== + dependencies: + tslib "^2.4.0" + +"@esbuild/aix-ppc64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz#ee6b7163a13528e099ecf562b972f2bcebe0aa97" + integrity sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw== + +"@esbuild/android-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.10.tgz#115fc76631e82dd06811bfaf2db0d4979c16e2cb" + integrity sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg== + +"@esbuild/android-arm@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.10.tgz#8d5811912da77f615398611e5bbc1333fe321aa9" + integrity sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w== + +"@esbuild/android-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.10.tgz#e3e96516b2d50d74105bb92594c473e30ddc16b1" + integrity sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg== + +"@esbuild/darwin-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.10.tgz#6af6bb1d05887dac515de1b162b59dc71212ed76" + integrity sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA== + +"@esbuild/darwin-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.10.tgz#99ae82347fbd336fc2d28ffd4f05694e6e5b723d" + integrity sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg== + +"@esbuild/freebsd-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.10.tgz#0c6d5558a6322b0bdb17f7025c19bd7d2359437d" + integrity sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg== + +"@esbuild/freebsd-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.10.tgz#8c35873fab8c0857a75300a3dcce4324ca0b9844" + integrity sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA== + +"@esbuild/linux-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.10.tgz#3edc2f87b889a15b4cedaf65f498c2bed7b16b90" + integrity sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ== + +"@esbuild/linux-arm@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.10.tgz#86501cfdfb3d110176d80c41b27ed4611471cde7" + integrity sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg== + +"@esbuild/linux-ia32@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.10.tgz#e6589877876142537c6864680cd5d26a622b9d97" + integrity sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ== + +"@esbuild/linux-loong64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.10.tgz#11119e18781f136d8083ea10eb6be73db7532de8" + integrity sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg== + +"@esbuild/linux-mips64el@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.10.tgz#3052f5436b0c0c67a25658d5fc87f045e7def9e6" + integrity sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA== + +"@esbuild/linux-ppc64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.10.tgz#2f098920ee5be2ce799f35e367b28709925a8744" + integrity sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA== + +"@esbuild/linux-riscv64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.10.tgz#fa51d7fd0a22a62b51b4b94b405a3198cf7405dd" + integrity sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA== + +"@esbuild/linux-s390x@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.10.tgz#a27642e36fc282748fdb38954bd3ef4f85791e8a" + integrity sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew== + +"@esbuild/linux-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.10.tgz#9d9b09c0033d17529570ced6d813f98315dfe4e9" + integrity sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA== + +"@esbuild/netbsd-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.10.tgz#25c09a659c97e8af19e3f2afd1c9190435802151" + integrity sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A== + +"@esbuild/netbsd-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.10.tgz#7fa5f6ffc19be3a0f6f5fd32c90df3dc2506937a" + integrity sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig== + +"@esbuild/openbsd-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.10.tgz#8faa6aa1afca0c6d024398321d6cb1c18e72a1c3" + integrity sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw== + +"@esbuild/openbsd-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.10.tgz#a42979b016f29559a8453d32440d3c8cd420af5e" + integrity sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw== + +"@esbuild/openharmony-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.10.tgz#fd87bfeadd7eeb3aa384bbba907459ffa3197cb1" + integrity sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag== + +"@esbuild/sunos-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.10.tgz#3a18f590e36cb78ae7397976b760b2b8c74407f4" + integrity sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ== + +"@esbuild/win32-arm64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.10.tgz#e71741a251e3fd971408827a529d2325551f530c" + integrity sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw== + +"@esbuild/win32-ia32@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.10.tgz#c6f010b5d3b943d8901a0c87ea55f93b8b54bf94" + integrity sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw== + +"@esbuild/win32-x64@0.25.10": + version "0.25.10" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.10.tgz#e4b3e255a1b4aea84f6e1d2ae0b73f826c3785bd" + integrity sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw== + +"@eslint-community/eslint-utils@^4.8.0": + version "4.9.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3" + integrity sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g== + dependencies: + eslint-visitor-keys "^3.4.3" + +"@eslint-community/regexpp@^4.12.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + +"@eslint/config-array@^0.21.0": + version "0.21.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.0.tgz#abdbcbd16b124c638081766392a4d6b509f72636" + integrity sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ== + dependencies: + "@eslint/object-schema" "^2.1.6" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/config-helpers@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.3.1.tgz#d316e47905bd0a1a931fa50e669b9af4104d1617" + integrity sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA== + +"@eslint/core@^0.15.2": + version "0.15.2" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.15.2.tgz#59386327d7862cc3603ebc7c78159d2dcc4a868f" + integrity sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg== + dependencies: + "@types/json-schema" "^7.0.15" + +"@eslint/eslintrc@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.1.tgz#e55f7f1dd400600dd066dbba349c4c0bac916964" + integrity sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^10.0.1" + globals "^14.0.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@9.35.0", "@eslint/js@^9.35.0": + version "9.35.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.35.0.tgz#ffbc7e13cf1204db18552e9cd9d4a8e17c692d07" + integrity sha512-30iXE9whjlILfWobBkNerJo+TXYsgVM5ERQwMcMKCHckHflCmf7wXDAHlARoWnh0s1U72WqlbeyE7iAcCzuCPw== + +"@eslint/object-schema@^2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f" + integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA== + +"@eslint/plugin-kit@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz#fd8764f0ee79c8ddab4da65460c641cefee017c5" + integrity sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w== + dependencies: + "@eslint/core" "^0.15.2" + levn "^0.4.1" + +"@humanfs/core@^0.19.1": + version "0.19.1" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77" + integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA== + +"@humanfs/node@^0.16.6": + version "0.16.7" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.7.tgz#822cb7b3a12c5a240a24f621b5a2413e27a45f26" + integrity sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ== + dependencies: + "@humanfs/core" "^0.19.1" + "@humanwhocodes/retry" "^0.4.0" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/retry@^0.4.0", "@humanwhocodes/retry@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" + integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== + +"@isaacs/balanced-match@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz#3081dadbc3460661b751e7591d7faea5df39dd29" + integrity sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ== + +"@isaacs/brace-expansion@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz#4b3dabab7d8e75a429414a96bd67bf4c1d13e0f3" + integrity sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA== + dependencies: + "@isaacs/balanced-match" "^4.0.1" + +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/source-map@^0.3.3": + version "0.3.11" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.11.tgz#b21835cbd36db656b857c2ad02ebd413cc13a9ba" + integrity sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + +"@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@lezer/common@^1.0.0": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@lezer/common/-/common-1.2.3.tgz#138fcddab157d83da557554851017c6c1e5667fd" + integrity sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA== + +"@lezer/lr@^1.0.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@lezer/lr/-/lr-1.4.2.tgz#931ea3dea8e9de84e90781001dae30dea9ff1727" + integrity sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA== + dependencies: + "@lezer/common" "^1.0.0" + +"@lmdb/lmdb-darwin-arm64@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.8.5.tgz#895d8cb16a9d709ce5fedd8b60022903b875e08e" + integrity sha512-KPDeVScZgA1oq0CiPBcOa3kHIqU+pTOwRFDIhxvmf8CTNvqdZQYp5cCKW0bUk69VygB2PuTiINFWbY78aR2pQw== + +"@lmdb/lmdb-darwin-x64@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-2.8.5.tgz#ca243534c8b37d5516c557e4624256d18dd63184" + integrity sha512-w/sLhN4T7MW1nB3R/U8WK5BgQLz904wh+/SmA2jD8NnF7BLLoUgflCNxOeSPOWp8geP6nP/+VjWzZVip7rZ1ug== + +"@lmdb/lmdb-linux-arm64@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-2.8.5.tgz#b44a8023057e21512eefb9f6120096843b531c1e" + integrity sha512-vtbZRHH5UDlL01TT5jB576Zox3+hdyogvpcbvVJlmU5PdL3c5V7cj1EODdh1CHPksRl+cws/58ugEHi8bcj4Ww== + +"@lmdb/lmdb-linux-arm@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-2.8.5.tgz#17bd54740779c3e4324e78e8f747c21416a84b3d" + integrity sha512-c0TGMbm2M55pwTDIfkDLB6BpIsgxV4PjYck2HiOX+cy/JWiBXz32lYbarPqejKs9Flm7YVAKSILUducU9g2RVg== + +"@lmdb/lmdb-linux-x64@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-2.8.5.tgz#6c61835b6cc58efdf79dbd5e8c72a38300a90302" + integrity sha512-Xkc8IUx9aEhP0zvgeKy7IQ3ReX2N8N1L0WPcQwnZweWmOuKfwpS3GRIYqLtK5za/w3E60zhFfNdS+3pBZPytqQ== + +"@lmdb/lmdb-win32-x64@2.8.5": + version "2.8.5" + resolved "https://registry.yarnpkg.com/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-2.8.5.tgz#8233e8762440b0f4632c47a09b1b6f23de8b934c" + integrity sha512-4wvrf5BgnR8RpogHhtpCPJMKBmvyZPhhUtEwMJbXh0ni2BucpfF07jlmyM11zRqQ2XIq6PbC2j7W7UCCcm1rRQ== + +"@mischnic/json-sourcemap@^0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@mischnic/json-sourcemap/-/json-sourcemap-0.1.1.tgz#0ef9b015a8f575dd9a8720d9a6b4dbc988425906" + integrity sha512-iA7+tyVqfrATAIsIRWQG+a7ZLLD0VaOCKV2Wd/v4mqIU3J9c4jx9p7S0nw1XH3gJCKNBOOwACOPYYSUu9pgT+w== + dependencies: + "@lezer/common" "^1.0.0" + "@lezer/lr" "^1.0.0" + json5 "^2.2.1" + +"@msgpackr-extract/msgpackr-extract-darwin-arm64@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz#9edec61b22c3082018a79f6d1c30289ddf3d9d11" + integrity sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw== + +"@msgpackr-extract/msgpackr-extract-darwin-x64@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz#33677a275204898ad8acbf62734fc4dc0b6a4855" + integrity sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw== + +"@msgpackr-extract/msgpackr-extract-linux-arm64@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz#19edf7cdc2e7063ee328403c1d895a86dd28f4bb" + integrity sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg== + +"@msgpackr-extract/msgpackr-extract-linux-arm@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz#94fb0543ba2e28766c3fc439cabbe0440ae70159" + integrity sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw== + +"@msgpackr-extract/msgpackr-extract-linux-x64@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz#4a0609ab5fe44d07c9c60a11e4484d3c38bbd6e3" + integrity sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg== + +"@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz#0aa5502d547b57abfc4ac492de68e2006e417242" + integrity sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ== + +"@napi-rs/wasm-runtime@^0.2.11": + version "0.2.12" + resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz#3e78a8b96e6c33a6c517e1894efbd5385a7cb6f2" + integrity sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ== + dependencies: + "@emnapi/core" "^1.4.3" + "@emnapi/runtime" "^1.4.3" + "@tybys/wasm-util" "^0.10.0" + +"@parcel/bundler-default@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/bundler-default/-/bundler-default-2.15.4.tgz#33f1ee6d3be7d10864f1f4567d5b90ef448a4cee" + integrity sha512-4vkaZuwGqL8L7NqEgjRznz9/QoeVKk0Z6z2nzfpdnSWA4xX3moUj+JeoqGUbyFGuPzfCma4SA4+txnQbKu0edQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/graph" "3.5.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/cache@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/cache/-/cache-2.15.4.tgz#64a5f57028ca7a4ee28f565b622ebb22901136d0" + integrity sha512-x/QgMuVvXQV6uNhIF+6kz6SzhVVkwf6WPSVG/xQvGMEiBabForDVYIhIEuN3RzUXCU352CGM6d8TtLLg61W1fw== + dependencies: + "@parcel/fs" "2.15.4" + "@parcel/logger" "2.15.4" + "@parcel/utils" "2.15.4" + lmdb "2.8.5" + +"@parcel/codeframe@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/codeframe/-/codeframe-2.15.4.tgz#69f00eea86313c5bc5cbe145607ae248803c32be" + integrity sha512-ErAPEQaJIpB+ocNZ3rl8AEK6piA7JBInwZLNU0eHMthm01Ssb10JkpAadyn1w9IVfCey+kqQcEeWv47Yh6mL1Q== + dependencies: + chalk "^4.1.2" + +"@parcel/compressor-raw@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/compressor-raw/-/compressor-raw-2.15.4.tgz#93a8d089e2621c90a5d1c09cce63279cbca4fc9b" + integrity sha512-gECePZxVXBwyo0DYbAq4V4SimVzHaJ3p8QOgFIfOqNmlEBbhLf3QSjArFPJNKiHZaJuclh4a+IShFBN+u6tXXw== + dependencies: + "@parcel/plugin" "2.15.4" + +"@parcel/config-default@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/config-default/-/config-default-2.15.4.tgz#df4987f2702cfece80859b13fcc27df53d876c4e" + integrity sha512-chUE4NpcSXpMfTcSmgl4Q78zH+ZFe0qdgZLBtF4EH2QQakW7wAXAYRxS2/P3xFkUj0/51sExhbCFWgulrlGDPw== + dependencies: + "@parcel/bundler-default" "2.15.4" + "@parcel/compressor-raw" "2.15.4" + "@parcel/namer-default" "2.15.4" + "@parcel/optimizer-css" "2.15.4" + "@parcel/optimizer-html" "2.15.4" + "@parcel/optimizer-image" "2.15.4" + "@parcel/optimizer-svg" "2.15.4" + "@parcel/optimizer-swc" "2.15.4" + "@parcel/packager-css" "2.15.4" + "@parcel/packager-html" "2.15.4" + "@parcel/packager-js" "2.15.4" + "@parcel/packager-raw" "2.15.4" + "@parcel/packager-svg" "2.15.4" + "@parcel/packager-wasm" "2.15.4" + "@parcel/reporter-dev-server" "2.15.4" + "@parcel/resolver-default" "2.15.4" + "@parcel/runtime-browser-hmr" "2.15.4" + "@parcel/runtime-js" "2.15.4" + "@parcel/runtime-rsc" "2.15.4" + "@parcel/runtime-service-worker" "2.15.4" + "@parcel/transformer-babel" "2.15.4" + "@parcel/transformer-css" "2.15.4" + "@parcel/transformer-html" "2.15.4" + "@parcel/transformer-image" "2.15.4" + "@parcel/transformer-js" "2.15.4" + "@parcel/transformer-json" "2.15.4" + "@parcel/transformer-node" "2.15.4" + "@parcel/transformer-postcss" "2.15.4" + "@parcel/transformer-posthtml" "2.15.4" + "@parcel/transformer-raw" "2.15.4" + "@parcel/transformer-react-refresh-wrap" "2.15.4" + "@parcel/transformer-svg" "2.15.4" + +"@parcel/core@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/core/-/core-2.15.4.tgz#5cfce948e9361e36f36cad9685124c7316b3cfeb" + integrity sha512-+TXxTm58lFwXXObFAEclwKX1p1AdixcD+M7T4NeFIQzQ4F20Vr+6oybCSqW1exNA3uHqVDDFLx7TT78seVjvkg== + dependencies: + "@mischnic/json-sourcemap" "^0.1.1" + "@parcel/cache" "2.15.4" + "@parcel/diagnostic" "2.15.4" + "@parcel/events" "2.15.4" + "@parcel/feature-flags" "2.15.4" + "@parcel/fs" "2.15.4" + "@parcel/graph" "3.5.4" + "@parcel/logger" "2.15.4" + "@parcel/package-manager" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/profiler" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + "@parcel/workers" "2.15.4" + base-x "^3.0.11" + browserslist "^4.24.5" + clone "^2.1.2" + dotenv "^16.5.0" + dotenv-expand "^11.0.7" + json5 "^2.2.3" + msgpackr "^1.11.2" + nullthrows "^1.1.1" + semver "^7.7.1" + +"@parcel/diagnostic@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/diagnostic/-/diagnostic-2.15.4.tgz#17393f0fa71da19c84d0668e496e4ca9427e1f77" + integrity sha512-8MAqefwzBKceNN3364OLm+p4HRD7AfimfFW3MntLxPB6bnelc9UBg5c9zEm34zYEctbmky8gqYgAUSDjqYC5Hw== + dependencies: + "@mischnic/json-sourcemap" "^0.1.1" + nullthrows "^1.1.1" + +"@parcel/error-overlay@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/error-overlay/-/error-overlay-2.15.4.tgz#bc5a90245a70c7e202dfe43c05112457a772bf58" + integrity sha512-xxeaWm8fV8Z4uGy/c09mOvmFSHBOgF1gCMQwLCwZvfMLqIWkdZaUQ2cRhWZIS6pOXaRVC7YpcXzk2DOiSUNSbQ== + +"@parcel/events@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/events/-/events-2.15.4.tgz#2a08fb358cff6888bc5151b1aece56671990681d" + integrity sha512-SBq4zstaFr7XQaXNaQmUuVh1swCUHrhtPCOSofvkJoQGhjsuhQlh4t0NmUikyKNdj7C1j40xCS1kGHuUO29b0g== + +"@parcel/feature-flags@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/feature-flags/-/feature-flags-2.15.4.tgz#07646d16668835977648999ebdedaa108b3ad722" + integrity sha512-DJqZVtbfjWJseM0gk7yyDkAuOhP7/FVwZ/YVqjozIqXBhmQm07xctiqNQyZX2vBbQsxmVbjpqyq+DOj45WPEzQ== + +"@parcel/fs@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/fs/-/fs-2.15.4.tgz#3f09cec9d780dcad5ce93811441c07056de423c4" + integrity sha512-5cahD2ByQaSi+YN0aDvrMWXZvs3mP7C5ey8zcDTDn7JxJa51sMqOQcdU3VUTzQFtAPeRM2KxUkxLhBBXgQqHZA== + dependencies: + "@parcel/feature-flags" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/types-internal" "2.15.4" + "@parcel/utils" "2.15.4" + "@parcel/watcher" "^2.0.7" + "@parcel/workers" "2.15.4" + +"@parcel/graph@3.5.4": + version "3.5.4" + resolved "https://registry.yarnpkg.com/@parcel/graph/-/graph-3.5.4.tgz#f2ac5c7d991cb9e2839c052cfec68cba3b659ad4" + integrity sha512-uF7kyQXWK2fQZvG5eE0N3avYGLQE5Q0vyJsyypNcFW3kXNnrkZCUtbG7urmdae9mmZ2jXIVN4q4Bhd9pefGj9A== + dependencies: + "@parcel/feature-flags" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/logger@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/logger/-/logger-2.15.4.tgz#a3a4452167db5ead13942bc1dd0b783ab5a11de9" + integrity sha512-rQ7F5+FMQ7t+w5NGFRT8CWHhym0aunduufCjlafvRzUSKEN/5/nwTfCe9I5QsthGlXJWs+ZTy4zQ+wLtZQRBKQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/events" "2.15.4" + +"@parcel/markdown-ansi@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/markdown-ansi/-/markdown-ansi-2.15.4.tgz#21e9119854dd7f07289eabc514ba1d2b939762f0" + integrity sha512-u5Lwcr4ZVBSLFbKYht+mJqJ3ZMXvJdmDMU5eDtrIEKPpu9LrIDdPpDEXBoyO6pDsoV/2AqyXUUMzBRyCatkkoQ== + dependencies: + chalk "^4.1.2" + +"@parcel/namer-default@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/namer-default/-/namer-default-2.15.4.tgz#46613c9ed8f433dda2a7907d41f4cb8076a508be" + integrity sha512-EXsoQ1S+5ZIfy8431E7F0vVS7bfH5JpZ+vFVcUpArJDkhmMG7T/eP6Kp9CXHLJmn7ki1x7iIVytrja0XXRQWBQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/node-resolver-core@3.6.4": + version "3.6.4" + resolved "https://registry.yarnpkg.com/@parcel/node-resolver-core/-/node-resolver-core-3.6.4.tgz#ff240da06cc57298f0c60178b935b60e1d621311" + integrity sha512-g3+usMnr7pfRqbMAksOpNA7GJk7HUNW1Wxx7Shhp4w0K9JUdVrd2LRKwZxbqL7H9NqWtVvUOT9cZbMlDR6bO1w== + dependencies: + "@mischnic/json-sourcemap" "^0.1.1" + "@parcel/diagnostic" "2.15.4" + "@parcel/fs" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + semver "^7.7.1" + +"@parcel/optimizer-css@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-css/-/optimizer-css-2.15.4.tgz#44e2f4278b20e7df4608202a875d6275a07c7642" + integrity sha512-KQLuqwcvVFTNFtM+bzfvQivwunmhVAngmR4NiI8zQaykidYH28V8YkVAQmpbLbgoGad/UgG7grb0UshvnrQHpw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + browserslist "^4.24.5" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/optimizer-html@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-html/-/optimizer-html-2.15.4.tgz#f6fa27766f7e6e0c57fff3ac8bccbae800e8d81f" + integrity sha512-gBvt6RdDVMyO1Flvdtc8DxpxLgIXhaKuVXEjHdAP7sEW0SMdSd6r/tl6Plmcszig7sDwhDf6IsQOIvbzGHYZZg== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/optimizer-image@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-image/-/optimizer-image-2.15.4.tgz#57a85fde1ad9280841cd819d45195602de0cb23e" + integrity sha512-M8fo7eEL6JRcmLhSX9pUUGU4MPrPrE9cMNcwIt3DQLnSvQ+sshhUDa6t9hKWeHHhs16BHvxrvksN2TIbkgHODQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + "@parcel/workers" "2.15.4" + +"@parcel/optimizer-svg@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-svg/-/optimizer-svg-2.15.4.tgz#12c7a05a26b25e93e47cb983bc612bb5a6fe02d4" + integrity sha512-pPdjRaLPqjAEROXIHLc6JWLLki56alhuUNbalhLqBCgktZrrq2dGCjBEVgxqRczc9D+ePCX/e/xci4tC0Tkcbg== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/optimizer-swc@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-swc/-/optimizer-swc-2.15.4.tgz#07168569eeaa26a50ec0fadf27b617f596717b7e" + integrity sha512-2m5cYESVCq6AGx252eSTArZ1Oc1Ve4GBGL7NhvgbNqOthyXlc2qAed6rCkARrBd8pfEl5+2XHeK1ijDAZdIZ/A== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + "@swc/core" "^1.11.24" + nullthrows "^1.1.1" + +"@parcel/package-manager@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/package-manager/-/package-manager-2.15.4.tgz#94954afd5b6d2bb8c80c96a6ffd1cb5217aad6cd" + integrity sha512-KZONBcEJ24moQdrpU0zJh9CYk3KKbpB5RUM70utAORem1yQKms+0Y4YED3njq6nZzbgwUN/Csc+powUHLZStvg== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/fs" "2.15.4" + "@parcel/logger" "2.15.4" + "@parcel/node-resolver-core" "3.6.4" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + "@parcel/workers" "2.15.4" + "@swc/core" "^1.11.24" + semver "^7.7.1" + +"@parcel/packager-css@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-css/-/packager-css-2.15.4.tgz#ef75eec1b30eea233b6f9e863a452c91aa115f3c" + integrity sha512-bzSaNf+I5lmJFu95wSG2k7pGwjCDesZsV6Y9sozIL2LoSxqvkGhm/ABXAa3Ed7dLe3tSAEBzJcyqShQgLzSzuw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/packager-html@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-html/-/packager-html-2.15.4.tgz#81a44e461854fc44ddaafdfa71a85150942e868c" + integrity sha512-Uayux6A2Anm66Kmq22QhD0TuVp9LiRCMuPUzBd6n4ekNlG0Lzm6K3/okMkPG65nKbNjq5qcPscFWlDxggvjt2g== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/packager-js@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-js/-/packager-js-2.15.4.tgz#14af23591731a716d185e4e08e5b2b228c399536" + integrity sha512-96bqhs1jyd28CfWQD+Yn8rSsd1ar7voHWyBtMLimsK+bDJIzL26Z7jWyRDwXRuLErYC01EoXRIRctxtmeRVJ2Q== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + globals "^13.24.0" + nullthrows "^1.1.1" + +"@parcel/packager-raw@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-raw/-/packager-raw-2.15.4.tgz#59ae6264d6df0ce1280c3bfa266056b2d69adcba" + integrity sha512-CaSpDt5jjcO0SYCtsDhw6yfTDQuDFQ875H42W/ftvSQL7RfLRljPthnbdcy9chvKBbvRBQF+0z8Sxwehrd5hsA== + dependencies: + "@parcel/plugin" "2.15.4" + +"@parcel/packager-svg@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-svg/-/packager-svg-2.15.4.tgz#126c51f8c4555ce4b706c1dfef4a99e09ea93cbf" + integrity sha512-qHsyOgnzoA2XGMLIYUnX79XAaV327VTWQvIzju/OmOjcff4o3uiEcNL8w9k3p2w2oPXOLoQ0THMiivoUQSM8GQ== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/packager-wasm@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/packager-wasm/-/packager-wasm-2.15.4.tgz#f7dc0243164ea09493c63f859463f2d43b6a104d" + integrity sha512-YPVij7zrBchtXr/y29P4uh3C/+19PMhhLibYF/8oMJKkFkeU3Uv00/XLm915vdBPrIPjgw0YuIfLzUKip1uGtg== + dependencies: + "@parcel/plugin" "2.15.4" + +"@parcel/plugin@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/plugin/-/plugin-2.15.4.tgz#742c08846d7c0ab174f040beac28c86c460e6220" + integrity sha512-XVehjmzk8ZDOFf/BXo26L76ZqCGNKIQcN2ngxAnq0KRY/WFanL8yLaL0qQq+c9whlu09hkGz1CuhFBLAIjJMYQ== + dependencies: + "@parcel/types" "2.15.4" + +"@parcel/profiler@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/profiler/-/profiler-2.15.4.tgz#aea16630151fef60edb9db1a34c840a9123cf262" + integrity sha512-ezVZlttUmQ1MQD5e8yVb07vSGYEFOB59Y/jaxL9mGSLZkVhMIIHe/7SuA+4qVAH8dlg6bslXRqlsunLMPEgPsg== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/events" "2.15.4" + "@parcel/types-internal" "2.15.4" + chrome-trace-event "^1.0.2" + +"@parcel/reporter-cli@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/reporter-cli/-/reporter-cli-2.15.4.tgz#0a5c8afe1d17058927faa3b392f73b8faa0c5a29" + integrity sha512-us0HIwuJqpSguf+yi4n8foabVs26JGvRB/eSOf0KkRldxFciYLn4NJ8rt3Xm1zvxlDiSkD4v2n77u+ouIZ+AEQ== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/types" "2.15.4" + "@parcel/utils" "2.15.4" + chalk "^4.1.2" + term-size "^2.2.1" + +"@parcel/reporter-dev-server@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/reporter-dev-server/-/reporter-dev-server-2.15.4.tgz#10f2ebb2f45f0c7524ae6b83a6991eb74ab386a3" + integrity sha512-uCNeDyArNNXI9YThlxyTx7+5ZSxlewyUdyrLdDZCqvn8s1xNB9W8sUNVps7mJZQSc+2ZRk3wyDemURD67uJk/A== + dependencies: + "@parcel/codeframe" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + +"@parcel/reporter-tracer@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/reporter-tracer/-/reporter-tracer-2.15.4.tgz#6ee5127a12d5c2e3bbaa47fee94b93c63a3a8a51" + integrity sha512-9W1xsb/FtobCQ4z847nI6hFDaTZHLeThv/z05EF77R30RX2k+unG9ac5NQB1v4KLx09Bhfre32+sjYNReWxWlg== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + chrome-trace-event "^1.0.3" + nullthrows "^1.1.1" + +"@parcel/resolver-default@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/resolver-default/-/resolver-default-2.15.4.tgz#e94da849e76621732274bb82703cbf52420db975" + integrity sha512-4uKo3FFnubtIc4rM9jZiQQXpa1slawyRy5btJEfTFvbcnz0dm3WThLrsPDMfmPwNr9F/n5x8yzDLI6/fZ/elgA== + dependencies: + "@parcel/node-resolver-core" "3.6.4" + "@parcel/plugin" "2.15.4" + +"@parcel/runtime-browser-hmr@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/runtime-browser-hmr/-/runtime-browser-hmr-2.15.4.tgz#4ab1231eaa86fa1f35c6bb9b6f61c52ba7a5d0c3" + integrity sha512-KRGzbxDUOQUkrJKxxY0WyU7oVaa9TvWTRlpuGJXzQJs/hw8vkAAoAm8+ptpypvBC8LnxFHzGbSyHPfL8C8MQOw== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/runtime-js@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/runtime-js/-/runtime-js-2.15.4.tgz#f0904e0f869d0944d958d42f4fe8404bf2cade9d" + integrity sha512-zNRK+693CMkYiA0ckjPOmz+JVHD9bVzp27itcMyuDH6l/Or8m09RgCC4DIdIxBqiplsDSe39DwEc5X7b0vvcjw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/runtime-rsc@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/runtime-rsc/-/runtime-rsc-2.15.4.tgz#4b688df19e8fdbd478f8eb5605d09e3e40d5c631" + integrity sha512-yHc4HEwzCQYLqa6Q1WtZ8xJeaDAk0p2i0b3ABq2I+izmRjer4jertlsEwh9mf9Z1eUGtJobdGYzl8Ai1VfhC3g== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/runtime-service-worker@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/runtime-service-worker/-/runtime-service-worker-2.15.4.tgz#e003a7b558b615f72615b75ca1fbc1a89297d7b7" + integrity sha512-NGq/wS34GIVzo2ZURBjCqgHV+PU7eTcngCzmmk/wrCEeWnr13ld+CAIxVZoqyNJwYsF6VQanrjSM2/LhCXEdyA== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/rust-darwin-arm64@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-arm64/-/rust-darwin-arm64-2.15.4.tgz#8716edcee0176394781cff6917f5cd9def77cb0f" + integrity sha512-cEpNDeEtvM5Nhj0QLN95QbcZ9yY6Z5W3+2OeHvnojEAP8Rp1XGzqVTTZdlyKyN1KTiyfzIOiQJCiEcr+kMc5Nw== + +"@parcel/rust-darwin-x64@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-x64/-/rust-darwin-x64-2.15.4.tgz#1556299e41cd3bd67391c613a892f0f5812a454a" + integrity sha512-jL9i13sXKeBXXz8Z3BNYoScPOi+ljBA0ubAE3PN5DCoAA6wS4/FsAiRSIUw+3uxqASBD7+JvaT5sDUga1Xft5g== + +"@parcel/rust-linux-arm-gnueabihf@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm-gnueabihf/-/rust-linux-arm-gnueabihf-2.15.4.tgz#514e3c7ae6b1eaca91a345ef5c705e95458f41ea" + integrity sha512-c8HpVdDugCutlMILoOlkTioih9HGJpQrzS2G3cg/O1a5ZTacooGf3eGJGoh6dUBEv9WEaEb6zsTRwFv2BgtZcA== + +"@parcel/rust-linux-arm64-gnu@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-gnu/-/rust-linux-arm64-gnu-2.15.4.tgz#78aaf9aa9be92a764eb76d013c580679eb12b44e" + integrity sha512-Wcfs/JY4FnuLxQaU+VX2rI4j376Qo2LkZmq4zp9frnsajaAqmloVQfnbUkdnQPEL4I38eHXerzBX3LoXSxnZKA== + +"@parcel/rust-linux-arm64-musl@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-musl/-/rust-linux-arm64-musl-2.15.4.tgz#c6d2cde97139d5329288cb44325534fe12a66659" + integrity sha512-xf9HxosEn3dU5M0zDSXqBaG8rEjLThRdTYqpkxHW/qQGzy0Se+/ntg8PeDHsSG5E9OK8xrcKH46Lhaw0QBF/Zw== + +"@parcel/rust-linux-x64-gnu@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-gnu/-/rust-linux-x64-gnu-2.15.4.tgz#476cbb6544117abca7e6f1b3c84737f2ad7182b4" + integrity sha512-RigXVCFj6h0AXmkuxU61rfgYuW+PXBR6qSkR2I20yKnAXoMfxLaZy9YJ3sAPMEjT9zXgzGAX+3syItMF+bRjaw== + +"@parcel/rust-linux-x64-musl@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-musl/-/rust-linux-x64-musl-2.15.4.tgz#76b62af4f6d7539f2d6dcaf0e0b84e76065116e2" + integrity sha512-tHlRgonSr5ca8OvhbGzZUggCgCOirRz5dHhPSCm4ajMxeDMamwprq6lKy0sCNTXht4TXIEyugBcfEuRKEeVIBw== + +"@parcel/rust-win32-x64-msvc@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust-win32-x64-msvc/-/rust-win32-x64-msvc-2.15.4.tgz#f64fade58dffe390754acc641a1a65950104a22e" + integrity sha512-YsX6vMl/bfyxqZSN7yiaZQKLoJKELSZYcvg8gIv4CF1xkaTdmfr6gvq2iCyoV+bwrodNohN4Xfl8r7Wniu1/UA== + +"@parcel/rust@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/rust/-/rust-2.15.4.tgz#2e6759c490869704e15466697786dd05fe7eba1c" + integrity sha512-OxOux8z8YEYg23+15uMmYaloFp3x1RwcliBay6HqxUW7RTmtI1/z+xd8AtienCckACD60gvDGy04LjgbEGdJVg== + optionalDependencies: + "@parcel/rust-darwin-arm64" "2.15.4" + "@parcel/rust-darwin-x64" "2.15.4" + "@parcel/rust-linux-arm-gnueabihf" "2.15.4" + "@parcel/rust-linux-arm64-gnu" "2.15.4" + "@parcel/rust-linux-arm64-musl" "2.15.4" + "@parcel/rust-linux-x64-gnu" "2.15.4" + "@parcel/rust-linux-x64-musl" "2.15.4" + "@parcel/rust-win32-x64-msvc" "2.15.4" + +"@parcel/source-map@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@parcel/source-map/-/source-map-2.1.1.tgz#fb193b82dba6dd62cc7a76b326f57bb35000a782" + integrity sha512-Ejx1P/mj+kMjQb8/y5XxDUn4reGdr+WyKYloBljpppUy8gs42T+BNoEOuRYqDVdgPc6NxduzIDoJS9pOFfV5Ew== + dependencies: + detect-libc "^1.0.3" + +"@parcel/transformer-babel@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-babel/-/transformer-babel-2.15.4.tgz#bffd85214853f0e80ad2e9097af130e6535a4547" + integrity sha512-rb4nqZcTLkLD3nvuYJ9wwNb8x6cajBK2l6csdYMLEI4516SkIzkO/gs2cZ9M5q+CMhxAqpdEnrwektbOtQQasg== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + browserslist "^4.24.5" + json5 "^2.2.3" + nullthrows "^1.1.1" + semver "^7.7.1" + +"@parcel/transformer-css@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-css/-/transformer-css-2.15.4.tgz#6250598c8507732f2dce5ce8f84210af13e47254" + integrity sha512-6tVwSJsOssXgcB5XMAQGsexAffoBEi8GVql3YQqzI1EwVYs9zr+B5mfbesb4aWcegR02w99NHJYFP9CrOr3SWw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + browserslist "^4.24.5" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/transformer-html@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-html/-/transformer-html-2.15.4.tgz#412b86e22806aa16311635028c431c4b3b60641f" + integrity sha512-gzYPbbyEuV8nzPojw86eD5Kf93AYUWcY8lu33gu0XHROJH7mq5MAwPwtb/U+EfpeCd0/oKbLzA2mkQksM1NncQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + +"@parcel/transformer-image@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-image/-/transformer-image-2.15.4.tgz#060d753ab75c9d2033fb82e078d1669480675e77" + integrity sha512-KOVwj2gKjUybuzHwarC/YVqRf3r2BD4/2ysckozj6DIji/bq3fd2rE9yqxWXO+zt918PsOSTzMKwRnaseaXLKQ== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + "@parcel/workers" "2.15.4" + nullthrows "^1.1.1" + +"@parcel/transformer-js@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-js/-/transformer-js-2.15.4.tgz#db320444667a398e36ef840cfaafdde4f5b46486" + integrity sha512-HX76PalPjqCLmXJnuSeMr2km8WlnUsW8oaRZ6FuZtSo9QD8BqIcwKGxSbIy9JHkObBgmrMOVpGtYrJM4/BlYbg== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.15.4" + "@parcel/workers" "2.15.4" + "@swc/helpers" "^0.5.0" + browserslist "^4.24.5" + nullthrows "^1.1.1" + regenerator-runtime "^0.14.1" + semver "^7.7.1" + +"@parcel/transformer-json@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-json/-/transformer-json-2.15.4.tgz#2d7c4f1ea876d8b59e0be165f480875f0ebc81c7" + integrity sha512-1ASeOSH3gPeaXyy/TZ7ce2TOfJ3ZeK5SBnDs+MM8LFcQsTwdRJKjX/4Qq9RgtMRryYAGHgMa09Gvp9FuFRyd+w== + dependencies: + "@parcel/plugin" "2.15.4" + json5 "^2.2.3" + +"@parcel/transformer-node@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-node/-/transformer-node-2.15.4.tgz#ce3c649dc82cf3fc99c90ace3482943dde8fa019" + integrity sha512-zV5jvZA971eQMcFtaWZkW1UfAH/G6XVM/87oJ2B4ip9o9aKUWIl296rrfg2xWxUQyPhy11B17CJ6b8NgieqqrQ== + dependencies: + "@parcel/plugin" "2.15.4" + +"@parcel/transformer-postcss@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-postcss/-/transformer-postcss-2.15.4.tgz#b0822af4816268da4aea21e353b5d58e9388ed64" + integrity sha512-cNueSpOj3ulmMX85xr9clh/t0+mzVE+Q3H7Cf/OammqUkG/xjmilq4q7ZTgQFyUtUdWpE9LWWHojbJuz6k2Ulw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/utils" "2.15.4" + clone "^2.1.2" + nullthrows "^1.1.1" + postcss-value-parser "^4.2.0" + semver "^7.7.1" + +"@parcel/transformer-posthtml@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-posthtml/-/transformer-posthtml-2.15.4.tgz#08e1b48bb939fcfb4606dc0c6e44ab17cbd96c38" + integrity sha512-dETI+CeKMwu5Dpvu8BrQtex6nwzbNWKQkXseiM5x6+Wf3j9RD2NVpAMBRMjLkw1XlC9Whz1egxLSgKlMKbjg0w== + dependencies: + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + +"@parcel/transformer-raw@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-raw/-/transformer-raw-2.15.4.tgz#e00a50a2f68057c1000b81aea299971296219272" + integrity sha512-pY2j09UCW2v1fwQtVLlCztSdPOxhq0YcWmTHCk/mRp8zuUR+eyHgsz48FrUxRF7cr/EBjc0zlFcregRMRcaTMg== + dependencies: + "@parcel/plugin" "2.15.4" + +"@parcel/transformer-react-refresh-wrap@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-react-refresh-wrap/-/transformer-react-refresh-wrap-2.15.4.tgz#a75c49ce57c5b3150511a1f4046d3562a5962648" + integrity sha512-MgoQrV8+BVjrczAns5ZZbTERGB3/U4MaCBmbg3CuiTiIyS8IJQnGi+OhYRdKAB4NlsgpMZ5T2JrRbQUIm9MM8Q== + dependencies: + "@parcel/error-overlay" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/utils" "2.15.4" + react-refresh "^0.16.0" + +"@parcel/transformer-svg@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/transformer-svg/-/transformer-svg-2.15.4.tgz#969e8c9bda3070e5a331f05873a14f68f9bc5349" + integrity sha512-Q22e0VRbx62VXFlvJWIlc8ihlLaPQgtnAZz5E1/+ojiNb+k0PmIRjNJclVWPF6IdCsLO5tnGfUOaXe2OnZz28Q== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/plugin" "2.15.4" + "@parcel/rust" "2.15.4" + +"@parcel/types-internal@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/types-internal/-/types-internal-2.15.4.tgz#50b192656a2b2b3d9e01d764038101218bd0ae6b" + integrity sha512-kl5QEZ8PTWRvMkwmk7IG3VpP/5/MSGwt9Nrj9ctXLdZkDdXZpK7IbXAthLQ4zrByMaqZULL2IyDuBqBgfuAqlQ== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/feature-flags" "2.15.4" + "@parcel/source-map" "^2.1.1" + utility-types "^3.11.0" + +"@parcel/types@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/types/-/types-2.15.4.tgz#736a42f81c3f3e3bd1ab7e3c374c123d60ec05fa" + integrity sha512-fS3UMMinLtzn/NTSx/qx38saBgRniylldh0XZEUcGeME4D2Llu/QlLv+YZ/LJqrFci3fPRM+YAn2K+JT/u+/0w== + dependencies: + "@parcel/types-internal" "2.15.4" + "@parcel/workers" "2.15.4" + +"@parcel/utils@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/utils/-/utils-2.15.4.tgz#5471ac633a202aa5861b80eae5d917065ed86465" + integrity sha512-29m09sfPx0GHnmy1kkZ5XezprepdFGKKKUEJkyiYA4ERf55jjdnU2/GP4sWlZXxjh2Y+JFoCAFlCamEClq/8eA== + dependencies: + "@parcel/codeframe" "2.15.4" + "@parcel/diagnostic" "2.15.4" + "@parcel/logger" "2.15.4" + "@parcel/markdown-ansi" "2.15.4" + "@parcel/rust" "2.15.4" + "@parcel/source-map" "^2.1.1" + chalk "^4.1.2" + nullthrows "^1.1.1" + +"@parcel/watcher-android-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz#507f836d7e2042f798c7d07ad19c3546f9848ac1" + integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA== + +"@parcel/watcher-darwin-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz#3d26dce38de6590ef79c47ec2c55793c06ad4f67" + integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw== + +"@parcel/watcher-darwin-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz#99f3af3869069ccf774e4ddfccf7e64fd2311ef8" + integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg== + +"@parcel/watcher-freebsd-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz#14d6857741a9f51dfe51d5b08b7c8afdbc73ad9b" + integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ== + +"@parcel/watcher-linux-arm-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz#43c3246d6892381db473bb4f663229ad20b609a1" + integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA== + +"@parcel/watcher-linux-arm-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz#663750f7090bb6278d2210de643eb8a3f780d08e" + integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q== + +"@parcel/watcher-linux-arm64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz#ba60e1f56977f7e47cd7e31ad65d15fdcbd07e30" + integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w== + +"@parcel/watcher-linux-arm64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz#f7fbcdff2f04c526f96eac01f97419a6a99855d2" + integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg== + +"@parcel/watcher-linux-x64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz#4d2ea0f633eb1917d83d483392ce6181b6a92e4e" + integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A== + +"@parcel/watcher-linux-x64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz#277b346b05db54f55657301dd77bdf99d63606ee" + integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg== + +"@parcel/watcher-win32-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz#7e9e02a26784d47503de1d10e8eab6cceb524243" + integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw== + +"@parcel/watcher-win32-ia32@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz#2d0f94fa59a873cdc584bf7f6b1dc628ddf976e6" + integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ== + +"@parcel/watcher-win32-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz#ae52693259664ba6f2228fa61d7ee44b64ea0947" + integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA== + +"@parcel/watcher@^2.0.7": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.1.tgz#342507a9cfaaf172479a882309def1e991fb1200" + integrity sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg== + dependencies: + detect-libc "^1.0.3" + is-glob "^4.0.3" + micromatch "^4.0.5" + node-addon-api "^7.0.0" + optionalDependencies: + "@parcel/watcher-android-arm64" "2.5.1" + "@parcel/watcher-darwin-arm64" "2.5.1" + "@parcel/watcher-darwin-x64" "2.5.1" + "@parcel/watcher-freebsd-x64" "2.5.1" + "@parcel/watcher-linux-arm-glibc" "2.5.1" + "@parcel/watcher-linux-arm-musl" "2.5.1" + "@parcel/watcher-linux-arm64-glibc" "2.5.1" + "@parcel/watcher-linux-arm64-musl" "2.5.1" + "@parcel/watcher-linux-x64-glibc" "2.5.1" + "@parcel/watcher-linux-x64-musl" "2.5.1" + "@parcel/watcher-win32-arm64" "2.5.1" + "@parcel/watcher-win32-ia32" "2.5.1" + "@parcel/watcher-win32-x64" "2.5.1" + +"@parcel/workers@2.15.4": + version "2.15.4" + resolved "https://registry.yarnpkg.com/@parcel/workers/-/workers-2.15.4.tgz#e4a3897e2a730a709d5dab53d75a578d4dc9542b" + integrity sha512-wZ/5/mfjs5aeqhXY0c6fwuaBFeNpOXoOq2CKPSMDXt+GX2u/9/1bpVxN9XeGTAJO+ZD++CLq0hyzTnIHy58nyw== + dependencies: + "@parcel/diagnostic" "2.15.4" + "@parcel/logger" "2.15.4" + "@parcel/profiler" "2.15.4" + "@parcel/types-internal" "2.15.4" + "@parcel/utils" "2.15.4" + nullthrows "^1.1.1" + +"@rollup/rollup-android-arm-eabi@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.2.tgz#52d66eba5198155f265f54aed94d2489c49269f6" + integrity sha512-uLN8NAiFVIRKX9ZQha8wy6UUs06UNSZ32xj6giK/rmMXAgKahwExvK6SsmgU5/brh4w/nSgj8e0k3c1HBQpa0A== + +"@rollup/rollup-android-arm64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.2.tgz#137e8153fc9ce6757531ce300b8d2262299f758e" + integrity sha512-oEouqQk2/zxxj22PNcGSskya+3kV0ZKH+nQxuCCOGJ4oTXBdNTbv+f/E3c74cNLeMO1S5wVWacSws10TTSB77g== + +"@rollup/rollup-darwin-arm64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.2.tgz#d4afd904386d37192cf5ef7345fdb0dd1bac0bc3" + integrity sha512-OZuTVTpj3CDSIxmPgGH8en/XtirV5nfljHZ3wrNwvgkT5DQLhIKAeuFSiwtbMto6oVexV0k1F1zqURPKf5rI1Q== + +"@rollup/rollup-darwin-x64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.2.tgz#6dbe83431fc7cbc09a2b6ed2b9fb7a62dd66ebc2" + integrity sha512-Wa/Wn8RFkIkr1vy1k1PB//VYhLnlnn5eaJkfTQKivirOvzu5uVd2It01ukeQstMursuz7S1bU+8WW+1UPXpa8A== + +"@rollup/rollup-freebsd-arm64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.2.tgz#d35afb9f66154b557b3387d12450920f8a954b96" + integrity sha512-QkzxvH3kYN9J1w7D1A+yIMdI1pPekD+pWx7G5rXgnIlQ1TVYVC6hLl7SOV9pi5q9uIDF9AuIGkuzcbF7+fAhow== + +"@rollup/rollup-freebsd-x64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.2.tgz#849303ecdc171a420317ad9166a70af308348f34" + integrity sha512-dkYXB0c2XAS3a3jmyDkX4Jk0m7gWLFzq1C3qUnJJ38AyxIF5G/dyS4N9B30nvFseCfgtCEdbYFhk0ChoCGxPog== + +"@rollup/rollup-linux-arm-gnueabihf@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.2.tgz#ab36199ca613376232794b2f3ba10e2b547a447c" + integrity sha512-9VlPY/BN3AgbukfVHAB8zNFWB/lKEuvzRo1NKev0Po8sYFKx0i+AQlCYftgEjcL43F2h9Ui1ZSdVBc4En/sP2w== + +"@rollup/rollup-linux-arm-musleabihf@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.2.tgz#f3704bc2eaecd176f558dc47af64197fcac36e8a" + integrity sha512-+GdKWOvsifaYNlIVf07QYan1J5F141+vGm5/Y8b9uCZnG/nxoGqgCmR24mv0koIWWuqvFYnbURRqw1lv7IBINw== + +"@rollup/rollup-linux-arm64-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.2.tgz#dda0b06fd1daedd00b34395a2fb4aaaa2ed6c32b" + integrity sha512-df0Eou14ojtUdLQdPFnymEQteENwSJAdLf5KCDrmZNsy1c3YaCNaJvYsEUHnrg+/DLBH612/R0xd3dD03uz2dg== + +"@rollup/rollup-linux-arm64-musl@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.2.tgz#a018de66209051dad0c58e689e080326c3dd15b0" + integrity sha512-iPeouV0UIDtz8j1YFR4OJ/zf7evjauqv7jQ/EFs0ClIyL+by++hiaDAfFipjOgyz6y6xbDvJuiU4HwpVMpRFDQ== + +"@rollup/rollup-linux-loong64-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.50.2.tgz#6e514f09988615e0c98fa5a34a88a30fec64d969" + integrity sha512-OL6KaNvBopLlj5fTa5D5bau4W82f+1TyTZRr2BdnfsrnQnmdxh4okMxR2DcDkJuh4KeoQZVuvHvzuD/lyLn2Kw== + +"@rollup/rollup-linux-ppc64-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.2.tgz#9b2efebc7b4a1951e684a895fdee0fef26319e0d" + integrity sha512-I21VJl1w6z/K5OTRl6aS9DDsqezEZ/yKpbqlvfHbW0CEF5IL8ATBMuUx6/mp683rKTK8thjs/0BaNrZLXetLag== + +"@rollup/rollup-linux-riscv64-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.2.tgz#a7104270e93d75789d1ba857b2c68ddf61f24f68" + integrity sha512-Hq6aQJT/qFFHrYMjS20nV+9SKrXL2lvFBENZoKfoTH2kKDOJqff5OSJr4x72ZaG/uUn+XmBnGhfr4lwMRrmqCQ== + +"@rollup/rollup-linux-riscv64-musl@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.2.tgz#42d153f734a7b9fcacd764cc9bee6c207dca4db6" + integrity sha512-82rBSEXRv5qtKyr0xZ/YMF531oj2AIpLZkeNYxmKNN6I2sVE9PGegN99tYDLK2fYHJITL1P2Lgb4ZXnv0PjQvw== + +"@rollup/rollup-linux-s390x-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.2.tgz#826ad73099f6fd57c083dc5329151b25404bc67d" + integrity sha512-4Q3S3Hy7pC6uaRo9gtXUTJ+EKo9AKs3BXKc2jYypEcMQ49gDPFU2P1ariX9SEtBzE5egIX6fSUmbmGazwBVF9w== + +"@rollup/rollup-linux-x64-gnu@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.2.tgz#b9ec17bf0ca3f737d0895fca2115756674342142" + integrity sha512-9Jie/At6qk70dNIcopcL4p+1UirusEtznpNtcq/u/C5cC4HBX7qSGsYIcG6bdxj15EYWhHiu02YvmdPzylIZlA== + +"@rollup/rollup-linux-x64-musl@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.2.tgz#29fe0adb45a1d99042f373685efbac9cdd5354d9" + integrity sha512-HPNJwxPL3EmhzeAnsWQCM3DcoqOz3/IC6de9rWfGR8ZCuEHETi9km66bH/wG3YH0V3nyzyFEGUZeL5PKyy4xvw== + +"@rollup/rollup-openharmony-arm64@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.2.tgz#29648f11e202736b74413f823b71e339e3068d60" + integrity sha512-nMKvq6FRHSzYfKLHZ+cChowlEkR2lj/V0jYj9JnGUVPL2/mIeFGmVM2mLaFeNa5Jev7W7TovXqXIG2d39y1KYA== + +"@rollup/rollup-win32-arm64-msvc@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.2.tgz#91e7edec80542fd81ab1c2581a91403ac63458ae" + integrity sha512-eFUvvnTYEKeTyHEijQKz81bLrUQOXKZqECeiWH6tb8eXXbZk+CXSG2aFrig2BQ/pjiVRj36zysjgILkqarS2YA== + +"@rollup/rollup-win32-ia32-msvc@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.2.tgz#9b7cd9779f1147a3e8d3ddad432ae64dd222c4e9" + integrity sha512-cBaWmXqyfRhH8zmUxK3d3sAhEWLrtMjWBRwdMMHJIXSjvjLKvv49adxiEz+FJ8AP90apSDDBx2Tyd/WylV6ikA== + +"@rollup/rollup-win32-x64-msvc@4.50.2": + version "4.50.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.2.tgz#40ecd1357526fe328c7af704a283ee8533ca7ad6" + integrity sha512-APwKy6YUhvZaEoHyM+9xqmTpviEI+9eL7LoCH+aLcvWYHJ663qG5zx7WzWZY+a9qkg5JtzcMyJ9z0WtQBMDmgA== + +"@swc/core-darwin-arm64@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.13.5.tgz#7638c073946f9297753ed9a2eb198d07b2336a24" + integrity sha512-lKNv7SujeXvKn16gvQqUQI5DdyY8v7xcoO3k06/FJbHJS90zEwZdQiMNRiqpYw/orU543tPaWgz7cIYWhbopiQ== + +"@swc/core-darwin-x64@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.13.5.tgz#18061167378f0fb285e17818494bc6c89dd07551" + integrity sha512-ILd38Fg/w23vHb0yVjlWvQBoE37ZJTdlLHa8LRCFDdX4WKfnVBiblsCU9ar4QTMNdeTBEX9iUF4IrbNWhaF1Ng== + +"@swc/core-linux-arm-gnueabihf@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.13.5.tgz#4c8062bd598049b5b9b0beb762e075e76b4c23c3" + integrity sha512-Q6eS3Pt8GLkXxqz9TAw+AUk9HpVJt8Uzm54MvPsqp2yuGmY0/sNaPPNVqctCX9fu/Nu8eaWUen0si6iEiCsazQ== + +"@swc/core-linux-arm64-gnu@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.13.5.tgz#7222d321197ea9304e387933e87d775849fc1ae6" + integrity sha512-aNDfeN+9af+y+M2MYfxCzCy/VDq7Z5YIbMqRI739o8Ganz6ST+27kjQFd8Y/57JN/hcnUEa9xqdS3XY7WaVtSw== + +"@swc/core-linux-arm64-musl@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.13.5.tgz#51e7958deaf37edc212bd9dc0ea1476f151d2bea" + integrity sha512-9+ZxFN5GJag4CnYnq6apKTnnezpfJhCumyz0504/JbHLo+Ue+ZtJnf3RhyA9W9TINtLE0bC4hKpWi8ZKoETyOQ== + +"@swc/core-linux-x64-gnu@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.13.5.tgz#3476beab93ab03e92844d955ca9d9289aa4a5993" + integrity sha512-WD530qvHrki8Ywt/PloKUjaRKgstQqNGvmZl54g06kA+hqtSE2FTG9gngXr3UJxYu/cNAjJYiBifm7+w4nbHbA== + +"@swc/core-linux-x64-musl@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.13.5.tgz#f4934b1e77e2a297909bb3ab977836205c36e5e0" + integrity sha512-Luj8y4OFYx4DHNQTWjdIuKTq2f5k6uSXICqx+FSabnXptaOBAbJHNbHT/06JZh6NRUouaf0mYXN0mcsqvkhd7Q== + +"@swc/core-win32-arm64-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.13.5.tgz#5084c107435cfc82d4d901bfb388dc319d38a236" + integrity sha512-cZ6UpumhF9SDJvv4DA2fo9WIzlNFuKSkZpZmPG1c+4PFSEMy5DFOjBSllCvnqihCabzXzpn6ykCwBmHpy31vQw== + +"@swc/core-win32-ia32-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.13.5.tgz#f8b2e28bc51b30467e316ed736a130c1324b9880" + integrity sha512-C5Yi/xIikrFUzZcyGj9L3RpKljFvKiDMtyDzPKzlsDrKIw2EYY+bF88gB6oGY5RGmv4DAX8dbnpRAqgFD0FMEw== + +"@swc/core-win32-x64-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.13.5.tgz#13883cf3c63bf11b787e28dcdf75ca0cc49efa83" + integrity sha512-YrKdMVxbYmlfybCSbRtrilc6UA8GF5aPmGKBdPvjrarvsmf4i7ZHGCEnLtfOMd3Lwbs2WUZq3WdMbozYeLU93Q== + +"@swc/core@^1.11.24": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.13.5.tgz#93874b831d3bd121560e6fcd688972b7fc7baa26" + integrity sha512-WezcBo8a0Dg2rnR82zhwoR6aRNxeTGfK5QCD6TQ+kg3xx/zNT02s/0o+81h/3zhvFSB24NtqEr8FTw88O5W/JQ== + dependencies: + "@swc/counter" "^0.1.3" + "@swc/types" "^0.1.24" + optionalDependencies: + "@swc/core-darwin-arm64" "1.13.5" + "@swc/core-darwin-x64" "1.13.5" + "@swc/core-linux-arm-gnueabihf" "1.13.5" + "@swc/core-linux-arm64-gnu" "1.13.5" + "@swc/core-linux-arm64-musl" "1.13.5" + "@swc/core-linux-x64-gnu" "1.13.5" + "@swc/core-linux-x64-musl" "1.13.5" + "@swc/core-win32-arm64-msvc" "1.13.5" + "@swc/core-win32-ia32-msvc" "1.13.5" + "@swc/core-win32-x64-msvc" "1.13.5" + +"@swc/counter@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" + integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== + +"@swc/helpers@^0.5.0": + version "0.5.17" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.17.tgz#5a7be95ac0f0bf186e7e6e890e7a6f6cda6ce971" + integrity sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A== + dependencies: + tslib "^2.8.0" + +"@swc/types@^0.1.24": + version "0.1.25" + resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.25.tgz#b517b2a60feb37dd933e542d93093719e4cf1078" + integrity sha512-iAoY/qRhNH8a/hBvm3zKj9qQ4oc2+3w1unPJa2XvTK3XjeLXtzcCingVPw/9e5mn1+0yPqxcBGp9Jf0pkfMb1g== + dependencies: + "@swc/counter" "^0.1.3" + +"@tybys/wasm-util@^0.10.0": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.1.tgz#ecddd3205cf1e2d5274649ff0eedd2991ed7f414" + integrity sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg== + dependencies: + tslib "^2.4.0" + +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "9.6.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@1.0.8", "@types/estree@^1.0.6", "@types/estree@^1.0.8": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + +"@types/json-schema@*", "@types/json-schema@^7.0.15", "@types/json-schema@^7.0.9": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + +"@types/node@*": + version "24.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.5.2.tgz#52ceb83f50fe0fcfdfbd2a9fab6db2e9e7ef6446" + integrity sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ== + dependencies: + undici-types "~7.12.0" + +"@typescript-eslint/types@^8.35.0": + version "8.44.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.44.0.tgz#4b9154ab164a0beff22d3217ff0fdc8d10bce924" + integrity sha512-ZSl2efn44VsYM0MfDQe68RKzBz75NPgLQXuGypmym6QVOWL5kegTZuZ02xRAT9T+onqvM6T8CdQk0OwYMB6ZvA== + +"@unrs/resolver-binding-android-arm-eabi@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz#9f5b04503088e6a354295e8ea8fe3cb99e43af81" + integrity sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw== + +"@unrs/resolver-binding-android-arm64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz#7414885431bd7178b989aedc4d25cccb3865bc9f" + integrity sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g== + +"@unrs/resolver-binding-darwin-arm64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz#b4a8556f42171fb9c9f7bac8235045e82aa0cbdf" + integrity sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g== + +"@unrs/resolver-binding-darwin-x64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz#fd4d81257b13f4d1a083890a6a17c00de571f0dc" + integrity sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ== + +"@unrs/resolver-binding-freebsd-x64@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz#d2513084d0f37c407757e22f32bd924a78cfd99b" + integrity sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw== + +"@unrs/resolver-binding-linux-arm-gnueabihf@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz#844d2605d057488d77fab09705f2866b86164e0a" + integrity sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw== + +"@unrs/resolver-binding-linux-arm-musleabihf@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz#204892995cefb6bd1d017d52d097193bc61ddad3" + integrity sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw== + +"@unrs/resolver-binding-linux-arm64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz#023eb0c3aac46066a10be7a3f362e7b34f3bdf9d" + integrity sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ== + +"@unrs/resolver-binding-linux-arm64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz#9e6f9abb06424e3140a60ac996139786f5d99be0" + integrity sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w== + +"@unrs/resolver-binding-linux-ppc64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz#b111417f17c9d1b02efbec8e08398f0c5527bb44" + integrity sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA== + +"@unrs/resolver-binding-linux-riscv64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz#92ffbf02748af3e99873945c9a8a5ead01d508a9" + integrity sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ== + +"@unrs/resolver-binding-linux-riscv64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz#0bec6f1258fc390e6b305e9ff44256cb207de165" + integrity sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew== + +"@unrs/resolver-binding-linux-s390x-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz#577843a084c5952f5906770633ccfb89dac9bc94" + integrity sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg== + +"@unrs/resolver-binding-linux-x64-gnu@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz#36fb318eebdd690f6da32ac5e0499a76fa881935" + integrity sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w== + +"@unrs/resolver-binding-linux-x64-musl@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz#bfb9af75f783f98f6a22c4244214efe4df1853d6" + integrity sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA== + +"@unrs/resolver-binding-wasm32-wasi@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz#752c359dd875684b27429500d88226d7cc72f71d" + integrity sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ== + dependencies: + "@napi-rs/wasm-runtime" "^0.2.11" + +"@unrs/resolver-binding-win32-arm64-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz#ce5735e600e4c2fbb409cd051b3b7da4a399af35" + integrity sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw== + +"@unrs/resolver-binding-win32-ia32-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz#72fc57bc7c64ec5c3de0d64ee0d1810317bc60a6" + integrity sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ== + +"@unrs/resolver-binding-win32-x64-msvc@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz#538b1e103bf8d9864e7b85cc96fa8d6fb6c40777" + integrity sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g== + +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== + dependencies: + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== + +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== + +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== + +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== + +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" + +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn-import-phases@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz#16eb850ba99a056cb7cbfe872ffb8972e18c8bd7" + integrity sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ== + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.15.0: + version "8.15.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" + integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== + +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + +ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.0, ajv@^8.9.0: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.11: + version "3.0.11" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.11.tgz#40d80e2a1aeacba29792ccc6c5354806421287ff" + integrity sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA== + dependencies: + safe-buffer "^5.0.1" + +baseline-browser-mapping@^2.8.3: + version "2.8.5" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.5.tgz#3147fe6b01a0c49ce1952daebcfc2057fc43fedb" + integrity sha512-TiU4qUT9jdCuh4aVOG7H1QozyeI2sZRqoRPdqBIaslfNt4WUSanRBueAwl2x5jt4rXBMim3lIN2x6yT8PDi24Q== + +brace-expansion@^1.1.7: + version "1.1.12" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" + integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +browserslist@^4.24.0, browserslist@^4.24.5: + version "4.26.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.26.2.tgz#7db3b3577ec97f1140a52db4936654911078cef3" + integrity sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A== + dependencies: + baseline-browser-mapping "^2.8.3" + caniuse-lite "^1.0.30001741" + electron-to-chromium "^1.5.218" + node-releases "^2.0.21" + update-browserslist-db "^1.1.3" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001741: + version "1.0.30001743" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001743.tgz#50ff91a991220a1ee2df5af00650dd5c308ea7cd" + integrity sha512-e6Ojr7RV14Un7dz6ASD0aZDmQPT/A+eZU+nuTNfjqmRrmkmQlnTNWH0SKmqagx9PeW87UVqapSurtAXifmtdmw== + +chalk@^4.0.0, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chrome-trace-event@^1.0.2, chrome-trace-event@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== + +cli-table3@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.5.tgz#013b91351762739c16a9567c21a04632e449bf2f" + integrity sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + +clone@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + +commander@^14.0.1: + version "14.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-14.0.1.tgz#2f9225c19e6ebd0dc4404dd45821b2caa17ea09b" + integrity sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A== + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +comment-parser@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.4.1.tgz#bdafead37961ac079be11eb7ec65c4d021eaf9cc" + integrity sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +consola@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.4.2.tgz#5af110145397bb67afdab77013fdc34cae590ea7" + integrity sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA== + +cross-spawn@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@^4.3.1, debug@^4.3.2, debug@^4.4.1: + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== + dependencies: + ms "^2.1.3" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== + +detect-libc@^2.0.1, detect-libc@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.0.tgz#3ca811f60a7b504b0480e5008adacc660b0b8c4f" + integrity sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg== + +dotenv-expand@^11.0.7: + version "11.0.7" + resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-11.0.7.tgz#af695aea007d6fdc84c86cd8d0ad7beb40a0bd08" + integrity sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA== + dependencies: + dotenv "^16.4.5" + +dotenv@^16.4.5, dotenv@^16.5.0: + version "16.6.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020" + integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow== + +electron-to-chromium@^1.5.218: + version "1.5.221" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.221.tgz#bd98014b2a247701c4ebd713080448d539545d79" + integrity sha512-/1hFJ39wkW01ogqSyYoA4goOXOtMRy6B+yvA1u42nnsEGtHzIzmk93aPISumVQeblj47JUHLC9coCjUxb1EvtQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +enhanced-resolve@^5.17.3: + version "5.18.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz#9b5f4c5c076b8787c78fe540392ce76a88855b44" + integrity sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +es-module-lexer@^1.2.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz#9159601561880a85f2734560a9099b2c31e5372a" + integrity sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA== + +esbuild@^0.25.0: + version "0.25.10" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.10.tgz#37f5aa5cd14500f141be121c01b096ca83ac34a9" + integrity sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.25.10" + "@esbuild/android-arm" "0.25.10" + "@esbuild/android-arm64" "0.25.10" + "@esbuild/android-x64" "0.25.10" + "@esbuild/darwin-arm64" "0.25.10" + "@esbuild/darwin-x64" "0.25.10" + "@esbuild/freebsd-arm64" "0.25.10" + "@esbuild/freebsd-x64" "0.25.10" + "@esbuild/linux-arm" "0.25.10" + "@esbuild/linux-arm64" "0.25.10" + "@esbuild/linux-ia32" "0.25.10" + "@esbuild/linux-loong64" "0.25.10" + "@esbuild/linux-mips64el" "0.25.10" + "@esbuild/linux-ppc64" "0.25.10" + "@esbuild/linux-riscv64" "0.25.10" + "@esbuild/linux-s390x" "0.25.10" + "@esbuild/linux-x64" "0.25.10" + "@esbuild/netbsd-arm64" "0.25.10" + "@esbuild/netbsd-x64" "0.25.10" + "@esbuild/openbsd-arm64" "0.25.10" + "@esbuild/openbsd-x64" "0.25.10" + "@esbuild/openharmony-arm64" "0.25.10" + "@esbuild/sunos-x64" "0.25.10" + "@esbuild/win32-arm64" "0.25.10" + "@esbuild/win32-ia32" "0.25.10" + "@esbuild/win32-x64" "0.25.10" + +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-import-context@^0.1.9: + version "0.1.9" + resolved "https://registry.yarnpkg.com/eslint-import-context/-/eslint-import-context-0.1.9.tgz#967b0b2f0a90ef4b689125e088f790f0b7756dbe" + integrity sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg== + dependencies: + get-tsconfig "^4.10.1" + stable-hash-x "^0.2.0" + +eslint-plugin-import-x@^4.16.1: + version "4.16.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import-x/-/eslint-plugin-import-x-4.16.1.tgz#a96ee1ad5ba6816f9a5573a9617935011a24c4df" + integrity sha512-vPZZsiOKaBAIATpFE2uMI4w5IRwdv/FpQ+qZZMR4E+PeOcM4OeoEbqxRMnywdxP19TyB/3h6QBB0EWon7letSQ== + dependencies: + "@typescript-eslint/types" "^8.35.0" + comment-parser "^1.4.1" + debug "^4.4.1" + eslint-import-context "^0.1.9" + is-glob "^4.0.3" + minimatch "^9.0.3 || ^10.0.1" + semver "^7.7.2" + stable-hash-x "^0.2.0" + unrs-resolver "^1.9.2" + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82" + integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint-visitor-keys@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1" + integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== + +eslint@^9.35.0: + version "9.35.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.35.0.tgz#7a89054b7b9ee1dfd1b62035d8ce75547773f47e" + integrity sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg== + dependencies: + "@eslint-community/eslint-utils" "^4.8.0" + "@eslint-community/regexpp" "^4.12.1" + "@eslint/config-array" "^0.21.0" + "@eslint/config-helpers" "^0.3.1" + "@eslint/core" "^0.15.2" + "@eslint/eslintrc" "^3.3.1" + "@eslint/js" "9.35.0" + "@eslint/plugin-kit" "^0.3.5" + "@humanfs/node" "^0.16.6" + "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.4.2" + "@types/estree" "^1.0.6" + "@types/json-schema" "^7.0.15" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.6" + debug "^4.3.2" + escape-string-regexp "^4.0.0" + eslint-scope "^8.4.0" + eslint-visitor-keys "^4.2.1" + espree "^10.4.0" + esquery "^1.5.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^8.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + json-stable-stringify-without-jsonify "^1.0.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + +espree@^10.0.1, espree@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837" + integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ== + dependencies: + acorn "^8.15.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.2.1" + +esquery@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fast-uri@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" + integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA== + +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== + dependencies: + flat-cache "^4.0.0" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== + dependencies: + flatted "^3.2.9" + keyv "^4.5.4" + +flatted@^3.2.9: + version "3.3.3" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358" + integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== + +fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +get-port@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" + integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== + +get-tsconfig@^4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.1.tgz#d34c1c01f47d65a606c37aa7a177bc3e56ab4b2e" + integrity sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ== + dependencies: + resolve-pkg-maps "^1.0.0" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +globals@^13.24.0: + version "13.24.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== + dependencies: + type-fest "^0.20.2" + +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + +globals@^16.4.0: + version "16.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-16.4.0.tgz#574bc7e72993d40cf27cf6c241f324ee77808e51" + integrity sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw== + +graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +ignore@^5.2.0: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + +import-fresh@^3.2.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" + integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-even-better-errors@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^2.2.1, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +keyv@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lightningcss-darwin-arm64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz#3d47ce5e221b9567c703950edf2529ca4a3700ae" + integrity sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ== + +lightningcss-darwin-x64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz#e81105d3fd6330860c15fe860f64d39cff5fbd22" + integrity sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA== + +lightningcss-freebsd-x64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz#a0e732031083ff9d625c5db021d09eb085af8be4" + integrity sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig== + +lightningcss-linux-arm-gnueabihf@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz#1f5ecca6095528ddb649f9304ba2560c72474908" + integrity sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q== + +lightningcss-linux-arm64-gnu@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz#eee7799726103bffff1e88993df726f6911ec009" + integrity sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw== + +lightningcss-linux-arm64-musl@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz#f2e4b53f42892feeef8f620cbb889f7c064a7dfe" + integrity sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ== + +lightningcss-linux-x64-gnu@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz#2fc7096224bc000ebb97eea94aea248c5b0eb157" + integrity sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw== + +lightningcss-linux-x64-musl@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz#66dca2b159fd819ea832c44895d07e5b31d75f26" + integrity sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ== + +lightningcss-win32-arm64-msvc@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz#7d8110a19d7c2d22bfdf2f2bb8be68e7d1b69039" + integrity sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA== + +lightningcss-win32-x64-msvc@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz#fd7dd008ea98494b85d24b4bea016793f2e0e352" + integrity sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg== + +lightningcss@^1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.30.1.tgz#78e979c2d595bfcb90d2a8c0eb632fe6c5bfed5d" + integrity sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg== + dependencies: + detect-libc "^2.0.3" + optionalDependencies: + lightningcss-darwin-arm64 "1.30.1" + lightningcss-darwin-x64 "1.30.1" + lightningcss-freebsd-x64 "1.30.1" + lightningcss-linux-arm-gnueabihf "1.30.1" + lightningcss-linux-arm64-gnu "1.30.1" + lightningcss-linux-arm64-musl "1.30.1" + lightningcss-linux-x64-gnu "1.30.1" + lightningcss-linux-x64-musl "1.30.1" + lightningcss-win32-arm64-msvc "1.30.1" + lightningcss-win32-x64-msvc "1.30.1" + +lmdb@2.8.5: + version "2.8.5" + resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.8.5.tgz#ce191110c755c0951caa062722e300c703973837" + integrity sha512-9bMdFfc80S+vSldBmG3HOuLVHnxRdNTlpzR6QDnzqCQtCzGUEAGTzBKYMeIM+I/sU4oZfgbcbS7X7F65/z/oxQ== + dependencies: + msgpackr "^1.9.5" + node-addon-api "^6.1.0" + node-gyp-build-optional-packages "5.1.1" + ordered-binary "^1.4.1" + weak-lru-cache "^1.2.2" + optionalDependencies: + "@lmdb/lmdb-darwin-arm64" "2.8.5" + "@lmdb/lmdb-darwin-x64" "2.8.5" + "@lmdb/lmdb-linux-arm" "2.8.5" + "@lmdb/lmdb-linux-arm64" "2.8.5" + "@lmdb/lmdb-linux-x64" "2.8.5" + "@lmdb/lmdb-win32-x64" "2.8.5" + +loader-runner@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +micromatch@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.27: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +"minimatch@^9.0.3 || ^10.0.1": + version "10.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.3.tgz#cf7a0314a16c4d9ab73a7730a0e8e3c3502d47aa" + integrity sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw== + dependencies: + "@isaacs/brace-expansion" "^5.0.0" + +ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +msgpackr-extract@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz#e9d87023de39ce714872f9e9504e3c1996d61012" + integrity sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA== + dependencies: + node-gyp-build-optional-packages "5.2.2" + optionalDependencies: + "@msgpackr-extract/msgpackr-extract-darwin-arm64" "3.0.3" + "@msgpackr-extract/msgpackr-extract-darwin-x64" "3.0.3" + "@msgpackr-extract/msgpackr-extract-linux-arm" "3.0.3" + "@msgpackr-extract/msgpackr-extract-linux-arm64" "3.0.3" + "@msgpackr-extract/msgpackr-extract-linux-x64" "3.0.3" + "@msgpackr-extract/msgpackr-extract-win32-x64" "3.0.3" + +msgpackr@^1.11.2, msgpackr@^1.9.5: + version "1.11.5" + resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-1.11.5.tgz#edf0b9d9cb7d8ed6897dd0e42cfb865a2f4b602e" + integrity sha512-UjkUHN0yqp9RWKy0Lplhh+wlpdt9oQBYgULZOiFhV3VclSF1JnSQWZ5r9gORQlNYaUKQoR8itv7g7z1xDDuACA== + optionalDependencies: + msgpackr-extract "^3.0.2" + +nanoid@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + +napi-postinstall@^0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.3.tgz#93d045c6b576803ead126711d3093995198c6eb9" + integrity sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +node-addon-api@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" + integrity sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA== + +node-addon-api@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== + +node-gyp-build-optional-packages@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz#52b143b9dd77b7669073cbfe39e3f4118bfc603c" + integrity sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw== + dependencies: + detect-libc "^2.0.1" + +node-gyp-build-optional-packages@5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz#522f50c2d53134d7f3a76cd7255de4ab6c96a3a4" + integrity sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw== + dependencies: + detect-libc "^2.0.1" + +node-releases@^2.0.21: + version "2.0.21" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.21.tgz#f59b018bc0048044be2d4c4c04e4c8b18160894c" + integrity sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw== + +nullthrows@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" + integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== + +optionator@^0.9.3: + version "0.9.4" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.5" + +ordered-binary@^1.4.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ordered-binary/-/ordered-binary-1.6.0.tgz#9c490dadc0b1336ca6917d8d41dd474b8c0bff32" + integrity sha512-IQh2aMfMIDbPjI/8a3Edr+PiOpcsB7yo8NdW7aHWVaoR/pcDldunMvnnwbk/auPGqmKeAdxtZl7MHX/QmPwhvQ== + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +parcel@^2.15.4: + version "2.15.4" + resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.15.4.tgz#f4038e7bb08b74bae6313306e86e0ff9fbacee13" + integrity sha512-eZHQ/omuQ7yBYB9XezyzSqhc826oy/uhloCNiej1CTZ+twAqJVtp4MRvTGMcivKhE+WE8QkYD5XkJHLLQsJQcg== + dependencies: + "@parcel/config-default" "2.15.4" + "@parcel/core" "2.15.4" + "@parcel/diagnostic" "2.15.4" + "@parcel/events" "2.15.4" + "@parcel/feature-flags" "2.15.4" + "@parcel/fs" "2.15.4" + "@parcel/logger" "2.15.4" + "@parcel/package-manager" "2.15.4" + "@parcel/reporter-cli" "2.15.4" + "@parcel/reporter-dev-server" "2.15.4" + "@parcel/reporter-tracer" "2.15.4" + "@parcel/utils" "2.15.4" + chalk "^4.1.2" + commander "^12.1.0" + get-port "^4.2.0" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + +postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + +postcss@^8.5.6: + version "8.5.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" + integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg== + dependencies: + nanoid "^3.3.11" + picocolors "^1.1.1" + source-map-js "^1.2.1" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== + +punycode@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +react-refresh@^0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.16.0.tgz#e7d45625f05c9709466d09348a25d22f79b2ad23" + integrity sha512-FPvF2XxTSikpJxcr+bHut2H4gJ17+18Uy20D5/F+SKzFap62R3cM5wH6b8WN3LyGSYeQilLEcJcR1fjBSI2S1A== + +regenerator-runtime@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + +rollup@^4.43.0: + version "4.50.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.50.2.tgz#938d898394939f3386d1e367ee6410a796b8f268" + integrity sha512-BgLRGy7tNS9H66aIMASq1qSYbAAJV6Z6WR4QYTvj5FgF15rZ/ympT1uixHXwzbZUBDbkvqUI1KR0fH1FhMaQ9w== + dependencies: + "@types/estree" "1.0.8" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.50.2" + "@rollup/rollup-android-arm64" "4.50.2" + "@rollup/rollup-darwin-arm64" "4.50.2" + "@rollup/rollup-darwin-x64" "4.50.2" + "@rollup/rollup-freebsd-arm64" "4.50.2" + "@rollup/rollup-freebsd-x64" "4.50.2" + "@rollup/rollup-linux-arm-gnueabihf" "4.50.2" + "@rollup/rollup-linux-arm-musleabihf" "4.50.2" + "@rollup/rollup-linux-arm64-gnu" "4.50.2" + "@rollup/rollup-linux-arm64-musl" "4.50.2" + "@rollup/rollup-linux-loong64-gnu" "4.50.2" + "@rollup/rollup-linux-ppc64-gnu" "4.50.2" + "@rollup/rollup-linux-riscv64-gnu" "4.50.2" + "@rollup/rollup-linux-riscv64-musl" "4.50.2" + "@rollup/rollup-linux-s390x-gnu" "4.50.2" + "@rollup/rollup-linux-x64-gnu" "4.50.2" + "@rollup/rollup-linux-x64-musl" "4.50.2" + "@rollup/rollup-openharmony-arm64" "4.50.2" + "@rollup/rollup-win32-arm64-msvc" "4.50.2" + "@rollup/rollup-win32-ia32-msvc" "4.50.2" + "@rollup/rollup-win32-x64-msvc" "4.50.2" + fsevents "~2.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +schema-utils@^4.3.0, schema-utils@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.2.tgz#0c10878bf4a73fd2b1dfd14b9462b26788c806ae" + integrity sha512-Gn/JaSk/Mt9gYubxTtSn/QCV4em9mpAPiR1rqy/Ocu19u/G9J5WWdNoUT4SiV6mFC3y6cxyFcFwdzPM3FgxGAQ== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" + +semver@^7.7.1, semver@^7.7.2: + version "7.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" + integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== + +serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + +shebang-command@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" - integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + +source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +stable-hash-x@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stable-hash-x/-/stable-hash-x-0.2.0.tgz#dfd76bfa5d839a7470125c6a6b3c8b22061793e9" + integrity sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ== + +string-width@^4.2.0: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" -ssl-root-cas@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/ssl-root-cas/-/ssl-root-cas-1.3.1.tgz#6b0566f7de4f0e6be99fbd93dbfbe5c7ab33b949" - integrity sha512-KR8J210Wfvjh+iNE9jcQEgbG0VG2713PHreItx6aNCPnkFO8XChz1cJ4iuCGeBj0+8wukLmgHgJqX+O5kRjPkQ== +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.3.tgz#4b67b635b2d97578a06a2713d2f04800c237e99b" + integrity sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg== + +term-size@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" + integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + +terser-webpack-plugin@^5.3.11: + version "5.3.14" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" + integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.25" + jest-worker "^27.4.5" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" + +terser@^5.31.1: + version "5.44.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.0.tgz#ebefb8e5b8579d93111bfdfc39d2cf63879f4a82" + integrity sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.15.0" + commander "^2.20.0" + source-map-support "~0.5.20" + +tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^2.4.0, tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +undici-types@~7.12.0: + version "7.12.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.12.0.tgz#15c5c7475c2a3ba30659529f5cdb4674b622fafb" + integrity sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ== + +unrs-resolver@^1.9.2: + version "1.11.1" + resolved "https://registry.yarnpkg.com/unrs-resolver/-/unrs-resolver-1.11.1.tgz#be9cd8686c99ef53ecb96df2a473c64d304048a9" + integrity sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg== + dependencies: + napi-postinstall "^0.3.0" + optionalDependencies: + "@unrs/resolver-binding-android-arm-eabi" "1.11.1" + "@unrs/resolver-binding-android-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-x64" "1.11.1" + "@unrs/resolver-binding-freebsd-x64" "1.11.1" + "@unrs/resolver-binding-linux-arm-gnueabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm-musleabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-arm64-musl" "1.11.1" + "@unrs/resolver-binding-linux-ppc64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-musl" "1.11.1" + "@unrs/resolver-binding-linux-s390x-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-musl" "1.11.1" + "@unrs/resolver-binding-wasm32-wasi" "1.11.1" + "@unrs/resolver-binding-win32-arm64-msvc" "1.11.1" + "@unrs/resolver-binding-win32-ia32-msvc" "1.11.1" + "@unrs/resolver-binding-win32-x64-msvc" "1.11.1" + +update-browserslist-db@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420" + integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.1" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +utility-types@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c" + integrity sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw== + +vite@^7.1.5: + version "7.1.5" + resolved "https://registry.yarnpkg.com/vite/-/vite-7.1.5.tgz#4dbcb48c6313116689be540466fc80faa377be38" + integrity sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ== + dependencies: + esbuild "^0.25.0" + fdir "^6.5.0" + picomatch "^4.0.3" + postcss "^8.5.6" + rollup "^4.43.0" + tinyglobby "^0.2.15" + optionalDependencies: + fsevents "~2.3.3" + +watchpack@^2.4.1: + version "2.4.4" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.4.tgz#473bda72f0850453da6425081ea46fc0d7602947" + integrity sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA== dependencies: - "@coolaj86/urequest" "^1.3.6" + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +weak-lru-cache@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz#fdbb6741f36bae9540d12f480ce8254060dccd19" + integrity sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw== + +webpack-sources@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.3.tgz#d4bf7f9909675d7a070ff14d0ef2a4f3c982c723" + integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== + +webpack@^5.101.3: + version "5.101.3" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.101.3.tgz#3633b2375bb29ea4b06ffb1902734d977bc44346" + integrity sha512-7b0dTKR3Ed//AD/6kkx/o7duS8H3f1a4w3BYpIriX4BzIhjkn4teo05cptsxvLesHFKK5KObnadmCHBwGc+51A== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.8" + "@types/json-schema" "^7.0.15" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.15.0" + acorn-import-phases "^1.0.3" + browserslist "^4.24.0" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.17.3" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.11" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^4.3.2" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.11" + watchpack "^2.4.1" + webpack-sources "^3.3.3" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From d108046295731b338e755b1270751b080b6a323f Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 18 Sep 2025 17:42:08 -0400 Subject: [PATCH 2/5] fixup! --- .husky/pre-commit | 2 + README.md | 3 +- fixtures/large-dependency/main.js | 3 + fixtures/large-dependency/package.json | 6 + package.json | 4 +- src/bundlers/parcel.mjs | 29 ++--- src/bundlers/vite.mjs | 32 ++--- src/bundlers/webpack.mjs | 35 ++--- src/core/cli.mjs | 6 +- src/core/runner.mjs | 173 +++++++++++++------------ src/core/utils/file.mjs | 17 ++- src/core/utils/formatting.mjs | 18 ++- src/core/utils/misc.mjs | 38 ++++++ src/metrics/build-time.mjs | 3 +- src/metrics/size.mjs | 5 +- src/reporters/console.mjs | 16 +++ src/types.d.ts | 43 ++++++ yarn.lock | 5 + 18 files changed, 278 insertions(+), 160 deletions(-) create mode 100644 .husky/pre-commit create mode 100644 fixtures/large-dependency/main.js create mode 100644 fixtures/large-dependency/package.json create mode 100644 src/core/utils/misc.mjs create mode 100644 src/types.d.ts diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000000..fa588505ac --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +node --run format:fix +node --run lint:fix \ No newline at end of file diff --git a/README.md b/README.md index 4d2af33f9f..1c9f32c979 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ export default async function report(results, options) { ... } To run a benchmark on a bundler directly from it's source, install it directly from it's repository, and benchmark like normal. For example, to benchmark Webpack's bleeding edge, install it with: + ```bash yarn add webpack@https://github.com/webpack/webpack -``` \ No newline at end of file +``` diff --git a/fixtures/large-dependency/main.js b/fixtures/large-dependency/main.js new file mode 100644 index 0000000000..684a33699e --- /dev/null +++ b/fixtures/large-dependency/main.js @@ -0,0 +1,3 @@ +import * as THREE from "three"; + +console.log(THREE); diff --git a/fixtures/large-dependency/package.json b/fixtures/large-dependency/package.json new file mode 100644 index 0000000000..a5c19c5427 --- /dev/null +++ b/fixtures/large-dependency/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "three": "^0.180.0" + }, + "type": "module" +} diff --git a/package.json b/package.json index 868dca5a6c..de186b0504 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "format:fix": "prettier --write .", "lint": "eslint .", "lint:fix": "eslint . --fix", - "start": "node ./src/core/cli.mjs" + "start": "node ./src/core/cli.mjs", + "prepare": "husky" }, "dependencies": { "@parcel/core": "2.15.4", @@ -40,6 +41,7 @@ "eslint": "^9.35.0", "eslint-plugin-import-x": "^4.16.1", "globals": "^16.4.0", + "husky": "^9.1.7", "prettier": "^3.6.2" } } diff --git a/src/bundlers/parcel.mjs b/src/bundlers/parcel.mjs index 86d772127a..29c4bcae09 100644 --- a/src/bundlers/parcel.mjs +++ b/src/bundlers/parcel.mjs @@ -5,15 +5,20 @@ import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "parcel"; const OUTPUT_DIR = "parcel-dist"; +/** @type {import('../types').Bundler['build']} */ export async function build(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); - const config = createParcelConfig(fixture, outputPath); const bundler = new Parcel({ - entries: config.entries, + entries: [path.join(fixture, "main.js")], defaultConfig: "@parcel/config-default", - targets: config.targets, - logLevel: "error", + targets: { + default: { + distDir: outputPath, + sourceMap: false, + }, + }, + mode: "production", }); const { bundleGraph } = await bundler.run(); @@ -21,27 +26,13 @@ export async function build(fixture) { return { bundler: BUNDLER_NAME, outputPath, - success: true, buildResult: bundleGraph, }; } +/** @type {import('../types').Bundler['clean']} */ export async function clean(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); await removeIfExists(outputPath); await removeIfExists(".parcel-cache"); } - -export function createParcelConfig(fixture, distDir) { - return { - entries: [path.join(fixture, "main.js")], - targets: { - default: { - distDir, - optimize: true, - scopeHoist: true, - sourceMap: false, - }, - }, - }; -} diff --git a/src/bundlers/vite.mjs b/src/bundlers/vite.mjs index ebd6917c85..7094894430 100644 --- a/src/bundlers/vite.mjs +++ b/src/bundlers/vite.mjs @@ -5,35 +5,31 @@ import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "vite"; const OUTPUT_DIR = "vite-dist"; +/** @type {import('../types').Bundler['build']} */ export async function build(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); - const config = createViteConfig(fixture, outputPath); - const result = await vite(config); + + const result = await vite({ + root: fixture, + build: { + outDir: outputPath, + minify: true, + sourcemap: false, + rollupOptions: { + input: path.join(fixture, "main.js"), + }, + }, + }); return { bundler: BUNDLER_NAME, outputPath, - success: true, buildResult: result, }; } +/** @type {import('../types').Bundler['clean']} */ export async function clean(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); await removeIfExists(outputPath); } - -export function createViteConfig(fixture, outDir) { - return { - root: fixture, - build: { - outDir, - minify: true, - sourcemap: false, - rollupOptions: { - input: path.join(fixture, "main.js"), - }, - }, - logLevel: "error", - }; -} diff --git a/src/bundlers/webpack.mjs b/src/bundlers/webpack.mjs index d6ecba0ba2..2ae26f4401 100644 --- a/src/bundlers/webpack.mjs +++ b/src/bundlers/webpack.mjs @@ -5,19 +5,33 @@ import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "webpack"; const OUTPUT_DIR = "webpack-dist"; +/** @type {import('../types').Bundler['build']} */ export async function build(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); - const config = createWebpackConfig(fixture, outputPath); - const result = await runWebpack(config); + + const result = await runWebpack({ + mode: "production", + entry: path.join(fixture, "main.js"), + output: { + path: outputPath, + }, + optimization: { + minimize: true, + }, + }); return { bundler: BUNDLER_NAME, outputPath, - success: true, buildResult: result, }; } +/** + * Runs a promisified webpack + * @param {import('webpack').Configuration} config The Webpack Config + * @returns {import('webpack').Stats} + */ function runWebpack(config) { return new Promise((resolve, reject) => { webpack(config, (err, stats) => { @@ -39,21 +53,8 @@ function runWebpack(config) { }); } +/** @type {import('../types').Bundler['clean']} */ export async function clean(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); await removeIfExists(outputPath); } - -export function createWebpackConfig(fixture, outputPath) { - return { - mode: "production", - entry: path.join(fixture, "main.js"), - output: { - path: outputPath, - }, - optimization: { - minimize: true, - }, - stats: "errors-only", // Reduce noise during benchmarking - }; -} diff --git a/src/core/cli.mjs b/src/core/cli.mjs index 30842fa9f0..f568572160 100644 --- a/src/core/cli.mjs +++ b/src/core/cli.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node import { Command } from "commander"; -import { BenchmarkRunner } from "./runner.mjs"; +import runBenchmark from "./runner.mjs"; import { consola } from "consola"; new Command() @@ -26,9 +26,7 @@ new Command() } consola.start("Starting bundler benchmarks..."); - const runner = new BenchmarkRunner(options); - await runner.run(); - + await runBenchmark(options); consola.success("Benchmarking completed successfully!"); }) .parse(); diff --git a/src/core/runner.mjs b/src/core/runner.mjs index 771e2698a7..dfec0424a8 100644 --- a/src/core/runner.mjs +++ b/src/core/runner.mjs @@ -2,104 +2,105 @@ import { performance } from "node:perf_hooks"; import { glob } from "node:fs/promises"; import { isAbsolute, join } from "node:path"; import { consola } from "consola"; - -const cache = new Map(); - -export async function load(module, instantiate = false) { - let mod = cache.get(module); - - if (!mod) { - mod = await import(import.meta.resolve(module)); - cache.set(module, mod); +import { prepareFixture, loadModule } from "./utils/misc.mjs"; + +/** + * Runs a benchmark on a fixture + * @param {string} fixture + * @param {import('../types').Options} options + */ +async function runForFixture(fixture, options) { + const results = new Map(); + for (const bundler of options.bundlers) { + results.set(bundler, {}); } - return instantiate ? new mod.default() : (mod.default ?? mod); -} + await prepareFixture(fixture); -export class BenchmarkRunner { - constructor(options) { - this.bundlers = options.bundlers; - this.metrics = options.metrics; - this.reporter = options.reporter; - this.fixturesGlob = options.fixtures; - } + for (const bundlerName of options.bundlers) { + const bundler = await loadModule(`bundlers/${bundlerName}.mjs`); - // This is the new entry point - async run() { - consola.info( - `Benchmarking ${this.bundlers.join(", ")} with metrics: ${this.metrics.join(", ")} on fixtures: ${this.fixturesGlob}`, + const metrics = await Promise.all( + options.metrics.map((metric) => + loadModule(`metrics/${metric}.mjs`, true), + ), ); - // Resolve all fixtures from glob - const cwd = process.cwd(); - const fixturePaths = (await Array.fromAsync(glob(this.fixturesGlob))).map( - (fixturePath) => - isAbsolute(fixturePath) ? fixturePath : join(cwd, fixturePath), + results.set( + bundlerName, + await runSingleBenchmark(bundler, metrics, fixture, options), ); - - // Load reporter - const report = await load(`../reporters/${this.reporter}.mjs`); - - // results will be: Map> - const allResults = new Map(); - - // Run for each fixture - for (const fixture of fixturePaths) { - consola.info(`Running benchmarks for fixture: ${fixture}`); - - const fixtureResults = await this.runForFixture(fixture); - allResults.set(fixture, fixtureResults); - } - - await report(allResults); - - return allResults; } - async runForFixture(fixture) { - const results = new Map(); - for (const bundler of this.bundlers) { - results.set(bundler, {}); - } - - for (const bundlerName of this.bundlers) { - const bundler = await load(`../bundlers/${bundlerName}.mjs`); - - const metrics = await Promise.all( - this.metrics.map((metric) => load(`../metrics/${metric}.mjs`, true)), - ); + return results; +} - results.set( - bundlerName, - await this.runSingleBenchmark(bundler, metrics, fixture), - ); - } +/** + * Runs a single benchmark + * @param {import('../types').Bundler} bundler + * @param {Array} metrics + * @param {string} fixture + * @param {import('../types').Options} options + */ +async function runSingleBenchmark(bundler, metrics, fixture, options) { + await bundler.clean(fixture); + + await Promise.all(metrics.map((metric) => metric.start?.(fixture, options))); + + const startTime = performance.now(); + const buildResult = await bundler.build(fixture, options); + const endTime = performance.now(); + + await Promise.all(metrics.map((metric) => metric.stop?.(fixture, options))); + + return new Map( + await Promise.all( + metrics.map(async (m) => [ + m.name, + await m.collect({ + buildResult, + startTime, + endTime, + fixture, + options, + }), + ]), + ), + ); +} - return results; +/** + * Runs a benchmark + * @param {import('../types').Options} options + */ +export default async function runBenchmark(options) { + consola.info( + `Benchmarking ${options.bundlers.join(", ")} with metrics: ${options.metrics.join(", ")} on fixtures: ${options.fixtures}`, + ); + + // Resolve all fixtures from glob + const cwd = process.cwd(); + const fixturePaths = (await Array.fromAsync(glob(options.fixtures))).map( + (fixturePath) => + isAbsolute(fixturePath) ? fixturePath : join(cwd, fixturePath), + ); + + // Load reporter + /** @type {import('../types').Reporter} */ + const report = await loadModule(`reporters/${options.reporter}.mjs`); + + // results will be: Map> + const allResults = new Map(); + + // Run for each fixture + for (const fixture of fixturePaths) { + consola.info(`Running benchmarks for fixture: ${fixture}`); + + const fixtureResults = await runForFixture(fixture, options); + allResults.set(fixture, fixtureResults); } - async runSingleBenchmark(bundler, metrics, fixture) { - await bundler.clean(fixture); - - await Promise.all(metrics.map((metric) => metric.start?.())); + await report(allResults, options); - const startTime = performance.now(); - const buildResult = await bundler.build(fixture); - const endTime = performance.now(); - - await Promise.all(metrics.map((metric) => metric.stop?.())); - - return new Map( - await Promise.all( - metrics.map(async (m) => [ - m.name, - await m.collect(buildResult, { - startTime, - endTime, - fixture, - }), - ]), - ), - ); - } + return allResults; } diff --git a/src/core/utils/file.mjs b/src/core/utils/file.mjs index 96f55f68ce..e386b33421 100644 --- a/src/core/utils/file.mjs +++ b/src/core/utils/file.mjs @@ -1,7 +1,10 @@ import fs from "node:fs/promises"; import path from "node:path"; -// Get the total size of a directory (recursively) +/** + * Get the total size of a directory + * @param {string} dirPath + */ export async function getDirectorySize(dirPath) { let totalSize = 0; try { @@ -22,8 +25,11 @@ export async function getDirectorySize(dirPath) { return totalSize; } -// Check if a file exists -async function exists(filePath) { +/** + * Checks if a file exists + * @param {string} filePath + */ +export async function exists(filePath) { try { await fs.access(filePath); return true; @@ -32,7 +38,10 @@ async function exists(filePath) { } } -// Remove all contents +/** + * Deletes a file, if it exists + * @param {string} filePath + */ export async function removeIfExists(filePath) { if (await exists(filePath)) { await fs.rm(filePath, { recursive: true, force: true }); diff --git a/src/core/utils/formatting.mjs b/src/core/utils/formatting.mjs index 423fa95bf2..5f4b347c3f 100644 --- a/src/core/utils/formatting.mjs +++ b/src/core/utils/formatting.mjs @@ -1,4 +1,7 @@ -// Format milliseconds into a human-readable duration string +/** + * Formats milliseconds into a human-readable string + * @param {number} milliseconds + */ export function formatDuration(milliseconds) { if (milliseconds < 1000) { return `${Math.round(milliseconds)}ms`; @@ -11,11 +14,12 @@ export function formatDuration(milliseconds) { } } -// Format bytes to human-readable string +const sizes = ["B", "KB", "MB", "GB"]; +/** + * Formats bytes into a human-readable string + * @param {number} bytes + */ export function formatBytes(bytes) { - if (bytes === 0) return "0 B"; - const k = 1024; - const sizes = ["B", "KB", "MB", "GB"]; - const i = Math.floor(Math.log(bytes) / Math.log(k)); - return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; + const i = Math.floor(Math.log(bytes) / Math.log(1024)); + return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]; } diff --git a/src/core/utils/misc.mjs b/src/core/utils/misc.mjs new file mode 100644 index 0000000000..ba1a28fb2c --- /dev/null +++ b/src/core/utils/misc.mjs @@ -0,0 +1,38 @@ +import { exists } from "./file.mjs"; +import { join } from "node:path"; +import { join as posixJoin } from "node:path/posix"; +import { execFile } from "node:child_process"; +import { promisify } from "node:util"; + +const moduleCache = new Map(); + +/** + * Loads a module from the root of `src/` + * @param {string} module The module to load + * @param {boolean} instantiate Whether or not to treat the module as a class that must be instantiated + */ +export async function loadModule(module, instantiate = false) { + let mod = moduleCache.get(module); + + if (!mod) { + mod = await import(import.meta.resolve(posixJoin("../../", module))); + moduleCache.set(module, mod); + } + + return instantiate ? new mod.default() : (mod.default ?? mod); +} + +const runCommand = promisify(execFile); + +/** + * Install dependencies needed for a fixture + * @param {string} fixture + */ +export async function prepareFixture(fixture) { + if (exists(join(fixture, "package.json"))) { + await runCommand("npm", ["install", "--no-package-lock"], { + cwd: fixture, + shell: true, + }); + } +} diff --git a/src/metrics/build-time.mjs b/src/metrics/build-time.mjs index 70ebd5bf52..a3290ce691 100644 --- a/src/metrics/build-time.mjs +++ b/src/metrics/build-time.mjs @@ -3,7 +3,8 @@ import { formatDuration } from "../core/utils/formatting.mjs"; export default class BuildTimeMetric { name = "Build Time"; - async collect(_, { startTime, endTime }) { + /** @type {import('../types').Metric['collect']} */ + async collect({ startTime, endTime }) { const buildTime = endTime - startTime; return { diff --git a/src/metrics/size.mjs b/src/metrics/size.mjs index 1117086234..fca2a75e4a 100644 --- a/src/metrics/size.mjs +++ b/src/metrics/size.mjs @@ -4,9 +4,10 @@ import { getDirectorySize } from "../core/utils/file.mjs"; export default class SizeMetric { name = "Size"; - async collect({ outputPath }) { + /** @type {import('../types').Metric['collect']} */ + async collect({ buildResult }) { // Get total directory size - const totalSize = await getDirectorySize(outputPath); + const totalSize = await getDirectorySize(buildResult.outputPath); return { value: totalSize, diff --git a/src/reporters/console.mjs b/src/reporters/console.mjs index 645ab44752..ed301a0df5 100644 --- a/src/reporters/console.mjs +++ b/src/reporters/console.mjs @@ -2,6 +2,10 @@ import Table from "cli-table3"; import { consola } from "consola"; import path from "path"; +/** + * Extracts the results from metrics + * @param {Array} bundlerResults + */ function extractMetrics(bundlerResults) { const metrics = new Set(); for (const [, bundlerMetrics] of bundlerResults) { @@ -17,6 +21,12 @@ function formatValue(metricData) { return metricData.formatted || String(metricData.value) || "─"; } +/** + * Create a row for the summary table + * @param {string} bundler + * @param {Array} bundlerMetrics + * @param {Array} metricsList + */ function createBundlerRow(bundler, bundlerMetrics, metricsList) { const row = [bundler]; @@ -28,6 +38,11 @@ function createBundlerRow(bundler, bundlerMetrics, metricsList) { return row; } +/** + * Prints a summary table + * @param {Map>} bundlerResults + * @param {Array} bundlers + */ function printSummaryTable(bundlerResults, bundlers) { const metricsList = extractMetrics(bundlerResults); @@ -45,6 +60,7 @@ function printSummaryTable(bundlerResults, bundlers) { console.log(table.toString()); } +/** @type {import('../types').Reporter} */ export default function displayResults(results) { consola.info("Benchmark Results"); console.log("=".repeat(60)); diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000000..0766cdcad4 --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,43 @@ +export declare type Options = { + bundlers: Array; + metrics: Array; + reporter: string; + fixtures: string; + verbose: boolean; + silent: boolean; +}; + +export declare type BuildResult = { + bundler: string; + outputPath: string; + buildResult: unknown; +}; + +export declare type MetricResult = { + value: number; + unit: string; + formatted: string; +}; + +export declare type Bundler = { + build(fixture: string, options: Options): Promise; + clean(fixture: string, options: Options): Promise; +}; + +export declare class Metric { + name: string; + + start(fixture: string, options: Options): Promise; + stop(fixture: string, options: Options): Promise; + collect(context: { + buildResult: BuildResult; + startTime: number; + endTime: number; + fixture: string; + options: Options; + }): Promise; +} + +export declare type Reporter = ( + results: Map>, +) => Promise; diff --git a/yarn.lock b/yarn.lock index f551d896fe..0a30b40d97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2127,6 +2127,11 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +husky@^9.1.7: + version "9.1.7" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" + integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== + ignore@^5.2.0: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" From f1b4f0b7aa1b1140eed860c450eb642129c46c1e Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 18 Sep 2025 17:48:21 -0400 Subject: [PATCH 3/5] esbuild --- .husky/pre-commit | 2 +- package.json | 1 + src/bundlers/esbuild.mjs | 31 +++++++++++++++++++++++++++++++ yarn.lock | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/bundlers/esbuild.mjs diff --git a/.husky/pre-commit b/.husky/pre-commit index fa588505ac..ffb0a10d2b 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,2 @@ node --run format:fix -node --run lint:fix \ No newline at end of file +node --run lint:fix diff --git a/package.json b/package.json index de186b0504..e6fa607173 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "cli-table3": "^0.6.5", "commander": "^14.0.1", "consola": "^3.4.2", + "esbuild": "^0.25.10", "parcel": "^2.15.4", "vite": "^7.1.5", "webpack": "^5.101.3" diff --git a/src/bundlers/esbuild.mjs b/src/bundlers/esbuild.mjs new file mode 100644 index 0000000000..4489eaed71 --- /dev/null +++ b/src/bundlers/esbuild.mjs @@ -0,0 +1,31 @@ +import { build as esbuild } from "esbuild"; +import path from "node:path"; +import { removeIfExists } from "../core/utils/file.mjs"; + +const BUNDLER_NAME = "esbuild"; +const OUTPUT_DIR = "esbuild-dist"; + +/** @type {import('../types').Bundler['build']} */ +export async function build(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + + const result = await esbuild({ + bundle: true, + minify: true, + outdir: outputPath, + entryPoints: [path.join(fixture, "main.js")], + sourceRoot: fixture, + }); + + return { + bundler: BUNDLER_NAME, + outputPath, + buildResult: result, + }; +} + +/** @type {import('../types').Bundler['clean']} */ +export async function clean(fixture) { + const outputPath = path.join(fixture, OUTPUT_DIR); + await removeIfExists(outputPath); +} diff --git a/yarn.lock b/yarn.lock index 0a30b40d97..7f082348da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1836,7 +1836,7 @@ es-module-lexer@^1.2.1: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz#9159601561880a85f2734560a9099b2c31e5372a" integrity sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA== -esbuild@^0.25.0: +esbuild@^0.25.0, esbuild@^0.25.10: version "0.25.10" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.10.tgz#37f5aa5cd14500f141be121c01b096ca83ac34a9" integrity sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ== From 8d7c69fe191e08fd0c8ce4715a7684d16cfb8669 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 18 Sep 2025 20:02:19 -0400 Subject: [PATCH 4/5] fixup! --- .github/lint.yml | 30 ++ .github/measure.yml | 37 ++ .gitignore | 3 +- .husky/pre-commit | 2 - README.md | 11 - eslint.config.mjs | 21 + package.json | 9 +- src/bundlers/esbuild.mjs | 4 +- src/bundlers/parcel.mjs | 4 +- src/bundlers/vite.mjs | 4 +- src/bundlers/webpack.mjs | 4 +- src/core/cli.mjs | 9 +- src/core/runner.mjs | 4 +- src/core/utils/formatting.mjs | 20 +- src/core/utils/misc.mjs | 5 +- src/metrics/build-time.mjs | 7 +- src/metrics/size.mjs | 5 +- src/reporters/console.mjs | 60 +-- src/reporters/json.mjs | 9 + src/types.d.ts | 8 +- yarn.lock | 922 ++++++++-------------------------- 21 files changed, 366 insertions(+), 812 deletions(-) create mode 100644 .github/lint.yml create mode 100644 .github/measure.yml delete mode 100644 .husky/pre-commit create mode 100644 src/reporters/json.mjs diff --git a/.github/lint.yml b/.github/lint.yml new file mode 100644 index 0000000000..afa05d0970 --- /dev/null +++ b/.github/lint.yml @@ -0,0 +1,30 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Git Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + # We want to ensure that the Node.js version running here respects our supported versions + node-version-file: ".nvmrc" + cache: "yarn" + + - name: Install packages + run: yarn install --frozen-lockfile + + - name: Lint + run: node --run lint && node --run format diff --git a/.github/measure.yml b/.github/measure.yml new file mode 100644 index 0000000000..539033ee87 --- /dev/null +++ b/.github/measure.yml @@ -0,0 +1,37 @@ +name: Measure + +on: + workflow_dispatch: + inputs: + versions: + description: "Versions to install" + required: false + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + + - name: Add and install Dependencies + run: yarn add ${{ github.event.inputs.versions || "webpack@latest vite@latest @parcel/core@latest esbuild@latest" }} + + - name: Run benchmark + run: yarn start --reporter json + + - uses: actions/upload-artifact@v4 + with: + name: benchmark + path: output.json diff --git a/.gitignore b/.gitignore index 9afe7dea40..e5a73f93fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ fixtures/*/*-dist .parcel-cache -node_modules \ No newline at end of file +node_modules +output.json diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index ffb0a10d2b..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,2 +0,0 @@ -node --run format:fix -node --run lint:fix diff --git a/README.md b/README.md index 1c9f32c979..7a7c6c5c30 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,5 @@ # Webpack Benchmarker -## CLI Options - -| Option | Short | Description | Default | -| ------------ | ----- | ------------------------------------ | ------------------------ | -| `--bundlers` | `-b` | Select bundlers to benchmark | `["vite", "webpack"]` | -| `--metrics` | `-m` | Choose metrics to collect | `["build-time", "size"]` | -| `--reporter` | `-r` | Choose output format | `"console"` | -| `--fixtures` | | Glob pattern for fixture directories | `"./fixtures/*"` | -| `--verbose` | | Enable verbose logging | `false` | -| `--silent` | | Suppress all output except errors | `false` | - ## Fixtures Fixtures are test projects used to benchmark bundlers. diff --git a/eslint.config.mjs b/eslint.config.mjs index 81977cec71..1a0e94da20 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,5 +10,26 @@ export default [ languageOptions: { globals: globals.nodeBuiltin, }, + rules: { + "object-shorthand": "error", + "import-x/order": [ + "error", + { + groups: [ + "builtin", + "external", + "internal", + ["sibling", "parent"], + "index", + "unknown", + ], + "newlines-between": "always", + alphabetize: { + order: "asc", + caseInsensitive: true, + }, + }, + ], + }, }, ]; diff --git a/package.json b/package.json index e6fa607173..6a2604c477 100644 --- a/package.json +++ b/package.json @@ -24,17 +24,15 @@ "format:fix": "prettier --write .", "lint": "eslint .", "lint:fix": "eslint . --fix", - "start": "node ./src/core/cli.mjs", - "prepare": "husky" + "start": "node ./src/core/cli.mjs" }, "dependencies": { - "@parcel/core": "2.15.4", + "@parcel/core": "^2.16.0", "cli-table3": "^0.6.5", "commander": "^14.0.1", "consola": "^3.4.2", "esbuild": "^0.25.10", - "parcel": "^2.15.4", - "vite": "^7.1.5", + "vite": "^7.1.6", "webpack": "^5.101.3" }, "devDependencies": { @@ -42,7 +40,6 @@ "eslint": "^9.35.0", "eslint-plugin-import-x": "^4.16.1", "globals": "^16.4.0", - "husky": "^9.1.7", "prettier": "^3.6.2" } } diff --git a/src/bundlers/esbuild.mjs b/src/bundlers/esbuild.mjs index 4489eaed71..dc7ab33953 100644 --- a/src/bundlers/esbuild.mjs +++ b/src/bundlers/esbuild.mjs @@ -1,5 +1,7 @@ -import { build as esbuild } from "esbuild"; import path from "node:path"; + +import { build as esbuild } from "esbuild"; + import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "esbuild"; diff --git a/src/bundlers/parcel.mjs b/src/bundlers/parcel.mjs index 29c4bcae09..5de366903c 100644 --- a/src/bundlers/parcel.mjs +++ b/src/bundlers/parcel.mjs @@ -1,5 +1,7 @@ -import { Parcel } from "@parcel/core"; import path from "node:path"; + +import { Parcel } from "@parcel/core"; + import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "parcel"; diff --git a/src/bundlers/vite.mjs b/src/bundlers/vite.mjs index 7094894430..9335580a54 100644 --- a/src/bundlers/vite.mjs +++ b/src/bundlers/vite.mjs @@ -1,5 +1,7 @@ -import { build as vite } from "vite"; import path from "node:path"; + +import { build as vite } from "vite"; + import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "vite"; diff --git a/src/bundlers/webpack.mjs b/src/bundlers/webpack.mjs index 2ae26f4401..6dcc12ce61 100644 --- a/src/bundlers/webpack.mjs +++ b/src/bundlers/webpack.mjs @@ -1,5 +1,7 @@ -import webpack from "webpack"; import path from "node:path"; + +import webpack from "webpack"; + import { removeIfExists } from "../core/utils/file.mjs"; const BUNDLER_NAME = "webpack"; diff --git a/src/core/cli.mjs b/src/core/cli.mjs index f568572160..7985e25769 100644 --- a/src/core/cli.mjs +++ b/src/core/cli.mjs @@ -1,19 +1,26 @@ #!/usr/bin/env node import { Command } from "commander"; -import runBenchmark from "./runner.mjs"; import { consola } from "consola"; +import runBenchmark from "./runner.mjs"; + new Command() .option("-b, --bundlers ", "Select bundlers to benchmark", [ "vite", "webpack", + "esbuild", ]) .option("-m, --metrics ", "Choose metrics to collect", [ "build-time", "size", ]) .option("-r, --reporter ", "Choose output format", "console") + .option( + "-o, --output ", + "The output file for JSON reports", + "output.json", + ) .option("--fixtures ", "Glob to fixtures", "./fixtures/*") .option("--verbose", "Enable verbose logging") .option("--silent", "Suppress all output except errors") diff --git a/src/core/runner.mjs b/src/core/runner.mjs index dfec0424a8..d253a7bf8c 100644 --- a/src/core/runner.mjs +++ b/src/core/runner.mjs @@ -1,7 +1,9 @@ -import { performance } from "node:perf_hooks"; import { glob } from "node:fs/promises"; import { isAbsolute, join } from "node:path"; +import { performance } from "node:perf_hooks"; + import { consola } from "consola"; + import { prepareFixture, loadModule } from "./utils/misc.mjs"; /** diff --git a/src/core/utils/formatting.mjs b/src/core/utils/formatting.mjs index 5f4b347c3f..561fa2896e 100644 --- a/src/core/utils/formatting.mjs +++ b/src/core/utils/formatting.mjs @@ -2,7 +2,7 @@ * Formats milliseconds into a human-readable string * @param {number} milliseconds */ -export function formatDuration(milliseconds) { +function formatDuration(milliseconds) { if (milliseconds < 1000) { return `${Math.round(milliseconds)}ms`; } else if (milliseconds < 60000) { @@ -19,7 +19,23 @@ const sizes = ["B", "KB", "MB", "GB"]; * Formats bytes into a human-readable string * @param {number} bytes */ -export function formatBytes(bytes) { +function formatBytes(bytes) { const i = Math.floor(Math.log(bytes) / Math.log(1024)); return parseFloat((bytes / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]; } + +/** + * Formats a value + * @param {number} value + * @param {string} unit + */ +export function formatValue(value, unit) { + switch (unit) { + case "ms": + return formatDuration(value); + case "bytes": + return formatBytes(value); + default: + return String(value); + } +} diff --git a/src/core/utils/misc.mjs b/src/core/utils/misc.mjs index ba1a28fb2c..3149000d0c 100644 --- a/src/core/utils/misc.mjs +++ b/src/core/utils/misc.mjs @@ -1,9 +1,10 @@ -import { exists } from "./file.mjs"; +import { execFile } from "node:child_process"; import { join } from "node:path"; import { join as posixJoin } from "node:path/posix"; -import { execFile } from "node:child_process"; import { promisify } from "node:util"; +import { exists } from "./file.mjs"; + const moduleCache = new Map(); /** diff --git a/src/metrics/build-time.mjs b/src/metrics/build-time.mjs index a3290ce691..6bfcd6b8b4 100644 --- a/src/metrics/build-time.mjs +++ b/src/metrics/build-time.mjs @@ -1,16 +1,13 @@ -import { formatDuration } from "../core/utils/formatting.mjs"; - export default class BuildTimeMetric { - name = "Build Time"; - + name = "build-time"; /** @type {import('../types').Metric['collect']} */ async collect({ startTime, endTime }) { const buildTime = endTime - startTime; return { value: buildTime, + displayName: "Build Time", unit: "ms", - formatted: formatDuration(buildTime), }; } } diff --git a/src/metrics/size.mjs b/src/metrics/size.mjs index fca2a75e4a..3039d61187 100644 --- a/src/metrics/size.mjs +++ b/src/metrics/size.mjs @@ -1,8 +1,7 @@ -import { formatBytes } from "../core/utils/formatting.mjs"; import { getDirectorySize } from "../core/utils/file.mjs"; export default class SizeMetric { - name = "Size"; + name = "size"; /** @type {import('../types').Metric['collect']} */ async collect({ buildResult }) { @@ -11,8 +10,8 @@ export default class SizeMetric { return { value: totalSize, + displayName: "Size", unit: "bytes", - formatted: formatBytes(totalSize), }; } } diff --git a/src/reporters/console.mjs b/src/reporters/console.mjs index ed301a0df5..070ac14ed4 100644 --- a/src/reporters/console.mjs +++ b/src/reporters/console.mjs @@ -1,67 +1,37 @@ +import path from "node:path"; + import Table from "cli-table3"; import { consola } from "consola"; -import path from "path"; - -/** - * Extracts the results from metrics - * @param {Array} bundlerResults - */ -function extractMetrics(bundlerResults) { - const metrics = new Set(); - for (const [, bundlerMetrics] of bundlerResults) { - for (const metricName of bundlerMetrics.keys()) { - metrics.add(metricName); - } - } - return Array.from(metrics).sort(); -} - -function formatValue(metricData) { - if (!metricData) return "─"; - return metricData.formatted || String(metricData.value) || "─"; -} -/** - * Create a row for the summary table - * @param {string} bundler - * @param {Array} bundlerMetrics - * @param {Array} metricsList - */ -function createBundlerRow(bundler, bundlerMetrics, metricsList) { - const row = [bundler]; - - for (const metric of metricsList) { - const metricData = bundlerMetrics.get(metric); - row.push(formatValue(metricData)); - } - - return row; -} +import { formatValue } from "../core/utils/formatting.mjs"; /** * Prints a summary table - * @param {Map>} bundlerResults + * @param {Map>} bundlerResults * @param {Array} bundlers */ function printSummaryTable(bundlerResults, bundlers) { - const metricsList = extractMetrics(bundlerResults); + const headers = new Set(); + + const rows = bundlers.map((bundler) => ({ + [bundler]: [...bundlerResults.get(bundler).values()].map((result) => { + headers.add(result.displayName); + return formatValue(result.value, result.unit); + }), + })); const table = new Table({ - head: ["Bundler", ...metricsList], - colWidths: [15, ...Array(metricsList.length).fill(18)], + head: ["Bundler", ...headers], style: { head: ["cyan"], border: ["grey"] }, }); - for (const bundler of bundlers) { - const bundlerMetrics = bundlerResults.get(bundler); - table.push(createBundlerRow(bundler, bundlerMetrics, metricsList)); - } + table.push(...rows); console.log(table.toString()); } /** @type {import('../types').Reporter} */ -export default function displayResults(results) { +export default function (results) { consola.info("Benchmark Results"); console.log("=".repeat(60)); diff --git a/src/reporters/json.mjs b/src/reporters/json.mjs new file mode 100644 index 0000000000..4d1f7fc168 --- /dev/null +++ b/src/reporters/json.mjs @@ -0,0 +1,9 @@ +import { writeFile } from "node:fs/promises"; + +// https://stackoverflow.com/questions/29085197/how-do-you-json-stringify-an-es6-map +const replacer = (_, value) => + value instanceof Map ? Object.fromEntries(value.entries()) : value; + +/** @type {import('../types').Reporter} */ +export default (results, options) => + writeFile(options.output, JSON.stringify(results, replacer)); diff --git a/src/types.d.ts b/src/types.d.ts index 0766cdcad4..38112ca0ab 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -5,6 +5,7 @@ export declare type Options = { fixtures: string; verbose: boolean; silent: boolean; + output: string; }; export declare type BuildResult = { @@ -15,8 +16,8 @@ export declare type BuildResult = { export declare type MetricResult = { value: number; - unit: string; - formatted: string; + unit: "ms" | "bytes"; + displayName: string; }; export declare type Bundler = { @@ -39,5 +40,6 @@ export declare class Metric { } export declare type Reporter = ( - results: Map>, + results: Map>>, + options: Options, ) => Promise; diff --git a/yarn.lock b/yarn.lock index 7f082348da..f73e953bee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -384,101 +384,44 @@ "@emnapi/runtime" "^1.4.3" "@tybys/wasm-util" "^0.10.0" -"@parcel/bundler-default@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/bundler-default/-/bundler-default-2.15.4.tgz#33f1ee6d3be7d10864f1f4567d5b90ef448a4cee" - integrity sha512-4vkaZuwGqL8L7NqEgjRznz9/QoeVKk0Z6z2nzfpdnSWA4xX3moUj+JeoqGUbyFGuPzfCma4SA4+txnQbKu0edQ== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/graph" "3.5.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/cache@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/cache/-/cache-2.15.4.tgz#64a5f57028ca7a4ee28f565b622ebb22901136d0" - integrity sha512-x/QgMuVvXQV6uNhIF+6kz6SzhVVkwf6WPSVG/xQvGMEiBabForDVYIhIEuN3RzUXCU352CGM6d8TtLLg61W1fw== - dependencies: - "@parcel/fs" "2.15.4" - "@parcel/logger" "2.15.4" - "@parcel/utils" "2.15.4" +"@parcel/cache@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/cache/-/cache-2.16.0.tgz#15d94f879167191736345f6838f17c4d6deab6f2" + integrity sha512-stBGOio+z2qjnSJNl1vJTNqjgLyzDFp+tUOKgaLJ8Vmn67jYccoGLTNApw2mhB3HtQuoz/5eudGHSvhqMpMyTg== + dependencies: + "@parcel/fs" "2.16.0" + "@parcel/logger" "2.16.0" + "@parcel/utils" "2.16.0" lmdb "2.8.5" -"@parcel/codeframe@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/codeframe/-/codeframe-2.15.4.tgz#69f00eea86313c5bc5cbe145607ae248803c32be" - integrity sha512-ErAPEQaJIpB+ocNZ3rl8AEK6piA7JBInwZLNU0eHMthm01Ssb10JkpAadyn1w9IVfCey+kqQcEeWv47Yh6mL1Q== +"@parcel/codeframe@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/codeframe/-/codeframe-2.16.0.tgz#0e00004565f7a572fc6a1b42d3aa9e40852fa0f1" + integrity sha512-wXpHOOE5o0c55AiUMCwkIrVCFeJzBfZpjhn07WQUUk57gGts5R67bMsoeoizvBhI748l6iSU7rPZSSrXc8NoRg== dependencies: chalk "^4.1.2" -"@parcel/compressor-raw@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/compressor-raw/-/compressor-raw-2.15.4.tgz#93a8d089e2621c90a5d1c09cce63279cbca4fc9b" - integrity sha512-gECePZxVXBwyo0DYbAq4V4SimVzHaJ3p8QOgFIfOqNmlEBbhLf3QSjArFPJNKiHZaJuclh4a+IShFBN+u6tXXw== - dependencies: - "@parcel/plugin" "2.15.4" - -"@parcel/config-default@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/config-default/-/config-default-2.15.4.tgz#df4987f2702cfece80859b13fcc27df53d876c4e" - integrity sha512-chUE4NpcSXpMfTcSmgl4Q78zH+ZFe0qdgZLBtF4EH2QQakW7wAXAYRxS2/P3xFkUj0/51sExhbCFWgulrlGDPw== - dependencies: - "@parcel/bundler-default" "2.15.4" - "@parcel/compressor-raw" "2.15.4" - "@parcel/namer-default" "2.15.4" - "@parcel/optimizer-css" "2.15.4" - "@parcel/optimizer-html" "2.15.4" - "@parcel/optimizer-image" "2.15.4" - "@parcel/optimizer-svg" "2.15.4" - "@parcel/optimizer-swc" "2.15.4" - "@parcel/packager-css" "2.15.4" - "@parcel/packager-html" "2.15.4" - "@parcel/packager-js" "2.15.4" - "@parcel/packager-raw" "2.15.4" - "@parcel/packager-svg" "2.15.4" - "@parcel/packager-wasm" "2.15.4" - "@parcel/reporter-dev-server" "2.15.4" - "@parcel/resolver-default" "2.15.4" - "@parcel/runtime-browser-hmr" "2.15.4" - "@parcel/runtime-js" "2.15.4" - "@parcel/runtime-rsc" "2.15.4" - "@parcel/runtime-service-worker" "2.15.4" - "@parcel/transformer-babel" "2.15.4" - "@parcel/transformer-css" "2.15.4" - "@parcel/transformer-html" "2.15.4" - "@parcel/transformer-image" "2.15.4" - "@parcel/transformer-js" "2.15.4" - "@parcel/transformer-json" "2.15.4" - "@parcel/transformer-node" "2.15.4" - "@parcel/transformer-postcss" "2.15.4" - "@parcel/transformer-posthtml" "2.15.4" - "@parcel/transformer-raw" "2.15.4" - "@parcel/transformer-react-refresh-wrap" "2.15.4" - "@parcel/transformer-svg" "2.15.4" - -"@parcel/core@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/core/-/core-2.15.4.tgz#5cfce948e9361e36f36cad9685124c7316b3cfeb" - integrity sha512-+TXxTm58lFwXXObFAEclwKX1p1AdixcD+M7T4NeFIQzQ4F20Vr+6oybCSqW1exNA3uHqVDDFLx7TT78seVjvkg== +"@parcel/core@^2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/core/-/core-2.16.0.tgz#8704402887017e41754879174d2af65f94655f26" + integrity sha512-erH9GdLe8Boie0mCO8hXn8Qt/pCACsOFlKp8UHNMlPaizUtCDkCOQqwmSi+VyrJ3dMMCOc/qBwTSGAJaJE8/Kw== dependencies: "@mischnic/json-sourcemap" "^0.1.1" - "@parcel/cache" "2.15.4" - "@parcel/diagnostic" "2.15.4" - "@parcel/events" "2.15.4" - "@parcel/feature-flags" "2.15.4" - "@parcel/fs" "2.15.4" - "@parcel/graph" "3.5.4" - "@parcel/logger" "2.15.4" - "@parcel/package-manager" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/profiler" "2.15.4" - "@parcel/rust" "2.15.4" + "@parcel/cache" "2.16.0" + "@parcel/diagnostic" "2.16.0" + "@parcel/events" "2.16.0" + "@parcel/feature-flags" "2.16.0" + "@parcel/fs" "2.16.0" + "@parcel/graph" "3.6.0" + "@parcel/logger" "2.16.0" + "@parcel/package-manager" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/profiler" "2.16.0" + "@parcel/rust" "2.16.0" "@parcel/source-map" "^2.1.1" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - "@parcel/workers" "2.15.4" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + "@parcel/workers" "2.16.0" base-x "^3.0.11" browserslist "^4.24.5" clone "^2.1.2" @@ -489,361 +432,157 @@ nullthrows "^1.1.1" semver "^7.7.1" -"@parcel/diagnostic@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/diagnostic/-/diagnostic-2.15.4.tgz#17393f0fa71da19c84d0668e496e4ca9427e1f77" - integrity sha512-8MAqefwzBKceNN3364OLm+p4HRD7AfimfFW3MntLxPB6bnelc9UBg5c9zEm34zYEctbmky8gqYgAUSDjqYC5Hw== +"@parcel/diagnostic@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/diagnostic/-/diagnostic-2.16.0.tgz#313e7a94ec0d2d856e604c96fa5c48c6b04fb0dc" + integrity sha512-z5MeMwFegaA23wseltLykVV9OxsKkY3BiEje/Dt7ttVivwNWFKHDuXB8vbZTDArUooixUH3s/RJhTFI46VJc2A== dependencies: "@mischnic/json-sourcemap" "^0.1.1" nullthrows "^1.1.1" -"@parcel/error-overlay@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/error-overlay/-/error-overlay-2.15.4.tgz#bc5a90245a70c7e202dfe43c05112457a772bf58" - integrity sha512-xxeaWm8fV8Z4uGy/c09mOvmFSHBOgF1gCMQwLCwZvfMLqIWkdZaUQ2cRhWZIS6pOXaRVC7YpcXzk2DOiSUNSbQ== - -"@parcel/events@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/events/-/events-2.15.4.tgz#2a08fb358cff6888bc5151b1aece56671990681d" - integrity sha512-SBq4zstaFr7XQaXNaQmUuVh1swCUHrhtPCOSofvkJoQGhjsuhQlh4t0NmUikyKNdj7C1j40xCS1kGHuUO29b0g== - -"@parcel/feature-flags@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/feature-flags/-/feature-flags-2.15.4.tgz#07646d16668835977648999ebdedaa108b3ad722" - integrity sha512-DJqZVtbfjWJseM0gk7yyDkAuOhP7/FVwZ/YVqjozIqXBhmQm07xctiqNQyZX2vBbQsxmVbjpqyq+DOj45WPEzQ== - -"@parcel/fs@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/fs/-/fs-2.15.4.tgz#3f09cec9d780dcad5ce93811441c07056de423c4" - integrity sha512-5cahD2ByQaSi+YN0aDvrMWXZvs3mP7C5ey8zcDTDn7JxJa51sMqOQcdU3VUTzQFtAPeRM2KxUkxLhBBXgQqHZA== - dependencies: - "@parcel/feature-flags" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/types-internal" "2.15.4" - "@parcel/utils" "2.15.4" +"@parcel/events@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/events/-/events-2.16.0.tgz#a1f17bfa4402b84d732bd21b408a3d9ee1e968b3" + integrity sha512-PI7dryJLPYCe4jNzo7XWAzbUPUuD50Nd76GTdzaHhmcQfZnPrtWAu73UmP3yYqpbv97TtWSiCJyrJWPTDU/REA== + +"@parcel/feature-flags@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/feature-flags/-/feature-flags-2.16.0.tgz#76e0bd00ef7faa7ebf1eb52ed41b08bb1b3637ea" + integrity sha512-GiRpLx0x8dZdWCpftk6OE0lp0Cc8oUyBssPiobigpSA8vgxrCz/zLbs83R/K70p+wPBb+ye4eEiR67+KCwcSXg== + +"@parcel/fs@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/fs/-/fs-2.16.0.tgz#ea9c2c4ef90005fdb5ead69be596af489a9cb18e" + integrity sha512-nRp4BhJm1V8tPu68WjRvu5kbBjTwWXYzqwpGoWwHFmZQQ2J1/Ye28x1NY3awxSVGyXsEy2sEO4s7rLyd0EW2pA== + dependencies: + "@parcel/feature-flags" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/types-internal" "2.16.0" + "@parcel/utils" "2.16.0" "@parcel/watcher" "^2.0.7" - "@parcel/workers" "2.15.4" + "@parcel/workers" "2.16.0" -"@parcel/graph@3.5.4": - version "3.5.4" - resolved "https://registry.yarnpkg.com/@parcel/graph/-/graph-3.5.4.tgz#f2ac5c7d991cb9e2839c052cfec68cba3b659ad4" - integrity sha512-uF7kyQXWK2fQZvG5eE0N3avYGLQE5Q0vyJsyypNcFW3kXNnrkZCUtbG7urmdae9mmZ2jXIVN4q4Bhd9pefGj9A== +"@parcel/graph@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@parcel/graph/-/graph-3.6.0.tgz#1211bdd7edf860bebc7e1d2aad9f54d15ae2bae4" + integrity sha512-ShxOzS0FdyXJ7gwit7CSPuQCbU0bXkB+kZyrXgj0UmgIDYDMYO02T+UIlH4AReEzqcZq3An+sDOx+UKRM8j8Uw== dependencies: - "@parcel/feature-flags" "2.15.4" + "@parcel/feature-flags" "2.16.0" nullthrows "^1.1.1" -"@parcel/logger@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/logger/-/logger-2.15.4.tgz#a3a4452167db5ead13942bc1dd0b783ab5a11de9" - integrity sha512-rQ7F5+FMQ7t+w5NGFRT8CWHhym0aunduufCjlafvRzUSKEN/5/nwTfCe9I5QsthGlXJWs+ZTy4zQ+wLtZQRBKQ== +"@parcel/logger@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/logger/-/logger-2.16.0.tgz#bde4615d869a581de5acd5ccec275456b3541a54" + integrity sha512-/K6UVVCtS1KOkH9xxuH9u2xV3348mb+Fb33K/OUs5wnpfmo0TtrzodjLyMpQG6KrofmYKSNzA5petp7+cf3aug== dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/events" "2.15.4" + "@parcel/diagnostic" "2.16.0" + "@parcel/events" "2.16.0" -"@parcel/markdown-ansi@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/markdown-ansi/-/markdown-ansi-2.15.4.tgz#21e9119854dd7f07289eabc514ba1d2b939762f0" - integrity sha512-u5Lwcr4ZVBSLFbKYht+mJqJ3ZMXvJdmDMU5eDtrIEKPpu9LrIDdPpDEXBoyO6pDsoV/2AqyXUUMzBRyCatkkoQ== +"@parcel/markdown-ansi@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/markdown-ansi/-/markdown-ansi-2.16.0.tgz#37c9826a67390d6b0bb8d04091d8ce5b03d32629" + integrity sha512-NxlmF/JAmsq9Yf/8q2+WEHFkcQ/cDoVOUx6ETDM8icDaQ8kXJbZSKAMOWnsB1EF0757UST77kX9zw/V6tyXqnw== dependencies: chalk "^4.1.2" -"@parcel/namer-default@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/namer-default/-/namer-default-2.15.4.tgz#46613c9ed8f433dda2a7907d41f4cb8076a508be" - integrity sha512-EXsoQ1S+5ZIfy8431E7F0vVS7bfH5JpZ+vFVcUpArJDkhmMG7T/eP6Kp9CXHLJmn7ki1x7iIVytrja0XXRQWBQ== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/node-resolver-core@3.6.4": - version "3.6.4" - resolved "https://registry.yarnpkg.com/@parcel/node-resolver-core/-/node-resolver-core-3.6.4.tgz#ff240da06cc57298f0c60178b935b60e1d621311" - integrity sha512-g3+usMnr7pfRqbMAksOpNA7GJk7HUNW1Wxx7Shhp4w0K9JUdVrd2LRKwZxbqL7H9NqWtVvUOT9cZbMlDR6bO1w== +"@parcel/node-resolver-core@3.7.0": + version "3.7.0" + resolved "https://registry.yarnpkg.com/@parcel/node-resolver-core/-/node-resolver-core-3.7.0.tgz#ac76d222dc0a570ca142c4ee0c1d61a6f92104c9" + integrity sha512-YIK7wtjO7biRoXNRdFR0uSYPY0FwvCA77xlJCOTX1+jeACj8BPwLKOMFJKCA89pBr7iHyTNzZ3ppVGsX8flMag== dependencies: "@mischnic/json-sourcemap" "^0.1.1" - "@parcel/diagnostic" "2.15.4" - "@parcel/fs" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" + "@parcel/diagnostic" "2.16.0" + "@parcel/fs" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" nullthrows "^1.1.1" semver "^7.7.1" -"@parcel/optimizer-css@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-css/-/optimizer-css-2.15.4.tgz#44e2f4278b20e7df4608202a875d6275a07c7642" - integrity sha512-KQLuqwcvVFTNFtM+bzfvQivwunmhVAngmR4NiI8zQaykidYH28V8YkVAQmpbLbgoGad/UgG7grb0UshvnrQHpw== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - browserslist "^4.24.5" - lightningcss "^1.30.1" - nullthrows "^1.1.1" - -"@parcel/optimizer-html@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-html/-/optimizer-html-2.15.4.tgz#f6fa27766f7e6e0c57fff3ac8bccbae800e8d81f" - integrity sha512-gBvt6RdDVMyO1Flvdtc8DxpxLgIXhaKuVXEjHdAP7sEW0SMdSd6r/tl6Plmcszig7sDwhDf6IsQOIvbzGHYZZg== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/optimizer-image@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-image/-/optimizer-image-2.15.4.tgz#57a85fde1ad9280841cd819d45195602de0cb23e" - integrity sha512-M8fo7eEL6JRcmLhSX9pUUGU4MPrPrE9cMNcwIt3DQLnSvQ+sshhUDa6t9hKWeHHhs16BHvxrvksN2TIbkgHODQ== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - "@parcel/workers" "2.15.4" - -"@parcel/optimizer-svg@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-svg/-/optimizer-svg-2.15.4.tgz#12c7a05a26b25e93e47cb983bc612bb5a6fe02d4" - integrity sha512-pPdjRaLPqjAEROXIHLc6JWLLki56alhuUNbalhLqBCgktZrrq2dGCjBEVgxqRczc9D+ePCX/e/xci4tC0Tkcbg== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/optimizer-swc@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/optimizer-swc/-/optimizer-swc-2.15.4.tgz#07168569eeaa26a50ec0fadf27b617f596717b7e" - integrity sha512-2m5cYESVCq6AGx252eSTArZ1Oc1Ve4GBGL7NhvgbNqOthyXlc2qAed6rCkARrBd8pfEl5+2XHeK1ijDAZdIZ/A== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - "@swc/core" "^1.11.24" - nullthrows "^1.1.1" - -"@parcel/package-manager@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/package-manager/-/package-manager-2.15.4.tgz#94954afd5b6d2bb8c80c96a6ffd1cb5217aad6cd" - integrity sha512-KZONBcEJ24moQdrpU0zJh9CYk3KKbpB5RUM70utAORem1yQKms+0Y4YED3njq6nZzbgwUN/Csc+powUHLZStvg== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/fs" "2.15.4" - "@parcel/logger" "2.15.4" - "@parcel/node-resolver-core" "3.6.4" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - "@parcel/workers" "2.15.4" +"@parcel/package-manager@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/package-manager/-/package-manager-2.16.0.tgz#0d7f21a9a6e920753858703123217047aef56f8a" + integrity sha512-YDOLTcDFYJn3VeEYktO8Yrpw+kaWsLGHOUhPPrw3uaQsqNPi4wIRMsuhcFa9fAL5OlFX56I9iD/yciUiULOFXw== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/fs" "2.16.0" + "@parcel/logger" "2.16.0" + "@parcel/node-resolver-core" "3.7.0" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + "@parcel/workers" "2.16.0" "@swc/core" "^1.11.24" semver "^7.7.1" -"@parcel/packager-css@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-css/-/packager-css-2.15.4.tgz#ef75eec1b30eea233b6f9e863a452c91aa115f3c" - integrity sha512-bzSaNf+I5lmJFu95wSG2k7pGwjCDesZsV6Y9sozIL2LoSxqvkGhm/ABXAa3Ed7dLe3tSAEBzJcyqShQgLzSzuw== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - lightningcss "^1.30.1" - nullthrows "^1.1.1" - -"@parcel/packager-html@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-html/-/packager-html-2.15.4.tgz#81a44e461854fc44ddaafdfa71a85150942e868c" - integrity sha512-Uayux6A2Anm66Kmq22QhD0TuVp9LiRCMuPUzBd6n4ekNlG0Lzm6K3/okMkPG65nKbNjq5qcPscFWlDxggvjt2g== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/packager-js@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-js/-/packager-js-2.15.4.tgz#14af23591731a716d185e4e08e5b2b228c399536" - integrity sha512-96bqhs1jyd28CfWQD+Yn8rSsd1ar7voHWyBtMLimsK+bDJIzL26Z7jWyRDwXRuLErYC01EoXRIRctxtmeRVJ2Q== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - globals "^13.24.0" - nullthrows "^1.1.1" - -"@parcel/packager-raw@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-raw/-/packager-raw-2.15.4.tgz#59ae6264d6df0ce1280c3bfa266056b2d69adcba" - integrity sha512-CaSpDt5jjcO0SYCtsDhw6yfTDQuDFQ875H42W/ftvSQL7RfLRljPthnbdcy9chvKBbvRBQF+0z8Sxwehrd5hsA== - dependencies: - "@parcel/plugin" "2.15.4" - -"@parcel/packager-svg@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-svg/-/packager-svg-2.15.4.tgz#126c51f8c4555ce4b706c1dfef4a99e09ea93cbf" - integrity sha512-qHsyOgnzoA2XGMLIYUnX79XAaV327VTWQvIzju/OmOjcff4o3uiEcNL8w9k3p2w2oPXOLoQ0THMiivoUQSM8GQ== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/packager-wasm@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/packager-wasm/-/packager-wasm-2.15.4.tgz#f7dc0243164ea09493c63f859463f2d43b6a104d" - integrity sha512-YPVij7zrBchtXr/y29P4uh3C/+19PMhhLibYF/8oMJKkFkeU3Uv00/XLm915vdBPrIPjgw0YuIfLzUKip1uGtg== - dependencies: - "@parcel/plugin" "2.15.4" - -"@parcel/plugin@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/plugin/-/plugin-2.15.4.tgz#742c08846d7c0ab174f040beac28c86c460e6220" - integrity sha512-XVehjmzk8ZDOFf/BXo26L76ZqCGNKIQcN2ngxAnq0KRY/WFanL8yLaL0qQq+c9whlu09hkGz1CuhFBLAIjJMYQ== +"@parcel/plugin@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/plugin/-/plugin-2.16.0.tgz#7e80d2c5d562daf7a938f1006d4f2d34498bc0c8" + integrity sha512-Rdk5e/VGmMp6s2DmC0AbjWYmea3Vv8Tx1SC5ln+lf+qRlhndrbFV9o5QKirTY9C8GWd20qH1ZqOxPDEzK/YSGA== dependencies: - "@parcel/types" "2.15.4" + "@parcel/types" "2.16.0" -"@parcel/profiler@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/profiler/-/profiler-2.15.4.tgz#aea16630151fef60edb9db1a34c840a9123cf262" - integrity sha512-ezVZlttUmQ1MQD5e8yVb07vSGYEFOB59Y/jaxL9mGSLZkVhMIIHe/7SuA+4qVAH8dlg6bslXRqlsunLMPEgPsg== +"@parcel/profiler@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/profiler/-/profiler-2.16.0.tgz#a408e9fd38ddcfaeec258e5cc77850a029859386" + integrity sha512-xm6fVTA1V/Co7JuJfkNtZJsKsvq0RSpoE7JjiNtKLCMh+Lim6w7dxc6CEBqGImhR/9YbwteY6/gVFwkvCdLvLg== dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/events" "2.15.4" - "@parcel/types-internal" "2.15.4" + "@parcel/diagnostic" "2.16.0" + "@parcel/events" "2.16.0" + "@parcel/types-internal" "2.16.0" chrome-trace-event "^1.0.2" -"@parcel/reporter-cli@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/reporter-cli/-/reporter-cli-2.15.4.tgz#0a5c8afe1d17058927faa3b392f73b8faa0c5a29" - integrity sha512-us0HIwuJqpSguf+yi4n8foabVs26JGvRB/eSOf0KkRldxFciYLn4NJ8rt3Xm1zvxlDiSkD4v2n77u+ouIZ+AEQ== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/types" "2.15.4" - "@parcel/utils" "2.15.4" - chalk "^4.1.2" - term-size "^2.2.1" - -"@parcel/reporter-dev-server@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/reporter-dev-server/-/reporter-dev-server-2.15.4.tgz#10f2ebb2f45f0c7524ae6b83a6991eb74ab386a3" - integrity sha512-uCNeDyArNNXI9YThlxyTx7+5ZSxlewyUdyrLdDZCqvn8s1xNB9W8sUNVps7mJZQSc+2ZRk3wyDemURD67uJk/A== - dependencies: - "@parcel/codeframe" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - -"@parcel/reporter-tracer@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/reporter-tracer/-/reporter-tracer-2.15.4.tgz#6ee5127a12d5c2e3bbaa47fee94b93c63a3a8a51" - integrity sha512-9W1xsb/FtobCQ4z847nI6hFDaTZHLeThv/z05EF77R30RX2k+unG9ac5NQB1v4KLx09Bhfre32+sjYNReWxWlg== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - chrome-trace-event "^1.0.3" - nullthrows "^1.1.1" - -"@parcel/resolver-default@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/resolver-default/-/resolver-default-2.15.4.tgz#e94da849e76621732274bb82703cbf52420db975" - integrity sha512-4uKo3FFnubtIc4rM9jZiQQXpa1slawyRy5btJEfTFvbcnz0dm3WThLrsPDMfmPwNr9F/n5x8yzDLI6/fZ/elgA== - dependencies: - "@parcel/node-resolver-core" "3.6.4" - "@parcel/plugin" "2.15.4" - -"@parcel/runtime-browser-hmr@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/runtime-browser-hmr/-/runtime-browser-hmr-2.15.4.tgz#4ab1231eaa86fa1f35c6bb9b6f61c52ba7a5d0c3" - integrity sha512-KRGzbxDUOQUkrJKxxY0WyU7oVaa9TvWTRlpuGJXzQJs/hw8vkAAoAm8+ptpypvBC8LnxFHzGbSyHPfL8C8MQOw== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/runtime-js@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/runtime-js/-/runtime-js-2.15.4.tgz#f0904e0f869d0944d958d42f4fe8404bf2cade9d" - integrity sha512-zNRK+693CMkYiA0ckjPOmz+JVHD9bVzp27itcMyuDH6l/Or8m09RgCC4DIdIxBqiplsDSe39DwEc5X7b0vvcjw== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/runtime-rsc@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/runtime-rsc/-/runtime-rsc-2.15.4.tgz#4b688df19e8fdbd478f8eb5605d09e3e40d5c631" - integrity sha512-yHc4HEwzCQYLqa6Q1WtZ8xJeaDAk0p2i0b3ABq2I+izmRjer4jertlsEwh9mf9Z1eUGtJobdGYzl8Ai1VfhC3g== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/runtime-service-worker@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/runtime-service-worker/-/runtime-service-worker-2.15.4.tgz#e003a7b558b615f72615b75ca1fbc1a89297d7b7" - integrity sha512-NGq/wS34GIVzo2ZURBjCqgHV+PU7eTcngCzmmk/wrCEeWnr13ld+CAIxVZoqyNJwYsF6VQanrjSM2/LhCXEdyA== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/rust-darwin-arm64@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-arm64/-/rust-darwin-arm64-2.15.4.tgz#8716edcee0176394781cff6917f5cd9def77cb0f" - integrity sha512-cEpNDeEtvM5Nhj0QLN95QbcZ9yY6Z5W3+2OeHvnojEAP8Rp1XGzqVTTZdlyKyN1KTiyfzIOiQJCiEcr+kMc5Nw== - -"@parcel/rust-darwin-x64@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-x64/-/rust-darwin-x64-2.15.4.tgz#1556299e41cd3bd67391c613a892f0f5812a454a" - integrity sha512-jL9i13sXKeBXXz8Z3BNYoScPOi+ljBA0ubAE3PN5DCoAA6wS4/FsAiRSIUw+3uxqASBD7+JvaT5sDUga1Xft5g== - -"@parcel/rust-linux-arm-gnueabihf@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm-gnueabihf/-/rust-linux-arm-gnueabihf-2.15.4.tgz#514e3c7ae6b1eaca91a345ef5c705e95458f41ea" - integrity sha512-c8HpVdDugCutlMILoOlkTioih9HGJpQrzS2G3cg/O1a5ZTacooGf3eGJGoh6dUBEv9WEaEb6zsTRwFv2BgtZcA== - -"@parcel/rust-linux-arm64-gnu@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-gnu/-/rust-linux-arm64-gnu-2.15.4.tgz#78aaf9aa9be92a764eb76d013c580679eb12b44e" - integrity sha512-Wcfs/JY4FnuLxQaU+VX2rI4j376Qo2LkZmq4zp9frnsajaAqmloVQfnbUkdnQPEL4I38eHXerzBX3LoXSxnZKA== - -"@parcel/rust-linux-arm64-musl@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-musl/-/rust-linux-arm64-musl-2.15.4.tgz#c6d2cde97139d5329288cb44325534fe12a66659" - integrity sha512-xf9HxosEn3dU5M0zDSXqBaG8rEjLThRdTYqpkxHW/qQGzy0Se+/ntg8PeDHsSG5E9OK8xrcKH46Lhaw0QBF/Zw== - -"@parcel/rust-linux-x64-gnu@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-gnu/-/rust-linux-x64-gnu-2.15.4.tgz#476cbb6544117abca7e6f1b3c84737f2ad7182b4" - integrity sha512-RigXVCFj6h0AXmkuxU61rfgYuW+PXBR6qSkR2I20yKnAXoMfxLaZy9YJ3sAPMEjT9zXgzGAX+3syItMF+bRjaw== - -"@parcel/rust-linux-x64-musl@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-musl/-/rust-linux-x64-musl-2.15.4.tgz#76b62af4f6d7539f2d6dcaf0e0b84e76065116e2" - integrity sha512-tHlRgonSr5ca8OvhbGzZUggCgCOirRz5dHhPSCm4ajMxeDMamwprq6lKy0sCNTXht4TXIEyugBcfEuRKEeVIBw== - -"@parcel/rust-win32-x64-msvc@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust-win32-x64-msvc/-/rust-win32-x64-msvc-2.15.4.tgz#f64fade58dffe390754acc641a1a65950104a22e" - integrity sha512-YsX6vMl/bfyxqZSN7yiaZQKLoJKELSZYcvg8gIv4CF1xkaTdmfr6gvq2iCyoV+bwrodNohN4Xfl8r7Wniu1/UA== - -"@parcel/rust@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/rust/-/rust-2.15.4.tgz#2e6759c490869704e15466697786dd05fe7eba1c" - integrity sha512-OxOux8z8YEYg23+15uMmYaloFp3x1RwcliBay6HqxUW7RTmtI1/z+xd8AtienCckACD60gvDGy04LjgbEGdJVg== +"@parcel/rust-darwin-arm64@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-arm64/-/rust-darwin-arm64-2.16.0.tgz#e624187ef241c4b3f9a41fc42f289d5de08ead3f" + integrity sha512-rdNl1jq34VflBzduQjcOH9SBJPW+Dy1w5XL7hQ5OEAOkRTP1/3mvh98iVYeB3e+RMjRNE/Ipn/rz2KXXku6e6g== + +"@parcel/rust-darwin-x64@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-x64/-/rust-darwin-x64-2.16.0.tgz#546f4a3d43f9fdda6331590c22d7681d90f29540" + integrity sha512-tozUnjBPfnCjk6HVZCUKNdgFWw4WsLRTJdnsTYBIERrfj858VN0rdOGlVesLFYNSUquoAO+aHtRdT/JqYW7ozA== + +"@parcel/rust-linux-arm-gnueabihf@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm-gnueabihf/-/rust-linux-arm-gnueabihf-2.16.0.tgz#a1f63d5ef852d11b8a6053a287c33a2bb17e315a" + integrity sha512-FX/XrQm5BkLfHHBsUA1t7tYGTkNN4vr/t9ZuADUQCWng+m8g7BB78zWxkjoqayn5zTJAfjjQp42lSZzahtT59A== + +"@parcel/rust-linux-arm64-gnu@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-gnu/-/rust-linux-arm64-gnu-2.16.0.tgz#b1e5e06491cf00e7a9e219e1e6975c7dd5480eda" + integrity sha512-zmnWuclEQDQMhbB8jQw9f1VbnSs6EB2RApg16qs5Co/dhZVozMwJngdkZ6mq5aW8ut+PKYrxIPcVsm7WtVOOfg== + +"@parcel/rust-linux-arm64-musl@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-arm64-musl/-/rust-linux-arm64-musl-2.16.0.tgz#7d5b05708737ed24260fd5d1688c04ee1ccc240c" + integrity sha512-bL3PzFEg0azmdFaf34yHAXukk2MjNSuiITPVOj9Cq65qAk7lb4+9nuGIwrCMr1+R1yCamrL31GgG61qp0X97xg== + +"@parcel/rust-linux-x64-gnu@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-gnu/-/rust-linux-x64-gnu-2.16.0.tgz#329d85282dd7d26da89bd8c3737b263ca025b7c6" + integrity sha512-yvuDTyuhMtwZjB1xGFmCC/UsZjEpMTAanJHAVX9b+tJnn7ArG7Q75Az/JpZsru6KAXiTo1krI54vTE87zzwkIg== + +"@parcel/rust-linux-x64-musl@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-linux-x64-musl/-/rust-linux-x64-musl-2.16.0.tgz#868636e6c4b5f0e3ed9876a6b022f6bfcd72e9bc" + integrity sha512-0q6ESCVe9uHVuQWuEGGDMJwjezliTsEWMcqn7oeQoKXaZJZQpW0UAuzNcNmpiHmeJdifYT9XuxVOo/a8IgOXhg== + +"@parcel/rust-win32-x64-msvc@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust-win32-x64-msvc/-/rust-win32-x64-msvc-2.16.0.tgz#9b623ee20e69c67c22b4148e1be6aaa7bd5fc428" + integrity sha512-IVWpXF1VY+Xgi6ylXaZttAF5+WjazPyxRJUZlC31taYwpfZ4LzmsV8NYlj5ehjTL8d28SKDBoAnOQJwDRe8z8Q== + +"@parcel/rust@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/rust/-/rust-2.16.0.tgz#4a336bc826cf3a5cf97ad03897856ed7ec5e8a2b" + integrity sha512-9ZBiwCCm9OYa2f1rjkXtPUIa0qbKPmpdTqtNHC+5ieRxClvk+m/mxsO1Ag+GbNJrJ8qFYliL3Ha0ZK4d1BrVKw== optionalDependencies: - "@parcel/rust-darwin-arm64" "2.15.4" - "@parcel/rust-darwin-x64" "2.15.4" - "@parcel/rust-linux-arm-gnueabihf" "2.15.4" - "@parcel/rust-linux-arm64-gnu" "2.15.4" - "@parcel/rust-linux-arm64-musl" "2.15.4" - "@parcel/rust-linux-x64-gnu" "2.15.4" - "@parcel/rust-linux-x64-musl" "2.15.4" - "@parcel/rust-win32-x64-msvc" "2.15.4" + "@parcel/rust-darwin-arm64" "2.16.0" + "@parcel/rust-darwin-x64" "2.16.0" + "@parcel/rust-linux-arm-gnueabihf" "2.16.0" + "@parcel/rust-linux-arm64-gnu" "2.16.0" + "@parcel/rust-linux-arm64-musl" "2.16.0" + "@parcel/rust-linux-x64-gnu" "2.16.0" + "@parcel/rust-linux-x64-musl" "2.16.0" + "@parcel/rust-win32-x64-msvc" "2.16.0" "@parcel/source-map@^2.1.1": version "2.1.1" @@ -852,160 +591,34 @@ dependencies: detect-libc "^1.0.3" -"@parcel/transformer-babel@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-babel/-/transformer-babel-2.15.4.tgz#bffd85214853f0e80ad2e9097af130e6535a4547" - integrity sha512-rb4nqZcTLkLD3nvuYJ9wwNb8x6cajBK2l6csdYMLEI4516SkIzkO/gs2cZ9M5q+CMhxAqpdEnrwektbOtQQasg== +"@parcel/types-internal@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/types-internal/-/types-internal-2.16.0.tgz#0476cfdcc80ab53bae0ab660ba1932e0c6943d0a" + integrity sha512-tibAjOY8iyMDzFp5B9jEZPfHYlNvXpw7/msUVebAE6gZ7A8ymWXG8YzMvin6gvWIVTCsYoOkkRsZARvpRcSspQ== dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - browserslist "^4.24.5" - json5 "^2.2.3" - nullthrows "^1.1.1" - semver "^7.7.1" - -"@parcel/transformer-css@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-css/-/transformer-css-2.15.4.tgz#6250598c8507732f2dce5ce8f84210af13e47254" - integrity sha512-6tVwSJsOssXgcB5XMAQGsexAffoBEi8GVql3YQqzI1EwVYs9zr+B5mfbesb4aWcegR02w99NHJYFP9CrOr3SWw== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - browserslist "^4.24.5" - lightningcss "^1.30.1" - nullthrows "^1.1.1" - -"@parcel/transformer-html@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-html/-/transformer-html-2.15.4.tgz#412b86e22806aa16311635028c431c4b3b60641f" - integrity sha512-gzYPbbyEuV8nzPojw86eD5Kf93AYUWcY8lu33gu0XHROJH7mq5MAwPwtb/U+EfpeCd0/oKbLzA2mkQksM1NncQ== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - -"@parcel/transformer-image@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-image/-/transformer-image-2.15.4.tgz#060d753ab75c9d2033fb82e078d1669480675e77" - integrity sha512-KOVwj2gKjUybuzHwarC/YVqRf3r2BD4/2ysckozj6DIji/bq3fd2rE9yqxWXO+zt918PsOSTzMKwRnaseaXLKQ== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - "@parcel/workers" "2.15.4" - nullthrows "^1.1.1" - -"@parcel/transformer-js@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-js/-/transformer-js-2.15.4.tgz#db320444667a398e36ef840cfaafdde4f5b46486" - integrity sha512-HX76PalPjqCLmXJnuSeMr2km8WlnUsW8oaRZ6FuZtSo9QD8BqIcwKGxSbIy9JHkObBgmrMOVpGtYrJM4/BlYbg== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/source-map" "^2.1.1" - "@parcel/utils" "2.15.4" - "@parcel/workers" "2.15.4" - "@swc/helpers" "^0.5.0" - browserslist "^4.24.5" - nullthrows "^1.1.1" - regenerator-runtime "^0.14.1" - semver "^7.7.1" - -"@parcel/transformer-json@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-json/-/transformer-json-2.15.4.tgz#2d7c4f1ea876d8b59e0be165f480875f0ebc81c7" - integrity sha512-1ASeOSH3gPeaXyy/TZ7ce2TOfJ3ZeK5SBnDs+MM8LFcQsTwdRJKjX/4Qq9RgtMRryYAGHgMa09Gvp9FuFRyd+w== - dependencies: - "@parcel/plugin" "2.15.4" - json5 "^2.2.3" - -"@parcel/transformer-node@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-node/-/transformer-node-2.15.4.tgz#ce3c649dc82cf3fc99c90ace3482943dde8fa019" - integrity sha512-zV5jvZA971eQMcFtaWZkW1UfAH/G6XVM/87oJ2B4ip9o9aKUWIl296rrfg2xWxUQyPhy11B17CJ6b8NgieqqrQ== - dependencies: - "@parcel/plugin" "2.15.4" - -"@parcel/transformer-postcss@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-postcss/-/transformer-postcss-2.15.4.tgz#b0822af4816268da4aea21e353b5d58e9388ed64" - integrity sha512-cNueSpOj3ulmMX85xr9clh/t0+mzVE+Q3H7Cf/OammqUkG/xjmilq4q7ZTgQFyUtUdWpE9LWWHojbJuz6k2Ulw== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - "@parcel/utils" "2.15.4" - clone "^2.1.2" - nullthrows "^1.1.1" - postcss-value-parser "^4.2.0" - semver "^7.7.1" - -"@parcel/transformer-posthtml@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-posthtml/-/transformer-posthtml-2.15.4.tgz#08e1b48bb939fcfb4606dc0c6e44ab17cbd96c38" - integrity sha512-dETI+CeKMwu5Dpvu8BrQtex6nwzbNWKQkXseiM5x6+Wf3j9RD2NVpAMBRMjLkw1XlC9Whz1egxLSgKlMKbjg0w== - dependencies: - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - -"@parcel/transformer-raw@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-raw/-/transformer-raw-2.15.4.tgz#e00a50a2f68057c1000b81aea299971296219272" - integrity sha512-pY2j09UCW2v1fwQtVLlCztSdPOxhq0YcWmTHCk/mRp8zuUR+eyHgsz48FrUxRF7cr/EBjc0zlFcregRMRcaTMg== - dependencies: - "@parcel/plugin" "2.15.4" - -"@parcel/transformer-react-refresh-wrap@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-react-refresh-wrap/-/transformer-react-refresh-wrap-2.15.4.tgz#a75c49ce57c5b3150511a1f4046d3562a5962648" - integrity sha512-MgoQrV8+BVjrczAns5ZZbTERGB3/U4MaCBmbg3CuiTiIyS8IJQnGi+OhYRdKAB4NlsgpMZ5T2JrRbQUIm9MM8Q== - dependencies: - "@parcel/error-overlay" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/utils" "2.15.4" - react-refresh "^0.16.0" - -"@parcel/transformer-svg@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/transformer-svg/-/transformer-svg-2.15.4.tgz#969e8c9bda3070e5a331f05873a14f68f9bc5349" - integrity sha512-Q22e0VRbx62VXFlvJWIlc8ihlLaPQgtnAZz5E1/+ojiNb+k0PmIRjNJclVWPF6IdCsLO5tnGfUOaXe2OnZz28Q== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/plugin" "2.15.4" - "@parcel/rust" "2.15.4" - -"@parcel/types-internal@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/types-internal/-/types-internal-2.15.4.tgz#50b192656a2b2b3d9e01d764038101218bd0ae6b" - integrity sha512-kl5QEZ8PTWRvMkwmk7IG3VpP/5/MSGwt9Nrj9ctXLdZkDdXZpK7IbXAthLQ4zrByMaqZULL2IyDuBqBgfuAqlQ== - dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/feature-flags" "2.15.4" + "@parcel/diagnostic" "2.16.0" + "@parcel/feature-flags" "2.16.0" "@parcel/source-map" "^2.1.1" utility-types "^3.11.0" -"@parcel/types@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/types/-/types-2.15.4.tgz#736a42f81c3f3e3bd1ab7e3c374c123d60ec05fa" - integrity sha512-fS3UMMinLtzn/NTSx/qx38saBgRniylldh0XZEUcGeME4D2Llu/QlLv+YZ/LJqrFci3fPRM+YAn2K+JT/u+/0w== +"@parcel/types@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/types/-/types-2.16.0.tgz#aa0877b3c3c4df2eed700f04238df0534c1d1ce2" + integrity sha512-EKsMTqqfiutQIiYKHEJHHeugIymPqM+D+CphhyewAIjxVLk6PTjEQW0ytIbbdOXGAgnK60OFiIKqZAxZ5Hf2dw== dependencies: - "@parcel/types-internal" "2.15.4" - "@parcel/workers" "2.15.4" + "@parcel/types-internal" "2.16.0" + "@parcel/workers" "2.16.0" -"@parcel/utils@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/utils/-/utils-2.15.4.tgz#5471ac633a202aa5861b80eae5d917065ed86465" - integrity sha512-29m09sfPx0GHnmy1kkZ5XezprepdFGKKKUEJkyiYA4ERf55jjdnU2/GP4sWlZXxjh2Y+JFoCAFlCamEClq/8eA== +"@parcel/utils@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/utils/-/utils-2.16.0.tgz#97fe4023cb68b915173379bf8da05ad1f81ae7f5" + integrity sha512-Jc5npvJ5T45goEIbDwsQKX3AtfhLIF2t6G496XhbjcH3aeFLrnIbg1iaitQWvgxdjrt73h8PPNphDkREZ/H7WA== dependencies: - "@parcel/codeframe" "2.15.4" - "@parcel/diagnostic" "2.15.4" - "@parcel/logger" "2.15.4" - "@parcel/markdown-ansi" "2.15.4" - "@parcel/rust" "2.15.4" + "@parcel/codeframe" "2.16.0" + "@parcel/diagnostic" "2.16.0" + "@parcel/logger" "2.16.0" + "@parcel/markdown-ansi" "2.16.0" + "@parcel/rust" "2.16.0" "@parcel/source-map" "^2.1.1" chalk "^4.1.2" nullthrows "^1.1.1" @@ -1099,16 +712,16 @@ "@parcel/watcher-win32-ia32" "2.5.1" "@parcel/watcher-win32-x64" "2.5.1" -"@parcel/workers@2.15.4": - version "2.15.4" - resolved "https://registry.yarnpkg.com/@parcel/workers/-/workers-2.15.4.tgz#e4a3897e2a730a709d5dab53d75a578d4dc9542b" - integrity sha512-wZ/5/mfjs5aeqhXY0c6fwuaBFeNpOXoOq2CKPSMDXt+GX2u/9/1bpVxN9XeGTAJO+ZD++CLq0hyzTnIHy58nyw== +"@parcel/workers@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/workers/-/workers-2.16.0.tgz#bbc8d5a365a6001a7a51173667610cece65cb16c" + integrity sha512-JVdAtTWRONbP4X8Me1qRE5sMGIkSKAcUb8fZdjCUPJxsBwcJwzYicYFuahxVVGj2sYzjLi0TzlvmXMK7tVvffA== dependencies: - "@parcel/diagnostic" "2.15.4" - "@parcel/logger" "2.15.4" - "@parcel/profiler" "2.15.4" - "@parcel/types-internal" "2.15.4" - "@parcel/utils" "2.15.4" + "@parcel/diagnostic" "2.16.0" + "@parcel/logger" "2.16.0" + "@parcel/profiler" "2.16.0" + "@parcel/types-internal" "2.16.0" + "@parcel/utils" "2.16.0" nullthrows "^1.1.1" "@rollup/rollup-android-arm-eabi@4.50.2": @@ -1290,13 +903,6 @@ resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== -"@swc/helpers@^0.5.0": - version "0.5.17" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.17.tgz#5a7be95ac0f0bf186e7e6e890e7a6f6cda6ce971" - integrity sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A== - dependencies: - tslib "^2.8.0" - "@swc/types@^0.1.24": version "0.1.25" resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.25.tgz#b517b2a60feb37dd933e542d93093719e4cf1078" @@ -1656,9 +1262,9 @@ base-x@^3.0.11: safe-buffer "^5.0.1" baseline-browser-mapping@^2.8.3: - version "2.8.5" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.5.tgz#3147fe6b01a0c49ce1952daebcfc2057fc43fedb" - integrity sha512-TiU4qUT9jdCuh4aVOG7H1QozyeI2sZRqoRPdqBIaslfNt4WUSanRBueAwl2x5jt4rXBMim3lIN2x6yT8PDi24Q== + version "2.8.6" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.6.tgz#c37dea4291ed8d01682f85661dbe87967028642e" + integrity sha512-wrH5NNqren/QMtKUEEJf7z86YjfqW/2uw3IL3/xpqZUC95SSVIFXYQeeGjL6FT/X68IROu6RMehZQS5foy2BXw== brace-expansion@^1.1.7: version "1.1.12" @@ -1709,7 +1315,7 @@ chalk@^4.0.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chrome-trace-event@^1.0.2, chrome-trace-event@^1.0.3: +chrome-trace-event@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== @@ -1740,11 +1346,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@^12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" - integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== - commander@^14.0.1: version "14.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-14.0.1.tgz#2f9225c19e6ebd0dc4404dd45821b2caa17ea09b" @@ -1796,7 +1397,7 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== -detect-libc@^2.0.1, detect-libc@^2.0.3: +detect-libc@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.0.tgz#3ca811f60a7b504b0480e5008adacc660b0b8c4f" integrity sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg== @@ -1814,9 +1415,9 @@ dotenv@^16.4.5, dotenv@^16.5.0: integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow== electron-to-chromium@^1.5.218: - version "1.5.221" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.221.tgz#bd98014b2a247701c4ebd713080448d539545d79" - integrity sha512-/1hFJ39wkW01ogqSyYoA4goOXOtMRy6B+yvA1u42nnsEGtHzIzmk93aPISumVQeblj47JUHLC9coCjUxb1EvtQ== + version "1.5.222" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.222.tgz#965c93783ad989116b74593ae3068b9466fdb237" + integrity sha512-gA7psSwSwQRE60CEoLz6JBCQPIxNeuzB2nL8vE03GK/OHxlvykbLyeiumQy1iH5C2f3YbRAZpGCMT12a/9ih9w== emoji-regex@^8.0.0: version "8.0.0" @@ -2076,11 +1677,6 @@ fsevents@~2.3.2, fsevents@~2.3.3: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== -get-port@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" - integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== - get-tsconfig@^4.10.1: version "4.10.1" resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.1.tgz#d34c1c01f47d65a606c37aa7a177bc3e56ab4b2e" @@ -2100,13 +1696,6 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -globals@^13.24.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" - globals@^14.0.0: version "14.0.0" resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" @@ -2127,11 +1716,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -husky@^9.1.7: - version "9.1.7" - resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d" - integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== - ignore@^5.2.0: version "5.3.2" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" @@ -2238,74 +1822,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lightningcss-darwin-arm64@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz#3d47ce5e221b9567c703950edf2529ca4a3700ae" - integrity sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ== - -lightningcss-darwin-x64@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz#e81105d3fd6330860c15fe860f64d39cff5fbd22" - integrity sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA== - -lightningcss-freebsd-x64@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz#a0e732031083ff9d625c5db021d09eb085af8be4" - integrity sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig== - -lightningcss-linux-arm-gnueabihf@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz#1f5ecca6095528ddb649f9304ba2560c72474908" - integrity sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q== - -lightningcss-linux-arm64-gnu@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz#eee7799726103bffff1e88993df726f6911ec009" - integrity sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw== - -lightningcss-linux-arm64-musl@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz#f2e4b53f42892feeef8f620cbb889f7c064a7dfe" - integrity sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ== - -lightningcss-linux-x64-gnu@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz#2fc7096224bc000ebb97eea94aea248c5b0eb157" - integrity sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw== - -lightningcss-linux-x64-musl@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz#66dca2b159fd819ea832c44895d07e5b31d75f26" - integrity sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ== - -lightningcss-win32-arm64-msvc@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz#7d8110a19d7c2d22bfdf2f2bb8be68e7d1b69039" - integrity sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA== - -lightningcss-win32-x64-msvc@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz#fd7dd008ea98494b85d24b4bea016793f2e0e352" - integrity sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg== - -lightningcss@^1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.30.1.tgz#78e979c2d595bfcb90d2a8c0eb632fe6c5bfed5d" - integrity sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg== - dependencies: - detect-libc "^2.0.3" - optionalDependencies: - lightningcss-darwin-arm64 "1.30.1" - lightningcss-darwin-x64 "1.30.1" - lightningcss-freebsd-x64 "1.30.1" - lightningcss-linux-arm-gnueabihf "1.30.1" - lightningcss-linux-arm64-gnu "1.30.1" - lightningcss-linux-arm64-musl "1.30.1" - lightningcss-linux-x64-gnu "1.30.1" - lightningcss-linux-x64-musl "1.30.1" - lightningcss-win32-arm64-msvc "1.30.1" - lightningcss-win32-x64-msvc "1.30.1" - lmdb@2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.8.5.tgz#ce191110c755c0951caa062722e300c703973837" @@ -2491,27 +2007,6 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" -parcel@^2.15.4: - version "2.15.4" - resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.15.4.tgz#f4038e7bb08b74bae6313306e86e0ff9fbacee13" - integrity sha512-eZHQ/omuQ7yBYB9XezyzSqhc826oy/uhloCNiej1CTZ+twAqJVtp4MRvTGMcivKhE+WE8QkYD5XkJHLLQsJQcg== - dependencies: - "@parcel/config-default" "2.15.4" - "@parcel/core" "2.15.4" - "@parcel/diagnostic" "2.15.4" - "@parcel/events" "2.15.4" - "@parcel/feature-flags" "2.15.4" - "@parcel/fs" "2.15.4" - "@parcel/logger" "2.15.4" - "@parcel/package-manager" "2.15.4" - "@parcel/reporter-cli" "2.15.4" - "@parcel/reporter-dev-server" "2.15.4" - "@parcel/reporter-tracer" "2.15.4" - "@parcel/utils" "2.15.4" - chalk "^4.1.2" - commander "^12.1.0" - get-port "^4.2.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2544,11 +2039,6 @@ picomatch@^4.0.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== -postcss-value-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - postcss@^8.5.6: version "8.5.6" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" @@ -2580,16 +2070,6 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -react-refresh@^0.16.0: - version "0.16.0" - resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.16.0.tgz#e7d45625f05c9709466d09348a25d22f79b2ad23" - integrity sha512-FPvF2XxTSikpJxcr+bHut2H4gJ17+18Uy20D5/F+SKzFap62R3cM5wH6b8WN3LyGSYeQilLEcJcR1fjBSI2S1A== - -regenerator-runtime@^0.14.1: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" @@ -2737,11 +2217,6 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.3.tgz#4b67b635b2d97578a06a2713d2f04800c237e99b" integrity sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg== -term-size@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - terser-webpack-plugin@^5.3.11: version "5.3.14" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" @@ -2778,7 +2253,7 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tslib@^2.4.0, tslib@^2.8.0: +tslib@^2.4.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -2790,11 +2265,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - undici-types@~7.12.0: version "7.12.0" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.12.0.tgz#15c5c7475c2a3ba30659529f5cdb4674b622fafb" @@ -2847,10 +2317,10 @@ utility-types@^3.11.0: resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c" integrity sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw== -vite@^7.1.5: - version "7.1.5" - resolved "https://registry.yarnpkg.com/vite/-/vite-7.1.5.tgz#4dbcb48c6313116689be540466fc80faa377be38" - integrity sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ== +vite@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/vite/-/vite-7.1.6.tgz#336806d29983135677f498a05efb0fd46c5eef2d" + integrity sha512-SRYIB8t/isTwNn8vMB3MR6E+EQZM/WG1aKmmIUCfDXfVvKfc20ZpamngWHKzAmmu9ppsgxsg4b2I7c90JZudIQ== dependencies: esbuild "^0.25.0" fdir "^6.5.0" From f0134ebbfc052b3f28293eba7e326b393aa558c6 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Thu, 18 Sep 2025 20:07:03 -0400 Subject: [PATCH 5/5] parcel fix --- .github/measure.yml | 2 +- package.json | 2 +- src/bundlers/parcel.mjs | 7 +- src/core/cli.mjs | 1 + yarn.lock | 533 +++++++++++++++++++++++++++++++++++++++- 5 files changed, 538 insertions(+), 7 deletions(-) diff --git a/.github/measure.yml b/.github/measure.yml index 539033ee87..94f45064f0 100644 --- a/.github/measure.yml +++ b/.github/measure.yml @@ -26,7 +26,7 @@ jobs: cache: "yarn" - name: Add and install Dependencies - run: yarn add ${{ github.event.inputs.versions || "webpack@latest vite@latest @parcel/core@latest esbuild@latest" }} + run: yarn add ${{ github.event.inputs.versions || "webpack@latest vite@latest parcel@latest esbuild@latest" }} - name: Run benchmark run: yarn start --reporter json diff --git a/package.json b/package.json index 6a2604c477..0f5d78caba 100644 --- a/package.json +++ b/package.json @@ -27,11 +27,11 @@ "start": "node ./src/core/cli.mjs" }, "dependencies": { - "@parcel/core": "^2.16.0", "cli-table3": "^0.6.5", "commander": "^14.0.1", "consola": "^3.4.2", "esbuild": "^0.25.10", + "parcel": "^2.16.0", "vite": "^7.1.6", "webpack": "^5.101.3" }, diff --git a/src/bundlers/parcel.mjs b/src/bundlers/parcel.mjs index 5de366903c..f560c966b2 100644 --- a/src/bundlers/parcel.mjs +++ b/src/bundlers/parcel.mjs @@ -36,5 +36,10 @@ export async function build(fixture) { export async function clean(fixture) { const outputPath = path.join(fixture, OUTPUT_DIR); await removeIfExists(outputPath); - await removeIfExists(".parcel-cache"); + + try { + await removeIfExists(".parcel-cache"); + } catch { + // If this fails to delete, it's okay + } } diff --git a/src/core/cli.mjs b/src/core/cli.mjs index 7985e25769..3969b9df68 100644 --- a/src/core/cli.mjs +++ b/src/core/cli.mjs @@ -10,6 +10,7 @@ new Command() "vite", "webpack", "esbuild", + "parcel" ]) .option("-m, --metrics ", "Choose metrics to collect", [ "build-time", diff --git a/yarn.lock b/yarn.lock index f73e953bee..9129a5e40b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -384,6 +384,18 @@ "@emnapi/runtime" "^1.4.3" "@tybys/wasm-util" "^0.10.0" +"@parcel/bundler-default@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/bundler-default/-/bundler-default-2.16.0.tgz#e4cad2143891f85a874e001736348a66b08d71c5" + integrity sha512-8kY+TUhir7qm+TgSMeMd8CP2PVoZjXamiZ8+mbXws4jKw6IrIVDQf8TkBZKGk7ncKJEteiX4ybbmiPjho8cHuA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/graph" "3.6.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + nullthrows "^1.1.1" + "@parcel/cache@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/cache/-/cache-2.16.0.tgz#15d94f879167191736345f6838f17c4d6deab6f2" @@ -401,7 +413,52 @@ dependencies: chalk "^4.1.2" -"@parcel/core@^2.16.0": +"@parcel/compressor-raw@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/compressor-raw/-/compressor-raw-2.16.0.tgz#7375f1e2e41605b55fdca491a8a5d4b4348507da" + integrity sha512-tl8/iCPlInfD3YLo1s/kA9/o7XdrYNBuGsAj4VOFqplH+2FINb48XPzp7Z4VGOB2q8qokt2gohTGfuNPGIX2pw== + dependencies: + "@parcel/plugin" "2.16.0" + +"@parcel/config-default@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/config-default/-/config-default-2.16.0.tgz#fbebfe5176a839c8388a69a9d615ba8b3a714782" + integrity sha512-az5gWXyztHekV1Dpz3nNT3iz5SqHh2924XCb2w+VyNDtnLhLNQ+X7NJd0na+EbWd9KBJYEdVYDPVDy1bEei0lQ== + dependencies: + "@parcel/bundler-default" "2.16.0" + "@parcel/compressor-raw" "2.16.0" + "@parcel/namer-default" "2.16.0" + "@parcel/optimizer-css" "2.16.0" + "@parcel/optimizer-html" "2.16.0" + "@parcel/optimizer-image" "2.16.0" + "@parcel/optimizer-svg" "2.16.0" + "@parcel/optimizer-swc" "2.16.0" + "@parcel/packager-css" "2.16.0" + "@parcel/packager-html" "2.16.0" + "@parcel/packager-js" "2.16.0" + "@parcel/packager-raw" "2.16.0" + "@parcel/packager-svg" "2.16.0" + "@parcel/packager-wasm" "2.16.0" + "@parcel/reporter-dev-server" "2.16.0" + "@parcel/resolver-default" "2.16.0" + "@parcel/runtime-browser-hmr" "2.16.0" + "@parcel/runtime-js" "2.16.0" + "@parcel/runtime-rsc" "2.16.0" + "@parcel/runtime-service-worker" "2.16.0" + "@parcel/transformer-babel" "2.16.0" + "@parcel/transformer-css" "2.16.0" + "@parcel/transformer-html" "2.16.0" + "@parcel/transformer-image" "2.16.0" + "@parcel/transformer-js" "2.16.0" + "@parcel/transformer-json" "2.16.0" + "@parcel/transformer-node" "2.16.0" + "@parcel/transformer-postcss" "2.16.0" + "@parcel/transformer-posthtml" "2.16.0" + "@parcel/transformer-raw" "2.16.0" + "@parcel/transformer-react-refresh-wrap" "2.16.0" + "@parcel/transformer-svg" "2.16.0" + +"@parcel/core@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/core/-/core-2.16.0.tgz#8704402887017e41754879174d2af65f94655f26" integrity sha512-erH9GdLe8Boie0mCO8hXn8Qt/pCACsOFlKp8UHNMlPaizUtCDkCOQqwmSi+VyrJ3dMMCOc/qBwTSGAJaJE8/Kw== @@ -440,6 +497,11 @@ "@mischnic/json-sourcemap" "^0.1.1" nullthrows "^1.1.1" +"@parcel/error-overlay@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/error-overlay/-/error-overlay-2.16.0.tgz#66d50062f432bd8213b51615ecc778cecbf8f855" + integrity sha512-ZcXOZc548Tjms0z7uaE4iUKHul32CpX5dCnEdum9PExxCLNCCxm4JgoO+dWeZXjNQDi8Opz9N3GU4wnF7WVzhg== + "@parcel/events@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/events/-/events-2.16.0.tgz#a1f17bfa4402b84d732bd21b408a3d9ee1e968b3" @@ -485,6 +547,15 @@ dependencies: chalk "^4.1.2" +"@parcel/namer-default@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/namer-default/-/namer-default-2.16.0.tgz#c4c6a6153b24722ae30a3dacdcecacd67ffc15ad" + integrity sha512-pRb6Bz32Xl65CZ1LzKAa8ADGyPyrJ724tq2IToqH5JQ8bFGNXF7Tg/qrv582CjHS5dJb/HB7LizfWaliHiG5DA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + nullthrows "^1.1.1" + "@parcel/node-resolver-core@3.7.0": version "3.7.0" resolved "https://registry.yarnpkg.com/@parcel/node-resolver-core/-/node-resolver-core-3.7.0.tgz#ac76d222dc0a570ca142c4ee0c1d61a6f92104c9" @@ -498,6 +569,60 @@ nullthrows "^1.1.1" semver "^7.7.1" +"@parcel/optimizer-css@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-css/-/optimizer-css-2.16.0.tgz#63b3ffe09da5ed17875d816efb1635994b4c3eef" + integrity sha512-QTrMOVknU4DmKzmnTxQx69ZZxoDYyTIWhpflDLSvUaLSXk2yi0SMBMcsEdA0W4bhORn6nj8toGwi04vbGVuQtA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + browserslist "^4.24.5" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/optimizer-html@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-html/-/optimizer-html-2.16.0.tgz#36d99ba3d142996aa92711e12a388c2271f6fb4c" + integrity sha512-T8VvsdCwLb/l3a/eHF2lJfeGO6Z4znKjvnBAvtyLwtFVVNnJasJLo9Cuan4bcnVM8etzbxjg1Qs/9c1hzWsBYg== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/optimizer-image@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-image/-/optimizer-image-2.16.0.tgz#38ebe9e2ce12cb14b352692185dcde1884bf260f" + integrity sha512-CVAitXbtKfVxxmOjieeI/YSwSFKx+In3MjP4jFpuYwgDT0TsgsyweBkADQMfEcBjeIPiCXLzzf/GSVIDY7hgwA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + "@parcel/workers" "2.16.0" + +"@parcel/optimizer-svg@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-svg/-/optimizer-svg-2.16.0.tgz#cc313395043e5e701a949230583e52c8d8f6072f" + integrity sha512-fx9VK28bXaFz0dWs3rIOQM0t8nAWXE62o4JIcIAZND5/6ij1y4/Fap791agvH4SKxNPFu/a/KEmF50SRfcSwkw== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/optimizer-swc@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-swc/-/optimizer-swc-2.16.0.tgz#c002218c319f209d22ebd91490bcad6caefe27b7" + integrity sha512-AwakRkMBzDWNrXbm5eJtuBvjCSyp6J730MCltZtiSWLtFbvkXMCt1BQ6Ug91NHq/zA2HTo3RYh96wTMRSRQa2w== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + "@swc/core" "^1.11.24" + nullthrows "^1.1.1" + "@parcel/package-manager@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/package-manager/-/package-manager-2.16.0.tgz#0d7f21a9a6e920753858703123217047aef56f8a" @@ -513,6 +638,66 @@ "@swc/core" "^1.11.24" semver "^7.7.1" +"@parcel/packager-css@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-css/-/packager-css-2.16.0.tgz#92f1228770750e9798e08e6cd880cc8f4c7b36c7" + integrity sha512-T36uCm/RUZ6h33O8NsjOoTH0if/FWyXuBWenVeQgQZrlYR+wZBsZSV8CElBMCmrFJ5BdSG1RybXPwvkATpJeig== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/packager-html@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-html/-/packager-html-2.16.0.tgz#70d453adfb3aaaf9a0d0504aec275ad7b97d34a6" + integrity sha512-d9NBtvJAGM8shnLfwDwF0VMP5P2F5Euvjbrv4FaqbivypzDBhjalE+EnC6eGtLNTCTg9o1CxxZmsTC/FVdu2yQ== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/packager-js@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-js/-/packager-js-2.16.0.tgz#3e72d4adc1906ea09c17e9f15cad64a6b6594294" + integrity sha512-2YHeFFFsh8KSqlfMfGVlAsDjwHZkGp99GRN+WnGAHlYzmDODve92yb94d5Zs22cDRzP6v/E5NMTYWu1dlUg/Wg== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + globals "^13.24.0" + nullthrows "^1.1.1" + +"@parcel/packager-raw@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-raw/-/packager-raw-2.16.0.tgz#07e6c36c9ca05cde02a45f2fa4b943355c418593" + integrity sha512-jY/t/PXpNTK6EwLBSTJPGTB8FYmhqHtj4Am/JVQkJkxgB8h8diivxsReZYNfDt9J9pVxSk+lcZCdOZXf1ZtmWw== + dependencies: + "@parcel/plugin" "2.16.0" + +"@parcel/packager-svg@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-svg/-/packager-svg-2.16.0.tgz#a5ba481921c91af0acb4a79eda6dbe199aabb37c" + integrity sha512-NVmpVjRe2Lr7htrxsscy4ExSRUN+YiMvPmxp9ZxoDnrGerqa66B5/Rh7HOhx7Vo9wuH5LCpFAWYhgkhXH6qrqQ== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/packager-wasm@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/packager-wasm/-/packager-wasm-2.16.0.tgz#ad9deee4869eeaa647c27391ac61eefe44f9b743" + integrity sha512-r+oCqaFfUB1f6CEQyWbkAjwfGrt2flNA3JguBJ8zCyDrx3fWI+isYufg2CP92ZJyOBTIU63iCi88YgcMLynL1g== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/plugin@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/plugin/-/plugin-2.16.0.tgz#7e80d2c5d562daf7a938f1006d4f2d34498bc0c8" @@ -530,6 +715,82 @@ "@parcel/types-internal" "2.16.0" chrome-trace-event "^1.0.2" +"@parcel/reporter-cli@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/reporter-cli/-/reporter-cli-2.16.0.tgz#603ad4287646cf1b6c8603648baf9bf4e15c5769" + integrity sha512-76U06/aSGTO8UTEBJb+tIvNAH/2aOfWVTsP4QQym//Lf8fmXJnLaCDsJmiNAXjW44rnzjNQ7qzRrbwH7W5u7FA== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/types" "2.16.0" + "@parcel/utils" "2.16.0" + chalk "^4.1.2" + term-size "^2.2.1" + +"@parcel/reporter-dev-server@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/reporter-dev-server/-/reporter-dev-server-2.16.0.tgz#3838fcce3aaa32ad0fa03f7475f5a044354dbbb7" + integrity sha512-n5XXh1S/oMQ8ItSm/nG5sPFb+1WBZPGtvDUd8gxvmO8lfZ7fo53l0TS5KshMvNqx0F208Erwi+/II78piqCrYA== + dependencies: + "@parcel/codeframe" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + +"@parcel/reporter-tracer@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/reporter-tracer/-/reporter-tracer-2.16.0.tgz#7814324c53d664b26f042921db3a2d3aed6c03e8" + integrity sha512-OHNQiz9c2F7nak8ztkuK+9ui9e5f9Qz5uEYPNHssyEIj4zLeenhnFEVSzUVXJdrqY0A3+xE8bFuQLi+PS+nbFQ== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + chrome-trace-event "^1.0.3" + nullthrows "^1.1.1" + +"@parcel/resolver-default@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/resolver-default/-/resolver-default-2.16.0.tgz#10f39144bfdf5f08890ac0f64998e91bd63706b7" + integrity sha512-HvzVXPn8j/ElbNkqAHa7wHOzqCWTwAEv4pWJVnguuqL9m7ZC2INDsp3XJR1LOA5UqBYRhkBrvWK69v4sA21a9w== + dependencies: + "@parcel/node-resolver-core" "3.7.0" + "@parcel/plugin" "2.16.0" + +"@parcel/runtime-browser-hmr@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/runtime-browser-hmr/-/runtime-browser-hmr-2.16.0.tgz#a79605f93345ee193dce83c267577ad456501bc4" + integrity sha512-tRPoFwUVtzE7ufOtIr1CHdh8SH3772FI1JlFCV0//tEWbj9iSk1bcK0g05Yj4dW4hW2SjqTcVo59Kw50Zeh7/Q== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/runtime-js@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/runtime-js/-/runtime-js-2.16.0.tgz#aabed946200721af85a47381a2e6f7736733b396" + integrity sha512-othbtwC7AG3SnDkzGpRXEwsY2/+INydJXSORogTEN/GSUQyci606pTfuU/eF9D22wVDdaVSYUhhJPTDdxksu9w== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + nullthrows "^1.1.1" + +"@parcel/runtime-rsc@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/runtime-rsc/-/runtime-rsc-2.16.0.tgz#f24378eda61b16b00b0fda1ca632ac3f3a5b4d4c" + integrity sha512-5T+mNRrsA9zxkbdaV4rxqRc7CJP77/oNpajDPWcBWDELM8q42be0Sr5zYoAG28jcnQBf88u2rqPVpNtNxoM/ZA== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + nullthrows "^1.1.1" + +"@parcel/runtime-service-worker@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/runtime-service-worker/-/runtime-service-worker-2.16.0.tgz#ddf3546faa1ef5ab235d2efc5d1686f4c6f37376" + integrity sha512-YOkWJbY08IiUXUSudPwJXJKn7CycTCSzsfbhdG+bhvVdPWGv7DpMoPDSq3IL9/99JZe7iXcOnibxCmoJqZA6WQ== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + nullthrows "^1.1.1" + "@parcel/rust-darwin-arm64@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/rust-darwin-arm64/-/rust-darwin-arm64-2.16.0.tgz#e624187ef241c4b3f9a41fc42f289d5de08ead3f" @@ -591,6 +852,132 @@ dependencies: detect-libc "^1.0.3" +"@parcel/transformer-babel@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-babel/-/transformer-babel-2.16.0.tgz#18eaa7e8b0af0a83623b92b3a791e97c2e18ff3f" + integrity sha512-jlaFyGlRKFbAI8370bcuEzmsZENqdw9ATCowpB/XkKgUlYe6iplMlKLy4EquqSR6axqfxBRMoSCcKFkROuLI9g== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + browserslist "^4.24.5" + json5 "^2.2.3" + nullthrows "^1.1.1" + semver "^7.7.1" + +"@parcel/transformer-css@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-css/-/transformer-css-2.16.0.tgz#a42c87f03dc194bc813fb3ecf584f570c3ee7bec" + integrity sha512-WSUITzJl2/2uU04WnCLAwhZJ8RAaRvNQ64fMr4LauWa72gzqXgh3+1egddBiAT7e5IndVJ0AYFywLBVegwKOOA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + browserslist "^4.24.5" + lightningcss "^1.30.1" + nullthrows "^1.1.1" + +"@parcel/transformer-html@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-html/-/transformer-html-2.16.0.tgz#c09d9852da4a1b6cfaeb1ac9ed2462680c242a81" + integrity sha512-CKAoB5yOovL3GyZlnm7lRUa3IfaSS/bEjjTy6F6RU7G4sMRgJu16AQfI4/uTJAA6iuW1ugNyza2DhWQ9xfbhaw== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + +"@parcel/transformer-image@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-image/-/transformer-image-2.16.0.tgz#0f863bf9328464eb04d766cb3dded83f9e1975b9" + integrity sha512-sW4CM6P2YMUyAICCMocTLvVVqnxmlBwkP+SrIZvNElDUu0CygOa92cA3rdepHi+tF1GN6ZvNwNyQbZGAIKVxgw== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + "@parcel/workers" "2.16.0" + nullthrows "^1.1.1" + +"@parcel/transformer-js@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-js/-/transformer-js-2.16.0.tgz#eb7e210e382b1950cf41e3ed8c580e380fe8a494" + integrity sha512-VRTFEJ/N13MFvwJPwilPET6gHJ0ZdFbCK26uO7uyL1eMGMvWStTXEQXvhLqtMfvDcQPnwkF5XGJL5JsGpcBFFA== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/source-map" "^2.1.1" + "@parcel/utils" "2.16.0" + "@parcel/workers" "2.16.0" + "@swc/helpers" "^0.5.0" + browserslist "^4.24.5" + nullthrows "^1.1.1" + regenerator-runtime "^0.14.1" + semver "^7.7.1" + +"@parcel/transformer-json@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-json/-/transformer-json-2.16.0.tgz#e176541ec5910926e5e2731f9104ed169f871287" + integrity sha512-qX6Zg+j7HezY+W2TNjJ+VPUsIviNdTuMn39W9M0YEd0WLKh0x7XD4oprVivvgD0Vbm04FUcTQEN1jAF3CAVeGw== + dependencies: + "@parcel/plugin" "2.16.0" + json5 "^2.2.3" + +"@parcel/transformer-node@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-node/-/transformer-node-2.16.0.tgz#9e2c32ea9f9e1ca14e4cbdedd2404b3f2c5254b5" + integrity sha512-Mavmjj6SfP0Lhu751G47EFtExZIJyD+V2C5PzdATTaT+cw0MzQgfLH8s4p0CI27MAuyFesm8WTA0lgUtcfzMSw== + dependencies: + "@parcel/plugin" "2.16.0" + +"@parcel/transformer-postcss@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-postcss/-/transformer-postcss-2.16.0.tgz#48d6da4394198091b5a530d8661e630e9f78907e" + integrity sha512-h+Qnn49UE5RywpuXMHN8Iufjvc7MMqHQc0sPNvwoLBXJXJcb3ul7WEY+DGXs90KsUY1B6JAqKtz9+pzqXZMwIg== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/utils" "2.16.0" + clone "^2.1.2" + nullthrows "^1.1.1" + postcss-value-parser "^4.2.0" + semver "^7.7.1" + +"@parcel/transformer-posthtml@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-posthtml/-/transformer-posthtml-2.16.0.tgz#bf624b578d7e877c724c0930aa299ec757641c44" + integrity sha512-mvHQNzFO1xPq+/7McjxF7+Zb2zAgksNbSXKi8/OuMRiNO3eDD/r1jWRWKNQZHWUkSx/vS7JJ5Y1ACI5INLxWww== + dependencies: + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + +"@parcel/transformer-raw@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-raw/-/transformer-raw-2.16.0.tgz#757546aeb0d50a2727a46c6f85cc7d0b6a50072c" + integrity sha512-LJXwH2rQAo6mOU6uG0IGQIN7KLC2sS8bl6aqf1YMcKk6ZEvylQkP0hUvRYja2IRzPoxjpdcAP5WC4e/Z8S1Vzg== + dependencies: + "@parcel/plugin" "2.16.0" + +"@parcel/transformer-react-refresh-wrap@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-react-refresh-wrap/-/transformer-react-refresh-wrap-2.16.0.tgz#8c14c7dbdfaf528c9ebd71a4d077142c5626e2d7" + integrity sha512-s6O5oJ0pUtZey6unI0mz2WIOpAVLCn5+hlou4YH7FXOiMvSJ2PU2rakk+EZk6K/R+TStYM0hQKSwJkiiN0m7Rg== + dependencies: + "@parcel/error-overlay" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/utils" "2.16.0" + react-refresh "^0.16.0" + +"@parcel/transformer-svg@2.16.0": + version "2.16.0" + resolved "https://registry.yarnpkg.com/@parcel/transformer-svg/-/transformer-svg-2.16.0.tgz#f17e4905053de7a5b0b242e9317f70049aa39f76" + integrity sha512-c4KpIqqbsvsh/ZxLTo0d7/IEVa/jR/+LZ1kFzBWXKvMBzbvqo63J6s3VGk61gPFV9JkSW3UI5LAMbJn/HDXycw== + dependencies: + "@parcel/diagnostic" "2.16.0" + "@parcel/plugin" "2.16.0" + "@parcel/rust" "2.16.0" + "@parcel/types-internal@2.16.0": version "2.16.0" resolved "https://registry.yarnpkg.com/@parcel/types-internal/-/types-internal-2.16.0.tgz#0476cfdcc80ab53bae0ab660ba1932e0c6943d0a" @@ -903,6 +1290,13 @@ resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== +"@swc/helpers@^0.5.0": + version "0.5.17" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.17.tgz#5a7be95ac0f0bf186e7e6e890e7a6f6cda6ce971" + integrity sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A== + dependencies: + tslib "^2.8.0" + "@swc/types@^0.1.24": version "0.1.25" resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.25.tgz#b517b2a60feb37dd933e542d93093719e4cf1078" @@ -1315,7 +1709,7 @@ chalk@^4.0.0, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chrome-trace-event@^1.0.2: +chrome-trace-event@^1.0.2, chrome-trace-event@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== @@ -1346,6 +1740,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +commander@^12.1.0: + version "12.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3" + integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA== + commander@^14.0.1: version "14.0.1" resolved "https://registry.yarnpkg.com/commander/-/commander-14.0.1.tgz#2f9225c19e6ebd0dc4404dd45821b2caa17ea09b" @@ -1397,7 +1796,7 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== -detect-libc@^2.0.1: +detect-libc@^2.0.1, detect-libc@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.0.tgz#3ca811f60a7b504b0480e5008adacc660b0b8c4f" integrity sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg== @@ -1677,6 +2076,11 @@ fsevents@~2.3.2, fsevents@~2.3.3: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== +get-port@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" + integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== + get-tsconfig@^4.10.1: version "4.10.1" resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.10.1.tgz#d34c1c01f47d65a606c37aa7a177bc3e56ab4b2e" @@ -1696,6 +2100,13 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +globals@^13.24.0: + version "13.24.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== + dependencies: + type-fest "^0.20.2" + globals@^14.0.0: version "14.0.0" resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" @@ -1822,6 +2233,74 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lightningcss-darwin-arm64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz#3d47ce5e221b9567c703950edf2529ca4a3700ae" + integrity sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ== + +lightningcss-darwin-x64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz#e81105d3fd6330860c15fe860f64d39cff5fbd22" + integrity sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA== + +lightningcss-freebsd-x64@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz#a0e732031083ff9d625c5db021d09eb085af8be4" + integrity sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig== + +lightningcss-linux-arm-gnueabihf@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz#1f5ecca6095528ddb649f9304ba2560c72474908" + integrity sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q== + +lightningcss-linux-arm64-gnu@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz#eee7799726103bffff1e88993df726f6911ec009" + integrity sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw== + +lightningcss-linux-arm64-musl@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz#f2e4b53f42892feeef8f620cbb889f7c064a7dfe" + integrity sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ== + +lightningcss-linux-x64-gnu@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz#2fc7096224bc000ebb97eea94aea248c5b0eb157" + integrity sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw== + +lightningcss-linux-x64-musl@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz#66dca2b159fd819ea832c44895d07e5b31d75f26" + integrity sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ== + +lightningcss-win32-arm64-msvc@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz#7d8110a19d7c2d22bfdf2f2bb8be68e7d1b69039" + integrity sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA== + +lightningcss-win32-x64-msvc@1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz#fd7dd008ea98494b85d24b4bea016793f2e0e352" + integrity sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg== + +lightningcss@^1.30.1: + version "1.30.1" + resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.30.1.tgz#78e979c2d595bfcb90d2a8c0eb632fe6c5bfed5d" + integrity sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg== + dependencies: + detect-libc "^2.0.3" + optionalDependencies: + lightningcss-darwin-arm64 "1.30.1" + lightningcss-darwin-x64 "1.30.1" + lightningcss-freebsd-x64 "1.30.1" + lightningcss-linux-arm-gnueabihf "1.30.1" + lightningcss-linux-arm64-gnu "1.30.1" + lightningcss-linux-arm64-musl "1.30.1" + lightningcss-linux-x64-gnu "1.30.1" + lightningcss-linux-x64-musl "1.30.1" + lightningcss-win32-arm64-msvc "1.30.1" + lightningcss-win32-x64-msvc "1.30.1" + lmdb@2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/lmdb/-/lmdb-2.8.5.tgz#ce191110c755c0951caa062722e300c703973837" @@ -2007,6 +2486,27 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +parcel@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.16.0.tgz#f5c65f1d56b6d4271939caf10df29ab911d140be" + integrity sha512-4sgnoYixTR6Qq6265tjmufXQj7wxvZo4VJHrYfbnfWQWfW5CgF80IiM+dy050pYgtBAMvh+8vJDDYiSto1YPUA== + dependencies: + "@parcel/config-default" "2.16.0" + "@parcel/core" "2.16.0" + "@parcel/diagnostic" "2.16.0" + "@parcel/events" "2.16.0" + "@parcel/feature-flags" "2.16.0" + "@parcel/fs" "2.16.0" + "@parcel/logger" "2.16.0" + "@parcel/package-manager" "2.16.0" + "@parcel/reporter-cli" "2.16.0" + "@parcel/reporter-dev-server" "2.16.0" + "@parcel/reporter-tracer" "2.16.0" + "@parcel/utils" "2.16.0" + chalk "^4.1.2" + commander "^12.1.0" + get-port "^4.2.0" + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -2039,6 +2539,11 @@ picomatch@^4.0.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== +postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + postcss@^8.5.6: version "8.5.6" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" @@ -2070,6 +2575,16 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" +react-refresh@^0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.16.0.tgz#e7d45625f05c9709466d09348a25d22f79b2ad23" + integrity sha512-FPvF2XxTSikpJxcr+bHut2H4gJ17+18Uy20D5/F+SKzFap62R3cM5wH6b8WN3LyGSYeQilLEcJcR1fjBSI2S1A== + +regenerator-runtime@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" @@ -2217,6 +2732,11 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.3.tgz#4b67b635b2d97578a06a2713d2f04800c237e99b" integrity sha512-ZL6DDuAlRlLGghwcfmSn9sK3Hr6ArtyudlSAiCqQ6IfE+b+HHbydbYDIG15IfS5do+7XQQBdBiubF/cV2dnDzg== +term-size@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" + integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== + terser-webpack-plugin@^5.3.11: version "5.3.14" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" @@ -2253,7 +2773,7 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tslib@^2.4.0: +tslib@^2.4.0, tslib@^2.8.0: version "2.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== @@ -2265,6 +2785,11 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + undici-types@~7.12.0: version "7.12.0" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.12.0.tgz#15c5c7475c2a3ba30659529f5cdb4674b622fafb"