three-stdlib 2.15.1 → 2.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1218) hide show
  1. package/animation/AnimationClipCreator.js +32 -52
  2. package/animation/AnimationClipCreator.mjs +57 -0
  3. package/animation/CCDIKSolver.js +66 -161
  4. package/animation/CCDIKSolver.mjs +234 -0
  5. package/animation/MMDAnimationHelper.js +150 -341
  6. package/animation/MMDAnimationHelper.mjs +514 -0
  7. package/animation/MMDPhysics.js +154 -361
  8. package/animation/MMDPhysics.mjs +769 -0
  9. package/cameras/CinematicCamera.js +67 -77
  10. package/cameras/CinematicCamera.mjs +129 -0
  11. package/controls/ArcballControls.js +544 -1449
  12. package/controls/ArcballControls.mjs +1737 -0
  13. package/controls/DeviceOrientationControls.js +52 -97
  14. package/controls/DeviceOrientationControls.mjs +74 -0
  15. package/controls/DragControls.js +85 -187
  16. package/controls/DragControls.mjs +172 -0
  17. package/controls/FirstPersonControls.js +123 -193
  18. package/controls/FirstPersonControls.mjs +220 -0
  19. package/controls/FlyControls.js +82 -152
  20. package/controls/FlyControls.mjs +239 -0
  21. package/controls/OrbitControls.js +232 -481
  22. package/controls/OrbitControls.mjs +731 -0
  23. package/controls/PointerLockControls.js +63 -99
  24. package/controls/PointerLockControls.mjs +88 -0
  25. package/controls/TrackballControls.js +211 -383
  26. package/controls/TrackballControls.mjs +481 -0
  27. package/controls/TransformControls.js +575 -782
  28. package/controls/TransformControls.mjs +1068 -0
  29. package/controls/experimental/CameraControls.js +329 -609
  30. package/controls/experimental/CameraControls.mjs +673 -0
  31. package/csm/CSM.js +47 -108
  32. package/csm/CSM.mjs +244 -0
  33. package/csm/CSMFrustum.js +14 -29
  34. package/csm/CSMFrustum.mjs +75 -0
  35. package/csm/CSMHelper.js +20 -34
  36. package/csm/CSMHelper.mjs +114 -0
  37. package/csm/CSMShader.js +7 -11
  38. package/csm/CSMShader.mjs +251 -0
  39. package/curves/CurveExtras.js +73 -115
  40. package/curves/CurveExtras.mjs +224 -0
  41. package/curves/NURBSCurve.js +15 -43
  42. package/curves/NURBSCurve.mjs +35 -0
  43. package/curves/NURBSSurface.js +11 -27
  44. package/curves/NURBSSurface.mjs +28 -0
  45. package/curves/NURBSUtils.js +54 -203
  46. package/curves/NURBSUtils.mjs +226 -0
  47. package/deprecated/Geometry.js +191 -486
  48. package/deprecated/Geometry.mjs +966 -0
  49. package/effects/AnaglyphEffect.js +95 -60
  50. package/effects/AnaglyphEffect.mjs +120 -0
  51. package/effects/AsciiEffect.js +80 -110
  52. package/effects/AsciiEffect.mjs +173 -0
  53. package/effects/OutlineEffect.js +121 -204
  54. package/effects/OutlineEffect.mjs +295 -0
  55. package/effects/ParallaxBarrierEffect.js +39 -38
  56. package/effects/ParallaxBarrierEffect.mjs +64 -0
  57. package/effects/PeppersGhostEffect.js +19 -68
  58. package/effects/PeppersGhostEffect.mjs +85 -0
  59. package/effects/StereoEffect.js +12 -16
  60. package/effects/StereoEffect.mjs +32 -0
  61. package/environments/RoomEnvironment.js +52 -47
  62. package/environments/RoomEnvironment.mjs +78 -0
  63. package/exporters/ColladaExporter.js +115 -241
  64. package/exporters/ColladaExporter.mjs +299 -0
  65. package/exporters/DRACOExporter.js +67 -121
  66. package/exporters/DRACOExporter.mjs +132 -0
  67. package/exporters/GLTFExporter.js +463 -1014
  68. package/exporters/GLTFExporter.mjs +1381 -0
  69. package/exporters/MMDExporter.js +44 -102
  70. package/exporters/MMDExporter.mjs +102 -0
  71. package/exporters/OBJExporter.js +78 -140
  72. package/exporters/OBJExporter.mjs +166 -0
  73. package/exporters/PLYExporter.js +93 -154
  74. package/exporters/PLYExporter.mjs +278 -0
  75. package/exporters/STLExporter.js +30 -81
  76. package/exporters/STLExporter.mjs +129 -0
  77. package/exporters/USDZExporter.js +84 -144
  78. package/exporters/USDZExporter.mjs +328 -0
  79. package/geometries/BoxLineGeometry.js +7 -14
  80. package/geometries/BoxLineGeometry.mjs +45 -0
  81. package/geometries/ConvexGeometry.js +14 -23
  82. package/geometries/ConvexGeometry.mjs +29 -0
  83. package/geometries/DecalGeometry.js +108 -162
  84. package/geometries/DecalGeometry.mjs +184 -0
  85. package/geometries/LightningStrike.js +101 -294
  86. package/geometries/LightningStrike.mjs +547 -0
  87. package/geometries/ParametricGeometries.js +26 -76
  88. package/geometries/ParametricGeometries.mjs +129 -0
  89. package/geometries/ParametricGeometry.js +24 -48
  90. package/geometries/ParametricGeometry.mjs +63 -0
  91. package/geometries/RoundedBoxGeometry.js +33 -64
  92. package/geometries/RoundedBoxGeometry.mjs +91 -0
  93. package/geometries/TeapotGeometry.js +1434 -174
  94. package/geometries/TeapotGeometry.mjs +1557 -0
  95. package/geometries/TextGeometry.js +9 -17
  96. package/geometries/TextGeometry.mjs +23 -0
  97. package/helpers/LightProbeHelper.js +53 -21
  98. package/helpers/LightProbeHelper.mjs +72 -0
  99. package/helpers/PositionalAudioHelper.js +23 -30
  100. package/helpers/PositionalAudioHelper.mjs +68 -0
  101. package/helpers/RectAreaLightHelper.js +17 -33
  102. package/helpers/RectAreaLightHelper.mjs +44 -0
  103. package/helpers/VertexNormalsHelper.js +20 -41
  104. package/helpers/VertexNormalsHelper.mjs +54 -0
  105. package/helpers/VertexTangentsHelper.js +18 -36
  106. package/helpers/VertexTangentsHelper.mjs +45 -0
  107. package/index.js +968 -333
  108. package/index.mjs +968 -0
  109. package/interactive/SelectionBox.js +31 -46
  110. package/interactive/SelectionBox.mjs +137 -0
  111. package/interactive/SelectionHelper.js +16 -21
  112. package/interactive/SelectionHelper.mjs +54 -0
  113. package/libs/MeshoptDecoder.js +147 -58
  114. package/libs/MeshoptDecoder.mjs +210 -0
  115. package/libs/MotionControllers.js +66 -208
  116. package/libs/MotionControllers.mjs +261 -0
  117. package/lights/LightProbeGenerator.js +40 -96
  118. package/lights/LightProbeGenerator.mjs +145 -0
  119. package/lights/RectAreaLightUniformsLib.js +32842 -9
  120. package/lights/RectAreaLightUniformsLib.mjs +32842 -0
  121. package/lines/Line2.js +9 -12
  122. package/lines/Line2.mjs +13 -0
  123. package/lines/LineGeometry.js +7 -19
  124. package/lines/LineGeometry.mjs +44 -0
  125. package/lines/LineMaterial.js +51 -89
  126. package/lines/LineMaterial.mjs +539 -0
  127. package/lines/LineSegments2.js +56 -165
  128. package/lines/LineSegments2.mjs +202 -0
  129. package/lines/LineSegmentsGeometry.js +29 -71
  130. package/lines/LineSegmentsGeometry.mjs +124 -0
  131. package/lines/Wireframe.js +15 -29
  132. package/lines/Wireframe.mjs +31 -0
  133. package/lines/WireframeGeometry2.js +8 -9
  134. package/lines/WireframeGeometry2.mjs +13 -0
  135. package/loaders/3DMLoader.js +234 -469
  136. package/loaders/3DMLoader.mjs +802 -0
  137. package/loaders/3MFLoader.js +340 -555
  138. package/loaders/3MFLoader.mjs +837 -0
  139. package/loaders/AMFLoader.js +114 -219
  140. package/loaders/AMFLoader.mjs +284 -0
  141. package/loaders/AssimpLoader.js +328 -725
  142. package/loaders/AssimpLoader.mjs +1396 -0
  143. package/loaders/BVHLoader.js +94 -200
  144. package/loaders/BVHLoader.mjs +207 -0
  145. package/loaders/BasisTextureLoader.js +229 -357
  146. package/loaders/BasisTextureLoader.mjs +474 -0
  147. package/loaders/ColladaLoader.js +932 -1522
  148. package/loaders/ColladaLoader.mjs +2403 -0
  149. package/loaders/DDSLoader.js +42 -108
  150. package/loaders/DDSLoader.mjs +148 -0
  151. package/loaders/DRACOLoader.js +103 -210
  152. package/loaders/DRACOLoader.mjs +340 -0
  153. package/loaders/EXRLoader.js +461 -809
  154. package/loaders/EXRLoader.mjs +1351 -0
  155. package/loaders/FBXLoader.js +842 -1397
  156. package/loaders/FBXLoader.mjs +2362 -0
  157. package/loaders/FontLoader.js +33 -66
  158. package/loaders/FontLoader.mjs +111 -0
  159. package/loaders/GCodeLoader.js +63 -111
  160. package/loaders/GCodeLoader.mjs +141 -0
  161. package/loaders/GLTFLoader.js +771 -1484
  162. package/loaders/GLTFLoader.mjs +2316 -0
  163. package/loaders/HDRCubeTextureLoader.js +45 -50
  164. package/loaders/HDRCubeTextureLoader.mjs +77 -0
  165. package/loaders/KMZLoader.js +42 -55
  166. package/loaders/KMZLoader.mjs +75 -0
  167. package/loaders/KTX2Loader.js +229 -362
  168. package/loaders/KTX2Loader.mjs +427 -0
  169. package/loaders/KTXLoader.js +37 -99
  170. package/loaders/KTXLoader.mjs +87 -0
  171. package/loaders/LDrawLoader.js +313 -746
  172. package/loaders/LDrawLoader.mjs +1409 -0
  173. package/loaders/LUT3dlLoader.js +50 -62
  174. package/loaders/LUT3dlLoader.mjs +100 -0
  175. package/loaders/LUTCubeLoader.js +45 -56
  176. package/loaders/LUTCubeLoader.mjs +104 -0
  177. package/loaders/LWOLoader.js +227 -339
  178. package/loaders/LWOLoader.mjs +625 -0
  179. package/loaders/LottieLoader.js +36 -38
  180. package/loaders/LottieLoader.mjs +47 -0
  181. package/loaders/MD2Loader.js +248 -91
  182. package/loaders/MD2Loader.mjs +359 -0
  183. package/loaders/MDDLoader.js +25 -45
  184. package/loaders/MDDLoader.mjs +58 -0
  185. package/loaders/MMDLoader.js +359 -795
  186. package/loaders/MMDLoader.mjs +998 -0
  187. package/loaders/MTLLoader.js +91 -201
  188. package/loaders/MTLLoader.mjs +280 -0
  189. package/loaders/NRRDLoader.js +182 -263
  190. package/loaders/NRRDLoader.mjs +401 -0
  191. package/loaders/NodeMaterialLoader.js +121 -14
  192. package/loaders/NodeMaterialLoader.mjs +146 -0
  193. package/loaders/OBJLoader.js +161 -283
  194. package/loaders/OBJLoader.mjs +487 -0
  195. package/loaders/PCDLoader.js +145 -164
  196. package/loaders/PCDLoader.mjs +248 -0
  197. package/loaders/PDBLoader.js +45 -63
  198. package/loaders/PDBLoader.mjs +246 -0
  199. package/loaders/PLYLoader.js +106 -203
  200. package/loaders/PLYLoader.mjs +317 -0
  201. package/loaders/PRWMLoader.js +73 -110
  202. package/loaders/PRWMLoader.mjs +160 -0
  203. package/loaders/PVRLoader.js +32 -93
  204. package/loaders/PVRLoader.mjs +131 -0
  205. package/loaders/RGBELoader.js +96 -233
  206. package/loaders/RGBELoader.mjs +244 -0
  207. package/loaders/RGBMLoader.js +344 -514
  208. package/loaders/RGBMLoader.mjs +998 -0
  209. package/loaders/STLLoader.js +59 -165
  210. package/loaders/STLLoader.mjs +190 -0
  211. package/loaders/SVGLoader.js +481 -851
  212. package/loaders/SVGLoader.mjs +1709 -0
  213. package/loaders/TDSLoader.js +137 -527
  214. package/loaders/TDSLoader.mjs +480 -0
  215. package/loaders/TGALoader.js +94 -205
  216. package/loaders/TGALoader.mjs +285 -0
  217. package/loaders/TTFLoader.js +58 -79
  218. package/loaders/TTFLoader.mjs +131 -0
  219. package/loaders/TiltLoader.js +129 -167
  220. package/loaders/TiltLoader.mjs +373 -0
  221. package/loaders/VOXLoader.js +320 -84
  222. package/loaders/VOXLoader.mjs +431 -0
  223. package/loaders/VRMLLoader.js +786 -1268
  224. package/loaders/VRMLLoader.mjs +2093 -0
  225. package/loaders/VRMLoader.js +23 -31
  226. package/loaders/VRMLoader.mjs +38 -0
  227. package/loaders/VTKLoader.js +219 -407
  228. package/loaders/VTKLoader.mjs +646 -0
  229. package/loaders/XLoader.js +1083 -1259
  230. package/loaders/XLoader.mjs +1258 -0
  231. package/loaders/XYZLoader.js +28 -34
  232. package/loaders/XYZLoader.mjs +60 -0
  233. package/loaders/lwo/IFFParser.js +238 -492
  234. package/loaders/lwo/IFFParser.mjs +697 -0
  235. package/loaders/lwo/LWO2Parser.js +176 -279
  236. package/loaders/lwo/LWO2Parser.mjs +327 -0
  237. package/loaders/lwo/LWO3Parser.js +160 -247
  238. package/loaders/lwo/LWO3Parser.mjs +298 -0
  239. package/math/Capsule.js +56 -43
  240. package/math/Capsule.mjs +100 -0
  241. package/math/ColorConverter.js +18 -32
  242. package/math/ColorConverter.mjs +51 -0
  243. package/math/ConvexHull.js +97 -357
  244. package/math/ConvexHull.mjs +574 -0
  245. package/math/ImprovedNoise.js +282 -32
  246. package/math/ImprovedNoise.mjs +302 -0
  247. package/math/Lut.js +51 -35
  248. package/math/Lut.mjs +135 -0
  249. package/math/MeshSurfaceSampler.js +25 -68
  250. package/math/MeshSurfaceSampler.mjs +107 -0
  251. package/math/OBB.js +91 -152
  252. package/math/OBB.mjs +235 -0
  253. package/math/Octree.js +76 -139
  254. package/math/Octree.mjs +278 -0
  255. package/math/SimplexNoise.js +217 -238
  256. package/math/SimplexNoise.mjs +425 -0
  257. package/misc/ConvexObjectBreaker.js +79 -185
  258. package/misc/ConvexObjectBreaker.mjs +292 -0
  259. package/misc/GPUComputationRenderer.js +69 -194
  260. package/misc/GPUComputationRenderer.mjs +171 -0
  261. package/misc/Gyroscope.js +16 -22
  262. package/misc/Gyroscope.mjs +35 -0
  263. package/misc/MD2Character.js +52 -74
  264. package/misc/MD2Character.mjs +162 -0
  265. package/misc/MD2CharacterComplex.js +112 -163
  266. package/misc/MD2CharacterComplex.mjs +328 -0
  267. package/misc/MorphAnimMesh.js +20 -28
  268. package/misc/MorphAnimMesh.mjs +40 -0
  269. package/misc/MorphBlendMesh.js +45 -69
  270. package/misc/MorphBlendMesh.mjs +179 -0
  271. package/misc/ProgressiveLightmap.js +70 -187
  272. package/misc/ProgressiveLightmap.mjs +166 -0
  273. package/misc/RollerCoaster.js +106 -135
  274. package/misc/RollerCoaster.mjs +346 -0
  275. package/misc/TubePainter.js +74 -92
  276. package/misc/TubePainter.mjs +123 -0
  277. package/misc/Volume.js +108 -270
  278. package/misc/Volume.mjs +244 -0
  279. package/misc/VolumeSlice.js +34 -122
  280. package/misc/VolumeSlice.mjs +106 -0
  281. package/misc/WebGL.js +37 -34
  282. package/misc/WebGL.mjs +74 -0
  283. package/modifiers/CurveModifier.js +46 -151
  284. package/modifiers/CurveModifier.mjs +182 -0
  285. package/modifiers/EdgeSplitModifier.js +46 -90
  286. package/modifiers/EdgeSplitModifier.mjs +162 -0
  287. package/modifiers/SimplifyModifier.js +77 -202
  288. package/modifiers/SimplifyModifier.mjs +282 -0
  289. package/modifiers/TessellateModifier.js +65 -90
  290. package/modifiers/TessellateModifier.mjs +206 -0
  291. package/nodes/Nodes.js +274 -140
  292. package/nodes/Nodes.mjs +400 -0
  293. package/nodes/ShaderNode.js +296 -196
  294. package/nodes/ShaderNode.mjs +408 -0
  295. package/nodes/accessors/BufferNode.js +4 -8
  296. package/nodes/accessors/BufferNode.mjs +15 -0
  297. package/nodes/accessors/CameraNode.js +20 -25
  298. package/nodes/accessors/CameraNode.mjs +44 -0
  299. package/nodes/accessors/CubeTextureNode.js +14 -26
  300. package/nodes/accessors/CubeTextureNode.mjs +42 -0
  301. package/nodes/accessors/MaterialNode.js +43 -53
  302. package/nodes/accessors/MaterialNode.mjs +71 -0
  303. package/nodes/accessors/MaterialReferenceNode.js +3 -6
  304. package/nodes/accessors/MaterialReferenceNode.mjs +14 -0
  305. package/nodes/accessors/ModelNode.js +3 -5
  306. package/nodes/accessors/ModelNode.mjs +9 -0
  307. package/nodes/accessors/ModelViewProjectionNode.js +14 -13
  308. package/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
  309. package/nodes/accessors/NormalNode.js +40 -39
  310. package/nodes/accessors/NormalNode.mjs +62 -0
  311. package/nodes/accessors/Object3DNode.js +40 -50
  312. package/nodes/accessors/Object3DNode.mjs +76 -0
  313. package/nodes/accessors/PointUVNode.js +5 -9
  314. package/nodes/accessors/PointUVNode.mjs +13 -0
  315. package/nodes/accessors/PositionNode.js +42 -41
  316. package/nodes/accessors/PositionNode.mjs +65 -0
  317. package/nodes/accessors/ReferenceNode.js +10 -17
  318. package/nodes/accessors/ReferenceNode.mjs +37 -0
  319. package/nodes/accessors/ReflectNode.js +23 -26
  320. package/nodes/accessors/ReflectNode.mjs +43 -0
  321. package/nodes/accessors/SkinningNode.js +46 -48
  322. package/nodes/accessors/SkinningNode.mjs +58 -0
  323. package/nodes/accessors/TextureNode.js +14 -29
  324. package/nodes/accessors/TextureNode.mjs +54 -0
  325. package/nodes/accessors/UVNode.js +5 -11
  326. package/nodes/accessors/UVNode.mjs +23 -0
  327. package/nodes/core/ArrayUniformNode.js +3 -7
  328. package/nodes/core/ArrayUniformNode.mjs +14 -0
  329. package/nodes/core/AttributeNode.js +5 -12
  330. package/nodes/core/AttributeNode.mjs +30 -0
  331. package/nodes/core/BypassNode.js +5 -12
  332. package/nodes/core/BypassNode.mjs +22 -0
  333. package/nodes/core/CodeNode.js +4 -12
  334. package/nodes/core/CodeNode.mjs +28 -0
  335. package/nodes/core/ConstNode.js +3 -7
  336. package/nodes/core/ConstNode.mjs +14 -0
  337. package/nodes/core/ContextNode.js +3 -8
  338. package/nodes/core/ContextNode.mjs +22 -0
  339. package/nodes/core/ExpressionNode.js +5 -9
  340. package/nodes/core/ExpressionNode.mjs +19 -0
  341. package/nodes/core/FunctionCallNode.js +6 -15
  342. package/nodes/core/FunctionCallNode.mjs +37 -0
  343. package/nodes/core/FunctionNode.js +10 -25
  344. package/nodes/core/FunctionNode.mjs +56 -0
  345. package/nodes/core/InputNode.js +12 -23
  346. package/nodes/core/InputNode.mjs +38 -0
  347. package/nodes/core/Node.js +35 -75
  348. package/nodes/core/Node.mjs +139 -0
  349. package/nodes/core/NodeAttribute.js +2 -4
  350. package/nodes/core/NodeAttribute.mjs +10 -0
  351. package/nodes/core/NodeBuilder.js +110 -224
  352. package/nodes/core/NodeBuilder.mjs +395 -0
  353. package/nodes/core/NodeCode.js +4 -7
  354. package/nodes/core/NodeCode.mjs +11 -0
  355. package/nodes/core/NodeFrame.js +9 -12
  356. package/nodes/core/NodeFrame.mjs +35 -0
  357. package/nodes/core/NodeFunctionInput.js +3 -5
  358. package/nodes/core/NodeFunctionInput.mjs +13 -0
  359. package/nodes/core/NodeKeywords.js +5 -16
  360. package/nodes/core/NodeKeywords.mjs +44 -0
  361. package/nodes/core/NodeUniform.js +3 -7
  362. package/nodes/core/NodeUniform.mjs +18 -0
  363. package/nodes/core/NodeUtils.js +39 -43
  364. package/nodes/core/NodeUtils.mjs +57 -0
  365. package/nodes/core/NodeVar.js +2 -4
  366. package/nodes/core/NodeVar.mjs +10 -0
  367. package/nodes/core/NodeVary.js +2 -4
  368. package/nodes/core/NodeVary.mjs +10 -0
  369. package/nodes/core/PropertyNode.js +4 -10
  370. package/nodes/core/PropertyNode.mjs +21 -0
  371. package/nodes/core/TempNode.js +5 -11
  372. package/nodes/core/TempNode.mjs +25 -0
  373. package/nodes/core/UniformNode.js +4 -10
  374. package/nodes/core/UniformNode.mjs +23 -0
  375. package/nodes/core/VarNode.js +3 -11
  376. package/nodes/core/VarNode.mjs +31 -0
  377. package/nodes/core/VaryNode.js +6 -15
  378. package/nodes/core/VaryNode.mjs +30 -0
  379. package/nodes/core/constants.js +20 -7
  380. package/nodes/core/constants.mjs +24 -0
  381. package/nodes/display/ColorSpaceNode.js +34 -38
  382. package/nodes/display/ColorSpaceNode.mjs +63 -0
  383. package/nodes/display/NormalMapNode.js +35 -53
  384. package/nodes/display/NormalMapNode.mjs +54 -0
  385. package/nodes/fog/FogNode.js +5 -9
  386. package/nodes/fog/FogNode.mjs +15 -0
  387. package/nodes/fog/FogRangeNode.js +5 -9
  388. package/nodes/fog/FogRangeNode.mjs +17 -0
  389. package/nodes/functions/BSDFs.js +61 -118
  390. package/nodes/functions/BSDFs.mjs +64 -0
  391. package/nodes/lights/LightContextNode.js +14 -23
  392. package/nodes/lights/LightContextNode.mjs +35 -0
  393. package/nodes/lights/LightNode.js +27 -31
  394. package/nodes/lights/LightNode.mjs +58 -0
  395. package/nodes/lights/LightsNode.js +9 -28
  396. package/nodes/lights/LightsNode.mjs +59 -0
  397. package/nodes/loaders/NodeLoader.js +27 -42
  398. package/nodes/loaders/NodeLoader.mjs +66 -0
  399. package/nodes/loaders/NodeMaterialLoader.js +4 -10
  400. package/nodes/loaders/NodeMaterialLoader.mjs +24 -0
  401. package/nodes/loaders/NodeObjectLoader.js +9 -19
  402. package/nodes/loaders/NodeObjectLoader.mjs +40 -0
  403. package/nodes/materials/LineBasicNodeMaterial.js +5 -10
  404. package/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
  405. package/nodes/materials/Materials.js +14 -17
  406. package/nodes/materials/Materials.mjs +28 -0
  407. package/nodes/materials/MeshBasicNodeMaterial.js +5 -10
  408. package/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
  409. package/nodes/materials/MeshStandardNodeMaterial.js +5 -8
  410. package/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
  411. package/nodes/materials/NodeMaterial.js +20 -36
  412. package/nodes/materials/NodeMaterial.mjs +64 -0
  413. package/nodes/materials/PointsNodeMaterial.js +5 -10
  414. package/nodes/materials/PointsNodeMaterial.mjs +30 -0
  415. package/nodes/math/CondNode.js +11 -23
  416. package/nodes/math/CondNode.mjs +38 -0
  417. package/nodes/math/MathNode.js +98 -142
  418. package/nodes/math/MathNode.mjs +163 -0
  419. package/nodes/math/OperatorNode.js +24 -46
  420. package/nodes/math/OperatorNode.mjs +103 -0
  421. package/nodes/procedural/CheckerNode.js +13 -19
  422. package/nodes/procedural/CheckerNode.mjs +21 -0
  423. package/nodes/utils/ArrayElementNode.js +4 -8
  424. package/nodes/utils/ArrayElementNode.mjs +19 -0
  425. package/nodes/utils/ConvertNode.js +3 -8
  426. package/nodes/utils/ConvertNode.mjs +25 -0
  427. package/nodes/utils/JoinNode.js +7 -11
  428. package/nodes/utils/JoinNode.mjs +26 -0
  429. package/nodes/utils/MatcapUVNode.js +8 -11
  430. package/nodes/utils/MatcapUVNode.mjs +16 -0
  431. package/nodes/utils/OscNode.js +27 -33
  432. package/nodes/utils/OscNode.mjs +50 -0
  433. package/nodes/utils/SplitNode.js +6 -20
  434. package/nodes/utils/SplitNode.mjs +45 -0
  435. package/nodes/utils/SpriteSheetUVNode.js +23 -23
  436. package/nodes/utils/SpriteSheetUVNode.mjs +40 -0
  437. package/nodes/utils/TimerNode.js +20 -24
  438. package/nodes/utils/TimerNode.mjs +44 -0
  439. package/objects/GroundProjectedEnv.js +22 -37
  440. package/objects/GroundProjectedEnv.mjs +130 -0
  441. package/objects/Lensflare.js +86 -156
  442. package/objects/Lensflare.mjs +262 -0
  443. package/objects/LightningStorm.js +38 -102
  444. package/objects/LightningStorm.mjs +110 -0
  445. package/objects/MarchingCubes.js +150 -303
  446. package/objects/MarchingCubes.mjs +457 -0
  447. package/objects/Reflector.js +50 -72
  448. package/objects/Reflector.mjs +166 -0
  449. package/objects/ReflectorForSSRPass.js +80 -131
  450. package/objects/ReflectorForSSRPass.mjs +247 -0
  451. package/objects/ReflectorRTT.js +6 -7
  452. package/objects/ReflectorRTT.mjs +10 -0
  453. package/objects/Refractor.js +64 -106
  454. package/objects/Refractor.mjs +178 -0
  455. package/objects/ShadowMesh.js +8 -17
  456. package/objects/ShadowMesh.mjs +41 -0
  457. package/objects/Sky.js +119 -80
  458. package/objects/Sky.mjs +124 -0
  459. package/objects/Water.js +83 -127
  460. package/objects/Water.mjs +235 -0
  461. package/objects/Water2.js +72 -108
  462. package/objects/Water2.mjs +252 -0
  463. package/offscreen/jank.js +10 -14
  464. package/offscreen/jank.mjs +27 -0
  465. package/offscreen/offscreen.js +4 -5
  466. package/offscreen/offscreen.mjs +5 -0
  467. package/offscreen/scene.js +45 -48
  468. package/offscreen/scene.mjs +52 -0
  469. package/package.json +3 -3
  470. package/physics/AmmoPhysics.js +30 -71
  471. package/physics/AmmoPhysics.mjs +165 -0
  472. package/postprocessing/AdaptiveToneMappingPass.js +97 -123
  473. package/postprocessing/AdaptiveToneMappingPass.mjs +221 -0
  474. package/postprocessing/AfterimagePass.js +28 -49
  475. package/postprocessing/AfterimagePass.mjs +55 -0
  476. package/postprocessing/BloomPass.js +43 -69
  477. package/postprocessing/BloomPass.mjs +90 -0
  478. package/postprocessing/BokehPass.js +39 -69
  479. package/postprocessing/BokehPass.mjs +76 -0
  480. package/postprocessing/ClearPass.js +10 -25
  481. package/postprocessing/ClearPass.mjs +27 -0
  482. package/postprocessing/CubeTexturePass.js +28 -27
  483. package/postprocessing/CubeTexturePass.mjs +49 -0
  484. package/postprocessing/DotScreenPass.js +24 -32
  485. package/postprocessing/DotScreenPass.mjs +40 -0
  486. package/postprocessing/EffectComposer.js +39 -86
  487. package/postprocessing/EffectComposer.mjs +139 -0
  488. package/postprocessing/FilmPass.js +25 -30
  489. package/postprocessing/FilmPass.mjs +42 -0
  490. package/postprocessing/GlitchPass.js +38 -61
  491. package/postprocessing/GlitchPass.mjs +75 -0
  492. package/postprocessing/HalftonePass.js +19 -39
  493. package/postprocessing/HalftonePass.mjs +44 -0
  494. package/postprocessing/LUTPass.js +13 -38
  495. package/postprocessing/LUTPass.mjs +136 -0
  496. package/postprocessing/MaskPass.js +19 -38
  497. package/postprocessing/MaskPass.mjs +60 -0
  498. package/postprocessing/OutlinePass.js +135 -277
  499. package/postprocessing/OutlinePass.mjs +438 -0
  500. package/postprocessing/Pass.js +20 -44
  501. package/postprocessing/Pass.mjs +37 -0
  502. package/postprocessing/RenderPass.js +13 -36
  503. package/postprocessing/RenderPass.mjs +48 -0
  504. package/postprocessing/RenderPixelatedPass.js +44 -58
  505. package/postprocessing/RenderPixelatedPass.mjs +199 -0
  506. package/postprocessing/SAOPass.js +154 -189
  507. package/postprocessing/SAOPass.mjs +282 -0
  508. package/postprocessing/SMAAPass.js +64 -84
  509. package/postprocessing/SMAAPass.mjs +112 -0
  510. package/postprocessing/SSAARenderPass.js +121 -69
  511. package/postprocessing/SSAARenderPass.mjs +170 -0
  512. package/postprocessing/SSAOPass.js +123 -172
  513. package/postprocessing/SSAOPass.mjs +265 -0
  514. package/postprocessing/SSRPass.js +211 -280
  515. package/postprocessing/SSRPass.mjs +432 -0
  516. package/postprocessing/SavePass.js +20 -25
  517. package/postprocessing/SavePass.mjs +37 -0
  518. package/postprocessing/ShaderPass.js +14 -30
  519. package/postprocessing/ShaderPass.mjs +39 -0
  520. package/postprocessing/TAARenderPass.js +42 -61
  521. package/postprocessing/TAARenderPass.mjs +88 -0
  522. package/postprocessing/TexturePass.js +21 -22
  523. package/postprocessing/TexturePass.mjs +39 -0
  524. package/postprocessing/UnrealBloomPass.js +105 -213
  525. package/postprocessing/UnrealBloomPass.mjs +220 -0
  526. package/renderers/CSS2DRenderer.js +44 -56
  527. package/renderers/CSS2DRenderer.mjs +112 -0
  528. package/renderers/CSS3DRenderer.js +53 -86
  529. package/renderers/CSS3DRenderer.mjs +133 -0
  530. package/renderers/Projector.js +107 -274
  531. package/renderers/Projector.mjs +511 -0
  532. package/renderers/SVGRenderer.js +72 -182
  533. package/renderers/SVGRenderer.mjs +306 -0
  534. package/renderers/nodes/accessors/CameraNode.js +29 -40
  535. package/renderers/nodes/accessors/CameraNode.mjs +63 -0
  536. package/renderers/nodes/accessors/ModelNode.js +28 -37
  537. package/renderers/nodes/accessors/ModelNode.mjs +61 -0
  538. package/renderers/nodes/accessors/ModelViewProjectionNode.js +10 -23
  539. package/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
  540. package/renderers/nodes/accessors/NormalNode.js +35 -45
  541. package/renderers/nodes/accessors/NormalNode.mjs +61 -0
  542. package/renderers/nodes/accessors/PositionNode.js +18 -19
  543. package/renderers/nodes/accessors/PositionNode.mjs +30 -0
  544. package/renderers/nodes/accessors/UVNode.js +5 -10
  545. package/renderers/nodes/accessors/UVNode.mjs +13 -0
  546. package/renderers/nodes/core/AttributeNode.js +5 -14
  547. package/renderers/nodes/core/AttributeNode.mjs +35 -0
  548. package/renderers/nodes/core/InputNode.js +4 -14
  549. package/renderers/nodes/core/InputNode.mjs +31 -0
  550. package/renderers/nodes/core/Node.js +7 -17
  551. package/renderers/nodes/core/Node.mjs +34 -0
  552. package/renderers/nodes/core/NodeAttribute.js +3 -6
  553. package/renderers/nodes/core/NodeAttribute.mjs +10 -0
  554. package/renderers/nodes/core/NodeBuilder.js +87 -154
  555. package/renderers/nodes/core/NodeBuilder.mjs +243 -0
  556. package/renderers/nodes/core/NodeFrame.js +9 -12
  557. package/renderers/nodes/core/NodeFrame.mjs +35 -0
  558. package/renderers/nodes/core/NodeSlot.js +2 -3
  559. package/renderers/nodes/core/NodeSlot.mjs +10 -0
  560. package/renderers/nodes/core/NodeUniform.js +4 -9
  561. package/renderers/nodes/core/NodeUniform.mjs +18 -0
  562. package/renderers/nodes/core/NodeVary.js +4 -7
  563. package/renderers/nodes/core/NodeVary.mjs +11 -0
  564. package/renderers/nodes/core/VaryNode.js +6 -12
  565. package/renderers/nodes/core/VaryNode.mjs +22 -0
  566. package/renderers/nodes/core/constants.js +16 -13
  567. package/renderers/nodes/core/constants.mjs +22 -0
  568. package/renderers/nodes/inputs/ColorNode.js +5 -11
  569. package/renderers/nodes/inputs/ColorNode.mjs +11 -0
  570. package/renderers/nodes/inputs/FloatNode.js +5 -11
  571. package/renderers/nodes/inputs/FloatNode.mjs +11 -0
  572. package/renderers/nodes/inputs/Matrix3Node.js +7 -13
  573. package/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
  574. package/renderers/nodes/inputs/Matrix4Node.js +7 -13
  575. package/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
  576. package/renderers/nodes/inputs/TextureNode.js +7 -15
  577. package/renderers/nodes/inputs/TextureNode.mjs +20 -0
  578. package/renderers/nodes/inputs/Vector2Node.js +5 -11
  579. package/renderers/nodes/inputs/Vector2Node.mjs +11 -0
  580. package/renderers/nodes/inputs/Vector3Node.js +7 -13
  581. package/renderers/nodes/inputs/Vector3Node.mjs +12 -0
  582. package/renderers/nodes/inputs/Vector4Node.js +7 -13
  583. package/renderers/nodes/inputs/Vector4Node.mjs +12 -0
  584. package/renderers/nodes/math/MathNode.js +20 -30
  585. package/renderers/nodes/math/MathNode.mjs +55 -0
  586. package/renderers/nodes/math/OperatorNode.js +4 -20
  587. package/renderers/nodes/math/OperatorNode.mjs +42 -0
  588. package/renderers/nodes/utils/SwitchNode.js +4 -9
  589. package/renderers/nodes/utils/SwitchNode.mjs +20 -0
  590. package/renderers/nodes/utils/TimerNode.js +5 -10
  591. package/renderers/nodes/utils/TimerNode.mjs +14 -0
  592. package/renderers/webgpu/WebGPU.js +14 -16
  593. package/renderers/webgpu/WebGPU.mjs +24 -0
  594. package/renderers/webgpu/WebGPUAttributes.js +16 -23
  595. package/renderers/webgpu/WebGPUAttributes.mjs +69 -0
  596. package/renderers/webgpu/WebGPUBackground.js +13 -30
  597. package/renderers/webgpu/WebGPUBackground.mjs +61 -0
  598. package/renderers/webgpu/WebGPUBinding.js +4 -7
  599. package/renderers/webgpu/WebGPUBinding.mjs +14 -0
  600. package/renderers/webgpu/WebGPUBindings.js +21 -57
  601. package/renderers/webgpu/WebGPUBindings.mjs +155 -0
  602. package/renderers/webgpu/WebGPUComputePipelines.js +14 -25
  603. package/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
  604. package/renderers/webgpu/WebGPUGeometries.js +5 -15
  605. package/renderers/webgpu/WebGPUGeometries.mjs +41 -0
  606. package/renderers/webgpu/WebGPUInfo.js +3 -8
  607. package/renderers/webgpu/WebGPUInfo.mjs +46 -0
  608. package/renderers/webgpu/WebGPUObjects.js +5 -10
  609. package/renderers/webgpu/WebGPUObjects.mjs +25 -0
  610. package/renderers/webgpu/WebGPUProperties.js +5 -11
  611. package/renderers/webgpu/WebGPUProperties.mjs +22 -0
  612. package/renderers/webgpu/WebGPURenderLists.js +20 -36
  613. package/renderers/webgpu/WebGPURenderLists.mjs +119 -0
  614. package/renderers/webgpu/WebGPURenderPipelines.js +260 -387
  615. package/renderers/webgpu/WebGPURenderPipelines.mjs +545 -0
  616. package/renderers/webgpu/WebGPURenderer.js +124 -262
  617. package/renderers/webgpu/WebGPURenderer.mjs +574 -0
  618. package/renderers/webgpu/WebGPUSampledTexture.js +18 -31
  619. package/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
  620. package/renderers/webgpu/WebGPUSampler.js +7 -12
  621. package/renderers/webgpu/WebGPUSampler.mjs +15 -0
  622. package/renderers/webgpu/WebGPUStorageBuffer.js +7 -12
  623. package/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
  624. package/renderers/webgpu/WebGPUTextureRenderer.js +5 -11
  625. package/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
  626. package/renderers/webgpu/WebGPUTextureUtils.js +29 -40
  627. package/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
  628. package/renderers/webgpu/WebGPUTextures.js +186 -333
  629. package/renderers/webgpu/WebGPUTextures.mjs +484 -0
  630. package/renderers/webgpu/WebGPUUniform.js +25 -51
  631. package/renderers/webgpu/WebGPUUniform.mjs +81 -0
  632. package/renderers/webgpu/WebGPUUniformsGroup.js +32 -72
  633. package/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
  634. package/renderers/webgpu/constants.js +190 -181
  635. package/renderers/webgpu/constants.mjs +230 -0
  636. package/renderers/webgpu/nodes/ShaderLib.js +2 -2
  637. package/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
  638. package/renderers/webgpu/nodes/WebGPUNodeBuilder.js +53 -124
  639. package/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
  640. package/renderers/webgpu/nodes/WebGPUNodeUniform.js +17 -31
  641. package/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
  642. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +8 -9
  643. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
  644. package/renderers/webgpu/nodes/WebGPUNodes.js +7 -45
  645. package/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
  646. package/shaders/ACESFilmicToneMappingShader.js +44 -24
  647. package/shaders/ACESFilmicToneMappingShader.mjs +48 -0
  648. package/shaders/AfterimageShader.js +28 -18
  649. package/shaders/AfterimageShader.mjs +32 -0
  650. package/shaders/BasicShader.js +9 -7
  651. package/shaders/BasicShader.mjs +12 -0
  652. package/shaders/BleachBypassShader.js +31 -15
  653. package/shaders/BleachBypassShader.mjs +35 -0
  654. package/shaders/BlendShader.js +26 -19
  655. package/shaders/BlendShader.mjs +30 -0
  656. package/shaders/BokehShader.js +98 -36
  657. package/shaders/BokehShader.mjs +106 -0
  658. package/shaders/BokehShader2.js +261 -90
  659. package/shaders/BokehShader2.mjs +269 -0
  660. package/shaders/BrightnessContrastShader.js +28 -19
  661. package/shaders/BrightnessContrastShader.mjs +32 -0
  662. package/shaders/ColorCorrectionShader.js +26 -22
  663. package/shaders/ColorCorrectionShader.mjs +30 -0
  664. package/shaders/ColorifyShader.js +24 -16
  665. package/shaders/ColorifyShader.mjs +28 -0
  666. package/shaders/ConvolutionShader.js +40 -36
  667. package/shaders/ConvolutionShader.mjs +55 -0
  668. package/shaders/CopyShader.js +21 -13
  669. package/shaders/CopyShader.mjs +25 -0
  670. package/shaders/DOFMipMapShader.js +28 -21
  671. package/shaders/DOFMipMapShader.mjs +32 -0
  672. package/shaders/DepthLimitedBlurShader.js +85 -40
  673. package/shaders/DepthLimitedBlurShader.mjs +114 -0
  674. package/shaders/DigitalGlitch.js +74 -46
  675. package/shaders/DigitalGlitch.mjs +78 -0
  676. package/shaders/DotScreenShader.js +35 -27
  677. package/shaders/DotScreenShader.mjs +39 -0
  678. package/shaders/FXAAShader.js +1094 -19
  679. package/shaders/FXAAShader.mjs +1098 -0
  680. package/shaders/FilmShader.js +38 -52
  681. package/shaders/FilmShader.mjs +42 -0
  682. package/shaders/FocusShader.js +51 -24
  683. package/shaders/FocusShader.mjs +55 -0
  684. package/shaders/FreiChenShader.js +57 -24
  685. package/shaders/FreiChenShader.mjs +61 -0
  686. package/shaders/FresnelShader.js +43 -22
  687. package/shaders/FresnelShader.mjs +47 -0
  688. package/shaders/GammaCorrectionShader.js +19 -11
  689. package/shaders/GammaCorrectionShader.mjs +23 -0
  690. package/shaders/GodRaysShader.js +103 -94
  691. package/shaders/GodRaysShader.mjs +146 -0
  692. package/shaders/HalftoneShader.js +208 -65
  693. package/shaders/HalftoneShader.mjs +212 -0
  694. package/shaders/HorizontalBlurShader.js +7 -23
  695. package/shaders/HorizontalBlurShader.mjs +43 -0
  696. package/shaders/HorizontalTiltShiftShader.js +33 -21
  697. package/shaders/HorizontalTiltShiftShader.mjs +37 -0
  698. package/shaders/HueSaturationShader.js +37 -21
  699. package/shaders/HueSaturationShader.mjs +41 -0
  700. package/shaders/KaleidoShader.js +30 -22
  701. package/shaders/KaleidoShader.mjs +34 -0
  702. package/shaders/LuminosityHighPassShader.js +33 -27
  703. package/shaders/LuminosityHighPassShader.mjs +37 -0
  704. package/shaders/LuminosityShader.js +21 -11
  705. package/shaders/LuminosityShader.mjs +25 -0
  706. package/shaders/MirrorShader.js +31 -16
  707. package/shaders/MirrorShader.mjs +35 -0
  708. package/shaders/NormalMapShader.js +27 -23
  709. package/shaders/NormalMapShader.mjs +31 -0
  710. package/shaders/ParallaxShader.js +107 -48
  711. package/shaders/ParallaxShader.mjs +113 -0
  712. package/shaders/PixelShader.js +24 -16
  713. package/shaders/PixelShader.mjs +28 -0
  714. package/shaders/RGBShiftShader.js +26 -22
  715. package/shaders/RGBShiftShader.mjs +30 -0
  716. package/shaders/SAOShader.js +132 -48
  717. package/shaders/SAOShader.mjs +144 -0
  718. package/shaders/SMAAShader.js +256 -135
  719. package/shaders/SMAAShader.mjs +272 -0
  720. package/shaders/SSAOShader.js +153 -81
  721. package/shaders/SSAOShader.mjs +172 -0
  722. package/shaders/SSRShader.js +32 -87
  723. package/shaders/SSRShader.mjs +324 -0
  724. package/shaders/SepiaShader.js +25 -15
  725. package/shaders/SepiaShader.mjs +29 -0
  726. package/shaders/SobelOperatorShader.js +40 -29
  727. package/shaders/SobelOperatorShader.mjs +44 -0
  728. package/shaders/SubsurfaceScatteringShader.js +53 -39
  729. package/shaders/SubsurfaceScatteringShader.mjs +59 -0
  730. package/shaders/TechnicolorShader.js +20 -13
  731. package/shaders/TechnicolorShader.mjs +24 -0
  732. package/shaders/ToneMapShader.js +44 -28
  733. package/shaders/ToneMapShader.mjs +48 -0
  734. package/shaders/ToonShader.js +172 -96
  735. package/shaders/ToonShader.mjs +188 -0
  736. package/shaders/TriangleBlurShader.js +32 -23
  737. package/shaders/TriangleBlurShader.mjs +36 -0
  738. package/shaders/UnpackDepthRGBAShader.js +22 -14
  739. package/shaders/UnpackDepthRGBAShader.mjs +26 -0
  740. package/shaders/VerticalBlurShader.js +7 -23
  741. package/shaders/VerticalBlurShader.mjs +44 -0
  742. package/shaders/VerticalTiltShiftShader.js +33 -21
  743. package/shaders/VerticalTiltShiftShader.mjs +37 -0
  744. package/shaders/VignetteShader.js +24 -28
  745. package/shaders/VignetteShader.mjs +28 -0
  746. package/shaders/VolumeShader.js +174 -77
  747. package/shaders/VolumeShader.mjs +178 -0
  748. package/shaders/WaterRefractionShader.js +38 -6
  749. package/shaders/WaterRefractionShader.mjs +57 -0
  750. package/shaders/types.js +1 -1
  751. package/{custom.d.js → shaders/types.mjs} +0 -0
  752. package/textures/FlakesTexture.js +8 -10
  753. package/textures/FlakesTexture.mjs +30 -0
  754. package/types/helpers.js +3 -2
  755. package/types/helpers.mjs +4 -0
  756. package/utils/BufferGeometryUtils.js +251 -325
  757. package/utils/BufferGeometryUtils.mjs +570 -0
  758. package/utils/GeometryCompressionUtils.js +241 -239
  759. package/utils/GeometryCompressionUtils.mjs +547 -0
  760. package/utils/GeometryUtils.js +41 -94
  761. package/utils/GeometryUtils.mjs +108 -0
  762. package/utils/RoughnessMipmapper.js +38 -82
  763. package/utils/RoughnessMipmapper.mjs +213 -0
  764. package/utils/SceneUtils.js +15 -20
  765. package/utils/SceneUtils.mjs +36 -0
  766. package/utils/ShadowMapViewer.js +49 -95
  767. package/utils/ShadowMapViewer.mjs +114 -0
  768. package/utils/SkeletonUtils.js +74 -165
  769. package/utils/SkeletonUtils.mjs +292 -0
  770. package/utils/UVsDebug.js +32 -62
  771. package/utils/UVsDebug.mjs +85 -0
  772. package/utils/WorkerPool.js +13 -33
  773. package/utils/WorkerPool.mjs +62 -0
  774. package/webxr/ARButton.js +72 -98
  775. package/webxr/ARButton.mjs +119 -0
  776. package/webxr/OculusHandModel.js +18 -37
  777. package/webxr/OculusHandModel.mjs +71 -0
  778. package/webxr/OculusHandPointerModel.js +58 -80
  779. package/webxr/OculusHandPointerModel.mjs +207 -0
  780. package/webxr/Text2D.js +37 -19
  781. package/webxr/Text2D.mjs +31 -0
  782. package/webxr/VRButton.js +59 -90
  783. package/webxr/VRButton.mjs +105 -0
  784. package/webxr/XRControllerModelFactory.js +58 -116
  785. package/webxr/XRControllerModelFactory.mjs +146 -0
  786. package/webxr/XREstimatedLight.js +39 -66
  787. package/webxr/XREstimatedLight.mjs +126 -0
  788. package/webxr/XRHandMeshModel.js +40 -29
  789. package/webxr/XRHandMeshModel.mjs +73 -0
  790. package/webxr/XRHandModelFactory.js +28 -31
  791. package/webxr/XRHandModelFactory.mjs +61 -0
  792. package/webxr/XRHandPrimitiveModel.js +41 -27
  793. package/webxr/XRHandPrimitiveModel.mjs +68 -0
  794. package/BufferGeometryUtils-1a7a235c.js +0 -655
  795. package/BufferGeometryUtils-971dfde3.js +0 -1
  796. package/Nodes-4f766d71.js +0 -471
  797. package/Nodes-9aa16d74.js +0 -1
  798. package/animation/AnimationClipCreator.cjs.js +0 -1
  799. package/animation/CCDIKSolver.cjs.js +0 -1
  800. package/animation/MMDAnimationHelper.cjs.js +0 -1
  801. package/animation/MMDPhysics.cjs.js +0 -1
  802. package/cameras/CinematicCamera.cjs.js +0 -1
  803. package/controls/ArcballControls.cjs.js +0 -1
  804. package/controls/DeviceOrientationControls.cjs.js +0 -1
  805. package/controls/DragControls.cjs.js +0 -1
  806. package/controls/FirstPersonControls.cjs.js +0 -1
  807. package/controls/FlyControls.cjs.js +0 -1
  808. package/controls/OrbitControls.cjs.js +0 -1
  809. package/controls/PointerLockControls.cjs.js +0 -1
  810. package/controls/TrackballControls.cjs.js +0 -1
  811. package/controls/TransformControls.cjs.js +0 -1
  812. package/controls/experimental/CameraControls.cjs.js +0 -1
  813. package/csm/CSM.cjs.js +0 -1
  814. package/csm/CSMFrustum.cjs.js +0 -1
  815. package/csm/CSMHelper.cjs.js +0 -1
  816. package/csm/CSMShader.cjs.js +0 -1
  817. package/curves/CurveExtras.cjs.js +0 -1
  818. package/curves/NURBSCurve.cjs.js +0 -1
  819. package/curves/NURBSSurface.cjs.js +0 -1
  820. package/curves/NURBSUtils.cjs.js +0 -1
  821. package/custom.d.cjs.js +0 -1
  822. package/deprecated/Geometry.cjs.js +0 -1
  823. package/effects/AnaglyphEffect.cjs.js +0 -1
  824. package/effects/AsciiEffect.cjs.js +0 -1
  825. package/effects/OutlineEffect.cjs.js +0 -1
  826. package/effects/ParallaxBarrierEffect.cjs.js +0 -1
  827. package/effects/PeppersGhostEffect.cjs.js +0 -1
  828. package/effects/StereoEffect.cjs.js +0 -1
  829. package/environments/RoomEnvironment.cjs.js +0 -1
  830. package/exporters/ColladaExporter.cjs.js +0 -1
  831. package/exporters/DRACOExporter.cjs.js +0 -1
  832. package/exporters/GLTFExporter.cjs.js +0 -1
  833. package/exporters/MMDExporter.cjs.js +0 -1
  834. package/exporters/OBJExporter.cjs.js +0 -1
  835. package/exporters/PLYExporter.cjs.js +0 -1
  836. package/exporters/STLExporter.cjs.js +0 -1
  837. package/exporters/USDZExporter.cjs.js +0 -1
  838. package/geometries/BoxLineGeometry.cjs.js +0 -1
  839. package/geometries/ConvexGeometry.cjs.js +0 -1
  840. package/geometries/DecalGeometry.cjs.js +0 -1
  841. package/geometries/LightningStrike.cjs.js +0 -1
  842. package/geometries/ParametricGeometries.cjs.js +0 -1
  843. package/geometries/ParametricGeometry.cjs.js +0 -1
  844. package/geometries/RoundedBoxGeometry.cjs.js +0 -1
  845. package/geometries/TeapotGeometry.cjs.js +0 -1
  846. package/geometries/TextGeometry.cjs.js +0 -1
  847. package/helpers/LightProbeHelper.cjs.js +0 -1
  848. package/helpers/PositionalAudioHelper.cjs.js +0 -1
  849. package/helpers/RectAreaLightHelper.cjs.js +0 -1
  850. package/helpers/VertexNormalsHelper.cjs.js +0 -1
  851. package/helpers/VertexTangentsHelper.cjs.js +0 -1
  852. package/index.cjs.js +0 -1
  853. package/interactive/InteractiveGroup.cjs.js +0 -1
  854. package/interactive/InteractiveGroup.d.ts +0 -5
  855. package/interactive/InteractiveGroup.js +0 -87
  856. package/interactive/SelectionBox.cjs.js +0 -1
  857. package/interactive/SelectionHelper.cjs.js +0 -1
  858. package/libs/MeshoptDecoder.cjs.js +0 -1
  859. package/libs/MotionControllers.cjs.js +0 -1
  860. package/lights/LightProbeGenerator.cjs.js +0 -1
  861. package/lights/RectAreaLightUniformsLib.cjs.js +0 -1
  862. package/lines/Line2.cjs.js +0 -1
  863. package/lines/LineGeometry.cjs.js +0 -1
  864. package/lines/LineMaterial.cjs.js +0 -1
  865. package/lines/LineSegments2.cjs.js +0 -1
  866. package/lines/LineSegmentsGeometry.cjs.js +0 -1
  867. package/lines/Wireframe.cjs.js +0 -1
  868. package/lines/WireframeGeometry2.cjs.js +0 -1
  869. package/loaders/3DMLoader.cjs.js +0 -1
  870. package/loaders/3MFLoader.cjs.js +0 -1
  871. package/loaders/AMFLoader.cjs.js +0 -1
  872. package/loaders/AssimpLoader.cjs.js +0 -1
  873. package/loaders/BVHLoader.cjs.js +0 -1
  874. package/loaders/BasisTextureLoader.cjs.js +0 -1
  875. package/loaders/ColladaLoader.cjs.js +0 -1
  876. package/loaders/DDSLoader.cjs.js +0 -1
  877. package/loaders/DRACOLoader.cjs.js +0 -1
  878. package/loaders/EXRLoader.cjs.js +0 -1
  879. package/loaders/FBXLoader.cjs.js +0 -1
  880. package/loaders/FontLoader.cjs.js +0 -1
  881. package/loaders/GCodeLoader.cjs.js +0 -1
  882. package/loaders/GLTFLoader.cjs.js +0 -1
  883. package/loaders/HDRCubeTextureLoader.cjs.js +0 -1
  884. package/loaders/KMZLoader.cjs.js +0 -1
  885. package/loaders/KTX2Loader.cjs.js +0 -1
  886. package/loaders/KTXLoader.cjs.js +0 -1
  887. package/loaders/LDrawLoader.cjs.js +0 -1
  888. package/loaders/LUT3dlLoader.cjs.js +0 -1
  889. package/loaders/LUTCubeLoader.cjs.js +0 -1
  890. package/loaders/LWOLoader.cjs.js +0 -1
  891. package/loaders/LottieLoader.cjs.js +0 -1
  892. package/loaders/MD2Loader.cjs.js +0 -1
  893. package/loaders/MDDLoader.cjs.js +0 -1
  894. package/loaders/MMDLoader.cjs.js +0 -1
  895. package/loaders/MTLLoader.cjs.js +0 -1
  896. package/loaders/NRRDLoader.cjs.js +0 -1
  897. package/loaders/NodeMaterialLoader.cjs.js +0 -1
  898. package/loaders/OBJLoader.cjs.js +0 -1
  899. package/loaders/PCDLoader.cjs.js +0 -1
  900. package/loaders/PDBLoader.cjs.js +0 -1
  901. package/loaders/PLYLoader.cjs.js +0 -1
  902. package/loaders/PRWMLoader.cjs.js +0 -1
  903. package/loaders/PVRLoader.cjs.js +0 -1
  904. package/loaders/RGBELoader.cjs.js +0 -1
  905. package/loaders/RGBMLoader.cjs.js +0 -1
  906. package/loaders/STLLoader.cjs.js +0 -1
  907. package/loaders/SVGLoader.cjs.js +0 -1
  908. package/loaders/TDSLoader.cjs.js +0 -1
  909. package/loaders/TGALoader.cjs.js +0 -1
  910. package/loaders/TTFLoader.cjs.js +0 -1
  911. package/loaders/TiltLoader.cjs.js +0 -1
  912. package/loaders/VOXLoader.cjs.js +0 -1
  913. package/loaders/VRMLLoader.cjs.js +0 -1
  914. package/loaders/VRMLoader.cjs.js +0 -1
  915. package/loaders/VTKLoader.cjs.js +0 -1
  916. package/loaders/XLoader.cjs.js +0 -1
  917. package/loaders/XYZLoader.cjs.js +0 -1
  918. package/loaders/lwo/IFFParser.cjs.js +0 -1
  919. package/loaders/lwo/LWO2Parser.cjs.js +0 -1
  920. package/loaders/lwo/LWO3Parser.cjs.js +0 -1
  921. package/math/Capsule.cjs.js +0 -1
  922. package/math/ColorConverter.cjs.js +0 -1
  923. package/math/ConvexHull.cjs.js +0 -1
  924. package/math/ImprovedNoise.cjs.js +0 -1
  925. package/math/Lut.cjs.js +0 -1
  926. package/math/MeshSurfaceSampler.cjs.js +0 -1
  927. package/math/OBB.cjs.js +0 -1
  928. package/math/Octree.cjs.js +0 -1
  929. package/math/SimplexNoise.cjs.js +0 -1
  930. package/misc/ConvexObjectBreaker.cjs.js +0 -1
  931. package/misc/GPUComputationRenderer.cjs.js +0 -1
  932. package/misc/Gyroscope.cjs.js +0 -1
  933. package/misc/MD2Character.cjs.js +0 -1
  934. package/misc/MD2CharacterComplex.cjs.js +0 -1
  935. package/misc/MorphAnimMesh.cjs.js +0 -1
  936. package/misc/MorphBlendMesh.cjs.js +0 -1
  937. package/misc/ProgressiveLightmap.cjs.js +0 -1
  938. package/misc/RollerCoaster.cjs.js +0 -1
  939. package/misc/TubePainter.cjs.js +0 -1
  940. package/misc/Volume.cjs.js +0 -1
  941. package/misc/VolumeSlice.cjs.js +0 -1
  942. package/misc/WebGL.cjs.js +0 -1
  943. package/modifiers/CurveModifier.cjs.js +0 -1
  944. package/modifiers/EdgeSplitModifier.cjs.js +0 -1
  945. package/modifiers/SimplifyModifier.cjs.js +0 -1
  946. package/modifiers/TessellateModifier.cjs.js +0 -1
  947. package/nodes/Nodes.cjs.js +0 -1
  948. package/nodes/ShaderNode.cjs.js +0 -1
  949. package/nodes/accessors/BufferNode.cjs.js +0 -1
  950. package/nodes/accessors/CameraNode.cjs.js +0 -1
  951. package/nodes/accessors/CubeTextureNode.cjs.js +0 -1
  952. package/nodes/accessors/MaterialNode.cjs.js +0 -1
  953. package/nodes/accessors/MaterialReferenceNode.cjs.js +0 -1
  954. package/nodes/accessors/ModelNode.cjs.js +0 -1
  955. package/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  956. package/nodes/accessors/NormalNode.cjs.js +0 -1
  957. package/nodes/accessors/Object3DNode.cjs.js +0 -1
  958. package/nodes/accessors/PointUVNode.cjs.js +0 -1
  959. package/nodes/accessors/PositionNode.cjs.js +0 -1
  960. package/nodes/accessors/ReferenceNode.cjs.js +0 -1
  961. package/nodes/accessors/ReflectNode.cjs.js +0 -1
  962. package/nodes/accessors/SkinningNode.cjs.js +0 -1
  963. package/nodes/accessors/TextureNode.cjs.js +0 -1
  964. package/nodes/accessors/UVNode.cjs.js +0 -1
  965. package/nodes/core/ArrayUniformNode.cjs.js +0 -1
  966. package/nodes/core/AttributeNode.cjs.js +0 -1
  967. package/nodes/core/BypassNode.cjs.js +0 -1
  968. package/nodes/core/CodeNode.cjs.js +0 -1
  969. package/nodes/core/ConstNode.cjs.js +0 -1
  970. package/nodes/core/ContextNode.cjs.js +0 -1
  971. package/nodes/core/ExpressionNode.cjs.js +0 -1
  972. package/nodes/core/FunctionCallNode.cjs.js +0 -1
  973. package/nodes/core/FunctionNode.cjs.js +0 -1
  974. package/nodes/core/InputNode.cjs.js +0 -1
  975. package/nodes/core/Node.cjs.js +0 -1
  976. package/nodes/core/NodeAttribute.cjs.js +0 -1
  977. package/nodes/core/NodeBuilder.cjs.js +0 -1
  978. package/nodes/core/NodeCode.cjs.js +0 -1
  979. package/nodes/core/NodeFrame.cjs.js +0 -1
  980. package/nodes/core/NodeFunction.cjs.js +0 -1
  981. package/nodes/core/NodeFunction.js +0 -17
  982. package/nodes/core/NodeFunctionInput.cjs.js +0 -1
  983. package/nodes/core/NodeKeywords.cjs.js +0 -1
  984. package/nodes/core/NodeParser.cjs.js +0 -1
  985. package/nodes/core/NodeParser.js +0 -8
  986. package/nodes/core/NodeUniform.cjs.js +0 -1
  987. package/nodes/core/NodeUtils.cjs.js +0 -1
  988. package/nodes/core/NodeVar.cjs.js +0 -1
  989. package/nodes/core/NodeVary.cjs.js +0 -1
  990. package/nodes/core/PropertyNode.cjs.js +0 -1
  991. package/nodes/core/TempNode.cjs.js +0 -1
  992. package/nodes/core/UniformNode.cjs.js +0 -1
  993. package/nodes/core/VarNode.cjs.js +0 -1
  994. package/nodes/core/VaryNode.cjs.js +0 -1
  995. package/nodes/core/constants.cjs.js +0 -1
  996. package/nodes/display/ColorSpaceNode.cjs.js +0 -1
  997. package/nodes/display/NormalMapNode.cjs.js +0 -1
  998. package/nodes/fog/FogNode.cjs.js +0 -1
  999. package/nodes/fog/FogRangeNode.cjs.js +0 -1
  1000. package/nodes/functions/BSDFs.cjs.js +0 -1
  1001. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +0 -1
  1002. package/nodes/functions/PhysicalMaterialFunctions.js +0 -57
  1003. package/nodes/lights/LightContextNode.cjs.js +0 -1
  1004. package/nodes/lights/LightNode.cjs.js +0 -1
  1005. package/nodes/lights/LightsNode.cjs.js +0 -1
  1006. package/nodes/loaders/NodeLoader.cjs.js +0 -1
  1007. package/nodes/loaders/NodeMaterialLoader.cjs.js +0 -1
  1008. package/nodes/loaders/NodeObjectLoader.cjs.js +0 -1
  1009. package/nodes/materials/LineBasicNodeMaterial.cjs.js +0 -1
  1010. package/nodes/materials/Materials.cjs.js +0 -1
  1011. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +0 -1
  1012. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +0 -1
  1013. package/nodes/materials/NodeMaterial.cjs.js +0 -1
  1014. package/nodes/materials/PointsNodeMaterial.cjs.js +0 -1
  1015. package/nodes/math/CondNode.cjs.js +0 -1
  1016. package/nodes/math/MathNode.cjs.js +0 -1
  1017. package/nodes/math/OperatorNode.cjs.js +0 -1
  1018. package/nodes/parsers/GLSLNodeFunction.cjs.js +0 -1
  1019. package/nodes/parsers/GLSLNodeFunction.js +0 -101
  1020. package/nodes/parsers/GLSLNodeParser.cjs.js +0 -1
  1021. package/nodes/parsers/GLSLNodeParser.js +0 -13
  1022. package/nodes/parsers/WGSLNodeFunction.cjs.js +0 -1
  1023. package/nodes/parsers/WGSLNodeFunction.js +0 -71
  1024. package/nodes/parsers/WGSLNodeParser.cjs.js +0 -1
  1025. package/nodes/parsers/WGSLNodeParser.js +0 -13
  1026. package/nodes/procedural/CheckerNode.cjs.js +0 -1
  1027. package/nodes/utils/ArrayElementNode.cjs.js +0 -1
  1028. package/nodes/utils/ConvertNode.cjs.js +0 -1
  1029. package/nodes/utils/JoinNode.cjs.js +0 -1
  1030. package/nodes/utils/MatcapUVNode.cjs.js +0 -1
  1031. package/nodes/utils/OscNode.cjs.js +0 -1
  1032. package/nodes/utils/SplitNode.cjs.js +0 -1
  1033. package/nodes/utils/SpriteSheetUVNode.cjs.js +0 -1
  1034. package/nodes/utils/TimerNode.cjs.js +0 -1
  1035. package/objects/GroundProjectedEnv.cjs.js +0 -1
  1036. package/objects/Lensflare.cjs.js +0 -1
  1037. package/objects/LightningStorm.cjs.js +0 -1
  1038. package/objects/MarchingCubes.cjs.js +0 -1
  1039. package/objects/Reflector.cjs.js +0 -1
  1040. package/objects/ReflectorForSSRPass.cjs.js +0 -1
  1041. package/objects/ReflectorRTT.cjs.js +0 -1
  1042. package/objects/Refractor.cjs.js +0 -1
  1043. package/objects/ShadowMesh.cjs.js +0 -1
  1044. package/objects/Sky.cjs.js +0 -1
  1045. package/objects/Water.cjs.js +0 -1
  1046. package/objects/Water2.cjs.js +0 -1
  1047. package/offscreen/jank.cjs.js +0 -1
  1048. package/offscreen/offscreen.cjs.js +0 -1
  1049. package/offscreen/scene.cjs.js +0 -1
  1050. package/physics/AmmoPhysics.cjs.js +0 -1
  1051. package/postprocessing/AdaptiveToneMappingPass.cjs.js +0 -1
  1052. package/postprocessing/AfterimagePass.cjs.js +0 -1
  1053. package/postprocessing/BloomPass.cjs.js +0 -1
  1054. package/postprocessing/BokehPass.cjs.js +0 -1
  1055. package/postprocessing/ClearPass.cjs.js +0 -1
  1056. package/postprocessing/CubeTexturePass.cjs.js +0 -1
  1057. package/postprocessing/DotScreenPass.cjs.js +0 -1
  1058. package/postprocessing/EffectComposer.cjs.js +0 -1
  1059. package/postprocessing/FilmPass.cjs.js +0 -1
  1060. package/postprocessing/GlitchPass.cjs.js +0 -1
  1061. package/postprocessing/HalftonePass.cjs.js +0 -1
  1062. package/postprocessing/LUTPass.cjs.js +0 -1
  1063. package/postprocessing/MaskPass.cjs.js +0 -1
  1064. package/postprocessing/OutlinePass.cjs.js +0 -1
  1065. package/postprocessing/Pass.cjs.js +0 -1
  1066. package/postprocessing/RenderPass.cjs.js +0 -1
  1067. package/postprocessing/RenderPixelatedPass.cjs.js +0 -1
  1068. package/postprocessing/SAOPass.cjs.js +0 -1
  1069. package/postprocessing/SMAAPass.cjs.js +0 -1
  1070. package/postprocessing/SSAARenderPass.cjs.js +0 -1
  1071. package/postprocessing/SSAOPass.cjs.js +0 -1
  1072. package/postprocessing/SSRPass.cjs.js +0 -1
  1073. package/postprocessing/SavePass.cjs.js +0 -1
  1074. package/postprocessing/ShaderPass.cjs.js +0 -1
  1075. package/postprocessing/TAARenderPass.cjs.js +0 -1
  1076. package/postprocessing/TexturePass.cjs.js +0 -1
  1077. package/postprocessing/UnrealBloomPass.cjs.js +0 -1
  1078. package/renderers/CSS2DRenderer.cjs.js +0 -1
  1079. package/renderers/CSS3DRenderer.cjs.js +0 -1
  1080. package/renderers/Projector.cjs.js +0 -1
  1081. package/renderers/SVGRenderer.cjs.js +0 -1
  1082. package/renderers/nodes/accessors/CameraNode.cjs.js +0 -1
  1083. package/renderers/nodes/accessors/ModelNode.cjs.js +0 -1
  1084. package/renderers/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  1085. package/renderers/nodes/accessors/NormalNode.cjs.js +0 -1
  1086. package/renderers/nodes/accessors/PositionNode.cjs.js +0 -1
  1087. package/renderers/nodes/accessors/UVNode.cjs.js +0 -1
  1088. package/renderers/nodes/core/AttributeNode.cjs.js +0 -1
  1089. package/renderers/nodes/core/InputNode.cjs.js +0 -1
  1090. package/renderers/nodes/core/Node.cjs.js +0 -1
  1091. package/renderers/nodes/core/NodeAttribute.cjs.js +0 -1
  1092. package/renderers/nodes/core/NodeBuilder.cjs.js +0 -1
  1093. package/renderers/nodes/core/NodeFrame.cjs.js +0 -1
  1094. package/renderers/nodes/core/NodeSlot.cjs.js +0 -1
  1095. package/renderers/nodes/core/NodeUniform.cjs.js +0 -1
  1096. package/renderers/nodes/core/NodeVary.cjs.js +0 -1
  1097. package/renderers/nodes/core/VaryNode.cjs.js +0 -1
  1098. package/renderers/nodes/core/constants.cjs.js +0 -1
  1099. package/renderers/nodes/inputs/ColorNode.cjs.js +0 -1
  1100. package/renderers/nodes/inputs/FloatNode.cjs.js +0 -1
  1101. package/renderers/nodes/inputs/Matrix3Node.cjs.js +0 -1
  1102. package/renderers/nodes/inputs/Matrix4Node.cjs.js +0 -1
  1103. package/renderers/nodes/inputs/TextureNode.cjs.js +0 -1
  1104. package/renderers/nodes/inputs/Vector2Node.cjs.js +0 -1
  1105. package/renderers/nodes/inputs/Vector3Node.cjs.js +0 -1
  1106. package/renderers/nodes/inputs/Vector4Node.cjs.js +0 -1
  1107. package/renderers/nodes/math/MathNode.cjs.js +0 -1
  1108. package/renderers/nodes/math/OperatorNode.cjs.js +0 -1
  1109. package/renderers/nodes/utils/SwitchNode.cjs.js +0 -1
  1110. package/renderers/nodes/utils/TimerNode.cjs.js +0 -1
  1111. package/renderers/webgpu/WebGPU.cjs.js +0 -1
  1112. package/renderers/webgpu/WebGPUAttributes.cjs.js +0 -1
  1113. package/renderers/webgpu/WebGPUBackground.cjs.js +0 -1
  1114. package/renderers/webgpu/WebGPUBinding.cjs.js +0 -1
  1115. package/renderers/webgpu/WebGPUBindings.cjs.js +0 -1
  1116. package/renderers/webgpu/WebGPUComputePipelines.cjs.js +0 -1
  1117. package/renderers/webgpu/WebGPUGeometries.cjs.js +0 -1
  1118. package/renderers/webgpu/WebGPUInfo.cjs.js +0 -1
  1119. package/renderers/webgpu/WebGPUObjects.cjs.js +0 -1
  1120. package/renderers/webgpu/WebGPUProperties.cjs.js +0 -1
  1121. package/renderers/webgpu/WebGPURenderLists.cjs.js +0 -1
  1122. package/renderers/webgpu/WebGPURenderPipelines.cjs.js +0 -1
  1123. package/renderers/webgpu/WebGPURenderer.cjs.js +0 -1
  1124. package/renderers/webgpu/WebGPUSampledTexture.cjs.js +0 -1
  1125. package/renderers/webgpu/WebGPUSampler.cjs.js +0 -1
  1126. package/renderers/webgpu/WebGPUStorageBuffer.cjs.js +0 -1
  1127. package/renderers/webgpu/WebGPUTextureRenderer.cjs.js +0 -1
  1128. package/renderers/webgpu/WebGPUTextureUtils.cjs.js +0 -1
  1129. package/renderers/webgpu/WebGPUTextures.cjs.js +0 -1
  1130. package/renderers/webgpu/WebGPUUniform.cjs.js +0 -1
  1131. package/renderers/webgpu/WebGPUUniformsGroup.cjs.js +0 -1
  1132. package/renderers/webgpu/constants.cjs.js +0 -1
  1133. package/renderers/webgpu/nodes/ShaderLib.cjs.js +0 -1
  1134. package/renderers/webgpu/nodes/WebGPUNodeBuilder.cjs.js +0 -1
  1135. package/renderers/webgpu/nodes/WebGPUNodeUniform.cjs.js +0 -1
  1136. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.cjs.js +0 -1
  1137. package/renderers/webgpu/nodes/WebGPUNodes.cjs.js +0 -1
  1138. package/shaders/ACESFilmicToneMappingShader.cjs.js +0 -1
  1139. package/shaders/AfterimageShader.cjs.js +0 -1
  1140. package/shaders/BasicShader.cjs.js +0 -1
  1141. package/shaders/BleachBypassShader.cjs.js +0 -1
  1142. package/shaders/BlendShader.cjs.js +0 -1
  1143. package/shaders/BokehShader.cjs.js +0 -1
  1144. package/shaders/BokehShader2.cjs.js +0 -1
  1145. package/shaders/BrightnessContrastShader.cjs.js +0 -1
  1146. package/shaders/ColorCorrectionShader.cjs.js +0 -1
  1147. package/shaders/ColorifyShader.cjs.js +0 -1
  1148. package/shaders/ConvolutionShader.cjs.js +0 -1
  1149. package/shaders/CopyShader.cjs.js +0 -1
  1150. package/shaders/DOFMipMapShader.cjs.js +0 -1
  1151. package/shaders/DepthLimitedBlurShader.cjs.js +0 -1
  1152. package/shaders/DigitalGlitch.cjs.js +0 -1
  1153. package/shaders/DotScreenShader.cjs.js +0 -1
  1154. package/shaders/FXAAShader.cjs.js +0 -1
  1155. package/shaders/FilmShader.cjs.js +0 -1
  1156. package/shaders/FocusShader.cjs.js +0 -1
  1157. package/shaders/FreiChenShader.cjs.js +0 -1
  1158. package/shaders/FresnelShader.cjs.js +0 -1
  1159. package/shaders/GammaCorrectionShader.cjs.js +0 -1
  1160. package/shaders/GodRaysShader.cjs.js +0 -1
  1161. package/shaders/HalftoneShader.cjs.js +0 -1
  1162. package/shaders/HorizontalBlurShader.cjs.js +0 -1
  1163. package/shaders/HorizontalTiltShiftShader.cjs.js +0 -1
  1164. package/shaders/HueSaturationShader.cjs.js +0 -1
  1165. package/shaders/KaleidoShader.cjs.js +0 -1
  1166. package/shaders/LuminosityHighPassShader.cjs.js +0 -1
  1167. package/shaders/LuminosityShader.cjs.js +0 -1
  1168. package/shaders/MirrorShader.cjs.js +0 -1
  1169. package/shaders/NormalMapShader.cjs.js +0 -1
  1170. package/shaders/ParallaxShader.cjs.js +0 -1
  1171. package/shaders/PixelShader.cjs.js +0 -1
  1172. package/shaders/RGBShiftShader.cjs.js +0 -1
  1173. package/shaders/SAOShader.cjs.js +0 -1
  1174. package/shaders/SMAAShader.cjs.js +0 -1
  1175. package/shaders/SSAOShader.cjs.js +0 -1
  1176. package/shaders/SSRShader.cjs.js +0 -1
  1177. package/shaders/SepiaShader.cjs.js +0 -1
  1178. package/shaders/SobelOperatorShader.cjs.js +0 -1
  1179. package/shaders/SubsurfaceScatteringShader.cjs.js +0 -1
  1180. package/shaders/TechnicolorShader.cjs.js +0 -1
  1181. package/shaders/ToneMapShader.cjs.js +0 -1
  1182. package/shaders/ToonShader.cjs.js +0 -1
  1183. package/shaders/TriangleBlurShader.cjs.js +0 -1
  1184. package/shaders/UnpackDepthRGBAShader.cjs.js +0 -1
  1185. package/shaders/VerticalBlurShader.cjs.js +0 -1
  1186. package/shaders/VerticalTiltShiftShader.cjs.js +0 -1
  1187. package/shaders/VignetteShader.cjs.js +0 -1
  1188. package/shaders/VolumeShader.cjs.js +0 -1
  1189. package/shaders/WaterRefractionShader.cjs.js +0 -1
  1190. package/shaders/types.cjs.js +0 -1
  1191. package/textures/FlakesTexture.cjs.js +0 -1
  1192. package/types/helpers.cjs.js +0 -1
  1193. package/types/shared.cjs.js +0 -1
  1194. package/types/shared.js +0 -1
  1195. package/types/utils.cjs.js +0 -1
  1196. package/types/utils.js +0 -1
  1197. package/utils/BufferGeometryUtils.cjs.js +0 -1
  1198. package/utils/GeometryCompressionUtils.cjs.js +0 -1
  1199. package/utils/GeometryUtils.cjs.js +0 -1
  1200. package/utils/LDrawUtils.cjs.js +0 -1
  1201. package/utils/LDrawUtils.d.ts +0 -5
  1202. package/utils/LDrawUtils.js +0 -144
  1203. package/utils/RoughnessMipmapper.cjs.js +0 -1
  1204. package/utils/SceneUtils.cjs.js +0 -1
  1205. package/utils/ShadowMapViewer.cjs.js +0 -1
  1206. package/utils/SkeletonUtils.cjs.js +0 -1
  1207. package/utils/UVsDebug.cjs.js +0 -1
  1208. package/utils/WorkerPool.cjs.js +0 -1
  1209. package/webxr/ARButton.cjs.js +0 -1
  1210. package/webxr/OculusHandModel.cjs.js +0 -1
  1211. package/webxr/OculusHandPointerModel.cjs.js +0 -1
  1212. package/webxr/Text2D.cjs.js +0 -1
  1213. package/webxr/VRButton.cjs.js +0 -1
  1214. package/webxr/XRControllerModelFactory.cjs.js +0 -1
  1215. package/webxr/XREstimatedLight.cjs.js +0 -1
  1216. package/webxr/XRHandMeshModel.cjs.js +0 -1
  1217. package/webxr/XRHandModelFactory.cjs.js +0 -1
  1218. package/webxr/XRHandPrimitiveModel.cjs.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");exports.ParallaxBarrierEffect=function(r){const t=new e.OrthographicCamera(-1,1,1,-1,0,1),a=new e.Scene,i=new e.StereoCamera,n={minFilter:e.LinearFilter,magFilter:e.NearestFilter,format:e.RGBAFormat},o=new e.WebGLRenderTarget(512,512,n),l=new e.WebGLRenderTarget(512,512,n),v=new e.ShaderMaterial({uniforms:{mapLeft:{value:o.texture},mapRight:{value:l.texture}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = vec2( uv.x, uv.y );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D mapLeft;","uniform sampler2D mapRight;","varying vec2 vUv;","void main() {","\tvec2 uv = vUv;","\tif ( ( mod( gl_FragCoord.y, 2.0 ) ) > 1.00 ) {","\t\tgl_FragColor = texture2D( mapLeft, uv );","\t} else {","\t\tgl_FragColor = texture2D( mapRight, uv );","\t}","}"].join("\n")}),d=new e.Mesh(new e.PlaneGeometry(2,2),v);a.add(d),this.setSize=(e,t)=>{r.setSize(e,t);const a=r.getPixelRatio();o.setSize(e*a,t*a),l.setSize(e*a,t*a)},this.render=(e,n)=>{e.updateMatrixWorld(),null===n.parent&&n.updateMatrixWorld(),i.update(n),r.setRenderTarget(o),r.clear(),r.render(e,i.cameraL),r.setRenderTarget(l),r.clear(),r.render(e,i.cameraR),r.setRenderTarget(null),r.render(a,t)}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");exports.PeppersGhostEffect=function(t){const r=this;let o,s,i;r.cameraDistance=15,r.reflectFromAbove=!1;const a=new e.PerspectiveCamera,n=new e.PerspectiveCamera,c=new e.PerspectiveCamera,p=new e.PerspectiveCamera,l=new e.Vector3,d=new e.Quaternion,m=new e.Vector3;t.autoClear=!1,this.setSize=(e,r)=>{o=e/2,e<r?(s=e/3,i=e/3):(s=r/3,i=r/3),t.setSize(e,r)},this.render=(e,u)=>{e.updateMatrixWorld(),null===u.parent&&u.updateMatrixWorld(),u.matrixWorld.decompose(l,d,m),a.position.copy(l),a.quaternion.copy(d),a.translateZ(r.cameraDistance),a.lookAt(e.position),n.position.copy(l),n.quaternion.copy(d),n.translateZ(-r.cameraDistance),n.lookAt(e.position),n.rotation.z+=Math.PI/180*180,c.position.copy(l),c.quaternion.copy(d),c.translateX(-r.cameraDistance),c.lookAt(e.position),c.rotation.x+=Math.PI/180*90,p.position.copy(l),p.quaternion.copy(d),p.translateX(r.cameraDistance),p.lookAt(e.position),p.rotation.x+=Math.PI/180*90,t.clear(),t.setScissorTest(!0),t.setScissor(o-s/2,2*i,s,i),t.setViewport(o-s/2,2*i,s,i),r.reflectFromAbove?t.render(e,n):t.render(e,a),t.setScissor(o-s/2,0,s,i),t.setViewport(o-s/2,0,s,i),r.reflectFromAbove?t.render(e,a):t.render(e,n),t.setScissor(o-s/2-s,i,s,i),t.setViewport(o-s/2-s,i,s,i),r.reflectFromAbove?t.render(e,p):t.render(e,c),t.setScissor(o+s/2,i,s,i),t.setViewport(o+s/2,i,s,i),r.reflectFromAbove?t.render(e,c):t.render(e,p),t.setScissorTest(!1)}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");exports.StereoEffect=function(t){const r=new e.StereoCamera;r.aspect=.5;const s=new e.Vector2;this.setEyeSeparation=e=>{r.eyeSep=e},this.setSize=(e,r)=>{t.setSize(e,r)},this.render=(e,i)=>{e.updateMatrixWorld(),null===i.parent&&i.updateMatrixWorld(),r.update(i),t.getSize(s),t.autoClear&&t.clear(),t.setScissorTest(!0),t.setScissor(0,0,s.width/2,s.height),t.setViewport(0,0,s.width/2,s.height),t.render(e,r.cameraL),t.setScissor(s.width/2,0,s.width/2,s.height),t.setViewport(s.width/2,0,s.width/2,s.height),t.render(e,r.cameraR),t.setScissorTest(!1)}};
