three-stdlib 2.22.7 → 2.22.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1065) hide show
  1. package/dist/_polyfill/CompressedArrayTexture.js +12 -0
  2. package/dist/_polyfill/CompressedArrayTexture.mjs +12 -0
  3. package/dist/_polyfill/Data3DTexture.js +17 -0
  4. package/dist/_polyfill/Data3DTexture.mjs +17 -0
  5. package/dist/animation/AnimationClipCreator.d.ts +12 -0
  6. package/dist/animation/AnimationClipCreator.js +57 -0
  7. package/dist/animation/AnimationClipCreator.mjs +57 -0
  8. package/dist/animation/CCDIKSolver.d.ts +25 -0
  9. package/dist/animation/CCDIKSolver.js +224 -0
  10. package/dist/animation/CCDIKSolver.mjs +224 -0
  11. package/dist/animation/MMDAnimationHelper.d.ts +93 -0
  12. package/dist/animation/MMDAnimationHelper.js +590 -0
  13. package/dist/animation/MMDAnimationHelper.mjs +590 -0
  14. package/dist/animation/MMDPhysics.d.ts +114 -0
  15. package/dist/animation/MMDPhysics.js +819 -0
  16. package/dist/animation/MMDPhysics.mjs +819 -0
  17. package/dist/cameras/CinematicCamera.d.ts +34 -0
  18. package/dist/cameras/CinematicCamera.js +131 -0
  19. package/dist/cameras/CinematicCamera.mjs +131 -0
  20. package/dist/controls/ArcballControls.d.ts +374 -0
  21. package/dist/controls/ArcballControls.js +2039 -0
  22. package/dist/controls/ArcballControls.mjs +2039 -0
  23. package/dist/controls/DeviceOrientationControls.d.ts +27 -0
  24. package/dist/controls/DeviceOrientationControls.js +84 -0
  25. package/dist/controls/DeviceOrientationControls.mjs +84 -0
  26. package/dist/controls/DragControls.d.ts +34 -0
  27. package/dist/controls/DragControls.js +182 -0
  28. package/dist/controls/DragControls.mjs +182 -0
  29. package/dist/controls/FirstPersonControls.d.ts +48 -0
  30. package/dist/controls/FirstPersonControls.js +229 -0
  31. package/dist/controls/FirstPersonControls.mjs +229 -0
  32. package/dist/controls/FlyControls.d.ts +32 -0
  33. package/dist/controls/FlyControls.js +248 -0
  34. package/dist/controls/FlyControls.mjs +248 -0
  35. package/dist/controls/OrbitControls.d.ts +63 -0
  36. package/dist/controls/OrbitControls.js +781 -0
  37. package/dist/controls/OrbitControls.mjs +781 -0
  38. package/dist/controls/PointerLockControls.d.ts +24 -0
  39. package/dist/controls/PointerLockControls.js +103 -0
  40. package/dist/controls/PointerLockControls.mjs +103 -0
  41. package/dist/controls/TrackballControls.d.ts +95 -0
  42. package/dist/controls/TrackballControls.js +502 -0
  43. package/dist/controls/TrackballControls.mjs +502 -0
  44. package/dist/controls/TransformControls.d.ts +151 -0
  45. package/dist/controls/TransformControls.js +1089 -0
  46. package/dist/controls/TransformControls.mjs +1089 -0
  47. package/dist/controls/experimental/CameraControls.d.ts +212 -0
  48. package/dist/controls/experimental/CameraControls.js +736 -0
  49. package/dist/controls/experimental/CameraControls.mjs +736 -0
  50. package/dist/csm/CSM.d.ts +61 -0
  51. package/dist/csm/CSM.js +244 -0
  52. package/dist/csm/CSM.mjs +244 -0
  53. package/dist/csm/CSMFrustum.d.ts +19 -0
  54. package/dist/csm/CSMFrustum.js +75 -0
  55. package/dist/csm/CSMFrustum.mjs +75 -0
  56. package/dist/csm/CSMHelper.d.ts +26 -0
  57. package/dist/csm/CSMHelper.js +114 -0
  58. package/dist/csm/CSMHelper.mjs +114 -0
  59. package/dist/csm/CSMShader.d.ts +4 -0
  60. package/dist/csm/CSMShader.js +257 -0
  61. package/dist/csm/CSMShader.mjs +257 -0
  62. package/dist/curves/CurveExtras.d.ts +68 -0
  63. package/dist/curves/CurveExtras.js +224 -0
  64. package/dist/curves/CurveExtras.mjs +224 -0
  65. package/dist/curves/NURBSCurve.d.ts +11 -0
  66. package/dist/curves/NURBSCurve.js +35 -0
  67. package/dist/curves/NURBSCurve.mjs +35 -0
  68. package/dist/curves/NURBSSurface.d.ts +13 -0
  69. package/dist/curves/NURBSSurface.js +28 -0
  70. package/dist/curves/NURBSSurface.mjs +28 -0
  71. package/dist/curves/NURBSUtils.d.ts +22 -0
  72. package/dist/curves/NURBSUtils.js +226 -0
  73. package/dist/curves/NURBSUtils.mjs +226 -0
  74. package/dist/custom.d.ts +5 -0
  75. package/dist/deprecated/Geometry.d.ts +342 -0
  76. package/dist/deprecated/Geometry.js +971 -0
  77. package/dist/deprecated/Geometry.mjs +971 -0
  78. package/dist/effects/AnaglyphEffect.d.ts +11 -0
  79. package/dist/effects/AnaglyphEffect.js +121 -0
  80. package/dist/effects/AnaglyphEffect.mjs +121 -0
  81. package/dist/effects/AsciiEffect.d.ts +18 -0
  82. package/dist/effects/AsciiEffect.js +173 -0
  83. package/dist/effects/AsciiEffect.mjs +173 -0
  84. package/dist/effects/OutlineEffect.d.ts +28 -0
  85. package/dist/effects/OutlineEffect.js +298 -0
  86. package/dist/effects/OutlineEffect.mjs +298 -0
  87. package/dist/effects/ParallaxBarrierEffect.d.ts +8 -0
  88. package/dist/effects/ParallaxBarrierEffect.js +64 -0
  89. package/dist/effects/ParallaxBarrierEffect.mjs +64 -0
  90. package/dist/effects/PeppersGhostEffect.d.ts +10 -0
  91. package/dist/effects/PeppersGhostEffect.js +85 -0
  92. package/dist/effects/PeppersGhostEffect.mjs +85 -0
  93. package/dist/effects/StereoEffect.d.ts +9 -0
  94. package/dist/effects/StereoEffect.js +32 -0
  95. package/dist/effects/StereoEffect.mjs +32 -0
  96. package/dist/environments/RoomEnvironment.d.ts +5 -0
  97. package/dist/environments/RoomEnvironment.js +95 -0
  98. package/dist/environments/RoomEnvironment.mjs +78 -0
  99. package/dist/exporters/ColladaExporter.d.ts +50 -0
  100. package/dist/exporters/ColladaExporter.js +331 -0
  101. package/dist/exporters/ColladaExporter.mjs +331 -0
  102. package/dist/exporters/DRACOExporter.d.ts +23 -0
  103. package/dist/exporters/DRACOExporter.js +141 -0
  104. package/dist/exporters/DRACOExporter.mjs +141 -0
  105. package/dist/exporters/GLTFExporter.d.ts +446 -0
  106. package/dist/exporters/GLTFExporter.js +1575 -0
  107. package/dist/exporters/GLTFExporter.mjs +1575 -0
  108. package/dist/exporters/MMDExporter.d.ts +12 -0
  109. package/dist/exporters/MMDExporter.js +131 -0
  110. package/dist/exporters/MMDExporter.mjs +131 -0
  111. package/dist/exporters/OBJExporter.d.ts +18 -0
  112. package/dist/exporters/OBJExporter.js +181 -0
  113. package/dist/exporters/OBJExporter.mjs +181 -0
  114. package/dist/exporters/PLYExporter.d.ts +23 -0
  115. package/dist/exporters/PLYExporter.js +280 -0
  116. package/dist/exporters/PLYExporter.mjs +280 -0
  117. package/dist/exporters/STLExporter.d.ts +31 -0
  118. package/dist/exporters/STLExporter.js +146 -0
  119. package/dist/exporters/STLExporter.mjs +146 -0
  120. package/dist/exporters/USDZExporter.d.ts +27 -0
  121. package/dist/exporters/USDZExporter.js +340 -0
  122. package/dist/exporters/USDZExporter.mjs +340 -0
  123. package/dist/geometries/BoxLineGeometry.d.ts +12 -0
  124. package/dist/geometries/BoxLineGeometry.js +45 -0
  125. package/dist/geometries/BoxLineGeometry.mjs +45 -0
  126. package/dist/geometries/ConvexGeometry.d.ts +5 -0
  127. package/dist/geometries/ConvexGeometry.js +29 -0
  128. package/dist/geometries/ConvexGeometry.mjs +29 -0
  129. package/dist/geometries/DecalGeometry.d.ts +10 -0
  130. package/dist/geometries/DecalGeometry.js +184 -0
  131. package/dist/geometries/DecalGeometry.mjs +184 -0
  132. package/dist/geometries/LightningStrike.d.ts +108 -0
  133. package/dist/geometries/LightningStrike.js +548 -0
  134. package/dist/geometries/LightningStrike.mjs +548 -0
  135. package/dist/geometries/ParametricGeometries.d.ts +26 -0
  136. package/dist/geometries/ParametricGeometries.js +129 -0
  137. package/dist/geometries/ParametricGeometries.mjs +129 -0
  138. package/dist/geometries/ParametricGeometry.d.ts +18 -0
  139. package/dist/geometries/ParametricGeometry.js +63 -0
  140. package/dist/geometries/ParametricGeometry.mjs +63 -0
  141. package/dist/geometries/RoundedBoxGeometry.d.ts +5 -0
  142. package/dist/geometries/RoundedBoxGeometry.js +91 -0
  143. package/dist/geometries/RoundedBoxGeometry.mjs +91 -0
  144. package/dist/geometries/TeapotGeometry.d.ts +13 -0
  145. package/dist/geometries/TeapotGeometry.js +1563 -0
  146. package/dist/geometries/TeapotGeometry.mjs +1563 -0
  147. package/dist/geometries/TextGeometry.d.ts +18 -0
  148. package/dist/geometries/TextGeometry.js +27 -0
  149. package/dist/geometries/TextGeometry.mjs +27 -0
  150. package/dist/helpers/LightProbeHelper.d.ts +10 -0
  151. package/dist/helpers/LightProbeHelper.js +73 -0
  152. package/dist/helpers/LightProbeHelper.mjs +73 -0
  153. package/dist/helpers/PositionalAudioHelper.d.ts +13 -0
  154. package/dist/helpers/PositionalAudioHelper.js +68 -0
  155. package/dist/helpers/PositionalAudioHelper.mjs +68 -0
  156. package/dist/helpers/RectAreaLightHelper.d.ts +10 -0
  157. package/dist/helpers/RectAreaLightHelper.js +44 -0
  158. package/dist/helpers/RectAreaLightHelper.mjs +44 -0
  159. package/dist/helpers/VertexNormalsHelper.d.ts +10 -0
  160. package/dist/helpers/VertexNormalsHelper.js +54 -0
  161. package/dist/helpers/VertexNormalsHelper.mjs +54 -0
  162. package/dist/helpers/VertexTangentsHelper.d.ts +10 -0
  163. package/dist/helpers/VertexTangentsHelper.js +45 -0
  164. package/dist/helpers/VertexTangentsHelper.mjs +45 -0
  165. package/dist/index.d.ts +325 -0
  166. package/dist/index.js +978 -0
  167. package/dist/index.mjs +978 -0
  168. package/dist/interactive/HTMLMesh.d.ts +6 -0
  169. package/dist/interactive/HTMLMesh.js +325 -0
  170. package/dist/interactive/HTMLMesh.mjs +325 -0
  171. package/dist/interactive/InteractiveGroup.d.ts +5 -0
  172. package/dist/interactive/InteractiveGroup.js +68 -0
  173. package/dist/interactive/InteractiveGroup.mjs +68 -0
  174. package/dist/interactive/SelectionBox.d.ts +15 -0
  175. package/dist/interactive/SelectionBox.js +137 -0
  176. package/dist/interactive/SelectionBox.mjs +137 -0
  177. package/dist/interactive/SelectionHelper.d.ts +17 -0
  178. package/dist/interactive/SelectionHelper.js +54 -0
  179. package/dist/interactive/SelectionHelper.mjs +54 -0
  180. package/dist/libs/MeshoptDecoder.d.ts +12 -0
  181. package/dist/libs/MeshoptDecoder.js +221 -0
  182. package/dist/libs/MeshoptDecoder.mjs +221 -0
  183. package/dist/libs/MotionControllers.d.ts +175 -0
  184. package/dist/libs/MotionControllers.js +325 -0
  185. package/dist/libs/MotionControllers.mjs +325 -0
  186. package/dist/lights/LightProbeGenerator.d.ts +6 -0
  187. package/dist/lights/LightProbeGenerator.js +145 -0
  188. package/dist/lights/LightProbeGenerator.mjs +145 -0
  189. package/dist/lights/RectAreaLightUniformsLib.d.ts +3 -0
  190. package/dist/lights/RectAreaLightUniformsLib.js +32842 -0
  191. package/dist/lights/RectAreaLightUniformsLib.mjs +32842 -0
  192. package/dist/lines/Line2.d.ts +11 -0
  193. package/dist/lines/Line2.js +13 -0
  194. package/dist/lines/Line2.mjs +13 -0
  195. package/dist/lines/LineGeometry.d.ts +10 -0
  196. package/dist/lines/LineGeometry.js +44 -0
  197. package/dist/lines/LineGeometry.mjs +44 -0
  198. package/dist/lines/LineMaterial.d.ts +31 -0
  199. package/dist/lines/LineMaterial.js +547 -0
  200. package/dist/lines/LineMaterial.mjs +547 -0
  201. package/dist/lines/LineSegments2.d.ts +14 -0
  202. package/dist/lines/LineSegments2.js +203 -0
  203. package/dist/lines/LineSegments2.mjs +203 -0
  204. package/dist/lines/LineSegmentsGeometry.d.ts +16 -0
  205. package/dist/lines/LineSegmentsGeometry.js +124 -0
  206. package/dist/lines/LineSegmentsGeometry.mjs +124 -0
  207. package/dist/lines/Wireframe.d.ts +11 -0
  208. package/dist/lines/Wireframe.js +32 -0
  209. package/dist/lines/Wireframe.mjs +32 -0
  210. package/dist/lines/WireframeGeometry2.d.ts +8 -0
  211. package/dist/lines/WireframeGeometry2.js +13 -0
  212. package/dist/lines/WireframeGeometry2.mjs +13 -0
  213. package/dist/loaders/3DMLoader.d.ts +17 -0
  214. package/dist/loaders/3DMLoader.js +803 -0
  215. package/dist/loaders/3DMLoader.mjs +803 -0
  216. package/dist/loaders/3MFLoader.d.ts +16 -0
  217. package/dist/loaders/3MFLoader.js +854 -0
  218. package/dist/loaders/3MFLoader.mjs +854 -0
  219. package/dist/loaders/AMFLoader.d.ts +14 -0
  220. package/dist/loaders/AMFLoader.js +284 -0
  221. package/dist/loaders/AMFLoader.mjs +284 -0
  222. package/dist/loaders/AssimpLoader.js +1396 -0
  223. package/dist/loaders/AssimpLoader.mjs +1396 -0
  224. package/dist/loaders/BVHLoader.d.ts +21 -0
  225. package/dist/loaders/BVHLoader.js +207 -0
  226. package/dist/loaders/BVHLoader.mjs +207 -0
  227. package/dist/loaders/BasisTextureLoader.d.ts +32 -0
  228. package/dist/loaders/BasisTextureLoader.js +480 -0
  229. package/dist/loaders/BasisTextureLoader.mjs +480 -0
  230. package/dist/loaders/ColladaLoader.d.ts +20 -0
  231. package/dist/loaders/ColladaLoader.js +2405 -0
  232. package/dist/loaders/ColladaLoader.mjs +2405 -0
  233. package/dist/loaders/DDSLoader.d.ts +16 -0
  234. package/dist/loaders/DDSLoader.js +148 -0
  235. package/dist/loaders/DDSLoader.mjs +148 -0
  236. package/dist/loaders/DRACOLoader.d.ts +18 -0
  237. package/dist/loaders/DRACOLoader.js +341 -0
  238. package/dist/loaders/DRACOLoader.mjs +341 -0
  239. package/dist/loaders/EXRLoader.d.ts +18 -0
  240. package/dist/loaders/EXRLoader.js +1354 -0
  241. package/dist/loaders/EXRLoader.mjs +1354 -0
  242. package/dist/loaders/FBXLoader.d.ts +14 -0
  243. package/dist/loaders/FBXLoader.js +2457 -0
  244. package/dist/loaders/FBXLoader.mjs +2457 -0
  245. package/dist/loaders/FontLoader.d.ts +36 -0
  246. package/dist/loaders/FontLoader.js +120 -0
  247. package/dist/loaders/FontLoader.mjs +120 -0
  248. package/dist/loaders/GCodeLoader.d.ts +15 -0
  249. package/dist/loaders/GCodeLoader.js +141 -0
  250. package/dist/loaders/GCodeLoader.mjs +141 -0
  251. package/dist/loaders/GLTFLoader.d.ts +153 -0
  252. package/dist/loaders/GLTFLoader.js +2459 -0
  253. package/dist/loaders/GLTFLoader.mjs +2459 -0
  254. package/dist/loaders/HDRCubeTextureLoader.d.ts +18 -0
  255. package/dist/loaders/HDRCubeTextureLoader.js +75 -0
  256. package/dist/loaders/HDRCubeTextureLoader.mjs +75 -0
  257. package/dist/loaders/KMZLoader.d.ts +16 -0
  258. package/dist/loaders/KMZLoader.js +75 -0
  259. package/dist/loaders/KMZLoader.mjs +75 -0
  260. package/dist/loaders/KTX2Loader.d.ts +16 -0
  261. package/dist/loaders/KTX2Loader.js +461 -0
  262. package/dist/loaders/KTX2Loader.mjs +461 -0
  263. package/dist/loaders/KTXLoader.d.ts +16 -0
  264. package/dist/loaders/KTXLoader.js +93 -0
  265. package/dist/loaders/KTXLoader.mjs +93 -0
  266. package/dist/loaders/LDrawLoader.d.ts +26 -0
  267. package/dist/loaders/LDrawLoader.js +1424 -0
  268. package/dist/loaders/LDrawLoader.mjs +1424 -0
  269. package/dist/loaders/LUT3dlLoader.d.ts +20 -0
  270. package/dist/loaders/LUT3dlLoader.js +103 -0
  271. package/dist/loaders/LUT3dlLoader.mjs +103 -0
  272. package/dist/loaders/LUTCubeLoader.d.ts +23 -0
  273. package/dist/loaders/LUTCubeLoader.js +107 -0
  274. package/dist/loaders/LUTCubeLoader.mjs +107 -0
  275. package/dist/loaders/LWOLoader.d.ts +26 -0
  276. package/dist/loaders/LWOLoader.js +645 -0
  277. package/dist/loaders/LWOLoader.mjs +645 -0
  278. package/dist/loaders/LottieLoader.d.ts +15 -0
  279. package/dist/loaders/LottieLoader.js +47 -0
  280. package/dist/loaders/LottieLoader.mjs +47 -0
  281. package/dist/loaders/MD2Loader.d.ts +14 -0
  282. package/dist/loaders/MD2Loader.js +359 -0
  283. package/dist/loaders/MD2Loader.mjs +359 -0
  284. package/dist/loaders/MDDLoader.d.ts +19 -0
  285. package/dist/loaders/MDDLoader.js +58 -0
  286. package/dist/loaders/MDDLoader.mjs +58 -0
  287. package/dist/loaders/MMDLoader.d.ts +63 -0
  288. package/dist/loaders/MMDLoader.js +1121 -0
  289. package/dist/loaders/MMDLoader.mjs +1121 -0
  290. package/dist/loaders/MTLLoader.d.ts +100 -0
  291. package/dist/loaders/MTLLoader.js +304 -0
  292. package/dist/loaders/MTLLoader.mjs +304 -0
  293. package/dist/loaders/NRRDLoader.d.ts +21 -0
  294. package/dist/loaders/NRRDLoader.js +401 -0
  295. package/dist/loaders/NRRDLoader.mjs +401 -0
  296. package/dist/loaders/NodeMaterialLoader.js +146 -0
  297. package/dist/loaders/NodeMaterialLoader.mjs +146 -0
  298. package/dist/loaders/OBJLoader.d.ts +17 -0
  299. package/dist/loaders/OBJLoader.js +487 -0
  300. package/dist/loaders/OBJLoader.mjs +487 -0
  301. package/dist/loaders/PCDLoader.d.ts +15 -0
  302. package/dist/loaders/PCDLoader.js +248 -0
  303. package/dist/loaders/PCDLoader.mjs +248 -0
  304. package/dist/loaders/PDBLoader.d.ts +22 -0
  305. package/dist/loaders/PDBLoader.js +247 -0
  306. package/dist/loaders/PDBLoader.mjs +247 -0
  307. package/dist/loaders/PLYLoader.d.ts +16 -0
  308. package/dist/loaders/PLYLoader.js +317 -0
  309. package/dist/loaders/PLYLoader.mjs +317 -0
  310. package/dist/loaders/PRWMLoader.d.ts +16 -0
  311. package/dist/loaders/PRWMLoader.js +160 -0
  312. package/dist/loaders/PRWMLoader.mjs +160 -0
  313. package/dist/loaders/PVRLoader.d.ts +16 -0
  314. package/dist/loaders/PVRLoader.js +131 -0
  315. package/dist/loaders/PVRLoader.mjs +131 -0
  316. package/dist/loaders/RGBELoader.d.ts +20 -0
  317. package/dist/loaders/RGBELoader.js +252 -0
  318. package/dist/loaders/RGBELoader.mjs +252 -0
  319. package/dist/loaders/RGBMLoader.d.ts +32 -0
  320. package/dist/loaders/RGBMLoader.js +998 -0
  321. package/dist/loaders/RGBMLoader.mjs +998 -0
  322. package/dist/loaders/STLLoader.d.ts +14 -0
  323. package/dist/loaders/STLLoader.js +190 -0
  324. package/dist/loaders/STLLoader.mjs +190 -0
  325. package/dist/loaders/SVGLoader.d.ts +63 -0
  326. package/dist/loaders/SVGLoader.js +1712 -0
  327. package/dist/loaders/SVGLoader.mjs +1712 -0
  328. package/dist/loaders/TDSLoader.d.ts +42 -0
  329. package/dist/loaders/TDSLoader.js +650 -0
  330. package/dist/loaders/TDSLoader.mjs +650 -0
  331. package/dist/loaders/TGALoader.d.ts +14 -0
  332. package/dist/loaders/TGALoader.js +285 -0
  333. package/dist/loaders/TGALoader.mjs +285 -0
  334. package/dist/loaders/TTFLoader.d.ts +15 -0
  335. package/dist/loaders/TTFLoader.js +131 -0
  336. package/dist/loaders/TTFLoader.mjs +131 -0
  337. package/dist/loaders/TiltLoader.d.ts +14 -0
  338. package/dist/loaders/TiltLoader.js +373 -0
  339. package/dist/loaders/TiltLoader.mjs +373 -0
  340. package/dist/loaders/VOXLoader.d.ts +28 -0
  341. package/dist/loaders/VOXLoader.js +432 -0
  342. package/dist/loaders/VOXLoader.mjs +432 -0
  343. package/dist/loaders/VRMLLoader.d.ts +14 -0
  344. package/dist/loaders/VRMLLoader.js +2105 -0
  345. package/dist/loaders/VRMLLoader.mjs +2105 -0
  346. package/dist/loaders/VRMLoader.js +38 -0
  347. package/dist/loaders/VRMLoader.mjs +38 -0
  348. package/dist/loaders/VTKLoader.d.ts +14 -0
  349. package/dist/loaders/VTKLoader.js +648 -0
  350. package/dist/loaders/VTKLoader.mjs +648 -0
  351. package/dist/loaders/XLoader.js +1258 -0
  352. package/dist/loaders/XLoader.mjs +1258 -0
  353. package/dist/loaders/XYZLoader.d.ts +14 -0
  354. package/dist/loaders/XYZLoader.js +60 -0
  355. package/dist/loaders/XYZLoader.mjs +60 -0
  356. package/dist/loaders/lwo/IFFParser.js +749 -0
  357. package/dist/loaders/lwo/IFFParser.mjs +749 -0
  358. package/dist/loaders/lwo/LWO2Parser.js +327 -0
  359. package/dist/loaders/lwo/LWO2Parser.mjs +327 -0
  360. package/dist/loaders/lwo/LWO3Parser.js +298 -0
  361. package/dist/loaders/lwo/LWO3Parser.mjs +298 -0
  362. package/dist/math/Capsule.d.ts +27 -0
  363. package/dist/math/Capsule.js +100 -0
  364. package/dist/math/Capsule.mjs +100 -0
  365. package/dist/math/ColorConverter.d.ts +21 -0
  366. package/dist/math/ColorConverter.js +52 -0
  367. package/dist/math/ColorConverter.mjs +52 -0
  368. package/dist/math/ConvexHull.d.ts +89 -0
  369. package/dist/math/ConvexHull.js +597 -0
  370. package/dist/math/ConvexHull.mjs +597 -0
  371. package/dist/math/ImprovedNoise.d.ts +4 -0
  372. package/dist/math/ImprovedNoise.js +302 -0
  373. package/dist/math/ImprovedNoise.mjs +302 -0
  374. package/dist/math/Lut.d.ts +27 -0
  375. package/dist/math/Lut.js +135 -0
  376. package/dist/math/Lut.mjs +135 -0
  377. package/dist/math/MeshSurfaceSampler.d.ts +15 -0
  378. package/dist/math/MeshSurfaceSampler.js +107 -0
  379. package/dist/math/MeshSurfaceSampler.mjs +107 -0
  380. package/dist/math/OBB.d.ts +24 -0
  381. package/dist/math/OBB.js +262 -0
  382. package/dist/math/OBB.mjs +262 -0
  383. package/dist/math/Octree.d.ts +24 -0
  384. package/dist/math/Octree.js +278 -0
  385. package/dist/math/Octree.mjs +278 -0
  386. package/dist/math/SimplexNoise.d.ts +21 -0
  387. package/dist/math/SimplexNoise.js +440 -0
  388. package/dist/math/SimplexNoise.mjs +440 -0
  389. package/dist/misc/ConvexObjectBreaker.d.ts +25 -0
  390. package/dist/misc/ConvexObjectBreaker.js +298 -0
  391. package/dist/misc/ConvexObjectBreaker.mjs +298 -0
  392. package/dist/misc/GPUComputationRenderer.d.ts +52 -0
  393. package/dist/misc/GPUComputationRenderer.js +171 -0
  394. package/dist/misc/GPUComputationRenderer.mjs +171 -0
  395. package/dist/misc/Gyroscope.d.ts +5 -0
  396. package/dist/misc/Gyroscope.js +35 -0
  397. package/dist/misc/Gyroscope.mjs +35 -0
  398. package/dist/misc/MD2Character.d.ts +33 -0
  399. package/dist/misc/MD2Character.js +165 -0
  400. package/dist/misc/MD2Character.mjs +165 -0
  401. package/dist/misc/MD2CharacterComplex.d.ts +47 -0
  402. package/dist/misc/MD2CharacterComplex.js +331 -0
  403. package/dist/misc/MD2CharacterComplex.mjs +331 -0
  404. package/dist/misc/MorphAnimMesh.d.ts +13 -0
  405. package/dist/misc/MorphAnimMesh.js +40 -0
  406. package/dist/misc/MorphAnimMesh.mjs +40 -0
  407. package/dist/misc/MorphBlendMesh.d.ts +21 -0
  408. package/dist/misc/MorphBlendMesh.js +179 -0
  409. package/dist/misc/MorphBlendMesh.mjs +179 -0
  410. package/dist/misc/ProgressiveLightmap.d.ts +61 -0
  411. package/dist/misc/ProgressiveLightmap.js +186 -0
  412. package/dist/misc/ProgressiveLightmap.mjs +186 -0
  413. package/dist/misc/RollerCoaster.d.ts +21 -0
  414. package/dist/misc/RollerCoaster.js +346 -0
  415. package/dist/misc/RollerCoaster.mjs +346 -0
  416. package/dist/misc/Timer.d.ts +27 -0
  417. package/dist/misc/Timer.js +101 -0
  418. package/dist/misc/Timer.mjs +101 -0
  419. package/dist/misc/TubePainter.d.ts +10 -0
  420. package/dist/misc/TubePainter.js +123 -0
  421. package/dist/misc/TubePainter.mjs +123 -0
  422. package/dist/misc/Volume.d.ts +37 -0
  423. package/dist/misc/Volume.js +302 -0
  424. package/dist/misc/Volume.mjs +302 -0
  425. package/dist/misc/VolumeSlice.d.ts +28 -0
  426. package/dist/misc/VolumeSlice.js +115 -0
  427. package/dist/misc/VolumeSlice.mjs +115 -0
  428. package/dist/misc/WebGL.d.ts +5 -0
  429. package/dist/misc/WebGL.js +74 -0
  430. package/dist/misc/WebGL.mjs +74 -0
  431. package/dist/modifiers/CurveModifier.d.ts +91 -0
  432. package/dist/modifiers/CurveModifier.js +232 -0
  433. package/dist/modifiers/CurveModifier.mjs +232 -0
  434. package/dist/modifiers/EdgeSplitModifier.d.ts +19 -0
  435. package/dist/modifiers/EdgeSplitModifier.js +167 -0
  436. package/dist/modifiers/EdgeSplitModifier.mjs +168 -0
  437. package/dist/modifiers/SimplifyModifier.d.ts +19 -0
  438. package/dist/modifiers/SimplifyModifier.js +300 -0
  439. package/dist/modifiers/SimplifyModifier.mjs +300 -0
  440. package/dist/modifiers/TessellateModifier.d.ts +11 -0
  441. package/dist/modifiers/TessellateModifier.js +214 -0
  442. package/dist/modifiers/TessellateModifier.mjs +214 -0
  443. package/dist/nodes/Nodes.js +347 -0
  444. package/dist/nodes/Nodes.mjs +347 -0
  445. package/dist/nodes/ShaderNode.js +408 -0
  446. package/dist/nodes/ShaderNode.mjs +408 -0
  447. package/dist/nodes/accessors/BufferNode.js +14 -0
  448. package/dist/nodes/accessors/BufferNode.mjs +15 -0
  449. package/dist/nodes/accessors/CameraNode.js +43 -0
  450. package/dist/nodes/accessors/CameraNode.mjs +44 -0
  451. package/dist/nodes/accessors/CubeTextureNode.js +41 -0
  452. package/dist/nodes/accessors/CubeTextureNode.mjs +42 -0
  453. package/dist/nodes/accessors/MaterialNode.js +70 -0
  454. package/dist/nodes/accessors/MaterialNode.mjs +71 -0
  455. package/dist/nodes/accessors/MaterialReferenceNode.js +13 -0
  456. package/dist/nodes/accessors/MaterialReferenceNode.mjs +14 -0
  457. package/dist/nodes/accessors/ModelNode.js +8 -0
  458. package/dist/nodes/accessors/ModelNode.mjs +9 -0
  459. package/dist/nodes/accessors/ModelViewProjectionNode.js +23 -0
  460. package/dist/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
  461. package/dist/nodes/accessors/NormalNode.js +61 -0
  462. package/dist/nodes/accessors/NormalNode.mjs +62 -0
  463. package/dist/nodes/accessors/Object3DNode.js +75 -0
  464. package/dist/nodes/accessors/Object3DNode.mjs +76 -0
  465. package/dist/nodes/accessors/PointUVNode.js +12 -0
  466. package/dist/nodes/accessors/PointUVNode.mjs +13 -0
  467. package/dist/nodes/accessors/PositionNode.js +64 -0
  468. package/dist/nodes/accessors/PositionNode.mjs +65 -0
  469. package/dist/nodes/accessors/ReferenceNode.js +36 -0
  470. package/dist/nodes/accessors/ReferenceNode.mjs +37 -0
  471. package/dist/nodes/accessors/ReflectNode.js +42 -0
  472. package/dist/nodes/accessors/ReflectNode.mjs +43 -0
  473. package/dist/nodes/accessors/SkinningNode.js +57 -0
  474. package/dist/nodes/accessors/SkinningNode.mjs +58 -0
  475. package/dist/nodes/accessors/TextureNode.js +53 -0
  476. package/dist/nodes/accessors/TextureNode.mjs +54 -0
  477. package/dist/nodes/accessors/UVNode.js +22 -0
  478. package/dist/nodes/accessors/UVNode.mjs +23 -0
  479. package/dist/nodes/core/ArrayUniformNode.js +13 -0
  480. package/dist/nodes/core/ArrayUniformNode.mjs +14 -0
  481. package/dist/nodes/core/AttributeNode.js +29 -0
  482. package/dist/nodes/core/AttributeNode.mjs +30 -0
  483. package/dist/nodes/core/BypassNode.js +21 -0
  484. package/dist/nodes/core/BypassNode.mjs +22 -0
  485. package/dist/nodes/core/CodeNode.js +27 -0
  486. package/dist/nodes/core/CodeNode.mjs +28 -0
  487. package/dist/nodes/core/ConstNode.js +13 -0
  488. package/dist/nodes/core/ConstNode.mjs +14 -0
  489. package/dist/nodes/core/ContextNode.js +21 -0
  490. package/dist/nodes/core/ContextNode.mjs +22 -0
  491. package/dist/nodes/core/ExpressionNode.js +18 -0
  492. package/dist/nodes/core/ExpressionNode.mjs +19 -0
  493. package/dist/nodes/core/FunctionCallNode.js +36 -0
  494. package/dist/nodes/core/FunctionCallNode.mjs +37 -0
  495. package/dist/nodes/core/FunctionNode.js +55 -0
  496. package/dist/nodes/core/FunctionNode.mjs +56 -0
  497. package/dist/nodes/core/InputNode.js +37 -0
  498. package/dist/nodes/core/InputNode.mjs +38 -0
  499. package/dist/nodes/core/Node.js +138 -0
  500. package/dist/nodes/core/Node.mjs +139 -0
  501. package/dist/nodes/core/NodeAttribute.js +9 -0
  502. package/dist/nodes/core/NodeAttribute.mjs +10 -0
  503. package/dist/nodes/core/NodeBuilder.js +402 -0
  504. package/dist/nodes/core/NodeBuilder.mjs +402 -0
  505. package/dist/nodes/core/NodeCode.js +10 -0
  506. package/dist/nodes/core/NodeCode.mjs +11 -0
  507. package/dist/nodes/core/NodeFrame.js +34 -0
  508. package/dist/nodes/core/NodeFrame.mjs +35 -0
  509. package/dist/nodes/core/NodeFunctionInput.js +12 -0
  510. package/dist/nodes/core/NodeFunctionInput.mjs +13 -0
  511. package/dist/nodes/core/NodeKeywords.js +43 -0
  512. package/dist/nodes/core/NodeKeywords.mjs +44 -0
  513. package/dist/nodes/core/NodeUniform.js +17 -0
  514. package/dist/nodes/core/NodeUniform.mjs +18 -0
  515. package/dist/nodes/core/NodeUtils.js +57 -0
  516. package/dist/nodes/core/NodeUtils.mjs +57 -0
  517. package/dist/nodes/core/NodeVar.js +9 -0
  518. package/dist/nodes/core/NodeVar.mjs +10 -0
  519. package/dist/nodes/core/NodeVary.js +9 -0
  520. package/dist/nodes/core/NodeVary.mjs +10 -0
  521. package/dist/nodes/core/PropertyNode.js +20 -0
  522. package/dist/nodes/core/PropertyNode.mjs +21 -0
  523. package/dist/nodes/core/TempNode.js +24 -0
  524. package/dist/nodes/core/TempNode.mjs +25 -0
  525. package/dist/nodes/core/UniformNode.js +22 -0
  526. package/dist/nodes/core/UniformNode.mjs +23 -0
  527. package/dist/nodes/core/VarNode.js +30 -0
  528. package/dist/nodes/core/VarNode.mjs +31 -0
  529. package/dist/nodes/core/VaryNode.js +29 -0
  530. package/dist/nodes/core/VaryNode.mjs +30 -0
  531. package/dist/nodes/core/constants.js +24 -0
  532. package/dist/nodes/core/constants.mjs +24 -0
  533. package/dist/nodes/display/ColorSpaceNode.js +62 -0
  534. package/dist/nodes/display/ColorSpaceNode.mjs +62 -0
  535. package/dist/nodes/display/NormalMapNode.js +53 -0
  536. package/dist/nodes/display/NormalMapNode.mjs +54 -0
  537. package/dist/nodes/fog/FogNode.js +14 -0
  538. package/dist/nodes/fog/FogNode.mjs +15 -0
  539. package/dist/nodes/fog/FogRangeNode.js +16 -0
  540. package/dist/nodes/fog/FogRangeNode.mjs +17 -0
  541. package/dist/nodes/functions/BSDFs.js +64 -0
  542. package/dist/nodes/functions/BSDFs.mjs +64 -0
  543. package/dist/nodes/lights/LightContextNode.js +34 -0
  544. package/dist/nodes/lights/LightContextNode.mjs +35 -0
  545. package/dist/nodes/lights/LightNode.js +57 -0
  546. package/dist/nodes/lights/LightNode.mjs +58 -0
  547. package/dist/nodes/lights/LightsNode.js +58 -0
  548. package/dist/nodes/lights/LightsNode.mjs +59 -0
  549. package/dist/nodes/loaders/NodeLoader.js +195 -0
  550. package/dist/nodes/loaders/NodeLoader.mjs +196 -0
  551. package/dist/nodes/loaders/NodeMaterialLoader.js +23 -0
  552. package/dist/nodes/loaders/NodeMaterialLoader.mjs +24 -0
  553. package/dist/nodes/loaders/NodeObjectLoader.js +39 -0
  554. package/dist/nodes/loaders/NodeObjectLoader.mjs +40 -0
  555. package/dist/nodes/materials/LineBasicNodeMaterial.js +26 -0
  556. package/dist/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
  557. package/dist/nodes/materials/Materials.js +24 -0
  558. package/dist/nodes/materials/Materials.mjs +24 -0
  559. package/dist/nodes/materials/MeshBasicNodeMaterial.js +27 -0
  560. package/dist/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
  561. package/dist/nodes/materials/MeshStandardNodeMaterial.js +40 -0
  562. package/dist/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
  563. package/dist/nodes/materials/NodeMaterial.js +63 -0
  564. package/dist/nodes/materials/NodeMaterial.mjs +64 -0
  565. package/dist/nodes/materials/PointsNodeMaterial.js +29 -0
  566. package/dist/nodes/materials/PointsNodeMaterial.mjs +30 -0
  567. package/dist/nodes/math/CondNode.js +40 -0
  568. package/dist/nodes/math/CondNode.mjs +41 -0
  569. package/dist/nodes/math/MathNode.js +165 -0
  570. package/dist/nodes/math/MathNode.mjs +166 -0
  571. package/dist/nodes/math/OperatorNode.js +102 -0
  572. package/dist/nodes/math/OperatorNode.mjs +103 -0
  573. package/dist/nodes/procedural/CheckerNode.js +20 -0
  574. package/dist/nodes/procedural/CheckerNode.mjs +21 -0
  575. package/dist/nodes/utils/ArrayElementNode.js +18 -0
  576. package/dist/nodes/utils/ArrayElementNode.mjs +19 -0
  577. package/dist/nodes/utils/ConvertNode.js +24 -0
  578. package/dist/nodes/utils/ConvertNode.mjs +25 -0
  579. package/dist/nodes/utils/JoinNode.js +25 -0
  580. package/dist/nodes/utils/JoinNode.mjs +26 -0
  581. package/dist/nodes/utils/MatcapUVNode.js +15 -0
  582. package/dist/nodes/utils/MatcapUVNode.mjs +16 -0
  583. package/dist/nodes/utils/OscNode.js +49 -0
  584. package/dist/nodes/utils/OscNode.mjs +50 -0
  585. package/dist/nodes/utils/SplitNode.js +44 -0
  586. package/dist/nodes/utils/SplitNode.mjs +45 -0
  587. package/dist/nodes/utils/SpriteSheetUVNode.js +39 -0
  588. package/dist/nodes/utils/SpriteSheetUVNode.mjs +40 -0
  589. package/dist/nodes/utils/TimerNode.js +43 -0
  590. package/dist/nodes/utils/TimerNode.mjs +44 -0
  591. package/dist/objects/GroundProjectedEnv.d.ts +12 -0
  592. package/dist/objects/GroundProjectedEnv.js +134 -0
  593. package/dist/objects/GroundProjectedEnv.mjs +134 -0
  594. package/dist/objects/Lensflare.d.ts +17 -0
  595. package/dist/objects/Lensflare.js +280 -0
  596. package/dist/objects/Lensflare.mjs +280 -0
  597. package/dist/objects/LightningStorm.d.ts +32 -0
  598. package/dist/objects/LightningStorm.js +110 -0
  599. package/dist/objects/LightningStorm.mjs +110 -0
  600. package/dist/objects/MarchingCubes.d.ts +75 -0
  601. package/dist/objects/MarchingCubes.js +457 -0
  602. package/dist/objects/MarchingCubes.mjs +457 -0
  603. package/dist/objects/Reflector.d.ts +19 -0
  604. package/dist/objects/Reflector.js +175 -0
  605. package/dist/objects/Reflector.mjs +175 -0
  606. package/dist/objects/ReflectorForSSRPass.d.ts +48 -0
  607. package/dist/objects/ReflectorForSSRPass.js +256 -0
  608. package/dist/objects/ReflectorForSSRPass.mjs +256 -0
  609. package/dist/objects/ReflectorRTT.js +10 -0
  610. package/dist/objects/ReflectorRTT.mjs +10 -0
  611. package/dist/objects/Refractor.d.ts +19 -0
  612. package/dist/objects/Refractor.js +188 -0
  613. package/dist/objects/Refractor.mjs +188 -0
  614. package/dist/objects/ShadowMesh.d.ts +7 -0
  615. package/dist/objects/ShadowMesh.js +41 -0
  616. package/dist/objects/ShadowMesh.mjs +41 -0
  617. package/dist/objects/Sky.d.ts +43 -0
  618. package/dist/objects/Sky.js +156 -0
  619. package/dist/objects/Sky.mjs +156 -0
  620. package/dist/objects/Water.d.ts +22 -0
  621. package/dist/objects/Water.js +241 -0
  622. package/dist/objects/Water.mjs +241 -0
  623. package/dist/objects/Water2.d.ts +22 -0
  624. package/dist/objects/Water2.js +258 -0
  625. package/dist/objects/Water2.mjs +258 -0
  626. package/dist/offscreen/jank.js +26 -0
  627. package/dist/offscreen/jank.mjs +27 -0
  628. package/dist/offscreen/offscreen.js +8 -0
  629. package/dist/offscreen/offscreen.mjs +7 -0
  630. package/dist/offscreen/scene.js +68 -0
  631. package/dist/offscreen/scene.mjs +52 -0
  632. package/dist/physics/AmmoPhysics.d.ts +7 -0
  633. package/dist/physics/AmmoPhysics.js +166 -0
  634. package/dist/physics/AmmoPhysics.mjs +166 -0
  635. package/dist/postprocessing/AdaptiveToneMappingPass.d.ts +29 -0
  636. package/dist/postprocessing/AdaptiveToneMappingPass.js +225 -0
  637. package/dist/postprocessing/AdaptiveToneMappingPass.mjs +225 -0
  638. package/dist/postprocessing/AfterimagePass.d.ts +15 -0
  639. package/dist/postprocessing/AfterimagePass.js +68 -0
  640. package/dist/postprocessing/AfterimagePass.mjs +68 -0
  641. package/dist/postprocessing/BloomPass.d.ts +16 -0
  642. package/dist/postprocessing/BloomPass.js +109 -0
  643. package/dist/postprocessing/BloomPass.mjs +109 -0
  644. package/dist/postprocessing/BokehPass.d.ts +26 -0
  645. package/dist/postprocessing/BokehPass.js +90 -0
  646. package/dist/postprocessing/BokehPass.mjs +90 -0
  647. package/dist/postprocessing/ClearPass.d.ts +10 -0
  648. package/dist/postprocessing/ClearPass.js +36 -0
  649. package/dist/postprocessing/ClearPass.mjs +36 -0
  650. package/dist/postprocessing/CubeTexturePass.d.ts +14 -0
  651. package/dist/postprocessing/CubeTexturePass.js +49 -0
  652. package/dist/postprocessing/CubeTexturePass.mjs +49 -0
  653. package/dist/postprocessing/DotScreenPass.d.ts +10 -0
  654. package/dist/postprocessing/DotScreenPass.js +49 -0
  655. package/dist/postprocessing/DotScreenPass.mjs +49 -0
  656. package/dist/postprocessing/EffectComposer.d.ts +27 -0
  657. package/dist/postprocessing/EffectComposer.js +156 -0
  658. package/dist/postprocessing/EffectComposer.mjs +156 -0
  659. package/dist/postprocessing/FilmPass.d.ts +10 -0
  660. package/dist/postprocessing/FilmPass.js +51 -0
  661. package/dist/postprocessing/FilmPass.mjs +51 -0
  662. package/dist/postprocessing/GlitchPass.d.ts +15 -0
  663. package/dist/postprocessing/GlitchPass.js +84 -0
  664. package/dist/postprocessing/GlitchPass.mjs +84 -0
  665. package/dist/postprocessing/HalftonePass.d.ts +26 -0
  666. package/dist/postprocessing/HalftonePass.js +53 -0
  667. package/dist/postprocessing/HalftonePass.mjs +53 -0
  668. package/dist/postprocessing/LUTPass.d.ts +13 -0
  669. package/dist/postprocessing/LUTPass.js +142 -0
  670. package/dist/postprocessing/LUTPass.mjs +142 -0
  671. package/dist/postprocessing/MaskPass.d.ts +14 -0
  672. package/dist/postprocessing/MaskPass.js +69 -0
  673. package/dist/postprocessing/MaskPass.mjs +69 -0
  674. package/dist/postprocessing/OutlinePass.d.ts +53 -0
  675. package/dist/postprocessing/OutlinePass.js +479 -0
  676. package/dist/postprocessing/OutlinePass.mjs +479 -0
  677. package/dist/postprocessing/Pass.d.ts +20 -0
  678. package/dist/postprocessing/Pass.js +48 -0
  679. package/dist/postprocessing/Pass.mjs +48 -0
  680. package/dist/postprocessing/RenderPass.d.ts +14 -0
  681. package/dist/postprocessing/RenderPass.js +59 -0
  682. package/dist/postprocessing/RenderPass.mjs +59 -0
  683. package/dist/postprocessing/RenderPixelatedPass.js +199 -0
  684. package/dist/postprocessing/RenderPixelatedPass.mjs +199 -0
  685. package/dist/postprocessing/SAOPass.d.ts +79 -0
  686. package/dist/postprocessing/SAOPass.js +282 -0
  687. package/dist/postprocessing/SAOPass.mjs +282 -0
  688. package/dist/postprocessing/SMAAPass.d.ts +21 -0
  689. package/dist/postprocessing/SMAAPass.js +112 -0
  690. package/dist/postprocessing/SMAAPass.mjs +112 -0
  691. package/dist/postprocessing/SSAARenderPass.d.ts +17 -0
  692. package/dist/postprocessing/SSAARenderPass.js +171 -0
  693. package/dist/postprocessing/SSAARenderPass.mjs +171 -0
  694. package/dist/postprocessing/SSAOPass.d.ts +71 -0
  695. package/dist/postprocessing/SSAOPass.js +265 -0
  696. package/dist/postprocessing/SSAOPass.mjs +265 -0
  697. package/dist/postprocessing/SSRPass.d.ts +124 -0
  698. package/dist/postprocessing/SSRPass.js +438 -0
  699. package/dist/postprocessing/SSRPass.mjs +438 -0
  700. package/dist/postprocessing/SavePass.d.ts +12 -0
  701. package/dist/postprocessing/SavePass.js +37 -0
  702. package/dist/postprocessing/SavePass.mjs +37 -0
  703. package/dist/postprocessing/ShaderPass.d.ts +13 -0
  704. package/dist/postprocessing/ShaderPass.js +49 -0
  705. package/dist/postprocessing/ShaderPass.mjs +49 -0
  706. package/dist/postprocessing/TAARenderPass.d.ts +8 -0
  707. package/dist/postprocessing/TAARenderPass.js +89 -0
  708. package/dist/postprocessing/TAARenderPass.mjs +89 -0
  709. package/dist/postprocessing/TexturePass.d.ts +12 -0
  710. package/dist/postprocessing/TexturePass.js +39 -0
  711. package/dist/postprocessing/TexturePass.mjs +39 -0
  712. package/dist/postprocessing/UnrealBloomPass.d.ts +31 -0
  713. package/dist/postprocessing/UnrealBloomPass.js +220 -0
  714. package/dist/postprocessing/UnrealBloomPass.mjs +220 -0
  715. package/dist/postprocessing/WaterPass.d.ts +30 -0
  716. package/dist/postprocessing/WaterPass.js +72 -0
  717. package/dist/postprocessing/WaterPass.mjs +72 -0
  718. package/dist/renderers/CSS2DRenderer.d.ts +22 -0
  719. package/dist/renderers/CSS2DRenderer.js +121 -0
  720. package/dist/renderers/CSS2DRenderer.mjs +121 -0
  721. package/dist/renderers/CSS3DRenderer.d.ts +26 -0
  722. package/dist/renderers/CSS3DRenderer.js +133 -0
  723. package/dist/renderers/CSS3DRenderer.mjs +133 -0
  724. package/dist/renderers/Projector.d.ts +60 -0
  725. package/dist/renderers/Projector.js +511 -0
  726. package/dist/renderers/Projector.mjs +511 -0
  727. package/dist/renderers/SVGRenderer.d.ts +25 -0
  728. package/dist/renderers/SVGRenderer.js +306 -0
  729. package/dist/renderers/SVGRenderer.mjs +306 -0
  730. package/dist/renderers/nodes/accessors/CameraNode.js +62 -0
  731. package/dist/renderers/nodes/accessors/CameraNode.mjs +63 -0
  732. package/dist/renderers/nodes/accessors/ModelNode.js +60 -0
  733. package/dist/renderers/nodes/accessors/ModelNode.mjs +61 -0
  734. package/dist/renderers/nodes/accessors/ModelViewProjectionNode.js +20 -0
  735. package/dist/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
  736. package/dist/renderers/nodes/accessors/NormalNode.js +60 -0
  737. package/dist/renderers/nodes/accessors/NormalNode.mjs +61 -0
  738. package/dist/renderers/nodes/accessors/PositionNode.js +29 -0
  739. package/dist/renderers/nodes/accessors/PositionNode.mjs +30 -0
  740. package/dist/renderers/nodes/accessors/UVNode.js +12 -0
  741. package/dist/renderers/nodes/accessors/UVNode.mjs +13 -0
  742. package/dist/renderers/nodes/core/AttributeNode.js +34 -0
  743. package/dist/renderers/nodes/core/AttributeNode.mjs +35 -0
  744. package/dist/renderers/nodes/core/InputNode.js +30 -0
  745. package/dist/renderers/nodes/core/InputNode.mjs +31 -0
  746. package/dist/renderers/nodes/core/Node.js +33 -0
  747. package/dist/renderers/nodes/core/Node.mjs +34 -0
  748. package/dist/renderers/nodes/core/NodeAttribute.js +9 -0
  749. package/dist/renderers/nodes/core/NodeAttribute.mjs +10 -0
  750. package/dist/renderers/nodes/core/NodeBuilder.js +248 -0
  751. package/dist/renderers/nodes/core/NodeBuilder.mjs +249 -0
  752. package/dist/renderers/nodes/core/NodeFrame.js +34 -0
  753. package/dist/renderers/nodes/core/NodeFrame.mjs +35 -0
  754. package/dist/renderers/nodes/core/NodeSlot.js +9 -0
  755. package/dist/renderers/nodes/core/NodeSlot.mjs +10 -0
  756. package/dist/renderers/nodes/core/NodeUniform.js +17 -0
  757. package/dist/renderers/nodes/core/NodeUniform.mjs +18 -0
  758. package/dist/renderers/nodes/core/NodeVary.js +10 -0
  759. package/dist/renderers/nodes/core/NodeVary.mjs +11 -0
  760. package/dist/renderers/nodes/core/VaryNode.js +21 -0
  761. package/dist/renderers/nodes/core/VaryNode.mjs +22 -0
  762. package/dist/renderers/nodes/core/constants.js +22 -0
  763. package/dist/renderers/nodes/core/constants.mjs +22 -0
  764. package/dist/renderers/nodes/inputs/ColorNode.js +10 -0
  765. package/dist/renderers/nodes/inputs/ColorNode.mjs +11 -0
  766. package/dist/renderers/nodes/inputs/FloatNode.js +10 -0
  767. package/dist/renderers/nodes/inputs/FloatNode.mjs +11 -0
  768. package/dist/renderers/nodes/inputs/Matrix3Node.js +11 -0
  769. package/dist/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
  770. package/dist/renderers/nodes/inputs/Matrix4Node.js +11 -0
  771. package/dist/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
  772. package/dist/renderers/nodes/inputs/TextureNode.js +19 -0
  773. package/dist/renderers/nodes/inputs/TextureNode.mjs +20 -0
  774. package/dist/renderers/nodes/inputs/Vector2Node.js +10 -0
  775. package/dist/renderers/nodes/inputs/Vector2Node.mjs +11 -0
  776. package/dist/renderers/nodes/inputs/Vector3Node.js +11 -0
  777. package/dist/renderers/nodes/inputs/Vector3Node.mjs +12 -0
  778. package/dist/renderers/nodes/inputs/Vector4Node.js +11 -0
  779. package/dist/renderers/nodes/inputs/Vector4Node.mjs +12 -0
  780. package/dist/renderers/nodes/math/MathNode.js +54 -0
  781. package/dist/renderers/nodes/math/MathNode.mjs +55 -0
  782. package/dist/renderers/nodes/math/OperatorNode.js +41 -0
  783. package/dist/renderers/nodes/math/OperatorNode.mjs +42 -0
  784. package/dist/renderers/nodes/utils/SwitchNode.js +19 -0
  785. package/dist/renderers/nodes/utils/SwitchNode.mjs +20 -0
  786. package/dist/renderers/nodes/utils/TimerNode.js +13 -0
  787. package/dist/renderers/nodes/utils/TimerNode.mjs +14 -0
  788. package/dist/renderers/webgpu/WebGPU.js +23 -0
  789. package/dist/renderers/webgpu/WebGPU.mjs +24 -0
  790. package/dist/renderers/webgpu/WebGPUAttributes.js +68 -0
  791. package/dist/renderers/webgpu/WebGPUAttributes.mjs +69 -0
  792. package/dist/renderers/webgpu/WebGPUBackground.js +60 -0
  793. package/dist/renderers/webgpu/WebGPUBackground.mjs +61 -0
  794. package/dist/renderers/webgpu/WebGPUBinding.js +13 -0
  795. package/dist/renderers/webgpu/WebGPUBinding.mjs +14 -0
  796. package/dist/renderers/webgpu/WebGPUBindings.js +154 -0
  797. package/dist/renderers/webgpu/WebGPUBindings.mjs +155 -0
  798. package/dist/renderers/webgpu/WebGPUComputePipelines.js +43 -0
  799. package/dist/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
  800. package/dist/renderers/webgpu/WebGPUGeometries.js +40 -0
  801. package/dist/renderers/webgpu/WebGPUGeometries.mjs +41 -0
  802. package/dist/renderers/webgpu/WebGPUInfo.js +45 -0
  803. package/dist/renderers/webgpu/WebGPUInfo.mjs +46 -0
  804. package/dist/renderers/webgpu/WebGPUObjects.js +24 -0
  805. package/dist/renderers/webgpu/WebGPUObjects.mjs +25 -0
  806. package/dist/renderers/webgpu/WebGPUProperties.js +21 -0
  807. package/dist/renderers/webgpu/WebGPUProperties.mjs +22 -0
  808. package/dist/renderers/webgpu/WebGPURenderLists.js +118 -0
  809. package/dist/renderers/webgpu/WebGPURenderLists.mjs +119 -0
  810. package/dist/renderers/webgpu/WebGPURenderPipelines.js +545 -0
  811. package/dist/renderers/webgpu/WebGPURenderPipelines.mjs +546 -0
  812. package/dist/renderers/webgpu/WebGPURenderer.js +596 -0
  813. package/dist/renderers/webgpu/WebGPURenderer.mjs +575 -0
  814. package/dist/renderers/webgpu/WebGPUSampledTexture.js +40 -0
  815. package/dist/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
  816. package/dist/renderers/webgpu/WebGPUSampler.js +14 -0
  817. package/dist/renderers/webgpu/WebGPUSampler.mjs +15 -0
  818. package/dist/renderers/webgpu/WebGPUStorageBuffer.js +14 -0
  819. package/dist/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
  820. package/dist/renderers/webgpu/WebGPUTextureRenderer.js +22 -0
  821. package/dist/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
  822. package/dist/renderers/webgpu/WebGPUTextureUtils.js +97 -0
  823. package/dist/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
  824. package/dist/renderers/webgpu/WebGPUTextures.js +483 -0
  825. package/dist/renderers/webgpu/WebGPUTextures.mjs +484 -0
  826. package/dist/renderers/webgpu/WebGPUUniform.js +81 -0
  827. package/dist/renderers/webgpu/WebGPUUniform.mjs +81 -0
  828. package/dist/renderers/webgpu/WebGPUUniformsGroup.js +175 -0
  829. package/dist/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
  830. package/dist/renderers/webgpu/constants.js +241 -0
  831. package/dist/renderers/webgpu/constants.mjs +241 -0
  832. package/dist/renderers/webgpu/nodes/ShaderLib.js +41 -0
  833. package/dist/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
  834. package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.js +164 -0
  835. package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
  836. package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.js +73 -0
  837. package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
  838. package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +14 -0
  839. package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
  840. package/dist/renderers/webgpu/nodes/WebGPUNodes.js +39 -0
  841. package/dist/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
  842. package/dist/shaders/ACESFilmicToneMappingShader.d.ts +16 -0
  843. package/dist/shaders/ACESFilmicToneMappingShader.js +55 -0
  844. package/dist/shaders/ACESFilmicToneMappingShader.mjs +55 -0
  845. package/dist/shaders/AfterimageShader.d.ts +15 -0
  846. package/dist/shaders/AfterimageShader.js +32 -0
  847. package/dist/shaders/AfterimageShader.mjs +32 -0
  848. package/dist/shaders/BasicShader.d.ts +8 -0
  849. package/dist/shaders/BasicShader.js +12 -0
  850. package/dist/shaders/BasicShader.mjs +12 -0
  851. package/dist/shaders/BleachBypassShader.d.ts +14 -0
  852. package/dist/shaders/BleachBypassShader.js +35 -0
  853. package/dist/shaders/BleachBypassShader.mjs +35 -0
  854. package/dist/shaders/BlendShader.d.ts +21 -0
  855. package/dist/shaders/BlendShader.js +30 -0
  856. package/dist/shaders/BlendShader.mjs +30 -0
  857. package/dist/shaders/BokehShader.d.ts +24 -0
  858. package/dist/shaders/BokehShader.js +109 -0
  859. package/dist/shaders/BokehShader.mjs +109 -0
  860. package/dist/shaders/BokehShader2.d.ts +50 -0
  861. package/dist/shaders/BokehShader2.js +269 -0
  862. package/dist/shaders/BokehShader2.mjs +269 -0
  863. package/dist/shaders/BrightnessContrastShader.d.ts +21 -0
  864. package/dist/shaders/BrightnessContrastShader.js +32 -0
  865. package/dist/shaders/BrightnessContrastShader.mjs +32 -0
  866. package/dist/shaders/ColorCorrectionShader.d.ts +22 -0
  867. package/dist/shaders/ColorCorrectionShader.js +30 -0
  868. package/dist/shaders/ColorCorrectionShader.mjs +30 -0
  869. package/dist/shaders/ColorifyShader.d.ts +16 -0
  870. package/dist/shaders/ColorifyShader.js +28 -0
  871. package/dist/shaders/ColorifyShader.mjs +28 -0
  872. package/dist/shaders/ConvolutionShader.d.ts +21 -0
  873. package/dist/shaders/ConvolutionShader.js +55 -0
  874. package/dist/shaders/ConvolutionShader.mjs +55 -0
  875. package/dist/shaders/CopyShader.d.ts +12 -0
  876. package/dist/shaders/CopyShader.js +25 -0
  877. package/dist/shaders/CopyShader.mjs +25 -0
  878. package/dist/shaders/DOFMipMapShader.d.ts +23 -0
  879. package/dist/shaders/DOFMipMapShader.js +32 -0
  880. package/dist/shaders/DOFMipMapShader.mjs +32 -0
  881. package/dist/shaders/DepthLimitedBlurShader.d.ts +28 -0
  882. package/dist/shaders/DepthLimitedBlurShader.js +114 -0
  883. package/dist/shaders/DepthLimitedBlurShader.mjs +114 -0
  884. package/dist/shaders/DigitalGlitch.d.ts +39 -0
  885. package/dist/shaders/DigitalGlitch.js +85 -0
  886. package/dist/shaders/DigitalGlitch.mjs +85 -0
  887. package/dist/shaders/DotScreenShader.d.ts +27 -0
  888. package/dist/shaders/DotScreenShader.js +39 -0
  889. package/dist/shaders/DotScreenShader.mjs +39 -0
  890. package/dist/shaders/FXAAShader.d.ts +19 -0
  891. package/dist/shaders/FXAAShader.js +1098 -0
  892. package/dist/shaders/FXAAShader.mjs +1098 -0
  893. package/dist/shaders/FilmShader.d.ts +43 -0
  894. package/dist/shaders/FilmShader.js +53 -0
  895. package/dist/shaders/FilmShader.mjs +53 -0
  896. package/dist/shaders/FocusShader.d.ts +26 -0
  897. package/dist/shaders/FocusShader.js +55 -0
  898. package/dist/shaders/FocusShader.mjs +55 -0
  899. package/dist/shaders/FreiChenShader.d.ts +19 -0
  900. package/dist/shaders/FreiChenShader.js +64 -0
  901. package/dist/shaders/FreiChenShader.mjs +64 -0
  902. package/dist/shaders/FresnelShader.d.ts +24 -0
  903. package/dist/shaders/FresnelShader.js +47 -0
  904. package/dist/shaders/FresnelShader.mjs +47 -0
  905. package/dist/shaders/GammaCorrectionShader.d.ts +12 -0
  906. package/dist/shaders/GammaCorrectionShader.js +23 -0
  907. package/dist/shaders/GammaCorrectionShader.mjs +23 -0
  908. package/dist/shaders/GodRaysShader.d.ts +97 -0
  909. package/dist/shaders/GodRaysShader.js +183 -0
  910. package/dist/shaders/GodRaysShader.mjs +183 -0
  911. package/dist/shaders/HalftoneShader.d.ts +51 -0
  912. package/dist/shaders/HalftoneShader.js +228 -0
  913. package/dist/shaders/HalftoneShader.mjs +228 -0
  914. package/dist/shaders/HorizontalBlurShader.d.ts +18 -0
  915. package/dist/shaders/HorizontalBlurShader.js +49 -0
  916. package/dist/shaders/HorizontalBlurShader.mjs +49 -0
  917. package/dist/shaders/HorizontalTiltShiftShader.d.ts +23 -0
  918. package/dist/shaders/HorizontalTiltShiftShader.js +37 -0
  919. package/dist/shaders/HorizontalTiltShiftShader.mjs +37 -0
  920. package/dist/shaders/HueSaturationShader.d.ts +21 -0
  921. package/dist/shaders/HueSaturationShader.js +43 -0
  922. package/dist/shaders/HueSaturationShader.mjs +43 -0
  923. package/dist/shaders/KaleidoShader.d.ts +24 -0
  924. package/dist/shaders/KaleidoShader.js +34 -0
  925. package/dist/shaders/KaleidoShader.mjs +34 -0
  926. package/dist/shaders/LuminosityHighPassShader.d.ts +27 -0
  927. package/dist/shaders/LuminosityHighPassShader.js +37 -0
  928. package/dist/shaders/LuminosityHighPassShader.mjs +37 -0
  929. package/dist/shaders/LuminosityShader.d.ts +13 -0
  930. package/dist/shaders/LuminosityShader.js +25 -0
  931. package/dist/shaders/LuminosityShader.mjs +25 -0
  932. package/dist/shaders/MirrorShader.d.ts +18 -0
  933. package/dist/shaders/MirrorShader.js +35 -0
  934. package/dist/shaders/MirrorShader.mjs +35 -0
  935. package/dist/shaders/NormalMapShader.d.ts +23 -0
  936. package/dist/shaders/NormalMapShader.js +31 -0
  937. package/dist/shaders/NormalMapShader.mjs +31 -0
  938. package/dist/shaders/ParallaxShader.d.ts +28 -0
  939. package/dist/shaders/ParallaxShader.js +133 -0
  940. package/dist/shaders/ParallaxShader.mjs +133 -0
  941. package/dist/shaders/PixelShader.d.ts +18 -0
  942. package/dist/shaders/PixelShader.js +28 -0
  943. package/dist/shaders/PixelShader.mjs +28 -0
  944. package/dist/shaders/RGBShiftShader.d.ts +24 -0
  945. package/dist/shaders/RGBShiftShader.js +30 -0
  946. package/dist/shaders/RGBShiftShader.mjs +30 -0
  947. package/dist/shaders/SAOShader.d.ts +25 -0
  948. package/dist/shaders/SAOShader.js +144 -0
  949. package/dist/shaders/SAOShader.mjs +144 -0
  950. package/dist/shaders/SMAAShader.d.ts +60 -0
  951. package/dist/shaders/SMAAShader.js +358 -0
  952. package/dist/shaders/SMAAShader.mjs +358 -0
  953. package/dist/shaders/SSAOShader.d.ts +86 -0
  954. package/dist/shaders/SSAOShader.js +182 -0
  955. package/dist/shaders/SSAOShader.mjs +182 -0
  956. package/dist/shaders/SSRShader.d.ts +94 -0
  957. package/dist/shaders/SSRShader.js +342 -0
  958. package/dist/shaders/SSRShader.mjs +342 -0
  959. package/dist/shaders/SepiaShader.d.ts +17 -0
  960. package/dist/shaders/SepiaShader.js +29 -0
  961. package/dist/shaders/SepiaShader.mjs +29 -0
  962. package/dist/shaders/SobelOperatorShader.d.ts +19 -0
  963. package/dist/shaders/SobelOperatorShader.js +54 -0
  964. package/dist/shaders/SobelOperatorShader.mjs +54 -0
  965. package/dist/shaders/SubsurfaceScatteringShader.d.ts +5 -0
  966. package/dist/shaders/SubsurfaceScatteringShader.js +59 -0
  967. package/dist/shaders/SubsurfaceScatteringShader.mjs +59 -0
  968. package/dist/shaders/TechnicolorShader.d.ts +15 -0
  969. package/dist/shaders/TechnicolorShader.js +24 -0
  970. package/dist/shaders/TechnicolorShader.mjs +24 -0
  971. package/dist/shaders/ToneMapShader.d.ts +27 -0
  972. package/dist/shaders/ToneMapShader.js +51 -0
  973. package/dist/shaders/ToneMapShader.mjs +51 -0
  974. package/dist/shaders/ToonShader.d.ts +108 -0
  975. package/dist/shaders/ToonShader.js +188 -0
  976. package/dist/shaders/ToonShader.mjs +188 -0
  977. package/dist/shaders/TriangleBlurShader.d.ts +22 -0
  978. package/dist/shaders/TriangleBlurShader.js +37 -0
  979. package/dist/shaders/TriangleBlurShader.mjs +37 -0
  980. package/dist/shaders/UnpackDepthRGBAShader.d.ts +16 -0
  981. package/dist/shaders/UnpackDepthRGBAShader.js +26 -0
  982. package/dist/shaders/UnpackDepthRGBAShader.mjs +26 -0
  983. package/dist/shaders/VerticalBlurShader.d.ts +18 -0
  984. package/dist/shaders/VerticalBlurShader.js +50 -0
  985. package/dist/shaders/VerticalBlurShader.mjs +50 -0
  986. package/dist/shaders/VerticalTiltShiftShader.d.ts +23 -0
  987. package/dist/shaders/VerticalTiltShiftShader.js +37 -0
  988. package/dist/shaders/VerticalTiltShiftShader.mjs +37 -0
  989. package/dist/shaders/VignetteShader.d.ts +20 -0
  990. package/dist/shaders/VignetteShader.js +38 -0
  991. package/dist/shaders/VignetteShader.mjs +38 -0
  992. package/dist/shaders/VolumeShader.d.ts +30 -0
  993. package/dist/shaders/VolumeShader.js +225 -0
  994. package/dist/shaders/VolumeShader.mjs +225 -0
  995. package/dist/shaders/WaterRefractionShader.d.ts +21 -0
  996. package/dist/shaders/WaterRefractionShader.js +59 -0
  997. package/dist/shaders/WaterRefractionShader.mjs +59 -0
  998. package/dist/shaders/types.d.ts +14 -0
  999. package/dist/shaders/types.js +1 -0
  1000. package/dist/shaders/types.mjs +1 -0
  1001. package/dist/textures/FlakesTexture.d.ts +4 -0
  1002. package/dist/textures/FlakesTexture.js +30 -0
  1003. package/dist/textures/FlakesTexture.mjs +30 -0
  1004. package/dist/types/helpers.d.ts +1 -0
  1005. package/dist/types/helpers.js +4 -0
  1006. package/dist/types/helpers.mjs +4 -0
  1007. package/dist/types/shared.d.ts +2 -0
  1008. package/dist/types/utils.d.ts +3 -0
  1009. package/dist/utils/BufferGeometryUtils.d.ts +48 -0
  1010. package/dist/utils/BufferGeometryUtils.js +636 -0
  1011. package/dist/utils/BufferGeometryUtils.mjs +636 -0
  1012. package/dist/utils/GeometryCompressionUtils.d.ts +7 -0
  1013. package/dist/utils/GeometryCompressionUtils.js +573 -0
  1014. package/dist/utils/GeometryCompressionUtils.mjs +573 -0
  1015. package/dist/utils/GeometryUtils.d.ts +6 -0
  1016. package/dist/utils/GeometryUtils.js +109 -0
  1017. package/dist/utils/GeometryUtils.mjs +109 -0
  1018. package/dist/utils/LDrawUtils.d.ts +5 -0
  1019. package/dist/utils/RoughnessMipmapper.js +219 -0
  1020. package/dist/utils/RoughnessMipmapper.mjs +219 -0
  1021. package/dist/utils/SceneUtils.d.ts +9 -0
  1022. package/dist/utils/SceneUtils.js +36 -0
  1023. package/dist/utils/SceneUtils.mjs +36 -0
  1024. package/dist/utils/ShadowMapViewer.d.ts +24 -0
  1025. package/dist/utils/ShadowMapViewer.js +114 -0
  1026. package/dist/utils/ShadowMapViewer.mjs +114 -0
  1027. package/dist/utils/SkeletonUtils.d.ts +30 -0
  1028. package/dist/utils/SkeletonUtils.js +292 -0
  1029. package/dist/utils/SkeletonUtils.mjs +292 -0
  1030. package/dist/utils/UVsDebug.d.ts +3 -0
  1031. package/dist/utils/UVsDebug.js +85 -0
  1032. package/dist/utils/UVsDebug.mjs +85 -0
  1033. package/dist/utils/WorkerPool.js +62 -0
  1034. package/dist/utils/WorkerPool.mjs +62 -0
  1035. package/dist/webxr/ARButton.d.ts +5 -0
  1036. package/dist/webxr/ARButton.js +119 -0
  1037. package/dist/webxr/ARButton.mjs +119 -0
  1038. package/dist/webxr/OculusHandModel.d.ts +22 -0
  1039. package/dist/webxr/OculusHandModel.js +82 -0
  1040. package/dist/webxr/OculusHandModel.mjs +82 -0
  1041. package/dist/webxr/OculusHandPointerModel.d.ts +63 -0
  1042. package/dist/webxr/OculusHandPointerModel.js +224 -0
  1043. package/dist/webxr/OculusHandPointerModel.mjs +207 -0
  1044. package/dist/webxr/Text2D.d.ts +3 -0
  1045. package/dist/webxr/Text2D.js +48 -0
  1046. package/dist/webxr/Text2D.mjs +31 -0
  1047. package/dist/webxr/VRButton.d.ts +7 -0
  1048. package/dist/webxr/VRButton.js +111 -0
  1049. package/dist/webxr/VRButton.mjs +111 -0
  1050. package/dist/webxr/XRControllerModelFactory.d.ts +23 -0
  1051. package/dist/webxr/XRControllerModelFactory.js +174 -0
  1052. package/dist/webxr/XRControllerModelFactory.mjs +174 -0
  1053. package/dist/webxr/XREstimatedLight.d.ts +33 -0
  1054. package/dist/webxr/XREstimatedLight.js +126 -0
  1055. package/dist/webxr/XREstimatedLight.mjs +126 -0
  1056. package/dist/webxr/XRHandMeshModel.d.ts +9 -0
  1057. package/dist/webxr/XRHandMeshModel.js +82 -0
  1058. package/dist/webxr/XRHandMeshModel.mjs +82 -0
  1059. package/dist/webxr/XRHandModelFactory.d.ts +25 -0
  1060. package/dist/webxr/XRHandModelFactory.js +61 -0
  1061. package/dist/webxr/XRHandModelFactory.mjs +61 -0
  1062. package/dist/webxr/XRHandPrimitiveModel.d.ts +24 -0
  1063. package/dist/webxr/XRHandPrimitiveModel.js +68 -0
  1064. package/dist/webxr/XRHandPrimitiveModel.mjs +68 -0
  1065. package/package.json +1 -1
