three-stdlib 2.22.9 → 2.23.0
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/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
@@ -2,6 +2,35 @@
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
3
|
const THREE = require("three");
|
4
4
|
const ParametricGeometry = require("./ParametricGeometry.js");
|
5
|
+
class TubeGeometry extends ParametricGeometry.ParametricGeometry {
|
6
|
+
constructor(path, segments = 64, radius = 1, segmentsRadius = 8, closed = false) {
|
7
|
+
const numpoints = segments + 1;
|
8
|
+
const frames = path.computeFrenetFrames(segments, closed), tangents = frames.tangents, normals = frames.normals, binormals = frames.binormals;
|
9
|
+
const position = new THREE.Vector3();
|
10
|
+
function ParametricTube(u, v, target) {
|
11
|
+
v *= 2 * Math.PI;
|
12
|
+
const i = Math.floor(u * (numpoints - 1));
|
13
|
+
path.getPointAt(u, position);
|
14
|
+
const normal = normals[i];
|
15
|
+
const binormal = binormals[i];
|
16
|
+
const cx = -radius * Math.cos(v);
|
17
|
+
const cy = radius * Math.sin(v);
|
18
|
+
position.x += cx * normal.x + cy * binormal.x;
|
19
|
+
position.y += cx * normal.y + cy * binormal.y;
|
20
|
+
position.z += cx * normal.z + cy * binormal.z;
|
21
|
+
target.copy(position);
|
22
|
+
}
|
23
|
+
super(ParametricTube, segments, segmentsRadius);
|
24
|
+
this.tangents = tangents;
|
25
|
+
this.normals = normals;
|
26
|
+
this.binormals = binormals;
|
27
|
+
this.path = path;
|
28
|
+
this.segments = segments;
|
29
|
+
this.radius = radius;
|
30
|
+
this.segmentsRadius = segmentsRadius;
|
31
|
+
this.closed = closed;
|
32
|
+
}
|
33
|
+
}
|
5
34
|
const ParametricGeometries = {
|
6
35
|
klein: function(v, u, target) {
|
7
36
|
u *= Math.PI;
|
@@ -46,84 +75,56 @@ const ParametricGeometries = {
|
|
46
75
|
const y = (major + x) * Math.sin(u);
|
47
76
|
x = (major + x) * Math.cos(u);
|
48
77
|
target.set(x, y, z);
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
const cy = radius * Math.sin(v);
|
64
|
-
position.x += cx * normal.x + cy * binormal.x;
|
65
|
-
position.y += cx * normal.y + cy * binormal.y;
|
66
|
-
position.z += cx * normal.z + cy * binormal.z;
|
67
|
-
target.copy(position);
|
68
|
-
}
|
69
|
-
super(ParametricTube, segments, segmentsRadius);
|
70
|
-
this.tangents = tangents;
|
71
|
-
this.normals = normals;
|
72
|
-
this.binormals = binormals;
|
73
|
-
this.path = path;
|
74
|
-
this.segments = segments;
|
75
|
-
this.radius = radius;
|
76
|
-
this.segmentsRadius = segmentsRadius;
|
77
|
-
this.closed = closed;
|
78
|
-
}
|
79
|
-
};
|
80
|
-
ParametricGeometries.TorusKnotGeometry = class TorusKnotGeometry extends ParametricGeometries.TubeGeometry {
|
81
|
-
constructor(radius = 200, tube = 40, segmentsT = 64, segmentsR = 8, p = 2, q = 3) {
|
82
|
-
class TorusKnotCurve extends THREE.Curve {
|
83
|
-
getPoint(t, optionalTarget = new THREE.Vector3()) {
|
84
|
-
const point = optionalTarget;
|
85
|
-
t *= Math.PI * 2;
|
86
|
-
const r = 0.5;
|
87
|
-
const x = (1 + r * Math.cos(q * t)) * Math.cos(p * t);
|
88
|
-
const y = (1 + r * Math.cos(q * t)) * Math.sin(p * t);
|
89
|
-
const z = r * Math.sin(q * t);
|
90
|
-
return point.set(x, y, z).multiplyScalar(radius);
|
78
|
+
},
|
79
|
+
TubeGeometry,
|
80
|
+
TorusKnotGeometry: class TorusKnotGeometry extends TubeGeometry {
|
81
|
+
constructor(radius = 200, tube = 40, segmentsT = 64, segmentsR = 8, p = 2, q = 3) {
|
82
|
+
class TorusKnotCurve extends THREE.Curve {
|
83
|
+
getPoint(t, optionalTarget = new THREE.Vector3()) {
|
84
|
+
const point = optionalTarget;
|
85
|
+
t *= Math.PI * 2;
|
86
|
+
const r = 0.5;
|
87
|
+
const x = (1 + r * Math.cos(q * t)) * Math.cos(p * t);
|
88
|
+
const y = (1 + r * Math.cos(q * t)) * Math.sin(p * t);
|
89
|
+
const z = r * Math.sin(q * t);
|
90
|
+
return point.set(x, y, z).multiplyScalar(radius);
|
91
|
+
}
|
91
92
|
}
|
93
|
+
const segments = segmentsT;
|
94
|
+
const radiusSegments = segmentsR;
|
95
|
+
const extrudePath = new TorusKnotCurve();
|
96
|
+
super(extrudePath, segments, tube, radiusSegments, true, false);
|
97
|
+
this.radius = radius;
|
98
|
+
this.tube = tube;
|
99
|
+
this.segmentsT = segmentsT;
|
100
|
+
this.segmentsR = segmentsR;
|
101
|
+
this.p = p;
|
102
|
+
this.q = q;
|
92
103
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
ParametricGeometries.SphereGeometry = class SphereGeometry extends ParametricGeometry.ParametricGeometry {
|
106
|
-
constructor(size, u, v) {
|
107
|
-
function sphere(u2, v2, target) {
|
108
|
-
u2 *= Math.PI;
|
109
|
-
v2 *= 2 * Math.PI;
|
110
|
-
const x = size * Math.sin(u2) * Math.cos(v2);
|
111
|
-
const y = size * Math.sin(u2) * Math.sin(v2);
|
112
|
-
const z = size * Math.cos(u2);
|
113
|
-
target.set(x, y, z);
|
104
|
+
},
|
105
|
+
SphereGeometry: class SphereGeometry extends ParametricGeometry.ParametricGeometry {
|
106
|
+
constructor(size, u, v) {
|
107
|
+
function sphere(u2, v2, target) {
|
108
|
+
u2 *= Math.PI;
|
109
|
+
v2 *= 2 * Math.PI;
|
110
|
+
const x = size * Math.sin(u2) * Math.cos(v2);
|
111
|
+
const y = size * Math.sin(u2) * Math.sin(v2);
|
112
|
+
const z = size * Math.cos(u2);
|
113
|
+
target.set(x, y, z);
|
114
|
+
}
|
115
|
+
super(sphere, u, v);
|
114
116
|
}
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
117
|
+
},
|
118
|
+
PlaneGeometry: class PlaneGeometry extends ParametricGeometry.ParametricGeometry {
|
119
|
+
constructor(width, depth, segmentsWidth, segmentsDepth) {
|
120
|
+
function plane(u, v, target) {
|
121
|
+
const x = u * width;
|
122
|
+
const y = 0;
|
123
|
+
const z = v * depth;
|
124
|
+
target.set(x, y, z);
|
125
|
+
}
|
126
|
+
super(plane, segmentsWidth, segmentsDepth);
|
125
127
|
}
|
126
|
-
super(plane, segmentsWidth, segmentsDepth);
|
127
128
|
}
|
128
129
|
};
|
129
130
|
exports.ParametricGeometries = ParametricGeometries;
|
@@ -1,5 +1,34 @@
|
|
1
1
|
import { Vector3, Curve } from "three";
|
2
2
|
import { ParametricGeometry } from "./ParametricGeometry.mjs";
|
3
|
+
class TubeGeometry extends ParametricGeometry {
|
4
|
+
constructor(path, segments = 64, radius = 1, segmentsRadius = 8, closed = false) {
|
5
|
+
const numpoints = segments + 1;
|
6
|
+
const frames = path.computeFrenetFrames(segments, closed), tangents = frames.tangents, normals = frames.normals, binormals = frames.binormals;
|
7
|
+
const position = new Vector3();
|
8
|
+
function ParametricTube(u, v, target) {
|
9
|
+
v *= 2 * Math.PI;
|
10
|
+
const i = Math.floor(u * (numpoints - 1));
|
11
|
+
path.getPointAt(u, position);
|
12
|
+
const normal = normals[i];
|
13
|
+
const binormal = binormals[i];
|
14
|
+
const cx = -radius * Math.cos(v);
|
15
|
+
const cy = radius * Math.sin(v);
|
16
|
+
position.x += cx * normal.x + cy * binormal.x;
|
17
|
+
position.y += cx * normal.y + cy * binormal.y;
|
18
|
+
position.z += cx * normal.z + cy * binormal.z;
|
19
|
+
target.copy(position);
|
20
|
+
}
|
21
|
+
super(ParametricTube, segments, segmentsRadius);
|
22
|
+
this.tangents = tangents;
|
23
|
+
this.normals = normals;
|
24
|
+
this.binormals = binormals;
|
25
|
+
this.path = path;
|
26
|
+
this.segments = segments;
|
27
|
+
this.radius = radius;
|
28
|
+
this.segmentsRadius = segmentsRadius;
|
29
|
+
this.closed = closed;
|
30
|
+
}
|
31
|
+
}
|
3
32
|
const ParametricGeometries = {
|
4
33
|
klein: function(v, u, target) {
|
5
34
|
u *= Math.PI;
|
@@ -44,84 +73,56 @@ const ParametricGeometries = {
|
|
44
73
|
const y = (major + x) * Math.sin(u);
|
45
74
|
x = (major + x) * Math.cos(u);
|
46
75
|
target.set(x, y, z);
|
47
|
-
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
const cy = radius * Math.sin(v);
|
62
|
-
position.x += cx * normal.x + cy * binormal.x;
|
63
|
-
position.y += cx * normal.y + cy * binormal.y;
|
64
|
-
position.z += cx * normal.z + cy * binormal.z;
|
65
|
-
target.copy(position);
|
66
|
-
}
|
67
|
-
super(ParametricTube, segments, segmentsRadius);
|
68
|
-
this.tangents = tangents;
|
69
|
-
this.normals = normals;
|
70
|
-
this.binormals = binormals;
|
71
|
-
this.path = path;
|
72
|
-
this.segments = segments;
|
73
|
-
this.radius = radius;
|
74
|
-
this.segmentsRadius = segmentsRadius;
|
75
|
-
this.closed = closed;
|
76
|
-
}
|
77
|
-
};
|
78
|
-
ParametricGeometries.TorusKnotGeometry = class TorusKnotGeometry extends ParametricGeometries.TubeGeometry {
|
79
|
-
constructor(radius = 200, tube = 40, segmentsT = 64, segmentsR = 8, p = 2, q = 3) {
|
80
|
-
class TorusKnotCurve extends Curve {
|
81
|
-
getPoint(t, optionalTarget = new Vector3()) {
|
82
|
-
const point = optionalTarget;
|
83
|
-
t *= Math.PI * 2;
|
84
|
-
const r = 0.5;
|
85
|
-
const x = (1 + r * Math.cos(q * t)) * Math.cos(p * t);
|
86
|
-
const y = (1 + r * Math.cos(q * t)) * Math.sin(p * t);
|
87
|
-
const z = r * Math.sin(q * t);
|
88
|
-
return point.set(x, y, z).multiplyScalar(radius);
|
76
|
+
},
|
77
|
+
TubeGeometry,
|
78
|
+
TorusKnotGeometry: class TorusKnotGeometry extends TubeGeometry {
|
79
|
+
constructor(radius = 200, tube = 40, segmentsT = 64, segmentsR = 8, p = 2, q = 3) {
|
80
|
+
class TorusKnotCurve extends Curve {
|
81
|
+
getPoint(t, optionalTarget = new Vector3()) {
|
82
|
+
const point = optionalTarget;
|
83
|
+
t *= Math.PI * 2;
|
84
|
+
const r = 0.5;
|
85
|
+
const x = (1 + r * Math.cos(q * t)) * Math.cos(p * t);
|
86
|
+
const y = (1 + r * Math.cos(q * t)) * Math.sin(p * t);
|
87
|
+
const z = r * Math.sin(q * t);
|
88
|
+
return point.set(x, y, z).multiplyScalar(radius);
|
89
|
+
}
|
89
90
|
}
|
91
|
+
const segments = segmentsT;
|
92
|
+
const radiusSegments = segmentsR;
|
93
|
+
const extrudePath = new TorusKnotCurve();
|
94
|
+
super(extrudePath, segments, tube, radiusSegments, true, false);
|
95
|
+
this.radius = radius;
|
96
|
+
this.tube = tube;
|
97
|
+
this.segmentsT = segmentsT;
|
98
|
+
this.segmentsR = segmentsR;
|
99
|
+
this.p = p;
|
100
|
+
this.q = q;
|
90
101
|
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
ParametricGeometries.SphereGeometry = class SphereGeometry extends ParametricGeometry {
|
104
|
-
constructor(size, u, v) {
|
105
|
-
function sphere(u2, v2, target) {
|
106
|
-
u2 *= Math.PI;
|
107
|
-
v2 *= 2 * Math.PI;
|
108
|
-
const x = size * Math.sin(u2) * Math.cos(v2);
|
109
|
-
const y = size * Math.sin(u2) * Math.sin(v2);
|
110
|
-
const z = size * Math.cos(u2);
|
111
|
-
target.set(x, y, z);
|
102
|
+
},
|
103
|
+
SphereGeometry: class SphereGeometry extends ParametricGeometry {
|
104
|
+
constructor(size, u, v) {
|
105
|
+
function sphere(u2, v2, target) {
|
106
|
+
u2 *= Math.PI;
|
107
|
+
v2 *= 2 * Math.PI;
|
108
|
+
const x = size * Math.sin(u2) * Math.cos(v2);
|
109
|
+
const y = size * Math.sin(u2) * Math.sin(v2);
|
110
|
+
const z = size * Math.cos(u2);
|
111
|
+
target.set(x, y, z);
|
112
|
+
}
|
113
|
+
super(sphere, u, v);
|
112
114
|
}
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
115
|
+
},
|
116
|
+
PlaneGeometry: class PlaneGeometry extends ParametricGeometry {
|
117
|
+
constructor(width, depth, segmentsWidth, segmentsDepth) {
|
118
|
+
function plane(u, v, target) {
|
119
|
+
const x = u * width;
|
120
|
+
const y = 0;
|
121
|
+
const z = v * depth;
|
122
|
+
target.set(x, y, z);
|
123
|
+
}
|
124
|
+
super(plane, segmentsWidth, segmentsDepth);
|
123
125
|
}
|
124
|
-
super(plane, segmentsWidth, segmentsDepth);
|
125
126
|
}
|
126
127
|
};
|
127
128
|
export {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
3
|
const THREE = require("three");
|
4
|
-
const tempNormal = new THREE.Vector3();
|
4
|
+
const tempNormal = /* @__PURE__ */ new THREE.Vector3();
|
5
5
|
function getUv(faceDirVector, normal, uvAxis, projectionAxis, radius, sideLength) {
|
6
6
|
const totArcLength = 2 * Math.PI * radius / 4;
|
7
7
|
const centerLength = Math.max(sideLength - 2 * radius, 0);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Vector3, BoxGeometry } from "three";
|
2
|
-
const tempNormal = new Vector3();
|
2
|
+
const tempNormal = /* @__PURE__ */ new Vector3();
|
3
3
|
function getUv(faceDirVector, normal, uvAxis, projectionAxis, radius, sideLength) {
|
4
4
|
const totArcLength = 2 * Math.PI * radius / 4;
|
5
5
|
const centerLength = Math.max(sideLength - 2 * radius, 0);
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import { Line, RectAreaLight,
|
1
|
+
import { Line, RectAreaLight, Color } from 'three'
|
2
2
|
|
3
3
|
export class RectAreaLightHelper extends Line {
|
4
|
-
|
4
|
+
readonly type: 'RectAreaLightHelper'
|
5
|
+
constructor(light: RectAreaLight, color?: Color | string | number)
|
5
6
|
|
6
7
|
light: RectAreaLight
|
7
|
-
color:
|
8
|
+
color: Color | string | number | undefined
|
8
9
|
|
9
10
|
dispose(): void
|
10
11
|
}
|
@@ -9,9 +9,9 @@ class RectAreaLightHelper extends THREE.Line {
|
|
9
9
|
geometry.computeBoundingSphere();
|
10
10
|
const material = new THREE.LineBasicMaterial({ fog: false });
|
11
11
|
super(geometry, material);
|
12
|
-
this.type = "RectAreaLightHelper";
|
13
12
|
this.light = light;
|
14
13
|
this.color = color;
|
14
|
+
this.type = "RectAreaLightHelper";
|
15
15
|
const positions2 = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0];
|
16
16
|
const geometry2 = new THREE.BufferGeometry();
|
17
17
|
geometry2.setAttribute("position", new THREE.Float32BufferAttribute(positions2, 3));
|
@@ -31,7 +31,7 @@ class RectAreaLightHelper extends THREE.Line {
|
|
31
31
|
c.multiplyScalar(1 / max);
|
32
32
|
this.children[0].material.color.copy(this.material.color);
|
33
33
|
}
|
34
|
-
this.matrixWorld.
|
34
|
+
this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld);
|
35
35
|
this.children[0].matrixWorld.copy(this.matrixWorld);
|
36
36
|
}
|
37
37
|
dispose() {
|
@@ -7,9 +7,9 @@ class RectAreaLightHelper extends Line {
|
|
7
7
|
geometry.computeBoundingSphere();
|
8
8
|
const material = new LineBasicMaterial({ fog: false });
|
9
9
|
super(geometry, material);
|
10
|
-
this.type = "RectAreaLightHelper";
|
11
10
|
this.light = light;
|
12
11
|
this.color = color;
|
12
|
+
this.type = "RectAreaLightHelper";
|
13
13
|
const positions2 = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0];
|
14
14
|
const geometry2 = new BufferGeometry();
|
15
15
|
geometry2.setAttribute("position", new Float32BufferAttribute(positions2, 3));
|
@@ -29,7 +29,7 @@ class RectAreaLightHelper extends Line {
|
|
29
29
|
c.multiplyScalar(1 / max);
|
30
30
|
this.children[0].material.color.copy(this.material.color);
|
31
31
|
}
|
32
|
-
this.matrixWorld.
|
32
|
+
this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld);
|
33
33
|
this.children[0].matrixWorld.copy(this.matrixWorld);
|
34
34
|
}
|
35
35
|
dispose() {
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { Object3D, LineSegments } from 'three'
|
2
2
|
|
3
3
|
export class VertexNormalsHelper extends LineSegments {
|
4
|
+
readonly type: 'VertexNormalsHelper'
|
4
5
|
constructor(object: Object3D, size?: number, hex?: number)
|
5
6
|
|
6
7
|
object: Object3D
|
7
8
|
size: number
|
8
9
|
|
9
10
|
update(): void
|
11
|
+
|
12
|
+
dispose(): void
|
10
13
|
}
|
@@ -1,26 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
3
|
const THREE = require("three");
|
4
|
-
const _v1 = new THREE.Vector3();
|
5
|
-
const _v2 = new THREE.Vector3();
|
6
|
-
const _normalMatrix = new THREE.Matrix3();
|
4
|
+
const _v1 = /* @__PURE__ */ new THREE.Vector3();
|
5
|
+
const _v2 = /* @__PURE__ */ new THREE.Vector3();
|
6
|
+
const _normalMatrix = /* @__PURE__ */ new THREE.Matrix3();
|
7
7
|
class VertexNormalsHelper extends THREE.LineSegments {
|
8
|
-
constructor(object, size,
|
8
|
+
constructor(object, size = 1, color = 16711680) {
|
9
9
|
const geometry = new THREE.BufferGeometry();
|
10
|
-
const
|
11
|
-
super(geometry, new THREE.LineBasicMaterial({ color, toneMapped: false }));
|
12
|
-
this.object = object;
|
13
|
-
this.size = size !== void 0 ? size : 0.1;
|
14
|
-
let nNormals = 0;
|
15
|
-
const objGeometry = this.object.geometry;
|
16
|
-
if (objGeometry && objGeometry.isGeometry) {
|
17
|
-
console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");
|
18
|
-
return;
|
19
|
-
} else if (objGeometry && objGeometry.isBufferGeometry) {
|
20
|
-
nNormals = objGeometry.attributes.normal.count;
|
21
|
-
}
|
10
|
+
const nNormals = object.geometry.attributes.normal.count;
|
22
11
|
const positions = new THREE.Float32BufferAttribute(nNormals * 2 * 3, 3);
|
23
12
|
geometry.setAttribute("position", positions);
|
13
|
+
super(geometry, new THREE.LineBasicMaterial({ color, toneMapped: false }));
|
14
|
+
this.object = object;
|
15
|
+
this.size = size;
|
24
16
|
this.type = "VertexNormalsHelper";
|
25
17
|
this.matrixAutoUpdate = false;
|
26
18
|
this.update();
|
@@ -31,16 +23,13 @@ class VertexNormalsHelper extends THREE.LineSegments {
|
|
31
23
|
const matrixWorld = this.object.matrixWorld;
|
32
24
|
const position = this.geometry.attributes.position;
|
33
25
|
const objGeometry = this.object.geometry;
|
34
|
-
if (objGeometry
|
35
|
-
console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");
|
36
|
-
return;
|
37
|
-
} else if (objGeometry && objGeometry.isBufferGeometry) {
|
26
|
+
if (objGeometry) {
|
38
27
|
const objPos = objGeometry.attributes.position;
|
39
28
|
const objNorm = objGeometry.attributes.normal;
|
40
29
|
let idx = 0;
|
41
30
|
for (let j = 0, jl = objPos.count; j < jl; j++) {
|
42
|
-
_v1.
|
43
|
-
_v2.
|
31
|
+
_v1.fromBufferAttribute(objPos, j).applyMatrix4(matrixWorld);
|
32
|
+
_v2.fromBufferAttribute(objNorm, j);
|
44
33
|
_v2.applyMatrix3(_normalMatrix).normalize().multiplyScalar(this.size).add(_v1);
|
45
34
|
position.setXYZ(idx, _v1.x, _v1.y, _v1.z);
|
46
35
|
idx = idx + 1;
|
@@ -50,5 +39,9 @@ class VertexNormalsHelper extends THREE.LineSegments {
|
|
50
39
|
}
|
51
40
|
position.needsUpdate = true;
|
52
41
|
}
|
42
|
+
dispose() {
|
43
|
+
this.geometry.dispose();
|
44
|
+
this.material.dispose();
|
45
|
+
}
|
53
46
|
}
|
54
47
|
exports.VertexNormalsHelper = VertexNormalsHelper;
|
@@ -1,24 +1,16 @@
|
|
1
|
-
import { Vector3, Matrix3, LineSegments, BufferGeometry,
|
2
|
-
const _v1 = new Vector3();
|
3
|
-
const _v2 = new Vector3();
|
4
|
-
const _normalMatrix = new Matrix3();
|
1
|
+
import { Vector3, Matrix3, LineSegments, BufferGeometry, Float32BufferAttribute, LineBasicMaterial } from "three";
|
2
|
+
const _v1 = /* @__PURE__ */ new Vector3();
|
3
|
+
const _v2 = /* @__PURE__ */ new Vector3();
|
4
|
+
const _normalMatrix = /* @__PURE__ */ new Matrix3();
|
5
5
|
class VertexNormalsHelper extends LineSegments {
|
6
|
-
constructor(object, size,
|
6
|
+
constructor(object, size = 1, color = 16711680) {
|
7
7
|
const geometry = new BufferGeometry();
|
8
|
-
const
|
9
|
-
super(geometry, new LineBasicMaterial({ color, toneMapped: false }));
|
10
|
-
this.object = object;
|
11
|
-
this.size = size !== void 0 ? size : 0.1;
|
12
|
-
let nNormals = 0;
|
13
|
-
const objGeometry = this.object.geometry;
|
14
|
-
if (objGeometry && objGeometry.isGeometry) {
|
15
|
-
console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");
|
16
|
-
return;
|
17
|
-
} else if (objGeometry && objGeometry.isBufferGeometry) {
|
18
|
-
nNormals = objGeometry.attributes.normal.count;
|
19
|
-
}
|
8
|
+
const nNormals = object.geometry.attributes.normal.count;
|
20
9
|
const positions = new Float32BufferAttribute(nNormals * 2 * 3, 3);
|
21
10
|
geometry.setAttribute("position", positions);
|
11
|
+
super(geometry, new LineBasicMaterial({ color, toneMapped: false }));
|
12
|
+
this.object = object;
|
13
|
+
this.size = size;
|
22
14
|
this.type = "VertexNormalsHelper";
|
23
15
|
this.matrixAutoUpdate = false;
|
24
16
|
this.update();
|
@@ -29,16 +21,13 @@ class VertexNormalsHelper extends LineSegments {
|
|
29
21
|
const matrixWorld = this.object.matrixWorld;
|
30
22
|
const position = this.geometry.attributes.position;
|
31
23
|
const objGeometry = this.object.geometry;
|
32
|
-
if (objGeometry
|
33
|
-
console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");
|
34
|
-
return;
|
35
|
-
} else if (objGeometry && objGeometry.isBufferGeometry) {
|
24
|
+
if (objGeometry) {
|
36
25
|
const objPos = objGeometry.attributes.position;
|
37
26
|
const objNorm = objGeometry.attributes.normal;
|
38
27
|
let idx = 0;
|
39
28
|
for (let j = 0, jl = objPos.count; j < jl; j++) {
|
40
|
-
_v1.
|
41
|
-
_v2.
|
29
|
+
_v1.fromBufferAttribute(objPos, j).applyMatrix4(matrixWorld);
|
30
|
+
_v2.fromBufferAttribute(objNorm, j);
|
42
31
|
_v2.applyMatrix3(_normalMatrix).normalize().multiplyScalar(this.size).add(_v1);
|
43
32
|
position.setXYZ(idx, _v1.x, _v1.y, _v1.z);
|
44
33
|
idx = idx + 1;
|
@@ -48,6 +37,10 @@ class VertexNormalsHelper extends LineSegments {
|
|
48
37
|
}
|
49
38
|
position.needsUpdate = true;
|
50
39
|
}
|
40
|
+
dispose() {
|
41
|
+
this.geometry.dispose();
|
42
|
+
this.material.dispose();
|
43
|
+
}
|
51
44
|
}
|
52
45
|
export {
|
53
46
|
VertexNormalsHelper
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import { Object3D, LineSegments } from 'three'
|
2
2
|
|
3
3
|
export class VertexTangentsHelper extends LineSegments {
|
4
|
+
readonly type: 'VertexTangentsHelper'
|
4
5
|
constructor(object: Object3D, size?: number, hex?: number)
|
5
6
|
|
6
7
|
object: Object3D
|
7
8
|
size: number
|
8
9
|
|
9
10
|
update(): void
|
11
|
+
|
12
|
+
dispose(): void
|
10
13
|
}
|
@@ -1,24 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
3
|
const THREE = require("three");
|
4
|
-
const _v1 = new THREE.Vector3();
|
5
|
-
const _v2 = new THREE.Vector3();
|
4
|
+
const _v1 = /* @__PURE__ */ new THREE.Vector3();
|
5
|
+
const _v2 = /* @__PURE__ */ new THREE.Vector3();
|
6
6
|
class VertexTangentsHelper extends THREE.LineSegments {
|
7
|
-
constructor(object, size,
|
8
|
-
const color = hex !== void 0 ? hex : 65535;
|
9
|
-
const objGeometry = object.geometry;
|
10
|
-
if (!(objGeometry && objGeometry.isBufferGeometry)) {
|
11
|
-
console.error("THREE.VertexTangentsHelper: geometry not an instance of THREE.BufferGeometry.", objGeometry);
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
const nTangents = objGeometry.attributes.tangent.count;
|
7
|
+
constructor(object, size = 1, color = 65535) {
|
15
8
|
const geometry = new THREE.BufferGeometry();
|
9
|
+
const nTangents = object.geometry.attributes.tangent.count;
|
16
10
|
const positions = new THREE.Float32BufferAttribute(nTangents * 2 * 3, 3);
|
17
11
|
geometry.setAttribute("position", positions);
|
18
12
|
super(geometry, new THREE.LineBasicMaterial({ color, toneMapped: false }));
|
19
|
-
this.type = "VertexTangentsHelper";
|
20
13
|
this.object = object;
|
21
|
-
this.size = size
|
14
|
+
this.size = size;
|
15
|
+
this.type = "VertexTangentsHelper";
|
22
16
|
this.matrixAutoUpdate = false;
|
23
17
|
this.update();
|
24
18
|
}
|
@@ -31,8 +25,8 @@ class VertexTangentsHelper extends THREE.LineSegments {
|
|
31
25
|
const objTan = objGeometry.attributes.tangent;
|
32
26
|
let idx = 0;
|
33
27
|
for (let j = 0, jl = objPos.count; j < jl; j++) {
|
34
|
-
_v1.
|
35
|
-
_v2.
|
28
|
+
_v1.fromBufferAttribute(objPos, j).applyMatrix4(matrixWorld);
|
29
|
+
_v2.fromBufferAttribute(objTan, j);
|
36
30
|
_v2.transformDirection(matrixWorld).multiplyScalar(this.size).add(_v1);
|
37
31
|
position.setXYZ(idx, _v1.x, _v1.y, _v1.z);
|
38
32
|
idx = idx + 1;
|
@@ -41,5 +35,9 @@ class VertexTangentsHelper extends THREE.LineSegments {
|
|
41
35
|
}
|
42
36
|
position.needsUpdate = true;
|
43
37
|
}
|
38
|
+
dispose() {
|
39
|
+
this.geometry.dispose();
|
40
|
+
this.material.dispose();
|
41
|
+
}
|
44
42
|
}
|
45
43
|
exports.VertexTangentsHelper = VertexTangentsHelper;
|