@@ -1 +0,0 @@
1
- "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("three"));exports.RoomEnvironment=function(){const e=new t.Scene,s=new t.BoxGeometry;s.deleteAttribute("uv");const n=new t.MeshStandardMaterial({side:t.BackSide}),o=new t.MeshStandardMaterial,a=new t.PointLight(16777215,5,28,2);a.position.set(.418,16.199,.3),e.add(a);const i=new t.Mesh(s,n);i.position.set(-.757,13.219,.717),i.scale.set(31.713,28.305,28.591),e.add(i);const c=new t.Mesh(s,o);c.position.set(-10.906,2.009,1.846),c.rotation.set(0,-.195,0),c.scale.set(2.328,7.905,4.651),e.add(c);const r=new t.Mesh(s,o);r.position.set(-5.607,-.754,-.758),r.rotation.set(0,.994,0),r.scale.set(1.97,1.534,3.955),e.add(r);const d=new t.Mesh(s,o);d.position.set(6.167,.857,7.803),d.rotation.set(0,.561,0),d.scale.set(3.927,6.285,3.687),e.add(d);const l=new t.Mesh(s,o);l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),e.add(l);const u=new t.Mesh(s,o);u.position.set(2.291,-.756,-2.621),u.rotation.set(0,-.286,0),u.scale.set(1.546,1.552,1.496),e.add(u);const M=new t.Mesh(s,o);M.position.set(-2.193,-.369,-5.547),M.rotation.set(0,.516,0),M.scale.set(3.875,3.487,2.986),e.add(M);const p=new t.Mesh(s,j(50));p.position.set(-16.116,14.37,8.208),p.scale.set(.1,2.428,2.739),e.add(p);const w=new t.Mesh(s,j(50));w.position.set(-16.109,18.021,-8.207),w.scale.set(.1,2.425,2.751),e.add(w);const h=new t.Mesh(s,j(17));h.position.set(14.904,12.198,-1.832),h.scale.set(.15,4.265,6.331),e.add(h);const f=new t.Mesh(s,j(43));f.position.set(-.462,8.89,14.52),f.scale.set(4.38,5.441,.088),e.add(f);const b=new t.Mesh(s,j(20));b.position.set(3.235,11.486,-12.541),b.scale.set(2.5,2,.1),e.add(b);const O=new t.Mesh(s,j(100));function j(e){const s=new t.MeshBasicMaterial;return s.color.setScalar(e),s}return O.position.set(0,20,0),O.scale.set(1,.1,1),e.add(O),e};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e);exports.ColladaExporter=class{constructor(){i.default(this,"options",void 0),i.default(this,"geometryInfo",void 0),i.default(this,"materialMap",void 0),i.default(this,"imageMap",void 0),i.default(this,"textures",void 0),i.default(this,"libraryImages",void 0),i.default(this,"libraryGeometries",void 0),i.default(this,"libraryEffects",void 0),i.default(this,"libraryMaterials",void 0),i.default(this,"canvas",void 0),i.default(this,"ctx",void 0),i.default(this,"transMat",void 0),i.default(this,"getFuncs",["getX","getY","getZ","getW"]),this.options={version:"1.4.1",author:null,textureDirectory:"",upAxis:"Y_UP",unitName:null,unitMeter:null},this.geometryInfo=new WeakMap,this.materialMap=new WeakMap,this.imageMap=new WeakMap,this.textures=[],this.libraryImages=[],this.libraryGeometries=[],this.libraryEffects=[],this.libraryMaterials=[],this.canvas=null,this.ctx=null,this.transMat=null}parse(e,t,r={}){if(this.options={...this.options,...r},null===this.options.upAxis.match(/^[XYZ]_UP$/))return console.error("ColladaExporter: Invalid upAxis: valid values are X_UP, Y_UP or Z_UP."),null;if(null!==this.options.unitName&&null===this.options.unitMeter)return console.error("ColladaExporter: unitMeter needs to be specified if unitName is specified."),null;if(null!==this.options.unitMeter&&null===this.options.unitName)return console.error("ColladaExporter: unitName needs to be specified if unitMeter is specified."),null;if(""!==this.options.textureDirectory&&(this.options.textureDirectory=`${this.options.textureDirectory}/`.replace(/\\/g,"/").replace(/\/+/g,"/")),"1.4.1"!==this.options.version&&"1.5.0"!==this.options.version)return console.warn(`ColladaExporter : Version ${this.options.version} not supported for export. Only 1.4.1 and 1.5.0.`),null;const i=this.processObject(e);let s=`<?xml version="1.0" encoding="UTF-8" standalone="no" ?><COLLADA xmlns="${"1.4.1"===this.options.version?"http://www.collada.org/2005/11/COLLADASchema":"https://www.khronos.org/collada/"}" version="${this.options.version}"><asset><contributor><authoring_tool>three.js Collada Exporter</authoring_tool>${null!==this.options.author?`<author>${this.options.author}</author>`:""}</contributor><created>${(new Date).toISOString()}</created><modified>${(new Date).toISOString()}</modified><up_axis>Y_UP</up_axis></asset>`;s+=`<library_images>${this.libraryImages.join("")}</library_images>`,s+=`<library_effects>${this.libraryEffects.join("")}</library_effects>`,s+=`<library_materials>${this.libraryMaterials.join("")}</library_materials>`,s+=`<library_geometries>${this.libraryGeometries.join("")}</library_geometries>`,s+=`<library_visual_scenes><visual_scene id="Scene" name="scene">${i}</visual_scene></library_visual_scenes>`,s+='<scene><instance_visual_scene url="#Scene"/></scene>',s+="</COLLADA>";const a={data:this.format(s),textures:this.textures};return"function"==typeof t&&requestAnimationFrame((()=>t(a))),a}format(e){var t,r;const i=/^<\//,s=/(\?>$)|(\/>$)/,a=/<[^>]+>[^<]*<\/[^<]+>/,o=(e,t)=>t>0?e+o(e,t-1):"";let n=0;return null!=(t=null===(r=e.match(/(<[^>]+>[^<]+<\/[^<]+>)|(<[^>]+>)/g))||void 0===r?void 0:r.map((e=>{a.test(e)||s.test(e)||!i.test(e)||n--;const t=`${o(" ",n)}${e}`;return a.test(e)||s.test(e)||i.test(e)||n++,t})).join("\n"))?t:""}base64ToBuffer(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0,i=r.length;e<i;e++)r[e]=t.charCodeAt(e);return r}imageToData(e,t){var r;this.canvas=this.canvas||document.createElement("canvas"),this.ctx=this.ctx||this.canvas.getContext("2d"),this.canvas.width=e.width instanceof SVGAnimatedLength?0:e.width,this.canvas.height=e.height instanceof SVGAnimatedLength?0:e.height,null===(r=this.ctx)||void 0===r||r.drawImage(e,0,0);const i=this.canvas.toDataURL(`image/${t}`,1).replace(/^data:image\/(png|jpg);base64,/,"");return this.base64ToBuffer(i)}attrBufferToArray(e){if(e instanceof t.InterleavedBufferAttribute&&e.isInterleavedBufferAttribute){const t=new(0,e.array.constructor)(e.count*e.itemSize),r=e.itemSize;for(let i=0,s=e.count;i<s;i++)for(let s=0;s<r;s++)t[i*r+s]=e[this.getFuncs[s]](i);return t}return e.array}subArray(e,t,r){if(Array.isArray(e))return e.slice(t,t+r);return new(0,e.constructor)(e.buffer,t*e.BYTES_PER_ELEMENT,r)}getAttribute(e,t,r,i){const s=this.attrBufferToArray(e);return Array.isArray(s)?`${`<source id="${t}"><float_array id="${t}-array" count="${s.length}">`+s.join(" ")}</float_array><technique_common><accessor source="#${t}-array" count="${Math.floor(s.length/e.itemSize)}" stride="${e.itemSize}">${r.map((e=>`<param name="${e}" type="${i}" />`)).join("")}</accessor></technique_common></source>`:""}getTransform(e){return e.updateMatrix(),this.transMat=this.transMat||new t.Matrix4,this.transMat.copy(e.matrix),this.transMat.transpose(),`<matrix>${this.transMat.toArray().join(" ")}</matrix>`}processGeometry(e){let t=this.geometryInfo.get(e);if(!t){const r=e;if(!r.isBufferGeometry)throw new Error("THREE.ColladaExporter: Geometry is not of type THREE.BufferGeometry.");const i=`Mesh${this.libraryGeometries.length+1}`,s=r.index?r.index.count*r.index.itemSize:r.attributes.position.count,a=null!=r.groups&&0!==r.groups.length?r.groups:[{start:0,count:s,materialIndex:0}];let o=`<geometry id="${i}"${e.name?` name="${e.name}"`:""}><mesh>`;const n=`${i}-position`,l=`${i}-vertices`;o+=this.getAttribute(r.attributes.position,n,["X","Y","Z"],"float"),o+=`<vertices id="${l}"><input semantic="POSITION" source="#${n}" /></vertices>`;let u=`<input semantic="VERTEX" source="#${l}" offset="0" />`;if("normal"in r.attributes){const e=`${i}-normal`;o+=this.getAttribute(r.attributes.normal,e,["X","Y","Z"],"float"),u+=`<input semantic="NORMAL" source="#${e}" offset="0" />`}if("uv"in r.attributes){const e=`${i}-texcoord`;o+=this.getAttribute(r.attributes.uv,e,["S","T"],"float"),u+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="0" />`}if("uv2"in r.attributes){const e=`${i}-texcoord2`;o+=this.getAttribute(r.attributes.uv2,e,["S","T"],"float"),u+=`<input semantic="TEXCOORD" source="#${e}" offset="0" set="1" />`}if("color"in r.attributes){const e=`${i}-color`;o+=this.getAttribute(r.attributes.color,e,["X","Y","Z"],"uint8"),u+=`<input semantic="COLOR" source="#${e}" offset="0" />`}let c=null;if(r.index)c=this.attrBufferToArray(r.index);else{c=new Array(s);for(let e=0,t=c.length;e<t&&Array.isArray(c);e++)c[e]=e}for(let e=0,t=a.length;e<t;e++){const t=a[e],r=this.subArray(c,t.start,t.count),i=r.length/3;o+=`<triangles material="MESH_MATERIAL_${t.materialIndex}" count="${i}">`,o+=u,o+=`<p>${r.join(" ")}</p>`,o+="</triangles>"}o+="</mesh></geometry>",this.libraryGeometries.push(o),t={meshid:i,bufferGeometry:r},this.geometryInfo.set(e,t)}return t}processTexture(e){let t=this.imageMap.get(e);if(null==t){t=`image-${this.libraryImages.length+1}`;const r="png",i=e.name||t;let s=`<image id="${t}" name="${i}">`;"1.5.0"===this.options.version?s+=`<init_from><ref>${this.options.textureDirectory}${i}.${r}</ref></init_from>`:s+=`<init_from>${this.options.textureDirectory}${i}.${r}</init_from>`,s+="</image>",this.libraryImages.push(s),this.imageMap.set(e,t),this.textures.push({directory:this.options.textureDirectory,name:i,ext:r,data:this.imageToData(e.image,r),original:e})}return t}processMaterial(e){let r=this.materialMap.get(e);if(null==r){r=`Mat${this.libraryEffects.length+1}`;let i="phong";if(e instanceof t.MeshLambertMaterial?i="lambert":e instanceof t.MeshBasicMaterial&&(i="constant",null!==e.map&&console.warn("ColladaExporter: Texture maps not supported with MeshBasicMaterial.")),e instanceof t.MeshPhongMaterial){const s=e.emissive?e.emissive:new t.Color(0,0,0),a=e.color?e.color:new t.Color(0,0,0),o=e.specular?e.specular:new t.Color(1,1,1),n=e.shininess||0,l=e.reflectivity||0;let u="";e.transparent&&(u+=`<transparent>${e.map?'<texture texture="diffuse-sampler"></texture>':"<float>1</float>"}</transparent>`,e.opacity<1&&(u+=`<transparency><float>${e.opacity}</float></transparency>`));const c=`<technique sid="common"><${i}><emission>${e.emissiveMap?'<texture texture="emissive-sampler" texcoord="TEXCOORD" />':`<color sid="emission">${s.r} ${s.g} ${s.b} 1</color>`}</emission>${"constant"!==i?`<diffuse>${e.map?'<texture texture="diffuse-sampler" texcoord="TEXCOORD" />':`<color sid="diffuse">${a.r} ${a.g} ${a.b} 1</color>`}</diffuse>`:""}${"constant"!==i?`<bump>${e.normalMap?'<texture texture="bump-sampler" texcoord="TEXCOORD" />':""}</bump>`:""}${"phong"===i?`<specular><color sid="specular">${o.r} ${o.g} ${o.b} 1</color></specular><shininess>${e.specularMap?'<texture texture="specular-sampler" texcoord="TEXCOORD" />':`<float sid="shininess">${n}</float>`}</shininess>`:""}<reflective><color>${a.r} ${a.g} ${a.b} 1</color></reflective><reflectivity><float>${l}</float></reflectivity>${u}</${i}></technique>`,m=`<effect id="${r}-effect"><profile_COMMON>${e.map?`<newparam sid="diffuse-surface"><surface type="2D"><init_from>${this.processTexture(e.map)}</init_from></surface></newparam><newparam sid="diffuse-sampler"><sampler2D><source>diffuse-surface</source></sampler2D></newparam>`:""}${e.specularMap?`<newparam sid="specular-surface"><surface type="2D"><init_from>${this.processTexture(e.specularMap)}</init_from></surface></newparam><newparam sid="specular-sampler"><sampler2D><source>specular-surface</source></sampler2D></newparam>`:""}${e.emissiveMap?`<newparam sid="emissive-surface"><surface type="2D"><init_from>${this.processTexture(e.emissiveMap)}</init_from></surface></newparam><newparam sid="emissive-sampler"><sampler2D><source>emissive-surface</source></sampler2D></newparam>`:""}${e.normalMap?`<newparam sid="bump-surface"><surface type="2D"><init_from>${this.processTexture(e.normalMap)}</init_from></surface></newparam><newparam sid="bump-sampler"><sampler2D><source>bump-surface</source></sampler2D></newparam>`:""}${c}${e.side===t.DoubleSide?'<extra><technique profile="THREEJS"><double_sided sid="double_sided" type="int">1</double_sided></technique></extra>':""}</profile_COMMON></effect>`,p=`<material id="${r}"${e.name?` name="${e.name}"`:""}><instance_effect url="#${r}-effect" /></material>`;this.libraryMaterials.push(p),this.libraryEffects.push(m),this.materialMap.set(e,r)}}return r}processObject(e){let r=`<node name="${e.name}">`;if(r+=this.getTransform(e),new t.Mesh,e instanceof t.Mesh&&e.isMesh&&null!==e.geometry){const i=this.processGeometry(e.geometry),s=i.meshid,a=i.bufferGeometry;let o,n=null;const l=e.material||new t.MeshBasicMaterial,u=Array.isArray(l)?l:[l];o=a.groups.length>u.length?new Array(a.groups.length):new Array(u.length),n=o.fill(null).map(((e,t)=>this.processMaterial(u[t%u.length]))),r+=`<instance_geometry url="#${s}">`+(null!=n?`<bind_material><technique_common>${n.map(((e,t)=>`<instance_material symbol="MESH_MATERIAL_${t}" target="#${e}" ><bind_vertex_input semantic="TEXCOORD" input_semantic="TEXCOORD" input_set="0" /></instance_material>`)).join("")}</technique_common></bind_material>`:"")+"</instance_geometry>"}return e.children.forEach((e=>r+=this.processObject(e))),r+="</node>",r}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(e);class n{parse(e,o={decodeSpeed:5,encodeSpeed:5,encoderMethod:n.MESH_EDGEBREAKER_ENCODING,quantization:[16,8,8,8,8],exportUvs:!0,exportNormals:!0,exportColor:!1}){if(e instanceof t.BufferGeometry&&e.isBufferGeometry)throw new Error("DRACOExporter: The first parameter of parse() is now an instance of Mesh or Points.");if(void 0===DracoEncoderModule)throw new Error("THREE.DRACOExporter: required the draco_encoder to work.");const r=e.geometry,i=DracoEncoderModule(),d=new i.Encoder;let a,s;if(!r.isBufferGeometry)throw new Error("THREE.DRACOExporter.parse(geometry, options): geometry is not a THREE.BufferGeometry instance.");if(e instanceof t.Mesh&&e.isMesh){a=new i.MeshBuilder,s=new i.Mesh;const e=r.getAttribute("position");a.AddFloatAttributeToMesh(s,i.POSITION,e.count,e.itemSize,e.array);const t=r.getIndex();if(null!==t)a.AddFacesToMesh(s,t.count/3,t.array);else{const t=new(e.count>65535?Uint32Array:Uint16Array)(e.count);for(let e=0;e<t.length;e++)t[e]=e;a.AddFacesToMesh(s,e.count,t)}if(o.exportNormals){const e=r.getAttribute("normal");void 0!==e&&a.AddFloatAttributeToMesh(s,i.NORMAL,e.count,e.itemSize,e.array)}if(o.exportUvs){const e=r.getAttribute("uv");void 0!==e&&a.AddFloatAttributeToMesh(s,i.TEX_COORD,e.count,e.itemSize,e.array)}if(o.exportColor){const e=r.getAttribute("color");void 0!==e&&a.AddFloatAttributeToMesh(s,i.COLOR,e.count,e.itemSize,e.array)}}else{if(!(e instanceof t.Points&&e.isPoints))throw new Error("DRACOExporter: Unsupported object type.");{a=new i.PointCloudBuilder,s=new i.PointCloud;const e=r.getAttribute("position");if(a.AddFloatAttribute(s,i.POSITION,e.count,e.itemSize,e.array),o.exportColor){const e=r.getAttribute("color");void 0!==e&&a.AddFloatAttribute(s,i.COLOR,e.count,e.itemSize,e.array)}}}const u=new i.DracoInt8Array,c=void 0!==o.encodeSpeed?o.encodeSpeed:5,f=void 0!==o.decodeSpeed?o.decodeSpeed:5;if(d.SetSpeedOptions(c,f),void 0!==o.encoderMethod&&d.SetEncodingMethod(o.encoderMethod),void 0!==o.quantization)for(let e=0;e<5;e++)void 0!==o.quantization[e]&&d.SetAttributeQuantization(e,o.quantization[e]);let l;if(l=e instanceof t.Mesh&&e.isMesh?d.EncodeMeshToDracoBuffer(s,u):d.EncodePointCloudToDracoBuffer(s,!0,u),i.destroy(s),0===l)throw new Error("THREE.DRACOExporter: Draco encoding failed.");const E=new Int8Array(new ArrayBuffer(l));for(let e=0;e<l;e++)E[e]=u.GetValue(e);return i.destroy(u),i.destroy(d),i.destroy(a),E}}r.default(n,"MESH_EDGEBREAKER_ENCODING",1),r.default(n,"MESH_SEQUENTIAL_ENCODING",0),r.default(n,"POINT_CLOUD",0),r.default(n,"TRIANGULAR_MESH",1),r.default(n,"INVALID",-1),r.default(n,"POSITION",0),r.default(n,"NORMAL",1),r.default(n,"COLOR",2),r.default(n,"TEX_COORD",3),r.default(n,"GENERIC",4),exports.DRACOExporter=n;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=s(e);class i{constructor(){n.default(this,"pluginCallbacks",void 0),this.pluginCallbacks=[],this.register((function(e){return new I(e)})),this.register((function(e){return new R(e)})),this.register((function(e){return new F(e)})),this.register((function(e){return new N(e)})),this.register((function(e){return new B(e)}))}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,s){const n=new E,i=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)i.push(this.pluginCallbacks[e](n));n.setPlugins(i),n.write(e,t,s)}}n.default(i,"Utils",{insertKeyframe:function(e,t){const s=.001,n=e.getValueSize(),i=new e.TimeBufferType(e.times.length+1),r=new e.ValueBufferType(e.values.length+n),a=e.createInterpolant(new e.ValueBufferType(n));let o;if(0===e.times.length){i[0]=t;for(let e=0;e<n;e++)r[e]=0;o=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<s)return 0;i[0]=t,i.set(e.times,1),r.set(a.evaluate(t),0),r.set(e.values,n),o=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<s)return e.times.length-1;i[i.length-1]=t,i.set(e.times,0),r.set(e.values,0),r.set(a.evaluate(t),e.values.length),o=i.length-1}else for(let l=0;l<e.times.length;l++){if(Math.abs(e.times[l]-t)<s)return l;if(e.times[l]<t&&e.times[l+1]>t){i.set(e.times.slice(0,l+1),0),i[l+1]=t,i.set(e.times.slice(l+1),l+2),r.set(e.values.slice(0,(l+1)*n),0),r.set(a.evaluate(t),(l+1)*n),r.set(e.values.slice((l+1)*n),(l+2)*n),o=l+1;break}}return e.times=i,e.values=r,o},mergeMorphTargetTracks:function(e,s){const n=[],i={},r=e.tracks;for(let e=0;e<r.length;++e){let a=r[e];const o=t.PropertyBinding.parseTrackName(a.name),l=t.PropertyBinding.findNode(s,o.nodeName);if("morphTargetInfluences"!==o.propertyName||void 0===o.propertyIndex){n.push(a);continue}if(a.createInterpolant!==a.InterpolantFactoryMethodDiscrete&&a.createInterpolant!==a.InterpolantFactoryMethodLinear){if(a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),a=a.clone(),a.setInterpolation(t.InterpolateLinear)}const c=l.morphTargetInfluences.length,h=l.morphTargetDictionary[o.propertyIndex];if(void 0===h)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let u;if(void 0===i[l.uuid]){u=a.clone();const e=new u.ValueBufferType(c*u.times.length);for(let t=0;t<u.times.length;t++)e[t*c+h]=u.values[t];u.name=(o.nodeName||"")+".morphTargetInfluences",u.values=e,i[l.uuid]=u,n.push(u);continue}const f=a.createInterpolant(new a.ValueBufferType(1));u=i[l.uuid];for(let e=0;e<u.times.length;e++)u.values[e*c+h]=f.evaluate(u.times[e]);for(let e=0;e<a.times.length;e++){const t=this.insertKeyframe(u,a.times[e]);u.values[t*c+h]=a.values[e]}}return e.tracks=n,e}});const r=0,a=1,o=2,l=3,c=4,h=5121,u=5123,f=5126,p=5125,m=34962,d=34963,g=9728,M=9729,y=9984,b=9985,x=9986,w=9987,T=33071,v=33648,A=10497,S={};S[t.NearestFilter]=g,S[t.NearestMipmapNearestFilter]=y,S[t.NearestMipmapLinearFilter]=x,S[t.LinearFilter]=M,S[t.LinearMipmapNearestFilter]=b,S[t.LinearMipmapLinearFilter]=w,S[t.ClampToEdgeWrapping]=T,S[t.RepeatWrapping]=A,S[t.MirroredRepeatWrapping]=v;const L={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"};class E{constructor(){n.default(this,"plugins",void 0),n.default(this,"options",void 0),n.default(this,"pending",void 0),n.default(this,"buffers",void 0),n.default(this,"byteOffset",void 0),n.default(this,"nodeMap",void 0),n.default(this,"skins",void 0),n.default(this,"extensionsUsed",void 0),n.default(this,"uids",void 0),n.default(this,"uid",void 0),n.default(this,"json",void 0),n.default(this,"cache",void 0),n.default(this,"cachedCanvas",void 0),this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.cachedCanvas=null}setPlugins(e){this.plugins=e}write(e,t,s){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},s),void 0!==this.options.animations&&this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e);const n=this;Promise.all(this.pending).then((()=>{const e=n.buffers,s=n.json,i=n.options,r=n.extensionsUsed,a=new Blob(e,{type:"application/octet-stream"}),o=Object.keys(r);if(o.length>0&&(s.extensionsUsed=o),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=a.size),i.binary){const e=new window.FileReader;e.readAsArrayBuffer(a),e.onloadend=()=>{if(null!==e.result&&"string"!=typeof e.result){const n=this.getPaddedArrayBuffer(e.result),i=new DataView(new ArrayBuffer(8));i.setUint32(0,n.byteLength,!0),i.setUint32(4,5130562,!0);const r=this.getPaddedArrayBuffer(this.stringToArrayBuffer(JSON.stringify(s)),32),a=new DataView(new ArrayBuffer(8));a.setUint32(0,r.byteLength,!0),a.setUint32(4,1313821514,!0);const o=new ArrayBuffer(12),l=new DataView(o);l.setUint32(0,1179937895,!0),l.setUint32(4,2,!0);const c=12+a.byteLength+r.byteLength+i.byteLength+n.byteLength;l.setUint32(8,c,!0);const h=new Blob([o,a,r,i,n],{type:"application/octet-stream"}),u=new window.FileReader;u.readAsArrayBuffer(h),u.onloadend=function(){null!==u.result&&"string"!=typeof u.result&&t(u.result)}}}}else if(s.buffers&&s.buffers.length>0){const e=new window.FileReader;e.readAsDataURL(a),e.onloadend=function(){const n=e.result;void 0!==s.buffers&&null!==n&&(s.buffers[0].uri=n,t(s))}}else t(s)}))}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;const s=this.options,n=this.extensionsUsed;try{const i=JSON.parse(JSON.stringify(e.userData));if(s.includeCustomExtensions&&i.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],n[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(t){t instanceof Error&&console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e){return this.uids.has(e)||this.uids.set(e,this.uid++),this.uids.get(e)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const s=new t.Vector3;for(let t=0,n=e.count;t<n;t++)if(Math.abs(s.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);const n=e.clone(),i=new t.Vector3;for(let e=0,t=n.count;e<t;e++)i.fromBufferAttribute(n,e),0===i.x&&0===i.y&&0===i.z?i.setX(1):i.normalize(),n.setXYZ(e,i.x,i.y,i.z);return s.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let s=!1;const n={};0===t.offset.x&&0===t.offset.y||(n.offset=t.offset.toArray(),s=!0),0!==t.rotation&&(n.rotation=t.rotation,s=!0),1===t.repeat.x&&1===t.repeat.y||(n.scale=t.repeat.toArray(),s=!0),s&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}processBuffer(e){const t=this.json,s=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),s.push(e),0}processBufferView(e,t,s,n,i){const r=this.json;let a;r.bufferViews||(r.bufferViews=[]),a=t===h?1:t===u?2:4;const o=this.getPaddedBufferSize(n*e.itemSize*a),l=new DataView(new ArrayBuffer(o));let c=0;for(let i=s;i<s+n;i++)for(let s=0;s<e.itemSize;s++){let n;e.itemSize>4?n=e.array[i*e.itemSize+s]:0===s?n=e.getX(i):1===s?n=e.getY(i):2===s?n=e.getZ(i):3===s&&(n=e.getW(i)),void 0!==n&&(t===f?l.setFloat32(c,n,!0):t===p?l.setUint32(c,n,!0):t===u?l.setUint16(c,n,!0):t===h&&l.setUint8(c,n)),c+=a}const d={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};void 0!==i&&(d.target=i),i===m&&(d.byteStride=e.itemSize*a),this.byteOffset+=o,r.bufferViews.push(d);return{id:r.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,s=t.json;return s.bufferViews||(s.bufferViews=[]),new Promise((n=>{const i=new window.FileReader;i.readAsArrayBuffer(e),i.onloadend=()=>{if(null!==i.result&&"string"!=typeof i.result&&void 0!==s.bufferViews){const e=this.getPaddedArrayBuffer(i.result),r={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,n(s.bufferViews.push(r)-1)}}}))}processAccessor(e,t,s,n){const i=this.options,r=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"};let o;if(e.array.constructor===Float32Array)o=f;else if(e.array.constructor===Uint32Array)o=p;else if(e.array.constructor===Uint16Array)o=u;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");o=h}if(void 0===s&&(s=0),void 0===n&&(n=e.count),i.truncateDrawRange&&void 0!==t&&null===t.index){const i=s+n,r=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;s=Math.max(s,t.drawRange.start),(n=Math.min(i,r)-s)<0&&(n=0)}if(0===n)return null;const l=this.getMinMax(e,s,n);let c;if(void 0!==t&&(c=e===t.index?d:m),void 0!==c){const t=this.processBufferView(e,o,s,n,c),i={bufferView:t.id,byteOffset:t.byteOffset,componentType:o,count:n,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized&&(i.normalized=!0),r.accessors||(r.accessors=[]),r.accessors.push(i)-1}}processImage(e,s,n){const i=this,r=i.cache,a=i.json,o=i.options,l=i.pending;r.images.has(e)||r.images.set(e,{});const c=r.images.get(e),h=s===t.RGBAFormat?"image/png":"image/jpeg",u=h+":flipY/"+n.toString();if(void 0!==c&&void 0!==c[u])return c[u];a.images||(a.images=[]);const f={mimeType:h};if(o.embedImages&&void 0!==o.maxTextureSize){const r=this.cachedCanvas=this.cachedCanvas||document.createElement("canvas");r.width=Math.min(e.width,o.maxTextureSize),r.height=Math.min(e.height,o.maxTextureSize);const a=r.getContext("2d");if(n&&(null==a||a.translate(0,r.height),null==a||a.scale(1,-1)),"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap)null==a||a.drawImage(e,0,0,r.width,r.height);else{s!==t.RGBAFormat&&console.error("GLTFExporter: Only RGBA format is supported."),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const n=new Uint8ClampedArray(e.height*e.width*4);if(e instanceof ImageData)for(let t=0;t<n.length;t+=4)n[t+0]=e.data[t+0],n[t+1]=e.data[t+1],n[t+2]=e.data[t+2],n[t+3]=e.data[t+3];null==a||a.putImageData(new ImageData(n,e.width,e.height),0,0)}o.binary?l.push(new Promise((function(e){r.toBlob((function(t){null!==t&&i.processBufferViewImage(t).then((function(t){f.bufferView=t,e()}))}),h)}))):f.uri=r.toDataURL(h)}else e instanceof Image&&(f.uri=e.src);const p=a.images.push(f)-1;return void 0!==c&&(c[u]=p),p}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const s={magFilter:S[e.magFilter],minFilter:S[e.minFilter],wrapS:S[e.wrapS],wrapT:S[e.wrapT]};return t.samplers.push(s)-1}processTexture(e){const t=this.cache,s=this.json;if(t.textures.has(e))return t.textures.get(e);s.textures||(s.textures=[]);const n={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY)};e.name&&(n.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,n)}));const i=s.textures.push(n)-1;return t.textures.set(e,i),i}processMaterial(e){const s=this.cache,n=this.json;if(s.materials.has(e))return s.materials.get(e);if(e instanceof t.ShaderMaterial&&e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const i={pbrMetallicRoughness:{}};if(e instanceof t.MeshStandardMaterial&&e.isMeshStandardMaterial&&e instanceof t.MeshBasicMaterial&&e.isMeshBasicMaterial||console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results."),e instanceof t.MeshStandardMaterial||e instanceof t.MeshPhysicalMaterial){const t=e.color.toArray().concat([e.opacity]);this.equalArray(t,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=t)}if(e instanceof t.MeshStandardMaterial&&e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e instanceof t.MeshStandardMaterial&&e.metalnessMap||e instanceof t.MeshStandardMaterial&&e.roughnessMap)if(e.metalnessMap===e.roughnessMap&&null!==e.metalnessMap){const t={index:this.processTexture(e.metalnessMap)};this.applyTextureTransform(t,e.metalnessMap),i.pbrMetallicRoughness.metallicRoughnessTexture=t}else console.warn("THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.");if((e instanceof t.MeshStandardMaterial||e instanceof t.MeshPhysicalMaterial)&&e.map){const t={index:this.processTexture(e.map)};this.applyTextureTransform(t,e.map),i.pbrMetallicRoughness.baseColorTexture=t}if((e instanceof t.MeshStandardMaterial||e instanceof t.MeshPhysicalMaterial)&&e.emissive){const t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),s=Math.max(t.r,t.g,t.b);if(s>1&&(t.multiplyScalar(1/s),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),s>0&&(i.emissiveFactor=t.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if((e instanceof t.MeshMatcapMaterial||e instanceof t.MeshNormalMaterial||e instanceof t.MeshPhongMaterial||e instanceof t.MeshStandardMaterial||e instanceof t.MeshToonMaterial)&&e.normalMap){const t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if((e instanceof t.MeshBasicMaterial||e instanceof t.MeshLambertMaterial||e instanceof t.MeshPhongMaterial||e instanceof t.MeshStandardMaterial||e instanceof t.MeshToonMaterial)&&e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===t.DoubleSide&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,i)}));const r=n.materials.push(i)-1;return s.materials.set(e,r),r}processMesh(e){const s=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,s=e.material.length;t<s;t++)i.push(e.material[t].uuid);else i.push(e.material.uuid);const h=i.join(":");if(s.meshes.has(h))return s.meshes.get(h);const u=e.geometry;let f;if(f=e instanceof t.LineSegments&&e.isLineSegments?a:e instanceof t.LineLoop&&e.isLineLoop?o:e instanceof t.Line&&e.isLine?l:e instanceof t.Points&&e.isPoints?r:(e.material instanceof t.MeshBasicMaterial||e.material instanceof t.MeshDepthMaterial||e.material instanceof t.MeshLambertMaterial||e.material instanceof t.MeshNormalMaterial||e.material instanceof t.MeshPhongMaterial||e.material instanceof t.MeshStandardMaterial||e.material instanceof t.MeshToonMaterial||e.material instanceof t.ShaderMaterial)&&e.material.wireframe?a:c,!u.isBufferGeometry)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");const p={},m={},d=[],g=[],M={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},y=u.getAttribute("normal");void 0===y||y instanceof t.InterleavedBufferAttribute||this.isNormalizedNormalAttribute(y)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),u.setAttribute("normal",this.createNormalizedNormalAttribute(y)));let b=null;for(let e in u.attributes){if("morph"===e.substr(0,5))continue;const n=u.attributes[e];e=M[e]||e.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),s.attributes.has(this.getUID(n))){m[e]=s.attributes.get(this.getUID(n));continue}b=null;const i=n.array;"JOINTS_0"!==e||i instanceof Uint16Array||i instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new t.BufferAttribute(new Uint16Array(i),n.itemSize,n.normalized));const r=null!==b&&this.processAccessor(b||n,u);r&&(m[e]=r,s.attributes.set(this.getUID(n),r))}if(void 0!==y&&u.setAttribute("normal",y),0===Object.keys(m).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){const t=[],n=[],i={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let r=0;r<e.morphTargetInfluences.length;++r){const a={};let o=!1;for(const e in u.morphAttributes){if("position"!==e&&"normal"!==e){o||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),o=!0);continue}const t=u.morphAttributes[e][r],n=e.toUpperCase(),i=u.attributes[e];if(s.attributes.has(this.getUID(t))){a[n]=s.attributes.get(this.getUID(t));continue}const l=t.clone();if(!u.morphTargetsRelative)for(let e=0,s=t.count;e<s;e++)l.setXYZ(e,t.getX(e)-i.getX(e),t.getY(e)-i.getY(e),t.getZ(e)-i.getZ(e));const c=this.processAccessor(l,u);null!=c&&(a[n]=c),s.attributes.set(this.getUID(i),a[n])}g.push(a),t.push(e.morphTargetInfluences[r]),void 0!==e.morphTargetDictionary&&n.push(i[r])}p.weights=t,n.length>0&&(p.extras={},p.extras.targetNames=n)}const x=Array.isArray(e.material);if(x&&0===u.groups.length)return null;const w=x?e.material:[e.material],T=x?u.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=T.length;e<n;e++){const n={mode:f,attributes:m};if((u instanceof t.Object3D||u instanceof t.Material)&&this.serializeUserData(u,n),g.length>0&&(n.targets=g),null!==u.index){let t=this.getUID(u.index);void 0===T[e].start&&void 0===T[e].count||(t+=`:${T[e].start}:${T[e].count}`),s.attributes.has(t)?n.indices=s.attributes.get(t):(n.indices=this.processAccessor(u.index,u,T[e].start,T[e].count),s.attributes.set(t,n.indices)),null===n.indices&&delete n.indices}const i=T[e].materialIndex;if(void 0!==i&&Array.isArray(w)){const e=w[i];if(!Array.isArray(e)){const t=this.processMaterial(e);null!==t&&(n.material=t),d.push(n)}}}p.primitives=d,n.meshes||(n.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,p)}));const v=n.meshes.push(p)-1;return s.meshes.set(h,v),v}processCamera(e){const s=this.json;s.cameras||(s.cameras=[]);const n=e instanceof t.OrthographicCamera&&e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return e instanceof t.OrthographicCamera&&n?i.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:e instanceof t.PerspectiveCamera&&(i.perspective={aspectRatio:e.aspect,yfov:t.MathUtils.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}),""!==e.name&&(i.name=e.type),s.cameras.push(i)-1}processAnimation(e,s){const n=this.json,r=this.nodeMap;n.animations||(n.animations=[]);const a=(e=i.Utils.mergeMorphTargetTracks(e.clone(),s)).tracks,o=[],l=[];for(let e=0;e<a.length;++e){const n=a[e],i=t.PropertyBinding.parseTrackName(n.name);let c=t.PropertyBinding.findNode(s,i.nodeName);const h=L[i.propertyName];if("bones"===i.objectName&&(c=c.isSkinnedMesh?c.skeleton.getBoneByName(i.objectIndex):void 0),!c||!h)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',n.name),null;const u=1;let f,p=n.values.length/n.times.length;h===L.morphTargetInfluences&&(p/=c.morphTargetInfluences.length),n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(f="CUBICSPLINE",p/=3):f=n.getInterpolation()===t.InterpolateDiscrete?"STEP":"LINEAR",l.push({input:this.processAccessor(new t.BufferAttribute(n.times,u)),output:this.processAccessor(new t.BufferAttribute(n.values,p)),interpolation:f}),o.push({sampler:l.length-1,target:{node:r.get(c),path:h}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:l,channels:o}),n.animations.length-1}processSkin(e){const s=this.json,n=this.nodeMap;if(void 0!==s.nodes&&e instanceof t.SkinnedMesh){const i=s.nodes[n.get(e)],r=e.skeleton;if(void 0===r)return null;const a=e.skeleton.bones[0];if(void 0===a)return null;const o=[],l=new Float32Array(16*r.bones.length),c=new t.Matrix4;for(let t=0;t<r.bones.length;++t)o.push(n.get(r.bones[t])),c.copy(r.boneInverses[t]),c.multiply(e.bindMatrix).toArray(l,16*t);void 0===s.skins&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new t.BufferAttribute(l,16)),joints:o,skeleton:n.get(a)});return i.skin=s.skins.length-1}return null}processNode(e){const s=this.json,n=this.options,i=this.nodeMap;s.nodes||(s.nodes=[]);const r={};if(n.trs){const t=e.quaternion.toArray(),s=e.position.toArray(),n=e.scale.toArray();this.equalArray(t,[0,0,0,1])||(r.rotation=t),this.equalArray(s,[0,0,0])||(r.translation=s),this.equalArray(n,[1,1,1])||(r.scale=n)}else e.matrixAutoUpdate&&e.updateMatrix(),this.isIdentityMatrix(e.matrix)||(r.matrix=e.matrix.elements);if(""!==e.name&&(r.name=String(e.name)),this.serializeUserData(e,r),(e instanceof t.Mesh&&e.isMesh||e instanceof t.Line&&e.isLine||e instanceof t.Points&&e.isPoints)&&e instanceof t.Mesh){const t=this.processMesh(e);null!==t&&(r.mesh=t)}else e instanceof t.Camera&&e.isCamera&&(r.camera=this.processCamera(e));if(e instanceof t.SkinnedMesh&&e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const t=[];for(let s=0,i=e.children.length;s<i;s++){const i=e.children[s];if(i.visible||!n.onlyVisible){const e=this.processNode(i);null!==e&&t.push(e)}}t.length>0&&(r.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,r)}));const a=s.nodes.push(r)-1;return i.set(e,a),a}processScene(e){const t=this.json,s=this.options;t.scenes||(t.scenes=[],t.scene=0);const n={};""!==e.name&&(n.name=e.name),t.scenes.push(n);const i=[];for(let t=0,n=e.children.length;t<n;t++){const n=e.children[t];if(n.visible||!s.onlyVisible){const e=this.processNode(n);null!==e&&i.push(e)}}i.length>0&&(n.nodes=i),this.serializeUserData(e,n)}processObjects(e){const s=new t.Scene;s.name="AuxScene";for(let t=0;t<e.length;t++)s.children.push(e[t]);this.processScene(s)}processInput(e){const s=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const n=[];for(let s=0;s<e.length;s++){const i=e[s];i instanceof t.Scene?this.processScene(i):n.push(e[s])}n.length>0&&this.processObjects(n);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let t=0;void 0!==s.animations&&t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,s=this.plugins.length;t<s;t++)e(this.plugins[t])}equalArray(e,t){return e.length===t.length&&e.every((function(e,s){return e===t[s]}))}stringToArrayBuffer(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;const t=new Uint8Array(new ArrayBuffer(e.length));for(let s=0,n=e.length;s<n;s++){const n=e.charCodeAt(s);t[s]=n>255?32:n}return t.buffer}isIdentityMatrix(e){return this.equalArray(e.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}getMinMax(e,t,s){const n={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let i=t;i<t+s;i++)for(let t=0;t<e.itemSize;t++){let s;e.itemSize>4?s=e.array[i*e.itemSize+t]:0===t?s=e.getX(i):1===t?s=e.getY(i):2===t?s=e.getZ(i):3===t&&(s=e.getW(i)),void 0!==s&&(n.min[t]=Math.min(n.min[t],s),n.max[t]=Math.max(n.max[t],s))}return n}getPaddedBufferSize(e){return 4*Math.ceil(e/4)}getPaddedArrayBuffer(e,t=0){const s=this.getPaddedBufferSize(e.byteLength);if(s!==e.byteLength){const n=new Uint8Array(s);if(n.set(new Uint8Array(e)),0!==t)for(let i=e.byteLength;i<s;i++)n[i]=t;return n.buffer}return e}}class I{constructor(e){n.default(this,"writer",void 0),n.default(this,"name",void 0),this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!(e instanceof t.DirectionalLight&&e.isDirectionalLight||e instanceof t.PointLight&&e.isPointLight||e instanceof t.SpotLight&&e.isSpotLight))return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);const n=this.writer,i=n.json,r=n.extensionsUsed,a={};if(e.name&&(a.name=e.name),a.color=e.color.toArray(),a.intensity=e.intensity,e instanceof t.DirectionalLight&&e.isDirectionalLight?a.type="directional":e instanceof t.PointLight&&e.isPointLight?(a.type="point",e.distance>0&&(a.range=e.distance)):e instanceof t.SpotLight&&e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e instanceof t.DirectionalLight||void 0===e.decay||2===e.decay||console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e instanceof t.PointLight||!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),r[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},r[this.name]=!0),void 0!==i.extensions){const e=i.extensions[this.name].lights;e.push(a),s.extensions=s.extensions||{},s.extensions[this.name]={light:e.length-1}}}}class R{constructor(e){n.default(this,"writer",void 0),n.default(this,"name",void 0),this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,s){if(!(e instanceof t.MeshBasicMaterial&&e.isMeshBasicMaterial))return;const n=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},n[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}}class F{constructor(e){n.default(this,"writer",void 0),n.default(this,"name",void 0),this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,s){if(!e.isGLTFSpecularGlossinessMaterial)return;const n=this.writer,i=n.extensionsUsed,r={};if(s.pbrMetallicRoughness.baseColorFactor&&(r.diffuseFactor=s.pbrMetallicRoughness.baseColorFactor),e instanceof t.MeshPhongMaterial){const t=[1,1,1];e.specular.toArray(t,0),r.specularFactor=t,r.glossinessFactor=e.glossiness}if(s.pbrMetallicRoughness.baseColorTexture&&(r.diffuseTexture=s.pbrMetallicRoughness.baseColorTexture),(e instanceof t.MeshBasicMaterial||e instanceof t.MeshLambertMaterial||e instanceof t.MeshPhongMaterial)&&e.specularMap){const t={index:n.processTexture(e.specularMap)};n.applyTextureTransform(t,e.specularMap),r.specularGlossinessTexture=t}s.extensions=s.extensions||{},s.extensions[this.name]=r,i[this.name]=!0}}class N{constructor(e){n.default(this,"writer",void 0),n.default(this,"name",void 0),this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!(e instanceof t.MeshPhysicalMaterial&&e.isMeshPhysicalMaterial)||0===e.transmission)return;const n=this.writer,i=n.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){const t={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(t,e.transmissionMap),r.transmissionTexture=t}s.extensions=s.extensions||{},s.extensions[this.name]=r,i[this.name]=!0}}class B{constructor(e){n.default(this,"writer",void 0),n.default(this,"name",void 0),this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!(e instanceof t.MeshPhysicalMaterial&&e.isMeshPhysicalMaterial)||0===e.thickness)return;const n=this.writer,i=n.extensionsUsed,r={};if(r.thickness=e.thickness,e.thicknessMap){const t={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(t,e.thicknessMap),r.thicknessTexture=t}r.attenuationDistance=e.attenuationDistance,r.attenuationColor=e.attenuationTint.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=r,i[this.name]=!0}}exports.GLTFExporter=i;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("three"),n=require("mmd-parser");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(e);exports.MMDExporter=class{constructor(){o.default(this,"u2sTable",void 0)}parseVpd(e,n,r){if(!0!==e.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);let t=e.toString();-1===t.indexOf(".")&&(t+="."),t+="000000";const n=t.indexOf(".");return t.slice(0,n)+"."+t.slice(n+1,n+7)}function s(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(o(e[n]));return t.join(",")}e.updateMatrixWorld(!0);const i=e.skeleton.bones,a=this.getBindBones(e),u=new t.Vector3,c=new t.Quaternion,l=new t.Quaternion,h=new t.Matrix4,p=[];p.push("Vocaloid Pose Data file"),p.push(""),p.push((""!==e.name?e.name.replace(/\s/g,"_"):"skin")+".osm;"),p.push(i.length+";"),p.push("");for(let e=0,t=i.length;e<t;e++){const t=i[e],n=a[e];!0===r&&void 0!==t.userData.ik&&void 0!==t.userData.ik.originalMatrix?h.fromArray(t.userData.ik.originalMatrix):h.copy(t.matrix),u.setFromMatrixPosition(h),c.setFromRotationMatrix(h);const o=u.sub(n.position).toArray(),d=l.copy(n.quaternion).conjugate().multiply(c).toArray();o[2]=-o[2],d[0]=-d[0],d[1]=-d[1],p.push("Bone"+e+"{"+t.name),p.push(" "+s(o)+";"),p.push(" "+s(d)+";"),p.push("}"),p.push("")}p.push("");const d=p.join("\n");return!0===n?this.unicodeToShiftjis(d):d}unicodeToShiftjis(e){if(void 0===this.u2sTable){const e=(new n.CharsetEncoder).s2uTable;this.u2sTable={};const t=Object.keys(e);for(let n=0,r=t.length;n<r;n++){let r=t[n];const o=e[r];this.u2sTable[o]=parseInt(r)}}const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n),o=this.u2sTable[r];if(void 0===o)throw"cannot convert charcode 0x"+r.toString(16);o>255?(t.push(o>>8&255),t.push(255&o)):t.push(255&o)}return new Uint8Array(t)}getBindBones(e){const t=e.clone();return t.pose(),t.skeleton.bones}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("three");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=i(t);exports.OBJExporter=class{constructor(){r.default(this,"output",void 0),r.default(this,"indexVertex",void 0),r.default(this,"indexVertexUvs",void 0),r.default(this,"indexNormals",void 0),r.default(this,"vertex",void 0),r.default(this,"color",void 0),r.default(this,"normal",void 0),r.default(this,"uv",void 0),r.default(this,"face",void 0),this.output="",this.indexVertex=0,this.indexVertexUvs=0,this.indexNormals=0,this.vertex=new e.Vector3,this.color=new e.Color,this.normal=new e.Vector3,this.uv=new e.Vector2,this.face=[]}parse(t){return t.traverse((t=>{t instanceof e.Mesh&&t.isMesh&&this.parseMesh(t),t instanceof e.Line&&t.isLine&&this.parseLine(t),t instanceof e.Points&&t.isPoints&&this.parsePoints(t)})),this.output}parseMesh(t){let i=0,r=0,o=0;const s=t.geometry,n=new e.Matrix3;if(!s.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const h=s.getAttribute("position"),u=s.getAttribute("normal"),x=s.getAttribute("uv"),a=s.getIndex();if(this.output+=`o ${t.name}\n`,t.material&&!Array.isArray(t.material)&&t.material.name&&(this.output+=`usemtl ${t.material.name}\n`),void 0!==h)for(let e=0,r=h.count;e<r;e++,i++)this.vertex.x=h.getX(e),this.vertex.y=h.getY(e),this.vertex.z=h.getZ(e),this.vertex.applyMatrix4(t.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if(void 0!==x)for(let t=0,e=x.count;t<e;t++,o++)this.uv.x=x.getX(t),this.uv.y=x.getY(t),this.output+=`vt ${this.uv.x} ${this.uv.y}\n`;if(void 0!==u){n.getNormalMatrix(t.matrixWorld);for(let t=0,e=u.count;t<e;t++,r++)this.normal.x=u.getX(t),this.normal.y=u.getY(t),this.normal.z=u.getZ(t),this.normal.applyMatrix3(n).normalize(),this.output+=`vn ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`}if(null!==a)for(let t=0,e=a.count;t<e;t+=3){for(let e=0;e<3;e++){const i=a.getX(t+e)+1;this.face[e]=this.indexVertex+i+(u||x?`/${x?this.indexVertexUvs+i:""}${u?`/${this.indexNormals+i}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}else for(let t=0,e=h.count;t<e;t+=3){for(let e=0;e<3;e++){const i=t+e+1;this.face[e]=this.indexVertex+i+(u||x?`/${x?this.indexVertexUvs+i:""}${u?`/${this.indexNormals+i}`:""}`:"")}this.output+=`f ${this.face.join(" ")}\n`}this.indexVertex+=i,this.indexVertexUvs+=o,this.indexNormals+=r}parseLine(t){let e=0;const i=t.geometry,r=t.type;if(i.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const o=i.getAttribute("position");if(this.output+=`o ${t.name}\n`,void 0!==o)for(let i=0,r=o.count;i<r;i++,e++)this.vertex.x=o.getX(i),this.vertex.y=o.getY(i),this.vertex.z=o.getZ(i),this.vertex.applyMatrix4(t.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}\n`;if("Line"===r){this.output+="l ";for(let t=1,e=o.count;t<=e;t++)this.output+=`${this.indexVertex+t} `;this.output+="\n"}if("LineSegments"===r)for(let t=1,e=t+1,i=o.count;t<i;t+=2,e=t+1)this.output+=`l ${this.indexVertex+t} ${this.indexVertex+e}\n`;this.indexVertex+=e}parsePoints(t){let i=0;const r=t.geometry;if(!r.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const o=r.getAttribute("position"),s=r.getAttribute("color");if(this.output+=`o ${t.name}\n`,void 0!==o)for(let r=0,n=o.count;r<n;r++,i++)this.vertex.fromBufferAttribute(o,r),this.vertex.applyMatrix4(t.matrixWorld),this.output+=`v ${this.vertex.x} ${this.vertex.y} ${this.vertex.z}`,void 0!==s&&s instanceof e.BufferAttribute&&(this.color.fromBufferAttribute(s,r),this.output+=` ${this.color.r} ${this.color.g} ${this.color.b}`),this.output+="\n";this.output+="p ";for(let t=1,e=o.count;t<=e;t++)this.output+=`${this.indexVertex+t} `;this.output+="\n",this.indexVertex+=i}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");exports.PLYExporter=class{parse(e,n,r){n&&"object"==typeof n&&(console.warn('THREE.PLYExporter: The options parameter is now the third argument to the "parse" function. See the documentation for the new API.'),r=n,n=void 0);const i=(r=Object.assign({binary:!1,excludeAttributes:[],littleEndian:!1},r)).excludeAttributes;let o=!1,l=!1,a=!1,s=0,u=0;e.traverse((function(e){if(e instanceof t.Mesh&&e.isMesh){const t=e.geometry;if(!t.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");const n=t.getAttribute("position"),r=t.getAttribute("normal"),i=t.getAttribute("uv"),f=t.getAttribute("color"),d=t.getIndex();if(void 0===n)return;s+=n.count,u+=d?d.count/3:n.count/3,void 0!==r&&(o=!0),void 0!==i&&(a=!0),void 0!==f&&(l=!0)}}));const f=-1===(null==i?void 0:i.indexOf("index"));if(o=o&&-1===(null==i?void 0:i.indexOf("normal")),l=l&&-1===(null==i?void 0:i.indexOf("color")),a=a&&-1===(null==i?void 0:i.indexOf("uv")),f&&u!==Math.floor(u))return console.error("PLYExporter: Failed to generate a valid PLY file with triangle indices because the number of indices is not divisible by 3."),null;let d=`ply\nformat ${r.binary?r.littleEndian?"binary_little_endian":"binary_big_endian":"ascii"} 1.0\nelement vertex ${s}\nproperty float x\nproperty float y\nproperty float z\n`;o&&(d+="property float nx\nproperty float ny\nproperty float nz\n"),a&&(d+="property float s\nproperty float t\n"),l&&(d+="property uchar red\nproperty uchar green\nproperty uchar blue\n"),f&&(d+=`element face ${u}\nproperty list uchar int vertex_index\n`),d+="end_header\n";const g=new t.Vector3,c=new t.Matrix3;let p=null;if(r.binary){const t=(new TextEncoder).encode(d),n=s*(12+(o?12:0)+(l?3:0)+(a?8:0)),i=f?13*u:0,y=new DataView(new ArrayBuffer(t.length+n+i));new Uint8Array(y.buffer).set(t,0);let x=t.length,E=t.length+n,h=0;this.traverseMeshes(e,(function(t,e){const n=e.getAttribute("position"),i=e.getAttribute("normal"),s=e.getAttribute("uv"),u=e.getAttribute("color"),d=e.getIndex();c.getNormalMatrix(t.matrixWorld);for(let e=0,f=n.count;e<f;e++)g.x=n.getX(e),g.y=n.getY(e),g.z=n.getZ(e),g.applyMatrix4(t.matrixWorld),y.setFloat32(x,g.x,r.littleEndian),x+=4,y.setFloat32(x,g.y,r.littleEndian),x+=4,y.setFloat32(x,g.z,r.littleEndian),x+=4,o&&(null!=i?(g.x=i.getX(e),g.y=i.getY(e),g.z=i.getZ(e),g.applyMatrix3(c).normalize(),y.setFloat32(x,g.x,r.littleEndian),x+=4,y.setFloat32(x,g.y,r.littleEndian),x+=4,y.setFloat32(x,g.z,r.littleEndian),x+=4):(y.setFloat32(x,0,r.littleEndian),x+=4,y.setFloat32(x,0,r.littleEndian),x+=4,y.setFloat32(x,0,r.littleEndian),x+=4)),a&&(null!=s?(y.setFloat32(x,s.getX(e),r.littleEndian),x+=4,y.setFloat32(x,s.getY(e),r.littleEndian),x+=4):a||(y.setFloat32(x,0,r.littleEndian),x+=4,y.setFloat32(x,0,r.littleEndian),x+=4)),l&&(null!=u?(y.setUint8(x,Math.floor(255*u.getX(e))),x+=1,y.setUint8(x,Math.floor(255*u.getY(e))),x+=1,y.setUint8(x,Math.floor(255*u.getZ(e))),x+=1):(y.setUint8(x,255),x+=1,y.setUint8(x,255),x+=1,y.setUint8(x,255),x+=1));if(f)if(null!==d)for(let t=0,e=d.count;t<e;t+=3)y.setUint8(E,3),E+=1,y.setUint32(E,d.getX(t+0)+h,r.littleEndian),E+=4,y.setUint32(E,d.getX(t+1)+h,r.littleEndian),E+=4,y.setUint32(E,d.getX(t+2)+h,r.littleEndian),E+=4;else for(let t=0,e=n.count;t<e;t+=3)y.setUint8(E,3),E+=1,y.setUint32(E,h+t,r.littleEndian),E+=4,y.setUint32(E,h+t+1,r.littleEndian),E+=4,y.setUint32(E,h+t+2,r.littleEndian),E+=4;h+=n.count})),p=y.buffer}else{let t=0,n="",r="";this.traverseMeshes(e,(function(e,i){const s=i.getAttribute("position"),d=i.getAttribute("normal"),p=i.getAttribute("uv"),y=i.getAttribute("color"),x=i.getIndex();c.getNormalMatrix(e.matrixWorld);for(let t=0,r=s.count;t<r;t++){g.x=s.getX(t),g.y=s.getY(t),g.z=s.getZ(t),g.applyMatrix4(e.matrixWorld);let r=g.x+" "+g.y+" "+g.z;o&&(null!=d?(g.x=d.getX(t),g.y=d.getY(t),g.z=d.getZ(t),g.applyMatrix3(c).normalize(),r+=" "+g.x+" "+g.y+" "+g.z):r+=" 0 0 0"),a&&(null!=p?r+=" "+p.getX(t)+" "+p.getY(t):a&&(r+=" 0 0")),l&&(r+=null!=y?" "+Math.floor(255*y.getX(t))+" "+Math.floor(255*y.getY(t))+" "+Math.floor(255*y.getZ(t)):" 255 255 255"),n+=r+"\n"}if(f){if(null!==x)for(let e=0,n=x.count;e<n;e+=3)r+=`3 ${x.getX(e+0)+t}`,r+=` ${x.getX(e+1)+t}`,r+=` ${x.getX(e+2)+t}\n`;else for(let e=0,n=s.count;e<n;e+=3)r+=`3 ${t+e} ${t+e+1} ${t+e+2}\n`;u+=x?x.count/3:s.count/3}t+=s.count})),p=`${d}${n}${f?`${r}\n`:"\n"}`}return"function"==typeof n&&requestAnimationFrame((()=>n&&n("string"==typeof p?p:""))),p}traverseMeshes(e,n){e.traverse((function(e){if(e instanceof t.Mesh&&e.isMesh){const t=e,r=t.geometry;if(!r.isBufferGeometry)throw new Error("THREE.PLYExporter: Geometry is not of type THREE.BufferGeometry.");r.hasAttribute("position")&&n(t,r)}}))}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("three");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(t);exports.STLExporter=class{constructor(){s.default(this,"binary",void 0),s.default(this,"output",void 0),s.default(this,"offset",void 0),s.default(this,"objects",void 0),s.default(this,"triangles",void 0),s.default(this,"vA",void 0),s.default(this,"vB",void 0),s.default(this,"vC",void 0),s.default(this,"cb",void 0),s.default(this,"ab",void 0),s.default(this,"normal",void 0),this.binary=!1,this.output="",this.offset=80,this.objects=[],this.triangles=0,this.vA=new e.Vector3,this.vB=new e.Vector3,this.vC=new e.Vector3,this.cb=new e.Vector3,this.ab=new e.Vector3,this.normal=new e.Vector3}parse(t,i){if(this.binary=void 0!==i.binary&&i.binary,t.traverse((t=>{if(t instanceof e.Mesh&&t.isMesh){const e=t.geometry;if(!e.isBufferGeometry)throw new Error("THREE.STLExporter: Geometry is not of type THREE.BufferGeometry.");const i=e.index,s=e.getAttribute("position");this.triangles+=null!==i?i.count/3:s.count/3,this.objects.push({object3d:t,geometry:e})}})),this.binary){const t=2*this.triangles+3*this.triangles*4*4+80+4,e=new ArrayBuffer(t);this.output=new DataView(e),this.output.setUint32(this.offset,this.triangles,!0),this.offset+=4}else this.output="",this.output+="solid exported\n";for(let t=0,i=this.objects.length;t<i;t++){const i=this.objects[t].object3d,s=this.objects[t].geometry,o=s.index,r=s.getAttribute("position");if(i instanceof e.SkinnedMesh)if(null!==o)for(let t=0;t<o.count;t+=3){const e=o.getX(t+0),s=o.getX(t+1),h=o.getX(t+2);this.writeFace(e,s,h,r,i)}else for(let t=0;t<r.count;t+=3){const e=t+0,s=t+1,o=t+2;this.writeFace(e,s,o,r,i)}}return this.binary||(this.output+="endsolid exported\n"),this.output}writeFace(t,e,i,s,o){this.vA.fromBufferAttribute(s,t),this.vB.fromBufferAttribute(s,e),this.vC.fromBufferAttribute(s,i),o.isSkinnedMesh&&(o.boneTransform(t,this.vA),o.boneTransform(e,this.vB),o.boneTransform(i,this.vC)),this.vA.applyMatrix4(o.matrixWorld),this.vB.applyMatrix4(o.matrixWorld),this.vC.applyMatrix4(o.matrixWorld),this.writeNormal(this.vA,this.vB,this.vC),this.writeVertex(this.vA),this.writeVertex(this.vB),this.writeVertex(this.vC),this.binary&&this.output instanceof DataView?(this.output.setUint16(this.offset,0,!0),this.offset+=2):(this.output+="\t\tendloop\n",this.output+="\tendfacet\n")}writeNormal(t,e,i){this.cb.subVectors(i,e),this.ab.subVectors(t,e),this.cb.cross(this.ab).normalize(),this.normal.copy(this.cb).normalize(),this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,this.normal.x,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.y,!0),this.offset+=4,this.output.setFloat32(this.offset,this.normal.z,!0),this.offset+=4):(this.output+=`\tfacet normal ${this.normal.x} ${this.normal.y} ${this.normal.z}\n`,this.output+="\t\touter loop\n")}writeVertex(t){this.binary&&this.output instanceof DataView?(this.output.setFloat32(this.offset,t.x,!0),this.offset+=4,this.output.setFloat32(this.offset,t.y,!0),this.offset+=4,this.output.setFloat32(this.offset,t.z,!0),this.offset+=4):this.output+="\t\t\tvertex vertex.x vertex.y vertex.z\n"}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("fflate"),i=require("three");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(t);exports.USDZExporter=class{constructor(){r.default(this,"PRECISION",7),r.default(this,"materials",void 0),r.default(this,"textures",void 0),r.default(this,"files",void 0),this.materials={},this.textures={},this.files={}}async parse(t){this.files["model.usda"]=null;let n=this.buildHeader();t.traverseVisible((t=>{if(t instanceof i.Mesh&&t.isMesh&&t.material.isMeshStandardMaterial){const e=t.geometry,i=t.material,r="geometries/Geometry_"+e.id+".usd";if(!(r in this.files)){const t=this.buildMeshObject(e);this.files[r]=this.buildUSDFileAsString(t)}i.uuid in this.materials||(this.materials[i.uuid]=i),n+=this.buildXform(t,e,i)}})),n+=this.buildMaterials(this.materials),this.files["model.usda"]=e.strToU8(n),n=null;for(const t in this.textures){const e=this.textures[t],i=t.split("_")[1],n=1023===e.format,r=this.imageToCanvas(e.image,i),s=await new Promise((t=>null==r?void 0:r.toBlob(t,n?"image/png":"image/jpeg",1)));s&&(this.files[`textures/Texture_${t}.${n?"png":"jpg"}`]=new Uint8Array(await s.arrayBuffer()))}let r=0;for(const t in this.files){const e=this.files[t];r+=34+t.length;const i=63&r;if(4!==i&&null!==e&&e instanceof Uint8Array){const n=new Uint8Array(64-i);this.files[t]=[e,{extra:{12345:n}}]}e&&"number"==typeof e.length&&(r=e.length)}return e.zipSync(this.files,{level:0})}imageToCanvas(t,e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=1024/Math.max(t.width,t.height),n=document.createElement("canvas");n.width=t.width*Math.min(1,i),n.height=t.height*Math.min(1,i);const r=n.getContext("2d");if(null==r||r.drawImage(t,0,0,n.width,n.height),void 0!==e){const t=parseInt(e,16),i=(t>>16&255)/255,s=(t>>8&255)/255,a=(255&t)/255,o=null==r?void 0:r.getImageData(0,0,n.width,n.height);if(o){const t=null==o?void 0:o.data;for(let e=0;e<t.length;e+=4)t[e+0]=t[e+0]*i,t[e+1]=t[e+1]*s,t[e+2]=t[e+2]*a;null==r||r.putImageData(o,0,0)}}return n}}buildHeader(){return'#usda 1.0\n(\n customLayerData = {\n string creator = "Three.js USDZExporter"\n }\n metersPerUnit = 1\n upAxis = "Y"\n)\n'}buildUSDFileAsString(t){let i=this.buildHeader();return i+=t,e.strToU8(i)}buildXform(t,e,i){const n="Object_"+t.id,r=this.buildMatrix(t.matrixWorld);return t.matrixWorld.determinant()<0&&console.warn("THREE.USDZExporter: USDZ does not support negative scales",t),`def Xform "${n}" (\n prepend references = @./geometries/Geometry_${e.id}.usd@</Geometry>\n)\n{\n matrix4d xformOp:transform = ${r}\n uniform token[] xformOpOrder = ["xformOp:transform"]\n rel material:binding = </Materials/Material_${i.id}>\n}\n`}buildMatrix(t){const e=t.elements;return`( ${this.buildMatrixRow(e,0)}, ${this.buildMatrixRow(e,4)}, ${this.buildMatrixRow(e,8)}, ${this.buildMatrixRow(e,12)} )`}buildMatrixRow(t,e){return`(${t[e+0]}, ${t[e+1]}, ${t[e+2]}, ${t[e+3]})`}buildMeshObject(t){return`\ndef "Geometry"\n{\n ${this.buildMesh(t)}\n}\n`}buildMesh(t){const e=t.attributes,i=e.position.count;return`\n def Mesh "Geometry"\n {\n int[] faceVertexCounts = [${this.buildMeshVertexCount(t)}]\n int[] faceVertexIndices = [${this.buildMeshVertexIndices(t)}]\n normal3f[] normals = [${this.buildVector3Array(e.normal,i)}] (\n interpolation = "vertex"\n )\n point3f[] points = [${this.buildVector3Array(e.position,i)}]\n float2[] primvars:st = [${this.buildVector2Array(e.uv,i)}] (\n interpolation = "vertex"\n )\n uniform token subdivisionScheme = "none"\n }\n`}buildMeshVertexCount(t){const e=null!==t.index?t.index.array.length:t.attributes.position.count;return Array(e/3).fill(3).join(", ")}buildMeshVertexIndices(t){if(null!==t.index)return t.index.array.join(", ");const e=[],i=t.attributes.position.count;for(let t=0;t<i;t++)e.push(t);return e.join(", ")}buildVector3Array(t,e){if(void 0===t)return console.warn("USDZExporter: Normals missing."),Array(e).fill("(0, 0, 0)").join(", ");const i=[],n=t.array;for(let t=0;t<n.length;t+=3)i.push(`(${n[t+0].toPrecision(this.PRECISION)}, ${n[t+1].toPrecision(this.PRECISION)}, ${n[t+2].toPrecision(this.PRECISION)})`);return i.join(", ")}buildVector2Array(t,e){if(void 0===t)return console.warn("USDZExporter: UVs missing."),Array(e).fill("(0, 0)").join(", ");const i=[],n=t.array;for(let t=0;t<n.length;t+=2)i.push(`(${n[t+0].toPrecision(this.PRECISION)}, ${1-n[t+1].toPrecision(this.PRECISION)})`);return i.join(", ")}buildMaterials(t){const e=[];for(const i in t){const n=t[i];e.push(this.buildMaterial(n))}return`def "Materials"\n{\n${e.join("")}\n}\n`}buildMaterial(t){const e=" ",n=[],r=[];return null!==t.map?(n.push(`${e}color3f inputs:diffuseColor.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:rgb>`),r.push(this.buildTexture(t,t.map,"diffuse",t.color))):n.push(`${e}color3f inputs:diffuseColor = ${this.buildColor(t.color)}`),null!==t.emissiveMap?(n.push(`${e}color3f inputs:emissiveColor.connect = </Materials/Material_${t.id}/Texture_${t.emissiveMap.id}_emissive.outputs:rgb>`),r.push(this.buildTexture(t,t.emissiveMap,"emissive"))):t.emissive.getHex()>0&&n.push(`${e}color3f inputs:emissiveColor = ${this.buildColor(t.emissive)}`),null!==t.normalMap&&(n.push(`${e}normal3f inputs:normal.connect = </Materials/Material_${t.id}/Texture_${t.normalMap.id}_normal.outputs:rgb>`),r.push(this.buildTexture(t,t.normalMap,"normal"))),null!==t.aoMap&&(n.push(`${e}float inputs:occlusion.connect = </Materials/Material_${t.id}/Texture_${t.aoMap.id}_occlusion.outputs:r>`),r.push(this.buildTexture(t,t.aoMap,"occlusion"))),null!==t.roughnessMap&&1===t.roughness?(n.push(`${e}float inputs:roughness.connect = </Materials/Material_${t.id}/Texture_${t.roughnessMap.id}_roughness.outputs:g>`),r.push(this.buildTexture(t,t.roughnessMap,"roughness"))):n.push(`${e}float inputs:roughness = ${t.roughness}`),null!==t.metalnessMap&&1===t.metalness?(n.push(`${e}float inputs:metallic.connect = </Materials/Material_${t.id}/Texture_${t.metalnessMap.id}_metallic.outputs:b>`),r.push(this.buildTexture(t,t.metalnessMap,"metallic"))):n.push(`${e}float inputs:metallic = ${t.metalness}`),n.push(`${e}float inputs:opacity = ${t.opacity}`),t instanceof i.MeshPhysicalMaterial&&(n.push(`${e}float inputs:clearcoat = ${t.clearcoat}`),n.push(`${e}float inputs:clearcoatRoughness = ${t.clearcoatRoughness}`),n.push(`${e}float inputs:ior = ${t.ior}`)),`\n def Material "Material_${t.id}"\n {\n def Shader "PreviewSurface"\n {\n uniform token info:id = "UsdPreviewSurface"\n${n.join("\n")}\n int inputs:useSpecularWorkflow = 0\n token outputs:surface\n }\n token outputs:surface.connect = </Materials/Material_${t.id}/PreviewSurface.outputs:surface>\n token inputs:frame:stPrimvarName = "st"\n def Shader "uvReader_st"\n {\n uniform token info:id = "UsdPrimvarReader_float2"\n token inputs:varname.connect = </Materials/Material_${t.id}.inputs:frame:stPrimvarName>\n float2 inputs:fallback = (0.0, 0.0)\n float2 outputs:result\n }\n${r.join("\n")}\n }\n`}buildTexture(t,e,i,n){const r=e.id+(n?"_"+n.getHexString():""),s=1023===e.format;return this.textures[r]=e,`\n def Shader "Transform2d_${i}" (\n sdrMetadata = {\n string role = "math"\n }\n )\n {\n uniform token info:id = "UsdTransform2d"\n float2 inputs:in.connect = </Materials/Material_${t.id}/uvReader_st.outputs:result>\n float2 inputs:scale = ${this.buildVector2(e.repeat)}\n float2 inputs:translation = ${this.buildVector2(e.offset)}\n float2 outputs:result\n }\n def Shader "Texture_${e.id}_${i}"\n {\n uniform token info:id = "UsdUVTexture"\n asset inputs:file = @textures/Texture_${r}.${s?"png":"jpg"}@\n float2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${i}.outputs:result>\n token inputs:wrapS = "repeat"\n token inputs:wrapT = "repeat"\n float outputs:r\n float outputs:g\n float outputs:b\n float3 outputs:rgb\n }`}buildColor(t){return`(${t.r}, ${t.g}, ${t.b})`}buildVector2(t){return`(${t.x}, ${t.y})`}};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");class t extends e.BufferGeometry{constructor(t,s,r,o,u,h){super();const p=(t=t||1)/2,f=(s=s||1)/2,l=(r=r||1)/2,i=t/(o=Math.floor(o)||1),a=s/(u=Math.floor(u)||1),n=r/(h=Math.floor(h)||1),c=[];let x=-p,M=-f,b=-l;for(let e=0;e<=o;e++)c.push(x,-f,-l,x,f,-l),c.push(x,f,-l,x,f,l),c.push(x,f,l,x,-f,l),c.push(x,-f,l,x,-f,-l),x+=i;for(let e=0;e<=u;e++)c.push(-p,M,-l,p,M,-l),c.push(p,M,-l,p,M,l),c.push(p,M,l,-p,M,l),c.push(-p,M,l,-p,M,-l),M+=a;for(let e=0;e<=h;e++)c.push(-p,-f,b,-p,f,b),c.push(-p,f,b,p,f,b),c.push(p,f,b,p,-f,b),c.push(p,-f,b,-p,-f,b),b+=n;this.setAttribute("position",new e.Float32BufferAttribute(c,3))}}exports.BoxLineGeometry=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("../math/ConvexHull.cjs.js");class o extends e.BufferGeometry{constructor(o=[]){super();const r=[],n=[];void 0===t.ConvexHull&&console.error("THREE.ConvexGeometry: ConvexGeometry relies on ConvexHull");const s=(new t.ConvexHull).setFromPoints(o).faces;for(let e=0;e<s.length;e++){const t=s[e];let o=t.edge;do{const e=o.head().point;r.push(e.x,e.y,e.z),n.push(t.normal.x,t.normal.y,t.normal.z),o=o.next}while(o!==t.edge)}this.setAttribute("position",new e.Float32BufferAttribute(r,3)),this.setAttribute("normal",new e.Float32BufferAttribute(n,3))}}exports.ConvexGeometry=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class o extends t.BufferGeometry{constructor(o,n,s,r){super();const i=[],u=[],p=[],l=new t.Vector3,c=new t.Matrix4;c.makeRotationFromEuler(s),c.setPosition(n);const a=new t.Matrix4;function h(t,n,s){n.applyMatrix4(o.matrixWorld),n.applyMatrix4(a),s.transformDirection(o.matrixWorld),t.push(new e(n.clone(),s.clone()))}function f(t,o){const e=[],n=.5*Math.abs(r.dot(o));for(let s=0;s<t.length;s+=3){let r,i,u,p,l,c,a,h=0;const f=t[s+0].position.dot(o)-n,x=t[s+1].position.dot(o)-n,y=t[s+2].position.dot(o)-n;switch(r=f>0,i=x>0,u=y>0,h=(r?1:0)+(i?1:0)+(u?1:0),h){case 0:e.push(t[s]),e.push(t[s+1]),e.push(t[s+2]);break;case 1:if(r&&(p=t[s+1],l=t[s+2],c=m(t[s],p,o,n),a=m(t[s],l,o,n)),i){p=t[s],l=t[s+2],c=m(t[s+1],p,o,n),a=m(t[s+1],l,o,n),e.push(c),e.push(l.clone()),e.push(p.clone()),e.push(l.clone()),e.push(c.clone()),e.push(a);break}u&&(p=t[s],l=t[s+1],c=m(t[s+2],p,o,n),a=m(t[s+2],l,o,n)),e.push(p.clone()),e.push(l.clone()),e.push(c),e.push(a),e.push(c.clone()),e.push(l.clone());break;case 2:r||(p=t[s].clone(),l=m(p,t[s+1],o,n),c=m(p,t[s+2],o,n),e.push(p),e.push(l),e.push(c)),i||(p=t[s+1].clone(),l=m(p,t[s+2],o,n),c=m(p,t[s],o,n),e.push(p),e.push(l),e.push(c)),u||(p=t[s+2].clone(),l=m(p,t[s],o,n),c=m(p,t[s+1],o,n),e.push(p),e.push(l),e.push(c))}}return e}function m(o,n,s,r){const i=o.position.dot(s)-r,u=i/(i-(n.position.dot(s)-r));return new e(new t.Vector3(o.position.x+u*(n.position.x-o.position.x),o.position.y+u*(n.position.y-o.position.y),o.position.z+u*(n.position.z-o.position.z)),new t.Vector3(o.normal.x+u*(n.normal.x-o.normal.x),o.normal.y+u*(n.normal.y-o.normal.y),o.normal.z+u*(n.normal.z-o.normal.z)))}a.copy(c).invert(),function(){let e,n=[];const s=new t.Vector3,a=new t.Vector3;if(!0===o.geometry.isGeometry)return void console.error("THREE.DecalGeometry no longer supports THREE.Geometry. Use BufferGeometry instead.");const m=o.geometry,x=m.attributes.position,y=m.attributes.normal;if(null!==m.index){const t=m.index;for(e=0;e<t.count;e++)s.fromBufferAttribute(x,t.getX(e)),a.fromBufferAttribute(y,t.getX(e)),h(n,s,a)}else for(e=0;e<x.count;e++)s.fromBufferAttribute(x,e),a.fromBufferAttribute(y,e),h(n,s,a);for(n=f(n,l.set(1,0,0)),n=f(n,l.set(-1,0,0)),n=f(n,l.set(0,1,0)),n=f(n,l.set(0,-1,0)),n=f(n,l.set(0,0,1)),n=f(n,l.set(0,0,-1)),e=0;e<n.length;e++){const t=n[e];p.push(.5+t.position.x/r.x,.5+t.position.y/r.y),t.position.applyMatrix4(c),i.push(t.position.x,t.position.y,t.position.z),u.push(t.normal.x,t.normal.y,t.normal.z)}}(),this.setAttribute("position",new t.Float32BufferAttribute(i,3)),this.setAttribute("normal",new t.Float32BufferAttribute(u,3)),this.setAttribute("uv",new t.Float32BufferAttribute(p,2))}}class e{constructor(t,o){this.position=t,this.normal=o}clone(){return new this.constructor(this.position.clone(),this.normal.clone())}}exports.DecalGeometry=o,exports.DecalVertex=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three"),i=require("../math/SimplexNoise.cjs.js");require("@babel/runtime/helpers/defineProperty");class e extends t.BufferGeometry{constructor(t){super(),this.type="LightningStrike",t=t||{},this.init(e.copyParameters(t,t)),this.createMesh()}update(t){this.isStatic||(this.rayParameters.isEternal||this.rayParameters.birthTime<=t&&t<=this.rayParameters.deathTime?(this.updateMesh(t),t<this.subrays[0].endPropagationTime?this.state=e.RAY_PROPAGATING:t>this.subrays[0].beginVanishingTime?this.state=e.RAY_VANISHING:this.state=e.RAY_STEADY,this.visible=!0):(this.visible=!1,t<this.rayParameters.birthTime?this.state=e.RAY_UNBORN:this.state=e.RAY_EXTINGUISHED))}init(r){this.rayParameters=r,this.maxIterations=void 0!==r.maxIterations?Math.floor(r.maxIterations):9,r.maxIterations=this.maxIterations,this.isStatic=void 0!==r.isStatic&&r.isStatic,r.isStatic=this.isStatic,this.ramification=void 0!==r.ramification?Math.floor(r.ramification):5,r.ramification=this.ramification,this.maxSubrayRecursion=void 0!==r.maxSubrayRecursion?Math.floor(r.maxSubrayRecursion):3,r.maxSubrayRecursion=this.maxSubrayRecursion,this.recursionProbability=void 0!==r.recursionProbability?r.recursionProbability:.6,r.recursionProbability=this.recursionProbability,this.generateUVs=void 0!==r.generateUVs&&r.generateUVs,r.generateUVs=this.generateUVs,void 0!==r.randomGenerator?(this.randomGenerator=r.randomGenerator,this.seedGenerator=r.randomGenerator,void 0!==r.noiseSeed&&this.seedGenerator.setSeed(r.noiseSeed)):(this.randomGenerator=e.createRandomGenerator(),this.seedGenerator=Math),void 0!==r.onDecideSubrayCreation?this.onDecideSubrayCreation=r.onDecideSubrayCreation:(this.createDefaultSubrayCreationCallbacks(),void 0!==r.onSubrayCreation&&(this.onSubrayCreation=r.onSubrayCreation)),this.state=e.RAY_INITIALIZED,this.maxSubrays=Math.ceil(1+Math.pow(this.ramification,Math.max(0,this.maxSubrayRecursion-1))),r.maxSubrays=this.maxSubrays,this.maxRaySegments=2*(1<<this.maxIterations),this.subrays=[];for(let t=0;t<this.maxSubrays;t++)this.subrays.push(this.createSubray());this.raySegments=[];for(let t=0;t<this.maxRaySegments;t++)this.raySegments.push(this.createSegment());this.time=0,this.timeFraction=0,this.currentSegmentCallback=null,this.currentCreateTriangleVertices=this.generateUVs?this.createTriangleVerticesWithUVs:this.createTriangleVerticesWithoutUVs,this.numSubrays=0,this.currentSubray=null,this.currentSegmentIndex=0,this.isInitialSegment=!1,this.subrayProbability=0,this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.vertices=null,this.uvs=null,this.indices=null,this.positionAttribute=null,this.uvsAttribute=null,this.simplexX=new i.SimplexNoise(this.seedGenerator),this.simplexY=new i.SimplexNoise(this.seedGenerator),this.simplexZ=new i.SimplexNoise(this.seedGenerator),this.forwards=new t.Vector3,this.forwardsFill=new t.Vector3,this.side=new t.Vector3,this.down=new t.Vector3,this.middlePos=new t.Vector3,this.middleLinPos=new t.Vector3,this.newPos=new t.Vector3,this.vPos=new t.Vector3,this.cross1=new t.Vector3}createMesh(){const i=1<<this.maxIterations,e=3*(i+1)*this.maxSubrays,r=18*i*this.maxSubrays;this.vertices=new Float32Array(3*e),this.indices=new Uint32Array(r),this.generateUVs&&(this.uvs=new Float32Array(2*e)),this.fillMesh(0),this.setIndex(new t.Uint32BufferAttribute(this.indices,1)),this.positionAttribute=new t.Float32BufferAttribute(this.vertices,3),this.setAttribute("position",this.positionAttribute),this.generateUVs&&(this.uvsAttribute=new t.Float32BufferAttribute(new Float32Array(this.uvs),2),this.setAttribute("uv",this.uvsAttribute)),this.isStatic||(this.index.usage=t.DynamicDrawUsage,this.positionAttribute.usage=t.DynamicDrawUsage,this.generateUVs&&(this.uvsAttribute.usage=t.DynamicDrawUsage)),this.vertices=this.positionAttribute.array,this.indices=this.index.array,this.generateUVs&&(this.uvs=this.uvsAttribute.array)}updateMesh(t){this.fillMesh(t),this.drawRange.count=this.currentIndex,this.index.needsUpdate=!0,this.positionAttribute.needsUpdate=!0,this.generateUVs&&(this.uvsAttribute.needsUpdate=!0)}fillMesh(t){const i=this;this.currentVertex=0,this.currentIndex=0,this.currentCoordinate=0,this.currentUVCoordinate=0,this.fractalRay(t,(function(e){const r=i.currentSubray;t<r.birthTime||(this.rayParameters.isEternal&&0==i.currentSubray.recursion?(i.createPrism(e),i.onDecideSubrayCreation(e,i)):t<r.endPropagationTime?i.timeFraction>=e.fraction0*r.propagationTimeFactor&&(i.createPrism(e),i.onDecideSubrayCreation(e,i)):t<r.beginVanishingTime?(i.createPrism(e),i.onDecideSubrayCreation(e,i)):(i.timeFraction<=r.vanishingTimeFactor+e.fraction1*(1-r.vanishingTimeFactor)&&i.createPrism(e),i.onDecideSubrayCreation(e,i)))}))}addNewSubray(){return this.subrays[this.numSubrays++]}initSubray(t,i){t.pos0.copy(i.sourceOffset),t.pos1.copy(i.destOffset),t.up0.copy(i.up0),t.up1.copy(i.up1),t.radius0=i.radius0,t.radius1=i.radius1,t.birthTime=i.birthTime,t.deathTime=i.deathTime,t.timeScale=i.timeScale,t.roughness=i.roughness,t.straightness=i.straightness,t.propagationTimeFactor=i.propagationTimeFactor,t.vanishingTimeFactor=i.vanishingTimeFactor,t.maxIterations=this.maxIterations,t.seed=void 0!==i.noiseSeed?i.noiseSeed:0,t.recursion=0}fractalRay(i,e){this.time=i,this.currentSegmentCallback=e,this.numSubrays=0,this.initSubray(this.addNewSubray(),this.rayParameters);for(let e=0;e<this.numSubrays;e++){const r=this.subrays[e];this.currentSubray=r,this.randomGenerator.setSeed(r.seed),r.endPropagationTime=t.MathUtils.lerp(r.birthTime,r.deathTime,r.propagationTimeFactor),r.beginVanishingTime=t.MathUtils.lerp(r.deathTime,r.birthTime,1-r.vanishingTimeFactor);const s=this.randomGenerator.random;r.linPos0.set(s(),s(),s()).multiplyScalar(1e3),r.linPos1.set(s(),s(),s()).multiplyScalar(1e3),this.timeFraction=(i-r.birthTime)/(r.deathTime-r.birthTime),this.currentSegmentIndex=0,this.isInitialSegment=!0;const a=this.getNewSegment();a.iteration=0,a.pos0.copy(r.pos0),a.pos1.copy(r.pos1),a.linPos0.copy(r.linPos0),a.linPos1.copy(r.linPos1),a.up0.copy(r.up0),a.up1.copy(r.up1),a.radius0=r.radius0,a.radius1=r.radius1,a.fraction0=0,a.fraction1=1,a.positionVariationFactor=1-r.straightness,this.subrayProbability=this.ramification*Math.pow(this.recursionProbability,r.recursion)/(1<<r.maxIterations),this.fractalRayRecursive(a)}this.currentSegmentCallback=null,this.currentSubray=null}fractalRayRecursive(t){if(t.iteration>=this.currentSubray.maxIterations)return void this.currentSegmentCallback(t);this.forwards.subVectors(t.pos1,t.pos0);let i=this.forwards.length();i<1e-6&&(this.forwards.set(0,0,.01),i=this.forwards.length());const e=.5*(t.radius0+t.radius1),r=.5*(t.fraction0+t.fraction1),s=this.time*this.currentSubray.timeScale*Math.pow(2,t.iteration);this.middlePos.lerpVectors(t.pos0,t.pos1,.5),this.middleLinPos.lerpVectors(t.linPos0,t.linPos1,.5);const a=this.middleLinPos;this.newPos.set(this.simplexX.noise4d(a.x,a.y,a.z,s),this.simplexY.noise4d(a.x,a.y,a.z,s),this.simplexZ.noise4d(a.x,a.y,a.z,s)),this.newPos.multiplyScalar(t.positionVariationFactor*i),this.newPos.add(this.middlePos);const o=this.getNewSegment();o.pos0.copy(t.pos0),o.pos1.copy(this.newPos),o.linPos0.copy(t.linPos0),o.linPos1.copy(this.middleLinPos),o.up0.copy(t.up0),o.up1.copy(t.up1),o.radius0=t.radius0,o.radius1=e,o.fraction0=t.fraction0,o.fraction1=r,o.positionVariationFactor=t.positionVariationFactor*this.currentSubray.roughness,o.iteration=t.iteration+1;const n=this.getNewSegment();n.pos0.copy(this.newPos),n.pos1.copy(t.pos1),n.linPos0.copy(this.middleLinPos),n.linPos1.copy(t.linPos1),this.cross1.crossVectors(t.up0,this.forwards.normalize()),n.up0.crossVectors(this.forwards,this.cross1).normalize(),n.up1.copy(t.up1),n.radius0=e,n.radius1=t.radius1,n.fraction0=r,n.fraction1=t.fraction1,n.positionVariationFactor=t.positionVariationFactor*this.currentSubray.roughness,n.iteration=t.iteration+1,this.fractalRayRecursive(o),this.fractalRayRecursive(n)}createPrism(t){this.forwardsFill.subVectors(t.pos1,t.pos0).normalize(),this.isInitialSegment&&(this.currentCreateTriangleVertices(t.pos0,t.up0,this.forwardsFill,t.radius0,0),this.isInitialSegment=!1),this.currentCreateTriangleVertices(t.pos1,t.up0,this.forwardsFill,t.radius1,t.fraction1),this.createPrismFaces()}createTriangleVerticesWithoutUVs(t,i,r,s){this.side.crossVectors(i,r).multiplyScalar(s*e.COS30DEG),this.down.copy(i).multiplyScalar(-s*e.SIN30DEG);const a=this.vPos,o=this.vertices;a.copy(t).sub(this.side).add(this.down),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,a.copy(t).add(this.side).add(this.down),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,a.copy(i).multiplyScalar(s).add(t),o[this.currentCoordinate++]=a.x,o[this.currentCoordinate++]=a.y,o[this.currentCoordinate++]=a.z,this.currentVertex+=3}createTriangleVerticesWithUVs(t,i,r,s,a){this.side.crossVectors(i,r).multiplyScalar(s*e.COS30DEG),this.down.copy(i).multiplyScalar(-s*e.SIN30DEG);const o=this.vPos,n=this.vertices,c=this.uvs;o.copy(t).sub(this.side).add(this.down),n[this.currentCoordinate++]=o.x,n[this.currentCoordinate++]=o.y,n[this.currentCoordinate++]=o.z,c[this.currentUVCoordinate++]=a,c[this.currentUVCoordinate++]=0,o.copy(t).add(this.side).add(this.down),n[this.currentCoordinate++]=o.x,n[this.currentCoordinate++]=o.y,n[this.currentCoordinate++]=o.z,c[this.currentUVCoordinate++]=a,c[this.currentUVCoordinate++]=.5,o.copy(i).multiplyScalar(s).add(t),n[this.currentCoordinate++]=o.x,n[this.currentCoordinate++]=o.y,n[this.currentCoordinate++]=o.z,c[this.currentUVCoordinate++]=a,c[this.currentUVCoordinate++]=1,this.currentVertex+=3}createPrismFaces(t){const i=this.indices;t=this.currentVertex-6;i[this.currentIndex++]=t+1,i[this.currentIndex++]=t+2,i[this.currentIndex++]=t+5,i[this.currentIndex++]=t+1,i[this.currentIndex++]=t+5,i[this.currentIndex++]=t+4,i[this.currentIndex++]=t+0,i[this.currentIndex++]=t+1,i[this.currentIndex++]=t+4,i[this.currentIndex++]=t+0,i[this.currentIndex++]=t+4,i[this.currentIndex++]=t+3,i[this.currentIndex++]=t+2,i[this.currentIndex++]=t+0,i[this.currentIndex++]=t+3,i[this.currentIndex++]=t+2,i[this.currentIndex++]=t+3,i[this.currentIndex++]=t+5}createDefaultSubrayCreationCallbacks(){const i=this.randomGenerator.random;this.onDecideSubrayCreation=(e,r)=>{const s=r.currentSubray,a=r.rayParameters.subrayPeriod,o=r.rayParameters.subrayDutyCycle,n=r.rayParameters.isEternal&&0==s.recursion?-i()*a:t.MathUtils.lerp(s.birthTime,s.endPropagationTime,e.fraction0)-i()*a,c=r.time-n,u=Math.floor(c/a),h=i()*(u+1);let d=0;if(c%a<=o*a&&(d=r.subrayProbability),s.recursion<r.maxSubrayRecursion&&r.numSubrays<r.maxSubrays&&i()<d){const t=r.addNewSubray(),c=r.randomGenerator.getSeed();t.seed=h,r.randomGenerator.setSeed(h),t.recursion=s.recursion+1,t.maxIterations=Math.max(1,s.maxIterations-1),t.linPos0.set(i(),i(),i()).multiplyScalar(1e3),t.linPos1.set(i(),i(),i()).multiplyScalar(1e3),t.up0.copy(s.up0),t.up1.copy(s.up1),t.radius0=e.radius0*r.rayParameters.radius0Factor,t.radius1=Math.min(r.rayParameters.minRadius,e.radius1*r.rayParameters.radius1Factor),t.birthTime=n+u*a,t.deathTime=t.birthTime+a*o,r.rayParameters.isEternal||0!=s.recursion||(t.birthTime=Math.max(t.birthTime,s.birthTime),t.deathTime=Math.min(t.deathTime,s.deathTime)),t.timeScale=2*s.timeScale,t.roughness=s.roughness,t.straightness=s.straightness,t.propagationTimeFactor=s.propagationTimeFactor,t.vanishingTimeFactor=s.vanishingTimeFactor,r.onSubrayCreation(e,s,t,r),r.randomGenerator.setSeed(c)}};const e=new t.Vector3,r=new t.Vector3,s=new t.Vector3,a=new t.Vector3;this.onSubrayCreation=(t,i,e,r)=>{r.subrayCylinderPosition(t,i,e,.5,.6,.2)},this.subrayConePosition=(t,o,n,c,u,h)=>{n.pos0.copy(t.pos0),e.subVectors(o.pos1,o.pos0),r.copy(e).normalize(),e.multiplyScalar(t.fraction0+(1-t.fraction0)*(i()*c));const d=e.length();s.crossVectors(o.up0,r);const m=2*Math.PI*i();s.multiplyScalar(Math.cos(m)),a.copy(o.up0).multiplyScalar(Math.sin(m)),n.pos1.copy(s).add(a).multiplyScalar(d*u*(h+i()*(1-h))).add(e).add(o.pos0)},this.subrayCylinderPosition=(t,o,n,c,u,h)=>{n.pos0.copy(t.pos0),e.subVectors(o.pos1,o.pos0),r.copy(e).normalize(),e.multiplyScalar(t.fraction0+(1-t.fraction0)*((2*i()-1)*c));const d=e.length();s.crossVectors(o.up0,r);const m=2*Math.PI*i();s.multiplyScalar(Math.cos(m)),a.copy(o.up0).multiplyScalar(Math.sin(m)),n.pos1.copy(s).add(a).multiplyScalar(d*u*(h+i()*(1-h))).add(e).add(o.pos0)}}createSubray(){return{seed:0,maxIterations:0,recursion:0,pos0:new t.Vector3,pos1:new t.Vector3,linPos0:new t.Vector3,linPos1:new t.Vector3,up0:new t.Vector3,up1:new t.Vector3,radius0:0,radius1:0,birthTime:0,deathTime:0,timeScale:0,roughness:0,straightness:0,propagationTimeFactor:0,vanishingTimeFactor:0,endPropagationTime:0,beginVanishingTime:0}}createSegment(){return{iteration:0,pos0:new t.Vector3,pos1:new t.Vector3,linPos0:new t.Vector3,linPos1:new t.Vector3,up0:new t.Vector3,up1:new t.Vector3,radius0:0,radius1:0,fraction0:0,fraction1:0,positionVariationFactor:0}}getNewSegment(){return this.raySegments[this.currentSegmentIndex++]}copy(t){return super.copy(t),this.init(e.copyParameters({},t.rayParameters)),this}clone(){return new this.constructor(e.copyParameters({},this.rayParameters))}}e.prototype.isLightningStrike=!0,e.RAY_INITIALIZED=0,e.RAY_UNBORN=1,e.RAY_PROPAGATING=2,e.RAY_STEADY=3,e.RAY_VANISHING=4,e.RAY_EXTINGUISHED=5,e.COS30DEG=Math.cos(30*Math.PI/180),e.SIN30DEG=Math.sin(30*Math.PI/180),e.createRandomGenerator=()=>{const t=2053,i=[];for(let e=0;e<t;e++)i.push(Math.random());const e={currentSeed:0,random:function(){const r=i[e.currentSeed];return e.currentSeed=(e.currentSeed+1)%t,r},getSeed:function(){return e.currentSeed/t},setSeed:function(i){e.currentSeed=Math.floor(i*t)%t}};return e},e.copyParameters=(i,e)=>{e=e||{};const r=t=>e===i?t:t.clone();return(i=i||{}).sourceOffset=void 0!==e.sourceOffset?r(e.sourceOffset):new t.Vector3(0,100,0),i.destOffset=void 0!==e.destOffset?r(e.destOffset):new t.Vector3(0,0,0),i.timeScale=void 0!==e.timeScale?e.timeScale:1,i.roughness=void 0!==e.roughness?e.roughness:.9,i.straightness=void 0!==e.straightness?e.straightness:.7,i.up0=void 0!==e.up0?r(e.up0):new t.Vector3(0,0,1),i.up1=void 0!==e.up1?r(e.up1):new t.Vector3(0,0,1),i.radius0=void 0!==e.radius0?e.radius0:1,i.radius1=void 0!==e.radius1?e.radius1:1,i.radius0Factor=void 0!==e.radius0Factor?e.radius0Factor:.5,i.radius1Factor=void 0!==e.radius1Factor?e.radius1Factor:.2,i.minRadius=void 0!==e.minRadius?e.minRadius:.2,i.isEternal=void 0!==e.isEternal?e.isEternal:void 0===e.birthTime||void 0===e.deathTime,i.birthTime=e.birthTime,i.deathTime=e.deathTime,i.propagationTimeFactor=void 0!==e.propagationTimeFactor?e.propagationTimeFactor:.1,i.vanishingTimeFactor=void 0!==e.vanishingTimeFactor?e.vanishingTimeFactor:.9,i.subrayPeriod=void 0!==e.subrayPeriod?e.subrayPeriod:4,i.subrayDutyCycle=void 0!==e.subrayDutyCycle?e.subrayDutyCycle:.6,i.maxIterations=void 0!==e.maxIterations?e.maxIterations:9,i.isStatic=void 0!==e.isStatic&&e.isStatic,i.ramification=void 0!==e.ramification?e.ramification:5,i.maxSubrayRecursion=void 0!==e.maxSubrayRecursion?e.maxSubrayRecursion:3,i.recursionProbability=void 0!==e.recursionProbability?e.recursionProbability:.6,i.generateUVs=void 0!==e.generateUVs&&e.generateUVs,i.randomGenerator=e.randomGenerator,i.noiseSeed=e.noiseSeed,i.onDecideSubrayCreation=e.onDecideSubrayCreation,i.onSubrayCreation=e.onSubrayCreation,i},exports.LightningStrike=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three"),s=require("./ParametricGeometry.cjs.js");const e={klein:function(t,s,e){let a,o;s*=Math.PI,t*=2*Math.PI,(s*=2)<Math.PI?(a=3*Math.cos(s)*(1+Math.sin(s))+2*(1-Math.cos(s)/2)*Math.cos(s)*Math.cos(t),o=-8*Math.sin(s)-2*(1-Math.cos(s)/2)*Math.sin(s)*Math.cos(t)):(a=3*Math.cos(s)*(1+Math.sin(s))+2*(1-Math.cos(s)/2)*Math.cos(t+Math.PI),o=-8*Math.sin(s));const n=-2*(1-Math.cos(s)/2)*Math.sin(t);e.set(a,n,o)},plane:function(t,s){return function(e,a,o){const n=e*t,c=a*s;o.set(n,0,c)}},mobius:function(t,s,e){t-=.5;const a=2*Math.PI*s,o=Math.cos(a)*(2+t*Math.cos(a/2)),n=Math.sin(a)*(2+t*Math.cos(a/2)),c=t*Math.sin(a/2);e.set(o,n,c)},mobius3d:function(t,s,e){t*=Math.PI,s*=2*Math.PI;const a=(t*=2)/2;let o=.125*Math.cos(s)*Math.cos(a)-.65*Math.sin(s)*Math.sin(a);const n=.125*Math.cos(s)*Math.sin(a)+.65*Math.sin(s)*Math.cos(a),c=(2.25+o)*Math.sin(t);o=(2.25+o)*Math.cos(t),e.set(o,c,n)}};e.TubeGeometry=class extends s.ParametricGeometry{constructor(s,e=64,a=1,o=8,n=!1){const c=e+1,h=s.computeFrenetFrames(e,n),i=h.tangents,r=h.normals,M=h.binormals,u=new t.Vector3;super((function(t,e,o){e*=2*Math.PI;const n=Math.floor(t*(c-1));s.getPointAt(t,u);const h=r[n],i=M[n],m=-a*Math.cos(e),l=a*Math.sin(e);u.x+=m*h.x+l*i.x,u.y+=m*h.y+l*i.y,u.z+=m*h.z+l*i.z,o.copy(u)}),e,o),this.tangents=i,this.normals=r,this.binormals=M,this.path=s,this.segments=e,this.radius=a,this.segmentsRadius=o,this.closed=n}},e.TorusKnotGeometry=class extends e.TubeGeometry{constructor(s=200,e=40,a=64,o=8,n=2,c=3){class h extends t.Curve{getPoint(e,a=new t.Vector3){const o=a;e*=2*Math.PI;const h=(1+.5*Math.cos(c*e))*Math.cos(n*e),i=(1+.5*Math.cos(c*e))*Math.sin(n*e),r=.5*Math.sin(c*e);return o.set(h,i,r).multiplyScalar(s)}}const i=a,r=o;super(new h,i,e,r,!0,!1),this.radius=s,this.tube=e,this.segmentsT=a,this.segmentsR=o,this.p=n,this.q=c}},e.SphereGeometry=class extends s.ParametricGeometry{constructor(t,s,e){super((function(s,e,a){s*=Math.PI,e*=2*Math.PI;const o=t*Math.sin(s)*Math.cos(e),n=t*Math.sin(s)*Math.sin(e),c=t*Math.cos(s);a.set(o,n,c)}),s,e)}},e.PlaneGeometry=class extends s.ParametricGeometry{constructor(t,s,e,a){super((function(e,a,o){const n=e*t,c=a*s;o.set(n,0,c)}),e,a)}},exports.ParametricGeometries=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class e extends t.BufferGeometry{constructor(e=((t,e,s)=>s.set(t,e,Math.cos(t)*Math.sin(e))),s=8,r=8){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:s,stacks:r};const o=[],u=[],c=[],i=[],n=1e-5,a=new t.Vector3,f=new t.Vector3,h=new t.Vector3,l=new t.Vector3,p=new t.Vector3,b=s+1;for(let t=0;t<=r;t++){const o=t/r;for(let t=0;t<=s;t++){const r=t/s;e(r,o,f),u.push(f.x,f.y,f.z),r-n>=0?(e(r-n,o,h),l.subVectors(f,h)):(e(r+n,o,h),l.subVectors(h,f)),o-n>=0?(e(r,o-n,h),p.subVectors(f,h)):(e(r,o+n,h),p.subVectors(h,f)),a.crossVectors(l,p).normalize(),c.push(a.x,a.y,a.z),i.push(r,o)}}for(let t=0;t<r;t++)for(let e=0;e<s;e++){const s=t*b+e,r=t*b+e+1,u=(t+1)*b+e+1,c=(t+1)*b+e;o.push(s,r,c),o.push(r,u,c)}this.setIndex(o),this.setAttribute("position",new t.Float32BufferAttribute(u,3)),this.setAttribute("normal",new t.Float32BufferAttribute(c,3)),this.setAttribute("uv",new t.Float32BufferAttribute(i,2))}}exports.ParametricGeometry=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");const e=new t.Vector3;function r(t,r,s,a,i,n){const o=2*Math.PI*i/4,c=Math.max(n-2*i,0),u=Math.PI/4;e.copy(r),e[a]=0,e.normalize();const h=.5*o/(o+c),y=1-e.angleTo(t)/u;if(1===Math.sign(e[s]))return y*h;return c/(o+c)+h+h*(1-y)}class s extends t.BoxGeometry{constructor(e=1,s=1,a=1,i=2,n=.1){if(i=2*i+1,n=Math.min(e/2,s/2,a/2,n),super(1,1,1,i,i,i),1===i)return;const o=this.toNonIndexed();this.index=null,this.attributes.position=o.attributes.position,this.attributes.normal=o.attributes.normal,this.attributes.uv=o.attributes.uv;const c=new t.Vector3,u=new t.Vector3,h=new t.Vector3(e,s,a).divideScalar(2).subScalar(n),y=this.attributes.position.array,x=this.attributes.normal.array,l=this.attributes.uv.array,b=y.length/6,z=new t.Vector3,M=.5/i;for(let t=0,i=0;t<y.length;t+=3,i+=2){c.fromArray(y,t),u.copy(c),u.x-=Math.sign(u.x)*M,u.y-=Math.sign(u.y)*M,u.z-=Math.sign(u.z)*M,u.normalize(),y[t+0]=h.x*Math.sign(c.x)+u.x*n,y[t+1]=h.y*Math.sign(c.y)+u.y*n,y[t+2]=h.z*Math.sign(c.z)+u.z*n,x[t+0]=u.x,x[t+1]=u.y,x[t+2]=u.z;switch(Math.floor(t/b)){case 0:z.set(1,0,0),l[i+0]=r(z,u,"z","y",n,a),l[i+1]=1-r(z,u,"y","z",n,s);break;case 1:z.set(-1,0,0),l[i+0]=1-r(z,u,"z","y",n,a),l[i+1]=1-r(z,u,"y","z",n,s);break;case 2:z.set(0,1,0),l[i+0]=1-r(z,u,"x","z",n,e),l[i+1]=r(z,u,"z","x",n,a);break;case 3:z.set(0,-1,0),l[i+0]=1-r(z,u,"x","z",n,e),l[i+1]=1-r(z,u,"z","x",n,a);break;case 4:z.set(0,0,1),l[i+0]=1-r(z,u,"x","y",n,e),l[i+1]=1-r(z,u,"y","x",n,s);break;case 5:z.set(0,0,-1),l[i+0]=r(z,u,"x","y",n,e),l[i+1]=1-r(z,u,"y","x",n,s)}}}}exports.RoundedBoxGeometry=s;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class e extends t.BufferGeometry{constructor(e,r,o,n,s,i,a){const c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,3,16,17,18,7,19,20,21,11,22,23,24,15,25,26,27,18,28,29,30,21,31,32,33,24,34,35,36,27,37,38,39,30,40,41,0,33,42,43,4,36,44,45,8,39,46,47,12,12,13,14,15,48,49,50,51,52,53,54,55,56,57,58,59,15,25,26,27,51,60,61,62,55,63,64,65,59,66,67,68,27,37,38,39,62,69,70,71,65,72,73,74,68,75,76,77,39,46,47,12,71,78,79,48,74,80,81,52,77,82,83,56,56,57,58,59,84,85,86,87,88,89,90,91,92,93,94,95,59,66,67,68,87,96,97,98,91,99,100,101,95,102,103,104,68,75,76,77,98,105,106,107,101,108,109,110,104,111,112,113,77,82,83,56,107,114,115,84,110,116,117,88,113,118,119,92,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,123,136,137,120,127,138,139,124,131,140,141,128,135,142,143,132,132,133,134,135,144,145,146,147,148,149,150,151,68,152,153,154,135,142,143,132,147,155,156,144,151,157,158,148,154,159,160,68,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,164,177,178,161,168,179,180,165,172,181,182,169,176,183,184,173,173,174,175,176,185,186,187,188,189,190,191,192,193,194,195,196,176,183,184,173,188,197,198,185,192,199,200,189,196,201,202,193,203,203,203,203,204,205,206,207,208,208,208,208,209,210,211,212,203,203,203,203,207,213,214,215,208,208,208,208,212,216,217,218,203,203,203,203,215,219,220,221,208,208,208,208,218,222,223,224,203,203,203,203,221,225,226,204,208,208,208,208,224,227,228,209,209,210,211,212,229,230,231,232,233,234,235,236,237,238,239,240,212,216,217,218,232,241,242,243,236,244,245,246,240,247,248,249,218,222,223,224,243,250,251,252,246,253,254,255,249,256,257,258,224,227,228,209,252,259,260,229,255,261,262,233,258,263,264,237,265,265,265,265,266,267,268,269,270,271,272,273,92,119,118,113,265,265,265,265,269,274,275,276,273,277,278,279,113,112,111,104,265,265,265,265,276,280,281,282,279,283,284,285,104,103,102,95,265,265,265,265,282,286,287,266,285,288,289,270,95,94,93,92],f=[1.4,0,2.4,1.4,-.784,2.4,.784,-1.4,2.4,0,-1.4,2.4,1.3375,0,2.53125,1.3375,-.749,2.53125,.749,-1.3375,2.53125,0,-1.3375,2.53125,1.4375,0,2.53125,1.4375,-.805,2.53125,.805,-1.4375,2.53125,0,-1.4375,2.53125,1.5,0,2.4,1.5,-.84,2.4,.84,-1.5,2.4,0,-1.5,2.4,-.784,-1.4,2.4,-1.4,-.784,2.4,-1.4,0,2.4,-.749,-1.3375,2.53125,-1.3375,-.749,2.53125,-1.3375,0,2.53125,-.805,-1.4375,2.53125,-1.4375,-.805,2.53125,-1.4375,0,2.53125,-.84,-1.5,2.4,-1.5,-.84,2.4,-1.5,0,2.4,-1.4,.784,2.4,-.784,1.4,2.4,0,1.4,2.4,-1.3375,.749,2.53125,-.749,1.3375,2.53125,0,1.3375,2.53125,-1.4375,.805,2.53125,-.805,1.4375,2.53125,0,1.4375,2.53125,-1.5,.84,2.4,-.84,1.5,2.4,0,1.5,2.4,.784,1.4,2.4,1.4,.784,2.4,.749,1.3375,2.53125,1.3375,.749,2.53125,.805,1.4375,2.53125,1.4375,.805,2.53125,.84,1.5,2.4,1.5,.84,2.4,1.75,0,1.875,1.75,-.98,1.875,.98,-1.75,1.875,0,-1.75,1.875,2,0,1.35,2,-1.12,1.35,1.12,-2,1.35,0,-2,1.35,2,0,.9,2,-1.12,.9,1.12,-2,.9,0,-2,.9,-.98,-1.75,1.875,-1.75,-.98,1.875,-1.75,0,1.875,-1.12,-2,1.35,-2,-1.12,1.35,-2,0,1.35,-1.12,-2,.9,-2,-1.12,.9,-2,0,.9,-1.75,.98,1.875,-.98,1.75,1.875,0,1.75,1.875,-2,1.12,1.35,-1.12,2,1.35,0,2,1.35,-2,1.12,.9,-1.12,2,.9,0,2,.9,.98,1.75,1.875,1.75,.98,1.875,1.12,2,1.35,2,1.12,1.35,1.12,2,.9,2,1.12,.9,2,0,.45,2,-1.12,.45,1.12,-2,.45,0,-2,.45,1.5,0,.225,1.5,-.84,.225,.84,-1.5,.225,0,-1.5,.225,1.5,0,.15,1.5,-.84,.15,.84,-1.5,.15,0,-1.5,.15,-1.12,-2,.45,-2,-1.12,.45,-2,0,.45,-.84,-1.5,.225,-1.5,-.84,.225,-1.5,0,.225,-.84,-1.5,.15,-1.5,-.84,.15,-1.5,0,.15,-2,1.12,.45,-1.12,2,.45,0,2,.45,-1.5,.84,.225,-.84,1.5,.225,0,1.5,.225,-1.5,.84,.15,-.84,1.5,.15,0,1.5,.15,1.12,2,.45,2,1.12,.45,.84,1.5,.225,1.5,.84,.225,.84,1.5,.15,1.5,.84,.15,-1.6,0,2.025,-1.6,-.3,2.025,-1.5,-.3,2.25,-1.5,0,2.25,-2.3,0,2.025,-2.3,-.3,2.025,-2.5,-.3,2.25,-2.5,0,2.25,-2.7,0,2.025,-2.7,-.3,2.025,-3,-.3,2.25,-3,0,2.25,-2.7,0,1.8,-2.7,-.3,1.8,-3,-.3,1.8,-3,0,1.8,-1.5,.3,2.25,-1.6,.3,2.025,-2.5,.3,2.25,-2.3,.3,2.025,-3,.3,2.25,-2.7,.3,2.025,-3,.3,1.8,-2.7,.3,1.8,-2.7,0,1.575,-2.7,-.3,1.575,-3,-.3,1.35,-3,0,1.35,-2.5,0,1.125,-2.5,-.3,1.125,-2.65,-.3,.9375,-2.65,0,.9375,-2,-.3,.9,-1.9,-.3,.6,-1.9,0,.6,-3,.3,1.35,-2.7,.3,1.575,-2.65,.3,.9375,-2.5,.3,1.125,-1.9,.3,.6,-2,.3,.9,1.7,0,1.425,1.7,-.66,1.425,1.7,-.66,.6,1.7,0,.6,2.6,0,1.425,2.6,-.66,1.425,3.1,-.66,.825,3.1,0,.825,2.3,0,2.1,2.3,-.25,2.1,2.4,-.25,2.025,2.4,0,2.025,2.7,0,2.4,2.7,-.25,2.4,3.3,-.25,2.4,3.3,0,2.4,1.7,.66,.6,1.7,.66,1.425,3.1,.66,.825,2.6,.66,1.425,2.4,.25,2.025,2.3,.25,2.1,3.3,.25,2.4,2.7,.25,2.4,2.8,0,2.475,2.8,-.25,2.475,3.525,-.25,2.49375,3.525,0,2.49375,2.9,0,2.475,2.9,-.15,2.475,3.45,-.15,2.5125,3.45,0,2.5125,2.8,0,2.4,2.8,-.15,2.4,3.2,-.15,2.4,3.2,0,2.4,3.525,.25,2.49375,2.8,.25,2.475,3.45,.15,2.5125,2.9,.15,2.475,3.2,.15,2.4,2.8,.15,2.4,0,0,3.15,.8,0,3.15,.8,-.45,3.15,.45,-.8,3.15,0,-.8,3.15,0,0,2.85,.2,0,2.7,.2,-.112,2.7,.112,-.2,2.7,0,-.2,2.7,-.45,-.8,3.15,-.8,-.45,3.15,-.8,0,3.15,-.112,-.2,2.7,-.2,-.112,2.7,-.2,0,2.7,-.8,.45,3.15,-.45,.8,3.15,0,.8,3.15,-.2,.112,2.7,-.112,.2,2.7,0,.2,2.7,.45,.8,3.15,.8,.45,3.15,.112,.2,2.7,.2,.112,2.7,.4,0,2.55,.4,-.224,2.55,.224,-.4,2.55,0,-.4,2.55,1.3,0,2.55,1.3,-.728,2.55,.728,-1.3,2.55,0,-1.3,2.55,1.3,0,2.4,1.3,-.728,2.4,.728,-1.3,2.4,0,-1.3,2.4,-.224,-.4,2.55,-.4,-.224,2.55,-.4,0,2.55,-.728,-1.3,2.55,-1.3,-.728,2.55,-1.3,0,2.55,-.728,-1.3,2.4,-1.3,-.728,2.4,-1.3,0,2.4,-.4,.224,2.55,-.224,.4,2.55,0,.4,2.55,-1.3,.728,2.55,-.728,1.3,2.55,0,1.3,2.55,-1.3,.728,2.4,-.728,1.3,2.4,0,1.3,2.4,.224,.4,2.55,.4,.224,2.55,.728,1.3,2.55,1.3,.728,2.55,.728,1.3,2.4,1.3,.728,2.4,0,0,0,1.425,0,0,1.425,.798,0,.798,1.425,0,0,1.425,0,1.5,0,.075,1.5,.84,.075,.84,1.5,.075,0,1.5,.075,-.798,1.425,0,-1.425,.798,0,-1.425,0,0,-.84,1.5,.075,-1.5,.84,.075,-1.5,0,.075,-1.425,-.798,0,-.798,-1.425,0,0,-1.425,0,-1.5,-.84,.075,-.84,-1.5,.075,0,-1.5,.075,.798,-1.425,0,1.425,-.798,0,.84,-1.5,.075,1.5,-.84,.075];super(),e=e||50,r=void 0!==r?Math.max(2,Math.floor(r)||10):10,i=void 0===i||i;const l=3.15*((a=void 0===a||a)?1:1.3)/2,u=e/l;let w=(o=void 0===o||o)?(8*r-4)*r:0;w+=(n=void 0===n||n)?(16*r-4)*r:0,w+=(s=void 0===s||s)?40*r*r:0;const y=new Uint32Array(3*w);let p=o?4:0;p+=n?8:0,p+=s?20:0,p*=(r+1)*(r+1);const A=new Float32Array(3*p),d=new Float32Array(3*p),m=new Float32Array(2*p),x=new t.Matrix4;x.set(-1,3,-3,1,3,-6,3,0,-3,3,0,0,1,0,0,0);const M=[];let h,v,V;const b=[],B=[],z=[],F=[],G=[],_=[],g=[],j=[],q=new t.Vector3;let I,O,P,S,T,U,k,C,D,E=0,H=0;const J=new t.Vector3;let K,L,N,Q;const R=new t.Matrix4,W=new t.Matrix4,X=new t.Vector4,Y=new t.Vector4,Z=new t.Vector4,$=new t.Vector4,tt=new t.Vector3,et=new t.Vector3,rt=x.clone();rt.transpose();const ot=(t,e,r)=>!(A[3*t]===A[3*e]&&A[3*t+1]===A[3*e+1]&&A[3*t+2]===A[3*e+2]||A[3*t]===A[3*r]&&A[3*t+1]===A[3*r+1]&&A[3*t+2]===A[3*r+2]||A[3*e]===A[3*r]&&A[3*e+1]===A[3*r+1]&&A[3*e+2]===A[3*r+2]);for(h=0;h<3;h++)G[h]=new t.Matrix4;const nt=o?32:28;S=r+1;let st=0,it=0,at=0,ct=0,ft=0;for(let t=s?0:20;t<nt;t++)if(n||t<20||t>=28){for(h=0;h<3;h++){for(v=0;v<4;v++)for(V=0;V<4;V++)M[4*V+v]=f[3*c[16*t+4*v+V]+h],i&&t>=20&&t<28&&2!==h&&(M[4*V+v]*=1.077),a||2!==h||(M[4*V+v]*=1.3);R.set(M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],M[8],M[9],M[10],M[11],M[12],M[13],M[14],M[15]),W.multiplyMatrices(R,x),G[h].multiplyMatrices(rt,W)}for(O=0;O<=r;O++)for(T=O/r,P=0;P<=r;P++){for(U=P/r,D=4,k=C=1;D--;)b[D]=k,B[D]=C,k*=T,C*=U,3===D?(z[D]=F[D]=0,E=H=1):(z[D]=E*(3-D),F[D]=H*(3-D),E*=T,H*=U);for(X.fromArray(b),Y.fromArray(B),Z.fromArray(z),$.fromArray(F),h=0;h<3;h++)I=X.clone(),I.applyMatrix4(G[h]),_[h]=I.dot(Y),I=Z.clone(),I.applyMatrix4(G[h]),g[h]=I.dot(Y),I=X.clone(),I.applyMatrix4(G[h]),j[h]=I.dot($);tt.fromArray(g),et.fromArray(j),q.crossVectors(et,tt),q.normalize(),0===_[0]&&0===_[1]?J.set(0,_[2]>l?1:-1,0):J.set(q.x,q.z,-q.y),A[it++]=u*_[0],A[it++]=u*(_[2]-l),A[it++]=-u*_[1],d[at++]=J.x,d[at++]=J.y,d[at++]=J.z,m[ct++]=1-U,m[ct++]=1-T}for(O=0;O<r;O++)for(P=0;P<r;P++)K=st*S*S+O*S+P,L=K+1,N=L+S,Q=K+S,ot(K,L,N)&&(y[ft++]=K,y[ft++]=L,y[ft++]=N),ot(K,N,Q)&&(y[ft++]=K,y[ft++]=N,y[ft++]=Q);st++}this.setIndex(new t.BufferAttribute(y,1)),this.setAttribute("position",new t.BufferAttribute(A,3)),this.setAttribute("normal",new t.BufferAttribute(d,3)),this.setAttribute("uv",new t.BufferAttribute(m,2)),this.computeBoundingSphere()}}exports.TeapotGeometry=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");class t extends e.ExtrudeGeometry{constructor(e,t){const{bevelEnabled:r=!1,bevelSize:s=8,bevelThickness:i=10,font:l,height:n=50,size:o=100,lineHeight:c=1,letterSpacing:h=0,...p}=t;super(l.generateShapes(e,o,{lineHeight:c,letterSpacing:h}),{...p,bevelEnabled:r,bevelSize:s,bevelThickness:i,depth:n}),this.type="TextGeometry"}}exports.TextBufferGeometry=t,exports.TextGeometry=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");class t extends e.Mesh{constructor(t,i){this.lightProbe=t,this.size=i;const r=new e.ShaderMaterial({type:"LightProbeHelperMaterial",uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\tgl_FragColor = linearToOutputTexel( vec4( outgoingLight, 1.0 ) );","}"].join("\n")});super(new e.SphereGeometry(1,32,16),r),this.type="LightProbeHelper",this.onBeforeRender()}dispose(){this.geometry.dispose(),this.material.dispose()}onBeforeRender(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity}}exports.LightProbeHelper=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");class t extends e.Line{constructor(t,i,s,n){this.audio=t,this.range=i||1,this.divisionsInnerAngle=s||16,this.divisionsOuterAngle=n||2;const o=new e.BufferGeometry,r=this.divisionsInnerAngle+2*this.divisionsOuterAngle,a=new Float32Array(3*(3*r+3));o.setAttribute("position",new e.BufferAttribute(a,3));const l=new e.LineBasicMaterial({color:65280});super(o,[new e.LineBasicMaterial({color:16776960}),l]),this.type="PositionalAudioHelper",this.update()}update(){const t=this.audio,i=this.range,s=this.divisionsInnerAngle,n=this.divisionsOuterAngle,o=e.MathUtils.degToRad(t.panner.coneInnerAngle),r=e.MathUtils.degToRad(t.panner.coneOuterAngle),a=o/2,l=r/2;let d,h,u=0,c=0;const p=this.geometry,g=p.attributes.position;function A(e,t,s,n){const o=(t-e)/s;for(g.setXYZ(u,0,0,0),c++,d=e;d<t;d+=o)h=u+c,g.setXYZ(h,Math.sin(d)*i,0,Math.cos(d)*i),g.setXYZ(h+1,Math.sin(Math.min(d+o,t))*i,0,Math.cos(Math.min(d+o,t))*i),g.setXYZ(h+2,0,0,0),c+=3;p.addGroup(u,c,n),u+=c,c=0}p.clearGroups(),A(-l,-a,n,0),A(-a,a,s,1),A(a,l,n,0),g.needsUpdate=!0,o===r&&(this.material[0].visible=!1)}dispose(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()}}exports.PositionalAudioHelper=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three");class e extends t.Line{constructor(e,i){this.light=e,this.color=i;const r=new t.BufferGeometry;r.setAttribute("position",new t.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),r.computeBoundingSphere();super(r,new t.LineBasicMaterial({fog:!1})),this.type="RectAreaLightHelper";const s=new t.BufferGeometry;s.setAttribute("position",new t.Float32BufferAttribute([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),s.computeBoundingSphere(),this.add(new t.Mesh(s,new t.MeshBasicMaterial({side:t.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const t=this.material.color,e=Math.max(t.r,t.g,t.b);e>1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.copy(this.light.matrixWorld).scale(this.scale),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}exports.RectAreaLightHelper=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");const t=new e.Vector3,r=new e.Vector3,o=new e.Matrix3;class s extends e.LineSegments{constructor(t,r,o){const s=new e.BufferGeometry,i=void 0!==o?o:16711680;super(s,new e.LineBasicMaterial({color:i,toneMapped:!1})),this.object=t,this.size=void 0!==r?r:.1;let a=0;const n=this.object.geometry;if(n&&n.isGeometry)return void console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");n&&n.isBufferGeometry&&(a=n.attributes.normal.count);const l=new e.Float32BufferAttribute(2*a*3,3);s.setAttribute("position",l),this.type="VertexNormalsHelper",this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0),o.getNormalMatrix(this.object.matrixWorld);const e=this.object.matrixWorld,s=this.geometry.attributes.position,i=this.object.geometry;if(i&&i.isGeometry)console.error("THREE.VertexNormalsHelper no longer supports Geometry. Use BufferGeometry instead.");else{if(i&&i.isBufferGeometry){const a=i.attributes.position,n=i.attributes.normal;let l=0;for(let i=0,p=a.count;i<p;i++)t.set(a.getX(i),a.getY(i),a.getZ(i)).applyMatrix4(e),r.set(n.getX(i),n.getY(i),n.getZ(i)),r.applyMatrix3(o).normalize().multiplyScalar(this.size).add(t),s.setXYZ(l,t.x,t.y,t.z),l+=1,s.setXYZ(l,r.x,r.y,r.z),l+=1}s.needsUpdate=!0}}}exports.VertexNormalsHelper=s;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");const t=new e.Vector3,r=new e.Vector3;class o extends e.LineSegments{constructor(t,r,o){const s=void 0!==o?o:65535,i=t.geometry;if(!i||!i.isBufferGeometry)return void console.error("THREE.VertexTangentsHelper: geometry not an instance of THREE.BufferGeometry.",i);const n=i.attributes.tangent.count,a=new e.BufferGeometry,u=new e.Float32BufferAttribute(2*n*3,3);a.setAttribute("position",u),super(a,new e.LineBasicMaterial({color:s,toneMapped:!1})),this.type="VertexTangentsHelper",this.object=t,this.size=void 0!==r?r:1,this.matrixAutoUpdate=!1,this.update()}update(){this.object.updateMatrixWorld(!0);const e=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry,i=s.attributes.position,n=s.attributes.tangent;let a=0;for(let s=0,u=i.count;s<u;s++)t.set(i.getX(s),i.getY(s),i.getZ(s)).applyMatrix4(e),r.set(n.getX(s),n.getY(s),n.getZ(s)),r.transformDirection(e).multiplyScalar(this.size).add(t),o.setXYZ(a,t.x,t.y,t.z),a+=1,o.setXYZ(a,r.x,r.y,r.z),a+=1;o.needsUpdate=!0}}exports.VertexTangentsHelper=o;