three-stdlib 2.22.7 → 2.22.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_polyfill/CompressedArrayTexture.js +12 -0
- package/dist/_polyfill/CompressedArrayTexture.mjs +12 -0
- package/dist/_polyfill/Data3DTexture.js +17 -0
- package/dist/_polyfill/Data3DTexture.mjs +17 -0
- package/dist/animation/AnimationClipCreator.d.ts +12 -0
- package/dist/animation/AnimationClipCreator.js +57 -0
- package/dist/animation/AnimationClipCreator.mjs +57 -0
- package/dist/animation/CCDIKSolver.d.ts +25 -0
- package/dist/animation/CCDIKSolver.js +224 -0
- package/dist/animation/CCDIKSolver.mjs +224 -0
- package/dist/animation/MMDAnimationHelper.d.ts +93 -0
- package/dist/animation/MMDAnimationHelper.js +590 -0
- package/dist/animation/MMDAnimationHelper.mjs +590 -0
- package/dist/animation/MMDPhysics.d.ts +114 -0
- package/dist/animation/MMDPhysics.js +819 -0
- package/dist/animation/MMDPhysics.mjs +819 -0
- package/dist/cameras/CinematicCamera.d.ts +34 -0
- package/dist/cameras/CinematicCamera.js +131 -0
- package/dist/cameras/CinematicCamera.mjs +131 -0
- package/dist/controls/ArcballControls.d.ts +374 -0
- package/dist/controls/ArcballControls.js +2039 -0
- package/dist/controls/ArcballControls.mjs +2039 -0
- package/dist/controls/DeviceOrientationControls.d.ts +27 -0
- package/dist/controls/DeviceOrientationControls.js +84 -0
- package/dist/controls/DeviceOrientationControls.mjs +84 -0
- package/dist/controls/DragControls.d.ts +34 -0
- package/dist/controls/DragControls.js +182 -0
- package/dist/controls/DragControls.mjs +182 -0
- package/dist/controls/FirstPersonControls.d.ts +48 -0
- package/dist/controls/FirstPersonControls.js +229 -0
- package/dist/controls/FirstPersonControls.mjs +229 -0
- package/dist/controls/FlyControls.d.ts +32 -0
- package/dist/controls/FlyControls.js +248 -0
- package/dist/controls/FlyControls.mjs +248 -0
- package/dist/controls/OrbitControls.d.ts +63 -0
- package/dist/controls/OrbitControls.js +781 -0
- package/dist/controls/OrbitControls.mjs +781 -0
- package/dist/controls/PointerLockControls.d.ts +24 -0
- package/dist/controls/PointerLockControls.js +103 -0
- package/dist/controls/PointerLockControls.mjs +103 -0
- package/dist/controls/TrackballControls.d.ts +95 -0
- package/dist/controls/TrackballControls.js +502 -0
- package/dist/controls/TrackballControls.mjs +502 -0
- package/dist/controls/TransformControls.d.ts +151 -0
- package/dist/controls/TransformControls.js +1089 -0
- package/dist/controls/TransformControls.mjs +1089 -0
- package/dist/controls/experimental/CameraControls.d.ts +212 -0
- package/dist/controls/experimental/CameraControls.js +736 -0
- package/dist/controls/experimental/CameraControls.mjs +736 -0
- package/dist/csm/CSM.d.ts +61 -0
- package/dist/csm/CSM.js +244 -0
- package/dist/csm/CSM.mjs +244 -0
- package/dist/csm/CSMFrustum.d.ts +19 -0
- package/dist/csm/CSMFrustum.js +75 -0
- package/dist/csm/CSMFrustum.mjs +75 -0
- package/dist/csm/CSMHelper.d.ts +26 -0
- package/dist/csm/CSMHelper.js +114 -0
- package/dist/csm/CSMHelper.mjs +114 -0
- package/dist/csm/CSMShader.d.ts +4 -0
- package/dist/csm/CSMShader.js +257 -0
- package/dist/csm/CSMShader.mjs +257 -0
- package/dist/curves/CurveExtras.d.ts +68 -0
- package/dist/curves/CurveExtras.js +224 -0
- package/dist/curves/CurveExtras.mjs +224 -0
- package/dist/curves/NURBSCurve.d.ts +11 -0
- package/dist/curves/NURBSCurve.js +35 -0
- package/dist/curves/NURBSCurve.mjs +35 -0
- package/dist/curves/NURBSSurface.d.ts +13 -0
- package/dist/curves/NURBSSurface.js +28 -0
- package/dist/curves/NURBSSurface.mjs +28 -0
- package/dist/curves/NURBSUtils.d.ts +22 -0
- package/dist/curves/NURBSUtils.js +226 -0
- package/dist/curves/NURBSUtils.mjs +226 -0
- package/dist/custom.d.ts +5 -0
- package/dist/deprecated/Geometry.d.ts +342 -0
- package/dist/deprecated/Geometry.js +971 -0
- package/dist/deprecated/Geometry.mjs +971 -0
- package/dist/effects/AnaglyphEffect.d.ts +11 -0
- package/dist/effects/AnaglyphEffect.js +121 -0
- package/dist/effects/AnaglyphEffect.mjs +121 -0
- package/dist/effects/AsciiEffect.d.ts +18 -0
- package/dist/effects/AsciiEffect.js +173 -0
- package/dist/effects/AsciiEffect.mjs +173 -0
- package/dist/effects/OutlineEffect.d.ts +28 -0
- package/dist/effects/OutlineEffect.js +298 -0
- package/dist/effects/OutlineEffect.mjs +298 -0
- package/dist/effects/ParallaxBarrierEffect.d.ts +8 -0
- package/dist/effects/ParallaxBarrierEffect.js +64 -0
- package/dist/effects/ParallaxBarrierEffect.mjs +64 -0
- package/dist/effects/PeppersGhostEffect.d.ts +10 -0
- package/dist/effects/PeppersGhostEffect.js +85 -0
- package/dist/effects/PeppersGhostEffect.mjs +85 -0
- package/dist/effects/StereoEffect.d.ts +9 -0
- package/dist/effects/StereoEffect.js +32 -0
- package/dist/effects/StereoEffect.mjs +32 -0
- package/dist/environments/RoomEnvironment.d.ts +5 -0
- package/dist/environments/RoomEnvironment.js +95 -0
- package/dist/environments/RoomEnvironment.mjs +78 -0
- package/dist/exporters/ColladaExporter.d.ts +50 -0
- package/dist/exporters/ColladaExporter.js +331 -0
- package/dist/exporters/ColladaExporter.mjs +331 -0
- package/dist/exporters/DRACOExporter.d.ts +23 -0
- package/dist/exporters/DRACOExporter.js +141 -0
- package/dist/exporters/DRACOExporter.mjs +141 -0
- package/dist/exporters/GLTFExporter.d.ts +446 -0
- package/dist/exporters/GLTFExporter.js +1575 -0
- package/dist/exporters/GLTFExporter.mjs +1575 -0
- package/dist/exporters/MMDExporter.d.ts +12 -0
- package/dist/exporters/MMDExporter.js +131 -0
- package/dist/exporters/MMDExporter.mjs +131 -0
- package/dist/exporters/OBJExporter.d.ts +18 -0
- package/dist/exporters/OBJExporter.js +181 -0
- package/dist/exporters/OBJExporter.mjs +181 -0
- package/dist/exporters/PLYExporter.d.ts +23 -0
- package/dist/exporters/PLYExporter.js +280 -0
- package/dist/exporters/PLYExporter.mjs +280 -0
- package/dist/exporters/STLExporter.d.ts +31 -0
- package/dist/exporters/STLExporter.js +146 -0
- package/dist/exporters/STLExporter.mjs +146 -0
- package/dist/exporters/USDZExporter.d.ts +27 -0
- package/dist/exporters/USDZExporter.js +340 -0
- package/dist/exporters/USDZExporter.mjs +340 -0
- package/dist/geometries/BoxLineGeometry.d.ts +12 -0
- package/dist/geometries/BoxLineGeometry.js +45 -0
- package/dist/geometries/BoxLineGeometry.mjs +45 -0
- package/dist/geometries/ConvexGeometry.d.ts +5 -0
- package/dist/geometries/ConvexGeometry.js +29 -0
- package/dist/geometries/ConvexGeometry.mjs +29 -0
- package/dist/geometries/DecalGeometry.d.ts +10 -0
- package/dist/geometries/DecalGeometry.js +184 -0
- package/dist/geometries/DecalGeometry.mjs +184 -0
- package/dist/geometries/LightningStrike.d.ts +108 -0
- package/dist/geometries/LightningStrike.js +548 -0
- package/dist/geometries/LightningStrike.mjs +548 -0
- package/dist/geometries/ParametricGeometries.d.ts +26 -0
- package/dist/geometries/ParametricGeometries.js +129 -0
- package/dist/geometries/ParametricGeometries.mjs +129 -0
- package/dist/geometries/ParametricGeometry.d.ts +18 -0
- package/dist/geometries/ParametricGeometry.js +63 -0
- package/dist/geometries/ParametricGeometry.mjs +63 -0
- package/dist/geometries/RoundedBoxGeometry.d.ts +5 -0
- package/dist/geometries/RoundedBoxGeometry.js +91 -0
- package/dist/geometries/RoundedBoxGeometry.mjs +91 -0
- package/dist/geometries/TeapotGeometry.d.ts +13 -0
- package/dist/geometries/TeapotGeometry.js +1563 -0
- package/dist/geometries/TeapotGeometry.mjs +1563 -0
- package/dist/geometries/TextGeometry.d.ts +18 -0
- package/dist/geometries/TextGeometry.js +27 -0
- package/dist/geometries/TextGeometry.mjs +27 -0
- package/dist/helpers/LightProbeHelper.d.ts +10 -0
- package/dist/helpers/LightProbeHelper.js +73 -0
- package/dist/helpers/LightProbeHelper.mjs +73 -0
- package/dist/helpers/PositionalAudioHelper.d.ts +13 -0
- package/dist/helpers/PositionalAudioHelper.js +68 -0
- package/dist/helpers/PositionalAudioHelper.mjs +68 -0
- package/dist/helpers/RectAreaLightHelper.d.ts +10 -0
- package/dist/helpers/RectAreaLightHelper.js +44 -0
- package/dist/helpers/RectAreaLightHelper.mjs +44 -0
- package/dist/helpers/VertexNormalsHelper.d.ts +10 -0
- package/dist/helpers/VertexNormalsHelper.js +54 -0
- package/dist/helpers/VertexNormalsHelper.mjs +54 -0
- package/dist/helpers/VertexTangentsHelper.d.ts +10 -0
- package/dist/helpers/VertexTangentsHelper.js +45 -0
- package/dist/helpers/VertexTangentsHelper.mjs +45 -0
- package/dist/index.d.ts +325 -0
- package/dist/index.js +978 -0
- package/dist/index.mjs +978 -0
- package/dist/interactive/HTMLMesh.d.ts +6 -0
- package/dist/interactive/HTMLMesh.js +325 -0
- package/dist/interactive/HTMLMesh.mjs +325 -0
- package/dist/interactive/InteractiveGroup.d.ts +5 -0
- package/dist/interactive/InteractiveGroup.js +68 -0
- package/dist/interactive/InteractiveGroup.mjs +68 -0
- package/dist/interactive/SelectionBox.d.ts +15 -0
- package/dist/interactive/SelectionBox.js +137 -0
- package/dist/interactive/SelectionBox.mjs +137 -0
- package/dist/interactive/SelectionHelper.d.ts +17 -0
- package/dist/interactive/SelectionHelper.js +54 -0
- package/dist/interactive/SelectionHelper.mjs +54 -0
- package/dist/libs/MeshoptDecoder.d.ts +12 -0
- package/dist/libs/MeshoptDecoder.js +221 -0
- package/dist/libs/MeshoptDecoder.mjs +221 -0
- package/dist/libs/MotionControllers.d.ts +175 -0
- package/dist/libs/MotionControllers.js +325 -0
- package/dist/libs/MotionControllers.mjs +325 -0
- package/dist/lights/LightProbeGenerator.d.ts +6 -0
- package/dist/lights/LightProbeGenerator.js +145 -0
- package/dist/lights/LightProbeGenerator.mjs +145 -0
- package/dist/lights/RectAreaLightUniformsLib.d.ts +3 -0
- package/dist/lights/RectAreaLightUniformsLib.js +32842 -0
- package/dist/lights/RectAreaLightUniformsLib.mjs +32842 -0
- package/dist/lines/Line2.d.ts +11 -0
- package/dist/lines/Line2.js +13 -0
- package/dist/lines/Line2.mjs +13 -0
- package/dist/lines/LineGeometry.d.ts +10 -0
- package/dist/lines/LineGeometry.js +44 -0
- package/dist/lines/LineGeometry.mjs +44 -0
- package/dist/lines/LineMaterial.d.ts +31 -0
- package/dist/lines/LineMaterial.js +547 -0
- package/dist/lines/LineMaterial.mjs +547 -0
- package/dist/lines/LineSegments2.d.ts +14 -0
- package/dist/lines/LineSegments2.js +203 -0
- package/dist/lines/LineSegments2.mjs +203 -0
- package/dist/lines/LineSegmentsGeometry.d.ts +16 -0
- package/dist/lines/LineSegmentsGeometry.js +124 -0
- package/dist/lines/LineSegmentsGeometry.mjs +124 -0
- package/dist/lines/Wireframe.d.ts +11 -0
- package/dist/lines/Wireframe.js +32 -0
- package/dist/lines/Wireframe.mjs +32 -0
- package/dist/lines/WireframeGeometry2.d.ts +8 -0
- package/dist/lines/WireframeGeometry2.js +13 -0
- package/dist/lines/WireframeGeometry2.mjs +13 -0
- package/dist/loaders/3DMLoader.d.ts +17 -0
- package/dist/loaders/3DMLoader.js +803 -0
- package/dist/loaders/3DMLoader.mjs +803 -0
- package/dist/loaders/3MFLoader.d.ts +16 -0
- package/dist/loaders/3MFLoader.js +854 -0
- package/dist/loaders/3MFLoader.mjs +854 -0
- package/dist/loaders/AMFLoader.d.ts +14 -0
- package/dist/loaders/AMFLoader.js +284 -0
- package/dist/loaders/AMFLoader.mjs +284 -0
- package/dist/loaders/AssimpLoader.js +1396 -0
- package/dist/loaders/AssimpLoader.mjs +1396 -0
- package/dist/loaders/BVHLoader.d.ts +21 -0
- package/dist/loaders/BVHLoader.js +207 -0
- package/dist/loaders/BVHLoader.mjs +207 -0
- package/dist/loaders/BasisTextureLoader.d.ts +32 -0
- package/dist/loaders/BasisTextureLoader.js +480 -0
- package/dist/loaders/BasisTextureLoader.mjs +480 -0
- package/dist/loaders/ColladaLoader.d.ts +20 -0
- package/dist/loaders/ColladaLoader.js +2405 -0
- package/dist/loaders/ColladaLoader.mjs +2405 -0
- package/dist/loaders/DDSLoader.d.ts +16 -0
- package/dist/loaders/DDSLoader.js +148 -0
- package/dist/loaders/DDSLoader.mjs +148 -0
- package/dist/loaders/DRACOLoader.d.ts +18 -0
- package/dist/loaders/DRACOLoader.js +341 -0
- package/dist/loaders/DRACOLoader.mjs +341 -0
- package/dist/loaders/EXRLoader.d.ts +18 -0
- package/dist/loaders/EXRLoader.js +1354 -0
- package/dist/loaders/EXRLoader.mjs +1354 -0
- package/dist/loaders/FBXLoader.d.ts +14 -0
- package/dist/loaders/FBXLoader.js +2457 -0
- package/dist/loaders/FBXLoader.mjs +2457 -0
- package/dist/loaders/FontLoader.d.ts +36 -0
- package/dist/loaders/FontLoader.js +120 -0
- package/dist/loaders/FontLoader.mjs +120 -0
- package/dist/loaders/GCodeLoader.d.ts +15 -0
- package/dist/loaders/GCodeLoader.js +141 -0
- package/dist/loaders/GCodeLoader.mjs +141 -0
- package/dist/loaders/GLTFLoader.d.ts +153 -0
- package/dist/loaders/GLTFLoader.js +2459 -0
- package/dist/loaders/GLTFLoader.mjs +2459 -0
- package/dist/loaders/HDRCubeTextureLoader.d.ts +18 -0
- package/dist/loaders/HDRCubeTextureLoader.js +75 -0
- package/dist/loaders/HDRCubeTextureLoader.mjs +75 -0
- package/dist/loaders/KMZLoader.d.ts +16 -0
- package/dist/loaders/KMZLoader.js +75 -0
- package/dist/loaders/KMZLoader.mjs +75 -0
- package/dist/loaders/KTX2Loader.d.ts +16 -0
- package/dist/loaders/KTX2Loader.js +461 -0
- package/dist/loaders/KTX2Loader.mjs +461 -0
- package/dist/loaders/KTXLoader.d.ts +16 -0
- package/dist/loaders/KTXLoader.js +93 -0
- package/dist/loaders/KTXLoader.mjs +93 -0
- package/dist/loaders/LDrawLoader.d.ts +26 -0
- package/dist/loaders/LDrawLoader.js +1424 -0
- package/dist/loaders/LDrawLoader.mjs +1424 -0
- package/dist/loaders/LUT3dlLoader.d.ts +20 -0
- package/dist/loaders/LUT3dlLoader.js +103 -0
- package/dist/loaders/LUT3dlLoader.mjs +103 -0
- package/dist/loaders/LUTCubeLoader.d.ts +23 -0
- package/dist/loaders/LUTCubeLoader.js +107 -0
- package/dist/loaders/LUTCubeLoader.mjs +107 -0
- package/dist/loaders/LWOLoader.d.ts +26 -0
- package/dist/loaders/LWOLoader.js +645 -0
- package/dist/loaders/LWOLoader.mjs +645 -0
- package/dist/loaders/LottieLoader.d.ts +15 -0
- package/dist/loaders/LottieLoader.js +47 -0
- package/dist/loaders/LottieLoader.mjs +47 -0
- package/dist/loaders/MD2Loader.d.ts +14 -0
- package/dist/loaders/MD2Loader.js +359 -0
- package/dist/loaders/MD2Loader.mjs +359 -0
- package/dist/loaders/MDDLoader.d.ts +19 -0
- package/dist/loaders/MDDLoader.js +58 -0
- package/dist/loaders/MDDLoader.mjs +58 -0
- package/dist/loaders/MMDLoader.d.ts +63 -0
- package/dist/loaders/MMDLoader.js +1121 -0
- package/dist/loaders/MMDLoader.mjs +1121 -0
- package/dist/loaders/MTLLoader.d.ts +100 -0
- package/dist/loaders/MTLLoader.js +304 -0
- package/dist/loaders/MTLLoader.mjs +304 -0
- package/dist/loaders/NRRDLoader.d.ts +21 -0
- package/dist/loaders/NRRDLoader.js +401 -0
- package/dist/loaders/NRRDLoader.mjs +401 -0
- package/dist/loaders/NodeMaterialLoader.js +146 -0
- package/dist/loaders/NodeMaterialLoader.mjs +146 -0
- package/dist/loaders/OBJLoader.d.ts +17 -0
- package/dist/loaders/OBJLoader.js +487 -0
- package/dist/loaders/OBJLoader.mjs +487 -0
- package/dist/loaders/PCDLoader.d.ts +15 -0
- package/dist/loaders/PCDLoader.js +248 -0
- package/dist/loaders/PCDLoader.mjs +248 -0
- package/dist/loaders/PDBLoader.d.ts +22 -0
- package/dist/loaders/PDBLoader.js +247 -0
- package/dist/loaders/PDBLoader.mjs +247 -0
- package/dist/loaders/PLYLoader.d.ts +16 -0
- package/dist/loaders/PLYLoader.js +317 -0
- package/dist/loaders/PLYLoader.mjs +317 -0
- package/dist/loaders/PRWMLoader.d.ts +16 -0
- package/dist/loaders/PRWMLoader.js +160 -0
- package/dist/loaders/PRWMLoader.mjs +160 -0
- package/dist/loaders/PVRLoader.d.ts +16 -0
- package/dist/loaders/PVRLoader.js +131 -0
- package/dist/loaders/PVRLoader.mjs +131 -0
- package/dist/loaders/RGBELoader.d.ts +20 -0
- package/dist/loaders/RGBELoader.js +252 -0
- package/dist/loaders/RGBELoader.mjs +252 -0
- package/dist/loaders/RGBMLoader.d.ts +32 -0
- package/dist/loaders/RGBMLoader.js +998 -0
- package/dist/loaders/RGBMLoader.mjs +998 -0
- package/dist/loaders/STLLoader.d.ts +14 -0
- package/dist/loaders/STLLoader.js +190 -0
- package/dist/loaders/STLLoader.mjs +190 -0
- package/dist/loaders/SVGLoader.d.ts +63 -0
- package/dist/loaders/SVGLoader.js +1712 -0
- package/dist/loaders/SVGLoader.mjs +1712 -0
- package/dist/loaders/TDSLoader.d.ts +42 -0
- package/dist/loaders/TDSLoader.js +650 -0
- package/dist/loaders/TDSLoader.mjs +650 -0
- package/dist/loaders/TGALoader.d.ts +14 -0
- package/dist/loaders/TGALoader.js +285 -0
- package/dist/loaders/TGALoader.mjs +285 -0
- package/dist/loaders/TTFLoader.d.ts +15 -0
- package/dist/loaders/TTFLoader.js +131 -0
- package/dist/loaders/TTFLoader.mjs +131 -0
- package/dist/loaders/TiltLoader.d.ts +14 -0
- package/dist/loaders/TiltLoader.js +373 -0
- package/dist/loaders/TiltLoader.mjs +373 -0
- package/dist/loaders/VOXLoader.d.ts +28 -0
- package/dist/loaders/VOXLoader.js +432 -0
- package/dist/loaders/VOXLoader.mjs +432 -0
- package/dist/loaders/VRMLLoader.d.ts +14 -0
- package/dist/loaders/VRMLLoader.js +2105 -0
- package/dist/loaders/VRMLLoader.mjs +2105 -0
- package/dist/loaders/VRMLoader.js +38 -0
- package/dist/loaders/VRMLoader.mjs +38 -0
- package/dist/loaders/VTKLoader.d.ts +14 -0
- package/dist/loaders/VTKLoader.js +648 -0
- package/dist/loaders/VTKLoader.mjs +648 -0
- package/dist/loaders/XLoader.js +1258 -0
- package/dist/loaders/XLoader.mjs +1258 -0
- package/dist/loaders/XYZLoader.d.ts +14 -0
- package/dist/loaders/XYZLoader.js +60 -0
- package/dist/loaders/XYZLoader.mjs +60 -0
- package/dist/loaders/lwo/IFFParser.js +749 -0
- package/dist/loaders/lwo/IFFParser.mjs +749 -0
- package/dist/loaders/lwo/LWO2Parser.js +327 -0
- package/dist/loaders/lwo/LWO2Parser.mjs +327 -0
- package/dist/loaders/lwo/LWO3Parser.js +298 -0
- package/dist/loaders/lwo/LWO3Parser.mjs +298 -0
- package/dist/math/Capsule.d.ts +27 -0
- package/dist/math/Capsule.js +100 -0
- package/dist/math/Capsule.mjs +100 -0
- package/dist/math/ColorConverter.d.ts +21 -0
- package/dist/math/ColorConverter.js +52 -0
- package/dist/math/ColorConverter.mjs +52 -0
- package/dist/math/ConvexHull.d.ts +89 -0
- package/dist/math/ConvexHull.js +597 -0
- package/dist/math/ConvexHull.mjs +597 -0
- package/dist/math/ImprovedNoise.d.ts +4 -0
- package/dist/math/ImprovedNoise.js +302 -0
- package/dist/math/ImprovedNoise.mjs +302 -0
- package/dist/math/Lut.d.ts +27 -0
- package/dist/math/Lut.js +135 -0
- package/dist/math/Lut.mjs +135 -0
- package/dist/math/MeshSurfaceSampler.d.ts +15 -0
- package/dist/math/MeshSurfaceSampler.js +107 -0
- package/dist/math/MeshSurfaceSampler.mjs +107 -0
- package/dist/math/OBB.d.ts +24 -0
- package/dist/math/OBB.js +262 -0
- package/dist/math/OBB.mjs +262 -0
- package/dist/math/Octree.d.ts +24 -0
- package/dist/math/Octree.js +278 -0
- package/dist/math/Octree.mjs +278 -0
- package/dist/math/SimplexNoise.d.ts +21 -0
- package/dist/math/SimplexNoise.js +440 -0
- package/dist/math/SimplexNoise.mjs +440 -0
- package/dist/misc/ConvexObjectBreaker.d.ts +25 -0
- package/dist/misc/ConvexObjectBreaker.js +298 -0
- package/dist/misc/ConvexObjectBreaker.mjs +298 -0
- package/dist/misc/GPUComputationRenderer.d.ts +52 -0
- package/dist/misc/GPUComputationRenderer.js +171 -0
- package/dist/misc/GPUComputationRenderer.mjs +171 -0
- package/dist/misc/Gyroscope.d.ts +5 -0
- package/dist/misc/Gyroscope.js +35 -0
- package/dist/misc/Gyroscope.mjs +35 -0
- package/dist/misc/MD2Character.d.ts +33 -0
- package/dist/misc/MD2Character.js +165 -0
- package/dist/misc/MD2Character.mjs +165 -0
- package/dist/misc/MD2CharacterComplex.d.ts +47 -0
- package/dist/misc/MD2CharacterComplex.js +331 -0
- package/dist/misc/MD2CharacterComplex.mjs +331 -0
- package/dist/misc/MorphAnimMesh.d.ts +13 -0
- package/dist/misc/MorphAnimMesh.js +40 -0
- package/dist/misc/MorphAnimMesh.mjs +40 -0
- package/dist/misc/MorphBlendMesh.d.ts +21 -0
- package/dist/misc/MorphBlendMesh.js +179 -0
- package/dist/misc/MorphBlendMesh.mjs +179 -0
- package/dist/misc/ProgressiveLightmap.d.ts +61 -0
- package/dist/misc/ProgressiveLightmap.js +186 -0
- package/dist/misc/ProgressiveLightmap.mjs +186 -0
- package/dist/misc/RollerCoaster.d.ts +21 -0
- package/dist/misc/RollerCoaster.js +346 -0
- package/dist/misc/RollerCoaster.mjs +346 -0
- package/dist/misc/Timer.d.ts +27 -0
- package/dist/misc/Timer.js +101 -0
- package/dist/misc/Timer.mjs +101 -0
- package/dist/misc/TubePainter.d.ts +10 -0
- package/dist/misc/TubePainter.js +123 -0
- package/dist/misc/TubePainter.mjs +123 -0
- package/dist/misc/Volume.d.ts +37 -0
- package/dist/misc/Volume.js +302 -0
- package/dist/misc/Volume.mjs +302 -0
- package/dist/misc/VolumeSlice.d.ts +28 -0
- package/dist/misc/VolumeSlice.js +115 -0
- package/dist/misc/VolumeSlice.mjs +115 -0
- package/dist/misc/WebGL.d.ts +5 -0
- package/dist/misc/WebGL.js +74 -0
- package/dist/misc/WebGL.mjs +74 -0
- package/dist/modifiers/CurveModifier.d.ts +91 -0
- package/dist/modifiers/CurveModifier.js +232 -0
- package/dist/modifiers/CurveModifier.mjs +232 -0
- package/dist/modifiers/EdgeSplitModifier.d.ts +19 -0
- package/dist/modifiers/EdgeSplitModifier.js +167 -0
- package/dist/modifiers/EdgeSplitModifier.mjs +168 -0
- package/dist/modifiers/SimplifyModifier.d.ts +19 -0
- package/dist/modifiers/SimplifyModifier.js +300 -0
- package/dist/modifiers/SimplifyModifier.mjs +300 -0
- package/dist/modifiers/TessellateModifier.d.ts +11 -0
- package/dist/modifiers/TessellateModifier.js +214 -0
- package/dist/modifiers/TessellateModifier.mjs +214 -0
- package/dist/nodes/Nodes.js +347 -0
- package/dist/nodes/Nodes.mjs +347 -0
- package/dist/nodes/ShaderNode.js +408 -0
- package/dist/nodes/ShaderNode.mjs +408 -0
- package/dist/nodes/accessors/BufferNode.js +14 -0
- package/dist/nodes/accessors/BufferNode.mjs +15 -0
- package/dist/nodes/accessors/CameraNode.js +43 -0
- package/dist/nodes/accessors/CameraNode.mjs +44 -0
- package/dist/nodes/accessors/CubeTextureNode.js +41 -0
- package/dist/nodes/accessors/CubeTextureNode.mjs +42 -0
- package/dist/nodes/accessors/MaterialNode.js +70 -0
- package/dist/nodes/accessors/MaterialNode.mjs +71 -0
- package/dist/nodes/accessors/MaterialReferenceNode.js +13 -0
- package/dist/nodes/accessors/MaterialReferenceNode.mjs +14 -0
- package/dist/nodes/accessors/ModelNode.js +8 -0
- package/dist/nodes/accessors/ModelNode.mjs +9 -0
- package/dist/nodes/accessors/ModelViewProjectionNode.js +23 -0
- package/dist/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
- package/dist/nodes/accessors/NormalNode.js +61 -0
- package/dist/nodes/accessors/NormalNode.mjs +62 -0
- package/dist/nodes/accessors/Object3DNode.js +75 -0
- package/dist/nodes/accessors/Object3DNode.mjs +76 -0
- package/dist/nodes/accessors/PointUVNode.js +12 -0
- package/dist/nodes/accessors/PointUVNode.mjs +13 -0
- package/dist/nodes/accessors/PositionNode.js +64 -0
- package/dist/nodes/accessors/PositionNode.mjs +65 -0
- package/dist/nodes/accessors/ReferenceNode.js +36 -0
- package/dist/nodes/accessors/ReferenceNode.mjs +37 -0
- package/dist/nodes/accessors/ReflectNode.js +42 -0
- package/dist/nodes/accessors/ReflectNode.mjs +43 -0
- package/dist/nodes/accessors/SkinningNode.js +57 -0
- package/dist/nodes/accessors/SkinningNode.mjs +58 -0
- package/dist/nodes/accessors/TextureNode.js +53 -0
- package/dist/nodes/accessors/TextureNode.mjs +54 -0
- package/dist/nodes/accessors/UVNode.js +22 -0
- package/dist/nodes/accessors/UVNode.mjs +23 -0
- package/dist/nodes/core/ArrayUniformNode.js +13 -0
- package/dist/nodes/core/ArrayUniformNode.mjs +14 -0
- package/dist/nodes/core/AttributeNode.js +29 -0
- package/dist/nodes/core/AttributeNode.mjs +30 -0
- package/dist/nodes/core/BypassNode.js +21 -0
- package/dist/nodes/core/BypassNode.mjs +22 -0
- package/dist/nodes/core/CodeNode.js +27 -0
- package/dist/nodes/core/CodeNode.mjs +28 -0
- package/dist/nodes/core/ConstNode.js +13 -0
- package/dist/nodes/core/ConstNode.mjs +14 -0
- package/dist/nodes/core/ContextNode.js +21 -0
- package/dist/nodes/core/ContextNode.mjs +22 -0
- package/dist/nodes/core/ExpressionNode.js +18 -0
- package/dist/nodes/core/ExpressionNode.mjs +19 -0
- package/dist/nodes/core/FunctionCallNode.js +36 -0
- package/dist/nodes/core/FunctionCallNode.mjs +37 -0
- package/dist/nodes/core/FunctionNode.js +55 -0
- package/dist/nodes/core/FunctionNode.mjs +56 -0
- package/dist/nodes/core/InputNode.js +37 -0
- package/dist/nodes/core/InputNode.mjs +38 -0
- package/dist/nodes/core/Node.js +138 -0
- package/dist/nodes/core/Node.mjs +139 -0
- package/dist/nodes/core/NodeAttribute.js +9 -0
- package/dist/nodes/core/NodeAttribute.mjs +10 -0
- package/dist/nodes/core/NodeBuilder.js +402 -0
- package/dist/nodes/core/NodeBuilder.mjs +402 -0
- package/dist/nodes/core/NodeCode.js +10 -0
- package/dist/nodes/core/NodeCode.mjs +11 -0
- package/dist/nodes/core/NodeFrame.js +34 -0
- package/dist/nodes/core/NodeFrame.mjs +35 -0
- package/dist/nodes/core/NodeFunctionInput.js +12 -0
- package/dist/nodes/core/NodeFunctionInput.mjs +13 -0
- package/dist/nodes/core/NodeKeywords.js +43 -0
- package/dist/nodes/core/NodeKeywords.mjs +44 -0
- package/dist/nodes/core/NodeUniform.js +17 -0
- package/dist/nodes/core/NodeUniform.mjs +18 -0
- package/dist/nodes/core/NodeUtils.js +57 -0
- package/dist/nodes/core/NodeUtils.mjs +57 -0
- package/dist/nodes/core/NodeVar.js +9 -0
- package/dist/nodes/core/NodeVar.mjs +10 -0
- package/dist/nodes/core/NodeVary.js +9 -0
- package/dist/nodes/core/NodeVary.mjs +10 -0
- package/dist/nodes/core/PropertyNode.js +20 -0
- package/dist/nodes/core/PropertyNode.mjs +21 -0
- package/dist/nodes/core/TempNode.js +24 -0
- package/dist/nodes/core/TempNode.mjs +25 -0
- package/dist/nodes/core/UniformNode.js +22 -0
- package/dist/nodes/core/UniformNode.mjs +23 -0
- package/dist/nodes/core/VarNode.js +30 -0
- package/dist/nodes/core/VarNode.mjs +31 -0
- package/dist/nodes/core/VaryNode.js +29 -0
- package/dist/nodes/core/VaryNode.mjs +30 -0
- package/dist/nodes/core/constants.js +24 -0
- package/dist/nodes/core/constants.mjs +24 -0
- package/dist/nodes/display/ColorSpaceNode.js +62 -0
- package/dist/nodes/display/ColorSpaceNode.mjs +62 -0
- package/dist/nodes/display/NormalMapNode.js +53 -0
- package/dist/nodes/display/NormalMapNode.mjs +54 -0
- package/dist/nodes/fog/FogNode.js +14 -0
- package/dist/nodes/fog/FogNode.mjs +15 -0
- package/dist/nodes/fog/FogRangeNode.js +16 -0
- package/dist/nodes/fog/FogRangeNode.mjs +17 -0
- package/dist/nodes/functions/BSDFs.js +64 -0
- package/dist/nodes/functions/BSDFs.mjs +64 -0
- package/dist/nodes/lights/LightContextNode.js +34 -0
- package/dist/nodes/lights/LightContextNode.mjs +35 -0
- package/dist/nodes/lights/LightNode.js +57 -0
- package/dist/nodes/lights/LightNode.mjs +58 -0
- package/dist/nodes/lights/LightsNode.js +58 -0
- package/dist/nodes/lights/LightsNode.mjs +59 -0
- package/dist/nodes/loaders/NodeLoader.js +195 -0
- package/dist/nodes/loaders/NodeLoader.mjs +196 -0
- package/dist/nodes/loaders/NodeMaterialLoader.js +23 -0
- package/dist/nodes/loaders/NodeMaterialLoader.mjs +24 -0
- package/dist/nodes/loaders/NodeObjectLoader.js +39 -0
- package/dist/nodes/loaders/NodeObjectLoader.mjs +40 -0
- package/dist/nodes/materials/LineBasicNodeMaterial.js +26 -0
- package/dist/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
- package/dist/nodes/materials/Materials.js +24 -0
- package/dist/nodes/materials/Materials.mjs +24 -0
- package/dist/nodes/materials/MeshBasicNodeMaterial.js +27 -0
- package/dist/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
- package/dist/nodes/materials/MeshStandardNodeMaterial.js +40 -0
- package/dist/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
- package/dist/nodes/materials/NodeMaterial.js +63 -0
- package/dist/nodes/materials/NodeMaterial.mjs +64 -0
- package/dist/nodes/materials/PointsNodeMaterial.js +29 -0
- package/dist/nodes/materials/PointsNodeMaterial.mjs +30 -0
- package/dist/nodes/math/CondNode.js +40 -0
- package/dist/nodes/math/CondNode.mjs +41 -0
- package/dist/nodes/math/MathNode.js +165 -0
- package/dist/nodes/math/MathNode.mjs +166 -0
- package/dist/nodes/math/OperatorNode.js +102 -0
- package/dist/nodes/math/OperatorNode.mjs +103 -0
- package/dist/nodes/procedural/CheckerNode.js +20 -0
- package/dist/nodes/procedural/CheckerNode.mjs +21 -0
- package/dist/nodes/utils/ArrayElementNode.js +18 -0
- package/dist/nodes/utils/ArrayElementNode.mjs +19 -0
- package/dist/nodes/utils/ConvertNode.js +24 -0
- package/dist/nodes/utils/ConvertNode.mjs +25 -0
- package/dist/nodes/utils/JoinNode.js +25 -0
- package/dist/nodes/utils/JoinNode.mjs +26 -0
- package/dist/nodes/utils/MatcapUVNode.js +15 -0
- package/dist/nodes/utils/MatcapUVNode.mjs +16 -0
- package/dist/nodes/utils/OscNode.js +49 -0
- package/dist/nodes/utils/OscNode.mjs +50 -0
- package/dist/nodes/utils/SplitNode.js +44 -0
- package/dist/nodes/utils/SplitNode.mjs +45 -0
- package/dist/nodes/utils/SpriteSheetUVNode.js +39 -0
- package/dist/nodes/utils/SpriteSheetUVNode.mjs +40 -0
- package/dist/nodes/utils/TimerNode.js +43 -0
- package/dist/nodes/utils/TimerNode.mjs +44 -0
- package/dist/objects/GroundProjectedEnv.d.ts +12 -0
- package/dist/objects/GroundProjectedEnv.js +134 -0
- package/dist/objects/GroundProjectedEnv.mjs +134 -0
- package/dist/objects/Lensflare.d.ts +17 -0
- package/dist/objects/Lensflare.js +280 -0
- package/dist/objects/Lensflare.mjs +280 -0
- package/dist/objects/LightningStorm.d.ts +32 -0
- package/dist/objects/LightningStorm.js +110 -0
- package/dist/objects/LightningStorm.mjs +110 -0
- package/dist/objects/MarchingCubes.d.ts +75 -0
- package/dist/objects/MarchingCubes.js +457 -0
- package/dist/objects/MarchingCubes.mjs +457 -0
- package/dist/objects/Reflector.d.ts +19 -0
- package/dist/objects/Reflector.js +175 -0
- package/dist/objects/Reflector.mjs +175 -0
- package/dist/objects/ReflectorForSSRPass.d.ts +48 -0
- package/dist/objects/ReflectorForSSRPass.js +256 -0
- package/dist/objects/ReflectorForSSRPass.mjs +256 -0
- package/dist/objects/ReflectorRTT.js +10 -0
- package/dist/objects/ReflectorRTT.mjs +10 -0
- package/dist/objects/Refractor.d.ts +19 -0
- package/dist/objects/Refractor.js +188 -0
- package/dist/objects/Refractor.mjs +188 -0
- package/dist/objects/ShadowMesh.d.ts +7 -0
- package/dist/objects/ShadowMesh.js +41 -0
- package/dist/objects/ShadowMesh.mjs +41 -0
- package/dist/objects/Sky.d.ts +43 -0
- package/dist/objects/Sky.js +156 -0
- package/dist/objects/Sky.mjs +156 -0
- package/dist/objects/Water.d.ts +22 -0
- package/dist/objects/Water.js +241 -0
- package/dist/objects/Water.mjs +241 -0
- package/dist/objects/Water2.d.ts +22 -0
- package/dist/objects/Water2.js +258 -0
- package/dist/objects/Water2.mjs +258 -0
- package/dist/offscreen/jank.js +26 -0
- package/dist/offscreen/jank.mjs +27 -0
- package/dist/offscreen/offscreen.js +8 -0
- package/dist/offscreen/offscreen.mjs +7 -0
- package/dist/offscreen/scene.js +68 -0
- package/dist/offscreen/scene.mjs +52 -0
- package/dist/physics/AmmoPhysics.d.ts +7 -0
- package/dist/physics/AmmoPhysics.js +166 -0
- package/dist/physics/AmmoPhysics.mjs +166 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.d.ts +29 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.js +225 -0
- package/dist/postprocessing/AdaptiveToneMappingPass.mjs +225 -0
- package/dist/postprocessing/AfterimagePass.d.ts +15 -0
- package/dist/postprocessing/AfterimagePass.js +68 -0
- package/dist/postprocessing/AfterimagePass.mjs +68 -0
- package/dist/postprocessing/BloomPass.d.ts +16 -0
- package/dist/postprocessing/BloomPass.js +109 -0
- package/dist/postprocessing/BloomPass.mjs +109 -0
- package/dist/postprocessing/BokehPass.d.ts +26 -0
- package/dist/postprocessing/BokehPass.js +90 -0
- package/dist/postprocessing/BokehPass.mjs +90 -0
- package/dist/postprocessing/ClearPass.d.ts +10 -0
- package/dist/postprocessing/ClearPass.js +36 -0
- package/dist/postprocessing/ClearPass.mjs +36 -0
- package/dist/postprocessing/CubeTexturePass.d.ts +14 -0
- package/dist/postprocessing/CubeTexturePass.js +49 -0
- package/dist/postprocessing/CubeTexturePass.mjs +49 -0
- package/dist/postprocessing/DotScreenPass.d.ts +10 -0
- package/dist/postprocessing/DotScreenPass.js +49 -0
- package/dist/postprocessing/DotScreenPass.mjs +49 -0
- package/dist/postprocessing/EffectComposer.d.ts +27 -0
- package/dist/postprocessing/EffectComposer.js +156 -0
- package/dist/postprocessing/EffectComposer.mjs +156 -0
- package/dist/postprocessing/FilmPass.d.ts +10 -0
- package/dist/postprocessing/FilmPass.js +51 -0
- package/dist/postprocessing/FilmPass.mjs +51 -0
- package/dist/postprocessing/GlitchPass.d.ts +15 -0
- package/dist/postprocessing/GlitchPass.js +84 -0
- package/dist/postprocessing/GlitchPass.mjs +84 -0
- package/dist/postprocessing/HalftonePass.d.ts +26 -0
- package/dist/postprocessing/HalftonePass.js +53 -0
- package/dist/postprocessing/HalftonePass.mjs +53 -0
- package/dist/postprocessing/LUTPass.d.ts +13 -0
- package/dist/postprocessing/LUTPass.js +142 -0
- package/dist/postprocessing/LUTPass.mjs +142 -0
- package/dist/postprocessing/MaskPass.d.ts +14 -0
- package/dist/postprocessing/MaskPass.js +69 -0
- package/dist/postprocessing/MaskPass.mjs +69 -0
- package/dist/postprocessing/OutlinePass.d.ts +53 -0
- package/dist/postprocessing/OutlinePass.js +479 -0
- package/dist/postprocessing/OutlinePass.mjs +479 -0
- package/dist/postprocessing/Pass.d.ts +20 -0
- package/dist/postprocessing/Pass.js +48 -0
- package/dist/postprocessing/Pass.mjs +48 -0
- package/dist/postprocessing/RenderPass.d.ts +14 -0
- package/dist/postprocessing/RenderPass.js +59 -0
- package/dist/postprocessing/RenderPass.mjs +59 -0
- package/dist/postprocessing/RenderPixelatedPass.js +199 -0
- package/dist/postprocessing/RenderPixelatedPass.mjs +199 -0
- package/dist/postprocessing/SAOPass.d.ts +79 -0
- package/dist/postprocessing/SAOPass.js +282 -0
- package/dist/postprocessing/SAOPass.mjs +282 -0
- package/dist/postprocessing/SMAAPass.d.ts +21 -0
- package/dist/postprocessing/SMAAPass.js +112 -0
- package/dist/postprocessing/SMAAPass.mjs +112 -0
- package/dist/postprocessing/SSAARenderPass.d.ts +17 -0
- package/dist/postprocessing/SSAARenderPass.js +171 -0
- package/dist/postprocessing/SSAARenderPass.mjs +171 -0
- package/dist/postprocessing/SSAOPass.d.ts +71 -0
- package/dist/postprocessing/SSAOPass.js +265 -0
- package/dist/postprocessing/SSAOPass.mjs +265 -0
- package/dist/postprocessing/SSRPass.d.ts +124 -0
- package/dist/postprocessing/SSRPass.js +438 -0
- package/dist/postprocessing/SSRPass.mjs +438 -0
- package/dist/postprocessing/SavePass.d.ts +12 -0
- package/dist/postprocessing/SavePass.js +37 -0
- package/dist/postprocessing/SavePass.mjs +37 -0
- package/dist/postprocessing/ShaderPass.d.ts +13 -0
- package/dist/postprocessing/ShaderPass.js +49 -0
- package/dist/postprocessing/ShaderPass.mjs +49 -0
- package/dist/postprocessing/TAARenderPass.d.ts +8 -0
- package/dist/postprocessing/TAARenderPass.js +89 -0
- package/dist/postprocessing/TAARenderPass.mjs +89 -0
- package/dist/postprocessing/TexturePass.d.ts +12 -0
- package/dist/postprocessing/TexturePass.js +39 -0
- package/dist/postprocessing/TexturePass.mjs +39 -0
- package/dist/postprocessing/UnrealBloomPass.d.ts +31 -0
- package/dist/postprocessing/UnrealBloomPass.js +220 -0
- package/dist/postprocessing/UnrealBloomPass.mjs +220 -0
- package/dist/postprocessing/WaterPass.d.ts +30 -0
- package/dist/postprocessing/WaterPass.js +72 -0
- package/dist/postprocessing/WaterPass.mjs +72 -0
- package/dist/renderers/CSS2DRenderer.d.ts +22 -0
- package/dist/renderers/CSS2DRenderer.js +121 -0
- package/dist/renderers/CSS2DRenderer.mjs +121 -0
- package/dist/renderers/CSS3DRenderer.d.ts +26 -0
- package/dist/renderers/CSS3DRenderer.js +133 -0
- package/dist/renderers/CSS3DRenderer.mjs +133 -0
- package/dist/renderers/Projector.d.ts +60 -0
- package/dist/renderers/Projector.js +511 -0
- package/dist/renderers/Projector.mjs +511 -0
- package/dist/renderers/SVGRenderer.d.ts +25 -0
- package/dist/renderers/SVGRenderer.js +306 -0
- package/dist/renderers/SVGRenderer.mjs +306 -0
- package/dist/renderers/nodes/accessors/CameraNode.js +62 -0
- package/dist/renderers/nodes/accessors/CameraNode.mjs +63 -0
- package/dist/renderers/nodes/accessors/ModelNode.js +60 -0
- package/dist/renderers/nodes/accessors/ModelNode.mjs +61 -0
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.js +20 -0
- package/dist/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
- package/dist/renderers/nodes/accessors/NormalNode.js +60 -0
- package/dist/renderers/nodes/accessors/NormalNode.mjs +61 -0
- package/dist/renderers/nodes/accessors/PositionNode.js +29 -0
- package/dist/renderers/nodes/accessors/PositionNode.mjs +30 -0
- package/dist/renderers/nodes/accessors/UVNode.js +12 -0
- package/dist/renderers/nodes/accessors/UVNode.mjs +13 -0
- package/dist/renderers/nodes/core/AttributeNode.js +34 -0
- package/dist/renderers/nodes/core/AttributeNode.mjs +35 -0
- package/dist/renderers/nodes/core/InputNode.js +30 -0
- package/dist/renderers/nodes/core/InputNode.mjs +31 -0
- package/dist/renderers/nodes/core/Node.js +33 -0
- package/dist/renderers/nodes/core/Node.mjs +34 -0
- package/dist/renderers/nodes/core/NodeAttribute.js +9 -0
- package/dist/renderers/nodes/core/NodeAttribute.mjs +10 -0
- package/dist/renderers/nodes/core/NodeBuilder.js +248 -0
- package/dist/renderers/nodes/core/NodeBuilder.mjs +249 -0
- package/dist/renderers/nodes/core/NodeFrame.js +34 -0
- package/dist/renderers/nodes/core/NodeFrame.mjs +35 -0
- package/dist/renderers/nodes/core/NodeSlot.js +9 -0
- package/dist/renderers/nodes/core/NodeSlot.mjs +10 -0
- package/dist/renderers/nodes/core/NodeUniform.js +17 -0
- package/dist/renderers/nodes/core/NodeUniform.mjs +18 -0
- package/dist/renderers/nodes/core/NodeVary.js +10 -0
- package/dist/renderers/nodes/core/NodeVary.mjs +11 -0
- package/dist/renderers/nodes/core/VaryNode.js +21 -0
- package/dist/renderers/nodes/core/VaryNode.mjs +22 -0
- package/dist/renderers/nodes/core/constants.js +22 -0
- package/dist/renderers/nodes/core/constants.mjs +22 -0
- package/dist/renderers/nodes/inputs/ColorNode.js +10 -0
- package/dist/renderers/nodes/inputs/ColorNode.mjs +11 -0
- package/dist/renderers/nodes/inputs/FloatNode.js +10 -0
- package/dist/renderers/nodes/inputs/FloatNode.mjs +11 -0
- package/dist/renderers/nodes/inputs/Matrix3Node.js +11 -0
- package/dist/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/Matrix4Node.js +11 -0
- package/dist/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/TextureNode.js +19 -0
- package/dist/renderers/nodes/inputs/TextureNode.mjs +20 -0
- package/dist/renderers/nodes/inputs/Vector2Node.js +10 -0
- package/dist/renderers/nodes/inputs/Vector2Node.mjs +11 -0
- package/dist/renderers/nodes/inputs/Vector3Node.js +11 -0
- package/dist/renderers/nodes/inputs/Vector3Node.mjs +12 -0
- package/dist/renderers/nodes/inputs/Vector4Node.js +11 -0
- package/dist/renderers/nodes/inputs/Vector4Node.mjs +12 -0
- package/dist/renderers/nodes/math/MathNode.js +54 -0
- package/dist/renderers/nodes/math/MathNode.mjs +55 -0
- package/dist/renderers/nodes/math/OperatorNode.js +41 -0
- package/dist/renderers/nodes/math/OperatorNode.mjs +42 -0
- package/dist/renderers/nodes/utils/SwitchNode.js +19 -0
- package/dist/renderers/nodes/utils/SwitchNode.mjs +20 -0
- package/dist/renderers/nodes/utils/TimerNode.js +13 -0
- package/dist/renderers/nodes/utils/TimerNode.mjs +14 -0
- package/dist/renderers/webgpu/WebGPU.js +23 -0
- package/dist/renderers/webgpu/WebGPU.mjs +24 -0
- package/dist/renderers/webgpu/WebGPUAttributes.js +68 -0
- package/dist/renderers/webgpu/WebGPUAttributes.mjs +69 -0
- package/dist/renderers/webgpu/WebGPUBackground.js +60 -0
- package/dist/renderers/webgpu/WebGPUBackground.mjs +61 -0
- package/dist/renderers/webgpu/WebGPUBinding.js +13 -0
- package/dist/renderers/webgpu/WebGPUBinding.mjs +14 -0
- package/dist/renderers/webgpu/WebGPUBindings.js +154 -0
- package/dist/renderers/webgpu/WebGPUBindings.mjs +155 -0
- package/dist/renderers/webgpu/WebGPUComputePipelines.js +43 -0
- package/dist/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
- package/dist/renderers/webgpu/WebGPUGeometries.js +40 -0
- package/dist/renderers/webgpu/WebGPUGeometries.mjs +41 -0
- package/dist/renderers/webgpu/WebGPUInfo.js +45 -0
- package/dist/renderers/webgpu/WebGPUInfo.mjs +46 -0
- package/dist/renderers/webgpu/WebGPUObjects.js +24 -0
- package/dist/renderers/webgpu/WebGPUObjects.mjs +25 -0
- package/dist/renderers/webgpu/WebGPUProperties.js +21 -0
- package/dist/renderers/webgpu/WebGPUProperties.mjs +22 -0
- package/dist/renderers/webgpu/WebGPURenderLists.js +118 -0
- package/dist/renderers/webgpu/WebGPURenderLists.mjs +119 -0
- package/dist/renderers/webgpu/WebGPURenderPipelines.js +545 -0
- package/dist/renderers/webgpu/WebGPURenderPipelines.mjs +546 -0
- package/dist/renderers/webgpu/WebGPURenderer.js +596 -0
- package/dist/renderers/webgpu/WebGPURenderer.mjs +575 -0
- package/dist/renderers/webgpu/WebGPUSampledTexture.js +40 -0
- package/dist/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
- package/dist/renderers/webgpu/WebGPUSampler.js +14 -0
- package/dist/renderers/webgpu/WebGPUSampler.mjs +15 -0
- package/dist/renderers/webgpu/WebGPUStorageBuffer.js +14 -0
- package/dist/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
- package/dist/renderers/webgpu/WebGPUTextureRenderer.js +22 -0
- package/dist/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
- package/dist/renderers/webgpu/WebGPUTextureUtils.js +97 -0
- package/dist/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
- package/dist/renderers/webgpu/WebGPUTextures.js +483 -0
- package/dist/renderers/webgpu/WebGPUTextures.mjs +484 -0
- package/dist/renderers/webgpu/WebGPUUniform.js +81 -0
- package/dist/renderers/webgpu/WebGPUUniform.mjs +81 -0
- package/dist/renderers/webgpu/WebGPUUniformsGroup.js +175 -0
- package/dist/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
- package/dist/renderers/webgpu/constants.js +241 -0
- package/dist/renderers/webgpu/constants.mjs +241 -0
- package/dist/renderers/webgpu/nodes/ShaderLib.js +41 -0
- package/dist/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.js +164 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.js +73 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +14 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodes.js +39 -0
- package/dist/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
- package/dist/shaders/ACESFilmicToneMappingShader.d.ts +16 -0
- package/dist/shaders/ACESFilmicToneMappingShader.js +55 -0
- package/dist/shaders/ACESFilmicToneMappingShader.mjs +55 -0
- package/dist/shaders/AfterimageShader.d.ts +15 -0
- package/dist/shaders/AfterimageShader.js +32 -0
- package/dist/shaders/AfterimageShader.mjs +32 -0
- package/dist/shaders/BasicShader.d.ts +8 -0
- package/dist/shaders/BasicShader.js +12 -0
- package/dist/shaders/BasicShader.mjs +12 -0
- package/dist/shaders/BleachBypassShader.d.ts +14 -0
- package/dist/shaders/BleachBypassShader.js +35 -0
- package/dist/shaders/BleachBypassShader.mjs +35 -0
- package/dist/shaders/BlendShader.d.ts +21 -0
- package/dist/shaders/BlendShader.js +30 -0
- package/dist/shaders/BlendShader.mjs +30 -0
- package/dist/shaders/BokehShader.d.ts +24 -0
- package/dist/shaders/BokehShader.js +109 -0
- package/dist/shaders/BokehShader.mjs +109 -0
- package/dist/shaders/BokehShader2.d.ts +50 -0
- package/dist/shaders/BokehShader2.js +269 -0
- package/dist/shaders/BokehShader2.mjs +269 -0
- package/dist/shaders/BrightnessContrastShader.d.ts +21 -0
- package/dist/shaders/BrightnessContrastShader.js +32 -0
- package/dist/shaders/BrightnessContrastShader.mjs +32 -0
- package/dist/shaders/ColorCorrectionShader.d.ts +22 -0
- package/dist/shaders/ColorCorrectionShader.js +30 -0
- package/dist/shaders/ColorCorrectionShader.mjs +30 -0
- package/dist/shaders/ColorifyShader.d.ts +16 -0
- package/dist/shaders/ColorifyShader.js +28 -0
- package/dist/shaders/ColorifyShader.mjs +28 -0
- package/dist/shaders/ConvolutionShader.d.ts +21 -0
- package/dist/shaders/ConvolutionShader.js +55 -0
- package/dist/shaders/ConvolutionShader.mjs +55 -0
- package/dist/shaders/CopyShader.d.ts +12 -0
- package/dist/shaders/CopyShader.js +25 -0
- package/dist/shaders/CopyShader.mjs +25 -0
- package/dist/shaders/DOFMipMapShader.d.ts +23 -0
- package/dist/shaders/DOFMipMapShader.js +32 -0
- package/dist/shaders/DOFMipMapShader.mjs +32 -0
- package/dist/shaders/DepthLimitedBlurShader.d.ts +28 -0
- package/dist/shaders/DepthLimitedBlurShader.js +114 -0
- package/dist/shaders/DepthLimitedBlurShader.mjs +114 -0
- package/dist/shaders/DigitalGlitch.d.ts +39 -0
- package/dist/shaders/DigitalGlitch.js +85 -0
- package/dist/shaders/DigitalGlitch.mjs +85 -0
- package/dist/shaders/DotScreenShader.d.ts +27 -0
- package/dist/shaders/DotScreenShader.js +39 -0
- package/dist/shaders/DotScreenShader.mjs +39 -0
- package/dist/shaders/FXAAShader.d.ts +19 -0
- package/dist/shaders/FXAAShader.js +1098 -0
- package/dist/shaders/FXAAShader.mjs +1098 -0
- package/dist/shaders/FilmShader.d.ts +43 -0
- package/dist/shaders/FilmShader.js +53 -0
- package/dist/shaders/FilmShader.mjs +53 -0
- package/dist/shaders/FocusShader.d.ts +26 -0
- package/dist/shaders/FocusShader.js +55 -0
- package/dist/shaders/FocusShader.mjs +55 -0
- package/dist/shaders/FreiChenShader.d.ts +19 -0
- package/dist/shaders/FreiChenShader.js +64 -0
- package/dist/shaders/FreiChenShader.mjs +64 -0
- package/dist/shaders/FresnelShader.d.ts +24 -0
- package/dist/shaders/FresnelShader.js +47 -0
- package/dist/shaders/FresnelShader.mjs +47 -0
- package/dist/shaders/GammaCorrectionShader.d.ts +12 -0
- package/dist/shaders/GammaCorrectionShader.js +23 -0
- package/dist/shaders/GammaCorrectionShader.mjs +23 -0
- package/dist/shaders/GodRaysShader.d.ts +97 -0
- package/dist/shaders/GodRaysShader.js +183 -0
- package/dist/shaders/GodRaysShader.mjs +183 -0
- package/dist/shaders/HalftoneShader.d.ts +51 -0
- package/dist/shaders/HalftoneShader.js +228 -0
- package/dist/shaders/HalftoneShader.mjs +228 -0
- package/dist/shaders/HorizontalBlurShader.d.ts +18 -0
- package/dist/shaders/HorizontalBlurShader.js +49 -0
- package/dist/shaders/HorizontalBlurShader.mjs +49 -0
- package/dist/shaders/HorizontalTiltShiftShader.d.ts +23 -0
- package/dist/shaders/HorizontalTiltShiftShader.js +37 -0
- package/dist/shaders/HorizontalTiltShiftShader.mjs +37 -0
- package/dist/shaders/HueSaturationShader.d.ts +21 -0
- package/dist/shaders/HueSaturationShader.js +43 -0
- package/dist/shaders/HueSaturationShader.mjs +43 -0
- package/dist/shaders/KaleidoShader.d.ts +24 -0
- package/dist/shaders/KaleidoShader.js +34 -0
- package/dist/shaders/KaleidoShader.mjs +34 -0
- package/dist/shaders/LuminosityHighPassShader.d.ts +27 -0
- package/dist/shaders/LuminosityHighPassShader.js +37 -0
- package/dist/shaders/LuminosityHighPassShader.mjs +37 -0
- package/dist/shaders/LuminosityShader.d.ts +13 -0
- package/dist/shaders/LuminosityShader.js +25 -0
- package/dist/shaders/LuminosityShader.mjs +25 -0
- package/dist/shaders/MirrorShader.d.ts +18 -0
- package/dist/shaders/MirrorShader.js +35 -0
- package/dist/shaders/MirrorShader.mjs +35 -0
- package/dist/shaders/NormalMapShader.d.ts +23 -0
- package/dist/shaders/NormalMapShader.js +31 -0
- package/dist/shaders/NormalMapShader.mjs +31 -0
- package/dist/shaders/ParallaxShader.d.ts +28 -0
- package/dist/shaders/ParallaxShader.js +133 -0
- package/dist/shaders/ParallaxShader.mjs +133 -0
- package/dist/shaders/PixelShader.d.ts +18 -0
- package/dist/shaders/PixelShader.js +28 -0
- package/dist/shaders/PixelShader.mjs +28 -0
- package/dist/shaders/RGBShiftShader.d.ts +24 -0
- package/dist/shaders/RGBShiftShader.js +30 -0
- package/dist/shaders/RGBShiftShader.mjs +30 -0
- package/dist/shaders/SAOShader.d.ts +25 -0
- package/dist/shaders/SAOShader.js +144 -0
- package/dist/shaders/SAOShader.mjs +144 -0
- package/dist/shaders/SMAAShader.d.ts +60 -0
- package/dist/shaders/SMAAShader.js +358 -0
- package/dist/shaders/SMAAShader.mjs +358 -0
- package/dist/shaders/SSAOShader.d.ts +86 -0
- package/dist/shaders/SSAOShader.js +182 -0
- package/dist/shaders/SSAOShader.mjs +182 -0
- package/dist/shaders/SSRShader.d.ts +94 -0
- package/dist/shaders/SSRShader.js +342 -0
- package/dist/shaders/SSRShader.mjs +342 -0
- package/dist/shaders/SepiaShader.d.ts +17 -0
- package/dist/shaders/SepiaShader.js +29 -0
- package/dist/shaders/SepiaShader.mjs +29 -0
- package/dist/shaders/SobelOperatorShader.d.ts +19 -0
- package/dist/shaders/SobelOperatorShader.js +54 -0
- package/dist/shaders/SobelOperatorShader.mjs +54 -0
- package/dist/shaders/SubsurfaceScatteringShader.d.ts +5 -0
- package/dist/shaders/SubsurfaceScatteringShader.js +59 -0
- package/dist/shaders/SubsurfaceScatteringShader.mjs +59 -0
- package/dist/shaders/TechnicolorShader.d.ts +15 -0
- package/dist/shaders/TechnicolorShader.js +24 -0
- package/dist/shaders/TechnicolorShader.mjs +24 -0
- package/dist/shaders/ToneMapShader.d.ts +27 -0
- package/dist/shaders/ToneMapShader.js +51 -0
- package/dist/shaders/ToneMapShader.mjs +51 -0
- package/dist/shaders/ToonShader.d.ts +108 -0
- package/dist/shaders/ToonShader.js +188 -0
- package/dist/shaders/ToonShader.mjs +188 -0
- package/dist/shaders/TriangleBlurShader.d.ts +22 -0
- package/dist/shaders/TriangleBlurShader.js +37 -0
- package/dist/shaders/TriangleBlurShader.mjs +37 -0
- package/dist/shaders/UnpackDepthRGBAShader.d.ts +16 -0
- package/dist/shaders/UnpackDepthRGBAShader.js +26 -0
- package/dist/shaders/UnpackDepthRGBAShader.mjs +26 -0
- package/dist/shaders/VerticalBlurShader.d.ts +18 -0
- package/dist/shaders/VerticalBlurShader.js +50 -0
- package/dist/shaders/VerticalBlurShader.mjs +50 -0
- package/dist/shaders/VerticalTiltShiftShader.d.ts +23 -0
- package/dist/shaders/VerticalTiltShiftShader.js +37 -0
- package/dist/shaders/VerticalTiltShiftShader.mjs +37 -0
- package/dist/shaders/VignetteShader.d.ts +20 -0
- package/dist/shaders/VignetteShader.js +38 -0
- package/dist/shaders/VignetteShader.mjs +38 -0
- package/dist/shaders/VolumeShader.d.ts +30 -0
- package/dist/shaders/VolumeShader.js +225 -0
- package/dist/shaders/VolumeShader.mjs +225 -0
- package/dist/shaders/WaterRefractionShader.d.ts +21 -0
- package/dist/shaders/WaterRefractionShader.js +59 -0
- package/dist/shaders/WaterRefractionShader.mjs +59 -0
- package/dist/shaders/types.d.ts +14 -0
- package/dist/shaders/types.js +1 -0
- package/dist/shaders/types.mjs +1 -0
- package/dist/textures/FlakesTexture.d.ts +4 -0
- package/dist/textures/FlakesTexture.js +30 -0
- package/dist/textures/FlakesTexture.mjs +30 -0
- package/dist/types/helpers.d.ts +1 -0
- package/dist/types/helpers.js +4 -0
- package/dist/types/helpers.mjs +4 -0
- package/dist/types/shared.d.ts +2 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/utils/BufferGeometryUtils.d.ts +48 -0
- package/dist/utils/BufferGeometryUtils.js +636 -0
- package/dist/utils/BufferGeometryUtils.mjs +636 -0
- package/dist/utils/GeometryCompressionUtils.d.ts +7 -0
- package/dist/utils/GeometryCompressionUtils.js +573 -0
- package/dist/utils/GeometryCompressionUtils.mjs +573 -0
- package/dist/utils/GeometryUtils.d.ts +6 -0
- package/dist/utils/GeometryUtils.js +109 -0
- package/dist/utils/GeometryUtils.mjs +109 -0
- package/dist/utils/LDrawUtils.d.ts +5 -0
- package/dist/utils/RoughnessMipmapper.js +219 -0
- package/dist/utils/RoughnessMipmapper.mjs +219 -0
- package/dist/utils/SceneUtils.d.ts +9 -0
- package/dist/utils/SceneUtils.js +36 -0
- package/dist/utils/SceneUtils.mjs +36 -0
- package/dist/utils/ShadowMapViewer.d.ts +24 -0
- package/dist/utils/ShadowMapViewer.js +114 -0
- package/dist/utils/ShadowMapViewer.mjs +114 -0
- package/dist/utils/SkeletonUtils.d.ts +30 -0
- package/dist/utils/SkeletonUtils.js +292 -0
- package/dist/utils/SkeletonUtils.mjs +292 -0
- package/dist/utils/UVsDebug.d.ts +3 -0
- package/dist/utils/UVsDebug.js +85 -0
- package/dist/utils/UVsDebug.mjs +85 -0
- package/dist/utils/WorkerPool.js +62 -0
- package/dist/utils/WorkerPool.mjs +62 -0
- package/dist/webxr/ARButton.d.ts +5 -0
- package/dist/webxr/ARButton.js +119 -0
- package/dist/webxr/ARButton.mjs +119 -0
- package/dist/webxr/OculusHandModel.d.ts +22 -0
- package/dist/webxr/OculusHandModel.js +82 -0
- package/dist/webxr/OculusHandModel.mjs +82 -0
- package/dist/webxr/OculusHandPointerModel.d.ts +63 -0
- package/dist/webxr/OculusHandPointerModel.js +224 -0
- package/dist/webxr/OculusHandPointerModel.mjs +207 -0
- package/dist/webxr/Text2D.d.ts +3 -0
- package/dist/webxr/Text2D.js +48 -0
- package/dist/webxr/Text2D.mjs +31 -0
- package/dist/webxr/VRButton.d.ts +7 -0
- package/dist/webxr/VRButton.js +111 -0
- package/dist/webxr/VRButton.mjs +111 -0
- package/dist/webxr/XRControllerModelFactory.d.ts +23 -0
- package/dist/webxr/XRControllerModelFactory.js +174 -0
- package/dist/webxr/XRControllerModelFactory.mjs +174 -0
- package/dist/webxr/XREstimatedLight.d.ts +33 -0
- package/dist/webxr/XREstimatedLight.js +126 -0
- package/dist/webxr/XREstimatedLight.mjs +126 -0
- package/dist/webxr/XRHandMeshModel.d.ts +9 -0
- package/dist/webxr/XRHandMeshModel.js +82 -0
- package/dist/webxr/XRHandMeshModel.mjs +82 -0
- package/dist/webxr/XRHandModelFactory.d.ts +25 -0
- package/dist/webxr/XRHandModelFactory.js +61 -0
- package/dist/webxr/XRHandModelFactory.mjs +61 -0
- package/dist/webxr/XRHandPrimitiveModel.d.ts +24 -0
- package/dist/webxr/XRHandPrimitiveModel.js +68 -0
- package/dist/webxr/XRHandPrimitiveModel.mjs +68 -0
- package/package.json +1 -1
@@ -0,0 +1,971 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const THREE = require("three");
|
4
|
+
const _m1 = new THREE.Matrix4();
|
5
|
+
const _obj = new THREE.Object3D();
|
6
|
+
const _offset = new THREE.Vector3();
|
7
|
+
class Geometry extends THREE.EventDispatcher {
|
8
|
+
constructor() {
|
9
|
+
super();
|
10
|
+
this.isGeometry = true;
|
11
|
+
this.uuid = THREE.MathUtils.generateUUID();
|
12
|
+
this.name = "";
|
13
|
+
this.type = "Geometry";
|
14
|
+
this.vertices = [];
|
15
|
+
this.colors = [];
|
16
|
+
this.faces = [];
|
17
|
+
this.faceVertexUvs = [[]];
|
18
|
+
this.morphTargets = [];
|
19
|
+
this.morphNormals = [];
|
20
|
+
this.skinWeights = [];
|
21
|
+
this.skinIndices = [];
|
22
|
+
this.lineDistances = [];
|
23
|
+
this.boundingBox = null;
|
24
|
+
this.boundingSphere = null;
|
25
|
+
this.elementsNeedUpdate = false;
|
26
|
+
this.verticesNeedUpdate = false;
|
27
|
+
this.uvsNeedUpdate = false;
|
28
|
+
this.normalsNeedUpdate = false;
|
29
|
+
this.colorsNeedUpdate = false;
|
30
|
+
this.lineDistancesNeedUpdate = false;
|
31
|
+
this.groupsNeedUpdate = false;
|
32
|
+
}
|
33
|
+
applyMatrix4(matrix) {
|
34
|
+
const normalMatrix = new THREE.Matrix3().getNormalMatrix(matrix);
|
35
|
+
for (let i = 0, il = this.vertices.length; i < il; i++) {
|
36
|
+
const vertex = this.vertices[i];
|
37
|
+
vertex.applyMatrix4(matrix);
|
38
|
+
}
|
39
|
+
for (let i = 0, il = this.faces.length; i < il; i++) {
|
40
|
+
const face = this.faces[i];
|
41
|
+
face.normal.applyMatrix3(normalMatrix).normalize();
|
42
|
+
for (let j = 0, jl = face.vertexNormals.length; j < jl; j++) {
|
43
|
+
face.vertexNormals[j].applyMatrix3(normalMatrix).normalize();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
if (this.boundingBox !== null) {
|
47
|
+
this.computeBoundingBox();
|
48
|
+
}
|
49
|
+
if (this.boundingSphere !== null) {
|
50
|
+
this.computeBoundingSphere();
|
51
|
+
}
|
52
|
+
this.verticesNeedUpdate = true;
|
53
|
+
this.normalsNeedUpdate = true;
|
54
|
+
return this;
|
55
|
+
}
|
56
|
+
rotateX(angle) {
|
57
|
+
_m1.makeRotationX(angle);
|
58
|
+
this.applyMatrix4(_m1);
|
59
|
+
return this;
|
60
|
+
}
|
61
|
+
rotateY(angle) {
|
62
|
+
_m1.makeRotationY(angle);
|
63
|
+
this.applyMatrix4(_m1);
|
64
|
+
return this;
|
65
|
+
}
|
66
|
+
rotateZ(angle) {
|
67
|
+
_m1.makeRotationZ(angle);
|
68
|
+
this.applyMatrix4(_m1);
|
69
|
+
return this;
|
70
|
+
}
|
71
|
+
translate(x, y, z) {
|
72
|
+
_m1.makeTranslation(x, y, z);
|
73
|
+
this.applyMatrix4(_m1);
|
74
|
+
return this;
|
75
|
+
}
|
76
|
+
scale(x, y, z) {
|
77
|
+
_m1.makeScale(x, y, z);
|
78
|
+
this.applyMatrix4(_m1);
|
79
|
+
return this;
|
80
|
+
}
|
81
|
+
lookAt(vector) {
|
82
|
+
_obj.lookAt(vector);
|
83
|
+
_obj.updateMatrix();
|
84
|
+
this.applyMatrix4(_obj.matrix);
|
85
|
+
return this;
|
86
|
+
}
|
87
|
+
fromBufferGeometry(geometry) {
|
88
|
+
const scope = this;
|
89
|
+
const index = geometry.index !== null ? geometry.index : void 0;
|
90
|
+
const attributes = geometry.attributes;
|
91
|
+
if (attributes.position === void 0) {
|
92
|
+
console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion.");
|
93
|
+
return this;
|
94
|
+
}
|
95
|
+
const position = attributes.position;
|
96
|
+
const normal = attributes.normal;
|
97
|
+
const color = attributes.color;
|
98
|
+
const uv = attributes.uv;
|
99
|
+
const uv2 = attributes.uv2;
|
100
|
+
if (uv2 !== void 0)
|
101
|
+
this.faceVertexUvs[1] = [];
|
102
|
+
for (let i = 0; i < position.count; i++) {
|
103
|
+
scope.vertices.push(new THREE.Vector3().fromBufferAttribute(position, i));
|
104
|
+
if (color !== void 0) {
|
105
|
+
scope.colors.push(new THREE.Color().fromBufferAttribute(color, i));
|
106
|
+
}
|
107
|
+
}
|
108
|
+
function addFace(a, b, c, materialIndex) {
|
109
|
+
const vertexColors = color === void 0 ? [] : [scope.colors[a].clone(), scope.colors[b].clone(), scope.colors[c].clone()];
|
110
|
+
const vertexNormals = normal === void 0 ? [] : [
|
111
|
+
new THREE.Vector3().fromBufferAttribute(normal, a),
|
112
|
+
new THREE.Vector3().fromBufferAttribute(normal, b),
|
113
|
+
new THREE.Vector3().fromBufferAttribute(normal, c)
|
114
|
+
];
|
115
|
+
const face = new Face3(a, b, c, vertexNormals, vertexColors, materialIndex);
|
116
|
+
scope.faces.push(face);
|
117
|
+
if (uv !== void 0) {
|
118
|
+
scope.faceVertexUvs[0].push([
|
119
|
+
new THREE.Vector2().fromBufferAttribute(uv, a),
|
120
|
+
new THREE.Vector2().fromBufferAttribute(uv, b),
|
121
|
+
new THREE.Vector2().fromBufferAttribute(uv, c)
|
122
|
+
]);
|
123
|
+
}
|
124
|
+
if (uv2 !== void 0) {
|
125
|
+
scope.faceVertexUvs[1].push([
|
126
|
+
new THREE.Vector2().fromBufferAttribute(uv2, a),
|
127
|
+
new THREE.Vector2().fromBufferAttribute(uv2, b),
|
128
|
+
new THREE.Vector2().fromBufferAttribute(uv2, c)
|
129
|
+
]);
|
130
|
+
}
|
131
|
+
}
|
132
|
+
const groups = geometry.groups;
|
133
|
+
if (groups.length > 0) {
|
134
|
+
for (let i = 0; i < groups.length; i++) {
|
135
|
+
const group = groups[i];
|
136
|
+
const start = group.start;
|
137
|
+
const count = group.count;
|
138
|
+
for (let j = start, jl = start + count; j < jl; j += 3) {
|
139
|
+
if (index !== void 0) {
|
140
|
+
addFace(index.getX(j), index.getX(j + 1), index.getX(j + 2), group.materialIndex);
|
141
|
+
} else {
|
142
|
+
addFace(j, j + 1, j + 2, group.materialIndex);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
} else {
|
147
|
+
if (index !== void 0) {
|
148
|
+
for (let i = 0; i < index.count; i += 3) {
|
149
|
+
addFace(index.getX(i), index.getX(i + 1), index.getX(i + 2));
|
150
|
+
}
|
151
|
+
} else {
|
152
|
+
for (let i = 0; i < position.count; i += 3) {
|
153
|
+
addFace(i, i + 1, i + 2);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
this.computeFaceNormals();
|
158
|
+
if (geometry.boundingBox !== null) {
|
159
|
+
this.boundingBox = geometry.boundingBox.clone();
|
160
|
+
}
|
161
|
+
if (geometry.boundingSphere !== null) {
|
162
|
+
this.boundingSphere = geometry.boundingSphere.clone();
|
163
|
+
}
|
164
|
+
return this;
|
165
|
+
}
|
166
|
+
center() {
|
167
|
+
this.computeBoundingBox();
|
168
|
+
this.boundingBox.getCenter(_offset).negate();
|
169
|
+
this.translate(_offset.x, _offset.y, _offset.z);
|
170
|
+
return this;
|
171
|
+
}
|
172
|
+
normalize() {
|
173
|
+
this.computeBoundingSphere();
|
174
|
+
const center = this.boundingSphere.center;
|
175
|
+
const radius = this.boundingSphere.radius;
|
176
|
+
const s = radius === 0 ? 1 : 1 / radius;
|
177
|
+
const matrix = new THREE.Matrix4();
|
178
|
+
matrix.set(s, 0, 0, -s * center.x, 0, s, 0, -s * center.y, 0, 0, s, -s * center.z, 0, 0, 0, 1);
|
179
|
+
this.applyMatrix4(matrix);
|
180
|
+
return this;
|
181
|
+
}
|
182
|
+
computeFaceNormals() {
|
183
|
+
const cb = new THREE.Vector3(), ab = new THREE.Vector3();
|
184
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
185
|
+
const face = this.faces[f];
|
186
|
+
const vA = this.vertices[face.a];
|
187
|
+
const vB = this.vertices[face.b];
|
188
|
+
const vC = this.vertices[face.c];
|
189
|
+
cb.subVectors(vC, vB);
|
190
|
+
ab.subVectors(vA, vB);
|
191
|
+
cb.cross(ab);
|
192
|
+
cb.normalize();
|
193
|
+
face.normal.copy(cb);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
computeVertexNormals(areaWeighted = true) {
|
197
|
+
const vertices = new Array(this.vertices.length);
|
198
|
+
for (let v = 0, vl = this.vertices.length; v < vl; v++) {
|
199
|
+
vertices[v] = new THREE.Vector3();
|
200
|
+
}
|
201
|
+
if (areaWeighted) {
|
202
|
+
const cb = new THREE.Vector3(), ab = new THREE.Vector3();
|
203
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
204
|
+
const face = this.faces[f];
|
205
|
+
const vA = this.vertices[face.a];
|
206
|
+
const vB = this.vertices[face.b];
|
207
|
+
const vC = this.vertices[face.c];
|
208
|
+
cb.subVectors(vC, vB);
|
209
|
+
ab.subVectors(vA, vB);
|
210
|
+
cb.cross(ab);
|
211
|
+
vertices[face.a].add(cb);
|
212
|
+
vertices[face.b].add(cb);
|
213
|
+
vertices[face.c].add(cb);
|
214
|
+
}
|
215
|
+
} else {
|
216
|
+
this.computeFaceNormals();
|
217
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
218
|
+
const face = this.faces[f];
|
219
|
+
vertices[face.a].add(face.normal);
|
220
|
+
vertices[face.b].add(face.normal);
|
221
|
+
vertices[face.c].add(face.normal);
|
222
|
+
}
|
223
|
+
}
|
224
|
+
for (let v = 0, vl = this.vertices.length; v < vl; v++) {
|
225
|
+
vertices[v].normalize();
|
226
|
+
}
|
227
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
228
|
+
const face = this.faces[f];
|
229
|
+
const vertexNormals = face.vertexNormals;
|
230
|
+
if (vertexNormals.length === 3) {
|
231
|
+
vertexNormals[0].copy(vertices[face.a]);
|
232
|
+
vertexNormals[1].copy(vertices[face.b]);
|
233
|
+
vertexNormals[2].copy(vertices[face.c]);
|
234
|
+
} else {
|
235
|
+
vertexNormals[0] = vertices[face.a].clone();
|
236
|
+
vertexNormals[1] = vertices[face.b].clone();
|
237
|
+
vertexNormals[2] = vertices[face.c].clone();
|
238
|
+
}
|
239
|
+
}
|
240
|
+
if (this.faces.length > 0) {
|
241
|
+
this.normalsNeedUpdate = true;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
computeFlatVertexNormals() {
|
245
|
+
this.computeFaceNormals();
|
246
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
247
|
+
const face = this.faces[f];
|
248
|
+
const vertexNormals = face.vertexNormals;
|
249
|
+
if (vertexNormals.length === 3) {
|
250
|
+
vertexNormals[0].copy(face.normal);
|
251
|
+
vertexNormals[1].copy(face.normal);
|
252
|
+
vertexNormals[2].copy(face.normal);
|
253
|
+
} else {
|
254
|
+
vertexNormals[0] = face.normal.clone();
|
255
|
+
vertexNormals[1] = face.normal.clone();
|
256
|
+
vertexNormals[2] = face.normal.clone();
|
257
|
+
}
|
258
|
+
}
|
259
|
+
if (this.faces.length > 0) {
|
260
|
+
this.normalsNeedUpdate = true;
|
261
|
+
}
|
262
|
+
}
|
263
|
+
computeMorphNormals() {
|
264
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
265
|
+
const face = this.faces[f];
|
266
|
+
if (!face.__originalFaceNormal) {
|
267
|
+
face.__originalFaceNormal = face.normal.clone();
|
268
|
+
} else {
|
269
|
+
face.__originalFaceNormal.copy(face.normal);
|
270
|
+
}
|
271
|
+
if (!face.__originalVertexNormals)
|
272
|
+
face.__originalVertexNormals = [];
|
273
|
+
for (let i = 0, il = face.vertexNormals.length; i < il; i++) {
|
274
|
+
if (!face.__originalVertexNormals[i]) {
|
275
|
+
face.__originalVertexNormals[i] = face.vertexNormals[i].clone();
|
276
|
+
} else {
|
277
|
+
face.__originalVertexNormals[i].copy(face.vertexNormals[i]);
|
278
|
+
}
|
279
|
+
}
|
280
|
+
}
|
281
|
+
const tmpGeo = new Geometry();
|
282
|
+
tmpGeo.faces = this.faces;
|
283
|
+
for (let i = 0, il = this.morphTargets.length; i < il; i++) {
|
284
|
+
if (!this.morphNormals[i]) {
|
285
|
+
this.morphNormals[i] = {};
|
286
|
+
this.morphNormals[i].faceNormals = [];
|
287
|
+
this.morphNormals[i].vertexNormals = [];
|
288
|
+
const dstNormalsFace = this.morphNormals[i].faceNormals;
|
289
|
+
const dstNormalsVertex = this.morphNormals[i].vertexNormals;
|
290
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
291
|
+
const faceNormal = new THREE.Vector3();
|
292
|
+
const vertexNormals = {
|
293
|
+
a: new THREE.Vector3(),
|
294
|
+
b: new THREE.Vector3(),
|
295
|
+
c: new THREE.Vector3()
|
296
|
+
};
|
297
|
+
dstNormalsFace.push(faceNormal);
|
298
|
+
dstNormalsVertex.push(vertexNormals);
|
299
|
+
}
|
300
|
+
}
|
301
|
+
const morphNormals = this.morphNormals[i];
|
302
|
+
tmpGeo.vertices = this.morphTargets[i].vertices;
|
303
|
+
tmpGeo.computeFaceNormals();
|
304
|
+
tmpGeo.computeVertexNormals();
|
305
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
306
|
+
const face = this.faces[f];
|
307
|
+
const faceNormal = morphNormals.faceNormals[f];
|
308
|
+
const vertexNormals = morphNormals.vertexNormals[f];
|
309
|
+
faceNormal.copy(face.normal);
|
310
|
+
vertexNormals.a.copy(face.vertexNormals[0]);
|
311
|
+
vertexNormals.b.copy(face.vertexNormals[1]);
|
312
|
+
vertexNormals.c.copy(face.vertexNormals[2]);
|
313
|
+
}
|
314
|
+
}
|
315
|
+
for (let f = 0, fl = this.faces.length; f < fl; f++) {
|
316
|
+
const face = this.faces[f];
|
317
|
+
face.normal = face.__originalFaceNormal;
|
318
|
+
face.vertexNormals = face.__originalVertexNormals;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
computeBoundingBox() {
|
322
|
+
if (this.boundingBox === null) {
|
323
|
+
this.boundingBox = new THREE.Box3();
|
324
|
+
}
|
325
|
+
this.boundingBox.setFromPoints(this.vertices);
|
326
|
+
}
|
327
|
+
computeBoundingSphere() {
|
328
|
+
if (this.boundingSphere === null) {
|
329
|
+
this.boundingSphere = new THREE.Sphere();
|
330
|
+
}
|
331
|
+
this.boundingSphere.setFromPoints(this.vertices);
|
332
|
+
}
|
333
|
+
merge(geometry, matrix, materialIndexOffset = 0) {
|
334
|
+
if (!(geometry && geometry.isGeometry)) {
|
335
|
+
console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", geometry);
|
336
|
+
return;
|
337
|
+
}
|
338
|
+
let normalMatrix;
|
339
|
+
const vertexOffset = this.vertices.length, vertices1 = this.vertices, vertices2 = geometry.vertices, faces1 = this.faces, faces2 = geometry.faces, colors1 = this.colors, colors2 = geometry.colors;
|
340
|
+
if (matrix !== void 0) {
|
341
|
+
normalMatrix = new THREE.Matrix3().getNormalMatrix(matrix);
|
342
|
+
}
|
343
|
+
for (let i = 0, il = vertices2.length; i < il; i++) {
|
344
|
+
const vertex = vertices2[i];
|
345
|
+
const vertexCopy = vertex.clone();
|
346
|
+
if (matrix !== void 0)
|
347
|
+
vertexCopy.applyMatrix4(matrix);
|
348
|
+
vertices1.push(vertexCopy);
|
349
|
+
}
|
350
|
+
for (let i = 0, il = colors2.length; i < il; i++) {
|
351
|
+
colors1.push(colors2[i].clone());
|
352
|
+
}
|
353
|
+
for (let i = 0, il = faces2.length; i < il; i++) {
|
354
|
+
const face = faces2[i];
|
355
|
+
let normal, color;
|
356
|
+
const faceVertexNormals = face.vertexNormals, faceVertexColors = face.vertexColors;
|
357
|
+
const faceCopy = new Face3(face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset);
|
358
|
+
faceCopy.normal.copy(face.normal);
|
359
|
+
if (normalMatrix !== void 0) {
|
360
|
+
faceCopy.normal.applyMatrix3(normalMatrix).normalize();
|
361
|
+
}
|
362
|
+
for (let j = 0, jl = faceVertexNormals.length; j < jl; j++) {
|
363
|
+
normal = faceVertexNormals[j].clone();
|
364
|
+
if (normalMatrix !== void 0) {
|
365
|
+
normal.applyMatrix3(normalMatrix).normalize();
|
366
|
+
}
|
367
|
+
faceCopy.vertexNormals.push(normal);
|
368
|
+
}
|
369
|
+
faceCopy.color.copy(face.color);
|
370
|
+
for (let j = 0, jl = faceVertexColors.length; j < jl; j++) {
|
371
|
+
color = faceVertexColors[j];
|
372
|
+
faceCopy.vertexColors.push(color.clone());
|
373
|
+
}
|
374
|
+
faceCopy.materialIndex = face.materialIndex + materialIndexOffset;
|
375
|
+
faces1.push(faceCopy);
|
376
|
+
}
|
377
|
+
for (let i = 0, il = geometry.faceVertexUvs.length; i < il; i++) {
|
378
|
+
const faceVertexUvs2 = geometry.faceVertexUvs[i];
|
379
|
+
if (this.faceVertexUvs[i] === void 0)
|
380
|
+
this.faceVertexUvs[i] = [];
|
381
|
+
for (let j = 0, jl = faceVertexUvs2.length; j < jl; j++) {
|
382
|
+
const uvs2 = faceVertexUvs2[j], uvsCopy = [];
|
383
|
+
for (let k = 0, kl = uvs2.length; k < kl; k++) {
|
384
|
+
uvsCopy.push(uvs2[k].clone());
|
385
|
+
}
|
386
|
+
this.faceVertexUvs[i].push(uvsCopy);
|
387
|
+
}
|
388
|
+
}
|
389
|
+
}
|
390
|
+
mergeMesh(mesh) {
|
391
|
+
if (!(mesh && mesh.isMesh)) {
|
392
|
+
console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", mesh);
|
393
|
+
return;
|
394
|
+
}
|
395
|
+
if (mesh.matrixAutoUpdate)
|
396
|
+
mesh.updateMatrix();
|
397
|
+
this.merge(mesh.geometry, mesh.matrix);
|
398
|
+
}
|
399
|
+
/*
|
400
|
+
* Checks for duplicate vertices with hashmap.
|
401
|
+
* Duplicated vertices are removed
|
402
|
+
* and faces' vertices are updated.
|
403
|
+
*/
|
404
|
+
mergeVertices(precisionPoints = 4) {
|
405
|
+
const verticesMap = {};
|
406
|
+
const unique = [], changes = [];
|
407
|
+
const precision = Math.pow(10, precisionPoints);
|
408
|
+
for (let i = 0, il = this.vertices.length; i < il; i++) {
|
409
|
+
const v = this.vertices[i];
|
410
|
+
const key = `${Math.round(v.x * precision)}_${Math.round(v.y * precision)}_${Math.round(v.z * precision)}`;
|
411
|
+
if (verticesMap[key] === void 0) {
|
412
|
+
verticesMap[key] = i;
|
413
|
+
unique.push(this.vertices[i]);
|
414
|
+
changes[i] = unique.length - 1;
|
415
|
+
} else {
|
416
|
+
changes[i] = changes[verticesMap[key]];
|
417
|
+
}
|
418
|
+
}
|
419
|
+
const faceIndicesToRemove = [];
|
420
|
+
for (let i = 0, il = this.faces.length; i < il; i++) {
|
421
|
+
const face = this.faces[i];
|
422
|
+
face.a = changes[face.a];
|
423
|
+
face.b = changes[face.b];
|
424
|
+
face.c = changes[face.c];
|
425
|
+
const indices = [face.a, face.b, face.c];
|
426
|
+
for (let n = 0; n < 3; n++) {
|
427
|
+
if (indices[n] === indices[(n + 1) % 3]) {
|
428
|
+
faceIndicesToRemove.push(i);
|
429
|
+
break;
|
430
|
+
}
|
431
|
+
}
|
432
|
+
}
|
433
|
+
for (let i = faceIndicesToRemove.length - 1; i >= 0; i--) {
|
434
|
+
const idx = faceIndicesToRemove[i];
|
435
|
+
this.faces.splice(idx, 1);
|
436
|
+
for (let j = 0, jl = this.faceVertexUvs.length; j < jl; j++) {
|
437
|
+
this.faceVertexUvs[j].splice(idx, 1);
|
438
|
+
}
|
439
|
+
}
|
440
|
+
const diff = this.vertices.length - unique.length;
|
441
|
+
this.vertices = unique;
|
442
|
+
return diff;
|
443
|
+
}
|
444
|
+
setFromPoints(points) {
|
445
|
+
this.vertices = [];
|
446
|
+
for (let i = 0, l = points.length; i < l; i++) {
|
447
|
+
const point = points[i];
|
448
|
+
this.vertices.push(new THREE.Vector3(point.x, point.y, point.z || 0));
|
449
|
+
}
|
450
|
+
return this;
|
451
|
+
}
|
452
|
+
sortFacesByMaterialIndex() {
|
453
|
+
const faces = this.faces;
|
454
|
+
const length = faces.length;
|
455
|
+
for (let i = 0; i < length; i++) {
|
456
|
+
faces[i]._id = i;
|
457
|
+
}
|
458
|
+
function materialIndexSort(a, b) {
|
459
|
+
return a.materialIndex - b.materialIndex;
|
460
|
+
}
|
461
|
+
faces.sort(materialIndexSort);
|
462
|
+
const uvs1 = this.faceVertexUvs[0];
|
463
|
+
const uvs2 = this.faceVertexUvs[1];
|
464
|
+
let newUvs1, newUvs2;
|
465
|
+
if (uvs1 && uvs1.length === length)
|
466
|
+
newUvs1 = [];
|
467
|
+
if (uvs2 && uvs2.length === length)
|
468
|
+
newUvs2 = [];
|
469
|
+
for (let i = 0; i < length; i++) {
|
470
|
+
const id = faces[i]._id;
|
471
|
+
if (newUvs1)
|
472
|
+
newUvs1.push(uvs1[id]);
|
473
|
+
if (newUvs2)
|
474
|
+
newUvs2.push(uvs2[id]);
|
475
|
+
}
|
476
|
+
if (newUvs1)
|
477
|
+
this.faceVertexUvs[0] = newUvs1;
|
478
|
+
if (newUvs2)
|
479
|
+
this.faceVertexUvs[1] = newUvs2;
|
480
|
+
}
|
481
|
+
toJSON() {
|
482
|
+
const data = {
|
483
|
+
metadata: {
|
484
|
+
version: 4.5,
|
485
|
+
type: "Geometry",
|
486
|
+
generator: "Geometry.toJSON"
|
487
|
+
}
|
488
|
+
};
|
489
|
+
data.uuid = this.uuid;
|
490
|
+
data.type = this.type;
|
491
|
+
if (this.name !== "")
|
492
|
+
data.name = this.name;
|
493
|
+
if (this.parameters !== void 0) {
|
494
|
+
const parameters = this.parameters;
|
495
|
+
for (let key in parameters) {
|
496
|
+
if (parameters[key] !== void 0)
|
497
|
+
data[key] = parameters[key];
|
498
|
+
}
|
499
|
+
return data;
|
500
|
+
}
|
501
|
+
const vertices = [];
|
502
|
+
for (let i = 0; i < this.vertices.length; i++) {
|
503
|
+
const vertex = this.vertices[i];
|
504
|
+
vertices.push(vertex.x, vertex.y, vertex.z);
|
505
|
+
}
|
506
|
+
const faces = [];
|
507
|
+
const normals = [];
|
508
|
+
const normalsHash = {};
|
509
|
+
const colors = [];
|
510
|
+
const colorsHash = {};
|
511
|
+
const uvs = [];
|
512
|
+
const uvsHash = {};
|
513
|
+
for (let i = 0; i < this.faces.length; i++) {
|
514
|
+
const face = this.faces[i];
|
515
|
+
const hasMaterial = true;
|
516
|
+
const hasFaceUv = false;
|
517
|
+
const hasFaceVertexUv = this.faceVertexUvs[0][i] !== void 0;
|
518
|
+
const hasFaceNormal = face.normal.length() > 0;
|
519
|
+
const hasFaceVertexNormal = face.vertexNormals.length > 0;
|
520
|
+
const hasFaceColor = face.color.r !== 1 || face.color.g !== 1 || face.color.b !== 1;
|
521
|
+
const hasFaceVertexColor = face.vertexColors.length > 0;
|
522
|
+
let faceType = 0;
|
523
|
+
faceType = setBit(faceType, 0, 0);
|
524
|
+
faceType = setBit(faceType, 1, hasMaterial);
|
525
|
+
faceType = setBit(faceType, 2, hasFaceUv);
|
526
|
+
faceType = setBit(faceType, 3, hasFaceVertexUv);
|
527
|
+
faceType = setBit(faceType, 4, hasFaceNormal);
|
528
|
+
faceType = setBit(faceType, 5, hasFaceVertexNormal);
|
529
|
+
faceType = setBit(faceType, 6, hasFaceColor);
|
530
|
+
faceType = setBit(faceType, 7, hasFaceVertexColor);
|
531
|
+
faces.push(faceType);
|
532
|
+
faces.push(face.a, face.b, face.c);
|
533
|
+
faces.push(face.materialIndex);
|
534
|
+
if (hasFaceVertexUv) {
|
535
|
+
const faceVertexUvs = this.faceVertexUvs[0][i];
|
536
|
+
faces.push(getUvIndex(faceVertexUvs[0]), getUvIndex(faceVertexUvs[1]), getUvIndex(faceVertexUvs[2]));
|
537
|
+
}
|
538
|
+
if (hasFaceNormal) {
|
539
|
+
faces.push(getNormalIndex(face.normal));
|
540
|
+
}
|
541
|
+
if (hasFaceVertexNormal) {
|
542
|
+
const vertexNormals = face.vertexNormals;
|
543
|
+
faces.push(getNormalIndex(vertexNormals[0]), getNormalIndex(vertexNormals[1]), getNormalIndex(vertexNormals[2]));
|
544
|
+
}
|
545
|
+
if (hasFaceColor) {
|
546
|
+
faces.push(getColorIndex(face.color));
|
547
|
+
}
|
548
|
+
if (hasFaceVertexColor) {
|
549
|
+
const vertexColors = face.vertexColors;
|
550
|
+
faces.push(getColorIndex(vertexColors[0]), getColorIndex(vertexColors[1]), getColorIndex(vertexColors[2]));
|
551
|
+
}
|
552
|
+
}
|
553
|
+
function setBit(value, position, enabled) {
|
554
|
+
return enabled ? value | 1 << position : value & ~(1 << position);
|
555
|
+
}
|
556
|
+
function getNormalIndex(normal) {
|
557
|
+
const hash = normal.x.toString() + normal.y.toString() + normal.z.toString();
|
558
|
+
if (normalsHash[hash] !== void 0) {
|
559
|
+
return normalsHash[hash];
|
560
|
+
}
|
561
|
+
normalsHash[hash] = normals.length / 3;
|
562
|
+
normals.push(normal.x, normal.y, normal.z);
|
563
|
+
return normalsHash[hash];
|
564
|
+
}
|
565
|
+
function getColorIndex(color) {
|
566
|
+
const hash = color.r.toString() + color.g.toString() + color.b.toString();
|
567
|
+
if (colorsHash[hash] !== void 0) {
|
568
|
+
return colorsHash[hash];
|
569
|
+
}
|
570
|
+
colorsHash[hash] = colors.length;
|
571
|
+
colors.push(color.getHex());
|
572
|
+
return colorsHash[hash];
|
573
|
+
}
|
574
|
+
function getUvIndex(uv) {
|
575
|
+
const hash = uv.x.toString() + uv.y.toString();
|
576
|
+
if (uvsHash[hash] !== void 0) {
|
577
|
+
return uvsHash[hash];
|
578
|
+
}
|
579
|
+
uvsHash[hash] = uvs.length / 2;
|
580
|
+
uvs.push(uv.x, uv.y);
|
581
|
+
return uvsHash[hash];
|
582
|
+
}
|
583
|
+
data.data = {};
|
584
|
+
data.data.vertices = vertices;
|
585
|
+
data.data.normals = normals;
|
586
|
+
if (colors.length > 0)
|
587
|
+
data.data.colors = colors;
|
588
|
+
if (uvs.length > 0)
|
589
|
+
data.data.uvs = [uvs];
|
590
|
+
data.data.faces = faces;
|
591
|
+
return data;
|
592
|
+
}
|
593
|
+
clone() {
|
594
|
+
return new Geometry().copy(this);
|
595
|
+
}
|
596
|
+
copy(source) {
|
597
|
+
this.vertices = [];
|
598
|
+
this.colors = [];
|
599
|
+
this.faces = [];
|
600
|
+
this.faceVertexUvs = [[]];
|
601
|
+
this.morphTargets = [];
|
602
|
+
this.morphNormals = [];
|
603
|
+
this.skinWeights = [];
|
604
|
+
this.skinIndices = [];
|
605
|
+
this.lineDistances = [];
|
606
|
+
this.boundingBox = null;
|
607
|
+
this.boundingSphere = null;
|
608
|
+
this.name = source.name;
|
609
|
+
const vertices = source.vertices;
|
610
|
+
for (let i = 0, il = vertices.length; i < il; i++) {
|
611
|
+
this.vertices.push(vertices[i].clone());
|
612
|
+
}
|
613
|
+
const colors = source.colors;
|
614
|
+
for (let i = 0, il = colors.length; i < il; i++) {
|
615
|
+
this.colors.push(colors[i].clone());
|
616
|
+
}
|
617
|
+
const faces = source.faces;
|
618
|
+
for (let i = 0, il = faces.length; i < il; i++) {
|
619
|
+
this.faces.push(faces[i].clone());
|
620
|
+
}
|
621
|
+
for (let i = 0, il = source.faceVertexUvs.length; i < il; i++) {
|
622
|
+
const faceVertexUvs = source.faceVertexUvs[i];
|
623
|
+
if (this.faceVertexUvs[i] === void 0) {
|
624
|
+
this.faceVertexUvs[i] = [];
|
625
|
+
}
|
626
|
+
for (let j = 0, jl = faceVertexUvs.length; j < jl; j++) {
|
627
|
+
const uvs = faceVertexUvs[j], uvsCopy = [];
|
628
|
+
for (let k = 0, kl = uvs.length; k < kl; k++) {
|
629
|
+
const uv = uvs[k];
|
630
|
+
uvsCopy.push(uv.clone());
|
631
|
+
}
|
632
|
+
this.faceVertexUvs[i].push(uvsCopy);
|
633
|
+
}
|
634
|
+
}
|
635
|
+
const morphTargets = source.morphTargets;
|
636
|
+
for (let i = 0, il = morphTargets.length; i < il; i++) {
|
637
|
+
const morphTarget = {};
|
638
|
+
morphTarget.name = morphTargets[i].name;
|
639
|
+
if (morphTargets[i].vertices !== void 0) {
|
640
|
+
morphTarget.vertices = [];
|
641
|
+
for (let j = 0, jl = morphTargets[i].vertices.length; j < jl; j++) {
|
642
|
+
morphTarget.vertices.push(morphTargets[i].vertices[j].clone());
|
643
|
+
}
|
644
|
+
}
|
645
|
+
if (morphTargets[i].normals !== void 0) {
|
646
|
+
morphTarget.normals = [];
|
647
|
+
for (let j = 0, jl = morphTargets[i].normals.length; j < jl; j++) {
|
648
|
+
morphTarget.normals.push(morphTargets[i].normals[j].clone());
|
649
|
+
}
|
650
|
+
}
|
651
|
+
this.morphTargets.push(morphTarget);
|
652
|
+
}
|
653
|
+
const morphNormals = source.morphNormals;
|
654
|
+
for (let i = 0, il = morphNormals.length; i < il; i++) {
|
655
|
+
const morphNormal = {};
|
656
|
+
if (morphNormals[i].vertexNormals !== void 0) {
|
657
|
+
morphNormal.vertexNormals = [];
|
658
|
+
for (let j = 0, jl = morphNormals[i].vertexNormals.length; j < jl; j++) {
|
659
|
+
const srcVertexNormal = morphNormals[i].vertexNormals[j];
|
660
|
+
const destVertexNormal = {};
|
661
|
+
destVertexNormal.a = srcVertexNormal.a.clone();
|
662
|
+
destVertexNormal.b = srcVertexNormal.b.clone();
|
663
|
+
destVertexNormal.c = srcVertexNormal.c.clone();
|
664
|
+
morphNormal.vertexNormals.push(destVertexNormal);
|
665
|
+
}
|
666
|
+
}
|
667
|
+
if (morphNormals[i].faceNormals !== void 0) {
|
668
|
+
morphNormal.faceNormals = [];
|
669
|
+
for (let j = 0, jl = morphNormals[i].faceNormals.length; j < jl; j++) {
|
670
|
+
morphNormal.faceNormals.push(morphNormals[i].faceNormals[j].clone());
|
671
|
+
}
|
672
|
+
}
|
673
|
+
this.morphNormals.push(morphNormal);
|
674
|
+
}
|
675
|
+
const skinWeights = source.skinWeights;
|
676
|
+
for (let i = 0, il = skinWeights.length; i < il; i++) {
|
677
|
+
this.skinWeights.push(skinWeights[i].clone());
|
678
|
+
}
|
679
|
+
const skinIndices = source.skinIndices;
|
680
|
+
for (let i = 0, il = skinIndices.length; i < il; i++) {
|
681
|
+
this.skinIndices.push(skinIndices[i].clone());
|
682
|
+
}
|
683
|
+
const lineDistances = source.lineDistances;
|
684
|
+
for (let i = 0, il = lineDistances.length; i < il; i++) {
|
685
|
+
this.lineDistances.push(lineDistances[i]);
|
686
|
+
}
|
687
|
+
const boundingBox = source.boundingBox;
|
688
|
+
if (boundingBox !== null) {
|
689
|
+
this.boundingBox = boundingBox.clone();
|
690
|
+
}
|
691
|
+
const boundingSphere = source.boundingSphere;
|
692
|
+
if (boundingSphere !== null) {
|
693
|
+
this.boundingSphere = boundingSphere.clone();
|
694
|
+
}
|
695
|
+
this.elementsNeedUpdate = source.elementsNeedUpdate;
|
696
|
+
this.verticesNeedUpdate = source.verticesNeedUpdate;
|
697
|
+
this.uvsNeedUpdate = source.uvsNeedUpdate;
|
698
|
+
this.normalsNeedUpdate = source.normalsNeedUpdate;
|
699
|
+
this.colorsNeedUpdate = source.colorsNeedUpdate;
|
700
|
+
this.lineDistancesNeedUpdate = source.lineDistancesNeedUpdate;
|
701
|
+
this.groupsNeedUpdate = source.groupsNeedUpdate;
|
702
|
+
return this;
|
703
|
+
}
|
704
|
+
toBufferGeometry() {
|
705
|
+
const geometry = new DirectGeometry().fromGeometry(this);
|
706
|
+
const buffergeometry = new THREE.BufferGeometry();
|
707
|
+
const positions = new Float32Array(geometry.vertices.length * 3);
|
708
|
+
buffergeometry.setAttribute("position", new THREE.BufferAttribute(positions, 3).copyVector3sArray(geometry.vertices));
|
709
|
+
if (geometry.normals.length > 0) {
|
710
|
+
const normals = new Float32Array(geometry.normals.length * 3);
|
711
|
+
buffergeometry.setAttribute("normal", new THREE.BufferAttribute(normals, 3).copyVector3sArray(geometry.normals));
|
712
|
+
}
|
713
|
+
if (geometry.colors.length > 0) {
|
714
|
+
const colors = new Float32Array(geometry.colors.length * 3);
|
715
|
+
buffergeometry.setAttribute("color", new THREE.BufferAttribute(colors, 3).copyColorsArray(geometry.colors));
|
716
|
+
}
|
717
|
+
if (geometry.uvs.length > 0) {
|
718
|
+
const uvs = new Float32Array(geometry.uvs.length * 2);
|
719
|
+
buffergeometry.setAttribute("uv", new THREE.BufferAttribute(uvs, 2).copyVector2sArray(geometry.uvs));
|
720
|
+
}
|
721
|
+
if (geometry.uvs2.length > 0) {
|
722
|
+
const uvs2 = new Float32Array(geometry.uvs2.length * 2);
|
723
|
+
buffergeometry.setAttribute("uv2", new THREE.BufferAttribute(uvs2, 2).copyVector2sArray(geometry.uvs2));
|
724
|
+
}
|
725
|
+
buffergeometry.groups = geometry.groups;
|
726
|
+
for (let name in geometry.morphTargets) {
|
727
|
+
const array = [];
|
728
|
+
const morphTargets = geometry.morphTargets[name];
|
729
|
+
for (let i = 0, l = morphTargets.length; i < l; i++) {
|
730
|
+
const morphTarget = morphTargets[i];
|
731
|
+
const attribute = new THREE.Float32BufferAttribute(morphTarget.data.length * 3, 3);
|
732
|
+
attribute.name = morphTarget.name;
|
733
|
+
array.push(attribute.copyVector3sArray(morphTarget.data));
|
734
|
+
}
|
735
|
+
buffergeometry.morphAttributes[name] = array;
|
736
|
+
}
|
737
|
+
if (geometry.skinIndices.length > 0) {
|
738
|
+
const skinIndices = new THREE.Float32BufferAttribute(geometry.skinIndices.length * 4, 4);
|
739
|
+
buffergeometry.setAttribute("skinIndex", skinIndices.copyVector4sArray(geometry.skinIndices));
|
740
|
+
}
|
741
|
+
if (geometry.skinWeights.length > 0) {
|
742
|
+
const skinWeights = new THREE.Float32BufferAttribute(geometry.skinWeights.length * 4, 4);
|
743
|
+
buffergeometry.setAttribute("skinWeight", skinWeights.copyVector4sArray(geometry.skinWeights));
|
744
|
+
}
|
745
|
+
if (geometry.boundingSphere !== null) {
|
746
|
+
buffergeometry.boundingSphere = geometry.boundingSphere.clone();
|
747
|
+
}
|
748
|
+
if (geometry.boundingBox !== null) {
|
749
|
+
buffergeometry.boundingBox = geometry.boundingBox.clone();
|
750
|
+
}
|
751
|
+
return buffergeometry;
|
752
|
+
}
|
753
|
+
computeTangents() {
|
754
|
+
console.error("THREE.Geometry: .computeTangents() has been removed.");
|
755
|
+
}
|
756
|
+
computeLineDistances() {
|
757
|
+
console.error(
|
758
|
+
"THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead."
|
759
|
+
);
|
760
|
+
}
|
761
|
+
applyMatrix(matrix) {
|
762
|
+
console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4().");
|
763
|
+
return this.applyMatrix4(matrix);
|
764
|
+
}
|
765
|
+
dispose() {
|
766
|
+
this.dispatchEvent({ type: "dispose" });
|
767
|
+
}
|
768
|
+
}
|
769
|
+
Geometry.createBufferGeometryFromObject = (object) => {
|
770
|
+
let buffergeometry = new THREE.BufferGeometry();
|
771
|
+
const geometry = object.geometry;
|
772
|
+
if (object.isPoints || object.isLine) {
|
773
|
+
const positions = new THREE.Float32BufferAttribute(geometry.vertices.length * 3, 3);
|
774
|
+
const colors = new THREE.Float32BufferAttribute(geometry.colors.length * 3, 3);
|
775
|
+
buffergeometry.setAttribute("position", positions.copyVector3sArray(geometry.vertices));
|
776
|
+
buffergeometry.setAttribute("color", colors.copyColorsArray(geometry.colors));
|
777
|
+
if (geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length) {
|
778
|
+
const lineDistances = new THREE.Float32BufferAttribute(geometry.lineDistances.length, 1);
|
779
|
+
buffergeometry.setAttribute("lineDistance", lineDistances.copyArray(geometry.lineDistances));
|
780
|
+
}
|
781
|
+
if (geometry.boundingSphere !== null) {
|
782
|
+
buffergeometry.boundingSphere = geometry.boundingSphere.clone();
|
783
|
+
}
|
784
|
+
if (geometry.boundingBox !== null) {
|
785
|
+
buffergeometry.boundingBox = geometry.boundingBox.clone();
|
786
|
+
}
|
787
|
+
} else if (object.isMesh) {
|
788
|
+
buffergeometry = geometry.toBufferGeometry();
|
789
|
+
}
|
790
|
+
return buffergeometry;
|
791
|
+
};
|
792
|
+
class DirectGeometry {
|
793
|
+
constructor() {
|
794
|
+
this.vertices = [];
|
795
|
+
this.normals = [];
|
796
|
+
this.colors = [];
|
797
|
+
this.uvs = [];
|
798
|
+
this.uvs2 = [];
|
799
|
+
this.groups = [];
|
800
|
+
this.morphTargets = {};
|
801
|
+
this.skinWeights = [];
|
802
|
+
this.skinIndices = [];
|
803
|
+
this.boundingBox = null;
|
804
|
+
this.boundingSphere = null;
|
805
|
+
this.verticesNeedUpdate = false;
|
806
|
+
this.normalsNeedUpdate = false;
|
807
|
+
this.colorsNeedUpdate = false;
|
808
|
+
this.uvsNeedUpdate = false;
|
809
|
+
this.groupsNeedUpdate = false;
|
810
|
+
}
|
811
|
+
computeGroups(geometry) {
|
812
|
+
const groups = [];
|
813
|
+
let group, i;
|
814
|
+
let materialIndex = void 0;
|
815
|
+
const faces = geometry.faces;
|
816
|
+
for (i = 0; i < faces.length; i++) {
|
817
|
+
const face = faces[i];
|
818
|
+
if (face.materialIndex !== materialIndex) {
|
819
|
+
materialIndex = face.materialIndex;
|
820
|
+
if (group !== void 0) {
|
821
|
+
group.count = i * 3 - group.start;
|
822
|
+
groups.push(group);
|
823
|
+
}
|
824
|
+
group = {
|
825
|
+
start: i * 3,
|
826
|
+
materialIndex
|
827
|
+
};
|
828
|
+
}
|
829
|
+
}
|
830
|
+
if (group !== void 0) {
|
831
|
+
group.count = i * 3 - group.start;
|
832
|
+
groups.push(group);
|
833
|
+
}
|
834
|
+
this.groups = groups;
|
835
|
+
}
|
836
|
+
fromGeometry(geometry) {
|
837
|
+
const faces = geometry.faces;
|
838
|
+
const vertices = geometry.vertices;
|
839
|
+
const faceVertexUvs = geometry.faceVertexUvs;
|
840
|
+
const hasFaceVertexUv = faceVertexUvs[0] && faceVertexUvs[0].length > 0;
|
841
|
+
const hasFaceVertexUv2 = faceVertexUvs[1] && faceVertexUvs[1].length > 0;
|
842
|
+
const morphTargets = geometry.morphTargets;
|
843
|
+
const morphTargetsLength = morphTargets.length;
|
844
|
+
let morphTargetsPosition;
|
845
|
+
if (morphTargetsLength > 0) {
|
846
|
+
morphTargetsPosition = [];
|
847
|
+
for (let i = 0; i < morphTargetsLength; i++) {
|
848
|
+
morphTargetsPosition[i] = {
|
849
|
+
name: morphTargets[i].name,
|
850
|
+
data: []
|
851
|
+
};
|
852
|
+
}
|
853
|
+
this.morphTargets.position = morphTargetsPosition;
|
854
|
+
}
|
855
|
+
const morphNormals = geometry.morphNormals;
|
856
|
+
const morphNormalsLength = morphNormals.length;
|
857
|
+
let morphTargetsNormal;
|
858
|
+
if (morphNormalsLength > 0) {
|
859
|
+
morphTargetsNormal = [];
|
860
|
+
for (let i = 0; i < morphNormalsLength; i++) {
|
861
|
+
morphTargetsNormal[i] = {
|
862
|
+
name: morphNormals[i].name,
|
863
|
+
data: []
|
864
|
+
};
|
865
|
+
}
|
866
|
+
this.morphTargets.normal = morphTargetsNormal;
|
867
|
+
}
|
868
|
+
const skinIndices = geometry.skinIndices;
|
869
|
+
const skinWeights = geometry.skinWeights;
|
870
|
+
const hasSkinIndices = skinIndices.length === vertices.length;
|
871
|
+
const hasSkinWeights = skinWeights.length === vertices.length;
|
872
|
+
if (vertices.length > 0 && faces.length === 0) {
|
873
|
+
console.error("THREE.DirectGeometry: Faceless geometries are not supported.");
|
874
|
+
}
|
875
|
+
for (let i = 0; i < faces.length; i++) {
|
876
|
+
const face = faces[i];
|
877
|
+
this.vertices.push(vertices[face.a], vertices[face.b], vertices[face.c]);
|
878
|
+
const vertexNormals = face.vertexNormals;
|
879
|
+
if (vertexNormals.length === 3) {
|
880
|
+
this.normals.push(vertexNormals[0], vertexNormals[1], vertexNormals[2]);
|
881
|
+
} else {
|
882
|
+
const normal = face.normal;
|
883
|
+
this.normals.push(normal, normal, normal);
|
884
|
+
}
|
885
|
+
const vertexColors = face.vertexColors;
|
886
|
+
if (vertexColors.length === 3) {
|
887
|
+
this.colors.push(vertexColors[0], vertexColors[1], vertexColors[2]);
|
888
|
+
} else {
|
889
|
+
const color = face.color;
|
890
|
+
this.colors.push(color, color, color);
|
891
|
+
}
|
892
|
+
if (hasFaceVertexUv === true) {
|
893
|
+
const vertexUvs = faceVertexUvs[0][i];
|
894
|
+
if (vertexUvs !== void 0) {
|
895
|
+
this.uvs.push(vertexUvs[0], vertexUvs[1], vertexUvs[2]);
|
896
|
+
} else {
|
897
|
+
console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", i);
|
898
|
+
this.uvs.push(new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2());
|
899
|
+
}
|
900
|
+
}
|
901
|
+
if (hasFaceVertexUv2 === true) {
|
902
|
+
const vertexUvs = faceVertexUvs[1][i];
|
903
|
+
if (vertexUvs !== void 0) {
|
904
|
+
this.uvs2.push(vertexUvs[0], vertexUvs[1], vertexUvs[2]);
|
905
|
+
} else {
|
906
|
+
console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", i);
|
907
|
+
this.uvs2.push(new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2());
|
908
|
+
}
|
909
|
+
}
|
910
|
+
for (let j = 0; j < morphTargetsLength; j++) {
|
911
|
+
const morphTarget = morphTargets[j].vertices;
|
912
|
+
morphTargetsPosition[j].data.push(morphTarget[face.a], morphTarget[face.b], morphTarget[face.c]);
|
913
|
+
}
|
914
|
+
for (let j = 0; j < morphNormalsLength; j++) {
|
915
|
+
const morphNormal = morphNormals[j].vertexNormals[i];
|
916
|
+
morphTargetsNormal[j].data.push(morphNormal.a, morphNormal.b, morphNormal.c);
|
917
|
+
}
|
918
|
+
if (hasSkinIndices) {
|
919
|
+
this.skinIndices.push(skinIndices[face.a], skinIndices[face.b], skinIndices[face.c]);
|
920
|
+
}
|
921
|
+
if (hasSkinWeights) {
|
922
|
+
this.skinWeights.push(skinWeights[face.a], skinWeights[face.b], skinWeights[face.c]);
|
923
|
+
}
|
924
|
+
}
|
925
|
+
this.computeGroups(geometry);
|
926
|
+
this.verticesNeedUpdate = geometry.verticesNeedUpdate;
|
927
|
+
this.normalsNeedUpdate = geometry.normalsNeedUpdate;
|
928
|
+
this.colorsNeedUpdate = geometry.colorsNeedUpdate;
|
929
|
+
this.uvsNeedUpdate = geometry.uvsNeedUpdate;
|
930
|
+
this.groupsNeedUpdate = geometry.groupsNeedUpdate;
|
931
|
+
if (geometry.boundingSphere !== null) {
|
932
|
+
this.boundingSphere = geometry.boundingSphere.clone();
|
933
|
+
}
|
934
|
+
if (geometry.boundingBox !== null) {
|
935
|
+
this.boundingBox = geometry.boundingBox.clone();
|
936
|
+
}
|
937
|
+
return this;
|
938
|
+
}
|
939
|
+
}
|
940
|
+
class Face3 {
|
941
|
+
constructor(a, b, c, normal, color, materialIndex = 0) {
|
942
|
+
this.a = a;
|
943
|
+
this.b = b;
|
944
|
+
this.c = c;
|
945
|
+
this.normal = normal && normal.isVector3 ? normal : new THREE.Vector3();
|
946
|
+
this.vertexNormals = Array.isArray(normal) ? normal : [];
|
947
|
+
this.color = color && color.isColor ? color : new THREE.Color();
|
948
|
+
this.vertexColors = Array.isArray(color) ? color : [];
|
949
|
+
this.materialIndex = materialIndex;
|
950
|
+
}
|
951
|
+
clone() {
|
952
|
+
return new this.constructor().copy(this);
|
953
|
+
}
|
954
|
+
copy(source) {
|
955
|
+
this.a = source.a;
|
956
|
+
this.b = source.b;
|
957
|
+
this.c = source.c;
|
958
|
+
this.normal.copy(source.normal);
|
959
|
+
this.color.copy(source.color);
|
960
|
+
this.materialIndex = source.materialIndex;
|
961
|
+
for (let i = 0, il = source.vertexNormals.length; i < il; i++) {
|
962
|
+
this.vertexNormals[i] = source.vertexNormals[i].clone();
|
963
|
+
}
|
964
|
+
for (let i = 0, il = source.vertexColors.length; i < il; i++) {
|
965
|
+
this.vertexColors[i] = source.vertexColors[i].clone();
|
966
|
+
}
|
967
|
+
return this;
|
968
|
+
}
|
969
|
+
}
|
970
|
+
exports.Face3 = Face3;
|
971
|
+
exports.Geometry = Geometry;
|