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,12 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
3
|
var __publicField = (obj, key, value) => {
|
|
5
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
5
|
return value;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
const THREE = require("three");
|
|
7
|
+
import { Matrix4, EventDispatcher, Vector2, Vector3, Quaternion, Group, EllipseCurve, BufferGeometry, PerspectiveCamera, MathUtils, OrthographicCamera, Box3, Sphere, GridHelper, LineBasicMaterial, Line, Raycaster } from "three";
|
|
10
8
|
const STATE = {
|
|
11
9
|
IDLE: Symbol(),
|
|
12
10
|
ROTATE: Symbol(),
|
|
@@ -32,13 +30,13 @@ const _center = {
|
|
|
32
30
|
y: 0
|
|
33
31
|
};
|
|
34
32
|
const _transformation = {
|
|
35
|
-
camera: /* @__PURE__ */ new
|
|
36
|
-
gizmos: /* @__PURE__ */ new
|
|
33
|
+
camera: /* @__PURE__ */ new Matrix4(),
|
|
34
|
+
gizmos: /* @__PURE__ */ new Matrix4()
|
|
37
35
|
};
|
|
38
36
|
const _changeEvent = { type: "change" };
|
|
39
37
|
const _startEvent = { type: "start" };
|
|
40
38
|
const _endEvent = { type: "end" };
|
|
41
|
-
class ArcballControls extends
|
|
39
|
+
class ArcballControls extends EventDispatcher {
|
|
42
40
|
constructor(camera, domElement = null, scene = null) {
|
|
43
41
|
super();
|
|
44
42
|
__publicField(this, "camera");
|
|
@@ -139,9 +137,9 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
const newRadius = this._tbRadius / scale;
|
|
142
|
-
const curve = new
|
|
140
|
+
const curve = new EllipseCurve(0, 0, newRadius, newRadius);
|
|
143
141
|
const points = curve.getPoints(this._curvePts);
|
|
144
|
-
const curveGeometry = new
|
|
142
|
+
const curveGeometry = new BufferGeometry().setFromPoints(points);
|
|
145
143
|
for (const gizmo in this._gizmos.children) {
|
|
146
144
|
const child = this._gizmos.children[gizmo];
|
|
147
145
|
child.geometry = curveGeometry;
|
|
@@ -358,10 +356,10 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
358
356
|
}
|
|
359
357
|
if (this.cursorZoom && this.enablePan) {
|
|
360
358
|
let scalePoint;
|
|
361
|
-
if (this.camera instanceof
|
|
359
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
362
360
|
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);
|
|
363
361
|
}
|
|
364
|
-
if (this.camera instanceof
|
|
362
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
365
363
|
scalePoint = (_b = this.unprojectOnTbPlane(this.camera, event.clientX, event.clientY, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
|
|
366
364
|
}
|
|
367
365
|
if (scalePoint !== void 0)
|
|
@@ -378,7 +376,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
378
376
|
this.dispatchEvent(_endEvent);
|
|
379
377
|
break;
|
|
380
378
|
case "FOV":
|
|
381
|
-
if (this.camera instanceof
|
|
379
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
382
380
|
this.updateTbState(STATE.FOV, true);
|
|
383
381
|
if (event.deltaX != 0) {
|
|
384
382
|
sgn = event.deltaX / notchDeltaY;
|
|
@@ -392,15 +390,15 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
392
390
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
393
391
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
394
392
|
let xNew = x / size;
|
|
395
|
-
xNew =
|
|
396
|
-
const y = x * Math.tan(
|
|
397
|
-
let newFov =
|
|
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);
|
|
398
396
|
if (newFov > this.maxFov) {
|
|
399
397
|
newFov = this.maxFov;
|
|
400
398
|
} else if (newFov < this.minFov) {
|
|
401
399
|
newFov = this.minFov;
|
|
402
400
|
}
|
|
403
|
-
const newDistance = y / Math.tan(
|
|
401
|
+
const newDistance = y / Math.tan(MathUtils.DEG2RAD * (newFov / 2));
|
|
404
402
|
size = x / newDistance;
|
|
405
403
|
this.setFov(newFov);
|
|
406
404
|
this.applyTransformMatrix(this.applyScale(size, this._gizmos.position, false));
|
|
@@ -473,7 +471,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
473
471
|
case "FOV":
|
|
474
472
|
if (!this.enableZoom)
|
|
475
473
|
return;
|
|
476
|
-
if (this.camera instanceof
|
|
474
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
477
475
|
if (this._animationId != -1) {
|
|
478
476
|
cancelAnimationFrame(this._animationId);
|
|
479
477
|
this._animationId = -1;
|
|
@@ -613,7 +611,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
613
611
|
}
|
|
614
612
|
break;
|
|
615
613
|
case STATE.FOV:
|
|
616
|
-
if (this.enableZoom && this.camera instanceof
|
|
614
|
+
if (this.enableZoom && this.camera instanceof PerspectiveCamera) {
|
|
617
615
|
if (restart) {
|
|
618
616
|
this.dispatchEvent(_endEvent);
|
|
619
617
|
this.dispatchEvent(_startEvent);
|
|
@@ -637,11 +635,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
637
635
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
638
636
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
639
637
|
let xNew = x / size;
|
|
640
|
-
xNew =
|
|
641
|
-
const y = x * Math.tan(
|
|
642
|
-
let newFov =
|
|
643
|
-
newFov =
|
|
644
|
-
const newDistance = y / Math.tan(
|
|
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));
|
|
645
643
|
size = x / newDistance;
|
|
646
644
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
647
645
|
this.setFov(newFov);
|
|
@@ -778,12 +776,12 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
778
776
|
}
|
|
779
777
|
this._currentFingerRotation = this.getAngle(this._touchCurrent[1], this._touchCurrent[0]) + this.getAngle(this._touchStart[1], this._touchStart[0]);
|
|
780
778
|
if (!this.enablePan) {
|
|
781
|
-
rotationPoint = new
|
|
779
|
+
rotationPoint = new Vector3().setFromMatrixPosition(this._gizmoMatrixState);
|
|
782
780
|
} else if (this.camera) {
|
|
783
781
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
784
782
|
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);
|
|
785
783
|
}
|
|
786
|
-
const amount =
|
|
784
|
+
const amount = MathUtils.DEG2RAD * (this._startFingerRotation - this._currentFingerRotation);
|
|
787
785
|
if (rotationPoint !== void 0) {
|
|
788
786
|
this.applyTransformMatrix(this.zRotate(rotationPoint, amount));
|
|
789
787
|
}
|
|
@@ -825,9 +823,9 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
825
823
|
if (!this.enablePan) {
|
|
826
824
|
scalePoint = this._gizmos.position;
|
|
827
825
|
} else {
|
|
828
|
-
if (this.camera instanceof
|
|
826
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
829
827
|
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);
|
|
830
|
-
} else if (this.camera instanceof
|
|
828
|
+
} else if (this.camera instanceof PerspectiveCamera) {
|
|
831
829
|
scalePoint = (_b = this.unprojectOnTbPlane(this.camera, _center.x, _center.y, this.domElement)) == null ? void 0 : _b.applyQuaternion(this.camera.quaternion).add(this._gizmos.position);
|
|
832
830
|
}
|
|
833
831
|
}
|
|
@@ -879,11 +877,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
879
877
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
880
878
|
const x = this._v3_1.distanceTo(this._gizmos.position);
|
|
881
879
|
let xNew = x / size;
|
|
882
|
-
xNew =
|
|
883
|
-
const y = x * Math.tan(
|
|
884
|
-
let newFov =
|
|
885
|
-
newFov =
|
|
886
|
-
const newDistance = y / Math.tan(
|
|
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));
|
|
887
885
|
size = x / newDistance;
|
|
888
886
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
889
887
|
this.setFov(newFov);
|
|
@@ -1080,11 +1078,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1080
1078
|
__publicField(this, "calculateTbRadius", (camera) => {
|
|
1081
1079
|
const factor = 0.67;
|
|
1082
1080
|
const distance = camera.position.distanceTo(this._gizmos.position);
|
|
1083
|
-
if (camera instanceof
|
|
1084
|
-
const halfFovV =
|
|
1081
|
+
if (camera instanceof PerspectiveCamera) {
|
|
1082
|
+
const halfFovV = MathUtils.DEG2RAD * camera.fov * 0.5;
|
|
1085
1083
|
const halfFovH = Math.atan(camera.aspect * Math.tan(halfFovV));
|
|
1086
1084
|
return Math.tan(Math.min(halfFovV, halfFovH)) * distance * factor;
|
|
1087
|
-
} else if (camera instanceof
|
|
1085
|
+
} else if (camera instanceof OrthographicCamera) {
|
|
1088
1086
|
return Math.min(camera.top, camera.right) * factor;
|
|
1089
1087
|
}
|
|
1090
1088
|
});
|
|
@@ -1120,16 +1118,16 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1120
1118
|
const color = 8947848;
|
|
1121
1119
|
const multiplier = 3;
|
|
1122
1120
|
let size, divisions, maxLength, tick;
|
|
1123
|
-
if (this.camera instanceof
|
|
1121
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1124
1122
|
const width = this.camera.right - this.camera.left;
|
|
1125
1123
|
const height = this.camera.bottom - this.camera.top;
|
|
1126
1124
|
maxLength = Math.max(width, height);
|
|
1127
1125
|
tick = maxLength / 20;
|
|
1128
1126
|
size = maxLength / this.camera.zoom * multiplier;
|
|
1129
1127
|
divisions = size / tick * this.camera.zoom;
|
|
1130
|
-
} else if (this.camera instanceof
|
|
1128
|
+
} else if (this.camera instanceof PerspectiveCamera) {
|
|
1131
1129
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1132
|
-
const halfFovV =
|
|
1130
|
+
const halfFovV = MathUtils.DEG2RAD * this.camera.fov * 0.5;
|
|
1133
1131
|
const halfFovH = Math.atan(this.camera.aspect * Math.tan(halfFovV));
|
|
1134
1132
|
maxLength = Math.tan(Math.max(halfFovV, halfFovH)) * distance * 2;
|
|
1135
1133
|
tick = maxLength / 20;
|
|
@@ -1137,7 +1135,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1137
1135
|
divisions = size / tick;
|
|
1138
1136
|
}
|
|
1139
1137
|
if (this._grid == null && this.camera) {
|
|
1140
|
-
this._grid = new
|
|
1138
|
+
this._grid = new GridHelper(size, divisions, color, color);
|
|
1141
1139
|
this._grid.position.copy(this._gizmos.position);
|
|
1142
1140
|
this._gridPosition.copy(this._grid.position);
|
|
1143
1141
|
this._grid.quaternion.copy(this.camera.quaternion);
|
|
@@ -1226,7 +1224,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1226
1224
|
*/
|
|
1227
1225
|
__publicField(this, "getCursorPosition", (cursorX, cursorY, canvas) => {
|
|
1228
1226
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1229
|
-
if (this.camera instanceof
|
|
1227
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1230
1228
|
this._v2_1.x *= (this.camera.right - this.camera.left) * 0.5;
|
|
1231
1229
|
this._v2_1.y *= (this.camera.top - this.camera.bottom) * 0.5;
|
|
1232
1230
|
}
|
|
@@ -1240,7 +1238,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1240
1238
|
if (camera) {
|
|
1241
1239
|
camera.lookAt(this.target);
|
|
1242
1240
|
camera.updateMatrix();
|
|
1243
|
-
if (camera instanceof
|
|
1241
|
+
if (camera instanceof PerspectiveCamera) {
|
|
1244
1242
|
this._fov0 = camera.fov;
|
|
1245
1243
|
this._fovState = camera.fov;
|
|
1246
1244
|
}
|
|
@@ -1272,15 +1270,15 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1272
1270
|
* @param {number} tbRadius The trackball radius
|
|
1273
1271
|
*/
|
|
1274
1272
|
__publicField(this, "makeGizmos", (tbCenter, tbRadius) => {
|
|
1275
|
-
const curve = new
|
|
1273
|
+
const curve = new EllipseCurve(0, 0, tbRadius, tbRadius);
|
|
1276
1274
|
const points = curve.getPoints(this._curvePts);
|
|
1277
|
-
const curveGeometry = new
|
|
1278
|
-
const curveMaterialX = new
|
|
1279
|
-
const curveMaterialY = new
|
|
1280
|
-
const curveMaterialZ = new
|
|
1281
|
-
const gizmoX = new
|
|
1282
|
-
const gizmoY = new
|
|
1283
|
-
const gizmoZ = new
|
|
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);
|
|
1284
1282
|
const rotation = Math.PI * 0.5;
|
|
1285
1283
|
gizmoX.rotation.x = rotation;
|
|
1286
1284
|
gizmoY.rotation.y = rotation;
|
|
@@ -1386,10 +1384,10 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1386
1384
|
__publicField(this, "pan", (p0, p1, adjust = false) => {
|
|
1387
1385
|
if (this.camera) {
|
|
1388
1386
|
const movement = p0.clone().sub(p1);
|
|
1389
|
-
if (this.camera instanceof
|
|
1387
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1390
1388
|
movement.multiplyScalar(1 / this.camera.zoom);
|
|
1391
1389
|
}
|
|
1392
|
-
if (this.camera instanceof
|
|
1390
|
+
if (this.camera instanceof PerspectiveCamera && adjust) {
|
|
1393
1391
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState0);
|
|
1394
1392
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);
|
|
1395
1393
|
const distanceFactor = this._v3_1.distanceTo(this._v3_2) / this.camera.position.distanceTo(this._gizmos.position);
|
|
@@ -1407,7 +1405,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1407
1405
|
__publicField(this, "reset", () => {
|
|
1408
1406
|
if (this.camera) {
|
|
1409
1407
|
this.camera.zoom = this._zoom0;
|
|
1410
|
-
if (this.camera instanceof
|
|
1408
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1411
1409
|
this.camera.fov = this._fov0;
|
|
1412
1410
|
}
|
|
1413
1411
|
this.camera.near = this._nearPos;
|
|
@@ -1449,7 +1447,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1449
1447
|
__publicField(this, "copyState", () => {
|
|
1450
1448
|
if (this.camera) {
|
|
1451
1449
|
const state = JSON.stringify(
|
|
1452
|
-
this.camera instanceof
|
|
1450
|
+
this.camera instanceof OrthographicCamera ? {
|
|
1453
1451
|
arcballState: {
|
|
1454
1452
|
cameraFar: this.camera.far,
|
|
1455
1453
|
cameraMatrix: this.camera.matrix,
|
|
@@ -1491,7 +1489,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1491
1489
|
this._farPos = this.camera.far;
|
|
1492
1490
|
this._zoom0 = this.camera.zoom;
|
|
1493
1491
|
this._up0.copy(this.camera.up);
|
|
1494
|
-
if (this.camera instanceof
|
|
1492
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1495
1493
|
this._fov0 = this.camera.fov;
|
|
1496
1494
|
}
|
|
1497
1495
|
});
|
|
@@ -1507,7 +1505,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1507
1505
|
return;
|
|
1508
1506
|
const scalePoint = point.clone();
|
|
1509
1507
|
let sizeInverse = 1 / size;
|
|
1510
|
-
if (this.camera instanceof
|
|
1508
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1511
1509
|
this.camera.zoom = this._zoomState;
|
|
1512
1510
|
this.camera.zoom *= size;
|
|
1513
1511
|
if (this.camera.zoom > this.maxZoom) {
|
|
@@ -1531,7 +1529,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1531
1529
|
this.setTransformationMatrices(this._m4_1, this._m4_2);
|
|
1532
1530
|
return _transformation;
|
|
1533
1531
|
}
|
|
1534
|
-
if (this.camera instanceof
|
|
1532
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1535
1533
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
|
1536
1534
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
|
1537
1535
|
let distance = this._v3_1.distanceTo(scalePoint);
|
|
@@ -1569,8 +1567,8 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1569
1567
|
* @param {Number} value fov to be setted
|
|
1570
1568
|
*/
|
|
1571
1569
|
__publicField(this, "setFov", (value) => {
|
|
1572
|
-
if (this.camera instanceof
|
|
1573
|
-
this.camera.fov =
|
|
1570
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1571
|
+
this.camera.fov = MathUtils.clamp(value, this.minFov, this.maxFov);
|
|
1574
1572
|
this.camera.updateProjectionMatrix();
|
|
1575
1573
|
}
|
|
1576
1574
|
});
|
|
@@ -1620,7 +1618,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1620
1618
|
__publicField(this, "unprojectOnObj", (cursor, camera) => {
|
|
1621
1619
|
if (!this.scene)
|
|
1622
1620
|
return null;
|
|
1623
|
-
const raycaster = new
|
|
1621
|
+
const raycaster = new Raycaster();
|
|
1624
1622
|
raycaster.near = camera.near;
|
|
1625
1623
|
raycaster.far = camera.far;
|
|
1626
1624
|
raycaster.setFromCamera(cursor, camera);
|
|
@@ -1642,7 +1640,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1642
1640
|
* @returns {Vector3} The unprojected point on the trackball surface
|
|
1643
1641
|
*/
|
|
1644
1642
|
__publicField(this, "unprojectOnTbSurface", (camera, cursorX, cursorY, canvas, tbRadius) => {
|
|
1645
|
-
if (camera instanceof
|
|
1643
|
+
if (camera instanceof OrthographicCamera) {
|
|
1646
1644
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
|
1647
1645
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
|
1648
1646
|
const x2 = Math.pow(this._v2_1.x, 2);
|
|
@@ -1655,7 +1653,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1655
1653
|
}
|
|
1656
1654
|
return this._v3_1;
|
|
1657
1655
|
}
|
|
1658
|
-
if (camera instanceof
|
|
1656
|
+
if (camera instanceof PerspectiveCamera) {
|
|
1659
1657
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1660
1658
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
|
1661
1659
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
|
@@ -1677,7 +1675,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1677
1675
|
if (delta >= 0) {
|
|
1678
1676
|
this._v2_1.setX((-b - Math.sqrt(delta)) / (2 * a));
|
|
1679
1677
|
this._v2_1.setY(m * this._v2_1.x + q);
|
|
1680
|
-
const angle =
|
|
1678
|
+
const angle = MathUtils.RAD2DEG * this._v2_1.angle();
|
|
1681
1679
|
if (angle >= 45) {
|
|
1682
1680
|
const rayLength2 = Math.sqrt(Math.pow(this._v2_1.x, 2) + Math.pow(cameraGizmoDistance - this._v2_1.y, 2));
|
|
1683
1681
|
rayDir.multiplyScalar(rayLength2);
|
|
@@ -1707,12 +1705,12 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1707
1705
|
* @returns {Vector3} The unprojected point on the trackball plane
|
|
1708
1706
|
*/
|
|
1709
1707
|
__publicField(this, "unprojectOnTbPlane", (camera, cursorX, cursorY, canvas, initialDistance = false) => {
|
|
1710
|
-
if (camera instanceof
|
|
1708
|
+
if (camera instanceof OrthographicCamera) {
|
|
1711
1709
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
|
1712
1710
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
|
1713
1711
|
return this._v3_1.clone();
|
|
1714
1712
|
}
|
|
1715
|
-
if (camera instanceof
|
|
1713
|
+
if (camera instanceof PerspectiveCamera) {
|
|
1716
1714
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
|
1717
1715
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
|
1718
1716
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
|
@@ -1746,12 +1744,12 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1746
1744
|
return;
|
|
1747
1745
|
this._cameraMatrixState.copy(this.camera.matrix);
|
|
1748
1746
|
this._gizmoMatrixState.copy(this._gizmos.matrix);
|
|
1749
|
-
if (this.camera instanceof
|
|
1747
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1750
1748
|
this._cameraProjectionState.copy(this.camera.projectionMatrix);
|
|
1751
1749
|
this.camera.updateProjectionMatrix();
|
|
1752
1750
|
this._zoomState = this.camera.zoom;
|
|
1753
1751
|
}
|
|
1754
|
-
if (this.camera instanceof
|
|
1752
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1755
1753
|
this._fovState = this.camera.fov;
|
|
1756
1754
|
}
|
|
1757
1755
|
});
|
|
@@ -1779,21 +1777,21 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1779
1777
|
}
|
|
1780
1778
|
if (!this.camera)
|
|
1781
1779
|
return;
|
|
1782
|
-
if (this.camera instanceof
|
|
1780
|
+
if (this.camera instanceof OrthographicCamera) {
|
|
1783
1781
|
if (this.camera.zoom > this.maxZoom || this.camera.zoom < this.minZoom) {
|
|
1784
|
-
const newZoom =
|
|
1782
|
+
const newZoom = MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
|
|
1785
1783
|
this.applyTransformMatrix(this.applyScale(newZoom / this.camera.zoom, this._gizmos.position, true));
|
|
1786
1784
|
}
|
|
1787
1785
|
}
|
|
1788
|
-
if (this.camera instanceof
|
|
1786
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1789
1787
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1790
1788
|
if (distance > this.maxDistance + EPS || distance < this.minDistance - EPS) {
|
|
1791
|
-
const newDistance =
|
|
1789
|
+
const newDistance = MathUtils.clamp(distance, this.minDistance, this.maxDistance);
|
|
1792
1790
|
this.applyTransformMatrix(this.applyScale(newDistance / distance, this._gizmos.position));
|
|
1793
1791
|
this.updateMatrixState();
|
|
1794
1792
|
}
|
|
1795
1793
|
if (this.camera.fov < this.minFov || this.camera.fov > this.maxFov) {
|
|
1796
|
-
this.camera.fov =
|
|
1794
|
+
this.camera.fov = MathUtils.clamp(this.camera.fov, this.minFov, this.maxFov);
|
|
1797
1795
|
this.camera.updateProjectionMatrix();
|
|
1798
1796
|
}
|
|
1799
1797
|
const oldRadius = this._tbRadius;
|
|
@@ -1804,9 +1802,9 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1804
1802
|
if (oldRadius < this._tbRadius - EPS || oldRadius > this._tbRadius + EPS) {
|
|
1805
1803
|
const scale = (this._gizmos.scale.x + this._gizmos.scale.y + this._gizmos.scale.z) / 3;
|
|
1806
1804
|
const newRadius = this._tbRadius / scale;
|
|
1807
|
-
const curve = new
|
|
1805
|
+
const curve = new EllipseCurve(0, 0, newRadius, newRadius);
|
|
1808
1806
|
const points = curve.getPoints(this._curvePts);
|
|
1809
|
-
const curveGeometry = new
|
|
1807
|
+
const curveGeometry = new BufferGeometry().setFromPoints(points);
|
|
1810
1808
|
for (const gizmo in this._gizmos.children) {
|
|
1811
1809
|
const child = this._gizmos.children[gizmo];
|
|
1812
1810
|
child.geometry = curveGeometry;
|
|
@@ -1824,7 +1822,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1824
1822
|
this.camera.near = state.arcballState.cameraNear;
|
|
1825
1823
|
this.camera.far = state.arcballState.cameraFar;
|
|
1826
1824
|
this.camera.zoom = state.arcballState.cameraZoom;
|
|
1827
|
-
if (this.camera instanceof
|
|
1825
|
+
if (this.camera instanceof PerspectiveCamera) {
|
|
1828
1826
|
this.camera.fov = state.arcballState.cameraFov;
|
|
1829
1827
|
}
|
|
1830
1828
|
this._gizmoMatrixState.fromArray(state.arcballState.gizmoMatrix.elements);
|
|
@@ -1836,7 +1834,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1836
1834
|
if (tbRadius !== void 0) {
|
|
1837
1835
|
this._tbRadius = tbRadius;
|
|
1838
1836
|
}
|
|
1839
|
-
const gizmoTmp = new
|
|
1837
|
+
const gizmoTmp = new Matrix4().copy(this._gizmoMatrixState0);
|
|
1840
1838
|
this.makeGizmos(this._gizmos.position, this._tbRadius);
|
|
1841
1839
|
this._gizmoMatrixState0.copy(gizmoTmp);
|
|
1842
1840
|
this.camera.lookAt(this._gizmos.position);
|
|
@@ -1849,33 +1847,33 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1849
1847
|
this.scene = scene;
|
|
1850
1848
|
this.mouseActions = [];
|
|
1851
1849
|
this._mouseOp = null;
|
|
1852
|
-
this._v2_1 = new
|
|
1853
|
-
this._v3_1 = new
|
|
1854
|
-
this._v3_2 = new
|
|
1855
|
-
this._m4_1 = new
|
|
1856
|
-
this._m4_2 = new
|
|
1857
|
-
this._quat = new
|
|
1858
|
-
this._translationMatrix = new
|
|
1859
|
-
this._rotationMatrix = new
|
|
1860
|
-
this._scaleMatrix = new
|
|
1861
|
-
this._rotationAxis = new
|
|
1862
|
-
this._cameraMatrixState = new
|
|
1863
|
-
this._cameraProjectionState = new
|
|
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();
|
|
1864
1862
|
this._fovState = 1;
|
|
1865
|
-
this._upState = new
|
|
1863
|
+
this._upState = new Vector3();
|
|
1866
1864
|
this._zoomState = 1;
|
|
1867
1865
|
this._nearPos = 0;
|
|
1868
1866
|
this._farPos = 0;
|
|
1869
|
-
this._gizmoMatrixState = new
|
|
1870
|
-
this._up0 = new
|
|
1867
|
+
this._gizmoMatrixState = new Matrix4();
|
|
1868
|
+
this._up0 = new Vector3();
|
|
1871
1869
|
this._zoom0 = 1;
|
|
1872
1870
|
this._fov0 = 0;
|
|
1873
1871
|
this._initialNear = 0;
|
|
1874
1872
|
this._nearPos0 = 0;
|
|
1875
1873
|
this._initialFar = 0;
|
|
1876
1874
|
this._farPos0 = 0;
|
|
1877
|
-
this._cameraMatrixState0 = new
|
|
1878
|
-
this._gizmoMatrixState0 = new
|
|
1875
|
+
this._cameraMatrixState0 = new Matrix4();
|
|
1876
|
+
this._gizmoMatrixState0 = new Matrix4();
|
|
1879
1877
|
this._button = -1;
|
|
1880
1878
|
this._touchStart = [];
|
|
1881
1879
|
this._touchCurrent = [];
|
|
@@ -1894,11 +1892,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1894
1892
|
this._maxInterval = 300;
|
|
1895
1893
|
this._posThreshold = 24;
|
|
1896
1894
|
this._movementThreshold = 24;
|
|
1897
|
-
this._currentCursorPosition = new
|
|
1898
|
-
this._startCursorPosition = new
|
|
1895
|
+
this._currentCursorPosition = new Vector3();
|
|
1896
|
+
this._startCursorPosition = new Vector3();
|
|
1899
1897
|
this._grid = null;
|
|
1900
|
-
this._gridPosition = new
|
|
1901
|
-
this._gizmos = new
|
|
1898
|
+
this._gridPosition = new Vector3();
|
|
1899
|
+
this._gizmos = new Group();
|
|
1902
1900
|
this._curvePts = 128;
|
|
1903
1901
|
this._timeStart = -1;
|
|
1904
1902
|
this._animationId = -1;
|
|
@@ -1907,8 +1905,8 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1907
1905
|
this._timeCurrent = 0;
|
|
1908
1906
|
this._anglePrev = 0;
|
|
1909
1907
|
this._angleCurrent = 0;
|
|
1910
|
-
this._cursorPosPrev = new
|
|
1911
|
-
this._cursorPosCurr = new
|
|
1908
|
+
this._cursorPosPrev = new Vector3();
|
|
1909
|
+
this._cursorPosCurr = new Vector3();
|
|
1912
1910
|
this._wPrev = 0;
|
|
1913
1911
|
this._wCurr = 0;
|
|
1914
1912
|
this.adjustNearFar = false;
|
|
@@ -1928,8 +1926,8 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1928
1926
|
this.maxDistance = Infinity;
|
|
1929
1927
|
this.minZoom = 0;
|
|
1930
1928
|
this.maxZoom = Infinity;
|
|
1931
|
-
this.target = new
|
|
1932
|
-
this._currentTarget = new
|
|
1929
|
+
this.target = new Vector3(0, 0, 0);
|
|
1930
|
+
this._currentTarget = new Vector3(0, 0, 0);
|
|
1933
1931
|
this._tbRadius = 1;
|
|
1934
1932
|
this._state = STATE.IDLE;
|
|
1935
1933
|
this.setCamera(camera);
|
|
@@ -1967,9 +1965,9 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
1967
1965
|
}
|
|
1968
1966
|
if (this.adjustNearFar) {
|
|
1969
1967
|
const cameraDistance = this.camera.position.distanceTo(this._gizmos.position);
|
|
1970
|
-
const bb = new
|
|
1968
|
+
const bb = new Box3();
|
|
1971
1969
|
bb.setFromObject(this._gizmos);
|
|
1972
|
-
const sphere = new
|
|
1970
|
+
const sphere = new Sphere();
|
|
1973
1971
|
bb.getBoundingSphere(sphere);
|
|
1974
1972
|
const adjustedNearPosition = Math.max(this._nearPos0, sphere.radius + sphere.center.length());
|
|
1975
1973
|
const regularNearPosition = cameraDistance - this._initialNear;
|
|
@@ -2030,4 +2028,6 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
|
2030
2028
|
}
|
|
2031
2029
|
}
|
|
2032
2030
|
}
|
|
2033
|
-
|
|
2031
|
+
export {
|
|
2032
|
+
ArcballControls
|
|
2033
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
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
|
-
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
const THREE = require("three");
|
|
10
|
+
class DeviceOrientationControls extends THREE.EventDispatcher {
|
|
9
11
|
// radians
|
|
10
12
|
constructor(object) {
|
|
11
13
|
super();
|
|
@@ -23,10 +25,10 @@ class DeviceOrientationControls extends EventDispatcher {
|
|
|
23
25
|
this.screenOrientation = window.orientation || 0;
|
|
24
26
|
});
|
|
25
27
|
// The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''
|
|
26
|
-
__publicField(this, "zee", new Vector3(0, 0, 1));
|
|
27
|
-
__publicField(this, "euler", new Euler());
|
|
28
|
-
__publicField(this, "q0", new Quaternion());
|
|
29
|
-
__publicField(this, "q1", new Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)));
|
|
28
|
+
__publicField(this, "zee", new THREE.Vector3(0, 0, 1));
|
|
29
|
+
__publicField(this, "euler", new THREE.Euler());
|
|
30
|
+
__publicField(this, "q0", new THREE.Quaternion());
|
|
31
|
+
__publicField(this, "q1", new THREE.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)));
|
|
30
32
|
// - PI/2 around the x-axis
|
|
31
33
|
__publicField(this, "setObjectQuaternion", (quaternion, alpha, beta, gamma, orient) => {
|
|
32
34
|
this.euler.set(beta, alpha, -gamma, "YXZ");
|
|
@@ -57,16 +59,16 @@ class DeviceOrientationControls extends EventDispatcher {
|
|
|
57
59
|
window.removeEventListener("deviceorientation", this.onDeviceOrientationChangeEvent);
|
|
58
60
|
this.enabled = false;
|
|
59
61
|
});
|
|
60
|
-
__publicField(this, "lastQuaternion", new Quaternion());
|
|
62
|
+
__publicField(this, "lastQuaternion", new THREE.Quaternion());
|
|
61
63
|
__publicField(this, "update", () => {
|
|
62
64
|
if (this.enabled === false)
|
|
63
65
|
return;
|
|
64
66
|
const device = this.deviceOrientation;
|
|
65
67
|
if (device) {
|
|
66
|
-
const alpha = device.alpha ? MathUtils.degToRad(device.alpha) + this.alphaOffset : 0;
|
|
67
|
-
const beta = device.beta ? MathUtils.degToRad(device.beta) : 0;
|
|
68
|
-
const gamma = device.gamma ? MathUtils.degToRad(device.gamma) : 0;
|
|
69
|
-
const orient = this.screenOrientation ? MathUtils.degToRad(this.screenOrientation) : 0;
|
|
68
|
+
const alpha = device.alpha ? THREE.MathUtils.degToRad(device.alpha) + this.alphaOffset : 0;
|
|
69
|
+
const beta = device.beta ? THREE.MathUtils.degToRad(device.beta) : 0;
|
|
70
|
+
const gamma = device.gamma ? THREE.MathUtils.degToRad(device.gamma) : 0;
|
|
71
|
+
const orient = this.screenOrientation ? THREE.MathUtils.degToRad(this.screenOrientation) : 0;
|
|
70
72
|
this.setObjectQuaternion(this.object.quaternion, alpha, beta, gamma, orient);
|
|
71
73
|
if (8 * (1 - this.lastQuaternion.dot(this.object.quaternion)) > this.EPS) {
|
|
72
74
|
this.lastQuaternion.copy(this.object.quaternion);
|
|
@@ -80,6 +82,4 @@ class DeviceOrientationControls extends EventDispatcher {
|
|
|
80
82
|
this.connect();
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
|
-
|
|
84
|
-
DeviceOrientationControls
|
|
85
|
-
};
|
|
85
|
+
exports.DeviceOrientationControls = DeviceOrientationControls;
|