three-stdlib 2.22.9 → 2.22.10
Sign up to get free protection for your applications and to get access to all the features.
- 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/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 +912 -581
- package/dist/exporters/GLTFExporter.mjs +912 -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,22 +1,21 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
3
|
const THREE = require("three");
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
var animation = {
|
4
|
+
class MorphBlendMesh extends THREE.Mesh {
|
5
|
+
constructor(geometry, material) {
|
6
|
+
super(geometry, material);
|
7
|
+
this.animationsMap = {};
|
8
|
+
this.animationsList = [];
|
9
|
+
const numFrames = Object.keys(this.morphTargetDictionary).length;
|
10
|
+
const name = "__default";
|
11
|
+
const startFrame = 0;
|
12
|
+
const endFrame = numFrames - 1;
|
13
|
+
const fps = numFrames / 1;
|
14
|
+
this.createAnimation(name, startFrame, endFrame, fps);
|
15
|
+
this.setAnimationWeight(name, 1);
|
16
|
+
}
|
17
|
+
createAnimation(name, start, end, fps) {
|
18
|
+
const animation = {
|
20
19
|
start,
|
21
20
|
end,
|
22
21
|
length: end - start + 1,
|
@@ -33,18 +32,19 @@ MorphBlendMesh.prototype = Object.assign(Object.create(THREE.Mesh.prototype), {
|
|
33
32
|
};
|
34
33
|
this.animationsMap[name] = animation;
|
35
34
|
this.animationsList.push(animation);
|
36
|
-
}
|
37
|
-
autoCreateAnimations
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
}
|
36
|
+
autoCreateAnimations(fps) {
|
37
|
+
const pattern = /([a-z]+)_?(\d+)/i;
|
38
|
+
let firstAnimation;
|
39
|
+
const frameRanges = {};
|
40
|
+
let i = 0;
|
41
|
+
for (const key in this.morphTargetDictionary) {
|
42
|
+
const chunks = key.match(pattern);
|
43
43
|
if (chunks && chunks.length > 1) {
|
44
|
-
|
44
|
+
const name = chunks[1];
|
45
45
|
if (!frameRanges[name])
|
46
46
|
frameRanges[name] = { start: Infinity, end: -Infinity };
|
47
|
-
|
47
|
+
const range = frameRanges[name];
|
48
48
|
if (i < range.start)
|
49
49
|
range.start = i;
|
50
50
|
if (i > range.end)
|
@@ -54,89 +54,89 @@ MorphBlendMesh.prototype = Object.assign(Object.create(THREE.Mesh.prototype), {
|
|
54
54
|
}
|
55
55
|
i++;
|
56
56
|
}
|
57
|
-
for (
|
58
|
-
|
59
|
-
this.createAnimation(
|
57
|
+
for (const name in frameRanges) {
|
58
|
+
const range = frameRanges[name];
|
59
|
+
this.createAnimation(name, range.start, range.end, fps);
|
60
60
|
}
|
61
61
|
this.firstAnimation = firstAnimation;
|
62
|
-
}
|
63
|
-
setAnimationDirectionForward
|
64
|
-
|
62
|
+
}
|
63
|
+
setAnimationDirectionForward(name) {
|
64
|
+
const animation = this.animationsMap[name];
|
65
65
|
if (animation) {
|
66
66
|
animation.direction = 1;
|
67
67
|
animation.directionBackwards = false;
|
68
68
|
}
|
69
|
-
}
|
70
|
-
setAnimationDirectionBackward
|
71
|
-
|
69
|
+
}
|
70
|
+
setAnimationDirectionBackward(name) {
|
71
|
+
const animation = this.animationsMap[name];
|
72
72
|
if (animation) {
|
73
73
|
animation.direction = -1;
|
74
74
|
animation.directionBackwards = true;
|
75
75
|
}
|
76
|
-
}
|
77
|
-
setAnimationFPS
|
78
|
-
|
76
|
+
}
|
77
|
+
setAnimationFPS(name, fps) {
|
78
|
+
const animation = this.animationsMap[name];
|
79
79
|
if (animation) {
|
80
80
|
animation.fps = fps;
|
81
81
|
animation.duration = (animation.end - animation.start) / animation.fps;
|
82
82
|
}
|
83
|
-
}
|
84
|
-
setAnimationDuration
|
85
|
-
|
83
|
+
}
|
84
|
+
setAnimationDuration(name, duration) {
|
85
|
+
const animation = this.animationsMap[name];
|
86
86
|
if (animation) {
|
87
87
|
animation.duration = duration;
|
88
88
|
animation.fps = (animation.end - animation.start) / animation.duration;
|
89
89
|
}
|
90
|
-
}
|
91
|
-
setAnimationWeight
|
92
|
-
|
90
|
+
}
|
91
|
+
setAnimationWeight(name, weight) {
|
92
|
+
const animation = this.animationsMap[name];
|
93
93
|
if (animation) {
|
94
94
|
animation.weight = weight;
|
95
95
|
}
|
96
|
-
}
|
97
|
-
setAnimationTime
|
98
|
-
|
96
|
+
}
|
97
|
+
setAnimationTime(name, time) {
|
98
|
+
const animation = this.animationsMap[name];
|
99
99
|
if (animation) {
|
100
100
|
animation.time = time;
|
101
101
|
}
|
102
|
-
}
|
103
|
-
getAnimationTime
|
104
|
-
|
105
|
-
|
102
|
+
}
|
103
|
+
getAnimationTime(name) {
|
104
|
+
let time = 0;
|
105
|
+
const animation = this.animationsMap[name];
|
106
106
|
if (animation) {
|
107
107
|
time = animation.time;
|
108
108
|
}
|
109
109
|
return time;
|
110
|
-
}
|
111
|
-
getAnimationDuration
|
112
|
-
|
113
|
-
|
110
|
+
}
|
111
|
+
getAnimationDuration(name) {
|
112
|
+
let duration = -1;
|
113
|
+
const animation = this.animationsMap[name];
|
114
114
|
if (animation) {
|
115
115
|
duration = animation.duration;
|
116
116
|
}
|
117
117
|
return duration;
|
118
|
-
}
|
119
|
-
playAnimation
|
120
|
-
|
118
|
+
}
|
119
|
+
playAnimation(name) {
|
120
|
+
const animation = this.animationsMap[name];
|
121
121
|
if (animation) {
|
122
122
|
animation.time = 0;
|
123
123
|
animation.active = true;
|
124
124
|
} else {
|
125
125
|
console.warn("THREE.MorphBlendMesh: animation[" + name + "] undefined in .playAnimation()");
|
126
126
|
}
|
127
|
-
}
|
128
|
-
stopAnimation
|
129
|
-
|
127
|
+
}
|
128
|
+
stopAnimation(name) {
|
129
|
+
const animation = this.animationsMap[name];
|
130
130
|
if (animation) {
|
131
131
|
animation.active = false;
|
132
132
|
}
|
133
|
-
}
|
134
|
-
update
|
133
|
+
}
|
134
|
+
update(delta) {
|
135
135
|
for (let i = 0, il = this.animationsList.length; i < il; i++) {
|
136
|
-
|
136
|
+
const animation = this.animationsList[i];
|
137
137
|
if (!animation.active)
|
138
138
|
continue;
|
139
|
-
|
139
|
+
const frameTime = animation.duration / animation.length;
|
140
140
|
animation.time += animation.direction * delta;
|
141
141
|
if (animation.mirroredLoop) {
|
142
142
|
if (animation.time > animation.duration || animation.time < 0) {
|
@@ -155,8 +155,8 @@ MorphBlendMesh.prototype = Object.assign(Object.create(THREE.Mesh.prototype), {
|
|
155
155
|
if (animation.time < 0)
|
156
156
|
animation.time += animation.duration;
|
157
157
|
}
|
158
|
-
|
159
|
-
|
158
|
+
const keyframe = animation.start + THREE.MathUtils.clamp(Math.floor(animation.time / frameTime), 0, animation.length - 1);
|
159
|
+
const weight = animation.weight;
|
160
160
|
if (keyframe !== animation.currentFrame) {
|
161
161
|
this.morphTargetInfluences[animation.lastFrame] = 0;
|
162
162
|
this.morphTargetInfluences[animation.currentFrame] = 1 * weight;
|
@@ -164,7 +164,7 @@ MorphBlendMesh.prototype = Object.assign(Object.create(THREE.Mesh.prototype), {
|
|
164
164
|
animation.lastFrame = animation.currentFrame;
|
165
165
|
animation.currentFrame = keyframe;
|
166
166
|
}
|
167
|
-
|
167
|
+
let mix = animation.time % frameTime / frameTime;
|
168
168
|
if (animation.directionBackwards)
|
169
169
|
mix = 1 - mix;
|
170
170
|
if (animation.currentFrame !== animation.lastFrame) {
|
@@ -175,5 +175,5 @@ MorphBlendMesh.prototype = Object.assign(Object.create(THREE.Mesh.prototype), {
|
|
175
175
|
}
|
176
176
|
}
|
177
177
|
}
|
178
|
-
}
|
178
|
+
}
|
179
179
|
exports.MorphBlendMesh = MorphBlendMesh;
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import { Mesh, MathUtils } from "three";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
var animation = {
|
2
|
+
class MorphBlendMesh extends Mesh {
|
3
|
+
constructor(geometry, material) {
|
4
|
+
super(geometry, material);
|
5
|
+
this.animationsMap = {};
|
6
|
+
this.animationsList = [];
|
7
|
+
const numFrames = Object.keys(this.morphTargetDictionary).length;
|
8
|
+
const name = "__default";
|
9
|
+
const startFrame = 0;
|
10
|
+
const endFrame = numFrames - 1;
|
11
|
+
const fps = numFrames / 1;
|
12
|
+
this.createAnimation(name, startFrame, endFrame, fps);
|
13
|
+
this.setAnimationWeight(name, 1);
|
14
|
+
}
|
15
|
+
createAnimation(name, start, end, fps) {
|
16
|
+
const animation = {
|
18
17
|
start,
|
19
18
|
end,
|
20
19
|
length: end - start + 1,
|
@@ -31,18 +30,19 @@ MorphBlendMesh.prototype = Object.assign(Object.create(Mesh.prototype), {
|
|
31
30
|
};
|
32
31
|
this.animationsMap[name] = animation;
|
33
32
|
this.animationsList.push(animation);
|
34
|
-
}
|
35
|
-
autoCreateAnimations
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
33
|
+
}
|
34
|
+
autoCreateAnimations(fps) {
|
35
|
+
const pattern = /([a-z]+)_?(\d+)/i;
|
36
|
+
let firstAnimation;
|
37
|
+
const frameRanges = {};
|
38
|
+
let i = 0;
|
39
|
+
for (const key in this.morphTargetDictionary) {
|
40
|
+
const chunks = key.match(pattern);
|
41
41
|
if (chunks && chunks.length > 1) {
|
42
|
-
|
42
|
+
const name = chunks[1];
|
43
43
|
if (!frameRanges[name])
|
44
44
|
frameRanges[name] = { start: Infinity, end: -Infinity };
|
45
|
-
|
45
|
+
const range = frameRanges[name];
|
46
46
|
if (i < range.start)
|
47
47
|
range.start = i;
|
48
48
|
if (i > range.end)
|
@@ -52,89 +52,89 @@ MorphBlendMesh.prototype = Object.assign(Object.create(Mesh.prototype), {
|
|
52
52
|
}
|
53
53
|
i++;
|
54
54
|
}
|
55
|
-
for (
|
56
|
-
|
57
|
-
this.createAnimation(
|
55
|
+
for (const name in frameRanges) {
|
56
|
+
const range = frameRanges[name];
|
57
|
+
this.createAnimation(name, range.start, range.end, fps);
|
58
58
|
}
|
59
59
|
this.firstAnimation = firstAnimation;
|
60
|
-
}
|
61
|
-
setAnimationDirectionForward
|
62
|
-
|
60
|
+
}
|
61
|
+
setAnimationDirectionForward(name) {
|
62
|
+
const animation = this.animationsMap[name];
|
63
63
|
if (animation) {
|
64
64
|
animation.direction = 1;
|
65
65
|
animation.directionBackwards = false;
|
66
66
|
}
|
67
|
-
}
|
68
|
-
setAnimationDirectionBackward
|
69
|
-
|
67
|
+
}
|
68
|
+
setAnimationDirectionBackward(name) {
|
69
|
+
const animation = this.animationsMap[name];
|
70
70
|
if (animation) {
|
71
71
|
animation.direction = -1;
|
72
72
|
animation.directionBackwards = true;
|
73
73
|
}
|
74
|
-
}
|
75
|
-
setAnimationFPS
|
76
|
-
|
74
|
+
}
|
75
|
+
setAnimationFPS(name, fps) {
|
76
|
+
const animation = this.animationsMap[name];
|
77
77
|
if (animation) {
|
78
78
|
animation.fps = fps;
|
79
79
|
animation.duration = (animation.end - animation.start) / animation.fps;
|
80
80
|
}
|
81
|
-
}
|
82
|
-
setAnimationDuration
|
83
|
-
|
81
|
+
}
|
82
|
+
setAnimationDuration(name, duration) {
|
83
|
+
const animation = this.animationsMap[name];
|
84
84
|
if (animation) {
|
85
85
|
animation.duration = duration;
|
86
86
|
animation.fps = (animation.end - animation.start) / animation.duration;
|
87
87
|
}
|
88
|
-
}
|
89
|
-
setAnimationWeight
|
90
|
-
|
88
|
+
}
|
89
|
+
setAnimationWeight(name, weight) {
|
90
|
+
const animation = this.animationsMap[name];
|
91
91
|
if (animation) {
|
92
92
|
animation.weight = weight;
|
93
93
|
}
|
94
|
-
}
|
95
|
-
setAnimationTime
|
96
|
-
|
94
|
+
}
|
95
|
+
setAnimationTime(name, time) {
|
96
|
+
const animation = this.animationsMap[name];
|
97
97
|
if (animation) {
|
98
98
|
animation.time = time;
|
99
99
|
}
|
100
|
-
}
|
101
|
-
getAnimationTime
|
102
|
-
|
103
|
-
|
100
|
+
}
|
101
|
+
getAnimationTime(name) {
|
102
|
+
let time = 0;
|
103
|
+
const animation = this.animationsMap[name];
|
104
104
|
if (animation) {
|
105
105
|
time = animation.time;
|
106
106
|
}
|
107
107
|
return time;
|
108
|
-
}
|
109
|
-
getAnimationDuration
|
110
|
-
|
111
|
-
|
108
|
+
}
|
109
|
+
getAnimationDuration(name) {
|
110
|
+
let duration = -1;
|
111
|
+
const animation = this.animationsMap[name];
|
112
112
|
if (animation) {
|
113
113
|
duration = animation.duration;
|
114
114
|
}
|
115
115
|
return duration;
|
116
|
-
}
|
117
|
-
playAnimation
|
118
|
-
|
116
|
+
}
|
117
|
+
playAnimation(name) {
|
118
|
+
const animation = this.animationsMap[name];
|
119
119
|
if (animation) {
|
120
120
|
animation.time = 0;
|
121
121
|
animation.active = true;
|
122
122
|
} else {
|
123
123
|
console.warn("THREE.MorphBlendMesh: animation[" + name + "] undefined in .playAnimation()");
|
124
124
|
}
|
125
|
-
}
|
126
|
-
stopAnimation
|
127
|
-
|
125
|
+
}
|
126
|
+
stopAnimation(name) {
|
127
|
+
const animation = this.animationsMap[name];
|
128
128
|
if (animation) {
|
129
129
|
animation.active = false;
|
130
130
|
}
|
131
|
-
}
|
132
|
-
update
|
131
|
+
}
|
132
|
+
update(delta) {
|
133
133
|
for (let i = 0, il = this.animationsList.length; i < il; i++) {
|
134
|
-
|
134
|
+
const animation = this.animationsList[i];
|
135
135
|
if (!animation.active)
|
136
136
|
continue;
|
137
|
-
|
137
|
+
const frameTime = animation.duration / animation.length;
|
138
138
|
animation.time += animation.direction * delta;
|
139
139
|
if (animation.mirroredLoop) {
|
140
140
|
if (animation.time > animation.duration || animation.time < 0) {
|
@@ -153,8 +153,8 @@ MorphBlendMesh.prototype = Object.assign(Object.create(Mesh.prototype), {
|
|
153
153
|
if (animation.time < 0)
|
154
154
|
animation.time += animation.duration;
|
155
155
|
}
|
156
|
-
|
157
|
-
|
156
|
+
const keyframe = animation.start + MathUtils.clamp(Math.floor(animation.time / frameTime), 0, animation.length - 1);
|
157
|
+
const weight = animation.weight;
|
158
158
|
if (keyframe !== animation.currentFrame) {
|
159
159
|
this.morphTargetInfluences[animation.lastFrame] = 0;
|
160
160
|
this.morphTargetInfluences[animation.currentFrame] = 1 * weight;
|
@@ -162,7 +162,7 @@ MorphBlendMesh.prototype = Object.assign(Object.create(Mesh.prototype), {
|
|
162
162
|
animation.lastFrame = animation.currentFrame;
|
163
163
|
animation.currentFrame = keyframe;
|
164
164
|
}
|
165
|
-
|
165
|
+
let mix = animation.time % frameTime / frameTime;
|
166
166
|
if (animation.directionBackwards)
|
167
167
|
mix = 1 - mix;
|
168
168
|
if (animation.currentFrame !== animation.lastFrame) {
|
@@ -173,7 +173,7 @@ MorphBlendMesh.prototype = Object.assign(Object.create(Mesh.prototype), {
|
|
173
173
|
}
|
174
174
|
}
|
175
175
|
}
|
176
|
-
}
|
176
|
+
}
|
177
177
|
export {
|
178
178
|
MorphBlendMesh
|
179
179
|
};
|
@@ -5,7 +5,6 @@ import {
|
|
5
5
|
MeshBasicMaterial,
|
6
6
|
MeshPhongMaterial,
|
7
7
|
Object3D,
|
8
|
-
PlaneBufferGeometry,
|
9
8
|
PlaneGeometry,
|
10
9
|
Texture,
|
11
10
|
Vector3,
|
@@ -43,7 +42,7 @@ export class ProgressiveLightMap {
|
|
43
42
|
|
44
43
|
uv_boxes: UVBoxes[]
|
45
44
|
|
46
|
-
blurringPlane: Mesh<
|
45
|
+
blurringPlane: Mesh<PlaneGeometry, MeshBasicMaterial>
|
47
46
|
|
48
47
|
labelMaterial: MeshBasicMaterial
|
49
48
|
labelPlane: PlaneGeometry
|