three-stdlib 2.22.10 → 2.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_polyfill/CompressedArrayTexture.cjs +12 -0
- package/dist/_polyfill/CompressedArrayTexture.js +6 -6
- package/dist/_polyfill/Data3DTexture.cjs +17 -0
- package/dist/_polyfill/Data3DTexture.js +8 -8
- package/dist/animation/{AnimationClipCreator.mjs → AnimationClipCreator.cjs} +18 -18
- package/dist/animation/AnimationClipCreator.js +18 -18
- package/dist/animation/{CCDIKSolver.mjs → CCDIKSolver.cjs} +32 -32
- package/dist/animation/CCDIKSolver.js +32 -32
- package/dist/animation/{MMDAnimationHelper.mjs → MMDAnimationHelper.cjs} +17 -17
- package/dist/animation/MMDAnimationHelper.js +17 -17
- package/dist/animation/{MMDPhysics.mjs → MMDPhysics.cjs} +25 -25
- package/dist/animation/MMDPhysics.js +25 -25
- package/dist/cameras/{CinematicCamera.mjs → CinematicCamera.cjs} +17 -17
- package/dist/cameras/CinematicCamera.js +17 -17
- package/dist/controls/{ArcballControls.mjs → ArcballControls.cjs} +102 -102
- package/dist/controls/ArcballControls.js +102 -102
- package/dist/controls/{DeviceOrientationControls.mjs → DeviceOrientationControls.cjs} +14 -14
- package/dist/controls/DeviceOrientationControls.js +14 -14
- package/dist/controls/{DragControls.mjs → DragControls.cjs} +12 -12
- package/dist/controls/DragControls.js +12 -12
- package/dist/controls/{FirstPersonControls.mjs → FirstPersonControls.cjs} +16 -16
- package/dist/controls/FirstPersonControls.js +16 -16
- package/dist/controls/{FlyControls.mjs → FlyControls.cjs} +10 -10
- package/dist/controls/FlyControls.js +10 -10
- package/dist/controls/{OrbitControls.mjs → OrbitControls.cjs} +52 -54
- package/dist/controls/OrbitControls.d.ts +4 -4
- package/dist/controls/OrbitControls.js +52 -54
- package/dist/controls/{PointerLockControls.mjs → PointerLockControls.cjs} +8 -8
- package/dist/controls/PointerLockControls.js +8 -8
- package/dist/controls/{TrackballControls.mjs → TrackballControls.cjs} +32 -32
- package/dist/controls/TrackballControls.d.ts +2 -2
- package/dist/controls/TrackballControls.js +32 -32
- package/dist/controls/{TransformControls.mjs → TransformControls.cjs} +169 -169
- package/dist/controls/TransformControls.js +169 -169
- package/dist/controls/experimental/{CameraControls.mjs → CameraControls.cjs} +59 -59
- package/dist/controls/experimental/CameraControls.js +59 -59
- package/dist/csm/{CSM.mjs → CSM.cjs} +17 -17
- package/dist/csm/CSM.js +17 -17
- package/dist/csm/{CSMFrustum.mjs → CSMFrustum.cjs} +7 -7
- package/dist/csm/CSMFrustum.js +7 -7
- package/dist/csm/{CSMHelper.mjs → CSMHelper.cjs} +14 -14
- package/dist/csm/CSMHelper.js +14 -14
- package/dist/csm/{CSMShader.mjs → CSMShader.cjs} +5 -5
- package/dist/csm/CSMShader.js +5 -5
- package/dist/curves/{CurveExtras.mjs → CurveExtras.cjs} +45 -45
- package/dist/curves/CurveExtras.js +45 -45
- package/dist/curves/{NURBSCurve.mjs → NURBSCurve.cjs} +11 -11
- package/dist/curves/NURBSCurve.js +11 -11
- package/dist/curves/{NURBSSurface.mjs → NURBSSurface.cjs} +7 -7
- package/dist/curves/NURBSSurface.js +7 -7
- package/dist/curves/{NURBSUtils.mjs → NURBSUtils.cjs} +17 -17
- package/dist/curves/NURBSUtils.js +17 -17
- package/dist/deprecated/{Geometry.mjs → Geometry.cjs} +51 -51
- package/dist/deprecated/Geometry.js +51 -51
- package/dist/effects/{AnaglyphEffect.mjs → AnaglyphEffect.cjs} +14 -14
- package/dist/effects/AnaglyphEffect.js +14 -14
- package/dist/effects/{AsciiEffect.mjs → AsciiEffect.cjs} +3 -3
- package/dist/effects/AsciiEffect.js +3 -3
- package/dist/effects/{OutlineEffect.mjs → OutlineEffect.cjs} +8 -8
- package/dist/effects/OutlineEffect.js +8 -8
- package/dist/effects/{ParallaxBarrierEffect.mjs → ParallaxBarrierEffect.cjs} +12 -12
- package/dist/effects/ParallaxBarrierEffect.js +12 -12
- package/dist/effects/{PeppersGhostEffect.mjs → PeppersGhostEffect.cjs} +11 -11
- package/dist/effects/PeppersGhostEffect.js +11 -11
- package/dist/effects/{StereoEffect.mjs → StereoEffect.cjs} +6 -6
- package/dist/effects/StereoEffect.js +6 -6
- package/dist/environments/RoomEnvironment.cjs +95 -0
- package/dist/environments/RoomEnvironment.js +23 -40
- package/dist/exporters/{ColladaExporter.mjs → ColladaExporter.cjs} +16 -16
- package/dist/exporters/ColladaExporter.js +16 -16
- package/dist/exporters/{DRACOExporter.mjs → DRACOExporter.cjs} +8 -8
- package/dist/exporters/DRACOExporter.js +8 -8
- package/dist/exporters/{GLTFExporter.mjs → GLTFExporter.cjs} +52 -49
- package/dist/exporters/GLTFExporter.js +52 -49
- package/dist/exporters/{MMDExporter.mjs → MMDExporter.cjs} +10 -10
- package/dist/exporters/MMDExporter.js +10 -10
- package/dist/exporters/{OBJExporter.mjs → OBJExporter.cjs} +13 -13
- package/dist/exporters/OBJExporter.js +13 -13
- package/dist/exporters/{PLYExporter.mjs → PLYExporter.cjs} +8 -8
- package/dist/exporters/PLYExporter.js +8 -8
- package/dist/exporters/{STLExporter.mjs → STLExporter.cjs} +12 -12
- package/dist/exporters/STLExporter.js +12 -12
- package/dist/exporters/{USDZExporter.mjs → USDZExporter.cjs} +10 -10
- package/dist/exporters/USDZExporter.js +10 -10
- package/dist/geometries/{BoxLineGeometry.mjs → BoxLineGeometry.cjs} +6 -6
- package/dist/geometries/BoxLineGeometry.js +6 -6
- package/dist/geometries/ConvexGeometry.cjs +26 -0
- package/dist/geometries/ConvexGeometry.js +9 -9
- package/dist/geometries/{DecalGeometry.mjs → DecalGeometry.cjs} +16 -16
- package/dist/geometries/DecalGeometry.js +16 -16
- package/dist/geometries/{LightningStrike.mjs → LightningStrike.cjs} +45 -45
- package/dist/geometries/LightningStrike.js +45 -45
- package/dist/geometries/{ParametricGeometries.mjs → ParametricGeometries.cjs} +11 -11
- package/dist/geometries/ParametricGeometries.js +11 -11
- package/dist/geometries/{ParametricGeometry.mjs → ParametricGeometry.cjs} +11 -11
- package/dist/geometries/ParametricGeometry.js +11 -11
- package/dist/geometries/{RoundedBoxGeometry.mjs → RoundedBoxGeometry.cjs} +10 -10
- package/dist/geometries/RoundedBoxGeometry.js +10 -10
- package/dist/geometries/{TeapotGeometry.mjs → TeapotGeometry.cjs} +21 -21
- package/dist/geometries/TeapotGeometry.js +21 -21
- package/dist/geometries/{TextGeometry.mjs → TextGeometry.cjs} +6 -6
- package/dist/geometries/TextGeometry.js +6 -6
- package/dist/helpers/{LightProbeHelper.mjs → LightProbeHelper.cjs} +7 -7
- package/dist/helpers/LightProbeHelper.js +7 -7
- package/dist/helpers/{PositionalAudioHelper.mjs → PositionalAudioHelper.cjs} +11 -11
- package/dist/helpers/PositionalAudioHelper.js +11 -11
- package/dist/helpers/{RectAreaLightHelper.mjs → RectAreaLightHelper.cjs} +11 -11
- package/dist/helpers/RectAreaLightHelper.js +11 -11
- package/dist/helpers/{VertexNormalsHelper.mjs → VertexNormalsHelper.cjs} +11 -11
- package/dist/helpers/VertexNormalsHelper.js +11 -11
- package/dist/helpers/{VertexTangentsHelper.mjs → VertexTangentsHelper.cjs} +10 -10
- package/dist/helpers/VertexTangentsHelper.js +10 -10
- package/dist/index.cjs +613 -0
- package/dist/index.js +613 -613
- package/dist/interactive/{HTMLMesh.mjs → HTMLMesh.cjs} +11 -11
- package/dist/interactive/HTMLMesh.js +11 -11
- package/dist/interactive/{InteractiveGroup.mjs → InteractiveGroup.cjs} +8 -8
- package/dist/interactive/InteractiveGroup.js +8 -8
- package/dist/interactive/{SelectionBox.mjs → SelectionBox.cjs} +21 -21
- package/dist/interactive/SelectionBox.js +21 -21
- package/dist/interactive/{SelectionHelper.mjs → SelectionHelper.cjs} +7 -7
- package/dist/interactive/SelectionHelper.js +7 -7
- package/dist/libs/{MeshoptDecoder.mjs → MeshoptDecoder.cjs} +3 -3
- package/dist/libs/MeshoptDecoder.js +3 -3
- package/dist/libs/{MotionControllers.mjs → MotionControllers.cjs} +6 -6
- package/dist/libs/MotionControllers.js +6 -6
- package/dist/lights/{LightProbeGenerator.mjs → LightProbeGenerator.cjs} +16 -16
- package/dist/lights/LightProbeGenerator.js +16 -16
- package/dist/lights/{RectAreaLightUniformsLib.mjs → RectAreaLightUniformsLib.cjs} +42 -42
- package/dist/lights/RectAreaLightUniformsLib.js +42 -42
- package/dist/lines/Line2.cjs +13 -0
- package/dist/lines/Line2.js +8 -8
- package/dist/lines/{LineGeometry.mjs → LineGeometry.cjs} +5 -5
- package/dist/lines/LineGeometry.js +5 -5
- package/dist/lines/{LineMaterial.mjs → LineMaterial.cjs} +10 -10
- package/dist/lines/LineMaterial.js +10 -10
- package/dist/lines/{LineSegments2.mjs → LineSegments2.cjs} +28 -28
- package/dist/lines/LineSegments2.js +28 -28
- package/dist/lines/{LineSegmentsGeometry.mjs → LineSegmentsGeometry.cjs} +18 -18
- package/dist/lines/LineSegmentsGeometry.js +18 -18
- package/dist/lines/Wireframe.cjs +32 -0
- package/dist/lines/Wireframe.js +13 -13
- package/dist/lines/WireframeGeometry2.cjs +13 -0
- package/dist/lines/WireframeGeometry2.js +7 -7
- package/dist/loaders/{3DMLoader.mjs → 3DMLoader.cjs} +37 -37
- package/dist/loaders/3DMLoader.js +37 -37
- package/dist/loaders/{3MFLoader.mjs → 3MFLoader.cjs} +53 -53
- package/dist/loaders/3MFLoader.js +53 -53
- package/dist/loaders/{AMFLoader.mjs → AMFLoader.cjs} +19 -19
- package/dist/loaders/AMFLoader.js +19 -19
- package/dist/loaders/{AssimpLoader.mjs → AssimpLoader.cjs} +41 -41
- package/dist/loaders/AssimpLoader.js +41 -41
- package/dist/loaders/{BVHLoader.mjs → BVHLoader.cjs} +18 -18
- package/dist/loaders/BVHLoader.js +18 -18
- package/dist/loaders/{BasisTextureLoader.mjs → BasisTextureLoader.cjs} +22 -22
- package/dist/loaders/BasisTextureLoader.js +22 -22
- package/dist/loaders/{ColladaLoader.mjs → ColladaLoader.cjs} +76 -76
- package/dist/loaders/ColladaLoader.js +76 -76
- package/dist/loaders/{DDSLoader.mjs → DDSLoader.cjs} +10 -10
- package/dist/loaders/DDSLoader.js +10 -10
- package/dist/loaders/{DRACOLoader.mjs → DRACOLoader.cjs} +12 -12
- package/dist/loaders/DRACOLoader.js +12 -12
- package/dist/loaders/{EXRLoader.mjs → EXRLoader.cjs} +23 -23
- package/dist/loaders/EXRLoader.js +23 -23
- package/dist/loaders/{FBXLoader.mjs → FBXLoader.cjs} +116 -116
- package/dist/loaders/FBXLoader.js +116 -116
- package/dist/loaders/{FontLoader.mjs → FontLoader.cjs} +9 -9
- package/dist/loaders/FontLoader.js +9 -9
- package/dist/loaders/{GCodeLoader.mjs → GCodeLoader.cjs} +13 -13
- package/dist/loaders/GCodeLoader.js +13 -13
- package/dist/loaders/{GLTFLoader.mjs → GLTFLoader.cjs} +112 -112
- package/dist/loaders/GLTFLoader.js +112 -112
- package/dist/loaders/{HDRCubeTextureLoader.mjs → HDRCubeTextureLoader.cjs} +15 -15
- package/dist/loaders/HDRCubeTextureLoader.js +15 -15
- package/dist/loaders/{KMZLoader.mjs → KMZLoader.cjs} +13 -13
- package/dist/loaders/KMZLoader.js +13 -13
- package/dist/loaders/{KTX2Loader.mjs → KTX2Loader.cjs} +65 -65
- package/dist/loaders/KTX2Loader.js +65 -65
- package/dist/loaders/{KTXLoader.mjs → KTXLoader.cjs} +5 -5
- package/dist/loaders/KTXLoader.js +5 -5
- package/dist/loaders/{LDrawLoader.mjs → LDrawLoader.cjs} +39 -39
- package/dist/loaders/LDrawLoader.js +39 -39
- package/dist/loaders/{LUT3dlLoader.mjs → LUT3dlLoader.cjs} +22 -22
- package/dist/loaders/LUT3dlLoader.js +22 -22
- package/dist/loaders/{LUTCubeLoader.mjs → LUTCubeLoader.cjs} +22 -22
- package/dist/loaders/LUTCubeLoader.js +22 -22
- package/dist/loaders/{LWOLoader.mjs → LWOLoader.cjs} +42 -42
- package/dist/loaders/LWOLoader.js +42 -42
- package/dist/loaders/{LottieLoader.mjs → LottieLoader.cjs} +8 -8
- package/dist/loaders/LottieLoader.js +8 -8
- package/dist/loaders/{MD2Loader.mjs → MD2Loader.cjs} +15 -15
- package/dist/loaders/MD2Loader.js +15 -15
- package/dist/loaders/{MDDLoader.mjs → MDDLoader.cjs} +9 -9
- package/dist/loaders/MDDLoader.js +9 -9
- package/dist/loaders/{MMDLoader.mjs → MMDLoader.cjs} +59 -59
- package/dist/loaders/MMDLoader.js +59 -59
- package/dist/loaders/{MTLLoader.mjs → MTLLoader.cjs} +17 -17
- package/dist/loaders/MTLLoader.js +17 -17
- package/dist/loaders/{NRRDLoader.mjs → NRRDLoader.cjs} +17 -17
- package/dist/loaders/NRRDLoader.js +17 -17
- package/dist/loaders/{OBJLoader.mjs → OBJLoader.cjs} +37 -37
- package/dist/loaders/OBJLoader.js +37 -37
- package/dist/loaders/{PCDLoader.mjs → PCDLoader.cjs} +13 -13
- package/dist/loaders/PCDLoader.js +13 -13
- package/dist/loaders/{PDBLoader.mjs → PDBLoader.cjs} +11 -11
- package/dist/loaders/PDBLoader.js +11 -11
- package/dist/loaders/{PLYLoader.mjs → PLYLoader.cjs} +13 -13
- package/dist/loaders/PLYLoader.js +13 -13
- package/dist/loaders/{PRWMLoader.mjs → PRWMLoader.cjs} +9 -9
- package/dist/loaders/PRWMLoader.js +9 -9
- package/dist/loaders/{PVRLoader.mjs → PVRLoader.cjs} +11 -11
- package/dist/loaders/PVRLoader.js +11 -11
- package/dist/loaders/{RGBELoader.mjs → RGBELoader.cjs} +18 -18
- package/dist/loaders/RGBELoader.js +18 -18
- package/dist/loaders/{RGBMLoader.mjs → RGBMLoader.cjs} +16 -16
- package/dist/loaders/RGBMLoader.js +16 -16
- package/dist/loaders/{STLLoader.mjs → STLLoader.cjs} +15 -15
- package/dist/loaders/STLLoader.js +15 -15
- package/dist/loaders/{SVGLoader.mjs → SVGLoader.cjs} +55 -55
- package/dist/loaders/SVGLoader.js +55 -55
- package/dist/loaders/{TDSLoader.mjs → TDSLoader.cjs} +20 -20
- package/dist/loaders/TDSLoader.js +20 -20
- package/dist/loaders/{TGALoader.mjs → TGALoader.cjs} +6 -6
- package/dist/loaders/TGALoader.js +6 -6
- package/dist/loaders/{TTFLoader.mjs → TTFLoader.cjs} +9 -9
- package/dist/loaders/TTFLoader.js +9 -9
- package/dist/loaders/{TiltLoader.mjs → TiltLoader.cjs} +26 -26
- package/dist/loaders/TiltLoader.js +26 -26
- package/dist/loaders/{VOXLoader.mjs → VOXLoader.cjs} +18 -18
- package/dist/loaders/VOXLoader.js +18 -18
- package/dist/loaders/{VRMLLoader.mjs → VRMLLoader.cjs} +125 -125
- package/dist/loaders/VRMLLoader.js +125 -125
- package/dist/loaders/{VRMLoader.mjs → VRMLoader.cjs} +7 -7
- package/dist/loaders/VRMLoader.js +7 -7
- package/dist/loaders/{VTKLoader.mjs → VTKLoader.cjs} +24 -24
- package/dist/loaders/VTKLoader.js +24 -24
- package/dist/loaders/{XLoader.mjs → XLoader.cjs} +42 -42
- package/dist/loaders/XLoader.js +42 -42
- package/dist/loaders/{XYZLoader.mjs → XYZLoader.cjs} +9 -9
- package/dist/loaders/XYZLoader.js +9 -9
- package/dist/loaders/lwo/{IFFParser.mjs → IFFParser.cjs} +7 -7
- package/dist/loaders/lwo/IFFParser.js +7 -7
- package/dist/loaders/lwo/{LWO2Parser.mjs → LWO2Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO2Parser.js +3 -3
- package/dist/loaders/lwo/{LWO3Parser.mjs → LWO3Parser.cjs} +3 -3
- package/dist/loaders/lwo/LWO3Parser.js +3 -3
- package/dist/math/{Capsule.mjs → Capsule.cjs} +8 -8
- package/dist/math/Capsule.js +8 -8
- package/dist/math/{ColorConverter.mjs → ColorConverter.cjs} +7 -7
- package/dist/math/ColorConverter.js +7 -7
- package/dist/math/{ConvexHull.mjs → ConvexHull.cjs} +18 -18
- package/dist/math/ConvexHull.js +18 -18
- package/dist/math/{ImprovedNoise.mjs → ImprovedNoise.cjs} +3 -3
- package/dist/math/ImprovedNoise.js +3 -3
- package/dist/math/{Lut.mjs → Lut.cjs} +14 -14
- package/dist/math/Lut.js +14 -14
- package/dist/math/{MeshSurfaceSampler.mjs → MeshSurfaceSampler.cjs} +6 -6
- package/dist/math/MeshSurfaceSampler.js +6 -6
- package/dist/math/{OBB.mjs → OBB.cjs} +21 -21
- package/dist/math/OBB.js +21 -21
- package/dist/math/{Octree.mjs → Octree.cjs} +19 -19
- package/dist/math/Octree.js +19 -19
- package/dist/math/{SimplexNoise.mjs → SimplexNoise.cjs} +3 -3
- package/dist/math/SimplexNoise.js +3 -3
- package/dist/misc/{ConvexObjectBreaker.mjs → ConvexObjectBreaker.cjs} +25 -25
- package/dist/misc/ConvexObjectBreaker.js +25 -25
- package/dist/misc/{GPUComputationRenderer.mjs → GPUComputationRenderer.cjs} +19 -19
- package/dist/misc/GPUComputationRenderer.js +19 -19
- package/dist/misc/{Gyroscope.mjs → Gyroscope.cjs} +11 -11
- package/dist/misc/Gyroscope.js +11 -11
- package/dist/misc/{MD2Character.mjs → MD2Character.cjs} +14 -14
- package/dist/misc/MD2Character.js +14 -14
- package/dist/misc/{MD2CharacterComplex.mjs → MD2CharacterComplex.cjs} +20 -20
- package/dist/misc/MD2CharacterComplex.js +20 -20
- package/dist/misc/{MorphAnimMesh.mjs → MorphAnimMesh.cjs} +8 -8
- package/dist/misc/MorphAnimMesh.js +8 -8
- package/dist/misc/{MorphBlendMesh.mjs → MorphBlendMesh.cjs} +6 -6
- package/dist/misc/MorphBlendMesh.js +6 -6
- package/dist/misc/{ProgressiveLightmap.mjs → ProgressiveLightmap.cjs} +17 -17
- package/dist/misc/ProgressiveLightmap.js +17 -17
- package/dist/misc/{RollerCoaster.mjs → RollerCoaster.cjs} +77 -77
- package/dist/misc/RollerCoaster.js +77 -77
- package/dist/misc/{Timer.mjs → Timer.cjs} +3 -3
- package/dist/misc/Timer.js +3 -3
- package/dist/misc/{TubePainter.mjs → TubePainter.cjs} +24 -24
- package/dist/misc/TubePainter.js +24 -24
- package/dist/misc/{Volume.mjs → Volume.cjs} +18 -18
- package/dist/misc/Volume.js +18 -18
- package/dist/misc/{VolumeSlice.mjs → VolumeSlice.cjs} +10 -10
- package/dist/misc/VolumeSlice.js +10 -10
- package/dist/misc/{WebGL.mjs → WebGL.cjs} +7 -7
- package/dist/misc/WebGL.js +7 -7
- package/dist/modifiers/{CurveModifier.mjs → CurveModifier.cjs} +17 -17
- package/dist/modifiers/CurveModifier.js +17 -17
- package/dist/modifiers/{EdgeSplitModifier.mjs → EdgeSplitModifier.cjs} +12 -13
- package/dist/modifiers/EdgeSplitModifier.js +13 -12
- package/dist/modifiers/{SimplifyModifier.mjs → SimplifyModifier.cjs} +12 -12
- package/dist/modifiers/SimplifyModifier.js +12 -12
- package/dist/modifiers/{TessellateModifier.mjs → TessellateModifier.cjs} +30 -30
- package/dist/modifiers/TessellateModifier.js +30 -30
- package/dist/objects/{GroundProjectedEnv.mjs → GroundProjectedEnv.cjs} +8 -8
- package/dist/objects/GroundProjectedEnv.js +8 -8
- package/dist/objects/{Lensflare.mjs → Lensflare.cjs} +37 -37
- package/dist/objects/Lensflare.js +37 -37
- package/dist/objects/{LightningStorm.mjs → LightningStorm.cjs} +17 -17
- package/dist/objects/LightningStorm.js +17 -17
- package/dist/objects/{MarchingCubes.mjs → MarchingCubes.cjs} +21 -21
- package/dist/objects/MarchingCubes.js +21 -21
- package/dist/objects/{Reflector.mjs → Reflector.cjs} +23 -23
- package/dist/objects/Reflector.js +23 -23
- package/dist/objects/{ReflectorForSSRPass.mjs → ReflectorForSSRPass.cjs} +33 -33
- package/dist/objects/ReflectorForSSRPass.js +33 -33
- package/dist/objects/ReflectorRTT.cjs +10 -0
- package/dist/objects/ReflectorRTT.js +5 -5
- package/dist/objects/{Refractor.mjs → Refractor.cjs} +26 -26
- package/dist/objects/Refractor.js +26 -26
- package/dist/objects/{ShadowMesh.mjs → ShadowMesh.cjs} +9 -9
- package/dist/objects/ShadowMesh.js +9 -9
- package/dist/objects/{Sky.mjs → Sky.cjs} +11 -11
- package/dist/objects/Sky.js +11 -11
- package/dist/objects/{Water.mjs → Water.cjs} +33 -33
- package/dist/objects/Water.js +33 -33
- package/dist/objects/{Water2.mjs → Water2.cjs} +20 -20
- package/dist/objects/Water2.js +20 -20
- package/dist/physics/{AmmoPhysics.mjs → AmmoPhysics.cjs} +3 -3
- package/dist/physics/AmmoPhysics.js +3 -3
- package/dist/postprocessing/{AdaptiveToneMappingPass.mjs → AdaptiveToneMappingPass.cjs} +32 -32
- package/dist/postprocessing/AdaptiveToneMappingPass.js +32 -32
- package/dist/postprocessing/{AfterimagePass.mjs → AfterimagePass.cjs} +21 -21
- package/dist/postprocessing/AfterimagePass.js +21 -21
- package/dist/postprocessing/{BloomPass.mjs → BloomPass.cjs} +20 -20
- package/dist/postprocessing/BloomPass.js +20 -20
- package/dist/postprocessing/{BokehPass.mjs → BokehPass.cjs} +19 -19
- package/dist/postprocessing/BokehPass.js +19 -19
- package/dist/postprocessing/{ClearPass.mjs → ClearPass.cjs} +7 -7
- package/dist/postprocessing/ClearPass.js +7 -7
- package/dist/postprocessing/{CubeTexturePass.mjs → CubeTexturePass.cjs} +14 -14
- package/dist/postprocessing/CubeTexturePass.js +14 -14
- package/dist/postprocessing/{DotScreenPass.mjs → DotScreenPass.cjs} +12 -12
- package/dist/postprocessing/DotScreenPass.js +12 -12
- package/dist/postprocessing/{EffectComposer.mjs → EffectComposer.cjs} +20 -20
- package/dist/postprocessing/EffectComposer.js +20 -20
- package/dist/postprocessing/{FilmPass.mjs → FilmPass.cjs} +12 -12
- package/dist/postprocessing/FilmPass.js +12 -12
- package/dist/postprocessing/{GlitchPass.mjs → GlitchPass.cjs} +26 -26
- package/dist/postprocessing/GlitchPass.js +26 -26
- package/dist/postprocessing/{HalftonePass.mjs → HalftonePass.cjs} +13 -13
- package/dist/postprocessing/HalftonePass.js +13 -13
- package/dist/postprocessing/{LUTPass.mjs → LUTPass.cjs} +5 -5
- package/dist/postprocessing/LUTPass.js +5 -5
- package/dist/postprocessing/{MaskPass.mjs → MaskPass.cjs} +7 -7
- package/dist/postprocessing/MaskPass.js +7 -7
- package/dist/postprocessing/{OutlinePass.mjs → OutlinePass.cjs} +45 -45
- package/dist/postprocessing/OutlinePass.js +45 -45
- package/dist/postprocessing/{Pass.mjs → Pass.cjs} +8 -8
- package/dist/postprocessing/Pass.js +8 -8
- package/dist/postprocessing/{RenderPass.mjs → RenderPass.cjs} +7 -7
- package/dist/postprocessing/RenderPass.js +7 -7
- package/dist/postprocessing/{RenderPixelatedPass.mjs → RenderPixelatedPass.cjs} +18 -18
- package/dist/postprocessing/RenderPixelatedPass.js +18 -18
- package/dist/postprocessing/{SAOPass.mjs → SAOPass.cjs} +69 -69
- package/dist/postprocessing/SAOPass.js +69 -69
- package/dist/postprocessing/{SMAAPass.mjs → SMAAPass.cjs} +30 -30
- package/dist/postprocessing/SMAAPass.js +30 -30
- package/dist/postprocessing/{SSAARenderPass.mjs → SSAARenderPass.cjs} +19 -19
- package/dist/postprocessing/SSAARenderPass.js +19 -19
- package/dist/postprocessing/{SSAOPass.mjs → SSAOPass.cjs} +63 -63
- package/dist/postprocessing/SSAOPass.js +63 -63
- package/dist/postprocessing/{SSRPass.mjs → SSRPass.cjs} +86 -86
- package/dist/postprocessing/SSRPass.js +86 -86
- package/dist/postprocessing/{SavePass.mjs → SavePass.cjs} +13 -13
- package/dist/postprocessing/SavePass.js +13 -13
- package/dist/postprocessing/{ShaderPass.mjs → ShaderPass.cjs} +10 -10
- package/dist/postprocessing/ShaderPass.js +10 -10
- package/dist/postprocessing/{TAARenderPass.mjs → TAARenderPass.cjs} +8 -8
- package/dist/postprocessing/TAARenderPass.js +8 -8
- package/dist/postprocessing/{TexturePass.mjs → TexturePass.cjs} +11 -11
- package/dist/postprocessing/TexturePass.js +11 -11
- package/dist/postprocessing/{UnrealBloomPass.mjs → UnrealBloomPass.cjs} +36 -36
- package/dist/postprocessing/UnrealBloomPass.js +36 -36
- package/dist/postprocessing/{WaterPass.mjs → WaterPass.cjs} +10 -10
- package/dist/postprocessing/WaterPass.js +10 -10
- package/dist/renderers/{CSS2DRenderer.mjs → CSS2DRenderer.cjs} +12 -12
- package/dist/renderers/CSS2DRenderer.js +12 -12
- package/dist/renderers/{CSS3DRenderer.mjs → CSS3DRenderer.cjs} +12 -12
- package/dist/renderers/CSS3DRenderer.js +12 -12
- package/dist/renderers/{Projector.mjs → Projector.cjs} +21 -21
- package/dist/renderers/Projector.js +21 -21
- package/dist/renderers/{SVGRenderer.mjs → SVGRenderer.cjs} +12 -12
- package/dist/renderers/SVGRenderer.js +12 -12
- package/dist/shaders/{ACESFilmicToneMappingShader.mjs → ACESFilmicToneMappingShader.cjs} +3 -3
- package/dist/shaders/ACESFilmicToneMappingShader.js +3 -3
- package/dist/shaders/{AfterimageShader.mjs → AfterimageShader.cjs} +3 -3
- package/dist/shaders/AfterimageShader.js +3 -3
- package/dist/shaders/{BasicShader.mjs → BasicShader.cjs} +3 -3
- package/dist/shaders/BasicShader.js +3 -3
- package/dist/shaders/{BleachBypassShader.mjs → BleachBypassShader.cjs} +3 -3
- package/dist/shaders/BleachBypassShader.js +3 -3
- package/dist/shaders/{BlendShader.mjs → BlendShader.cjs} +3 -3
- package/dist/shaders/BlendShader.js +3 -3
- package/dist/shaders/{BokehShader.mjs → BokehShader.cjs} +3 -3
- package/dist/shaders/BokehShader.js +3 -3
- package/dist/shaders/{BokehShader2.mjs → BokehShader2.cjs} +6 -6
- package/dist/shaders/BokehShader2.js +6 -6
- package/dist/shaders/{BrightnessContrastShader.mjs → BrightnessContrastShader.cjs} +3 -3
- package/dist/shaders/BrightnessContrastShader.js +3 -3
- package/dist/shaders/{ColorCorrectionShader.mjs → ColorCorrectionShader.cjs} +7 -7
- package/dist/shaders/ColorCorrectionShader.js +7 -7
- package/dist/shaders/{ColorifyShader.mjs → ColorifyShader.cjs} +5 -5
- package/dist/shaders/ColorifyShader.js +5 -5
- package/dist/shaders/{ConvolutionShader.mjs → ConvolutionShader.cjs} +5 -5
- package/dist/shaders/ConvolutionShader.js +5 -5
- package/dist/shaders/{CopyShader.mjs → CopyShader.cjs} +3 -3
- package/dist/shaders/CopyShader.js +3 -3
- package/dist/shaders/{DOFMipMapShader.mjs → DOFMipMapShader.cjs} +3 -3
- package/dist/shaders/DOFMipMapShader.js +3 -3
- package/dist/shaders/{DepthLimitedBlurShader.mjs → DepthLimitedBlurShader.cjs} +7 -7
- package/dist/shaders/DepthLimitedBlurShader.js +7 -7
- package/dist/shaders/{DigitalGlitch.mjs → DigitalGlitch.cjs} +3 -3
- package/dist/shaders/DigitalGlitch.js +3 -3
- package/dist/shaders/{DotScreenShader.mjs → DotScreenShader.cjs} +6 -6
- package/dist/shaders/DotScreenShader.js +6 -6
- package/dist/shaders/{FXAAShader.mjs → FXAAShader.cjs} +5 -5
- package/dist/shaders/FXAAShader.js +5 -5
- package/dist/shaders/{FilmShader.mjs → FilmShader.cjs} +3 -3
- package/dist/shaders/FilmShader.js +3 -3
- package/dist/shaders/{FocusShader.mjs → FocusShader.cjs} +3 -3
- package/dist/shaders/FocusShader.js +3 -3
- package/dist/shaders/{FreiChenShader.mjs → FreiChenShader.cjs} +5 -5
- package/dist/shaders/FreiChenShader.js +5 -5
- package/dist/shaders/{FresnelShader.mjs → FresnelShader.cjs} +3 -3
- package/dist/shaders/FresnelShader.js +3 -3
- package/dist/shaders/{GammaCorrectionShader.mjs → GammaCorrectionShader.cjs} +3 -3
- package/dist/shaders/GammaCorrectionShader.js +3 -3
- package/dist/shaders/{GodRaysShader.mjs → GodRaysShader.cjs} +11 -11
- package/dist/shaders/GodRaysShader.js +11 -11
- package/dist/shaders/{HalftoneShader.mjs → HalftoneShader.cjs} +3 -3
- package/dist/shaders/HalftoneShader.js +3 -3
- package/dist/shaders/{HorizontalBlurShader.mjs → HorizontalBlurShader.cjs} +3 -3
- package/dist/shaders/HorizontalBlurShader.js +3 -3
- package/dist/shaders/{HorizontalTiltShiftShader.mjs → HorizontalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/HorizontalTiltShiftShader.js +3 -3
- package/dist/shaders/{HueSaturationShader.mjs → HueSaturationShader.cjs} +3 -3
- package/dist/shaders/HueSaturationShader.js +3 -3
- package/dist/shaders/{KaleidoShader.mjs → KaleidoShader.cjs} +3 -3
- package/dist/shaders/KaleidoShader.js +3 -3
- package/dist/shaders/{LuminosityHighPassShader.mjs → LuminosityHighPassShader.cjs} +5 -5
- package/dist/shaders/LuminosityHighPassShader.js +5 -5
- package/dist/shaders/{LuminosityShader.mjs → LuminosityShader.cjs} +3 -3
- package/dist/shaders/LuminosityShader.js +3 -3
- package/dist/shaders/{MirrorShader.mjs → MirrorShader.cjs} +3 -3
- package/dist/shaders/MirrorShader.js +3 -3
- package/dist/shaders/{NormalMapShader.mjs → NormalMapShader.cjs} +6 -6
- package/dist/shaders/NormalMapShader.js +6 -6
- package/dist/shaders/{ParallaxShader.mjs → ParallaxShader.cjs} +3 -3
- package/dist/shaders/ParallaxShader.js +3 -3
- package/dist/shaders/{PixelShader.mjs → PixelShader.cjs} +3 -3
- package/dist/shaders/PixelShader.js +3 -3
- package/dist/shaders/{RGBShiftShader.mjs → RGBShiftShader.cjs} +3 -3
- package/dist/shaders/RGBShiftShader.js +3 -3
- package/dist/shaders/{SAOShader.mjs → SAOShader.cjs} +7 -7
- package/dist/shaders/SAOShader.js +7 -7
- package/dist/shaders/{SMAAShader.mjs → SMAAShader.cjs} +9 -9
- package/dist/shaders/SMAAShader.js +9 -9
- package/dist/shaders/{SSAOShader.mjs → SSAOShader.cjs} +10 -10
- package/dist/shaders/SSAOShader.js +10 -10
- package/dist/shaders/{SSRShader.mjs → SSRShader.cjs} +10 -10
- package/dist/shaders/SSRShader.js +10 -10
- package/dist/shaders/{SepiaShader.mjs → SepiaShader.cjs} +3 -3
- package/dist/shaders/SepiaShader.js +3 -3
- package/dist/shaders/{SobelOperatorShader.mjs → SobelOperatorShader.cjs} +5 -5
- package/dist/shaders/SobelOperatorShader.js +5 -5
- package/dist/shaders/{SubsurfaceScatteringShader.mjs → SubsurfaceScatteringShader.cjs} +13 -13
- package/dist/shaders/SubsurfaceScatteringShader.js +13 -13
- package/dist/shaders/{TechnicolorShader.mjs → TechnicolorShader.cjs} +3 -3
- package/dist/shaders/TechnicolorShader.js +3 -3
- package/dist/shaders/{ToneMapShader.mjs → ToneMapShader.cjs} +3 -3
- package/dist/shaders/ToneMapShader.js +3 -3
- package/dist/shaders/{ToonShader.mjs → ToonShader.cjs} +32 -32
- package/dist/shaders/ToonShader.js +32 -32
- package/dist/shaders/{TriangleBlurShader.mjs → TriangleBlurShader.cjs} +5 -5
- package/dist/shaders/TriangleBlurShader.js +5 -5
- package/dist/shaders/{UnpackDepthRGBAShader.mjs → UnpackDepthRGBAShader.cjs} +3 -3
- package/dist/shaders/UnpackDepthRGBAShader.js +3 -3
- package/dist/shaders/{VerticalBlurShader.mjs → VerticalBlurShader.cjs} +3 -3
- package/dist/shaders/VerticalBlurShader.js +3 -3
- package/dist/shaders/{VerticalTiltShiftShader.mjs → VerticalTiltShiftShader.cjs} +3 -3
- package/dist/shaders/VerticalTiltShiftShader.js +3 -3
- package/dist/shaders/{VignetteShader.mjs → VignetteShader.cjs} +3 -3
- package/dist/shaders/VignetteShader.js +3 -3
- package/dist/shaders/{VolumeShader.mjs → VolumeShader.cjs} +6 -6
- package/dist/shaders/VolumeShader.js +6 -6
- package/dist/shaders/{WaterRefractionShader.mjs → WaterRefractionShader.cjs} +3 -3
- package/dist/shaders/WaterRefractionShader.js +3 -3
- package/dist/shaders/types.cjs +1 -0
- package/dist/shaders/types.js +1 -1
- package/dist/textures/{FlakesTexture.mjs → FlakesTexture.cjs} +3 -3
- package/dist/textures/FlakesTexture.js +3 -3
- package/dist/types/Loader.cjs +26 -0
- package/dist/types/Loader.js +5 -22
- package/dist/types/helpers.cjs +4 -0
- package/dist/types/helpers.js +3 -3
- package/dist/utils/{BufferGeometryUtils.mjs → BufferGeometryUtils.cjs} +41 -41
- package/dist/utils/BufferGeometryUtils.js +41 -41
- package/dist/utils/{GeometryCompressionUtils.mjs → GeometryCompressionUtils.cjs} +94 -94
- package/dist/utils/GeometryCompressionUtils.js +94 -94
- package/dist/utils/{GeometryUtils.mjs → GeometryUtils.cjs} +18 -18
- package/dist/utils/GeometryUtils.js +18 -18
- package/dist/utils/{RoughnessMipmapper.mjs → RoughnessMipmapper.cjs} +13 -13
- package/dist/utils/RoughnessMipmapper.js +13 -13
- package/dist/utils/{SceneUtils.mjs → SceneUtils.cjs} +8 -8
- package/dist/utils/SceneUtils.js +8 -8
- package/dist/utils/{ShadowMapViewer.mjs → ShadowMapViewer.cjs} +18 -18
- package/dist/utils/ShadowMapViewer.js +18 -18
- package/dist/utils/{SkeletonUtils.mjs → SkeletonUtils.cjs} +10 -10
- package/dist/utils/SkeletonUtils.js +10 -10
- package/dist/utils/{UVsDebug.mjs → UVsDebug.cjs} +7 -7
- package/dist/utils/UVsDebug.js +7 -7
- package/dist/utils/{WorkerPool.mjs → WorkerPool.cjs} +3 -3
- package/dist/utils/WorkerPool.js +3 -3
- package/dist/webxr/{ARButton.mjs → ARButton.cjs} +3 -3
- package/dist/webxr/ARButton.js +3 -3
- package/dist/webxr/{OculusHandModel.mjs → OculusHandModel.cjs} +9 -9
- package/dist/webxr/OculusHandModel.js +9 -9
- package/dist/webxr/{OculusHandPointerModel.mjs → OculusHandPointerModel.cjs} +41 -24
- package/dist/webxr/OculusHandPointerModel.js +24 -41
- package/dist/webxr/Text2D.cjs +48 -0
- package/dist/webxr/Text2D.js +9 -26
- package/dist/webxr/{VRButton.mjs → VRButton.cjs} +3 -3
- package/dist/webxr/VRButton.js +3 -3
- package/dist/webxr/{XRControllerModelFactory.mjs → XRControllerModelFactory.cjs} +18 -18
- package/dist/webxr/XRControllerModelFactory.js +18 -18
- package/dist/webxr/{XREstimatedLight.mjs → XREstimatedLight.cjs} +8 -8
- package/dist/webxr/XREstimatedLight.js +8 -8
- package/dist/webxr/{XRHandMeshModel.mjs → XRHandMeshModel.cjs} +5 -5
- package/dist/webxr/XRHandMeshModel.js +5 -5
- package/dist/webxr/{XRHandModelFactory.mjs → XRHandModelFactory.cjs} +10 -10
- package/dist/webxr/XRHandModelFactory.js +10 -10
- package/dist/webxr/{XRHandPrimitiveModel.mjs → XRHandPrimitiveModel.cjs} +11 -11
- package/dist/webxr/XRHandPrimitiveModel.js +11 -11
- package/package.json +3 -3
- package/dist/_polyfill/CompressedArrayTexture.mjs +0 -12
- package/dist/_polyfill/Data3DTexture.mjs +0 -17
- package/dist/environments/RoomEnvironment.mjs +0 -78
- package/dist/geometries/ConvexGeometry.mjs +0 -26
- package/dist/index.mjs +0 -613
- package/dist/lines/Line2.mjs +0 -13
- package/dist/lines/Wireframe.mjs +0 -32
- package/dist/lines/WireframeGeometry2.mjs +0 -13
- package/dist/objects/ReflectorRTT.mjs +0 -10
- package/dist/shaders/types.mjs +0 -1
- package/dist/types/Loader.mjs +0 -9
- package/dist/types/helpers.mjs +0 -4
- package/dist/webxr/Text2D.mjs +0 -31
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
4
|
var __publicField = (obj, key, value) => {
|
|
4
5
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
6
|
return value;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
const THREE = require("three");
|
|
8
10
|
const STATE = {
|
|
9
11
|
IDLE: Symbol(),
|
|
10
12
|
ROTATE: Symbol(),
|
|
@@ -30,13 +32,13 @@ const _center = {
|
|
|
30
32
|
y: 0
|
|
31
33
|
};
|
|
32
34
|
const _transformation = {
|
|
33
|
-
camera: /* @__PURE__ */ new Matrix4(),
|
|
34
|
-
gizmos: /* @__PURE__ */ new Matrix4()
|
|
35
|
+
camera: /* @__PURE__ */ new THREE.Matrix4(),
|
|
36
|
+
gizmos: /* @__PURE__ */ new THREE.Matrix4()
|
|
35
37
|
};
|
|
36
38
|
const _changeEvent = { type: "change" };
|
|
37
39
|
const _startEvent = { type: "start" };
|
|
38
40
|
const _endEvent = { type: "end" };
|
|
39
|
-
class ArcballControls extends EventDispatcher {
|
|
41
|
+
class ArcballControls extends THREE.EventDispatcher {
|
|
40
42
|
constructor(camera, domElement = null, scene = null) {
|
|
41
43
|
super();
|
|
42
44
|
__publicField(this, "camera");
|
|
@@ -137,9 +139,9 @@ class ArcballControls extends EventDispatcher {
|
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
const newRadius = this._tbRadius / scale;
|
|
140
|
-
const curve = new EllipseCurve(0, 0, newRadius, newRadius);
|
|
142
|
+
const curve = new THREE.EllipseCurve(0, 0, newRadius, newRadius);
|
|
141
143
|
const points = curve.getPoints(this._curvePts);
|
|
142
|
-
const curveGeometry = new BufferGeometry().setFromPoints(points);
|
|
144
|
+
const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
143
145
|
for (const gizmo in this._gizmos.children) {
|
|
144
146
|
const child = this._gizmos.children[gizmo];
|
|
145
147
|
child.geometry = curveGeometry;
|
|
@@ -356,10 +358,10 @@ class ArcballControls extends EventDispatcher {
|
|
|
356
358
|
}
|
|
357
359
|
if (this.cursorZoom && this.enablePan) {
|
|
358
360
|
let scalePoint;
|
|
359
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
361
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
360
362
|
scalePoint = (_a = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) == null ? void 0 : _a.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
|
|
361
363
|
}
|
|
362
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
364
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
363
365
|
scalePoint = (_b = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
|
|
364
366
|
}
|
|
365
367
|
if (scalePoint !== void 0)
|
|
@@ -376,7 +378,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
376
378
|
this.dispatchEvent(_endEvent);
|
|
377
379
|
break;
|
|
378
380
|
case "FOV":
|
|
379
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
381
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
380
382
|
this.updateTbState(STATE.FOV, true);
|
|
381
383
|
if (event.deltaX != 0) {
|
|
382
384
|
sgn = event.deltaX / notchDeltaY;
|
|
@@ -390,15 +392,15 @@ class ArcballControls extends EventDispatcher {
|
|
|
390
392
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
391
393
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
392
394
|
let xNew = x / size;
|
|
393
|
-
xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
394
|
-
const y = x * Math.tan(MathUtils.DEG2RAD * this.camera.fov * 0.5);
|
|
395
|
-
let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
395
|
+
xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
396
|
+
const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this.camera.fov * 0.5);
|
|
397
|
+
let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
396
398
|
if (newFov > this.maxFov) {
|
|
397
399
|
newFov = this.maxFov;
|
|
398
400
|
} else if (newFov < this.minFov) {
|
|
399
401
|
newFov = this.minFov;
|
|
400
402
|
}
|
|
401
|
-
const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
|
|
403
|
+
const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
|
|
402
404
|
size = x / newDistance;
|
|
403
405
|
this.setFov(newFov);
|
|
404
406
|
this.applyTransformMatrix(this.applyScale(size, this._gizmos.position, false));
|
|
@@ -471,7 +473,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
471
473
|
case "FOV":
|
|
472
474
|
if (!this.enableZoom)
|
|
473
475
|
return;
|
|
474
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
476
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
475
477
|
if (this._animationId != -1) {
|
|
476
478
|
cancelAnimationFrame(this._animationId);
|
|
477
479
|
this._animationId = -1;
|
|
@@ -611,7 +613,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
611
613
|
}
|
|
612
614
|
break;
|
|
613
615
|
case STATE.FOV:
|
|
614
|
-
if (this.enableZoom && this.camera instanceof PerspectiveCamera) {
|
|
616
|
+
if (this.enableZoom && this.camera instanceof THREE.PerspectiveCamera) {
|
|
615
617
|
if (restart) {
|
|
616
618
|
this.dispatchEvent(_endEvent);
|
|
617
619
|
this.dispatchEvent(_startEvent);
|
|
@@ -635,11 +637,11 @@ class ArcballControls extends EventDispatcher {
|
|
|
635
637
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
636
638
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
637
639
|
let xNew = x / size;
|
|
638
|
-
xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
639
|
-
const y = x * Math.tan(MathUtils.DEG2RAD * this._fovState * 0.5);
|
|
640
|
-
let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
641
|
-
newFov = MathUtils.clamp(newFov, this.minFov, this.maxFov);
|
|
642
|
-
const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
|
|
640
|
+
xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
641
|
+
const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this._fovState * 0.5);
|
|
642
|
+
let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
643
|
+
newFov = THREE.MathUtils.clamp(newFov, this.minFov, this.maxFov);
|
|
644
|
+
const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
|
|
643
645
|
size = x / newDistance;
|
|
644
646
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
645
647
|
this.setFov(newFov);
|
|
@@ -776,12 +778,12 @@ class ArcballControls extends EventDispatcher {
|
|
|
776
778
|
}
|
|
777
779
|
this._currentFingerRotation = this.getAngle(this._touchCurrent[1], this._touchCurrent[0]) + this.getAngle(this._touchStart[1], this._touchStart[0]);
|
|
778
780
|
if (!this.enablePan) {
|
|
779
|
-
rotationPoint = new Vector3().setFromMatrixPosition(this._gizmoMatrixState);
|
|
781
|
+
rotationPoint = new THREE.Vector3().setFromMatrixPosition(this._gizmoMatrixState);
|
|
780
782
|
} else if (this.camera) {
|
|
781
783
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
782
784
|
rotationPoint = (_a = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _a.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._v3_2);
|
|
783
785
|
}
|
|
784
|
-
const amount = MathUtils.DEG2RAD * (this._startFingerRotation - this._currentFingerRotation);
|
|
786
|
+
const amount = THREE.MathUtils.DEG2RAD * (this._startFingerRotation - this._currentFingerRotation);
|
|
785
787
|
if (rotationPoint !== void 0) {
|
|
786
788
|
this.applyTransformMatrix(this.zRotate(rotationPoint, amount));
|
|
787
789
|
}
|
|
@@ -823,9 +825,9 @@ class ArcballControls extends EventDispatcher {
|
|
|
823
825
|
if (!this.enablePan) {
|
|
824
826
|
scalePoint = this._gizmos.position;
|
|
825
827
|
} else {
|
|
826
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
828
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
827
829
|
scalePoint = (_a = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _a.applyQuaternion(this.camera.quaternion).multiplyScalar(1 / this.camera.zoom).add(this._gizmos.position);
|
|
828
|
-
} else if (this.camera instanceof PerspectiveCamera) {
|
|
830
|
+
} else if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
829
831
|
scalePoint = (_b = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
|
|
830
832
|
}
|
|
831
833
|
}
|
|
@@ -877,11 +879,11 @@ class ArcballControls extends EventDispatcher {
|
|
|
877
879
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
878
880
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
879
881
|
let xNew = x / size;
|
|
880
|
-
xNew = MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
881
|
-
const y = x * Math.tan(MathUtils.DEG2RAD * this._fovState * 0.5);
|
|
882
|
-
let newFov = MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
883
|
-
newFov = MathUtils.clamp(newFov, this.minFov, this.maxFov);
|
|
884
|
-
const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
|
|
882
|
+
xNew = THREE.MathUtils.clamp(xNew, this.minDistance, this.maxDistance);
|
|
883
|
+
const y = x * Math.tan(THREE.MathUtils.DEG2RAD * this._fovState * 0.5);
|
|
884
|
+
let newFov = THREE.MathUtils.RAD2DEG * (Math.atan(y / xNew) * 2);
|
|
885
|
+
newFov = THREE.MathUtils.clamp(newFov, this.minFov, this.maxFov);
|
|
886
|
+
const newDistance = y / Math.tan(THREE.MathUtils.DEG2RAD * (newFov / 2));
|
|
885
887
|
size = x / newDistance;
|
|
886
888
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
887
889
|
this.setFov(newFov);
|
|
@@ -1078,11 +1080,11 @@ class ArcballControls extends EventDispatcher {
|
|
|
1078
1080
|
__publicField(this, "calculateTbRadius", (camera) => {
|
|
1079
1081
|
const factor = 0.67;
|
|
1080
1082
|
const distance = camera.position.distanceTo(this._gizmos.position);
|
|
1081
|
-
if (camera instanceof PerspectiveCamera) {
|
|
1082
|
-
const halfFovV = MathUtils.DEG2RAD * camera.fov * 0.5;
|
|
1083
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
|
1084
|
+
const halfFovV = THREE.MathUtils.DEG2RAD * camera.fov * 0.5;
|
|
1083
1085
|
const halfFovH = Math.atan(camera.aspect * Math.tan(halfFovV));
|
|
1084
1086
|
return Math.tan(Math.min(halfFovV, halfFovH)) * distance * factor;
|
|
1085
|
-
} else if (camera instanceof OrthographicCamera) {
|
|
1087
|
+
} else if (camera instanceof THREE.OrthographicCamera) {
|
|
1086
1088
|
return Math.min(camera.top, camera.right) * factor;
|
|
1087
1089
|
}
|
|
1088
1090
|
});
|
|
@@ -1118,16 +1120,16 @@ class ArcballControls extends EventDispatcher {
|
|
|
1118
1120
|
const color = 8947848;
|
|
1119
1121
|
const multiplier = 3;
|
|
1120
1122
|
let size, divisions, maxLength, tick;
|
|
1121
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1123
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1122
1124
|
const width = this.camera.right - this.camera.left;
|
|
1123
1125
|
const height = this.camera.bottom - this.camera.top;
|
|
1124
1126
|
maxLength = Math.max(width, height);
|
|
1125
1127
|
tick = maxLength / 20;
|
|
1126
1128
|
size = maxLength / this.camera.zoom * multiplier;
|
|
1127
1129
|
divisions = size / tick * this.camera.zoom;
|
|
1128
|
-
} else if (this.camera instanceof PerspectiveCamera) {
|
|
1130
|
+
} else if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1129
1131
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1130
|
-
const halfFovV = MathUtils.DEG2RAD * this.camera.fov * 0.5;
|
|
1132
|
+
const halfFovV = THREE.MathUtils.DEG2RAD * this.camera.fov * 0.5;
|
|
1131
1133
|
const halfFovH = Math.atan(this.camera.aspect * Math.tan(halfFovV));
|
|
1132
1134
|
maxLength = Math.tan(Math.max(halfFovV, halfFovH)) * distance * 2;
|
|
1133
1135
|
tick = maxLength / 20;
|
|
@@ -1135,7 +1137,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1135
1137
|
divisions = size / tick;
|
|
1136
1138
|
}
|
|
1137
1139
|
if (this._grid == null && this.camera) {
|
|
1138
|
-
this._grid = new GridHelper(size, divisions, color, color);
|
|
1140
|
+
this._grid = new THREE.GridHelper(size, divisions, color, color);
|
|
1139
1141
|
this._grid.position.copy(this._gizmos.position);
|
|
1140
1142
|
this._gridPosition.copy(this._grid.position);
|
|
1141
1143
|
this._grid.quaternion.copy(this.camera.quaternion);
|
|
@@ -1224,7 +1226,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1224
1226
|
*/
|
|
1225
1227
|
__publicField(this, "getCursorPosition", (cursorX, cursorY, canvas) => {
|
|
1226
1228
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1227
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1229
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1228
1230
|
this._v2_1.x *= (this.camera.right - this.camera.left) * 0.5;
|
|
1229
1231
|
this._v2_1.y *= (this.camera.top - this.camera.bottom) * 0.5;
|
|
1230
1232
|
}
|
|
@@ -1238,7 +1240,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1238
1240
|
if (camera) {
|
|
1239
1241
|
camera.lookAt(this.target);
|
|
1240
1242
|
camera.updateMatrix();
|
|
1241
|
-
if (camera instanceof PerspectiveCamera) {
|
|
1243
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
|
1242
1244
|
this._fov0 = camera.fov;
|
|
1243
1245
|
this._fovState = camera.fov;
|
|
1244
1246
|
}
|
|
@@ -1270,15 +1272,15 @@ class ArcballControls extends EventDispatcher {
|
|
|
1270
1272
|
* @param {number} tbRadius The trackball radius
|
|
1271
1273
|
*/
|
|
1272
1274
|
__publicField(this, "makeGizmos", (tbCenter, tbRadius) => {
|
|
1273
|
-
const curve = new EllipseCurve(0, 0, tbRadius, tbRadius);
|
|
1275
|
+
const curve = new THREE.EllipseCurve(0, 0, tbRadius, tbRadius);
|
|
1274
1276
|
const points = curve.getPoints(this._curvePts);
|
|
1275
|
-
const curveGeometry = new BufferGeometry().setFromPoints(points);
|
|
1276
|
-
const curveMaterialX = new LineBasicMaterial({ color: 16744576, fog: false, transparent: true, opacity: 0.6 });
|
|
1277
|
-
const curveMaterialY = new LineBasicMaterial({ color: 8454016, fog: false, transparent: true, opacity: 0.6 });
|
|
1278
|
-
const curveMaterialZ = new LineBasicMaterial({ color: 8421631, fog: false, transparent: true, opacity: 0.6 });
|
|
1279
|
-
const gizmoX = new Line(curveGeometry, curveMaterialX);
|
|
1280
|
-
const gizmoY = new Line(curveGeometry, curveMaterialY);
|
|
1281
|
-
const gizmoZ = new Line(curveGeometry, curveMaterialZ);
|
|
1277
|
+
const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
1278
|
+
const curveMaterialX = new THREE.LineBasicMaterial({ color: 16744576, fog: false, transparent: true, opacity: 0.6 });
|
|
1279
|
+
const curveMaterialY = new THREE.LineBasicMaterial({ color: 8454016, fog: false, transparent: true, opacity: 0.6 });
|
|
1280
|
+
const curveMaterialZ = new THREE.LineBasicMaterial({ color: 8421631, fog: false, transparent: true, opacity: 0.6 });
|
|
1281
|
+
const gizmoX = new THREE.Line(curveGeometry, curveMaterialX);
|
|
1282
|
+
const gizmoY = new THREE.Line(curveGeometry, curveMaterialY);
|
|
1283
|
+
const gizmoZ = new THREE.Line(curveGeometry, curveMaterialZ);
|
|
1282
1284
|
const rotation = Math.PI * 0.5;
|
|
1283
1285
|
gizmoX.rotation.x = rotation;
|
|
1284
1286
|
gizmoY.rotation.y = rotation;
|
|
@@ -1384,10 +1386,10 @@ class ArcballControls extends EventDispatcher {
|
|
|
1384
1386
|
__publicField(this, "pan", (p0, p1, adjust = false) => {
|
|
1385
1387
|
if (this.camera) {
|
|
1386
1388
|
const movement = p0.clone().sub(p1);
|
|
1387
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1389
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1388
1390
|
movement.multiplyScalar(1 / this.camera.zoom);
|
|
1389
1391
|
}
|
|
1390
|
-
if (this.camera instanceof PerspectiveCamera && adjust) {
|
|
1392
|
+
if (this.camera instanceof THREE.PerspectiveCamera && adjust) {
|
|
1391
1393
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState0);
|
|
1392
1394
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);
|
|
1393
1395
|
const distanceFactor = this._v3_1.distanceTo(this._v3_2) / this.camera.position.distanceTo(this._gizmos.position);
|
|
@@ -1405,7 +1407,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1405
1407
|
__publicField(this, "reset", () => {
|
|
1406
1408
|
if (this.camera) {
|
|
1407
1409
|
this.camera.zoom = this._zoom0;
|
|
1408
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1410
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1409
1411
|
this.camera.fov = this._fov0;
|
|
1410
1412
|
}
|
|
1411
1413
|
this.camera.near = this._nearPos;
|
|
@@ -1447,7 +1449,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1447
1449
|
__publicField(this, "copyState", () => {
|
|
1448
1450
|
if (this.camera) {
|
|
1449
1451
|
const state = JSON.stringify(
|
|
1450
|
-
this.camera instanceof OrthographicCamera ? {
|
|
1452
|
+
this.camera instanceof THREE.OrthographicCamera ? {
|
|
1451
1453
|
arcballState: {
|
|
1452
1454
|
cameraFar: this.camera.far,
|
|
1453
1455
|
cameraMatrix: this.camera.matrix,
|
|
@@ -1489,7 +1491,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1489
1491
|
this._farPos = this.camera.far;
|
|
1490
1492
|
this._zoom0 = this.camera.zoom;
|
|
1491
1493
|
this._up0.copy(this.camera.up);
|
|
1492
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1494
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1493
1495
|
this._fov0 = this.camera.fov;
|
|
1494
1496
|
}
|
|
1495
1497
|
});
|
|
@@ -1505,7 +1507,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1505
1507
|
return;
|
|
1506
1508
|
const scalePoint = point.clone();
|
|
1507
1509
|
let sizeInverse = 1 / size;
|
|
1508
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1510
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1509
1511
|
this.camera.zoom = this._zoomState;
|
|
1510
1512
|
this.camera.zoom *= size;
|
|
1511
1513
|
if (this.camera.zoom > this.maxZoom) {
|
|
@@ -1529,7 +1531,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1529
1531
|
this.setTransformationMatrices(this._m4_1, this._m4_2);
|
|
1530
1532
|
return _transformation;
|
|
1531
1533
|
}
|
|
1532
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1534
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1533
1535
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
1534
1536
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
1535
1537
|
let distance = this._v3_1.distanceTo(scalePoint);
|
|
@@ -1567,8 +1569,8 @@ class ArcballControls extends EventDispatcher {
|
|
|
1567
1569
|
* @param {Number} value fov to be setted
|
|
1568
1570
|
*/
|
|
1569
1571
|
__publicField(this, "setFov", (value) => {
|
|
1570
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1571
|
-
this.camera.fov = MathUtils.clamp(value, this.minFov, this.maxFov);
|
|
1572
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1573
|
+
this.camera.fov = THREE.MathUtils.clamp(value, this.minFov, this.maxFov);
|
|
1572
1574
|
this.camera.updateProjectionMatrix();
|
|
1573
1575
|
}
|
|
1574
1576
|
});
|
|
@@ -1618,7 +1620,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1618
1620
|
__publicField(this, "unprojectOnObj", (cursor, camera) => {
|
|
1619
1621
|
if (!this.scene)
|
|
1620
1622
|
return null;
|
|
1621
|
-
const raycaster = new Raycaster();
|
|
1623
|
+
const raycaster = new THREE.Raycaster();
|
|
1622
1624
|
raycaster.near = camera.near;
|
|
1623
1625
|
raycaster.far = camera.far;
|
|
1624
1626
|
raycaster.setFromCamera(cursor, camera);
|
|
@@ -1640,7 +1642,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1640
1642
|
* @returns {Vector3} The unprojected point on the trackball surface
|
|
1641
1643
|
*/
|
|
1642
1644
|
__publicField(this, "unprojectOnTbSurface", (camera, cursorX, cursorY, canvas, tbRadius) => {
|
|
1643
|
-
if (camera instanceof OrthographicCamera) {
|
|
1645
|
+
if (camera instanceof THREE.OrthographicCamera) {
|
|
1644
1646
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
|
1645
1647
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
|
1646
1648
|
const x2 = Math.pow(this._v2_1.x, 2);
|
|
@@ -1653,7 +1655,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1653
1655
|
}
|
|
1654
1656
|
return this._v3_1;
|
|
1655
1657
|
}
|
|
1656
|
-
if (camera instanceof PerspectiveCamera) {
|
|
1658
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
|
1657
1659
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1658
1660
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
|
1659
1661
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
|
@@ -1675,7 +1677,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1675
1677
|
if (delta >= 0) {
|
|
1676
1678
|
this._v2_1.setX((-b - Math.sqrt(delta)) / (2 * a));
|
|
1677
1679
|
this._v2_1.setY(m * this._v2_1.x + q);
|
|
1678
|
-
const angle = MathUtils.RAD2DEG * this._v2_1.angle();
|
|
1680
|
+
const angle = THREE.MathUtils.RAD2DEG * this._v2_1.angle();
|
|
1679
1681
|
if (angle >= 45) {
|
|
1680
1682
|
const rayLength2 = Math.sqrt(Math.pow(this._v2_1.x, 2) + Math.pow(cameraGizmoDistance - this._v2_1.y, 2));
|
|
1681
1683
|
rayDir.multiplyScalar(rayLength2);
|
|
@@ -1705,12 +1707,12 @@ class ArcballControls extends EventDispatcher {
|
|
|
1705
1707
|
* @returns {Vector3} The unprojected point on the trackball plane
|
|
1706
1708
|
*/
|
|
1707
1709
|
__publicField(this, "unprojectOnTbPlane", (camera, cursorX, cursorY, canvas, initialDistance = false) => {
|
|
1708
|
-
if (camera instanceof OrthographicCamera) {
|
|
1710
|
+
if (camera instanceof THREE.OrthographicCamera) {
|
|
1709
1711
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
|
1710
1712
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
|
1711
1713
|
return this._v3_1.clone();
|
|
1712
1714
|
}
|
|
1713
|
-
if (camera instanceof PerspectiveCamera) {
|
|
1715
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
|
1714
1716
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1715
1717
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
|
1716
1718
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
|
@@ -1744,12 +1746,12 @@ class ArcballControls extends EventDispatcher {
|
|
|
1744
1746
|
return;
|
|
1745
1747
|
this._cameraMatrixState.copy(this.camera.matrix);
|
|
1746
1748
|
this._gizmoMatrixState.copy(this._gizmos.matrix);
|
|
1747
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1749
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1748
1750
|
this._cameraProjectionState.copy(this.camera.projectionMatrix);
|
|
1749
1751
|
this.camera.updateProjectionMatrix();
|
|
1750
1752
|
this._zoomState = this.camera.zoom;
|
|
1751
1753
|
}
|
|
1752
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1754
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1753
1755
|
this._fovState = this.camera.fov;
|
|
1754
1756
|
}
|
|
1755
1757
|
});
|
|
@@ -1777,21 +1779,21 @@ class ArcballControls extends EventDispatcher {
|
|
|
1777
1779
|
}
|
|
1778
1780
|
if (!this.camera)
|
|
1779
1781
|
return;
|
|
1780
|
-
if (this.camera instanceof OrthographicCamera) {
|
|
1782
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
|
1781
1783
|
if (this.camera.zoom > this.maxZoom || this.camera.zoom < this.minZoom) {
|
|
1782
|
-
const newZoom = MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
|
|
1784
|
+
const newZoom = THREE.MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
|
|
1783
1785
|
this.applyTransformMatrix(this.applyScale(newZoom / this.camera.zoom, this._gizmos.position, true));
|
|
1784
1786
|
}
|
|
1785
1787
|
}
|
|
1786
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1788
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1787
1789
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1788
1790
|
if (distance > this.maxDistance + EPS || distance < this.minDistance - EPS) {
|
|
1789
|
-
const newDistance = MathUtils.clamp(distance, this.minDistance, this.maxDistance);
|
|
1791
|
+
const newDistance = THREE.MathUtils.clamp(distance, this.minDistance, this.maxDistance);
|
|
1790
1792
|
this.applyTransformMatrix(this.applyScale(newDistance / distance, this._gizmos.position));
|
|
1791
1793
|
this.updateMatrixState();
|
|
1792
1794
|
}
|
|
1793
1795
|
if (this.camera.fov < this.minFov || this.camera.fov > this.maxFov) {
|
|
1794
|
-
this.camera.fov = MathUtils.clamp(this.camera.fov, this.minFov, this.maxFov);
|
|
1796
|
+
this.camera.fov = THREE.MathUtils.clamp(this.camera.fov, this.minFov, this.maxFov);
|
|
1795
1797
|
this.camera.updateProjectionMatrix();
|
|
1796
1798
|
}
|
|
1797
1799
|
const oldRadius = this._tbRadius;
|
|
@@ -1802,9 +1804,9 @@ class ArcballControls extends EventDispatcher {
|
|
|
1802
1804
|
if (oldRadius < this._tbRadius - EPS || oldRadius > this._tbRadius + EPS) {
|
|
1803
1805
|
const scale = (this._gizmos.scale.x + this._gizmos.scale.y + this._gizmos.scale.z) / 3;
|
|
1804
1806
|
const newRadius = this._tbRadius / scale;
|
|
1805
|
-
const curve = new EllipseCurve(0, 0, newRadius, newRadius);
|
|
1807
|
+
const curve = new THREE.EllipseCurve(0, 0, newRadius, newRadius);
|
|
1806
1808
|
const points = curve.getPoints(this._curvePts);
|
|
1807
|
-
const curveGeometry = new BufferGeometry().setFromPoints(points);
|
|
1809
|
+
const curveGeometry = new THREE.BufferGeometry().setFromPoints(points);
|
|
1808
1810
|
for (const gizmo in this._gizmos.children) {
|
|
1809
1811
|
const child = this._gizmos.children[gizmo];
|
|
1810
1812
|
child.geometry = curveGeometry;
|
|
@@ -1822,7 +1824,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1822
1824
|
this.camera.near = state.arcballState.cameraNear;
|
|
1823
1825
|
this.camera.far = state.arcballState.cameraFar;
|
|
1824
1826
|
this.camera.zoom = state.arcballState.cameraZoom;
|
|
1825
|
-
if (this.camera instanceof PerspectiveCamera) {
|
|
1827
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
|
1826
1828
|
this.camera.fov = state.arcballState.cameraFov;
|
|
1827
1829
|
}
|
|
1828
1830
|
this._gizmoMatrixState.fromArray(state.arcballState.gizmoMatrix.elements);
|
|
@@ -1834,7 +1836,7 @@ class ArcballControls extends EventDispatcher {
|
|
|
1834
1836
|
if (tbRadius !== void 0) {
|
|
1835
1837
|
this._tbRadius = tbRadius;
|
|
1836
1838
|
}
|
|
1837
|
-
const gizmoTmp = new Matrix4().copy(this._gizmoMatrixState0);
|
|
1839
|
+
const gizmoTmp = new THREE.Matrix4().copy(this._gizmoMatrixState0);
|
|
1838
1840
|
this.makeGizmos(this._gizmos.position, this._tbRadius);
|
|
1839
1841
|
this._gizmoMatrixState0.copy(gizmoTmp);
|
|
1840
1842
|
this.camera.lookAt(this._gizmos.position);
|
|
@@ -1847,33 +1849,33 @@ class ArcballControls extends EventDispatcher {
|
|
|
1847
1849
|
this.scene = scene;
|
|
1848
1850
|
this.mouseActions = [];
|
|
1849
1851
|
this._mouseOp = null;
|
|
1850
|
-
this._v2_1 = new Vector2();
|
|
1851
|
-
this._v3_1 = new Vector3();
|
|
1852
|
-
this._v3_2 = new Vector3();
|
|
1853
|
-
this._m4_1 = new Matrix4();
|
|
1854
|
-
this._m4_2 = new Matrix4();
|
|
1855
|
-
this._quat = new Quaternion();
|
|
1856
|
-
this._translationMatrix = new Matrix4();
|
|
1857
|
-
this._rotationMatrix = new Matrix4();
|
|
1858
|
-
this._scaleMatrix = new Matrix4();
|
|
1859
|
-
this._rotationAxis = new Vector3();
|
|
1860
|
-
this._cameraMatrixState = new Matrix4();
|
|
1861
|
-
this._cameraProjectionState = new Matrix4();
|
|
1852
|
+
this._v2_1 = new THREE.Vector2();
|
|
1853
|
+
this._v3_1 = new THREE.Vector3();
|
|
1854
|
+
this._v3_2 = new THREE.Vector3();
|
|
1855
|
+
this._m4_1 = new THREE.Matrix4();
|
|
1856
|
+
this._m4_2 = new THREE.Matrix4();
|
|
1857
|
+
this._quat = new THREE.Quaternion();
|
|
1858
|
+
this._translationMatrix = new THREE.Matrix4();
|
|
1859
|
+
this._rotationMatrix = new THREE.Matrix4();
|
|
1860
|
+
this._scaleMatrix = new THREE.Matrix4();
|
|
1861
|
+
this._rotationAxis = new THREE.Vector3();
|
|
1862
|
+
this._cameraMatrixState = new THREE.Matrix4();
|
|
1863
|
+
this._cameraProjectionState = new THREE.Matrix4();
|
|
1862
1864
|
this._fovState = 1;
|
|
1863
|
-
this._upState = new Vector3();
|
|
1865
|
+
this._upState = new THREE.Vector3();
|
|
1864
1866
|
this._zoomState = 1;
|
|
1865
1867
|
this._nearPos = 0;
|
|
1866
1868
|
this._farPos = 0;
|
|
1867
|
-
this._gizmoMatrixState = new Matrix4();
|
|
1868
|
-
this._up0 = new Vector3();
|
|
1869
|
+
this._gizmoMatrixState = new THREE.Matrix4();
|
|
1870
|
+
this._up0 = new THREE.Vector3();
|
|
1869
1871
|
this._zoom0 = 1;
|
|
1870
1872
|
this._fov0 = 0;
|
|
1871
1873
|
this._initialNear = 0;
|
|
1872
1874
|
this._nearPos0 = 0;
|
|
1873
1875
|
this._initialFar = 0;
|
|
1874
1876
|
this._farPos0 = 0;
|
|
1875
|
-
this._cameraMatrixState0 = new Matrix4();
|
|
1876
|
-
this._gizmoMatrixState0 = new Matrix4();
|
|
1877
|
+
this._cameraMatrixState0 = new THREE.Matrix4();
|
|
1878
|
+
this._gizmoMatrixState0 = new THREE.Matrix4();
|
|
1877
1879
|
this._button = -1;
|
|
1878
1880
|
this._touchStart = [];
|
|
1879
1881
|
this._touchCurrent = [];
|
|
@@ -1892,11 +1894,11 @@ class ArcballControls extends EventDispatcher {
|
|
|
1892
1894
|
this._maxInterval = 300;
|
|
1893
1895
|
this._posThreshold = 24;
|
|
1894
1896
|
this._movementThreshold = 24;
|
|
1895
|
-
this._currentCursorPosition = new Vector3();
|
|
1896
|
-
this._startCursorPosition = new Vector3();
|
|
1897
|
+
this._currentCursorPosition = new THREE.Vector3();
|
|
1898
|
+
this._startCursorPosition = new THREE.Vector3();
|
|
1897
1899
|
this._grid = null;
|
|
1898
|
-
this._gridPosition = new Vector3();
|
|
1899
|
-
this._gizmos = new Group();
|
|
1900
|
+
this._gridPosition = new THREE.Vector3();
|
|
1901
|
+
this._gizmos = new THREE.Group();
|
|
1900
1902
|
this._curvePts = 128;
|
|
1901
1903
|
this._timeStart = -1;
|
|
1902
1904
|
this._animationId = -1;
|
|
@@ -1905,8 +1907,8 @@ class ArcballControls extends EventDispatcher {
|
|
|
1905
1907
|
this._timeCurrent = 0;
|
|
1906
1908
|
this._anglePrev = 0;
|
|
1907
1909
|
this._angleCurrent = 0;
|
|
1908
|
-
this._cursorPosPrev = new Vector3();
|
|
1909
|
-
this._cursorPosCurr = new Vector3();
|
|
1910
|
+
this._cursorPosPrev = new THREE.Vector3();
|
|
1911
|
+
this._cursorPosCurr = new THREE.Vector3();
|
|
1910
1912
|
this._wPrev = 0;
|
|
1911
1913
|
this._wCurr = 0;
|
|
1912
1914
|
this.adjustNearFar = false;
|
|
@@ -1926,8 +1928,8 @@ class ArcballControls extends EventDispatcher {
|
|
|
1926
1928
|
this.maxDistance = Infinity;
|
|
1927
1929
|
this.minZoom = 0;
|
|
1928
1930
|
this.maxZoom = Infinity;
|
|
1929
|
-
this.target = new Vector3(0, 0, 0);
|
|
1930
|
-
this._currentTarget = new Vector3(0, 0, 0);
|
|
1931
|
+
this.target = new THREE.Vector3(0, 0, 0);
|
|
1932
|
+
this._currentTarget = new THREE.Vector3(0, 0, 0);
|
|
1931
1933
|
this._tbRadius = 1;
|
|
1932
1934
|
this._state = STATE.IDLE;
|
|
1933
1935
|
this.setCamera(camera);
|
|
@@ -1965,9 +1967,9 @@ class ArcballControls extends EventDispatcher {
|
|
|
1965
1967
|
}
|
|
1966
1968
|
if (this.adjustNearFar) {
|
|
1967
1969
|
const cameraDistance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1968
|
-
const bb = new Box3();
|
|
1970
|
+
const bb = new THREE.Box3();
|
|
1969
1971
|
bb.setFromObject(this._gizmos);
|
|
1970
|
-
const sphere = new Sphere();
|
|
1972
|
+
const sphere = new THREE.Sphere();
|
|
1971
1973
|
bb.getBoundingSphere(sphere);
|
|
1972
1974
|
const adjustedNearPosition = Math.max(this._nearPos0, sphere.radius + sphere.center.length());
|
|
1973
1975
|
const regularNearPosition = cameraDistance - this._initialNear;
|
|
@@ -2028,6 +2030,4 @@ class ArcballControls extends EventDispatcher {
|
|
|
2028
2030
|
}
|
|
2029
2031
|
}
|
|
2030
2032
|
}
|
|
2031
|
-
|
|
2032
|
-
ArcballControls
|
|
2033
|
-
};
|
|
2033
|
+
exports.ArcballControls = ArcballControls;
|