three-stdlib 2.22.9 → 2.23.0
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/animation/AnimationClipCreator.js +49 -50
- package/dist/animation/AnimationClipCreator.mjs +49 -50
- package/dist/animation/CCDIKSolver.d.ts +9 -4
- package/dist/animation/CCDIKSolver.js +193 -148
- package/dist/animation/CCDIKSolver.mjs +194 -149
- package/dist/animation/MMDAnimationHelper.js +613 -515
- package/dist/animation/MMDAnimationHelper.mjs +613 -515
- package/dist/animation/MMDPhysics.d.ts +6 -1
- package/dist/animation/MMDPhysics.js +728 -718
- package/dist/animation/MMDPhysics.mjs +729 -719
- package/dist/cameras/CinematicCamera.d.ts +2 -2
- package/dist/controls/ArcballControls.d.ts +1 -1
- package/dist/controls/ArcballControls.js +38 -44
- package/dist/controls/ArcballControls.mjs +39 -45
- package/dist/controls/DeviceOrientationControls.js +2 -1
- package/dist/controls/DeviceOrientationControls.mjs +2 -1
- package/dist/controls/FirstPersonControls.d.ts +1 -1
- package/dist/controls/FirstPersonControls.js +1 -1
- package/dist/controls/FirstPersonControls.mjs +1 -1
- package/dist/controls/PointerLockControls.js +2 -2
- package/dist/controls/PointerLockControls.mjs +2 -2
- package/dist/controls/TrackballControls.d.ts +2 -2
- package/dist/controls/TransformControls.d.ts +1 -1
- package/dist/controls/experimental/CameraControls.d.ts +1 -1
- package/dist/csm/CSM.js +4 -4
- package/dist/csm/CSM.mjs +4 -4
- package/dist/csm/CSMFrustum.js +1 -1
- package/dist/csm/CSMFrustum.mjs +1 -1
- package/dist/csm/CSMShader.js +14 -10
- package/dist/csm/CSMShader.mjs +14 -10
- package/dist/curves/CurveExtras.js +52 -62
- package/dist/curves/CurveExtras.mjs +53 -63
- package/dist/curves/NURBSUtils.d.ts +18 -20
- package/dist/curves/NURBSUtils.js +17 -17
- package/dist/curves/NURBSUtils.mjs +17 -17
- package/dist/deprecated/Geometry.js +26 -26
- package/dist/deprecated/Geometry.mjs +27 -27
- package/dist/effects/AnaglyphEffect.js +95 -114
- package/dist/effects/AnaglyphEffect.mjs +95 -114
- package/dist/effects/AsciiEffect.js +144 -162
- package/dist/effects/AsciiEffect.mjs +144 -162
- package/dist/effects/OutlineEffect.js +253 -276
- package/dist/effects/OutlineEffect.mjs +253 -276
- package/dist/effects/ParallaxBarrierEffect.js +61 -60
- package/dist/effects/ParallaxBarrierEffect.mjs +61 -60
- package/dist/effects/PeppersGhostEffect.js +84 -81
- package/dist/effects/PeppersGhostEffect.mjs +84 -81
- package/dist/effects/StereoEffect.js +31 -28
- package/dist/effects/StereoEffect.mjs +31 -28
- package/dist/environments/RoomEnvironment.d.ts +6 -5
- package/dist/exporters/GLTFExporter.d.ts +109 -441
- package/dist/exporters/GLTFExporter.js +915 -581
- package/dist/exporters/GLTFExporter.mjs +915 -581
- package/dist/geometries/ConvexGeometry.js +0 -3
- package/dist/geometries/ConvexGeometry.mjs +0 -3
- package/dist/geometries/LightningStrike.d.ts +3 -3
- package/dist/geometries/LightningStrike.js +80 -75
- package/dist/geometries/LightningStrike.mjs +80 -75
- package/dist/geometries/ParametricGeometries.js +75 -74
- package/dist/geometries/ParametricGeometries.mjs +75 -74
- package/dist/geometries/RoundedBoxGeometry.js +1 -1
- package/dist/geometries/RoundedBoxGeometry.mjs +1 -1
- package/dist/geometries/TextGeometry.d.ts +1 -1
- package/dist/helpers/RectAreaLightHelper.d.ts +4 -3
- package/dist/helpers/RectAreaLightHelper.js +2 -2
- package/dist/helpers/RectAreaLightHelper.mjs +2 -2
- package/dist/helpers/VertexNormalsHelper.d.ts +3 -0
- package/dist/helpers/VertexNormalsHelper.js +15 -22
- package/dist/helpers/VertexNormalsHelper.mjs +16 -23
- package/dist/helpers/VertexTangentsHelper.d.ts +3 -0
- package/dist/helpers/VertexTangentsHelper.js +12 -14
- package/dist/helpers/VertexTangentsHelper.mjs +12 -14
- package/dist/index.d.ts +1 -66
- package/dist/index.js +5 -370
- package/dist/index.mjs +9 -374
- package/dist/interactive/InteractiveGroup.js +1 -1
- package/dist/interactive/InteractiveGroup.mjs +1 -1
- package/dist/interactive/SelectionBox.js +122 -125
- package/dist/interactive/SelectionBox.mjs +122 -125
- package/dist/interactive/SelectionHelper.js +45 -48
- package/dist/interactive/SelectionHelper.mjs +45 -48
- package/dist/libs/MeshoptDecoder.d.ts +1 -1
- package/dist/libs/MotionControllers.d.ts +15 -14
- package/dist/libs/MotionControllers.js +10 -10
- package/dist/libs/MotionControllers.mjs +10 -10
- package/dist/lights/LightProbeGenerator.js +43 -43
- package/dist/lights/LightProbeGenerator.mjs +43 -43
- package/dist/lights/RectAreaLightUniformsLib.js +9 -5
- package/dist/lights/RectAreaLightUniformsLib.mjs +9 -5
- package/dist/lines/LineMaterial.js +271 -271
- package/dist/lines/LineMaterial.mjs +272 -272
- package/dist/lines/LineSegments2.js +12 -12
- package/dist/lines/LineSegments2.mjs +12 -12
- package/dist/lines/LineSegmentsGeometry.js +2 -2
- package/dist/lines/LineSegmentsGeometry.mjs +2 -2
- package/dist/lines/Wireframe.js +2 -2
- package/dist/lines/Wireframe.mjs +2 -2
- package/dist/loaders/3DMLoader.d.ts +2 -1
- package/dist/loaders/3MFLoader.d.ts +2 -1
- package/dist/loaders/AMFLoader.d.ts +2 -1
- package/dist/loaders/AssimpLoader.d.ts +20 -0
- package/dist/loaders/AssimpLoader.js +520 -482
- package/dist/loaders/AssimpLoader.mjs +520 -482
- package/dist/loaders/BVHLoader.d.ts +2 -1
- package/dist/loaders/BasisTextureLoader.d.ts +2 -1
- package/dist/loaders/BasisTextureLoader.js +23 -14
- package/dist/loaders/BasisTextureLoader.mjs +24 -15
- package/dist/loaders/ColladaLoader.d.ts +2 -1
- package/dist/loaders/DRACOLoader.d.ts +2 -1
- package/dist/loaders/FBXLoader.d.ts +2 -1
- package/dist/loaders/FBXLoader.js +2 -2
- package/dist/loaders/FBXLoader.mjs +2 -2
- package/dist/loaders/FontLoader.d.ts +4 -4
- package/dist/loaders/FontLoader.js +2 -1
- package/dist/loaders/FontLoader.mjs +2 -1
- package/dist/loaders/GCodeLoader.d.ts +2 -1
- package/dist/loaders/GLTFLoader.d.ts +11 -9
- package/dist/loaders/GLTFLoader.js +2 -2
- package/dist/loaders/GLTFLoader.mjs +2 -2
- package/dist/loaders/HDRCubeTextureLoader.d.ts +2 -1
- package/dist/loaders/KMZLoader.d.ts +2 -1
- package/dist/loaders/KTX2Loader.js +34 -15
- package/dist/loaders/KTX2Loader.mjs +35 -16
- package/dist/loaders/LDrawLoader.d.ts +2 -1
- package/dist/loaders/LDrawLoader.js +3 -3
- package/dist/loaders/LDrawLoader.mjs +3 -3
- package/dist/loaders/LUT3dlLoader.d.ts +3 -2
- package/dist/loaders/LUTCubeLoader.d.ts +3 -2
- package/dist/loaders/LWOLoader.d.ts +2 -1
- package/dist/loaders/LottieLoader.d.ts +2 -1
- package/dist/loaders/MD2Loader.d.ts +2 -1
- package/dist/loaders/MDDLoader.d.ts +2 -1
- package/dist/loaders/MMDLoader.d.ts +2 -1
- package/dist/loaders/MTLLoader.d.ts +2 -1
- package/dist/loaders/OBJLoader.d.ts +2 -1
- package/dist/loaders/OBJLoader.js +5 -5
- package/dist/loaders/OBJLoader.mjs +5 -5
- package/dist/loaders/PCDLoader.d.ts +2 -1
- package/dist/loaders/PDBLoader.d.ts +2 -1
- package/dist/loaders/PLYLoader.d.ts +2 -1
- package/dist/loaders/PRWMLoader.d.ts +2 -1
- package/dist/loaders/RGBMLoader.js +924 -918
- package/dist/loaders/RGBMLoader.mjs +924 -918
- package/dist/loaders/STLLoader.d.ts +2 -1
- package/dist/loaders/SVGLoader.d.ts +2 -1
- package/dist/loaders/TDSLoader.d.ts +2 -1
- package/dist/loaders/TTFLoader.d.ts +2 -1
- package/dist/loaders/TiltLoader.d.ts +2 -1
- package/dist/loaders/TiltLoader.js +3 -1
- package/dist/loaders/TiltLoader.mjs +3 -1
- package/dist/loaders/VOXLoader.d.ts +4 -2
- package/dist/loaders/VRMLLoader.d.ts +2 -1
- package/dist/loaders/VRMLoader.d.ts +20 -0
- package/dist/loaders/VTKLoader.d.ts +2 -1
- package/dist/loaders/XLoader.d.ts +20 -0
- package/dist/loaders/XLoader.js +1 -1
- package/dist/loaders/XLoader.mjs +1 -1
- package/dist/loaders/XYZLoader.d.ts +2 -1
- package/dist/loaders/lwo/IFFParser.js +104 -110
- package/dist/loaders/lwo/IFFParser.mjs +104 -110
- package/dist/loaders/lwo/LWO2Parser.js +18 -33
- package/dist/loaders/lwo/LWO2Parser.mjs +18 -33
- package/dist/loaders/lwo/LWO3Parser.js +17 -33
- package/dist/loaders/lwo/LWO3Parser.mjs +17 -33
- package/dist/math/Capsule.d.ts +1 -1
- package/dist/math/Capsule.js +90 -92
- package/dist/math/Capsule.mjs +90 -92
- package/dist/math/ColorConverter.js +26 -36
- package/dist/math/ColorConverter.mjs +26 -36
- package/dist/math/ConvexHull.js +16 -17
- package/dist/math/ConvexHull.mjs +17 -18
- package/dist/math/ImprovedNoise.js +41 -39
- package/dist/math/ImprovedNoise.mjs +41 -39
- package/dist/math/Lut.js +65 -63
- package/dist/math/Lut.mjs +66 -64
- package/dist/math/MeshSurfaceSampler.d.ts +3 -0
- package/dist/math/MeshSurfaceSampler.js +85 -89
- package/dist/math/MeshSurfaceSampler.mjs +85 -89
- package/dist/math/OBB.js +68 -88
- package/dist/math/OBB.mjs +68 -88
- package/dist/math/Octree.js +240 -245
- package/dist/math/Octree.mjs +240 -245
- package/dist/misc/ConvexObjectBreaker.js +114 -120
- package/dist/misc/ConvexObjectBreaker.mjs +115 -121
- package/dist/misc/GPUComputationRenderer.d.ts +1 -0
- package/dist/misc/GPUComputationRenderer.js +191 -157
- package/dist/misc/GPUComputationRenderer.mjs +192 -158
- package/dist/misc/Gyroscope.js +16 -18
- package/dist/misc/Gyroscope.mjs +17 -19
- package/dist/misc/MD2Character.js +88 -86
- package/dist/misc/MD2Character.mjs +89 -87
- package/dist/misc/MD2CharacterComplex.js +106 -105
- package/dist/misc/MD2CharacterComplex.mjs +107 -106
- package/dist/misc/MorphAnimMesh.d.ts +1 -1
- package/dist/misc/MorphAnimMesh.js +33 -33
- package/dist/misc/MorphAnimMesh.mjs +33 -33
- package/dist/misc/MorphBlendMesh.js +68 -68
- package/dist/misc/MorphBlendMesh.mjs +68 -68
- package/dist/misc/ProgressiveLightmap.d.ts +1 -2
- package/dist/misc/RollerCoaster.js +321 -314
- package/dist/misc/RollerCoaster.mjs +322 -315
- package/dist/misc/Volume.d.ts +1 -1
- package/dist/misc/Volume.js +169 -166
- package/dist/misc/Volume.mjs +170 -167
- package/dist/misc/VolumeSlice.js +50 -51
- package/dist/misc/VolumeSlice.mjs +50 -51
- package/dist/modifiers/CurveModifier.d.ts +2 -2
- package/dist/modifiers/CurveModifier.js +1 -1
- package/dist/modifiers/CurveModifier.mjs +1 -1
- package/dist/modifiers/SimplifyModifier.js +2 -1
- package/dist/modifiers/SimplifyModifier.mjs +2 -1
- package/dist/objects/Lensflare.js +32 -21
- package/dist/objects/Lensflare.mjs +33 -22
- package/dist/objects/LightningStorm.d.ts +3 -3
- package/dist/objects/LightningStorm.js +3 -3
- package/dist/objects/LightningStorm.mjs +3 -3
- package/dist/objects/MarchingCubes.d.ts +1 -0
- package/dist/objects/MarchingCubes.js +4362 -10
- package/dist/objects/MarchingCubes.mjs +4363 -11
- package/dist/objects/Reflector.d.ts +5 -2
- package/dist/objects/Reflector.js +39 -12
- package/dist/objects/Reflector.mjs +40 -13
- package/dist/objects/ReflectorForSSRPass.js +25 -21
- package/dist/objects/ReflectorForSSRPass.mjs +26 -22
- package/dist/objects/ReflectorRTT.d.ts +6 -0
- package/dist/objects/Refractor.d.ts +5 -2
- package/dist/objects/Refractor.js +39 -12
- package/dist/objects/Refractor.mjs +40 -13
- package/dist/objects/ShadowMesh.d.ts +6 -3
- package/dist/objects/ShadowMesh.js +7 -3
- package/dist/objects/ShadowMesh.mjs +8 -4
- package/dist/objects/Sky.js +181 -137
- package/dist/objects/Sky.mjs +182 -138
- package/dist/objects/Water.d.ts +3 -3
- package/dist/objects/Water.js +3 -2
- package/dist/objects/Water.mjs +3 -2
- package/dist/objects/Water2.d.ts +2 -2
- package/dist/objects/Water2.js +16 -18
- package/dist/objects/Water2.mjs +17 -19
- package/dist/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
- package/dist/postprocessing/AdaptiveToneMappingPass.js +105 -112
- package/dist/postprocessing/AdaptiveToneMappingPass.mjs +107 -114
- package/dist/postprocessing/BokehPass.d.ts +1 -1
- package/dist/postprocessing/ClearPass.d.ts +3 -3
- package/dist/postprocessing/CubeTexturePass.js +37 -33
- package/dist/postprocessing/CubeTexturePass.mjs +37 -33
- package/dist/postprocessing/HalftonePass.d.ts +1 -1
- package/dist/postprocessing/LUTPass.d.ts +3 -3
- package/dist/postprocessing/RenderPixelatedPass.d.ts +28 -0
- package/dist/postprocessing/SAOPass.d.ts +5 -6
- package/dist/postprocessing/SAOPass.js +151 -145
- package/dist/postprocessing/SAOPass.mjs +153 -147
- package/dist/postprocessing/SSAARenderPass.d.ts +5 -5
- package/dist/postprocessing/SSAARenderPass.js +78 -55
- package/dist/postprocessing/SSAARenderPass.mjs +80 -57
- package/dist/postprocessing/SSAOPass.d.ts +4 -5
- package/dist/postprocessing/SSAOPass.js +17 -10
- package/dist/postprocessing/SSAOPass.mjs +17 -10
- package/dist/postprocessing/SSRPass.d.ts +6 -7
- package/dist/postprocessing/SSRPass.js +235 -262
- package/dist/postprocessing/SSRPass.mjs +237 -264
- package/dist/postprocessing/TAARenderPass.d.ts +2 -2
- package/dist/postprocessing/TAARenderPass.js +106 -27
- package/dist/postprocessing/TAARenderPass.mjs +107 -28
- package/dist/postprocessing/TexturePass.d.ts +2 -2
- package/dist/postprocessing/TexturePass.js +24 -22
- package/dist/postprocessing/TexturePass.mjs +25 -23
- package/dist/postprocessing/UnrealBloomPass.js +175 -118
- package/dist/postprocessing/UnrealBloomPass.mjs +177 -120
- package/dist/renderers/CSS2DRenderer.d.ts +2 -1
- package/dist/renderers/CSS2DRenderer.js +5 -4
- package/dist/renderers/CSS2DRenderer.mjs +6 -5
- package/dist/renderers/CSS3DRenderer.d.ts +1 -1
- package/dist/renderers/CSS3DRenderer.js +147 -113
- package/dist/renderers/CSS3DRenderer.mjs +148 -114
- package/dist/renderers/Projector.js +377 -389
- package/dist/renderers/Projector.mjs +377 -389
- package/dist/renderers/SVGRenderer.js +280 -275
- package/dist/renderers/SVGRenderer.mjs +280 -275
- package/dist/shaders/ACESFilmicToneMappingShader.d.ts +1 -1
- package/dist/shaders/AfterimageShader.d.ts +1 -1
- package/dist/shaders/BasicShader.d.ts +1 -1
- package/dist/shaders/BleachBypassShader.d.ts +1 -1
- package/dist/shaders/BokehShader.d.ts +2 -2
- package/dist/shaders/BokehShader2.d.ts +2 -2
- package/dist/shaders/BokehShader2.js +1 -1
- package/dist/shaders/BokehShader2.mjs +1 -1
- package/dist/shaders/ColorCorrectionShader.js +3 -3
- package/dist/shaders/ColorCorrectionShader.mjs +3 -3
- package/dist/shaders/ColorifyShader.js +1 -1
- package/dist/shaders/ColorifyShader.mjs +1 -1
- package/dist/shaders/ConvolutionShader.d.ts +2 -2
- package/dist/shaders/ConvolutionShader.js +1 -1
- package/dist/shaders/ConvolutionShader.mjs +1 -1
- package/dist/shaders/CopyShader.d.ts +1 -1
- package/dist/shaders/DepthLimitedBlurShader.d.ts +2 -2
- package/dist/shaders/DepthLimitedBlurShader.js +2 -2
- package/dist/shaders/DepthLimitedBlurShader.mjs +2 -2
- package/dist/shaders/DotScreenShader.js +2 -2
- package/dist/shaders/DotScreenShader.mjs +2 -2
- package/dist/shaders/FXAAShader.js +1 -1
- package/dist/shaders/FXAAShader.mjs +1 -1
- package/dist/shaders/FreiChenShader.js +1 -1
- package/dist/shaders/FreiChenShader.mjs +1 -1
- package/dist/shaders/GammaCorrectionShader.d.ts +1 -1
- package/dist/shaders/GodRaysShader.js +4 -4
- package/dist/shaders/GodRaysShader.mjs +4 -4
- package/dist/shaders/HorizontalBlurShader.d.ts +1 -1
- package/dist/shaders/LuminosityHighPassShader.js +1 -1
- package/dist/shaders/LuminosityHighPassShader.mjs +1 -1
- package/dist/shaders/NormalMapShader.js +2 -2
- package/dist/shaders/NormalMapShader.mjs +2 -2
- package/dist/shaders/SAOShader.d.ts +2 -2
- package/dist/shaders/SAOShader.js +3 -3
- package/dist/shaders/SAOShader.mjs +3 -3
- package/dist/shaders/SMAAShader.js +3 -3
- package/dist/shaders/SMAAShader.mjs +3 -3
- package/dist/shaders/SSAOShader.js +4 -4
- package/dist/shaders/SSAOShader.mjs +4 -4
- package/dist/shaders/SSRShader.js +4 -4
- package/dist/shaders/SSRShader.mjs +4 -4
- package/dist/shaders/SobelOperatorShader.js +1 -1
- package/dist/shaders/SobelOperatorShader.mjs +1 -1
- package/dist/shaders/SubsurfaceScatteringShader.d.ts +2 -2
- package/dist/shaders/SubsurfaceScatteringShader.js +91 -52
- package/dist/shaders/SubsurfaceScatteringShader.mjs +91 -52
- package/dist/shaders/ToonShader.js +25 -25
- package/dist/shaders/ToonShader.mjs +25 -25
- package/dist/shaders/TriangleBlurShader.js +1 -1
- package/dist/shaders/TriangleBlurShader.mjs +1 -1
- package/dist/shaders/VerticalBlurShader.d.ts +1 -1
- package/dist/shaders/VolumeShader.js +2 -2
- package/dist/shaders/VolumeShader.mjs +2 -2
- package/dist/shaders/types.d.ts +2 -2
- package/dist/types/Loader.d.ts +4 -0
- package/dist/types/Loader.js +26 -0
- package/dist/types/Loader.mjs +9 -0
- package/dist/types/shared.d.ts +2 -2
- package/dist/types/utils.d.ts +1 -1
- package/dist/utils/BufferGeometryUtils.d.ts +2 -2
- package/dist/utils/BufferGeometryUtils.js +1 -1
- package/dist/utils/BufferGeometryUtils.mjs +1 -1
- package/dist/utils/RoughnessMipmapper.d.ts +8 -0
- package/dist/utils/RoughnessMipmapper.js +79 -75
- package/dist/utils/RoughnessMipmapper.mjs +79 -75
- package/dist/utils/ShadowMapViewer.js +103 -106
- package/dist/utils/ShadowMapViewer.mjs +103 -106
- package/dist/utils/SkeletonUtils.d.ts +5 -21
- package/dist/utils/SkeletonUtils.js +182 -263
- package/dist/utils/SkeletonUtils.mjs +183 -264
- package/dist/utils/UVsDebug.js +37 -42
- package/dist/utils/UVsDebug.mjs +37 -42
- package/dist/webxr/ARButton.d.ts +2 -1
- package/dist/webxr/OculusHandModel.d.ts +2 -1
- package/dist/webxr/OculusHandPointerModel.d.ts +2 -2
- package/dist/webxr/OculusHandPointerModel.js +2 -2
- package/dist/webxr/OculusHandPointerModel.mjs +2 -2
- package/dist/webxr/VRButton.d.ts +2 -1
- package/dist/webxr/XRHandPrimitiveModel.js +2 -2
- package/dist/webxr/XRHandPrimitiveModel.mjs +2 -2
- package/package.json +5 -6
- package/dist/custom.d.ts +0 -5
- package/dist/loaders/NodeMaterialLoader.js +0 -146
- package/dist/loaders/NodeMaterialLoader.mjs +0 -146
- package/dist/nodes/Nodes.js +0 -347
- package/dist/nodes/Nodes.mjs +0 -347
- package/dist/nodes/ShaderNode.js +0 -408
- package/dist/nodes/ShaderNode.mjs +0 -408
- package/dist/nodes/accessors/BufferNode.js +0 -14
- package/dist/nodes/accessors/BufferNode.mjs +0 -15
- package/dist/nodes/accessors/CameraNode.js +0 -43
- package/dist/nodes/accessors/CameraNode.mjs +0 -44
- package/dist/nodes/accessors/CubeTextureNode.js +0 -41
- package/dist/nodes/accessors/CubeTextureNode.mjs +0 -42
- package/dist/nodes/accessors/MaterialNode.js +0 -70
- package/dist/nodes/accessors/MaterialNode.mjs +0 -71
- package/dist/nodes/accessors/MaterialReferenceNode.js +0 -13
- package/dist/nodes/accessors/MaterialReferenceNode.mjs +0 -14
- package/dist/nodes/accessors/ModelNode.js +0 -8
- package/dist/nodes/accessors/ModelNode.mjs +0 -9
- package/dist/nodes/accessors/ModelViewProjectionNode.js +0 -23
- package/dist/nodes/accessors/ModelViewProjectionNode.mjs +0 -24
- package/dist/nodes/accessors/NormalNode.js +0 -61
- package/dist/nodes/accessors/NormalNode.mjs +0 -62
- package/dist/nodes/accessors/Object3DNode.js +0 -75
- package/dist/nodes/accessors/Object3DNode.mjs +0 -76
- package/dist/nodes/accessors/PointUVNode.js +0 -12
- package/dist/nodes/accessors/PointUVNode.mjs +0 -13
- package/dist/nodes/accessors/PositionNode.js +0 -64
- package/dist/nodes/accessors/PositionNode.mjs +0 -65
- package/dist/nodes/accessors/ReferenceNode.js +0 -36
- package/dist/nodes/accessors/ReferenceNode.mjs +0 -37
- package/dist/nodes/accessors/ReflectNode.js +0 -42
- package/dist/nodes/accessors/ReflectNode.mjs +0 -43
- package/dist/nodes/accessors/SkinningNode.js +0 -57
- package/dist/nodes/accessors/SkinningNode.mjs +0 -58
- package/dist/nodes/accessors/TextureNode.js +0 -53
- package/dist/nodes/accessors/TextureNode.mjs +0 -54
- package/dist/nodes/accessors/UVNode.js +0 -22
- package/dist/nodes/accessors/UVNode.mjs +0 -23
- package/dist/nodes/core/ArrayUniformNode.js +0 -13
- package/dist/nodes/core/ArrayUniformNode.mjs +0 -14
- package/dist/nodes/core/AttributeNode.js +0 -29
- package/dist/nodes/core/AttributeNode.mjs +0 -30
- package/dist/nodes/core/BypassNode.js +0 -21
- package/dist/nodes/core/BypassNode.mjs +0 -22
- package/dist/nodes/core/CodeNode.js +0 -27
- package/dist/nodes/core/CodeNode.mjs +0 -28
- package/dist/nodes/core/ConstNode.js +0 -13
- package/dist/nodes/core/ConstNode.mjs +0 -14
- package/dist/nodes/core/ContextNode.js +0 -21
- package/dist/nodes/core/ContextNode.mjs +0 -22
- package/dist/nodes/core/ExpressionNode.js +0 -18
- package/dist/nodes/core/ExpressionNode.mjs +0 -19
- package/dist/nodes/core/FunctionCallNode.js +0 -36
- package/dist/nodes/core/FunctionCallNode.mjs +0 -37
- package/dist/nodes/core/FunctionNode.js +0 -55
- package/dist/nodes/core/FunctionNode.mjs +0 -56
- package/dist/nodes/core/InputNode.js +0 -37
- package/dist/nodes/core/InputNode.mjs +0 -38
- package/dist/nodes/core/Node.js +0 -138
- package/dist/nodes/core/Node.mjs +0 -139
- package/dist/nodes/core/NodeAttribute.js +0 -9
- package/dist/nodes/core/NodeAttribute.mjs +0 -10
- package/dist/nodes/core/NodeBuilder.js +0 -402
- package/dist/nodes/core/NodeBuilder.mjs +0 -402
- package/dist/nodes/core/NodeCode.js +0 -10
- package/dist/nodes/core/NodeCode.mjs +0 -11
- package/dist/nodes/core/NodeFrame.js +0 -34
- package/dist/nodes/core/NodeFrame.mjs +0 -35
- package/dist/nodes/core/NodeFunctionInput.js +0 -12
- package/dist/nodes/core/NodeFunctionInput.mjs +0 -13
- package/dist/nodes/core/NodeKeywords.js +0 -43
- package/dist/nodes/core/NodeKeywords.mjs +0 -44
- package/dist/nodes/core/NodeUniform.js +0 -17
- package/dist/nodes/core/NodeUniform.mjs +0 -18
- package/dist/nodes/core/NodeUtils.js +0 -57
- package/dist/nodes/core/NodeUtils.mjs +0 -57
- package/dist/nodes/core/NodeVar.js +0 -9
- package/dist/nodes/core/NodeVar.mjs +0 -10
- package/dist/nodes/core/NodeVary.js +0 -9
- package/dist/nodes/core/NodeVary.mjs +0 -10
- package/dist/nodes/core/PropertyNode.js +0 -20
- package/dist/nodes/core/PropertyNode.mjs +0 -21
- package/dist/nodes/core/TempNode.js +0 -24
- package/dist/nodes/core/TempNode.mjs +0 -25
- package/dist/nodes/core/UniformNode.js +0 -22
- package/dist/nodes/core/UniformNode.mjs +0 -23
- package/dist/nodes/core/VarNode.js +0 -30
- package/dist/nodes/core/VarNode.mjs +0 -31
- package/dist/nodes/core/VaryNode.js +0 -29
- package/dist/nodes/core/VaryNode.mjs +0 -30
- package/dist/nodes/core/constants.js +0 -24
- package/dist/nodes/core/constants.mjs +0 -24
- package/dist/nodes/display/ColorSpaceNode.js +0 -62
- package/dist/nodes/display/ColorSpaceNode.mjs +0 -62
- package/dist/nodes/display/NormalMapNode.js +0 -53
- package/dist/nodes/display/NormalMapNode.mjs +0 -54
- package/dist/nodes/fog/FogNode.js +0 -14
- package/dist/nodes/fog/FogNode.mjs +0 -15
- package/dist/nodes/fog/FogRangeNode.js +0 -16
- package/dist/nodes/fog/FogRangeNode.mjs +0 -17
- package/dist/nodes/functions/BSDFs.js +0 -64
- package/dist/nodes/functions/BSDFs.mjs +0 -64
- package/dist/nodes/lights/LightContextNode.js +0 -34
- package/dist/nodes/lights/LightContextNode.mjs +0 -35
- package/dist/nodes/lights/LightNode.js +0 -57
- package/dist/nodes/lights/LightNode.mjs +0 -58
- package/dist/nodes/lights/LightsNode.js +0 -58
- package/dist/nodes/lights/LightsNode.mjs +0 -59
- package/dist/nodes/loaders/NodeLoader.js +0 -195
- package/dist/nodes/loaders/NodeLoader.mjs +0 -196
- package/dist/nodes/loaders/NodeMaterialLoader.js +0 -23
- package/dist/nodes/loaders/NodeMaterialLoader.mjs +0 -24
- package/dist/nodes/loaders/NodeObjectLoader.js +0 -39
- package/dist/nodes/loaders/NodeObjectLoader.mjs +0 -40
- package/dist/nodes/materials/LineBasicNodeMaterial.js +0 -26
- package/dist/nodes/materials/LineBasicNodeMaterial.mjs +0 -27
- package/dist/nodes/materials/Materials.js +0 -24
- package/dist/nodes/materials/Materials.mjs +0 -24
- package/dist/nodes/materials/MeshBasicNodeMaterial.js +0 -27
- package/dist/nodes/materials/MeshBasicNodeMaterial.mjs +0 -28
- package/dist/nodes/materials/MeshStandardNodeMaterial.js +0 -40
- package/dist/nodes/materials/MeshStandardNodeMaterial.mjs +0 -41
- package/dist/nodes/materials/NodeMaterial.js +0 -63
- package/dist/nodes/materials/NodeMaterial.mjs +0 -64
- package/dist/nodes/materials/PointsNodeMaterial.js +0 -29
- package/dist/nodes/materials/PointsNodeMaterial.mjs +0 -30
- package/dist/nodes/math/CondNode.js +0 -40
- package/dist/nodes/math/CondNode.mjs +0 -41
- package/dist/nodes/math/MathNode.js +0 -165
- package/dist/nodes/math/MathNode.mjs +0 -166
- package/dist/nodes/math/OperatorNode.js +0 -102
- package/dist/nodes/math/OperatorNode.mjs +0 -103
- package/dist/nodes/procedural/CheckerNode.js +0 -20
- package/dist/nodes/procedural/CheckerNode.mjs +0 -21
- package/dist/nodes/utils/ArrayElementNode.js +0 -18
- package/dist/nodes/utils/ArrayElementNode.mjs +0 -19
- package/dist/nodes/utils/ConvertNode.js +0 -24
- package/dist/nodes/utils/ConvertNode.mjs +0 -25
- package/dist/nodes/utils/JoinNode.js +0 -25
- package/dist/nodes/utils/JoinNode.mjs +0 -26
- package/dist/nodes/utils/MatcapUVNode.js +0 -15
- package/dist/nodes/utils/MatcapUVNode.mjs +0 -16
- package/dist/nodes/utils/OscNode.js +0 -49
- package/dist/nodes/utils/OscNode.mjs +0 -50
- package/dist/nodes/utils/SplitNode.js +0 -44
- package/dist/nodes/utils/SplitNode.mjs +0 -45
- package/dist/nodes/utils/SpriteSheetUVNode.js +0 -39
- package/dist/nodes/utils/SpriteSheetUVNode.mjs +0 -40
- package/dist/nodes/utils/TimerNode.js +0 -43
- package/dist/nodes/utils/TimerNode.mjs +0 -44
- package/dist/offscreen/jank.js +0 -26
- package/dist/offscreen/jank.mjs +0 -27
- package/dist/offscreen/offscreen.js +0 -8
- package/dist/offscreen/offscreen.mjs +0 -7
- package/dist/offscreen/scene.js +0 -68
- package/dist/offscreen/scene.mjs +0 -52
- package/dist/renderers/nodes/accessors/CameraNode.js +0 -62
- package/dist/renderers/nodes/accessors/CameraNode.mjs +0 -63
- package/dist/renderers/nodes/accessors/ModelNode.js +0 -60
- package/dist/renderers/nodes/accessors/ModelNode.mjs +0 -61
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.js +0 -20
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.mjs +0 -21
- package/dist/renderers/nodes/accessors/NormalNode.js +0 -60
- package/dist/renderers/nodes/accessors/NormalNode.mjs +0 -61
- package/dist/renderers/nodes/accessors/PositionNode.js +0 -29
- package/dist/renderers/nodes/accessors/PositionNode.mjs +0 -30
- package/dist/renderers/nodes/accessors/UVNode.js +0 -12
- package/dist/renderers/nodes/accessors/UVNode.mjs +0 -13
- package/dist/renderers/nodes/core/AttributeNode.js +0 -34
- package/dist/renderers/nodes/core/AttributeNode.mjs +0 -35
- package/dist/renderers/nodes/core/InputNode.js +0 -30
- package/dist/renderers/nodes/core/InputNode.mjs +0 -31
- package/dist/renderers/nodes/core/Node.js +0 -33
- package/dist/renderers/nodes/core/Node.mjs +0 -34
- package/dist/renderers/nodes/core/NodeAttribute.js +0 -9
- package/dist/renderers/nodes/core/NodeAttribute.mjs +0 -10
- package/dist/renderers/nodes/core/NodeBuilder.js +0 -248
- package/dist/renderers/nodes/core/NodeBuilder.mjs +0 -249
- package/dist/renderers/nodes/core/NodeFrame.js +0 -34
- package/dist/renderers/nodes/core/NodeFrame.mjs +0 -35
- package/dist/renderers/nodes/core/NodeSlot.js +0 -9
- package/dist/renderers/nodes/core/NodeSlot.mjs +0 -10
- package/dist/renderers/nodes/core/NodeUniform.js +0 -17
- package/dist/renderers/nodes/core/NodeUniform.mjs +0 -18
- package/dist/renderers/nodes/core/NodeVary.js +0 -10
- package/dist/renderers/nodes/core/NodeVary.mjs +0 -11
- package/dist/renderers/nodes/core/VaryNode.js +0 -21
- package/dist/renderers/nodes/core/VaryNode.mjs +0 -22
- package/dist/renderers/nodes/core/constants.js +0 -22
- package/dist/renderers/nodes/core/constants.mjs +0 -22
- package/dist/renderers/nodes/inputs/ColorNode.js +0 -10
- package/dist/renderers/nodes/inputs/ColorNode.mjs +0 -11
- package/dist/renderers/nodes/inputs/FloatNode.js +0 -10
- package/dist/renderers/nodes/inputs/FloatNode.mjs +0 -11
- package/dist/renderers/nodes/inputs/Matrix3Node.js +0 -11
- package/dist/renderers/nodes/inputs/Matrix3Node.mjs +0 -12
- package/dist/renderers/nodes/inputs/Matrix4Node.js +0 -11
- package/dist/renderers/nodes/inputs/Matrix4Node.mjs +0 -12
- package/dist/renderers/nodes/inputs/TextureNode.js +0 -19
- package/dist/renderers/nodes/inputs/TextureNode.mjs +0 -20
- package/dist/renderers/nodes/inputs/Vector2Node.js +0 -10
- package/dist/renderers/nodes/inputs/Vector2Node.mjs +0 -11
- package/dist/renderers/nodes/inputs/Vector3Node.js +0 -11
- package/dist/renderers/nodes/inputs/Vector3Node.mjs +0 -12
- package/dist/renderers/nodes/inputs/Vector4Node.js +0 -11
- package/dist/renderers/nodes/inputs/Vector4Node.mjs +0 -12
- package/dist/renderers/nodes/math/MathNode.js +0 -54
- package/dist/renderers/nodes/math/MathNode.mjs +0 -55
- package/dist/renderers/nodes/math/OperatorNode.js +0 -41
- package/dist/renderers/nodes/math/OperatorNode.mjs +0 -42
- package/dist/renderers/nodes/utils/SwitchNode.js +0 -19
- package/dist/renderers/nodes/utils/SwitchNode.mjs +0 -20
- package/dist/renderers/nodes/utils/TimerNode.js +0 -13
- package/dist/renderers/nodes/utils/TimerNode.mjs +0 -14
- package/dist/renderers/webgpu/WebGPU.js +0 -23
- package/dist/renderers/webgpu/WebGPU.mjs +0 -24
- package/dist/renderers/webgpu/WebGPUAttributes.js +0 -68
- package/dist/renderers/webgpu/WebGPUAttributes.mjs +0 -69
- package/dist/renderers/webgpu/WebGPUBackground.js +0 -60
- package/dist/renderers/webgpu/WebGPUBackground.mjs +0 -61
- package/dist/renderers/webgpu/WebGPUBinding.js +0 -13
- package/dist/renderers/webgpu/WebGPUBinding.mjs +0 -14
- package/dist/renderers/webgpu/WebGPUBindings.js +0 -154
- package/dist/renderers/webgpu/WebGPUBindings.mjs +0 -155
- package/dist/renderers/webgpu/WebGPUComputePipelines.js +0 -43
- package/dist/renderers/webgpu/WebGPUComputePipelines.mjs +0 -44
- package/dist/renderers/webgpu/WebGPUGeometries.js +0 -40
- package/dist/renderers/webgpu/WebGPUGeometries.mjs +0 -41
- package/dist/renderers/webgpu/WebGPUInfo.js +0 -45
- package/dist/renderers/webgpu/WebGPUInfo.mjs +0 -46
- package/dist/renderers/webgpu/WebGPUObjects.js +0 -24
- package/dist/renderers/webgpu/WebGPUObjects.mjs +0 -25
- package/dist/renderers/webgpu/WebGPUProperties.js +0 -21
- package/dist/renderers/webgpu/WebGPUProperties.mjs +0 -22
- package/dist/renderers/webgpu/WebGPURenderLists.js +0 -118
- package/dist/renderers/webgpu/WebGPURenderLists.mjs +0 -119
- package/dist/renderers/webgpu/WebGPURenderPipelines.js +0 -545
- package/dist/renderers/webgpu/WebGPURenderPipelines.mjs +0 -546
- package/dist/renderers/webgpu/WebGPURenderer.js +0 -596
- package/dist/renderers/webgpu/WebGPURenderer.mjs +0 -575
- package/dist/renderers/webgpu/WebGPUSampledTexture.js +0 -40
- package/dist/renderers/webgpu/WebGPUSampledTexture.mjs +0 -40
- package/dist/renderers/webgpu/WebGPUSampler.js +0 -14
- package/dist/renderers/webgpu/WebGPUSampler.mjs +0 -15
- package/dist/renderers/webgpu/WebGPUStorageBuffer.js +0 -14
- package/dist/renderers/webgpu/WebGPUStorageBuffer.mjs +0 -15
- package/dist/renderers/webgpu/WebGPUTextureRenderer.js +0 -22
- package/dist/renderers/webgpu/WebGPUTextureRenderer.mjs +0 -23
- package/dist/renderers/webgpu/WebGPUTextureUtils.js +0 -97
- package/dist/renderers/webgpu/WebGPUTextureUtils.mjs +0 -98
- package/dist/renderers/webgpu/WebGPUTextures.js +0 -483
- package/dist/renderers/webgpu/WebGPUTextures.mjs +0 -484
- package/dist/renderers/webgpu/WebGPUUniform.js +0 -81
- package/dist/renderers/webgpu/WebGPUUniform.mjs +0 -81
- package/dist/renderers/webgpu/WebGPUUniformsGroup.js +0 -175
- package/dist/renderers/webgpu/WebGPUUniformsGroup.mjs +0 -176
- package/dist/renderers/webgpu/constants.js +0 -241
- package/dist/renderers/webgpu/constants.mjs +0 -241
- package/dist/renderers/webgpu/nodes/ShaderLib.js +0 -41
- package/dist/renderers/webgpu/nodes/ShaderLib.mjs +0 -42
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.js +0 -164
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +0 -165
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.js +0 -73
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +0 -73
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +0 -14
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +0 -15
- package/dist/renderers/webgpu/nodes/WebGPUNodes.js +0 -39
- package/dist/renderers/webgpu/nodes/WebGPUNodes.mjs +0 -40
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PerspectiveCamera, ShaderMaterial, Scene, WebGLRenderer, OrthographicCamera, WebGLRenderTarget } from 'three'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import { BokehShader2Uniforms } from './../shaders/BokehShader2'
|
4
4
|
|
5
5
|
export class CinematicCamera extends PerspectiveCamera {
|
6
6
|
constructor(fov: number, aspect: number, near: number, far: number)
|
@@ -11,7 +11,7 @@ export class CinematicCamera extends PerspectiveCamera {
|
|
11
11
|
camera: OrthographicCamera
|
12
12
|
rtTextureDepth: WebGLRenderTarget
|
13
13
|
rtTextureColor: WebGLRenderTarget
|
14
|
-
bokeh_uniforms:
|
14
|
+
bokeh_uniforms: BokehShader2Uniforms
|
15
15
|
}
|
16
16
|
shaderSettings: {
|
17
17
|
rings: number
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Scene, PerspectiveCamera, OrthographicCamera, EventDispatcher } from 'three';
|
2
|
-
|
2
|
+
type Camera = OrthographicCamera | PerspectiveCamera;
|
3
3
|
/**
|
4
4
|
*
|
5
5
|
* @param {CamOrthographicCamera | PerspectiveCameraera} camera Virtual camera used in the scene
|
@@ -32,8 +32,8 @@ const _center = {
|
|
32
32
|
y: 0
|
33
33
|
};
|
34
34
|
const _transformation = {
|
35
|
-
camera: new THREE.Matrix4(),
|
36
|
-
gizmos: new THREE.Matrix4()
|
35
|
+
camera: /* @__PURE__ */ new THREE.Matrix4(),
|
36
|
+
gizmos: /* @__PURE__ */ new THREE.Matrix4()
|
37
37
|
};
|
38
38
|
const _changeEvent = { type: "change" };
|
39
39
|
const _startEvent = { type: "start" };
|
@@ -328,7 +328,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
328
328
|
}
|
329
329
|
});
|
330
330
|
__publicField(this, "onWheel", (event) => {
|
331
|
-
var _a, _b
|
331
|
+
var _a, _b;
|
332
332
|
if (this.enabled && this.enableZoom && this.domElement) {
|
333
333
|
let modifier = null;
|
334
334
|
if (event.ctrlKey || event.metaKey) {
|
@@ -358,11 +358,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
358
358
|
}
|
359
359
|
if (this.cursorZoom && this.enablePan) {
|
360
360
|
let scalePoint;
|
361
|
-
if (
|
362
|
-
scalePoint = (
|
361
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
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);
|
363
363
|
}
|
364
|
-
if (
|
365
|
-
scalePoint = (
|
364
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
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);
|
366
366
|
}
|
367
367
|
if (scalePoint !== void 0)
|
368
368
|
this.applyTransformMatrix(this.applyScale(size, scalePoint));
|
@@ -378,7 +378,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
378
378
|
this.dispatchEvent(_endEvent);
|
379
379
|
break;
|
380
380
|
case "FOV":
|
381
|
-
if (
|
381
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
382
382
|
this.updateTbState(STATE.FOV, true);
|
383
383
|
if (event.deltaX != 0) {
|
384
384
|
sgn = event.deltaX / notchDeltaY;
|
@@ -418,7 +418,6 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
418
418
|
}
|
419
419
|
});
|
420
420
|
__publicField(this, "onSinglePanStart", (event, operation) => {
|
421
|
-
var _a;
|
422
421
|
if (this.enabled && this.domElement) {
|
423
422
|
this.dispatchEvent(_startEvent);
|
424
423
|
this.setCenter(event.clientX, event.clientY);
|
@@ -474,7 +473,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
474
473
|
case "FOV":
|
475
474
|
if (!this.enableZoom)
|
476
475
|
return;
|
477
|
-
if (
|
476
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
478
477
|
if (this._animationId != -1) {
|
479
478
|
cancelAnimationFrame(this._animationId);
|
480
479
|
this._animationId = -1;
|
@@ -505,7 +504,6 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
505
504
|
}
|
506
505
|
});
|
507
506
|
__publicField(this, "onSinglePanMove", (event, opState) => {
|
508
|
-
var _a;
|
509
507
|
if (this.enabled && this.domElement) {
|
510
508
|
const restart = opState != this._state;
|
511
509
|
this.setCenter(event.clientX, event.clientY);
|
@@ -615,7 +613,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
615
613
|
}
|
616
614
|
break;
|
617
615
|
case STATE.FOV:
|
618
|
-
if (this.enableZoom &&
|
616
|
+
if (this.enableZoom && this.camera instanceof THREE.PerspectiveCamera) {
|
619
617
|
if (restart) {
|
620
618
|
this.dispatchEvent(_endEvent);
|
621
619
|
this.dispatchEvent(_startEvent);
|
@@ -807,7 +805,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
807
805
|
}
|
808
806
|
});
|
809
807
|
__publicField(this, "onPinchMove", () => {
|
810
|
-
var _a, _b
|
808
|
+
var _a, _b;
|
811
809
|
if (this.enabled && this.enableZoom && this.domElement) {
|
812
810
|
this.setCenter(
|
813
811
|
(this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
|
@@ -827,10 +825,10 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
827
825
|
if (!this.enablePan) {
|
828
826
|
scalePoint = this._gizmos.position;
|
829
827
|
} else {
|
830
|
-
if (
|
831
|
-
scalePoint = (
|
832
|
-
} else if (
|
833
|
-
scalePoint = (
|
828
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
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);
|
830
|
+
} else if (this.camera instanceof THREE.PerspectiveCamera) {
|
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);
|
834
832
|
}
|
835
833
|
}
|
836
834
|
if (scalePoint !== void 0) {
|
@@ -1082,11 +1080,11 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1082
1080
|
__publicField(this, "calculateTbRadius", (camera) => {
|
1083
1081
|
const factor = 0.67;
|
1084
1082
|
const distance = camera.position.distanceTo(this._gizmos.position);
|
1085
|
-
if (camera
|
1083
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
1086
1084
|
const halfFovV = THREE.MathUtils.DEG2RAD * camera.fov * 0.5;
|
1087
1085
|
const halfFovH = Math.atan(camera.aspect * Math.tan(halfFovV));
|
1088
1086
|
return Math.tan(Math.min(halfFovV, halfFovH)) * distance * factor;
|
1089
|
-
} else if (camera
|
1087
|
+
} else if (camera instanceof THREE.OrthographicCamera) {
|
1090
1088
|
return Math.min(camera.top, camera.right) * factor;
|
1091
1089
|
}
|
1092
1090
|
});
|
@@ -1118,19 +1116,18 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1118
1116
|
* Draw a grid and add it to the scene
|
1119
1117
|
*/
|
1120
1118
|
__publicField(this, "drawGrid", () => {
|
1121
|
-
var _a, _b;
|
1122
1119
|
if (this.scene) {
|
1123
1120
|
const color = 8947848;
|
1124
1121
|
const multiplier = 3;
|
1125
1122
|
let size, divisions, maxLength, tick;
|
1126
|
-
if (
|
1123
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1127
1124
|
const width = this.camera.right - this.camera.left;
|
1128
1125
|
const height = this.camera.bottom - this.camera.top;
|
1129
1126
|
maxLength = Math.max(width, height);
|
1130
1127
|
tick = maxLength / 20;
|
1131
1128
|
size = maxLength / this.camera.zoom * multiplier;
|
1132
1129
|
divisions = size / tick * this.camera.zoom;
|
1133
|
-
} else if (
|
1130
|
+
} else if (this.camera instanceof THREE.PerspectiveCamera) {
|
1134
1131
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
1135
1132
|
const halfFovV = THREE.MathUtils.DEG2RAD * this.camera.fov * 0.5;
|
1136
1133
|
const halfFovH = Math.atan(this.camera.aspect * Math.tan(halfFovV));
|
@@ -1228,9 +1225,8 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1228
1225
|
* @returns {Vector2} Cursor position inside the canvas
|
1229
1226
|
*/
|
1230
1227
|
__publicField(this, "getCursorPosition", (cursorX, cursorY, canvas) => {
|
1231
|
-
var _a;
|
1232
1228
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1233
|
-
if (
|
1229
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1234
1230
|
this._v2_1.x *= (this.camera.right - this.camera.left) * 0.5;
|
1235
1231
|
this._v2_1.y *= (this.camera.top - this.camera.bottom) * 0.5;
|
1236
1232
|
}
|
@@ -1244,7 +1240,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1244
1240
|
if (camera) {
|
1245
1241
|
camera.lookAt(this.target);
|
1246
1242
|
camera.updateMatrix();
|
1247
|
-
if (
|
1243
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
1248
1244
|
this._fov0 = camera.fov;
|
1249
1245
|
this._fovState = camera.fov;
|
1250
1246
|
}
|
@@ -1390,10 +1386,10 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1390
1386
|
__publicField(this, "pan", (p0, p1, adjust = false) => {
|
1391
1387
|
if (this.camera) {
|
1392
1388
|
const movement = p0.clone().sub(p1);
|
1393
|
-
if (this.camera
|
1389
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1394
1390
|
movement.multiplyScalar(1 / this.camera.zoom);
|
1395
1391
|
}
|
1396
|
-
if (this.camera
|
1392
|
+
if (this.camera instanceof THREE.PerspectiveCamera && adjust) {
|
1397
1393
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState0);
|
1398
1394
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);
|
1399
1395
|
const distanceFactor = this._v3_1.distanceTo(this._v3_2) / this.camera.position.distanceTo(this._gizmos.position);
|
@@ -1411,7 +1407,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1411
1407
|
__publicField(this, "reset", () => {
|
1412
1408
|
if (this.camera) {
|
1413
1409
|
this.camera.zoom = this._zoom0;
|
1414
|
-
if (this.camera
|
1410
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1415
1411
|
this.camera.fov = this._fov0;
|
1416
1412
|
}
|
1417
1413
|
this.camera.near = this._nearPos;
|
@@ -1451,10 +1447,9 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1451
1447
|
return _transformation;
|
1452
1448
|
});
|
1453
1449
|
__publicField(this, "copyState", () => {
|
1454
|
-
var _a;
|
1455
1450
|
if (this.camera) {
|
1456
1451
|
const state = JSON.stringify(
|
1457
|
-
|
1452
|
+
this.camera instanceof THREE.OrthographicCamera ? {
|
1458
1453
|
arcballState: {
|
1459
1454
|
cameraFar: this.camera.far,
|
1460
1455
|
cameraMatrix: this.camera.matrix,
|
@@ -1496,7 +1491,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1496
1491
|
this._farPos = this.camera.far;
|
1497
1492
|
this._zoom0 = this.camera.zoom;
|
1498
1493
|
this._up0.copy(this.camera.up);
|
1499
|
-
if (this.camera
|
1494
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1500
1495
|
this._fov0 = this.camera.fov;
|
1501
1496
|
}
|
1502
1497
|
});
|
@@ -1512,7 +1507,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1512
1507
|
return;
|
1513
1508
|
const scalePoint = point.clone();
|
1514
1509
|
let sizeInverse = 1 / size;
|
1515
|
-
if (this.camera
|
1510
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1516
1511
|
this.camera.zoom = this._zoomState;
|
1517
1512
|
this.camera.zoom *= size;
|
1518
1513
|
if (this.camera.zoom > this.maxZoom) {
|
@@ -1536,7 +1531,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1536
1531
|
this.setTransformationMatrices(this._m4_1, this._m4_2);
|
1537
1532
|
return _transformation;
|
1538
1533
|
}
|
1539
|
-
if (this.camera
|
1534
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1540
1535
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
1541
1536
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
1542
1537
|
let distance = this._v3_1.distanceTo(scalePoint);
|
@@ -1574,8 +1569,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1574
1569
|
* @param {Number} value fov to be setted
|
1575
1570
|
*/
|
1576
1571
|
__publicField(this, "setFov", (value) => {
|
1577
|
-
|
1578
|
-
if (((_a = this.camera) == null ? void 0 : _a.type) === "PerspectiveCamera") {
|
1572
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1579
1573
|
this.camera.fov = THREE.MathUtils.clamp(value, this.minFov, this.maxFov);
|
1580
1574
|
this.camera.updateProjectionMatrix();
|
1581
1575
|
}
|
@@ -1648,7 +1642,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1648
1642
|
* @returns {Vector3} The unprojected point on the trackball surface
|
1649
1643
|
*/
|
1650
1644
|
__publicField(this, "unprojectOnTbSurface", (camera, cursorX, cursorY, canvas, tbRadius) => {
|
1651
|
-
if (camera
|
1645
|
+
if (camera instanceof THREE.OrthographicCamera) {
|
1652
1646
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
1653
1647
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
1654
1648
|
const x2 = Math.pow(this._v2_1.x, 2);
|
@@ -1661,7 +1655,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1661
1655
|
}
|
1662
1656
|
return this._v3_1;
|
1663
1657
|
}
|
1664
|
-
if (camera
|
1658
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
1665
1659
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1666
1660
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
1667
1661
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
@@ -1713,12 +1707,12 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1713
1707
|
* @returns {Vector3} The unprojected point on the trackball plane
|
1714
1708
|
*/
|
1715
1709
|
__publicField(this, "unprojectOnTbPlane", (camera, cursorX, cursorY, canvas, initialDistance = false) => {
|
1716
|
-
if (camera
|
1710
|
+
if (camera instanceof THREE.OrthographicCamera) {
|
1717
1711
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
1718
1712
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
1719
1713
|
return this._v3_1.clone();
|
1720
1714
|
}
|
1721
|
-
if (camera
|
1715
|
+
if (camera instanceof THREE.PerspectiveCamera) {
|
1722
1716
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1723
1717
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
1724
1718
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
@@ -1752,12 +1746,12 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1752
1746
|
return;
|
1753
1747
|
this._cameraMatrixState.copy(this.camera.matrix);
|
1754
1748
|
this._gizmoMatrixState.copy(this._gizmos.matrix);
|
1755
|
-
if (this.camera
|
1749
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1756
1750
|
this._cameraProjectionState.copy(this.camera.projectionMatrix);
|
1757
1751
|
this.camera.updateProjectionMatrix();
|
1758
1752
|
this._zoomState = this.camera.zoom;
|
1759
1753
|
}
|
1760
|
-
if (this.camera
|
1754
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1761
1755
|
this._fovState = this.camera.fov;
|
1762
1756
|
}
|
1763
1757
|
});
|
@@ -1785,13 +1779,13 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1785
1779
|
}
|
1786
1780
|
if (!this.camera)
|
1787
1781
|
return;
|
1788
|
-
if (this.camera
|
1782
|
+
if (this.camera instanceof THREE.OrthographicCamera) {
|
1789
1783
|
if (this.camera.zoom > this.maxZoom || this.camera.zoom < this.minZoom) {
|
1790
1784
|
const newZoom = THREE.MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
|
1791
1785
|
this.applyTransformMatrix(this.applyScale(newZoom / this.camera.zoom, this._gizmos.position, true));
|
1792
1786
|
}
|
1793
1787
|
}
|
1794
|
-
if (this.camera
|
1788
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1795
1789
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
1796
1790
|
if (distance > this.maxDistance + EPS || distance < this.minDistance - EPS) {
|
1797
1791
|
const newDistance = THREE.MathUtils.clamp(distance, this.minDistance, this.maxDistance);
|
@@ -1830,7 +1824,7 @@ class ArcballControls extends THREE.EventDispatcher {
|
|
1830
1824
|
this.camera.near = state.arcballState.cameraNear;
|
1831
1825
|
this.camera.far = state.arcballState.cameraFar;
|
1832
1826
|
this.camera.zoom = state.arcballState.cameraZoom;
|
1833
|
-
if (this.camera
|
1827
|
+
if (this.camera instanceof THREE.PerspectiveCamera) {
|
1834
1828
|
this.camera.fov = state.arcballState.cameraFov;
|
1835
1829
|
}
|
1836
1830
|
this._gizmoMatrixState.fromArray(state.arcballState.gizmoMatrix.elements);
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
5
5
|
return value;
|
6
6
|
};
|
7
|
-
import { Matrix4, EventDispatcher, Vector2, Vector3, Quaternion, Group, EllipseCurve, BufferGeometry, MathUtils, Box3, Sphere, GridHelper, LineBasicMaterial, Line, Raycaster } from "three";
|
7
|
+
import { Matrix4, EventDispatcher, Vector2, Vector3, Quaternion, Group, EllipseCurve, BufferGeometry, PerspectiveCamera, MathUtils, OrthographicCamera, Box3, Sphere, GridHelper, LineBasicMaterial, Line, Raycaster } from "three";
|
8
8
|
const STATE = {
|
9
9
|
IDLE: Symbol(),
|
10
10
|
ROTATE: Symbol(),
|
@@ -30,8 +30,8 @@ const _center = {
|
|
30
30
|
y: 0
|
31
31
|
};
|
32
32
|
const _transformation = {
|
33
|
-
camera: new Matrix4(),
|
34
|
-
gizmos: new Matrix4()
|
33
|
+
camera: /* @__PURE__ */ new Matrix4(),
|
34
|
+
gizmos: /* @__PURE__ */ new Matrix4()
|
35
35
|
};
|
36
36
|
const _changeEvent = { type: "change" };
|
37
37
|
const _startEvent = { type: "start" };
|
@@ -326,7 +326,7 @@ class ArcballControls extends EventDispatcher {
|
|
326
326
|
}
|
327
327
|
});
|
328
328
|
__publicField(this, "onWheel", (event) => {
|
329
|
-
var _a, _b
|
329
|
+
var _a, _b;
|
330
330
|
if (this.enabled && this.enableZoom && this.domElement) {
|
331
331
|
let modifier = null;
|
332
332
|
if (event.ctrlKey || event.metaKey) {
|
@@ -356,11 +356,11 @@ class ArcballControls extends EventDispatcher {
|
|
356
356
|
}
|
357
357
|
if (this.cursorZoom && this.enablePan) {
|
358
358
|
let scalePoint;
|
359
|
-
if (
|
360
|
-
scalePoint = (
|
359
|
+
if (this.camera instanceof OrthographicCamera) {
|
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);
|
361
361
|
}
|
362
|
-
if (
|
363
|
-
scalePoint = (
|
362
|
+
if (this.camera instanceof PerspectiveCamera) {
|
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);
|
364
364
|
}
|
365
365
|
if (scalePoint !== void 0)
|
366
366
|
this.applyTransformMatrix(this.applyScale(size, scalePoint));
|
@@ -376,7 +376,7 @@ class ArcballControls extends EventDispatcher {
|
|
376
376
|
this.dispatchEvent(_endEvent);
|
377
377
|
break;
|
378
378
|
case "FOV":
|
379
|
-
if (
|
379
|
+
if (this.camera instanceof PerspectiveCamera) {
|
380
380
|
this.updateTbState(STATE.FOV, true);
|
381
381
|
if (event.deltaX != 0) {
|
382
382
|
sgn = event.deltaX / notchDeltaY;
|
@@ -416,7 +416,6 @@ class ArcballControls extends EventDispatcher {
|
|
416
416
|
}
|
417
417
|
});
|
418
418
|
__publicField(this, "onSinglePanStart", (event, operation) => {
|
419
|
-
var _a;
|
420
419
|
if (this.enabled && this.domElement) {
|
421
420
|
this.dispatchEvent(_startEvent);
|
422
421
|
this.setCenter(event.clientX, event.clientY);
|
@@ -472,7 +471,7 @@ class ArcballControls extends EventDispatcher {
|
|
472
471
|
case "FOV":
|
473
472
|
if (!this.enableZoom)
|
474
473
|
return;
|
475
|
-
if (
|
474
|
+
if (this.camera instanceof PerspectiveCamera) {
|
476
475
|
if (this._animationId != -1) {
|
477
476
|
cancelAnimationFrame(this._animationId);
|
478
477
|
this._animationId = -1;
|
@@ -503,7 +502,6 @@ class ArcballControls extends EventDispatcher {
|
|
503
502
|
}
|
504
503
|
});
|
505
504
|
__publicField(this, "onSinglePanMove", (event, opState) => {
|
506
|
-
var _a;
|
507
505
|
if (this.enabled && this.domElement) {
|
508
506
|
const restart = opState != this._state;
|
509
507
|
this.setCenter(event.clientX, event.clientY);
|
@@ -613,7 +611,7 @@ class ArcballControls extends EventDispatcher {
|
|
613
611
|
}
|
614
612
|
break;
|
615
613
|
case STATE.FOV:
|
616
|
-
if (this.enableZoom &&
|
614
|
+
if (this.enableZoom && this.camera instanceof PerspectiveCamera) {
|
617
615
|
if (restart) {
|
618
616
|
this.dispatchEvent(_endEvent);
|
619
617
|
this.dispatchEvent(_startEvent);
|
@@ -805,7 +803,7 @@ class ArcballControls extends EventDispatcher {
|
|
805
803
|
}
|
806
804
|
});
|
807
805
|
__publicField(this, "onPinchMove", () => {
|
808
|
-
var _a, _b
|
806
|
+
var _a, _b;
|
809
807
|
if (this.enabled && this.enableZoom && this.domElement) {
|
810
808
|
this.setCenter(
|
811
809
|
(this._touchCurrent[0].clientX + this._touchCurrent[1].clientX) / 2,
|
@@ -825,10 +823,10 @@ class ArcballControls extends EventDispatcher {
|
|
825
823
|
if (!this.enablePan) {
|
826
824
|
scalePoint = this._gizmos.position;
|
827
825
|
} else {
|
828
|
-
if (
|
829
|
-
scalePoint = (
|
830
|
-
} else if (
|
831
|
-
scalePoint = (
|
826
|
+
if (this.camera instanceof OrthographicCamera) {
|
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);
|
828
|
+
} else if (this.camera instanceof PerspectiveCamera) {
|
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
|
}
|
834
832
|
if (scalePoint !== void 0) {
|
@@ -1080,11 +1078,11 @@ class ArcballControls extends 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
|
1081
|
+
if (camera instanceof PerspectiveCamera) {
|
1084
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
|
1085
|
+
} else if (camera instanceof OrthographicCamera) {
|
1088
1086
|
return Math.min(camera.top, camera.right) * factor;
|
1089
1087
|
}
|
1090
1088
|
});
|
@@ -1116,19 +1114,18 @@ class ArcballControls extends EventDispatcher {
|
|
1116
1114
|
* Draw a grid and add it to the scene
|
1117
1115
|
*/
|
1118
1116
|
__publicField(this, "drawGrid", () => {
|
1119
|
-
var _a, _b;
|
1120
1117
|
if (this.scene) {
|
1121
1118
|
const color = 8947848;
|
1122
1119
|
const multiplier = 3;
|
1123
1120
|
let size, divisions, maxLength, tick;
|
1124
|
-
if (
|
1121
|
+
if (this.camera instanceof OrthographicCamera) {
|
1125
1122
|
const width = this.camera.right - this.camera.left;
|
1126
1123
|
const height = this.camera.bottom - this.camera.top;
|
1127
1124
|
maxLength = Math.max(width, height);
|
1128
1125
|
tick = maxLength / 20;
|
1129
1126
|
size = maxLength / this.camera.zoom * multiplier;
|
1130
1127
|
divisions = size / tick * this.camera.zoom;
|
1131
|
-
} else if (
|
1128
|
+
} else if (this.camera instanceof PerspectiveCamera) {
|
1132
1129
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
1133
1130
|
const halfFovV = MathUtils.DEG2RAD * this.camera.fov * 0.5;
|
1134
1131
|
const halfFovH = Math.atan(this.camera.aspect * Math.tan(halfFovV));
|
@@ -1226,9 +1223,8 @@ class ArcballControls extends EventDispatcher {
|
|
1226
1223
|
* @returns {Vector2} Cursor position inside the canvas
|
1227
1224
|
*/
|
1228
1225
|
__publicField(this, "getCursorPosition", (cursorX, cursorY, canvas) => {
|
1229
|
-
var _a;
|
1230
1226
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1231
|
-
if (
|
1227
|
+
if (this.camera instanceof OrthographicCamera) {
|
1232
1228
|
this._v2_1.x *= (this.camera.right - this.camera.left) * 0.5;
|
1233
1229
|
this._v2_1.y *= (this.camera.top - this.camera.bottom) * 0.5;
|
1234
1230
|
}
|
@@ -1242,7 +1238,7 @@ class ArcballControls extends EventDispatcher {
|
|
1242
1238
|
if (camera) {
|
1243
1239
|
camera.lookAt(this.target);
|
1244
1240
|
camera.updateMatrix();
|
1245
|
-
if (
|
1241
|
+
if (camera instanceof PerspectiveCamera) {
|
1246
1242
|
this._fov0 = camera.fov;
|
1247
1243
|
this._fovState = camera.fov;
|
1248
1244
|
}
|
@@ -1388,10 +1384,10 @@ class ArcballControls extends EventDispatcher {
|
|
1388
1384
|
__publicField(this, "pan", (p0, p1, adjust = false) => {
|
1389
1385
|
if (this.camera) {
|
1390
1386
|
const movement = p0.clone().sub(p1);
|
1391
|
-
if (this.camera
|
1387
|
+
if (this.camera instanceof OrthographicCamera) {
|
1392
1388
|
movement.multiplyScalar(1 / this.camera.zoom);
|
1393
1389
|
}
|
1394
|
-
if (this.camera
|
1390
|
+
if (this.camera instanceof PerspectiveCamera && adjust) {
|
1395
1391
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState0);
|
1396
1392
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState0);
|
1397
1393
|
const distanceFactor = this._v3_1.distanceTo(this._v3_2) / this.camera.position.distanceTo(this._gizmos.position);
|
@@ -1409,7 +1405,7 @@ class ArcballControls extends EventDispatcher {
|
|
1409
1405
|
__publicField(this, "reset", () => {
|
1410
1406
|
if (this.camera) {
|
1411
1407
|
this.camera.zoom = this._zoom0;
|
1412
|
-
if (this.camera
|
1408
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1413
1409
|
this.camera.fov = this._fov0;
|
1414
1410
|
}
|
1415
1411
|
this.camera.near = this._nearPos;
|
@@ -1449,10 +1445,9 @@ class ArcballControls extends EventDispatcher {
|
|
1449
1445
|
return _transformation;
|
1450
1446
|
});
|
1451
1447
|
__publicField(this, "copyState", () => {
|
1452
|
-
var _a;
|
1453
1448
|
if (this.camera) {
|
1454
1449
|
const state = JSON.stringify(
|
1455
|
-
|
1450
|
+
this.camera instanceof OrthographicCamera ? {
|
1456
1451
|
arcballState: {
|
1457
1452
|
cameraFar: this.camera.far,
|
1458
1453
|
cameraMatrix: this.camera.matrix,
|
@@ -1494,7 +1489,7 @@ class ArcballControls extends EventDispatcher {
|
|
1494
1489
|
this._farPos = this.camera.far;
|
1495
1490
|
this._zoom0 = this.camera.zoom;
|
1496
1491
|
this._up0.copy(this.camera.up);
|
1497
|
-
if (this.camera
|
1492
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1498
1493
|
this._fov0 = this.camera.fov;
|
1499
1494
|
}
|
1500
1495
|
});
|
@@ -1510,7 +1505,7 @@ class ArcballControls extends EventDispatcher {
|
|
1510
1505
|
return;
|
1511
1506
|
const scalePoint = point.clone();
|
1512
1507
|
let sizeInverse = 1 / size;
|
1513
|
-
if (this.camera
|
1508
|
+
if (this.camera instanceof OrthographicCamera) {
|
1514
1509
|
this.camera.zoom = this._zoomState;
|
1515
1510
|
this.camera.zoom *= size;
|
1516
1511
|
if (this.camera.zoom > this.maxZoom) {
|
@@ -1534,7 +1529,7 @@ class ArcballControls extends EventDispatcher {
|
|
1534
1529
|
this.setTransformationMatrices(this._m4_1, this._m4_2);
|
1535
1530
|
return _transformation;
|
1536
1531
|
}
|
1537
|
-
if (this.camera
|
1532
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1538
1533
|
this._v3_1.setFromMatrixPosition(this._cameraMatrixState);
|
1539
1534
|
this._v3_2.setFromMatrixPosition(this._gizmoMatrixState);
|
1540
1535
|
let distance = this._v3_1.distanceTo(scalePoint);
|
@@ -1572,8 +1567,7 @@ class ArcballControls extends EventDispatcher {
|
|
1572
1567
|
* @param {Number} value fov to be setted
|
1573
1568
|
*/
|
1574
1569
|
__publicField(this, "setFov", (value) => {
|
1575
|
-
|
1576
|
-
if (((_a = this.camera) == null ? void 0 : _a.type) === "PerspectiveCamera") {
|
1570
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1577
1571
|
this.camera.fov = MathUtils.clamp(value, this.minFov, this.maxFov);
|
1578
1572
|
this.camera.updateProjectionMatrix();
|
1579
1573
|
}
|
@@ -1646,7 +1640,7 @@ class ArcballControls extends EventDispatcher {
|
|
1646
1640
|
* @returns {Vector3} The unprojected point on the trackball surface
|
1647
1641
|
*/
|
1648
1642
|
__publicField(this, "unprojectOnTbSurface", (camera, cursorX, cursorY, canvas, tbRadius) => {
|
1649
|
-
if (camera
|
1643
|
+
if (camera instanceof OrthographicCamera) {
|
1650
1644
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
1651
1645
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
1652
1646
|
const x2 = Math.pow(this._v2_1.x, 2);
|
@@ -1659,7 +1653,7 @@ class ArcballControls extends EventDispatcher {
|
|
1659
1653
|
}
|
1660
1654
|
return this._v3_1;
|
1661
1655
|
}
|
1662
|
-
if (camera
|
1656
|
+
if (camera instanceof PerspectiveCamera) {
|
1663
1657
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1664
1658
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
1665
1659
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
@@ -1711,12 +1705,12 @@ class ArcballControls extends EventDispatcher {
|
|
1711
1705
|
* @returns {Vector3} The unprojected point on the trackball plane
|
1712
1706
|
*/
|
1713
1707
|
__publicField(this, "unprojectOnTbPlane", (camera, cursorX, cursorY, canvas, initialDistance = false) => {
|
1714
|
-
if (camera
|
1708
|
+
if (camera instanceof OrthographicCamera) {
|
1715
1709
|
this._v2_1.copy(this.getCursorPosition(cursorX, cursorY, canvas));
|
1716
1710
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, 0);
|
1717
1711
|
return this._v3_1.clone();
|
1718
1712
|
}
|
1719
|
-
if (camera
|
1713
|
+
if (camera instanceof PerspectiveCamera) {
|
1720
1714
|
this._v2_1.copy(this.getCursorNDC(cursorX, cursorY, canvas));
|
1721
1715
|
this._v3_1.set(this._v2_1.x, this._v2_1.y, -1);
|
1722
1716
|
this._v3_1.applyMatrix4(camera.projectionMatrixInverse);
|
@@ -1750,12 +1744,12 @@ class ArcballControls extends EventDispatcher {
|
|
1750
1744
|
return;
|
1751
1745
|
this._cameraMatrixState.copy(this.camera.matrix);
|
1752
1746
|
this._gizmoMatrixState.copy(this._gizmos.matrix);
|
1753
|
-
if (this.camera
|
1747
|
+
if (this.camera instanceof OrthographicCamera) {
|
1754
1748
|
this._cameraProjectionState.copy(this.camera.projectionMatrix);
|
1755
1749
|
this.camera.updateProjectionMatrix();
|
1756
1750
|
this._zoomState = this.camera.zoom;
|
1757
1751
|
}
|
1758
|
-
if (this.camera
|
1752
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1759
1753
|
this._fovState = this.camera.fov;
|
1760
1754
|
}
|
1761
1755
|
});
|
@@ -1783,13 +1777,13 @@ class ArcballControls extends EventDispatcher {
|
|
1783
1777
|
}
|
1784
1778
|
if (!this.camera)
|
1785
1779
|
return;
|
1786
|
-
if (this.camera
|
1780
|
+
if (this.camera instanceof OrthographicCamera) {
|
1787
1781
|
if (this.camera.zoom > this.maxZoom || this.camera.zoom < this.minZoom) {
|
1788
1782
|
const newZoom = MathUtils.clamp(this.camera.zoom, this.minZoom, this.maxZoom);
|
1789
1783
|
this.applyTransformMatrix(this.applyScale(newZoom / this.camera.zoom, this._gizmos.position, true));
|
1790
1784
|
}
|
1791
1785
|
}
|
1792
|
-
if (this.camera
|
1786
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1793
1787
|
const distance = this.camera.position.distanceTo(this._gizmos.position);
|
1794
1788
|
if (distance > this.maxDistance + EPS || distance < this.minDistance - EPS) {
|
1795
1789
|
const newDistance = MathUtils.clamp(distance, this.minDistance, this.maxDistance);
|
@@ -1828,7 +1822,7 @@ class ArcballControls extends EventDispatcher {
|
|
1828
1822
|
this.camera.near = state.arcballState.cameraNear;
|
1829
1823
|
this.camera.far = state.arcballState.cameraFar;
|
1830
1824
|
this.camera.zoom = state.arcballState.cameraZoom;
|
1831
|
-
if (this.camera
|
1825
|
+
if (this.camera instanceof PerspectiveCamera) {
|
1832
1826
|
this.camera.fov = state.arcballState.cameraFov;
|
1833
1827
|
}
|
1834
1828
|
this._gizmoMatrixState.fromArray(state.arcballState.gizmoMatrix.elements);
|
@@ -38,7 +38,8 @@ class DeviceOrientationControls extends THREE.EventDispatcher {
|
|
38
38
|
});
|
39
39
|
__publicField(this, "connect", () => {
|
40
40
|
this.onScreenOrientationChangeEvent();
|
41
|
-
if (window.DeviceOrientationEvent !== void 0 &&
|
41
|
+
if (window.DeviceOrientationEvent !== void 0 && // @ts-ignore
|
42
|
+
typeof window.DeviceOrientationEvent.requestPermission === "function") {
|
42
43
|
window.DeviceOrientationEvent.requestPermission().then((response) => {
|
43
44
|
if (response == "granted") {
|
44
45
|
window.addEventListener("orientationchange", this.onScreenOrientationChangeEvent);
|
@@ -36,7 +36,8 @@ class DeviceOrientationControls extends EventDispatcher {
|
|
36
36
|
});
|
37
37
|
__publicField(this, "connect", () => {
|
38
38
|
this.onScreenOrientationChangeEvent();
|
39
|
-
if (window.DeviceOrientationEvent !== void 0 &&
|
39
|
+
if (window.DeviceOrientationEvent !== void 0 && // @ts-ignore
|
40
|
+
typeof window.DeviceOrientationEvent.requestPermission === "function") {
|
40
41
|
window.DeviceOrientationEvent.requestPermission().then((response) => {
|
41
42
|
if (response == "granted") {
|
42
43
|
window.addEventListener("orientationchange", this.onScreenOrientationChangeEvent);
|