three-stdlib 2.25.0 → 2.26.0

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