@@ -0,0 +1,2105 @@
1
+ import { Loader, LoaderUtils, FileLoader, Scene, Object3D, Group, Vector3, SphereGeometry, MeshBasicMaterial, BackSide, Mesh, PointsMaterial, Points, LineBasicMaterial, LineSegments, FrontSide, DoubleSide, MeshPhongMaterial, Color, RepeatWrapping, ClampToEdgeWrapping, DataTexture, Vector2, BufferGeometry, Float32BufferAttribute, BoxGeometry, ConeGeometry, CylinderGeometry, Quaternion, ShapeUtils, BufferAttribute, TextureLoader } from "three";
2
+ import { createToken, Lexer, CstParser } from "chevrotain";
3
+ class VRMLLoader extends Loader {
4
+ constructor(manager) {
5
+ super(manager);
6
+ }
7
+ load(url, onLoad, onProgress, onError) {
8
+ const scope = this;
9
+ const path = scope.path === "" ? LoaderUtils.extractUrlBase(url) : scope.path;
10
+ const loader = new FileLoader(scope.manager);
11
+ loader.setPath(scope.path);
12
+ loader.setRequestHeader(scope.requestHeader);
13
+ loader.setWithCredentials(scope.withCredentials);
14
+ loader.load(
15
+ url,
16
+ function(text) {
17
+ try {
18
+ onLoad(scope.parse(text, path));
19
+ } catch (e) {
20
+ if (onError) {
21
+ onError(e);
22
+ } else {
23
+ console.error(e);
24
+ }
25
+ scope.manager.itemError(url);
26
+ }
27
+ },
28
+ onProgress,
29
+ onError
30
+ );
31
+ }
32
+ parse(data, path) {
33
+ const nodeMap = {};
34
+ function generateVRMLTree(data2) {
35
+ const tokenData = createTokens();
36
+ const lexer = new VRMLLexer(tokenData.tokens);
37
+ const parser = new VRMLParser(tokenData.tokenVocabulary);
38
+ const visitor = createVisitor(parser.getBaseCstVisitorConstructor());
39
+ const lexingResult = lexer.lex(data2);
40
+ parser.input = lexingResult.tokens;
41
+ const cstOutput = parser.vrml();
42
+ if (parser.errors.length > 0) {
43
+ console.error(parser.errors);
44
+ throw Error("THREE.VRMLLoader: Parsing errors detected.");
45
+ }
46
+ const ast = visitor.visit(cstOutput);
47
+ return ast;
48
+ }
49
+ function createTokens() {
50
+ const RouteIdentifier = createToken({
51
+ name: "RouteIdentifier",
52
+ pattern: /[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/
53
+ });
54
+ const Identifier = createToken({
55
+ name: "Identifier",
56
+ pattern: /[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/,
57
+ longer_alt: RouteIdentifier
58
+ });
59
+ const nodeTypes = [
60
+ "Anchor",
61
+ "Billboard",
62
+ "Collision",
63
+ "Group",
64
+ "Transform",
65
+ // grouping nodes
66
+ "Inline",
67
+ "LOD",
68
+ "Switch",
69
+ // special groups
70
+ "AudioClip",
71
+ "DirectionalLight",
72
+ "PointLight",
73
+ "Script",
74
+ "Shape",
75
+ "Sound",
76
+ "SpotLight",
77
+ "WorldInfo",
78
+ // common nodes
79
+ "CylinderSensor",
80
+ "PlaneSensor",
81
+ "ProximitySensor",
82
+ "SphereSensor",
83
+ "TimeSensor",
84
+ "TouchSensor",
85
+ "VisibilitySensor",
86
+ // sensors
87
+ "Box",
88
+ "Cone",
89
+ "Cylinder",
90
+ "ElevationGrid",
91
+ "Extrusion",
92
+ "IndexedFaceSet",
93
+ "IndexedLineSet",
94
+ "PointSet",
95
+ "Sphere",
96
+ // geometries
97
+ "Color",
98
+ "Coordinate",
99
+ "Normal",
100
+ "TextureCoordinate",
101
+ // geometric properties
102
+ "Appearance",
103
+ "FontStyle",
104
+ "ImageTexture",
105
+ "Material",
106
+ "MovieTexture",
107
+ "PixelTexture",
108
+ "TextureTransform",
109
+ // appearance
110
+ "ColorInterpolator",
111
+ "CoordinateInterpolator",
112
+ "NormalInterpolator",
113
+ "OrientationInterpolator",
114
+ "PositionInterpolator",
115
+ "ScalarInterpolator",
116
+ // interpolators
117
+ "Background",
118
+ "Fog",
119
+ "NavigationInfo",
120
+ "Viewpoint",
121
+ // bindable nodes
122
+ "Text"
123
+ // Text must be placed at the end of the regex so there are no matches for TextureTransform and TextureCoordinate
124
+ ];
125
+ const Version = createToken({
126
+ name: "Version",
127
+ pattern: /#VRML.*/,
128
+ longer_alt: Identifier
129
+ });
130
+ const NodeName = createToken({
131
+ name: "NodeName",
132
+ pattern: new RegExp(nodeTypes.join("|")),
133
+ longer_alt: Identifier
134
+ });
135
+ const DEF = createToken({
136
+ name: "DEF",
137
+ pattern: /DEF/,
138
+ longer_alt: Identifier
139
+ });
140
+ const USE = createToken({
141
+ name: "USE",
142
+ pattern: /USE/,
143
+ longer_alt: Identifier
144
+ });
145
+ const ROUTE = createToken({
146
+ name: "ROUTE",
147
+ pattern: /ROUTE/,
148
+ longer_alt: Identifier
149
+ });
150
+ const TO = createToken({
151
+ name: "TO",
152
+ pattern: /TO/,
153
+ longer_alt: Identifier
154
+ });
155
+ const StringLiteral = createToken({
156
+ name: "StringLiteral",
157
+ pattern: /"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/
158
+ });
159
+ const HexLiteral = createToken({ name: "HexLiteral", pattern: /0[xX][0-9a-fA-F]+/ });
160
+ const NumberLiteral = createToken({ name: "NumberLiteral", pattern: /[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/ });
161
+ const TrueLiteral = createToken({ name: "TrueLiteral", pattern: /TRUE/ });
162
+ const FalseLiteral = createToken({ name: "FalseLiteral", pattern: /FALSE/ });
163
+ const NullLiteral = createToken({ name: "NullLiteral", pattern: /NULL/ });
164
+ const LSquare = createToken({ name: "LSquare", pattern: /\[/ });
165
+ const RSquare = createToken({ name: "RSquare", pattern: /]/ });
166
+ const LCurly = createToken({ name: "LCurly", pattern: /{/ });
167
+ const RCurly = createToken({ name: "RCurly", pattern: /}/ });
168
+ const Comment = createToken({
169
+ name: "Comment",
170
+ pattern: /#.*/,
171
+ group: Lexer.SKIPPED
172
+ });
173
+ const WhiteSpace = createToken({
174
+ name: "WhiteSpace",
175
+ pattern: /[ ,\s]/,
176
+ group: Lexer.SKIPPED
177
+ });
178
+ const tokens = [
179
+ WhiteSpace,
180
+ // keywords appear before the Identifier
181
+ NodeName,
182
+ DEF,
183
+ USE,
184
+ ROUTE,
185
+ TO,
186
+ TrueLiteral,
187
+ FalseLiteral,
188
+ NullLiteral,
189
+ // the Identifier must appear after the keywords because all keywords are valid identifiers
190
+ Version,
191
+ Identifier,
192
+ RouteIdentifier,
193
+ StringLiteral,
194
+ HexLiteral,
195
+ NumberLiteral,
196
+ LSquare,
197
+ RSquare,
198
+ LCurly,
199
+ RCurly,
200
+ Comment
201
+ ];
202
+ const tokenVocabulary = {};
203
+ for (let i = 0, l = tokens.length; i < l; i++) {
204
+ const token = tokens[i];
205
+ tokenVocabulary[token.name] = token;
206
+ }
207
+ return { tokens, tokenVocabulary };
208
+ }
209
+ function createVisitor(BaseVRMLVisitor) {
210
+ function VRMLToASTVisitor() {
211
+ BaseVRMLVisitor.call(this);
212
+ this.validateVisitor();
213
+ }
214
+ VRMLToASTVisitor.prototype = Object.assign(Object.create(BaseVRMLVisitor.prototype), {
215
+ constructor: VRMLToASTVisitor,
216
+ vrml: function(ctx) {
217
+ const data2 = {
218
+ version: this.visit(ctx.version),
219
+ nodes: [],
220
+ routes: []
221
+ };
222
+ for (let i = 0, l = ctx.node.length; i < l; i++) {
223
+ const node = ctx.node[i];
224
+ data2.nodes.push(this.visit(node));
225
+ }
226
+ if (ctx.route) {
227
+ for (let i = 0, l = ctx.route.length; i < l; i++) {
228
+ const route = ctx.route[i];
229
+ data2.routes.push(this.visit(route));
230
+ }
231
+ }
232
+ return data2;
233
+ },
234
+ version: function(ctx) {
235
+ return ctx.Version[0].image;
236
+ },
237
+ node: function(ctx) {
238
+ const data2 = {
239
+ name: ctx.NodeName[0].image,
240
+ fields: []
241
+ };
242
+ if (ctx.field) {
243
+ for (let i = 0, l = ctx.field.length; i < l; i++) {
244
+ const field = ctx.field[i];
245
+ data2.fields.push(this.visit(field));
246
+ }
247
+ }
248
+ if (ctx.def) {
249
+ data2.DEF = this.visit(ctx.def[0]);
250
+ }
251
+ return data2;
252
+ },
253
+ field: function(ctx) {
254
+ const data2 = {
255
+ name: ctx.Identifier[0].image,
256
+ type: null,
257
+ values: null
258
+ };
259
+ let result;
260
+ if (ctx.singleFieldValue) {
261
+ result = this.visit(ctx.singleFieldValue[0]);
262
+ }
263
+ if (ctx.multiFieldValue) {
264
+ result = this.visit(ctx.multiFieldValue[0]);
265
+ }
266
+ data2.type = result.type;
267
+ data2.values = result.values;
268
+ return data2;
269
+ },
270
+ def: function(ctx) {
271
+ return (ctx.Identifier || ctx.NodeName)[0].image;
272
+ },
273
+ use: function(ctx) {
274
+ return { USE: (ctx.Identifier || ctx.NodeName)[0].image };
275
+ },
276
+ singleFieldValue: function(ctx) {
277
+ return processField(this, ctx);
278
+ },
279
+ multiFieldValue: function(ctx) {
280
+ return processField(this, ctx);
281
+ },
282
+ route: function(ctx) {
283
+ const data2 = {
284
+ FROM: ctx.RouteIdentifier[0].image,
285
+ TO: ctx.RouteIdentifier[1].image
286
+ };
287
+ return data2;
288
+ }
289
+ });
290
+ function processField(scope, ctx) {
291
+ const field = {
292
+ type: null,
293
+ values: []
294
+ };
295
+ if (ctx.node) {
296
+ field.type = "node";
297
+ for (let i = 0, l = ctx.node.length; i < l; i++) {
298
+ const node = ctx.node[i];
299
+ field.values.push(scope.visit(node));
300
+ }
301
+ }
302
+ if (ctx.use) {
303
+ field.type = "use";
304
+ for (let i = 0, l = ctx.use.length; i < l; i++) {
305
+ const use = ctx.use[i];
306
+ field.values.push(scope.visit(use));
307
+ }
308
+ }
309
+ if (ctx.StringLiteral) {
310
+ field.type = "string";
311
+ for (let i = 0, l = ctx.StringLiteral.length; i < l; i++) {
312
+ const stringLiteral = ctx.StringLiteral[i];
313
+ field.values.push(stringLiteral.image.replace(/'|"/g, ""));
314
+ }
315
+ }
316
+ if (ctx.NumberLiteral) {
317
+ field.type = "number";
318
+ for (let i = 0, l = ctx.NumberLiteral.length; i < l; i++) {
319
+ const numberLiteral = ctx.NumberLiteral[i];
320
+ field.values.push(parseFloat(numberLiteral.image));
321
+ }
322
+ }
323
+ if (ctx.HexLiteral) {
324
+ field.type = "hex";
325
+ for (let i = 0, l = ctx.HexLiteral.length; i < l; i++) {
326
+ const hexLiteral = ctx.HexLiteral[i];
327
+ field.values.push(hexLiteral.image);
328
+ }
329
+ }
330
+ if (ctx.TrueLiteral) {
331
+ field.type = "boolean";
332
+ for (let i = 0, l = ctx.TrueLiteral.length; i < l; i++) {
333
+ const trueLiteral = ctx.TrueLiteral[i];
334
+ if (trueLiteral.image === "TRUE")
335
+ field.values.push(true);
336
+ }
337
+ }
338
+ if (ctx.FalseLiteral) {
339
+ field.type = "boolean";
340
+ for (let i = 0, l = ctx.FalseLiteral.length; i < l; i++) {
341
+ const falseLiteral = ctx.FalseLiteral[i];
342
+ if (falseLiteral.image === "FALSE")
343
+ field.values.push(false);
344
+ }
345
+ }
346
+ if (ctx.NullLiteral) {
347
+ field.type = "null";
348
+ ctx.NullLiteral.forEach(function() {
349
+ field.values.push(null);
350
+ });
351
+ }
352
+ return field;
353
+ }
354
+ return new VRMLToASTVisitor();
355
+ }
356
+ function parseTree(tree2) {
357
+ const nodes = tree2.nodes;
358
+ const scene2 = new Scene();
359
+ for (let i = 0, l = nodes.length; i < l; i++) {
360
+ const node = nodes[i];
361
+ buildNodeMap(node);
362
+ }
363
+ for (let i = 0, l = nodes.length; i < l; i++) {
364
+ const node = nodes[i];
365
+ const object = getNode(node);
366
+ if (object instanceof Object3D)
367
+ scene2.add(object);
368
+ if (node.name === "WorldInfo")
369
+ scene2.userData.worldInfo = object;
370
+ }
371
+ return scene2;
372
+ }
373
+ function buildNodeMap(node) {
374
+ if (node.DEF) {
375
+ nodeMap[node.DEF] = node;
376
+ }
377
+ const fields = node.fields;
378
+ for (let i = 0, l = fields.length; i < l; i++) {
379
+ const field = fields[i];
380
+ if (field.type === "node") {
381
+ const fieldValues = field.values;
382
+ for (let j = 0, jl = fieldValues.length; j < jl; j++) {
383
+ buildNodeMap(fieldValues[j]);
384
+ }
385
+ }
386
+ }
387
+ }
388
+ function getNode(node) {
389
+ if (node.USE) {
390
+ return resolveUSE(node.USE);
391
+ }
392
+ if (node.build !== void 0)
393
+ return node.build;
394
+ node.build = buildNode(node);
395
+ return node.build;
396
+ }
397
+ function buildNode(node) {
398
+ const nodeName = node.name;
399
+ let build;
400
+ switch (nodeName) {
401
+ case "Group":
402
+ case "Transform":
403
+ case "Collision":
404
+ build = buildGroupingNode(node);
405
+ break;
406
+ case "Background":
407
+ build = buildBackgroundNode(node);
408
+ break;
409
+ case "Shape":
410
+ build = buildShapeNode(node);
411
+ break;
412
+ case "Appearance":
413
+ build = buildAppearanceNode(node);
414
+ break;
415
+ case "Material":
416
+ build = buildMaterialNode(node);
417
+ break;
418
+ case "ImageTexture":
419
+ build = buildImageTextureNode(node);
420
+ break;
421
+ case "PixelTexture":
422
+ build = buildPixelTextureNode(node);
423
+ break;
424
+ case "TextureTransform":
425
+ build = buildTextureTransformNode(node);
426
+ break;
427
+ case "IndexedFaceSet":
428
+ build = buildIndexedFaceSetNode(node);
429
+ break;
430
+ case "IndexedLineSet":
431
+ build = buildIndexedLineSetNode(node);
432
+ break;
433
+ case "PointSet":
434
+ build = buildPointSetNode(node);
435
+ break;
436
+ case "Box":
437
+ build = buildBoxNode(node);
438
+ break;
439
+ case "Cone":
440
+ build = buildConeNode(node);
441
+ break;
442
+ case "Cylinder":
443
+ build = buildCylinderNode(node);
444
+ break;
445
+ case "Sphere":
446
+ build = buildSphereNode(node);
447
+ break;
448
+ case "ElevationGrid":
449
+ build = buildElevationGridNode(node);
450
+ break;
451
+ case "Extrusion":
452
+ build = buildExtrusionNode(node);
453
+ break;
454
+ case "Color":
455
+ case "Coordinate":
456
+ case "Normal":
457
+ case "TextureCoordinate":
458
+ build = buildGeometricNode(node);
459
+ break;
460
+ case "WorldInfo":
461
+ build = buildWorldInfoNode(node);
462
+ break;
463
+ case "Anchor":
464
+ case "Billboard":
465
+ case "Inline":
466
+ case "LOD":
467
+ case "Switch":
468
+ case "AudioClip":
469
+ case "DirectionalLight":
470
+ case "PointLight":
471
+ case "Script":
472
+ case "Sound":
473
+ case "SpotLight":
474
+ case "CylinderSensor":
475
+ case "PlaneSensor":
476
+ case "ProximitySensor":
477
+ case "SphereSensor":
478
+ case "TimeSensor":
479
+ case "TouchSensor":
480
+ case "VisibilitySensor":
481
+ case "Text":
482
+ case "FontStyle":
483
+ case "MovieTexture":
484
+ case "ColorInterpolator":
485
+ case "CoordinateInterpolator":
486
+ case "NormalInterpolator":
487
+ case "OrientationInterpolator":
488
+ case "PositionInterpolator":
489
+ case "ScalarInterpolator":
490
+ case "Fog":
491
+ case "NavigationInfo":
492
+ case "Viewpoint":
493
+ break;
494
+ default:
495
+ console.warn("THREE.VRMLLoader: Unknown node:", nodeName);
496
+ break;
497
+ }
498
+ if (build !== void 0 && node.DEF !== void 0 && build.hasOwnProperty("name") === true) {
499
+ build.name = node.DEF;
500
+ }
501
+ return build;
502
+ }
503
+ function buildGroupingNode(node) {
504
+ const object = new Group();
505
+ const fields = node.fields;
506
+ for (let i = 0, l = fields.length; i < l; i++) {
507
+ const field = fields[i];
508
+ const fieldName = field.name;
509
+ const fieldValues = field.values;
510
+ switch (fieldName) {
511
+ case "bboxCenter":
512
+ break;
513
+ case "bboxSize":
514
+ break;
515
+ case "center":
516
+ break;
517
+ case "children":
518
+ parseFieldChildren(fieldValues, object);
519
+ break;
520
+ case "collide":
521
+ break;
522
+ case "rotation":
523
+ const axis = new Vector3(fieldValues[0], fieldValues[1], fieldValues[2]);
524
+ const angle = fieldValues[3];
525
+ object.quaternion.setFromAxisAngle(axis, angle);
526
+ break;
527
+ case "scale":
528
+ object.scale.set(fieldValues[0], fieldValues[1], fieldValues[2]);
529
+ break;
530
+ case "scaleOrientation":
531
+ break;
532
+ case "translation":
533
+ object.position.set(fieldValues[0], fieldValues[1], fieldValues[2]);
534
+ break;
535
+ case "proxy":
536
+ break;
537
+ default:
538
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
539
+ break;
540
+ }
541
+ }
542
+ return object;
543
+ }
544
+ function buildBackgroundNode(node) {
545
+ const group = new Group();
546
+ let groundAngle, groundColor;
547
+ let skyAngle, skyColor;
548
+ const fields = node.fields;
549
+ for (let i = 0, l = fields.length; i < l; i++) {
550
+ const field = fields[i];
551
+ const fieldName = field.name;
552
+ const fieldValues = field.values;
553
+ switch (fieldName) {
554
+ case "groundAngle":
555
+ groundAngle = fieldValues;
556
+ break;
557
+ case "groundColor":
558
+ groundColor = fieldValues;
559
+ break;
560
+ case "backUrl":
561
+ break;
562
+ case "bottomUrl":
563
+ break;
564
+ case "frontUrl":
565
+ break;
566
+ case "leftUrl":
567
+ break;
568
+ case "rightUrl":
569
+ break;
570
+ case "topUrl":
571
+ break;
572
+ case "skyAngle":
573
+ skyAngle = fieldValues;
574
+ break;
575
+ case "skyColor":
576
+ skyColor = fieldValues;
577
+ break;
578
+ default:
579
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
580
+ break;
581
+ }
582
+ }
583
+ const radius = 1e4;
584
+ if (skyColor) {
585
+ const skyGeometry = new SphereGeometry(radius, 32, 16);
586
+ const skyMaterial = new MeshBasicMaterial({ fog: false, side: BackSide, depthWrite: false, depthTest: false });
587
+ if (skyColor.length > 3) {
588
+ paintFaces(skyGeometry, radius, skyAngle, toColorArray(skyColor), true);
589
+ skyMaterial.vertexColors = true;
590
+ } else {
591
+ skyMaterial.color.setRGB(skyColor[0], skyColor[1], skyColor[2]);
592
+ }
593
+ const sky = new Mesh(skyGeometry, skyMaterial);
594
+ group.add(sky);
595
+ }
596
+ if (groundColor) {
597
+ if (groundColor.length > 0) {
598
+ const groundGeometry = new SphereGeometry(radius, 32, 16, 0, 2 * Math.PI, 0.5 * Math.PI, 1.5 * Math.PI);
599
+ const groundMaterial = new MeshBasicMaterial({
600
+ fog: false,
601
+ side: BackSide,
602
+ vertexColors: true,
603
+ depthWrite: false,
604
+ depthTest: false
605
+ });
606
+ paintFaces(groundGeometry, radius, groundAngle, toColorArray(groundColor), false);
607
+ const ground = new Mesh(groundGeometry, groundMaterial);
608
+ group.add(ground);
609
+ }
610
+ }
611
+ group.renderOrder = -Infinity;
612
+ return group;
613
+ }
614
+ function buildShapeNode(node) {
615
+ const fields = node.fields;
616
+ let material = new MeshBasicMaterial({ color: 0 });
617
+ let geometry;
618
+ for (let i = 0, l = fields.length; i < l; i++) {
619
+ const field = fields[i];
620
+ const fieldName = field.name;
621
+ const fieldValues = field.values;
622
+ switch (fieldName) {
623
+ case "appearance":
624
+ if (fieldValues[0] !== null) {
625
+ material = getNode(fieldValues[0]);
626
+ }
627
+ break;
628
+ case "geometry":
629
+ if (fieldValues[0] !== null) {
630
+ geometry = getNode(fieldValues[0]);
631
+ }
632
+ break;
633
+ default:
634
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
635
+ break;
636
+ }
637
+ }
638
+ let object;
639
+ if (geometry && geometry.attributes.position) {
640
+ const type = geometry._type;
641
+ if (type === "points") {
642
+ const pointsMaterial = new PointsMaterial({ color: 16777215 });
643
+ if (geometry.attributes.color !== void 0) {
644
+ pointsMaterial.vertexColors = true;
645
+ } else {
646
+ if (material.isMeshPhongMaterial) {
647
+ pointsMaterial.color.copy(material.emissive);
648
+ }
649
+ }
650
+ object = new Points(geometry, pointsMaterial);
651
+ } else if (type === "line") {
652
+ const lineMaterial = new LineBasicMaterial({ color: 16777215 });
653
+ if (geometry.attributes.color !== void 0) {
654
+ lineMaterial.vertexColors = true;
655
+ } else {
656
+ if (material.isMeshPhongMaterial) {
657
+ lineMaterial.color.copy(material.emissive);
658
+ }
659
+ }
660
+ object = new LineSegments(geometry, lineMaterial);
661
+ } else {
662
+ if (geometry._solid !== void 0) {
663
+ material.side = geometry._solid ? FrontSide : DoubleSide;
664
+ }
665
+ if (geometry.attributes.color !== void 0) {
666
+ material.vertexColors = true;
667
+ }
668
+ object = new Mesh(geometry, material);
669
+ }
670
+ } else {
671
+ object = new Object3D();
672
+ object.visible = false;
673
+ }
674
+ return object;
675
+ }
676
+ function buildAppearanceNode(node) {
677
+ let material = new MeshPhongMaterial();
678
+ let transformData;
679
+ const fields = node.fields;
680
+ for (let i = 0, l = fields.length; i < l; i++) {
681
+ const field = fields[i];
682
+ const fieldName = field.name;
683
+ const fieldValues = field.values;
684
+ switch (fieldName) {
685
+ case "material":
686
+ if (fieldValues[0] !== null) {
687
+ const materialData = getNode(fieldValues[0]);
688
+ if (materialData.diffuseColor)
689
+ material.color.copy(materialData.diffuseColor);
690
+ if (materialData.emissiveColor)
691
+ material.emissive.copy(materialData.emissiveColor);
692
+ if (materialData.shininess)
693
+ material.shininess = materialData.shininess;
694
+ if (materialData.specularColor)
695
+ material.specular.copy(materialData.specularColor);
696
+ if (materialData.transparency)
697
+ material.opacity = 1 - materialData.transparency;
698
+ if (materialData.transparency > 0)
699
+ material.transparent = true;
700
+ } else {
701
+ material = new MeshBasicMaterial({ color: 0 });
702
+ }
703
+ break;
704
+ case "texture":
705
+ const textureNode = fieldValues[0];
706
+ if (textureNode !== null) {
707
+ if (textureNode.name === "ImageTexture" || textureNode.name === "PixelTexture") {
708
+ material.map = getNode(textureNode);
709
+ } else {
710
+ }
711
+ }
712
+ break;
713
+ case "textureTransform":
714
+ if (fieldValues[0] !== null) {
715
+ transformData = getNode(fieldValues[0]);
716
+ }
717
+ break;
718
+ default:
719
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
720
+ break;
721
+ }
722
+ }
723
+ if (material.map) {
724
+ if (material.map.__type) {
725
+ switch (material.map.__type) {
726
+ case TEXTURE_TYPE.INTENSITY_ALPHA:
727
+ material.opacity = 1;
728
+ break;
729
+ case TEXTURE_TYPE.RGB:
730
+ material.color.set(16777215);
731
+ break;
732
+ case TEXTURE_TYPE.RGBA:
733
+ material.color.set(16777215);
734
+ material.opacity = 1;
735
+ break;
736
+ default:
737
+ }
738
+ delete material.map.__type;
739
+ }
740
+ if (transformData) {
741
+ material.map.center.copy(transformData.center);
742
+ material.map.rotation = transformData.rotation;
743
+ material.map.repeat.copy(transformData.scale);
744
+ material.map.offset.copy(transformData.translation);
745
+ }
746
+ }
747
+ return material;
748
+ }
749
+ function buildMaterialNode(node) {
750
+ const materialData = {};
751
+ const fields = node.fields;
752
+ for (let i = 0, l = fields.length; i < l; i++) {
753
+ const field = fields[i];
754
+ const fieldName = field.name;
755
+ const fieldValues = field.values;
756
+ switch (fieldName) {
757
+ case "ambientIntensity":
758
+ break;
759
+ case "diffuseColor":
760
+ materialData.diffuseColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
761
+ break;
762
+ case "emissiveColor":
763
+ materialData.emissiveColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
764
+ break;
765
+ case "shininess":
766
+ materialData.shininess = fieldValues[0];
767
+ break;
768
+ case "specularColor":
769
+ materialData.emissiveColor = new Color(fieldValues[0], fieldValues[1], fieldValues[2]);
770
+ break;
771
+ case "transparency":
772
+ materialData.transparency = fieldValues[0];
773
+ break;
774
+ default:
775
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
776
+ break;
777
+ }
778
+ }
779
+ return materialData;
780
+ }
781
+ function parseHexColor(hex, textureType, color) {
782
+ let value;
783
+ switch (textureType) {
784
+ case TEXTURE_TYPE.INTENSITY:
785
+ value = parseInt(hex);
786
+ color.r = value;
787
+ color.g = value;
788
+ color.b = value;
789
+ color.a = 1;
790
+ break;
791
+ case TEXTURE_TYPE.INTENSITY_ALPHA:
792
+ value = parseInt("0x" + hex.substring(2, 4));
793
+ color.r = value;
794
+ color.g = value;
795
+ color.b = value;
796
+ color.a = parseInt("0x" + hex.substring(4, 6));
797
+ break;
798
+ case TEXTURE_TYPE.RGB:
799
+ color.r = parseInt("0x" + hex.substring(2, 4));
800
+ color.g = parseInt("0x" + hex.substring(4, 6));
801
+ color.b = parseInt("0x" + hex.substring(6, 8));
802
+ color.a = 1;
803
+ break;
804
+ case TEXTURE_TYPE.RGBA:
805
+ color.r = parseInt("0x" + hex.substring(2, 4));
806
+ color.g = parseInt("0x" + hex.substring(4, 6));
807
+ color.b = parseInt("0x" + hex.substring(6, 8));
808
+ color.a = parseInt("0x" + hex.substring(8, 10));
809
+ break;
810
+ default:
811
+ }
812
+ }
813
+ function getTextureType(num_components) {
814
+ let type;
815
+ switch (num_components) {
816
+ case 1:
817
+ type = TEXTURE_TYPE.INTENSITY;
818
+ break;
819
+ case 2:
820
+ type = TEXTURE_TYPE.INTENSITY_ALPHA;
821
+ break;
822
+ case 3:
823
+ type = TEXTURE_TYPE.RGB;
824
+ break;
825
+ case 4:
826
+ type = TEXTURE_TYPE.RGBA;
827
+ break;
828
+ default:
829
+ }
830
+ return type;
831
+ }
832
+ function buildPixelTextureNode(node) {
833
+ let texture;
834
+ let wrapS = RepeatWrapping;
835
+ let wrapT = RepeatWrapping;
836
+ const fields = node.fields;
837
+ for (let i = 0, l = fields.length; i < l; i++) {
838
+ const field = fields[i];
839
+ const fieldName = field.name;
840
+ const fieldValues = field.values;
841
+ switch (fieldName) {
842
+ case "image":
843
+ const width = fieldValues[0];
844
+ const height = fieldValues[1];
845
+ const num_components = fieldValues[2];
846
+ const textureType = getTextureType(num_components);
847
+ const data2 = new Uint8Array(4 * width * height);
848
+ const color = { r: 0, g: 0, b: 0, a: 0 };
849
+ for (let j = 3, k = 0, jl = fieldValues.length; j < jl; j++, k++) {
850
+ parseHexColor(fieldValues[j], textureType, color);
851
+ const stride = k * 4;
852
+ data2[stride + 0] = color.r;
853
+ data2[stride + 1] = color.g;
854
+ data2[stride + 2] = color.b;
855
+ data2[stride + 3] = color.a;
856
+ }
857
+ texture = new DataTexture(data2, width, height);
858
+ texture.needsUpdate = true;
859
+ texture.__type = textureType;
860
+ break;
861
+ case "repeatS":
862
+ if (fieldValues[0] === false)
863
+ wrapS = ClampToEdgeWrapping;
864
+ break;
865
+ case "repeatT":
866
+ if (fieldValues[0] === false)
867
+ wrapT = ClampToEdgeWrapping;
868
+ break;
869
+ default:
870
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
871
+ break;
872
+ }
873
+ }
874
+ if (texture) {
875
+ texture.wrapS = wrapS;
876
+ texture.wrapT = wrapT;
877
+ }
878
+ return texture;
879
+ }
880
+ function buildImageTextureNode(node) {
881
+ let texture;
882
+ let wrapS = RepeatWrapping;
883
+ let wrapT = RepeatWrapping;
884
+ const fields = node.fields;
885
+ for (let i = 0, l = fields.length; i < l; i++) {
886
+ const field = fields[i];
887
+ const fieldName = field.name;
888
+ const fieldValues = field.values;
889
+ switch (fieldName) {
890
+ case "url":
891
+ const url = fieldValues[0];
892
+ if (url)
893
+ texture = textureLoader.load(url);
894
+ break;
895
+ case "repeatS":
896
+ if (fieldValues[0] === false)
897
+ wrapS = ClampToEdgeWrapping;
898
+ break;
899
+ case "repeatT":
900
+ if (fieldValues[0] === false)
901
+ wrapT = ClampToEdgeWrapping;
902
+ break;
903
+ default:
904
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
905
+ break;
906
+ }
907
+ }
908
+ if (texture) {
909
+ texture.wrapS = wrapS;
910
+ texture.wrapT = wrapT;
911
+ }
912
+ return texture;
913
+ }
914
+ function buildTextureTransformNode(node) {
915
+ const transformData = {
916
+ center: new Vector2(),
917
+ rotation: new Vector2(),
918
+ scale: new Vector2(),
919
+ translation: new Vector2()
920
+ };
921
+ const fields = node.fields;
922
+ for (let i = 0, l = fields.length; i < l; i++) {
923
+ const field = fields[i];
924
+ const fieldName = field.name;
925
+ const fieldValues = field.values;
926
+ switch (fieldName) {
927
+ case "center":
928
+ transformData.center.set(fieldValues[0], fieldValues[1]);
929
+ break;
930
+ case "rotation":
931
+ transformData.rotation = fieldValues[0];
932
+ break;
933
+ case "scale":
934
+ transformData.scale.set(fieldValues[0], fieldValues[1]);
935
+ break;
936
+ case "translation":
937
+ transformData.translation.set(fieldValues[0], fieldValues[1]);
938
+ break;
939
+ default:
940
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
941
+ break;
942
+ }
943
+ }
944
+ return transformData;
945
+ }
946
+ function buildGeometricNode(node) {
947
+ return node.fields[0].values;
948
+ }
949
+ function buildWorldInfoNode(node) {
950
+ const worldInfo = {};
951
+ const fields = node.fields;
952
+ for (let i = 0, l = fields.length; i < l; i++) {
953
+ const field = fields[i];
954
+ const fieldName = field.name;
955
+ const fieldValues = field.values;
956
+ switch (fieldName) {
957
+ case "title":
958
+ worldInfo.title = fieldValues[0];
959
+ break;
960
+ case "info":
961
+ worldInfo.info = fieldValues;
962
+ break;
963
+ default:
964
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
965
+ break;
966
+ }
967
+ }
968
+ return worldInfo;
969
+ }
970
+ function buildIndexedFaceSetNode(node) {
971
+ let color, coord, normal, texCoord;
972
+ let ccw = true, solid = true, creaseAngle = 0;
973
+ let colorIndex, coordIndex, normalIndex, texCoordIndex;
974
+ let colorPerVertex = true, normalPerVertex = true;
975
+ const fields = node.fields;
976
+ for (let i = 0, l = fields.length; i < l; i++) {
977
+ const field = fields[i];
978
+ const fieldName = field.name;
979
+ const fieldValues = field.values;
980
+ switch (fieldName) {
981
+ case "color":
982
+ const colorNode = fieldValues[0];
983
+ if (colorNode !== null) {
984
+ color = getNode(colorNode);
985
+ }
986
+ break;
987
+ case "coord":
988
+ const coordNode = fieldValues[0];
989
+ if (coordNode !== null) {
990
+ coord = getNode(coordNode);
991
+ }
992
+ break;
993
+ case "normal":
994
+ const normalNode = fieldValues[0];
995
+ if (normalNode !== null) {
996
+ normal = getNode(normalNode);
997
+ }
998
+ break;
999
+ case "texCoord":
1000
+ const texCoordNode = fieldValues[0];
1001
+ if (texCoordNode !== null) {
1002
+ texCoord = getNode(texCoordNode);
1003
+ }
1004
+ break;
1005
+ case "ccw":
1006
+ ccw = fieldValues[0];
1007
+ break;
1008
+ case "colorIndex":
1009
+ colorIndex = fieldValues;
1010
+ break;
1011
+ case "colorPerVertex":
1012
+ colorPerVertex = fieldValues[0];
1013
+ break;
1014
+ case "convex":
1015
+ break;
1016
+ case "coordIndex":
1017
+ coordIndex = fieldValues;
1018
+ break;
1019
+ case "creaseAngle":
1020
+ creaseAngle = fieldValues[0];
1021
+ break;
1022
+ case "normalIndex":
1023
+ normalIndex = fieldValues;
1024
+ break;
1025
+ case "normalPerVertex":
1026
+ normalPerVertex = fieldValues[0];
1027
+ break;
1028
+ case "solid":
1029
+ solid = fieldValues[0];
1030
+ break;
1031
+ case "texCoordIndex":
1032
+ texCoordIndex = fieldValues;
1033
+ break;
1034
+ default:
1035
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1036
+ break;
1037
+ }
1038
+ }
1039
+ if (coordIndex === void 0) {
1040
+ console.warn("THREE.VRMLLoader: Missing coordIndex.");
1041
+ return new BufferGeometry();
1042
+ }
1043
+ const triangulatedCoordIndex = triangulateFaceIndex(coordIndex, ccw);
1044
+ let colorAttribute;
1045
+ let normalAttribute;
1046
+ let uvAttribute;
1047
+ if (color) {
1048
+ if (colorPerVertex === true) {
1049
+ if (colorIndex && colorIndex.length > 0) {
1050
+ const triangulatedColorIndex = triangulateFaceIndex(colorIndex, ccw);
1051
+ colorAttribute = computeAttributeFromIndexedData(triangulatedCoordIndex, triangulatedColorIndex, color, 3);
1052
+ } else {
1053
+ colorAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(color, 3));
1054
+ }
1055
+ } else {
1056
+ if (colorIndex && colorIndex.length > 0) {
1057
+ const flattenFaceColors = flattenData(color, colorIndex);
1058
+ const triangulatedFaceColors = triangulateFaceData(flattenFaceColors, coordIndex);
1059
+ colorAttribute = computeAttributeFromFaceData(triangulatedCoordIndex, triangulatedFaceColors);
1060
+ } else {
1061
+ const triangulatedFaceColors = triangulateFaceData(color, coordIndex);
1062
+ colorAttribute = computeAttributeFromFaceData(triangulatedCoordIndex, triangulatedFaceColors);
1063
+ }
1064
+ }
1065
+ }
1066
+ if (normal) {
1067
+ if (normalPerVertex === true) {
1068
+ if (normalIndex && normalIndex.length > 0) {
1069
+ const triangulatedNormalIndex = triangulateFaceIndex(normalIndex, ccw);
1070
+ normalAttribute = computeAttributeFromIndexedData(
1071
+ triangulatedCoordIndex,
1072
+ triangulatedNormalIndex,
1073
+ normal,
1074
+ 3
1075
+ );
1076
+ } else {
1077
+ normalAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(normal, 3));
1078
+ }
1079
+ } else {
1080
+ if (normalIndex && normalIndex.length > 0) {
1081
+ const flattenFaceNormals = flattenData(normal, normalIndex);
1082
+ const triangulatedFaceNormals = triangulateFaceData(flattenFaceNormals, coordIndex);
1083
+ normalAttribute = computeAttributeFromFaceData(triangulatedCoordIndex, triangulatedFaceNormals);
1084
+ } else {
1085
+ const triangulatedFaceNormals = triangulateFaceData(normal, coordIndex);
1086
+ normalAttribute = computeAttributeFromFaceData(triangulatedCoordIndex, triangulatedFaceNormals);
1087
+ }
1088
+ }
1089
+ } else {
1090
+ normalAttribute = computeNormalAttribute(triangulatedCoordIndex, coord, creaseAngle);
1091
+ }
1092
+ if (texCoord) {
1093
+ if (texCoordIndex && texCoordIndex.length > 0) {
1094
+ const triangulatedTexCoordIndex = triangulateFaceIndex(texCoordIndex, ccw);
1095
+ uvAttribute = computeAttributeFromIndexedData(triangulatedCoordIndex, triangulatedTexCoordIndex, texCoord, 2);
1096
+ } else {
1097
+ uvAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(texCoord, 2));
1098
+ }
1099
+ }
1100
+ const geometry = new BufferGeometry();
1101
+ const positionAttribute = toNonIndexedAttribute(triangulatedCoordIndex, new Float32BufferAttribute(coord, 3));
1102
+ geometry.setAttribute("position", positionAttribute);
1103
+ geometry.setAttribute("normal", normalAttribute);
1104
+ if (colorAttribute)
1105
+ geometry.setAttribute("color", colorAttribute);
1106
+ if (uvAttribute)
1107
+ geometry.setAttribute("uv", uvAttribute);
1108
+ geometry._solid = solid;
1109
+ geometry._type = "mesh";
1110
+ return geometry;
1111
+ }
1112
+ function buildIndexedLineSetNode(node) {
1113
+ let color, coord;
1114
+ let colorIndex, coordIndex;
1115
+ let colorPerVertex = true;
1116
+ const fields = node.fields;
1117
+ for (let i = 0, l = fields.length; i < l; i++) {
1118
+ const field = fields[i];
1119
+ const fieldName = field.name;
1120
+ const fieldValues = field.values;
1121
+ switch (fieldName) {
1122
+ case "color":
1123
+ const colorNode = fieldValues[0];
1124
+ if (colorNode !== null) {
1125
+ color = getNode(colorNode);
1126
+ }
1127
+ break;
1128
+ case "coord":
1129
+ const coordNode = fieldValues[0];
1130
+ if (coordNode !== null) {
1131
+ coord = getNode(coordNode);
1132
+ }
1133
+ break;
1134
+ case "colorIndex":
1135
+ colorIndex = fieldValues;
1136
+ break;
1137
+ case "colorPerVertex":
1138
+ colorPerVertex = fieldValues[0];
1139
+ break;
1140
+ case "coordIndex":
1141
+ coordIndex = fieldValues;
1142
+ break;
1143
+ default:
1144
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1145
+ break;
1146
+ }
1147
+ }
1148
+ let colorAttribute;
1149
+ const expandedLineIndex = expandLineIndex(coordIndex);
1150
+ if (color) {
1151
+ if (colorPerVertex === true) {
1152
+ if (colorIndex.length > 0) {
1153
+ const expandedColorIndex = expandLineIndex(colorIndex);
1154
+ colorAttribute = computeAttributeFromIndexedData(expandedLineIndex, expandedColorIndex, color, 3);
1155
+ } else {
1156
+ colorAttribute = toNonIndexedAttribute(expandedLineIndex, new Float32BufferAttribute(color, 3));
1157
+ }
1158
+ } else {
1159
+ if (colorIndex.length > 0) {
1160
+ const flattenLineColors = flattenData(color, colorIndex);
1161
+ const expandedLineColors = expandLineData(flattenLineColors, coordIndex);
1162
+ colorAttribute = computeAttributeFromLineData(expandedLineIndex, expandedLineColors);
1163
+ } else {
1164
+ const expandedLineColors = expandLineData(color, coordIndex);
1165
+ colorAttribute = computeAttributeFromLineData(expandedLineIndex, expandedLineColors);
1166
+ }
1167
+ }
1168
+ }
1169
+ const geometry = new BufferGeometry();
1170
+ const positionAttribute = toNonIndexedAttribute(expandedLineIndex, new Float32BufferAttribute(coord, 3));
1171
+ geometry.setAttribute("position", positionAttribute);
1172
+ if (colorAttribute)
1173
+ geometry.setAttribute("color", colorAttribute);
1174
+ geometry._type = "line";
1175
+ return geometry;
1176
+ }
1177
+ function buildPointSetNode(node) {
1178
+ let color, coord;
1179
+ const fields = node.fields;
1180
+ for (let i = 0, l = fields.length; i < l; i++) {
1181
+ const field = fields[i];
1182
+ const fieldName = field.name;
1183
+ const fieldValues = field.values;
1184
+ switch (fieldName) {
1185
+ case "color":
1186
+ const colorNode = fieldValues[0];
1187
+ if (colorNode !== null) {
1188
+ color = getNode(colorNode);
1189
+ }
1190
+ break;
1191
+ case "coord":
1192
+ const coordNode = fieldValues[0];
1193
+ if (coordNode !== null) {
1194
+ coord = getNode(coordNode);
1195
+ }
1196
+ break;
1197
+ default:
1198
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1199
+ break;
1200
+ }
1201
+ }
1202
+ const geometry = new BufferGeometry();
1203
+ geometry.setAttribute("position", new Float32BufferAttribute(coord, 3));
1204
+ if (color)
1205
+ geometry.setAttribute("color", new Float32BufferAttribute(color, 3));
1206
+ geometry._type = "points";
1207
+ return geometry;
1208
+ }
1209
+ function buildBoxNode(node) {
1210
+ const size = new Vector3(2, 2, 2);
1211
+ const fields = node.fields;
1212
+ for (let i = 0, l = fields.length; i < l; i++) {
1213
+ const field = fields[i];
1214
+ const fieldName = field.name;
1215
+ const fieldValues = field.values;
1216
+ switch (fieldName) {
1217
+ case "size":
1218
+ size.x = fieldValues[0];
1219
+ size.y = fieldValues[1];
1220
+ size.z = fieldValues[2];
1221
+ break;
1222
+ default:
1223
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1224
+ break;
1225
+ }
1226
+ }
1227
+ const geometry = new BoxGeometry(size.x, size.y, size.z);
1228
+ return geometry;
1229
+ }
1230
+ function buildConeNode(node) {
1231
+ let radius = 1, height = 2, openEnded = false;
1232
+ const fields = node.fields;
1233
+ for (let i = 0, l = fields.length; i < l; i++) {
1234
+ const field = fields[i];
1235
+ const fieldName = field.name;
1236
+ const fieldValues = field.values;
1237
+ switch (fieldName) {
1238
+ case "bottom":
1239
+ openEnded = !fieldValues[0];
1240
+ break;
1241
+ case "bottomRadius":
1242
+ radius = fieldValues[0];
1243
+ break;
1244
+ case "height":
1245
+ height = fieldValues[0];
1246
+ break;
1247
+ case "side":
1248
+ break;
1249
+ default:
1250
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1251
+ break;
1252
+ }
1253
+ }
1254
+ const geometry = new ConeGeometry(radius, height, 16, 1, openEnded);
1255
+ return geometry;
1256
+ }
1257
+ function buildCylinderNode(node) {
1258
+ let radius = 1, height = 2;
1259
+ const fields = node.fields;
1260
+ for (let i = 0, l = fields.length; i < l; i++) {
1261
+ const field = fields[i];
1262
+ const fieldName = field.name;
1263
+ const fieldValues = field.values;
1264
+ switch (fieldName) {
1265
+ case "bottom":
1266
+ break;
1267
+ case "radius":
1268
+ radius = fieldValues[0];
1269
+ break;
1270
+ case "height":
1271
+ height = fieldValues[0];
1272
+ break;
1273
+ case "side":
1274
+ break;
1275
+ case "top":
1276
+ break;
1277
+ default:
1278
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1279
+ break;
1280
+ }
1281
+ }
1282
+ const geometry = new CylinderGeometry(radius, radius, height, 16, 1);
1283
+ return geometry;
1284
+ }
1285
+ function buildSphereNode(node) {
1286
+ let radius = 1;
1287
+ const fields = node.fields;
1288
+ for (let i = 0, l = fields.length; i < l; i++) {
1289
+ const field = fields[i];
1290
+ const fieldName = field.name;
1291
+ const fieldValues = field.values;
1292
+ switch (fieldName) {
1293
+ case "radius":
1294
+ radius = fieldValues[0];
1295
+ break;
1296
+ default:
1297
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1298
+ break;
1299
+ }
1300
+ }
1301
+ const geometry = new SphereGeometry(radius, 16, 16);
1302
+ return geometry;
1303
+ }
1304
+ function buildElevationGridNode(node) {
1305
+ let color;
1306
+ let normal;
1307
+ let texCoord;
1308
+ let height;
1309
+ let colorPerVertex = true;
1310
+ let normalPerVertex = true;
1311
+ let solid = true;
1312
+ let ccw = true;
1313
+ let creaseAngle = 0;
1314
+ let xDimension = 2;
1315
+ let zDimension = 2;
1316
+ let xSpacing = 1;
1317
+ let zSpacing = 1;
1318
+ const fields = node.fields;
1319
+ for (let i = 0, l = fields.length; i < l; i++) {
1320
+ const field = fields[i];
1321
+ const fieldName = field.name;
1322
+ const fieldValues = field.values;
1323
+ switch (fieldName) {
1324
+ case "color":
1325
+ const colorNode = fieldValues[0];
1326
+ if (colorNode !== null) {
1327
+ color = getNode(colorNode);
1328
+ }
1329
+ break;
1330
+ case "normal":
1331
+ const normalNode = fieldValues[0];
1332
+ if (normalNode !== null) {
1333
+ normal = getNode(normalNode);
1334
+ }
1335
+ break;
1336
+ case "texCoord":
1337
+ const texCoordNode = fieldValues[0];
1338
+ if (texCoordNode !== null) {
1339
+ texCoord = getNode(texCoordNode);
1340
+ }
1341
+ break;
1342
+ case "height":
1343
+ height = fieldValues;
1344
+ break;
1345
+ case "ccw":
1346
+ ccw = fieldValues[0];
1347
+ break;
1348
+ case "colorPerVertex":
1349
+ colorPerVertex = fieldValues[0];
1350
+ break;
1351
+ case "creaseAngle":
1352
+ creaseAngle = fieldValues[0];
1353
+ break;
1354
+ case "normalPerVertex":
1355
+ normalPerVertex = fieldValues[0];
1356
+ break;
1357
+ case "solid":
1358
+ solid = fieldValues[0];
1359
+ break;
1360
+ case "xDimension":
1361
+ xDimension = fieldValues[0];
1362
+ break;
1363
+ case "xSpacing":
1364
+ xSpacing = fieldValues[0];
1365
+ break;
1366
+ case "zDimension":
1367
+ zDimension = fieldValues[0];
1368
+ break;
1369
+ case "zSpacing":
1370
+ zSpacing = fieldValues[0];
1371
+ break;
1372
+ default:
1373
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1374
+ break;
1375
+ }
1376
+ }
1377
+ const vertices = [];
1378
+ const normals = [];
1379
+ const colors = [];
1380
+ const uvs = [];
1381
+ for (let i = 0; i < zDimension; i++) {
1382
+ for (let j = 0; j < xDimension; j++) {
1383
+ const index = i * xDimension + j;
1384
+ const x = xSpacing * i;
1385
+ const y = height[index];
1386
+ const z = zSpacing * j;
1387
+ vertices.push(x, y, z);
1388
+ if (color && colorPerVertex === true) {
1389
+ const r = color[index * 3 + 0];
1390
+ const g = color[index * 3 + 1];
1391
+ const b = color[index * 3 + 2];
1392
+ colors.push(r, g, b);
1393
+ }
1394
+ if (normal && normalPerVertex === true) {
1395
+ const xn = normal[index * 3 + 0];
1396
+ const yn = normal[index * 3 + 1];
1397
+ const zn = normal[index * 3 + 2];
1398
+ normals.push(xn, yn, zn);
1399
+ }
1400
+ if (texCoord) {
1401
+ const s = texCoord[index * 2 + 0];
1402
+ const t = texCoord[index * 2 + 1];
1403
+ uvs.push(s, t);
1404
+ } else {
1405
+ uvs.push(i / (xDimension - 1), j / (zDimension - 1));
1406
+ }
1407
+ }
1408
+ }
1409
+ const indices = [];
1410
+ for (let i = 0; i < xDimension - 1; i++) {
1411
+ for (let j = 0; j < zDimension - 1; j++) {
1412
+ const a = i + j * xDimension;
1413
+ const b = i + (j + 1) * xDimension;
1414
+ const c = i + 1 + (j + 1) * xDimension;
1415
+ const d = i + 1 + j * xDimension;
1416
+ if (ccw === true) {
1417
+ indices.push(a, c, b);
1418
+ indices.push(c, a, d);
1419
+ } else {
1420
+ indices.push(a, b, c);
1421
+ indices.push(c, d, a);
1422
+ }
1423
+ }
1424
+ }
1425
+ const positionAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(vertices, 3));
1426
+ const uvAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(uvs, 2));
1427
+ let colorAttribute;
1428
+ let normalAttribute;
1429
+ if (color) {
1430
+ if (colorPerVertex === false) {
1431
+ for (let i = 0; i < xDimension - 1; i++) {
1432
+ for (let j = 0; j < zDimension - 1; j++) {
1433
+ const index = i + j * (xDimension - 1);
1434
+ const r = color[index * 3 + 0];
1435
+ const g = color[index * 3 + 1];
1436
+ const b = color[index * 3 + 2];
1437
+ colors.push(r, g, b);
1438
+ colors.push(r, g, b);
1439
+ colors.push(r, g, b);
1440
+ colors.push(r, g, b);
1441
+ colors.push(r, g, b);
1442
+ colors.push(r, g, b);
1443
+ }
1444
+ }
1445
+ colorAttribute = new Float32BufferAttribute(colors, 3);
1446
+ } else {
1447
+ colorAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(colors, 3));
1448
+ }
1449
+ }
1450
+ if (normal) {
1451
+ if (normalPerVertex === false) {
1452
+ for (let i = 0; i < xDimension - 1; i++) {
1453
+ for (let j = 0; j < zDimension - 1; j++) {
1454
+ const index = i + j * (xDimension - 1);
1455
+ const xn = normal[index * 3 + 0];
1456
+ const yn = normal[index * 3 + 1];
1457
+ const zn = normal[index * 3 + 2];
1458
+ normals.push(xn, yn, zn);
1459
+ normals.push(xn, yn, zn);
1460
+ normals.push(xn, yn, zn);
1461
+ normals.push(xn, yn, zn);
1462
+ normals.push(xn, yn, zn);
1463
+ normals.push(xn, yn, zn);
1464
+ }
1465
+ }
1466
+ normalAttribute = new Float32BufferAttribute(normals, 3);
1467
+ } else {
1468
+ normalAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(normals, 3));
1469
+ }
1470
+ } else {
1471
+ normalAttribute = computeNormalAttribute(indices, vertices, creaseAngle);
1472
+ }
1473
+ const geometry = new BufferGeometry();
1474
+ geometry.setAttribute("position", positionAttribute);
1475
+ geometry.setAttribute("normal", normalAttribute);
1476
+ geometry.setAttribute("uv", uvAttribute);
1477
+ if (colorAttribute)
1478
+ geometry.setAttribute("color", colorAttribute);
1479
+ geometry._solid = solid;
1480
+ geometry._type = "mesh";
1481
+ return geometry;
1482
+ }
1483
+ function buildExtrusionNode(node) {
1484
+ let crossSection = [1, 1, 1, -1, -1, -1, -1, 1, 1, 1];
1485
+ let spine = [0, 0, 0, 0, 1, 0];
1486
+ let scale;
1487
+ let orientation;
1488
+ let beginCap = true;
1489
+ let ccw = true;
1490
+ let creaseAngle = 0;
1491
+ let endCap = true;
1492
+ let solid = true;
1493
+ const fields = node.fields;
1494
+ for (let i = 0, l = fields.length; i < l; i++) {
1495
+ const field = fields[i];
1496
+ const fieldName = field.name;
1497
+ const fieldValues = field.values;
1498
+ switch (fieldName) {
1499
+ case "beginCap":
1500
+ beginCap = fieldValues[0];
1501
+ break;
1502
+ case "ccw":
1503
+ ccw = fieldValues[0];
1504
+ break;
1505
+ case "convex":
1506
+ break;
1507
+ case "creaseAngle":
1508
+ creaseAngle = fieldValues[0];
1509
+ break;
1510
+ case "crossSection":
1511
+ crossSection = fieldValues;
1512
+ break;
1513
+ case "endCap":
1514
+ endCap = fieldValues[0];
1515
+ break;
1516
+ case "orientation":
1517
+ orientation = fieldValues;
1518
+ break;
1519
+ case "scale":
1520
+ scale = fieldValues;
1521
+ break;
1522
+ case "solid":
1523
+ solid = fieldValues[0];
1524
+ break;
1525
+ case "spine":
1526
+ spine = fieldValues;
1527
+ break;
1528
+ default:
1529
+ console.warn("THREE.VRMLLoader: Unknown field:", fieldName);
1530
+ break;
1531
+ }
1532
+ }
1533
+ const crossSectionClosed = crossSection[0] === crossSection[crossSection.length - 2] && crossSection[1] === crossSection[crossSection.length - 1];
1534
+ const vertices = [];
1535
+ const spineVector = new Vector3();
1536
+ const scaling = new Vector3();
1537
+ const axis = new Vector3();
1538
+ const vertex = new Vector3();
1539
+ const quaternion = new Quaternion();
1540
+ for (let i = 0, j = 0, o = 0, il = spine.length; i < il; i += 3, j += 2, o += 4) {
1541
+ spineVector.fromArray(spine, i);
1542
+ scaling.x = scale ? scale[j + 0] : 1;
1543
+ scaling.y = 1;
1544
+ scaling.z = scale ? scale[j + 1] : 1;
1545
+ axis.x = orientation ? orientation[o + 0] : 0;
1546
+ axis.y = orientation ? orientation[o + 1] : 0;
1547
+ axis.z = orientation ? orientation[o + 2] : 1;
1548
+ const angle = orientation ? orientation[o + 3] : 0;
1549
+ for (let k = 0, kl = crossSection.length; k < kl; k += 2) {
1550
+ vertex.x = crossSection[k + 0];
1551
+ vertex.y = 0;
1552
+ vertex.z = crossSection[k + 1];
1553
+ vertex.multiply(scaling);
1554
+ quaternion.setFromAxisAngle(axis, angle);
1555
+ vertex.applyQuaternion(quaternion);
1556
+ vertex.add(spineVector);
1557
+ vertices.push(vertex.x, vertex.y, vertex.z);
1558
+ }
1559
+ }
1560
+ const indices = [];
1561
+ const spineCount = spine.length / 3;
1562
+ const crossSectionCount = crossSection.length / 2;
1563
+ for (let i = 0; i < spineCount - 1; i++) {
1564
+ for (let j = 0; j < crossSectionCount - 1; j++) {
1565
+ const a = j + i * crossSectionCount;
1566
+ let b = j + 1 + i * crossSectionCount;
1567
+ const c = j + (i + 1) * crossSectionCount;
1568
+ let d = j + 1 + (i + 1) * crossSectionCount;
1569
+ if (j === crossSectionCount - 2 && crossSectionClosed === true) {
1570
+ b = i * crossSectionCount;
1571
+ d = (i + 1) * crossSectionCount;
1572
+ }
1573
+ if (ccw === true) {
1574
+ indices.push(a, b, c);
1575
+ indices.push(c, b, d);
1576
+ } else {
1577
+ indices.push(a, c, b);
1578
+ indices.push(c, d, b);
1579
+ }
1580
+ }
1581
+ }
1582
+ if (beginCap === true || endCap === true) {
1583
+ const contour = [];
1584
+ for (let i = 0, l = crossSection.length; i < l; i += 2) {
1585
+ contour.push(new Vector2(crossSection[i], crossSection[i + 1]));
1586
+ }
1587
+ const faces = ShapeUtils.triangulateShape(contour, []);
1588
+ const capIndices = [];
1589
+ for (let i = 0, l = faces.length; i < l; i++) {
1590
+ const face = faces[i];
1591
+ capIndices.push(face[0], face[1], face[2]);
1592
+ }
1593
+ if (beginCap === true) {
1594
+ for (let i = 0, l = capIndices.length; i < l; i += 3) {
1595
+ if (ccw === true) {
1596
+ indices.push(capIndices[i + 0], capIndices[i + 1], capIndices[i + 2]);
1597
+ } else {
1598
+ indices.push(capIndices[i + 0], capIndices[i + 2], capIndices[i + 1]);
1599
+ }
1600
+ }
1601
+ }
1602
+ if (endCap === true) {
1603
+ const indexOffset = crossSectionCount * (spineCount - 1);
1604
+ for (let i = 0, l = capIndices.length; i < l; i += 3) {
1605
+ if (ccw === true) {
1606
+ indices.push(
1607
+ indexOffset + capIndices[i + 0],
1608
+ indexOffset + capIndices[i + 2],
1609
+ indexOffset + capIndices[i + 1]
1610
+ );
1611
+ } else {
1612
+ indices.push(
1613
+ indexOffset + capIndices[i + 0],
1614
+ indexOffset + capIndices[i + 1],
1615
+ indexOffset + capIndices[i + 2]
1616
+ );
1617
+ }
1618
+ }
1619
+ }
1620
+ }
1621
+ const positionAttribute = toNonIndexedAttribute(indices, new Float32BufferAttribute(vertices, 3));
1622
+ const normalAttribute = computeNormalAttribute(indices, vertices, creaseAngle);
1623
+ const geometry = new BufferGeometry();
1624
+ geometry.setAttribute("position", positionAttribute);
1625
+ geometry.setAttribute("normal", normalAttribute);
1626
+ geometry._solid = solid;
1627
+ geometry._type = "mesh";
1628
+ return geometry;
1629
+ }
1630
+ function resolveUSE(identifier) {
1631
+ const node = nodeMap[identifier];
1632
+ const build = getNode(node);
1633
+ return build.isObject3D || build.isMaterial ? build.clone() : build;
1634
+ }
1635
+ function parseFieldChildren(children, owner) {
1636
+ for (let i = 0, l = children.length; i < l; i++) {
1637
+ const object = getNode(children[i]);
1638
+ if (object instanceof Object3D)
1639
+ owner.add(object);
1640
+ }
1641
+ }
1642
+ function triangulateFaceIndex(index, ccw) {
1643
+ const indices = [];
1644
+ let start = 0;
1645
+ for (let i = 0, l = index.length; i < l; i++) {
1646
+ const i1 = index[start];
1647
+ const i2 = index[i + (ccw ? 1 : 2)];
1648
+ const i3 = index[i + (ccw ? 2 : 1)];
1649
+ indices.push(i1, i2, i3);
1650
+ if (index[i + 3] === -1 || i + 3 >= l) {
1651
+ i += 3;
1652
+ start = i + 1;
1653
+ }
1654
+ }
1655
+ return indices;
1656
+ }
1657
+ function triangulateFaceData(data2, index) {
1658
+ const triangulatedData = [];
1659
+ let start = 0;
1660
+ for (let i = 0, l = index.length; i < l; i++) {
1661
+ const stride = start * 3;
1662
+ const x = data2[stride];
1663
+ const y = data2[stride + 1];
1664
+ const z = data2[stride + 2];
1665
+ triangulatedData.push(x, y, z);
1666
+ if (index[i + 3] === -1 || i + 3 >= l) {
1667
+ i += 3;
1668
+ start++;
1669
+ }
1670
+ }
1671
+ return triangulatedData;
1672
+ }
1673
+ function flattenData(data2, index) {
1674
+ const flattenData2 = [];
1675
+ for (let i = 0, l = index.length; i < l; i++) {
1676
+ const i1 = index[i];
1677
+ const stride = i1 * 3;
1678
+ const x = data2[stride];
1679
+ const y = data2[stride + 1];
1680
+ const z = data2[stride + 2];
1681
+ flattenData2.push(x, y, z);
1682
+ }
1683
+ return flattenData2;
1684
+ }
1685
+ function expandLineIndex(index) {
1686
+ const indices = [];
1687
+ for (let i = 0, l = index.length; i < l; i++) {
1688
+ const i1 = index[i];
1689
+ const i2 = index[i + 1];
1690
+ indices.push(i1, i2);
1691
+ if (index[i + 2] === -1 || i + 2 >= l) {
1692
+ i += 2;
1693
+ }
1694
+ }
1695
+ return indices;
1696
+ }
1697
+ function expandLineData(data2, index) {
1698
+ const triangulatedData = [];
1699
+ let start = 0;
1700
+ for (let i = 0, l = index.length; i < l; i++) {
1701
+ const stride = start * 3;
1702
+ const x = data2[stride];
1703
+ const y = data2[stride + 1];
1704
+ const z = data2[stride + 2];
1705
+ triangulatedData.push(x, y, z);
1706
+ if (index[i + 2] === -1 || i + 2 >= l) {
1707
+ i += 2;
1708
+ start++;
1709
+ }
1710
+ }
1711
+ return triangulatedData;
1712
+ }
1713
+ const vA = new Vector3();
1714
+ const vB = new Vector3();
1715
+ const vC = new Vector3();
1716
+ const uvA = new Vector2();
1717
+ const uvB = new Vector2();
1718
+ const uvC = new Vector2();
1719
+ function computeAttributeFromIndexedData(coordIndex, index, data2, itemSize) {
1720
+ const array = [];
1721
+ for (let i = 0, l = coordIndex.length; i < l; i += 3) {
1722
+ const a = index[i];
1723
+ const b = index[i + 1];
1724
+ const c = index[i + 2];
1725
+ if (itemSize === 2) {
1726
+ uvA.fromArray(data2, a * itemSize);
1727
+ uvB.fromArray(data2, b * itemSize);
1728
+ uvC.fromArray(data2, c * itemSize);
1729
+ array.push(uvA.x, uvA.y);
1730
+ array.push(uvB.x, uvB.y);
1731
+ array.push(uvC.x, uvC.y);
1732
+ } else {
1733
+ vA.fromArray(data2, a * itemSize);
1734
+ vB.fromArray(data2, b * itemSize);
1735
+ vC.fromArray(data2, c * itemSize);
1736
+ array.push(vA.x, vA.y, vA.z);
1737
+ array.push(vB.x, vB.y, vB.z);
1738
+ array.push(vC.x, vC.y, vC.z);
1739
+ }
1740
+ }
1741
+ return new Float32BufferAttribute(array, itemSize);
1742
+ }
1743
+ function computeAttributeFromFaceData(index, faceData) {
1744
+ const array = [];
1745
+ for (let i = 0, j = 0, l = index.length; i < l; i += 3, j++) {
1746
+ vA.fromArray(faceData, j * 3);
1747
+ array.push(vA.x, vA.y, vA.z);
1748
+ array.push(vA.x, vA.y, vA.z);
1749
+ array.push(vA.x, vA.y, vA.z);
1750
+ }
1751
+ return new Float32BufferAttribute(array, 3);
1752
+ }
1753
+ function computeAttributeFromLineData(index, lineData) {
1754
+ const array = [];
1755
+ for (let i = 0, j = 0, l = index.length; i < l; i += 2, j++) {
1756
+ vA.fromArray(lineData, j * 3);
1757
+ array.push(vA.x, vA.y, vA.z);
1758
+ array.push(vA.x, vA.y, vA.z);
1759
+ }
1760
+ return new Float32BufferAttribute(array, 3);
1761
+ }
1762
+ function toNonIndexedAttribute(indices, attribute) {
1763
+ const array = attribute.array;
1764
+ const itemSize = attribute.itemSize;
1765
+ const array2 = new array.constructor(indices.length * itemSize);
1766
+ let index = 0, index2 = 0;
1767
+ for (let i = 0, l = indices.length; i < l; i++) {
1768
+ index = indices[i] * itemSize;
1769
+ for (let j = 0; j < itemSize; j++) {
1770
+ array2[index2++] = array[index++];
1771
+ }
1772
+ }
1773
+ return new Float32BufferAttribute(array2, itemSize);
1774
+ }
1775
+ const ab = new Vector3();
1776
+ const cb = new Vector3();
1777
+ function computeNormalAttribute(index, coord, creaseAngle) {
1778
+ const faces = [];
1779
+ const vertexNormals = {};
1780
+ for (let i = 0, l = index.length; i < l; i += 3) {
1781
+ const a = index[i];
1782
+ const b = index[i + 1];
1783
+ const c = index[i + 2];
1784
+ const face = new Face(a, b, c);
1785
+ vA.fromArray(coord, a * 3);
1786
+ vB.fromArray(coord, b * 3);
1787
+ vC.fromArray(coord, c * 3);
1788
+ cb.subVectors(vC, vB);
1789
+ ab.subVectors(vA, vB);
1790
+ cb.cross(ab);
1791
+ cb.normalize();
1792
+ face.normal.copy(cb);
1793
+ if (vertexNormals[a] === void 0)
1794
+ vertexNormals[a] = [];
1795
+ if (vertexNormals[b] === void 0)
1796
+ vertexNormals[b] = [];
1797
+ if (vertexNormals[c] === void 0)
1798
+ vertexNormals[c] = [];
1799
+ vertexNormals[a].push(face.normal);
1800
+ vertexNormals[b].push(face.normal);
1801
+ vertexNormals[c].push(face.normal);
1802
+ faces.push(face);
1803
+ }
1804
+ const normals = [];
1805
+ for (let i = 0, l = faces.length; i < l; i++) {
1806
+ const face = faces[i];
1807
+ const nA = weightedNormal(vertexNormals[face.a], face.normal, creaseAngle);
1808
+ const nB = weightedNormal(vertexNormals[face.b], face.normal, creaseAngle);
1809
+ const nC = weightedNormal(vertexNormals[face.c], face.normal, creaseAngle);
1810
+ vA.fromArray(coord, face.a * 3);
1811
+ vB.fromArray(coord, face.b * 3);
1812
+ vC.fromArray(coord, face.c * 3);
1813
+ normals.push(nA.x, nA.y, nA.z);
1814
+ normals.push(nB.x, nB.y, nB.z);
1815
+ normals.push(nC.x, nC.y, nC.z);
1816
+ }
1817
+ return new Float32BufferAttribute(normals, 3);
1818
+ }
1819
+ function weightedNormal(normals, vector, creaseAngle) {
1820
+ const normal = new Vector3();
1821
+ if (creaseAngle === 0) {
1822
+ normal.copy(vector);
1823
+ } else {
1824
+ for (let i = 0, l = normals.length; i < l; i++) {
1825
+ if (normals[i].angleTo(vector) < creaseAngle) {
1826
+ normal.add(normals[i]);
1827
+ }
1828
+ }
1829
+ }
1830
+ return normal.normalize();
1831
+ }
1832
+ function toColorArray(colors) {
1833
+ const array = [];
1834
+ for (let i = 0, l = colors.length; i < l; i += 3) {
1835
+ array.push(new Color(colors[i], colors[i + 1], colors[i + 2]));
1836
+ }
1837
+ return array;
1838
+ }
1839
+ function paintFaces(geometry, radius, angles, colors, topDown) {
1840
+ const thresholds = [];
1841
+ const startAngle = topDown === true ? 0 : Math.PI;
1842
+ for (let i = 0, l = colors.length; i < l; i++) {
1843
+ let angle = i === 0 ? 0 : angles[i - 1];
1844
+ angle = topDown === true ? angle : startAngle - angle;
1845
+ const point = new Vector3();
1846
+ point.setFromSphericalCoords(radius, angle, 0);
1847
+ thresholds.push(point);
1848
+ }
1849
+ const indices = geometry.index;
1850
+ const positionAttribute = geometry.attributes.position;
1851
+ const colorAttribute = new BufferAttribute(new Float32Array(geometry.attributes.position.count * 3), 3);
1852
+ const position = new Vector3();
1853
+ const color = new Color();
1854
+ for (let i = 0; i < indices.count; i++) {
1855
+ const index = indices.getX(i);
1856
+ position.fromBufferAttribute(positionAttribute, index);
1857
+ let thresholdIndexA, thresholdIndexB;
1858
+ let t = 1;
1859
+ for (let j = 1; j < thresholds.length; j++) {
1860
+ thresholdIndexA = j - 1;
1861
+ thresholdIndexB = j;
1862
+ const thresholdA = thresholds[thresholdIndexA];
1863
+ const thresholdB = thresholds[thresholdIndexB];
1864
+ if (topDown === true) {
1865
+ if (position.y <= thresholdA.y && position.y > thresholdB.y) {
1866
+ t = Math.abs(thresholdA.y - position.y) / Math.abs(thresholdA.y - thresholdB.y);
1867
+ break;
1868
+ }
1869
+ } else {
1870
+ if (position.y >= thresholdA.y && position.y < thresholdB.y) {
1871
+ t = Math.abs(thresholdA.y - position.y) / Math.abs(thresholdA.y - thresholdB.y);
1872
+ break;
1873
+ }
1874
+ }
1875
+ }
1876
+ const colorA = colors[thresholdIndexA];
1877
+ const colorB = colors[thresholdIndexB];
1878
+ color.copy(colorA).lerp(colorB, t);
1879
+ colorAttribute.setXYZ(index, color.r, color.g, color.b);
1880
+ }
1881
+ geometry.setAttribute("color", colorAttribute);
1882
+ }
1883
+ const textureLoader = new TextureLoader(this.manager);
1884
+ textureLoader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
1885
+ if (data.indexOf("#VRML V2.0") === -1) {
1886
+ throw Error("THREE.VRMLLexer: Version of VRML asset not supported.");
1887
+ }
1888
+ const tree = generateVRMLTree(data);
1889
+ const scene = parseTree(tree);
1890
+ return scene;
1891
+ }
1892
+ }
1893
+ class VRMLLexer {
1894
+ constructor(tokens) {
1895
+ this.lexer = new Lexer(tokens);
1896
+ }
1897
+ lex(inputText) {
1898
+ const lexingResult = this.lexer.tokenize(inputText);
1899
+ if (lexingResult.errors.length > 0) {
1900
+ console.error(lexingResult.errors);
1901
+ throw Error("THREE.VRMLLexer: Lexing errors detected.");
1902
+ }
1903
+ return lexingResult;
1904
+ }
1905
+ }
1906
+ class VRMLParser extends CstParser {
1907
+ constructor(tokenVocabulary) {
1908
+ super(tokenVocabulary);
1909
+ const $ = this;
1910
+ const Version = tokenVocabulary["Version"];
1911
+ const LCurly = tokenVocabulary["LCurly"];
1912
+ const RCurly = tokenVocabulary["RCurly"];
1913
+ const LSquare = tokenVocabulary["LSquare"];
1914
+ const RSquare = tokenVocabulary["RSquare"];
1915
+ const Identifier = tokenVocabulary["Identifier"];
1916
+ const RouteIdentifier = tokenVocabulary["RouteIdentifier"];
1917
+ const StringLiteral = tokenVocabulary["StringLiteral"];
1918
+ const HexLiteral = tokenVocabulary["HexLiteral"];
1919
+ const NumberLiteral = tokenVocabulary["NumberLiteral"];
1920
+ const TrueLiteral = tokenVocabulary["TrueLiteral"];
1921
+ const FalseLiteral = tokenVocabulary["FalseLiteral"];
1922
+ const NullLiteral = tokenVocabulary["NullLiteral"];
1923
+ const DEF = tokenVocabulary["DEF"];
1924
+ const USE = tokenVocabulary["USE"];
1925
+ const ROUTE = tokenVocabulary["ROUTE"];
1926
+ const TO = tokenVocabulary["TO"];
1927
+ const NodeName = tokenVocabulary["NodeName"];
1928
+ $.RULE("vrml", function() {
1929
+ $.SUBRULE($.version);
1930
+ $.AT_LEAST_ONE(function() {
1931
+ $.SUBRULE($.node);
1932
+ });
1933
+ $.MANY(function() {
1934
+ $.SUBRULE($.route);
1935
+ });
1936
+ });
1937
+ $.RULE("version", function() {
1938
+ $.CONSUME(Version);
1939
+ });
1940
+ $.RULE("node", function() {
1941
+ $.OPTION(function() {
1942
+ $.SUBRULE($.def);
1943
+ });
1944
+ $.CONSUME(NodeName);
1945
+ $.CONSUME(LCurly);
1946
+ $.MANY(function() {
1947
+ $.SUBRULE($.field);
1948
+ });
1949
+ $.CONSUME(RCurly);
1950
+ });
1951
+ $.RULE("field", function() {
1952
+ $.CONSUME(Identifier);
1953
+ $.OR2([
1954
+ {
1955
+ ALT: function() {
1956
+ $.SUBRULE($.singleFieldValue);
1957
+ }
1958
+ },
1959
+ {
1960
+ ALT: function() {
1961
+ $.SUBRULE($.multiFieldValue);
1962
+ }
1963
+ }
1964
+ ]);
1965
+ });
1966
+ $.RULE("def", function() {
1967
+ $.CONSUME(DEF);
1968
+ $.OR([
1969
+ {
1970
+ ALT: function() {
1971
+ $.CONSUME(Identifier);
1972
+ }
1973
+ },
1974
+ {
1975
+ ALT: function() {
1976
+ $.CONSUME(NodeName);
1977
+ }
1978
+ }
1979
+ ]);
1980
+ });
1981
+ $.RULE("use", function() {
1982
+ $.CONSUME(USE);
1983
+ $.OR([
1984
+ {
1985
+ ALT: function() {
1986
+ $.CONSUME(Identifier);
1987
+ }
1988
+ },
1989
+ {
1990
+ ALT: function() {
1991
+ $.CONSUME(NodeName);
1992
+ }
1993
+ }
1994
+ ]);
1995
+ });
1996
+ $.RULE("singleFieldValue", function() {
1997
+ $.AT_LEAST_ONE(function() {
1998
+ $.OR([
1999
+ {
2000
+ ALT: function() {
2001
+ $.SUBRULE($.node);
2002
+ }
2003
+ },
2004
+ {
2005
+ ALT: function() {
2006
+ $.SUBRULE($.use);
2007
+ }
2008
+ },
2009
+ {
2010
+ ALT: function() {
2011
+ $.CONSUME(StringLiteral);
2012
+ }
2013
+ },
2014
+ {
2015
+ ALT: function() {
2016
+ $.CONSUME(HexLiteral);
2017
+ }
2018
+ },
2019
+ {
2020
+ ALT: function() {
2021
+ $.CONSUME(NumberLiteral);
2022
+ }
2023
+ },
2024
+ {
2025
+ ALT: function() {
2026
+ $.CONSUME(TrueLiteral);
2027
+ }
2028
+ },
2029
+ {
2030
+ ALT: function() {
2031
+ $.CONSUME(FalseLiteral);
2032
+ }
2033
+ },
2034
+ {
2035
+ ALT: function() {
2036
+ $.CONSUME(NullLiteral);
2037
+ }
2038
+ }
2039
+ ]);
2040
+ });
2041
+ });
2042
+ $.RULE("multiFieldValue", function() {
2043
+ $.CONSUME(LSquare);
2044
+ $.MANY(function() {
2045
+ $.OR([
2046
+ {
2047
+ ALT: function() {
2048
+ $.SUBRULE($.node);
2049
+ }
2050
+ },
2051
+ {
2052
+ ALT: function() {
2053
+ $.SUBRULE($.use);
2054
+ }
2055
+ },
2056
+ {
2057
+ ALT: function() {
2058
+ $.CONSUME(StringLiteral);
2059
+ }
2060
+ },
2061
+ {
2062
+ ALT: function() {
2063
+ $.CONSUME(HexLiteral);
2064
+ }
2065
+ },
2066
+ {
2067
+ ALT: function() {
2068
+ $.CONSUME(NumberLiteral);
2069
+ }
2070
+ },
2071
+ {
2072
+ ALT: function() {
2073
+ $.CONSUME(NullLiteral);
2074
+ }
2075
+ }
2076
+ ]);
2077
+ });
2078
+ $.CONSUME(RSquare);
2079
+ });
2080
+ $.RULE("route", function() {
2081
+ $.CONSUME(ROUTE);
2082
+ $.CONSUME(RouteIdentifier);
2083
+ $.CONSUME(TO);
2084
+ $.CONSUME2(RouteIdentifier);
2085
+ });
2086
+ this.performSelfAnalysis();
2087
+ }
2088
+ }
2089
+ class Face {
2090
+ constructor(a, b, c) {
2091
+ this.a = a;
2092
+ this.b = b;
2093
+ this.c = c;
2094
+ this.normal = new Vector3();
2095
+ }
2096
+ }
2097
+ const TEXTURE_TYPE = {
2098
+ INTENSITY: 1,
2099
+ INTENSITY_ALPHA: 2,
2100
+ RGB: 3,
2101
+ RGBA: 4
2102
+ };
2103
+ export {
2104
+ VRMLLoader
2105
+ };