three-stdlib 2.15.0 → 2.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1222) hide show
  1. package/animation/AnimationClipCreator.js +32 -52
  2. package/animation/AnimationClipCreator.mjs +57 -0
  3. package/animation/CCDIKSolver.js +66 -161
  4. package/animation/CCDIKSolver.mjs +234 -0
  5. package/animation/MMDAnimationHelper.js +150 -341
  6. package/animation/MMDAnimationHelper.mjs +514 -0
  7. package/animation/MMDPhysics.js +154 -361
  8. package/animation/MMDPhysics.mjs +769 -0
  9. package/cameras/CinematicCamera.js +67 -77
  10. package/cameras/CinematicCamera.mjs +129 -0
  11. package/controls/ArcballControls.js +544 -1449
  12. package/controls/ArcballControls.mjs +1737 -0
  13. package/controls/DeviceOrientationControls.js +52 -97
  14. package/controls/DeviceOrientationControls.mjs +74 -0
  15. package/controls/DragControls.js +85 -187
  16. package/controls/DragControls.mjs +172 -0
  17. package/controls/FirstPersonControls.js +123 -193
  18. package/controls/FirstPersonControls.mjs +220 -0
  19. package/controls/FlyControls.js +82 -152
  20. package/controls/FlyControls.mjs +239 -0
  21. package/controls/OrbitControls.js +232 -481
  22. package/controls/OrbitControls.mjs +731 -0
  23. package/controls/PointerLockControls.js +63 -99
  24. package/controls/PointerLockControls.mjs +88 -0
  25. package/controls/TrackballControls.js +211 -383
  26. package/controls/TrackballControls.mjs +481 -0
  27. package/controls/TransformControls.js +575 -782
  28. package/controls/TransformControls.mjs +1068 -0
  29. package/controls/experimental/CameraControls.js +329 -609
  30. package/controls/experimental/CameraControls.mjs +673 -0
  31. package/csm/CSM.js +47 -108
  32. package/csm/CSM.mjs +244 -0
  33. package/csm/CSMFrustum.js +14 -29
  34. package/csm/CSMFrustum.mjs +75 -0
  35. package/csm/CSMHelper.js +20 -34
  36. package/csm/CSMHelper.mjs +114 -0
  37. package/csm/CSMShader.js +7 -11
  38. package/csm/CSMShader.mjs +251 -0
  39. package/curves/CurveExtras.js +73 -115
  40. package/curves/CurveExtras.mjs +224 -0
  41. package/curves/NURBSCurve.js +15 -43
  42. package/curves/NURBSCurve.mjs +35 -0
  43. package/curves/NURBSSurface.js +11 -27
  44. package/curves/NURBSSurface.mjs +28 -0
  45. package/curves/NURBSUtils.js +54 -203
  46. package/curves/NURBSUtils.mjs +226 -0
  47. package/deprecated/Geometry.js +191 -486
  48. package/deprecated/Geometry.mjs +966 -0
  49. package/effects/AnaglyphEffect.js +95 -60
  50. package/effects/AnaglyphEffect.mjs +120 -0
  51. package/effects/AsciiEffect.js +80 -110
  52. package/effects/AsciiEffect.mjs +173 -0
  53. package/effects/OutlineEffect.js +121 -204
  54. package/effects/OutlineEffect.mjs +295 -0
  55. package/effects/ParallaxBarrierEffect.js +39 -38
  56. package/effects/ParallaxBarrierEffect.mjs +64 -0
  57. package/effects/PeppersGhostEffect.js +19 -68
  58. package/effects/PeppersGhostEffect.mjs +85 -0
  59. package/effects/StereoEffect.js +12 -16
  60. package/effects/StereoEffect.mjs +32 -0
  61. package/environments/RoomEnvironment.js +52 -47
  62. package/environments/RoomEnvironment.mjs +78 -0
  63. package/exporters/ColladaExporter.js +115 -241
  64. package/exporters/ColladaExporter.mjs +299 -0
  65. package/exporters/DRACOExporter.js +67 -121
  66. package/exporters/DRACOExporter.mjs +132 -0
  67. package/exporters/GLTFExporter.js +463 -1014
  68. package/exporters/GLTFExporter.mjs +1381 -0
  69. package/exporters/MMDExporter.js +44 -102
  70. package/exporters/MMDExporter.mjs +102 -0
  71. package/exporters/OBJExporter.js +78 -140
  72. package/exporters/OBJExporter.mjs +166 -0
  73. package/exporters/PLYExporter.js +93 -154
  74. package/exporters/PLYExporter.mjs +278 -0
  75. package/exporters/STLExporter.js +30 -81
  76. package/exporters/STLExporter.mjs +129 -0
  77. package/exporters/USDZExporter.js +84 -144
  78. package/exporters/USDZExporter.mjs +328 -0
  79. package/geometries/BoxLineGeometry.js +7 -14
  80. package/geometries/BoxLineGeometry.mjs +45 -0
  81. package/geometries/ConvexGeometry.js +15 -24
  82. package/geometries/ConvexGeometry.mjs +29 -0
  83. package/geometries/DecalGeometry.js +108 -162
  84. package/geometries/DecalGeometry.mjs +184 -0
  85. package/geometries/LightningStrike.js +101 -294
  86. package/geometries/LightningStrike.mjs +547 -0
  87. package/geometries/ParametricGeometries.js +26 -76
  88. package/geometries/ParametricGeometries.mjs +129 -0
  89. package/geometries/ParametricGeometry.js +24 -48
  90. package/geometries/ParametricGeometry.mjs +63 -0
  91. package/geometries/RoundedBoxGeometry.js +33 -64
  92. package/geometries/RoundedBoxGeometry.mjs +91 -0
  93. package/geometries/TeapotGeometry.js +1434 -174
  94. package/geometries/TeapotGeometry.mjs +1557 -0
  95. package/geometries/TextGeometry.js +9 -17
  96. package/geometries/TextGeometry.mjs +23 -0
  97. package/helpers/LightProbeHelper.js +53 -21
  98. package/helpers/LightProbeHelper.mjs +72 -0
  99. package/helpers/PositionalAudioHelper.js +23 -30
  100. package/helpers/PositionalAudioHelper.mjs +68 -0
  101. package/helpers/RectAreaLightHelper.js +17 -33
  102. package/helpers/RectAreaLightHelper.mjs +44 -0
  103. package/helpers/VertexNormalsHelper.js +20 -41
  104. package/helpers/VertexNormalsHelper.mjs +54 -0
  105. package/helpers/VertexTangentsHelper.js +18 -36
  106. package/helpers/VertexTangentsHelper.mjs +45 -0
  107. package/index.d.ts +54 -0
  108. package/index.js +968 -333
  109. package/index.mjs +968 -0
  110. package/interactive/SelectionBox.js +31 -46
  111. package/interactive/SelectionBox.mjs +137 -0
  112. package/interactive/SelectionHelper.js +16 -21
  113. package/interactive/SelectionHelper.mjs +54 -0
  114. package/libs/MeshoptDecoder.js +147 -58
  115. package/libs/MeshoptDecoder.mjs +210 -0
  116. package/libs/MotionControllers.js +66 -208
  117. package/libs/MotionControllers.mjs +261 -0
  118. package/lights/LightProbeGenerator.js +40 -96
  119. package/lights/LightProbeGenerator.mjs +145 -0
  120. package/lights/RectAreaLightUniformsLib.js +32842 -9
  121. package/lights/RectAreaLightUniformsLib.mjs +32842 -0
  122. package/lines/Line2.js +9 -12
  123. package/lines/Line2.mjs +13 -0
  124. package/lines/LineGeometry.js +7 -19
  125. package/lines/LineGeometry.mjs +44 -0
  126. package/lines/LineMaterial.js +51 -89
  127. package/lines/LineMaterial.mjs +539 -0
  128. package/lines/LineSegments2.js +56 -165
  129. package/lines/LineSegments2.mjs +202 -0
  130. package/lines/LineSegmentsGeometry.js +29 -71
  131. package/lines/LineSegmentsGeometry.mjs +124 -0
  132. package/lines/Wireframe.js +15 -29
  133. package/lines/Wireframe.mjs +31 -0
  134. package/lines/WireframeGeometry2.js +8 -9
  135. package/lines/WireframeGeometry2.mjs +13 -0
  136. package/loaders/3DMLoader.js +234 -469
  137. package/loaders/3DMLoader.mjs +802 -0
  138. package/loaders/3MFLoader.js +340 -555
  139. package/loaders/3MFLoader.mjs +837 -0
  140. package/loaders/AMFLoader.js +114 -219
  141. package/loaders/AMFLoader.mjs +284 -0
  142. package/loaders/AssimpLoader.js +328 -725
  143. package/loaders/AssimpLoader.mjs +1396 -0
  144. package/loaders/BVHLoader.js +94 -200
  145. package/loaders/BVHLoader.mjs +207 -0
  146. package/loaders/BasisTextureLoader.js +229 -357
  147. package/loaders/BasisTextureLoader.mjs +474 -0
  148. package/loaders/ColladaLoader.js +932 -1522
  149. package/loaders/ColladaLoader.mjs +2403 -0
  150. package/loaders/DDSLoader.js +42 -108
  151. package/loaders/DDSLoader.mjs +148 -0
  152. package/loaders/DRACOLoader.js +103 -210
  153. package/loaders/DRACOLoader.mjs +340 -0
  154. package/loaders/EXRLoader.js +461 -809
  155. package/loaders/EXRLoader.mjs +1351 -0
  156. package/loaders/FBXLoader.js +842 -1397
  157. package/loaders/FBXLoader.mjs +2362 -0
  158. package/loaders/FontLoader.js +33 -66
  159. package/loaders/FontLoader.mjs +111 -0
  160. package/loaders/GCodeLoader.js +63 -111
  161. package/loaders/GCodeLoader.mjs +141 -0
  162. package/loaders/GLTFLoader.js +771 -1484
  163. package/loaders/GLTFLoader.mjs +2316 -0
  164. package/loaders/HDRCubeTextureLoader.js +45 -50
  165. package/loaders/HDRCubeTextureLoader.mjs +77 -0
  166. package/loaders/KMZLoader.js +42 -55
  167. package/loaders/KMZLoader.mjs +75 -0
  168. package/loaders/KTX2Loader.js +229 -362
  169. package/loaders/KTX2Loader.mjs +427 -0
  170. package/loaders/KTXLoader.js +37 -99
  171. package/loaders/KTXLoader.mjs +87 -0
  172. package/loaders/LDrawLoader.js +313 -746
  173. package/loaders/LDrawLoader.mjs +1409 -0
  174. package/loaders/LUT3dlLoader.js +50 -62
  175. package/loaders/LUT3dlLoader.mjs +100 -0
  176. package/loaders/LUTCubeLoader.js +45 -56
  177. package/loaders/LUTCubeLoader.mjs +104 -0
  178. package/loaders/LWOLoader.js +227 -339
  179. package/loaders/LWOLoader.mjs +625 -0
  180. package/loaders/LottieLoader.js +36 -38
  181. package/loaders/LottieLoader.mjs +47 -0
  182. package/loaders/MD2Loader.js +248 -91
  183. package/loaders/MD2Loader.mjs +359 -0
  184. package/loaders/MDDLoader.js +25 -45
  185. package/loaders/MDDLoader.mjs +58 -0
  186. package/loaders/MMDLoader.js +359 -795
  187. package/loaders/MMDLoader.mjs +998 -0
  188. package/loaders/MTLLoader.js +91 -201
  189. package/loaders/MTLLoader.mjs +280 -0
  190. package/loaders/NRRDLoader.js +182 -263
  191. package/loaders/NRRDLoader.mjs +401 -0
  192. package/loaders/NodeMaterialLoader.js +121 -14
  193. package/loaders/NodeMaterialLoader.mjs +146 -0
  194. package/loaders/OBJLoader.js +161 -283
  195. package/loaders/OBJLoader.mjs +487 -0
  196. package/loaders/PCDLoader.js +145 -164
  197. package/loaders/PCDLoader.mjs +248 -0
  198. package/loaders/PDBLoader.js +45 -63
  199. package/loaders/PDBLoader.mjs +246 -0
  200. package/loaders/PLYLoader.js +106 -203
  201. package/loaders/PLYLoader.mjs +317 -0
  202. package/loaders/PRWMLoader.js +73 -110
  203. package/loaders/PRWMLoader.mjs +160 -0
  204. package/loaders/PVRLoader.js +32 -93
  205. package/loaders/PVRLoader.mjs +131 -0
  206. package/loaders/RGBELoader.js +96 -233
  207. package/loaders/RGBELoader.mjs +244 -0
  208. package/loaders/RGBMLoader.js +344 -514
  209. package/loaders/RGBMLoader.mjs +998 -0
  210. package/loaders/STLLoader.js +59 -165
  211. package/loaders/STLLoader.mjs +190 -0
  212. package/loaders/SVGLoader.js +481 -851
  213. package/loaders/SVGLoader.mjs +1709 -0
  214. package/loaders/TDSLoader.js +137 -527
  215. package/loaders/TDSLoader.mjs +480 -0
  216. package/loaders/TGALoader.js +94 -205
  217. package/loaders/TGALoader.mjs +285 -0
  218. package/loaders/TTFLoader.js +58 -79
  219. package/loaders/TTFLoader.mjs +131 -0
  220. package/loaders/TiltLoader.js +129 -167
  221. package/loaders/TiltLoader.mjs +373 -0
  222. package/loaders/VOXLoader.js +320 -84
  223. package/loaders/VOXLoader.mjs +431 -0
  224. package/loaders/VRMLLoader.js +786 -1268
  225. package/loaders/VRMLLoader.mjs +2093 -0
  226. package/loaders/VRMLoader.js +23 -31
  227. package/loaders/VRMLoader.mjs +38 -0
  228. package/loaders/VTKLoader.js +219 -407
  229. package/loaders/VTKLoader.mjs +646 -0
  230. package/loaders/XLoader.js +1083 -1259
  231. package/loaders/XLoader.mjs +1258 -0
  232. package/loaders/XYZLoader.js +28 -34
  233. package/loaders/XYZLoader.mjs +60 -0
  234. package/loaders/lwo/IFFParser.js +238 -492
  235. package/loaders/lwo/IFFParser.mjs +697 -0
  236. package/loaders/lwo/LWO2Parser.js +176 -279
  237. package/loaders/lwo/LWO2Parser.mjs +327 -0
  238. package/loaders/lwo/LWO3Parser.js +160 -247
  239. package/loaders/lwo/LWO3Parser.mjs +298 -0
  240. package/math/Capsule.js +56 -43
  241. package/math/Capsule.mjs +100 -0
  242. package/math/ColorConverter.js +18 -32
  243. package/math/ColorConverter.mjs +51 -0
  244. package/math/ConvexHull.js +515 -739
  245. package/math/ConvexHull.mjs +574 -0
  246. package/math/ImprovedNoise.js +282 -32
  247. package/math/ImprovedNoise.mjs +302 -0
  248. package/math/Lut.js +51 -35
  249. package/math/Lut.mjs +135 -0
  250. package/math/MeshSurfaceSampler.js +25 -68
  251. package/math/MeshSurfaceSampler.mjs +107 -0
  252. package/math/OBB.js +91 -152
  253. package/math/OBB.mjs +235 -0
  254. package/math/Octree.js +76 -139
  255. package/math/Octree.mjs +278 -0
  256. package/math/SimplexNoise.js +217 -238
  257. package/math/SimplexNoise.mjs +425 -0
  258. package/misc/ConvexObjectBreaker.js +79 -185
  259. package/misc/ConvexObjectBreaker.mjs +292 -0
  260. package/misc/GPUComputationRenderer.js +69 -194
  261. package/misc/GPUComputationRenderer.mjs +171 -0
  262. package/misc/Gyroscope.js +16 -22
  263. package/misc/Gyroscope.mjs +35 -0
  264. package/misc/MD2Character.js +52 -74
  265. package/misc/MD2Character.mjs +162 -0
  266. package/misc/MD2CharacterComplex.js +112 -163
  267. package/misc/MD2CharacterComplex.mjs +328 -0
  268. package/misc/MorphAnimMesh.js +20 -28
  269. package/misc/MorphAnimMesh.mjs +40 -0
  270. package/misc/MorphBlendMesh.js +45 -69
  271. package/misc/MorphBlendMesh.mjs +179 -0
  272. package/misc/ProgressiveLightmap.js +70 -187
  273. package/misc/ProgressiveLightmap.mjs +166 -0
  274. package/misc/RollerCoaster.js +106 -135
  275. package/misc/RollerCoaster.mjs +346 -0
  276. package/misc/TubePainter.js +74 -92
  277. package/misc/TubePainter.mjs +123 -0
  278. package/misc/Volume.js +108 -270
  279. package/misc/Volume.mjs +244 -0
  280. package/misc/VolumeSlice.js +34 -122
  281. package/misc/VolumeSlice.mjs +106 -0
  282. package/misc/WebGL.js +37 -34
  283. package/misc/WebGL.mjs +74 -0
  284. package/modifiers/CurveModifier.js +46 -151
  285. package/modifiers/CurveModifier.mjs +182 -0
  286. package/modifiers/EdgeSplitModifier.js +46 -90
  287. package/modifiers/EdgeSplitModifier.mjs +162 -0
  288. package/modifiers/SimplifyModifier.js +77 -202
  289. package/modifiers/SimplifyModifier.mjs +282 -0
  290. package/modifiers/TessellateModifier.js +65 -90
  291. package/modifiers/TessellateModifier.mjs +206 -0
  292. package/nodes/Nodes.js +274 -140
  293. package/nodes/Nodes.mjs +400 -0
  294. package/nodes/ShaderNode.js +296 -196
  295. package/nodes/ShaderNode.mjs +408 -0
  296. package/nodes/accessors/BufferNode.js +4 -8
  297. package/nodes/accessors/BufferNode.mjs +15 -0
  298. package/nodes/accessors/CameraNode.js +20 -25
  299. package/nodes/accessors/CameraNode.mjs +44 -0
  300. package/nodes/accessors/CubeTextureNode.js +14 -26
  301. package/nodes/accessors/CubeTextureNode.mjs +42 -0
  302. package/nodes/accessors/MaterialNode.js +43 -53
  303. package/nodes/accessors/MaterialNode.mjs +71 -0
  304. package/nodes/accessors/MaterialReferenceNode.js +3 -6
  305. package/nodes/accessors/MaterialReferenceNode.mjs +14 -0
  306. package/nodes/accessors/ModelNode.js +3 -5
  307. package/nodes/accessors/ModelNode.mjs +9 -0
  308. package/nodes/accessors/ModelViewProjectionNode.js +14 -13
  309. package/nodes/accessors/ModelViewProjectionNode.mjs +24 -0
  310. package/nodes/accessors/NormalNode.js +40 -39
  311. package/nodes/accessors/NormalNode.mjs +62 -0
  312. package/nodes/accessors/Object3DNode.js +40 -50
  313. package/nodes/accessors/Object3DNode.mjs +76 -0
  314. package/nodes/accessors/PointUVNode.js +5 -9
  315. package/nodes/accessors/PointUVNode.mjs +13 -0
  316. package/nodes/accessors/PositionNode.js +42 -41
  317. package/nodes/accessors/PositionNode.mjs +65 -0
  318. package/nodes/accessors/ReferenceNode.js +10 -17
  319. package/nodes/accessors/ReferenceNode.mjs +37 -0
  320. package/nodes/accessors/ReflectNode.js +23 -26
  321. package/nodes/accessors/ReflectNode.mjs +43 -0
  322. package/nodes/accessors/SkinningNode.js +46 -48
  323. package/nodes/accessors/SkinningNode.mjs +58 -0
  324. package/nodes/accessors/TextureNode.js +14 -29
  325. package/nodes/accessors/TextureNode.mjs +54 -0
  326. package/nodes/accessors/UVNode.js +5 -11
  327. package/nodes/accessors/UVNode.mjs +23 -0
  328. package/nodes/core/ArrayUniformNode.js +3 -7
  329. package/nodes/core/ArrayUniformNode.mjs +14 -0
  330. package/nodes/core/AttributeNode.js +5 -12
  331. package/nodes/core/AttributeNode.mjs +30 -0
  332. package/nodes/core/BypassNode.js +5 -12
  333. package/nodes/core/BypassNode.mjs +22 -0
  334. package/nodes/core/CodeNode.js +4 -12
  335. package/nodes/core/CodeNode.mjs +28 -0
  336. package/nodes/core/ConstNode.js +3 -7
  337. package/nodes/core/ConstNode.mjs +14 -0
  338. package/nodes/core/ContextNode.js +3 -8
  339. package/nodes/core/ContextNode.mjs +22 -0
  340. package/nodes/core/ExpressionNode.js +5 -9
  341. package/nodes/core/ExpressionNode.mjs +19 -0
  342. package/nodes/core/FunctionCallNode.js +6 -15
  343. package/nodes/core/FunctionCallNode.mjs +37 -0
  344. package/nodes/core/FunctionNode.js +10 -25
  345. package/nodes/core/FunctionNode.mjs +56 -0
  346. package/nodes/core/InputNode.js +12 -23
  347. package/nodes/core/InputNode.mjs +38 -0
  348. package/nodes/core/Node.js +35 -75
  349. package/nodes/core/Node.mjs +139 -0
  350. package/nodes/core/NodeAttribute.js +2 -4
  351. package/nodes/core/NodeAttribute.mjs +10 -0
  352. package/nodes/core/NodeBuilder.js +110 -224
  353. package/nodes/core/NodeBuilder.mjs +395 -0
  354. package/nodes/core/NodeCode.js +4 -7
  355. package/nodes/core/NodeCode.mjs +11 -0
  356. package/nodes/core/NodeFrame.js +9 -12
  357. package/nodes/core/NodeFrame.mjs +35 -0
  358. package/nodes/core/NodeFunctionInput.js +3 -5
  359. package/nodes/core/NodeFunctionInput.mjs +13 -0
  360. package/nodes/core/NodeKeywords.js +5 -16
  361. package/nodes/core/NodeKeywords.mjs +44 -0
  362. package/nodes/core/NodeUniform.js +3 -7
  363. package/nodes/core/NodeUniform.mjs +18 -0
  364. package/nodes/core/NodeUtils.js +39 -43
  365. package/nodes/core/NodeUtils.mjs +57 -0
  366. package/nodes/core/NodeVar.js +2 -4
  367. package/nodes/core/NodeVar.mjs +10 -0
  368. package/nodes/core/NodeVary.js +2 -4
  369. package/nodes/core/NodeVary.mjs +10 -0
  370. package/nodes/core/PropertyNode.js +4 -10
  371. package/nodes/core/PropertyNode.mjs +21 -0
  372. package/nodes/core/TempNode.js +5 -11
  373. package/nodes/core/TempNode.mjs +25 -0
  374. package/nodes/core/UniformNode.js +4 -10
  375. package/nodes/core/UniformNode.mjs +23 -0
  376. package/nodes/core/VarNode.js +3 -11
  377. package/nodes/core/VarNode.mjs +31 -0
  378. package/nodes/core/VaryNode.js +6 -15
  379. package/nodes/core/VaryNode.mjs +30 -0
  380. package/nodes/core/constants.js +20 -7
  381. package/nodes/core/constants.mjs +24 -0
  382. package/nodes/display/ColorSpaceNode.js +34 -38
  383. package/nodes/display/ColorSpaceNode.mjs +63 -0
  384. package/nodes/display/NormalMapNode.js +35 -53
  385. package/nodes/display/NormalMapNode.mjs +54 -0
  386. package/nodes/fog/FogNode.js +5 -9
  387. package/nodes/fog/FogNode.mjs +15 -0
  388. package/nodes/fog/FogRangeNode.js +5 -9
  389. package/nodes/fog/FogRangeNode.mjs +17 -0
  390. package/nodes/functions/BSDFs.js +61 -118
  391. package/nodes/functions/BSDFs.mjs +64 -0
  392. package/nodes/lights/LightContextNode.js +14 -23
  393. package/nodes/lights/LightContextNode.mjs +35 -0
  394. package/nodes/lights/LightNode.js +27 -31
  395. package/nodes/lights/LightNode.mjs +58 -0
  396. package/nodes/lights/LightsNode.js +9 -28
  397. package/nodes/lights/LightsNode.mjs +59 -0
  398. package/nodes/loaders/NodeLoader.js +27 -42
  399. package/nodes/loaders/NodeLoader.mjs +66 -0
  400. package/nodes/loaders/NodeMaterialLoader.js +4 -10
  401. package/nodes/loaders/NodeMaterialLoader.mjs +24 -0
  402. package/nodes/loaders/NodeObjectLoader.js +9 -19
  403. package/nodes/loaders/NodeObjectLoader.mjs +40 -0
  404. package/nodes/materials/LineBasicNodeMaterial.js +5 -10
  405. package/nodes/materials/LineBasicNodeMaterial.mjs +27 -0
  406. package/nodes/materials/Materials.js +14 -17
  407. package/nodes/materials/Materials.mjs +28 -0
  408. package/nodes/materials/MeshBasicNodeMaterial.js +5 -10
  409. package/nodes/materials/MeshBasicNodeMaterial.mjs +28 -0
  410. package/nodes/materials/MeshStandardNodeMaterial.js +5 -8
  411. package/nodes/materials/MeshStandardNodeMaterial.mjs +41 -0
  412. package/nodes/materials/NodeMaterial.js +20 -36
  413. package/nodes/materials/NodeMaterial.mjs +64 -0
  414. package/nodes/materials/PointsNodeMaterial.js +5 -10
  415. package/nodes/materials/PointsNodeMaterial.mjs +30 -0
  416. package/nodes/math/CondNode.js +11 -23
  417. package/nodes/math/CondNode.mjs +38 -0
  418. package/nodes/math/MathNode.js +98 -142
  419. package/nodes/math/MathNode.mjs +163 -0
  420. package/nodes/math/OperatorNode.js +24 -46
  421. package/nodes/math/OperatorNode.mjs +103 -0
  422. package/nodes/procedural/CheckerNode.js +13 -19
  423. package/nodes/procedural/CheckerNode.mjs +21 -0
  424. package/nodes/utils/ArrayElementNode.js +4 -8
  425. package/nodes/utils/ArrayElementNode.mjs +19 -0
  426. package/nodes/utils/ConvertNode.js +3 -8
  427. package/nodes/utils/ConvertNode.mjs +25 -0
  428. package/nodes/utils/JoinNode.js +7 -11
  429. package/nodes/utils/JoinNode.mjs +26 -0
  430. package/nodes/utils/MatcapUVNode.js +8 -11
  431. package/nodes/utils/MatcapUVNode.mjs +16 -0
  432. package/nodes/utils/OscNode.js +27 -33
  433. package/nodes/utils/OscNode.mjs +50 -0
  434. package/nodes/utils/SplitNode.js +6 -20
  435. package/nodes/utils/SplitNode.mjs +45 -0
  436. package/nodes/utils/SpriteSheetUVNode.js +23 -23
  437. package/nodes/utils/SpriteSheetUVNode.mjs +40 -0
  438. package/nodes/utils/TimerNode.js +20 -24
  439. package/nodes/utils/TimerNode.mjs +44 -0
  440. package/objects/GroundProjectedEnv.js +22 -37
  441. package/objects/GroundProjectedEnv.mjs +130 -0
  442. package/objects/Lensflare.js +86 -156
  443. package/objects/Lensflare.mjs +262 -0
  444. package/objects/LightningStorm.js +38 -102
  445. package/objects/LightningStorm.mjs +110 -0
  446. package/objects/MarchingCubes.js +150 -303
  447. package/objects/MarchingCubes.mjs +457 -0
  448. package/objects/Reflector.js +50 -72
  449. package/objects/Reflector.mjs +166 -0
  450. package/objects/ReflectorForSSRPass.js +80 -131
  451. package/objects/ReflectorForSSRPass.mjs +247 -0
  452. package/objects/ReflectorRTT.js +6 -7
  453. package/objects/ReflectorRTT.mjs +10 -0
  454. package/objects/Refractor.js +64 -106
  455. package/objects/Refractor.mjs +178 -0
  456. package/objects/ShadowMesh.js +8 -17
  457. package/objects/ShadowMesh.mjs +41 -0
  458. package/objects/Sky.js +119 -80
  459. package/objects/Sky.mjs +124 -0
  460. package/objects/Water.js +83 -127
  461. package/objects/Water.mjs +235 -0
  462. package/objects/Water2.js +72 -108
  463. package/objects/Water2.mjs +252 -0
  464. package/offscreen/jank.js +10 -14
  465. package/offscreen/jank.mjs +27 -0
  466. package/offscreen/offscreen.js +4 -5
  467. package/offscreen/offscreen.mjs +5 -0
  468. package/offscreen/scene.js +45 -48
  469. package/offscreen/scene.mjs +52 -0
  470. package/package.json +3 -3
  471. package/physics/AmmoPhysics.js +30 -71
  472. package/physics/AmmoPhysics.mjs +165 -0
  473. package/postprocessing/AdaptiveToneMappingPass.js +97 -123
  474. package/postprocessing/AdaptiveToneMappingPass.mjs +221 -0
  475. package/postprocessing/AfterimagePass.js +28 -49
  476. package/postprocessing/AfterimagePass.mjs +55 -0
  477. package/postprocessing/BloomPass.js +43 -69
  478. package/postprocessing/BloomPass.mjs +90 -0
  479. package/postprocessing/BokehPass.js +39 -69
  480. package/postprocessing/BokehPass.mjs +76 -0
  481. package/postprocessing/ClearPass.js +10 -25
  482. package/postprocessing/ClearPass.mjs +27 -0
  483. package/postprocessing/CubeTexturePass.js +28 -27
  484. package/postprocessing/CubeTexturePass.mjs +49 -0
  485. package/postprocessing/DotScreenPass.js +24 -32
  486. package/postprocessing/DotScreenPass.mjs +40 -0
  487. package/postprocessing/EffectComposer.js +39 -86
  488. package/postprocessing/EffectComposer.mjs +139 -0
  489. package/postprocessing/FilmPass.js +25 -30
  490. package/postprocessing/FilmPass.mjs +42 -0
  491. package/postprocessing/GlitchPass.js +38 -61
  492. package/postprocessing/GlitchPass.mjs +75 -0
  493. package/postprocessing/HalftonePass.js +19 -39
  494. package/postprocessing/HalftonePass.mjs +44 -0
  495. package/postprocessing/LUTPass.js +13 -38
  496. package/postprocessing/LUTPass.mjs +136 -0
  497. package/postprocessing/MaskPass.js +19 -38
  498. package/postprocessing/MaskPass.mjs +60 -0
  499. package/postprocessing/OutlinePass.js +135 -277
  500. package/postprocessing/OutlinePass.mjs +438 -0
  501. package/postprocessing/Pass.js +20 -44
  502. package/postprocessing/Pass.mjs +37 -0
  503. package/postprocessing/RenderPass.js +13 -36
  504. package/postprocessing/RenderPass.mjs +48 -0
  505. package/postprocessing/RenderPixelatedPass.js +44 -58
  506. package/postprocessing/RenderPixelatedPass.mjs +199 -0
  507. package/postprocessing/SAOPass.js +154 -189
  508. package/postprocessing/SAOPass.mjs +282 -0
  509. package/postprocessing/SMAAPass.js +64 -84
  510. package/postprocessing/SMAAPass.mjs +112 -0
  511. package/postprocessing/SSAARenderPass.js +121 -69
  512. package/postprocessing/SSAARenderPass.mjs +170 -0
  513. package/postprocessing/SSAOPass.js +123 -172
  514. package/postprocessing/SSAOPass.mjs +265 -0
  515. package/postprocessing/SSRPass.js +211 -280
  516. package/postprocessing/SSRPass.mjs +432 -0
  517. package/postprocessing/SavePass.js +20 -25
  518. package/postprocessing/SavePass.mjs +37 -0
  519. package/postprocessing/ShaderPass.js +14 -30
  520. package/postprocessing/ShaderPass.mjs +39 -0
  521. package/postprocessing/TAARenderPass.js +42 -61
  522. package/postprocessing/TAARenderPass.mjs +88 -0
  523. package/postprocessing/TexturePass.js +21 -22
  524. package/postprocessing/TexturePass.mjs +39 -0
  525. package/postprocessing/UnrealBloomPass.js +105 -213
  526. package/postprocessing/UnrealBloomPass.mjs +220 -0
  527. package/renderers/CSS2DRenderer.js +44 -56
  528. package/renderers/CSS2DRenderer.mjs +112 -0
  529. package/renderers/CSS3DRenderer.js +53 -86
  530. package/renderers/CSS3DRenderer.mjs +133 -0
  531. package/renderers/Projector.js +107 -274
  532. package/renderers/Projector.mjs +511 -0
  533. package/renderers/SVGRenderer.js +72 -182
  534. package/renderers/SVGRenderer.mjs +306 -0
  535. package/renderers/nodes/accessors/CameraNode.js +29 -40
  536. package/renderers/nodes/accessors/CameraNode.mjs +63 -0
  537. package/renderers/nodes/accessors/ModelNode.js +28 -37
  538. package/renderers/nodes/accessors/ModelNode.mjs +61 -0
  539. package/renderers/nodes/accessors/ModelViewProjectionNode.js +10 -23
  540. package/renderers/nodes/accessors/ModelViewProjectionNode.mjs +21 -0
  541. package/renderers/nodes/accessors/NormalNode.js +35 -45
  542. package/renderers/nodes/accessors/NormalNode.mjs +61 -0
  543. package/renderers/nodes/accessors/PositionNode.js +18 -19
  544. package/renderers/nodes/accessors/PositionNode.mjs +30 -0
  545. package/renderers/nodes/accessors/UVNode.js +5 -10
  546. package/renderers/nodes/accessors/UVNode.mjs +13 -0
  547. package/renderers/nodes/core/AttributeNode.js +5 -14
  548. package/renderers/nodes/core/AttributeNode.mjs +35 -0
  549. package/renderers/nodes/core/InputNode.js +4 -14
  550. package/renderers/nodes/core/InputNode.mjs +31 -0
  551. package/renderers/nodes/core/Node.js +7 -17
  552. package/renderers/nodes/core/Node.mjs +34 -0
  553. package/renderers/nodes/core/NodeAttribute.js +3 -6
  554. package/renderers/nodes/core/NodeAttribute.mjs +10 -0
  555. package/renderers/nodes/core/NodeBuilder.js +87 -154
  556. package/renderers/nodes/core/NodeBuilder.mjs +243 -0
  557. package/renderers/nodes/core/NodeFrame.js +9 -12
  558. package/renderers/nodes/core/NodeFrame.mjs +35 -0
  559. package/renderers/nodes/core/NodeSlot.js +2 -3
  560. package/renderers/nodes/core/NodeSlot.mjs +10 -0
  561. package/renderers/nodes/core/NodeUniform.js +4 -9
  562. package/renderers/nodes/core/NodeUniform.mjs +18 -0
  563. package/renderers/nodes/core/NodeVary.js +4 -7
  564. package/renderers/nodes/core/NodeVary.mjs +11 -0
  565. package/renderers/nodes/core/VaryNode.js +6 -12
  566. package/renderers/nodes/core/VaryNode.mjs +22 -0
  567. package/renderers/nodes/core/constants.js +16 -13
  568. package/renderers/nodes/core/constants.mjs +22 -0
  569. package/renderers/nodes/inputs/ColorNode.js +5 -11
  570. package/renderers/nodes/inputs/ColorNode.mjs +11 -0
  571. package/renderers/nodes/inputs/FloatNode.js +5 -11
  572. package/renderers/nodes/inputs/FloatNode.mjs +11 -0
  573. package/renderers/nodes/inputs/Matrix3Node.js +7 -13
  574. package/renderers/nodes/inputs/Matrix3Node.mjs +12 -0
  575. package/renderers/nodes/inputs/Matrix4Node.js +7 -13
  576. package/renderers/nodes/inputs/Matrix4Node.mjs +12 -0
  577. package/renderers/nodes/inputs/TextureNode.js +7 -15
  578. package/renderers/nodes/inputs/TextureNode.mjs +20 -0
  579. package/renderers/nodes/inputs/Vector2Node.js +5 -11
  580. package/renderers/nodes/inputs/Vector2Node.mjs +11 -0
  581. package/renderers/nodes/inputs/Vector3Node.js +7 -13
  582. package/renderers/nodes/inputs/Vector3Node.mjs +12 -0
  583. package/renderers/nodes/inputs/Vector4Node.js +7 -13
  584. package/renderers/nodes/inputs/Vector4Node.mjs +12 -0
  585. package/renderers/nodes/math/MathNode.js +20 -30
  586. package/renderers/nodes/math/MathNode.mjs +55 -0
  587. package/renderers/nodes/math/OperatorNode.js +4 -20
  588. package/renderers/nodes/math/OperatorNode.mjs +42 -0
  589. package/renderers/nodes/utils/SwitchNode.js +4 -9
  590. package/renderers/nodes/utils/SwitchNode.mjs +20 -0
  591. package/renderers/nodes/utils/TimerNode.js +5 -10
  592. package/renderers/nodes/utils/TimerNode.mjs +14 -0
  593. package/renderers/webgpu/WebGPU.js +14 -16
  594. package/renderers/webgpu/WebGPU.mjs +24 -0
  595. package/renderers/webgpu/WebGPUAttributes.js +16 -23
  596. package/renderers/webgpu/WebGPUAttributes.mjs +69 -0
  597. package/renderers/webgpu/WebGPUBackground.js +13 -30
  598. package/renderers/webgpu/WebGPUBackground.mjs +61 -0
  599. package/renderers/webgpu/WebGPUBinding.js +4 -7
  600. package/renderers/webgpu/WebGPUBinding.mjs +14 -0
  601. package/renderers/webgpu/WebGPUBindings.js +21 -57
  602. package/renderers/webgpu/WebGPUBindings.mjs +155 -0
  603. package/renderers/webgpu/WebGPUComputePipelines.js +14 -25
  604. package/renderers/webgpu/WebGPUComputePipelines.mjs +44 -0
  605. package/renderers/webgpu/WebGPUGeometries.js +5 -15
  606. package/renderers/webgpu/WebGPUGeometries.mjs +41 -0
  607. package/renderers/webgpu/WebGPUInfo.js +3 -8
  608. package/renderers/webgpu/WebGPUInfo.mjs +46 -0
  609. package/renderers/webgpu/WebGPUObjects.js +5 -10
  610. package/renderers/webgpu/WebGPUObjects.mjs +25 -0
  611. package/renderers/webgpu/WebGPUProperties.js +5 -11
  612. package/renderers/webgpu/WebGPUProperties.mjs +22 -0
  613. package/renderers/webgpu/WebGPURenderLists.js +20 -36
  614. package/renderers/webgpu/WebGPURenderLists.mjs +119 -0
  615. package/renderers/webgpu/WebGPURenderPipelines.js +260 -387
  616. package/renderers/webgpu/WebGPURenderPipelines.mjs +545 -0
  617. package/renderers/webgpu/WebGPURenderer.js +124 -262
  618. package/renderers/webgpu/WebGPURenderer.mjs +574 -0
  619. package/renderers/webgpu/WebGPUSampledTexture.js +18 -31
  620. package/renderers/webgpu/WebGPUSampledTexture.mjs +40 -0
  621. package/renderers/webgpu/WebGPUSampler.js +7 -12
  622. package/renderers/webgpu/WebGPUSampler.mjs +15 -0
  623. package/renderers/webgpu/WebGPUStorageBuffer.js +7 -12
  624. package/renderers/webgpu/WebGPUStorageBuffer.mjs +15 -0
  625. package/renderers/webgpu/WebGPUTextureRenderer.js +5 -11
  626. package/renderers/webgpu/WebGPUTextureRenderer.mjs +23 -0
  627. package/renderers/webgpu/WebGPUTextureUtils.js +29 -40
  628. package/renderers/webgpu/WebGPUTextureUtils.mjs +98 -0
  629. package/renderers/webgpu/WebGPUTextures.js +186 -333
  630. package/renderers/webgpu/WebGPUTextures.mjs +484 -0
  631. package/renderers/webgpu/WebGPUUniform.js +25 -51
  632. package/renderers/webgpu/WebGPUUniform.mjs +81 -0
  633. package/renderers/webgpu/WebGPUUniformsGroup.js +32 -72
  634. package/renderers/webgpu/WebGPUUniformsGroup.mjs +176 -0
  635. package/renderers/webgpu/constants.js +190 -181
  636. package/renderers/webgpu/constants.mjs +230 -0
  637. package/renderers/webgpu/nodes/ShaderLib.js +2 -2
  638. package/renderers/webgpu/nodes/ShaderLib.mjs +42 -0
  639. package/renderers/webgpu/nodes/WebGPUNodeBuilder.js +53 -124
  640. package/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +165 -0
  641. package/renderers/webgpu/nodes/WebGPUNodeUniform.js +17 -31
  642. package/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +73 -0
  643. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +8 -9
  644. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +15 -0
  645. package/renderers/webgpu/nodes/WebGPUNodes.js +7 -45
  646. package/renderers/webgpu/nodes/WebGPUNodes.mjs +40 -0
  647. package/shaders/ACESFilmicToneMappingShader.js +44 -24
  648. package/shaders/ACESFilmicToneMappingShader.mjs +48 -0
  649. package/shaders/AfterimageShader.js +28 -18
  650. package/shaders/AfterimageShader.mjs +32 -0
  651. package/shaders/BasicShader.js +9 -7
  652. package/shaders/BasicShader.mjs +12 -0
  653. package/shaders/BleachBypassShader.js +31 -15
  654. package/shaders/BleachBypassShader.mjs +35 -0
  655. package/shaders/BlendShader.js +26 -19
  656. package/shaders/BlendShader.mjs +30 -0
  657. package/shaders/BokehShader.js +98 -36
  658. package/shaders/BokehShader.mjs +106 -0
  659. package/shaders/BokehShader2.js +261 -90
  660. package/shaders/BokehShader2.mjs +269 -0
  661. package/shaders/BrightnessContrastShader.js +28 -19
  662. package/shaders/BrightnessContrastShader.mjs +32 -0
  663. package/shaders/ColorCorrectionShader.js +26 -22
  664. package/shaders/ColorCorrectionShader.mjs +30 -0
  665. package/shaders/ColorifyShader.js +24 -16
  666. package/shaders/ColorifyShader.mjs +28 -0
  667. package/shaders/ConvolutionShader.js +40 -36
  668. package/shaders/ConvolutionShader.mjs +55 -0
  669. package/shaders/CopyShader.js +21 -13
  670. package/shaders/CopyShader.mjs +25 -0
  671. package/shaders/DOFMipMapShader.js +28 -21
  672. package/shaders/DOFMipMapShader.mjs +32 -0
  673. package/shaders/DepthLimitedBlurShader.js +85 -40
  674. package/shaders/DepthLimitedBlurShader.mjs +114 -0
  675. package/shaders/DigitalGlitch.js +74 -46
  676. package/shaders/DigitalGlitch.mjs +78 -0
  677. package/shaders/DotScreenShader.js +35 -27
  678. package/shaders/DotScreenShader.mjs +39 -0
  679. package/shaders/FXAAShader.js +1094 -19
  680. package/shaders/FXAAShader.mjs +1098 -0
  681. package/shaders/FilmShader.js +38 -52
  682. package/shaders/FilmShader.mjs +42 -0
  683. package/shaders/FocusShader.js +51 -24
  684. package/shaders/FocusShader.mjs +55 -0
  685. package/shaders/FreiChenShader.js +57 -24
  686. package/shaders/FreiChenShader.mjs +61 -0
  687. package/shaders/FresnelShader.js +43 -22
  688. package/shaders/FresnelShader.mjs +47 -0
  689. package/shaders/GammaCorrectionShader.js +19 -11
  690. package/shaders/GammaCorrectionShader.mjs +23 -0
  691. package/shaders/GodRaysShader.js +103 -94
  692. package/shaders/GodRaysShader.mjs +146 -0
  693. package/shaders/HalftoneShader.js +208 -65
  694. package/shaders/HalftoneShader.mjs +212 -0
  695. package/shaders/HorizontalBlurShader.js +7 -23
  696. package/shaders/HorizontalBlurShader.mjs +43 -0
  697. package/shaders/HorizontalTiltShiftShader.js +33 -21
  698. package/shaders/HorizontalTiltShiftShader.mjs +37 -0
  699. package/shaders/HueSaturationShader.js +37 -21
  700. package/shaders/HueSaturationShader.mjs +41 -0
  701. package/shaders/KaleidoShader.js +30 -22
  702. package/shaders/KaleidoShader.mjs +34 -0
  703. package/shaders/LuminosityHighPassShader.js +33 -27
  704. package/shaders/LuminosityHighPassShader.mjs +37 -0
  705. package/shaders/LuminosityShader.js +21 -11
  706. package/shaders/LuminosityShader.mjs +25 -0
  707. package/shaders/MirrorShader.js +31 -16
  708. package/shaders/MirrorShader.mjs +35 -0
  709. package/shaders/NormalMapShader.js +27 -23
  710. package/shaders/NormalMapShader.mjs +31 -0
  711. package/shaders/ParallaxShader.js +107 -48
  712. package/shaders/ParallaxShader.mjs +113 -0
  713. package/shaders/PixelShader.js +24 -16
  714. package/shaders/PixelShader.mjs +28 -0
  715. package/shaders/RGBShiftShader.js +26 -22
  716. package/shaders/RGBShiftShader.mjs +30 -0
  717. package/shaders/SAOShader.js +132 -48
  718. package/shaders/SAOShader.mjs +144 -0
  719. package/shaders/SMAAShader.js +256 -135
  720. package/shaders/SMAAShader.mjs +272 -0
  721. package/shaders/SSAOShader.js +153 -81
  722. package/shaders/SSAOShader.mjs +172 -0
  723. package/shaders/SSRShader.js +32 -87
  724. package/shaders/SSRShader.mjs +324 -0
  725. package/shaders/SepiaShader.js +25 -15
  726. package/shaders/SepiaShader.mjs +29 -0
  727. package/shaders/SobelOperatorShader.js +40 -29
  728. package/shaders/SobelOperatorShader.mjs +44 -0
  729. package/shaders/SubsurfaceScatteringShader.js +53 -39
  730. package/shaders/SubsurfaceScatteringShader.mjs +59 -0
  731. package/shaders/TechnicolorShader.js +20 -13
  732. package/shaders/TechnicolorShader.mjs +24 -0
  733. package/shaders/ToneMapShader.js +44 -28
  734. package/shaders/ToneMapShader.mjs +48 -0
  735. package/shaders/ToonShader.js +172 -96
  736. package/shaders/ToonShader.mjs +188 -0
  737. package/shaders/TriangleBlurShader.js +32 -23
  738. package/shaders/TriangleBlurShader.mjs +36 -0
  739. package/shaders/UnpackDepthRGBAShader.js +22 -14
  740. package/shaders/UnpackDepthRGBAShader.mjs +26 -0
  741. package/shaders/VerticalBlurShader.js +7 -23
  742. package/shaders/VerticalBlurShader.mjs +44 -0
  743. package/shaders/VerticalTiltShiftShader.js +33 -21
  744. package/shaders/VerticalTiltShiftShader.mjs +37 -0
  745. package/shaders/VignetteShader.js +24 -28
  746. package/shaders/VignetteShader.mjs +28 -0
  747. package/shaders/VolumeShader.js +174 -77
  748. package/shaders/VolumeShader.mjs +178 -0
  749. package/shaders/WaterRefractionShader.js +38 -6
  750. package/shaders/WaterRefractionShader.mjs +57 -0
  751. package/shaders/types.js +1 -1
  752. package/{custom.d.js → shaders/types.mjs} +0 -0
  753. package/textures/FlakesTexture.js +8 -10
  754. package/textures/FlakesTexture.mjs +30 -0
  755. package/types/helpers.js +3 -2
  756. package/types/helpers.mjs +4 -0
  757. package/utils/BufferGeometryUtils.js +251 -325
  758. package/utils/BufferGeometryUtils.mjs +570 -0
  759. package/utils/GeometryCompressionUtils.js +241 -239
  760. package/utils/GeometryCompressionUtils.mjs +547 -0
  761. package/utils/GeometryUtils.js +41 -94
  762. package/utils/GeometryUtils.mjs +108 -0
  763. package/utils/RoughnessMipmapper.js +38 -82
  764. package/utils/RoughnessMipmapper.mjs +213 -0
  765. package/utils/SceneUtils.js +15 -20
  766. package/utils/SceneUtils.mjs +36 -0
  767. package/utils/ShadowMapViewer.js +49 -95
  768. package/utils/ShadowMapViewer.mjs +114 -0
  769. package/utils/SkeletonUtils.js +74 -165
  770. package/utils/SkeletonUtils.mjs +292 -0
  771. package/utils/UVsDebug.js +32 -62
  772. package/utils/UVsDebug.mjs +85 -0
  773. package/utils/WorkerPool.js +13 -33
  774. package/utils/WorkerPool.mjs +62 -0
  775. package/webxr/ARButton.js +72 -98
  776. package/webxr/ARButton.mjs +119 -0
  777. package/webxr/OculusHandModel.js +18 -37
  778. package/webxr/OculusHandModel.mjs +71 -0
  779. package/webxr/OculusHandPointerModel.js +58 -80
  780. package/webxr/OculusHandPointerModel.mjs +207 -0
  781. package/webxr/Text2D.js +37 -19
  782. package/webxr/Text2D.mjs +31 -0
  783. package/webxr/VRButton.js +59 -90
  784. package/webxr/VRButton.mjs +105 -0
  785. package/webxr/XRControllerModelFactory.js +58 -116
  786. package/webxr/XRControllerModelFactory.mjs +146 -0
  787. package/webxr/XREstimatedLight.js +39 -66
  788. package/webxr/XREstimatedLight.mjs +126 -0
  789. package/webxr/XRHandMeshModel.js +40 -29
  790. package/webxr/XRHandMeshModel.mjs +73 -0
  791. package/webxr/XRHandModelFactory.js +28 -31
  792. package/webxr/XRHandModelFactory.mjs +61 -0
  793. package/webxr/XRHandPrimitiveModel.js +41 -27
  794. package/webxr/XRHandPrimitiveModel.mjs +68 -0
  795. package/BufferGeometryUtils-1a7a235c.js +0 -655
  796. package/BufferGeometryUtils-971dfde3.js +0 -1
  797. package/Nodes-4f766d71.js +0 -471
  798. package/Nodes-9aa16d74.js +0 -1
  799. package/animation/AnimationClipCreator.cjs.js +0 -1
  800. package/animation/CCDIKSolver.cjs.js +0 -1
  801. package/animation/MMDAnimationHelper.cjs.js +0 -1
  802. package/animation/MMDPhysics.cjs.js +0 -1
  803. package/cameras/CinematicCamera.cjs.js +0 -1
  804. package/controls/ArcballControls.cjs.js +0 -1
  805. package/controls/DeviceOrientationControls.cjs.js +0 -1
  806. package/controls/DragControls.cjs.js +0 -1
  807. package/controls/FirstPersonControls.cjs.js +0 -1
  808. package/controls/FlyControls.cjs.js +0 -1
  809. package/controls/OrbitControls.cjs.js +0 -1
  810. package/controls/PointerLockControls.cjs.js +0 -1
  811. package/controls/TrackballControls.cjs.js +0 -1
  812. package/controls/TransformControls.cjs.js +0 -1
  813. package/controls/experimental/CameraControls.cjs.js +0 -1
  814. package/csm/CSM.cjs.js +0 -1
  815. package/csm/CSMFrustum.cjs.js +0 -1
  816. package/csm/CSMHelper.cjs.js +0 -1
  817. package/csm/CSMShader.cjs.js +0 -1
  818. package/curves/CurveExtras.cjs.js +0 -1
  819. package/curves/NURBSCurve.cjs.js +0 -1
  820. package/curves/NURBSSurface.cjs.js +0 -1
  821. package/curves/NURBSUtils.cjs.js +0 -1
  822. package/custom.d.cjs.js +0 -1
  823. package/deprecated/Geometry.cjs.js +0 -1
  824. package/effects/AnaglyphEffect.cjs.js +0 -1
  825. package/effects/AsciiEffect.cjs.js +0 -1
  826. package/effects/OutlineEffect.cjs.js +0 -1
  827. package/effects/ParallaxBarrierEffect.cjs.js +0 -1
  828. package/effects/PeppersGhostEffect.cjs.js +0 -1
  829. package/effects/StereoEffect.cjs.js +0 -1
  830. package/environments/RoomEnvironment.cjs.js +0 -1
  831. package/exporters/ColladaExporter.cjs.js +0 -1
  832. package/exporters/DRACOExporter.cjs.js +0 -1
  833. package/exporters/GLTFExporter.cjs.js +0 -1
  834. package/exporters/MMDExporter.cjs.js +0 -1
  835. package/exporters/OBJExporter.cjs.js +0 -1
  836. package/exporters/PLYExporter.cjs.js +0 -1
  837. package/exporters/STLExporter.cjs.js +0 -1
  838. package/exporters/USDZExporter.cjs.js +0 -1
  839. package/geometries/BoxLineGeometry.cjs.js +0 -1
  840. package/geometries/ConvexGeometry.cjs.js +0 -1
  841. package/geometries/DecalGeometry.cjs.js +0 -1
  842. package/geometries/LightningStrike.cjs.js +0 -1
  843. package/geometries/ParametricGeometries.cjs.js +0 -1
  844. package/geometries/ParametricGeometry.cjs.js +0 -1
  845. package/geometries/RoundedBoxGeometry.cjs.js +0 -1
  846. package/geometries/TeapotGeometry.cjs.js +0 -1
  847. package/geometries/TextGeometry.cjs.js +0 -1
  848. package/helpers/LightProbeHelper.cjs.js +0 -1
  849. package/helpers/PositionalAudioHelper.cjs.js +0 -1
  850. package/helpers/RectAreaLightHelper.cjs.js +0 -1
  851. package/helpers/VertexNormalsHelper.cjs.js +0 -1
  852. package/helpers/VertexTangentsHelper.cjs.js +0 -1
  853. package/index.cjs.js +0 -1
  854. package/interactive/InteractiveGroup.cjs.js +0 -1
  855. package/interactive/InteractiveGroup.d.ts +0 -5
  856. package/interactive/InteractiveGroup.js +0 -87
  857. package/interactive/SelectionBox.cjs.js +0 -1
  858. package/interactive/SelectionHelper.cjs.js +0 -1
  859. package/libs/MeshoptDecoder.cjs.js +0 -1
  860. package/libs/MotionControllers.cjs.js +0 -1
  861. package/lights/LightProbeGenerator.cjs.js +0 -1
  862. package/lights/RectAreaLightUniformsLib.cjs.js +0 -1
  863. package/lines/Line2.cjs.js +0 -1
  864. package/lines/LineGeometry.cjs.js +0 -1
  865. package/lines/LineMaterial.cjs.js +0 -1
  866. package/lines/LineSegments2.cjs.js +0 -1
  867. package/lines/LineSegmentsGeometry.cjs.js +0 -1
  868. package/lines/Wireframe.cjs.js +0 -1
  869. package/lines/WireframeGeometry2.cjs.js +0 -1
  870. package/loaders/3DMLoader.cjs.js +0 -1
  871. package/loaders/3MFLoader.cjs.js +0 -1
  872. package/loaders/AMFLoader.cjs.js +0 -1
  873. package/loaders/AssimpLoader.cjs.js +0 -1
  874. package/loaders/BVHLoader.cjs.js +0 -1
  875. package/loaders/BasisTextureLoader.cjs.js +0 -1
  876. package/loaders/ColladaLoader.cjs.js +0 -1
  877. package/loaders/DDSLoader.cjs.js +0 -1
  878. package/loaders/DRACOLoader.cjs.js +0 -1
  879. package/loaders/EXRLoader.cjs.js +0 -1
  880. package/loaders/FBXLoader.cjs.js +0 -1
  881. package/loaders/FontLoader.cjs.js +0 -1
  882. package/loaders/GCodeLoader.cjs.js +0 -1
  883. package/loaders/GLTFLoader.cjs.js +0 -1
  884. package/loaders/HDRCubeTextureLoader.cjs.js +0 -1
  885. package/loaders/KMZLoader.cjs.js +0 -1
  886. package/loaders/KTX2Loader.cjs.js +0 -1
  887. package/loaders/KTXLoader.cjs.js +0 -1
  888. package/loaders/LDrawLoader.cjs.js +0 -1
  889. package/loaders/LUT3dlLoader.cjs.js +0 -1
  890. package/loaders/LUTCubeLoader.cjs.js +0 -1
  891. package/loaders/LWOLoader.cjs.js +0 -1
  892. package/loaders/LottieLoader.cjs.js +0 -1
  893. package/loaders/MD2Loader.cjs.js +0 -1
  894. package/loaders/MDDLoader.cjs.js +0 -1
  895. package/loaders/MMDLoader.cjs.js +0 -1
  896. package/loaders/MTLLoader.cjs.js +0 -1
  897. package/loaders/NRRDLoader.cjs.js +0 -1
  898. package/loaders/NodeMaterialLoader.cjs.js +0 -1
  899. package/loaders/OBJLoader.cjs.js +0 -1
  900. package/loaders/PCDLoader.cjs.js +0 -1
  901. package/loaders/PDBLoader.cjs.js +0 -1
  902. package/loaders/PLYLoader.cjs.js +0 -1
  903. package/loaders/PRWMLoader.cjs.js +0 -1
  904. package/loaders/PVRLoader.cjs.js +0 -1
  905. package/loaders/RGBELoader.cjs.js +0 -1
  906. package/loaders/RGBMLoader.cjs.js +0 -1
  907. package/loaders/STLLoader.cjs.js +0 -1
  908. package/loaders/SVGLoader.cjs.js +0 -1
  909. package/loaders/TDSLoader.cjs.js +0 -1
  910. package/loaders/TGALoader.cjs.js +0 -1
  911. package/loaders/TTFLoader.cjs.js +0 -1
  912. package/loaders/TiltLoader.cjs.js +0 -1
  913. package/loaders/VOXLoader.cjs.js +0 -1
  914. package/loaders/VRMLLoader.cjs.js +0 -1
  915. package/loaders/VRMLoader.cjs.js +0 -1
  916. package/loaders/VTKLoader.cjs.js +0 -1
  917. package/loaders/XLoader.cjs.js +0 -1
  918. package/loaders/XYZLoader.cjs.js +0 -1
  919. package/loaders/lwo/IFFParser.cjs.js +0 -1
  920. package/loaders/lwo/LWO2Parser.cjs.js +0 -1
  921. package/loaders/lwo/LWO3Parser.cjs.js +0 -1
  922. package/math/Capsule.cjs.js +0 -1
  923. package/math/ColorConverter.cjs.js +0 -1
  924. package/math/ConvexHull.cjs.js +0 -1
  925. package/math/ImprovedNoise.cjs.js +0 -1
  926. package/math/Lut.cjs.js +0 -1
  927. package/math/MeshSurfaceSampler.cjs.js +0 -1
  928. package/math/OBB.cjs.js +0 -1
  929. package/math/Octree.cjs.js +0 -1
  930. package/math/SimplexNoise.cjs.js +0 -1
  931. package/misc/ConvexObjectBreaker.cjs.js +0 -1
  932. package/misc/GPUComputationRenderer.cjs.js +0 -1
  933. package/misc/Gyroscope.cjs.js +0 -1
  934. package/misc/MD2Character.cjs.js +0 -1
  935. package/misc/MD2CharacterComplex.cjs.js +0 -1
  936. package/misc/MorphAnimMesh.cjs.js +0 -1
  937. package/misc/MorphBlendMesh.cjs.js +0 -1
  938. package/misc/ProgressiveLightmap.cjs.js +0 -1
  939. package/misc/RollerCoaster.cjs.js +0 -1
  940. package/misc/TubePainter.cjs.js +0 -1
  941. package/misc/Volume.cjs.js +0 -1
  942. package/misc/VolumeSlice.cjs.js +0 -1
  943. package/misc/WebGL.cjs.js +0 -1
  944. package/modifiers/CurveModifier.cjs.js +0 -1
  945. package/modifiers/EdgeSplitModifier.cjs.js +0 -1
  946. package/modifiers/SimplifyModifier.cjs.js +0 -1
  947. package/modifiers/TessellateModifier.cjs.js +0 -1
  948. package/nodes/Nodes.cjs.js +0 -1
  949. package/nodes/ShaderNode.cjs.js +0 -1
  950. package/nodes/accessors/BufferNode.cjs.js +0 -1
  951. package/nodes/accessors/CameraNode.cjs.js +0 -1
  952. package/nodes/accessors/CubeTextureNode.cjs.js +0 -1
  953. package/nodes/accessors/MaterialNode.cjs.js +0 -1
  954. package/nodes/accessors/MaterialReferenceNode.cjs.js +0 -1
  955. package/nodes/accessors/ModelNode.cjs.js +0 -1
  956. package/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  957. package/nodes/accessors/NormalNode.cjs.js +0 -1
  958. package/nodes/accessors/Object3DNode.cjs.js +0 -1
  959. package/nodes/accessors/PointUVNode.cjs.js +0 -1
  960. package/nodes/accessors/PositionNode.cjs.js +0 -1
  961. package/nodes/accessors/ReferenceNode.cjs.js +0 -1
  962. package/nodes/accessors/ReflectNode.cjs.js +0 -1
  963. package/nodes/accessors/SkinningNode.cjs.js +0 -1
  964. package/nodes/accessors/TextureNode.cjs.js +0 -1
  965. package/nodes/accessors/UVNode.cjs.js +0 -1
  966. package/nodes/core/ArrayUniformNode.cjs.js +0 -1
  967. package/nodes/core/AttributeNode.cjs.js +0 -1
  968. package/nodes/core/BypassNode.cjs.js +0 -1
  969. package/nodes/core/CodeNode.cjs.js +0 -1
  970. package/nodes/core/ConstNode.cjs.js +0 -1
  971. package/nodes/core/ContextNode.cjs.js +0 -1
  972. package/nodes/core/ExpressionNode.cjs.js +0 -1
  973. package/nodes/core/FunctionCallNode.cjs.js +0 -1
  974. package/nodes/core/FunctionNode.cjs.js +0 -1
  975. package/nodes/core/InputNode.cjs.js +0 -1
  976. package/nodes/core/Node.cjs.js +0 -1
  977. package/nodes/core/NodeAttribute.cjs.js +0 -1
  978. package/nodes/core/NodeBuilder.cjs.js +0 -1
  979. package/nodes/core/NodeCode.cjs.js +0 -1
  980. package/nodes/core/NodeFrame.cjs.js +0 -1
  981. package/nodes/core/NodeFunction.cjs.js +0 -1
  982. package/nodes/core/NodeFunction.js +0 -17
  983. package/nodes/core/NodeFunctionInput.cjs.js +0 -1
  984. package/nodes/core/NodeKeywords.cjs.js +0 -1
  985. package/nodes/core/NodeParser.cjs.js +0 -1
  986. package/nodes/core/NodeParser.js +0 -8
  987. package/nodes/core/NodeUniform.cjs.js +0 -1
  988. package/nodes/core/NodeUtils.cjs.js +0 -1
  989. package/nodes/core/NodeVar.cjs.js +0 -1
  990. package/nodes/core/NodeVary.cjs.js +0 -1
  991. package/nodes/core/PropertyNode.cjs.js +0 -1
  992. package/nodes/core/TempNode.cjs.js +0 -1
  993. package/nodes/core/UniformNode.cjs.js +0 -1
  994. package/nodes/core/VarNode.cjs.js +0 -1
  995. package/nodes/core/VaryNode.cjs.js +0 -1
  996. package/nodes/core/constants.cjs.js +0 -1
  997. package/nodes/display/ColorSpaceNode.cjs.js +0 -1
  998. package/nodes/display/NormalMapNode.cjs.js +0 -1
  999. package/nodes/fog/FogNode.cjs.js +0 -1
  1000. package/nodes/fog/FogRangeNode.cjs.js +0 -1
  1001. package/nodes/functions/BSDFs.cjs.js +0 -1
  1002. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +0 -1
  1003. package/nodes/functions/PhysicalMaterialFunctions.js +0 -57
  1004. package/nodes/lights/LightContextNode.cjs.js +0 -1
  1005. package/nodes/lights/LightNode.cjs.js +0 -1
  1006. package/nodes/lights/LightsNode.cjs.js +0 -1
  1007. package/nodes/loaders/NodeLoader.cjs.js +0 -1
  1008. package/nodes/loaders/NodeMaterialLoader.cjs.js +0 -1
  1009. package/nodes/loaders/NodeObjectLoader.cjs.js +0 -1
  1010. package/nodes/materials/LineBasicNodeMaterial.cjs.js +0 -1
  1011. package/nodes/materials/Materials.cjs.js +0 -1
  1012. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +0 -1
  1013. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +0 -1
  1014. package/nodes/materials/NodeMaterial.cjs.js +0 -1
  1015. package/nodes/materials/PointsNodeMaterial.cjs.js +0 -1
  1016. package/nodes/math/CondNode.cjs.js +0 -1
  1017. package/nodes/math/MathNode.cjs.js +0 -1
  1018. package/nodes/math/OperatorNode.cjs.js +0 -1
  1019. package/nodes/parsers/GLSLNodeFunction.cjs.js +0 -1
  1020. package/nodes/parsers/GLSLNodeFunction.js +0 -101
  1021. package/nodes/parsers/GLSLNodeParser.cjs.js +0 -1
  1022. package/nodes/parsers/GLSLNodeParser.js +0 -13
  1023. package/nodes/parsers/WGSLNodeFunction.cjs.js +0 -1
  1024. package/nodes/parsers/WGSLNodeFunction.js +0 -71
  1025. package/nodes/parsers/WGSLNodeParser.cjs.js +0 -1
  1026. package/nodes/parsers/WGSLNodeParser.js +0 -13
  1027. package/nodes/procedural/CheckerNode.cjs.js +0 -1
  1028. package/nodes/utils/ArrayElementNode.cjs.js +0 -1
  1029. package/nodes/utils/ConvertNode.cjs.js +0 -1
  1030. package/nodes/utils/JoinNode.cjs.js +0 -1
  1031. package/nodes/utils/MatcapUVNode.cjs.js +0 -1
  1032. package/nodes/utils/OscNode.cjs.js +0 -1
  1033. package/nodes/utils/SplitNode.cjs.js +0 -1
  1034. package/nodes/utils/SpriteSheetUVNode.cjs.js +0 -1
  1035. package/nodes/utils/TimerNode.cjs.js +0 -1
  1036. package/objects/GroundProjectedEnv.cjs.js +0 -1
  1037. package/objects/Lensflare.cjs.js +0 -1
  1038. package/objects/LightningStorm.cjs.js +0 -1
  1039. package/objects/MarchingCubes.cjs.js +0 -1
  1040. package/objects/Reflector.cjs.js +0 -1
  1041. package/objects/ReflectorForSSRPass.cjs.js +0 -1
  1042. package/objects/ReflectorRTT.cjs.js +0 -1
  1043. package/objects/Refractor.cjs.js +0 -1
  1044. package/objects/ShadowMesh.cjs.js +0 -1
  1045. package/objects/Sky.cjs.js +0 -1
  1046. package/objects/Water.cjs.js +0 -1
  1047. package/objects/Water2.cjs.js +0 -1
  1048. package/offscreen/jank.cjs.js +0 -1
  1049. package/offscreen/offscreen.cjs.js +0 -1
  1050. package/offscreen/scene.cjs.js +0 -1
  1051. package/physics/AmmoPhysics.cjs.js +0 -1
  1052. package/postprocessing/AdaptiveToneMappingPass.cjs.js +0 -1
  1053. package/postprocessing/AfterimagePass.cjs.js +0 -1
  1054. package/postprocessing/BloomPass.cjs.js +0 -1
  1055. package/postprocessing/BokehPass.cjs.js +0 -1
  1056. package/postprocessing/ClearPass.cjs.js +0 -1
  1057. package/postprocessing/CubeTexturePass.cjs.js +0 -1
  1058. package/postprocessing/DotScreenPass.cjs.js +0 -1
  1059. package/postprocessing/EffectComposer.cjs.js +0 -1
  1060. package/postprocessing/FilmPass.cjs.js +0 -1
  1061. package/postprocessing/GlitchPass.cjs.js +0 -1
  1062. package/postprocessing/HalftonePass.cjs.js +0 -1
  1063. package/postprocessing/LUTPass.cjs.js +0 -1
  1064. package/postprocessing/MaskPass.cjs.js +0 -1
  1065. package/postprocessing/OutlinePass.cjs.js +0 -1
  1066. package/postprocessing/Pass.cjs.js +0 -1
  1067. package/postprocessing/RenderPass.cjs.js +0 -1
  1068. package/postprocessing/RenderPixelatedPass.cjs.js +0 -1
  1069. package/postprocessing/SAOPass.cjs.js +0 -1
  1070. package/postprocessing/SMAAPass.cjs.js +0 -1
  1071. package/postprocessing/SSAARenderPass.cjs.js +0 -1
  1072. package/postprocessing/SSAOPass.cjs.js +0 -1
  1073. package/postprocessing/SSRPass.cjs.js +0 -1
  1074. package/postprocessing/SavePass.cjs.js +0 -1
  1075. package/postprocessing/ShaderPass.cjs.js +0 -1
  1076. package/postprocessing/TAARenderPass.cjs.js +0 -1
  1077. package/postprocessing/TexturePass.cjs.js +0 -1
  1078. package/postprocessing/UnrealBloomPass.cjs.js +0 -1
  1079. package/renderers/CSS2DRenderer.cjs.js +0 -1
  1080. package/renderers/CSS3DRenderer.cjs.js +0 -1
  1081. package/renderers/Projector.cjs.js +0 -1
  1082. package/renderers/SVGRenderer.cjs.js +0 -1
  1083. package/renderers/nodes/accessors/CameraNode.cjs.js +0 -1
  1084. package/renderers/nodes/accessors/ModelNode.cjs.js +0 -1
  1085. package/renderers/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  1086. package/renderers/nodes/accessors/NormalNode.cjs.js +0 -1
  1087. package/renderers/nodes/accessors/PositionNode.cjs.js +0 -1
  1088. package/renderers/nodes/accessors/UVNode.cjs.js +0 -1
  1089. package/renderers/nodes/core/AttributeNode.cjs.js +0 -1
  1090. package/renderers/nodes/core/InputNode.cjs.js +0 -1
  1091. package/renderers/nodes/core/Node.cjs.js +0 -1
  1092. package/renderers/nodes/core/NodeAttribute.cjs.js +0 -1
  1093. package/renderers/nodes/core/NodeBuilder.cjs.js +0 -1
  1094. package/renderers/nodes/core/NodeFrame.cjs.js +0 -1
  1095. package/renderers/nodes/core/NodeSlot.cjs.js +0 -1
  1096. package/renderers/nodes/core/NodeUniform.cjs.js +0 -1
  1097. package/renderers/nodes/core/NodeVary.cjs.js +0 -1
  1098. package/renderers/nodes/core/VaryNode.cjs.js +0 -1
  1099. package/renderers/nodes/core/constants.cjs.js +0 -1
  1100. package/renderers/nodes/inputs/ColorNode.cjs.js +0 -1
  1101. package/renderers/nodes/inputs/FloatNode.cjs.js +0 -1
  1102. package/renderers/nodes/inputs/Matrix3Node.cjs.js +0 -1
  1103. package/renderers/nodes/inputs/Matrix4Node.cjs.js +0 -1
  1104. package/renderers/nodes/inputs/TextureNode.cjs.js +0 -1
  1105. package/renderers/nodes/inputs/Vector2Node.cjs.js +0 -1
  1106. package/renderers/nodes/inputs/Vector3Node.cjs.js +0 -1
  1107. package/renderers/nodes/inputs/Vector4Node.cjs.js +0 -1
  1108. package/renderers/nodes/math/MathNode.cjs.js +0 -1
  1109. package/renderers/nodes/math/OperatorNode.cjs.js +0 -1
  1110. package/renderers/nodes/utils/SwitchNode.cjs.js +0 -1
  1111. package/renderers/nodes/utils/TimerNode.cjs.js +0 -1
  1112. package/renderers/webgpu/WebGPU.cjs.js +0 -1
  1113. package/renderers/webgpu/WebGPUAttributes.cjs.js +0 -1
  1114. package/renderers/webgpu/WebGPUBackground.cjs.js +0 -1
  1115. package/renderers/webgpu/WebGPUBinding.cjs.js +0 -1
  1116. package/renderers/webgpu/WebGPUBindings.cjs.js +0 -1
  1117. package/renderers/webgpu/WebGPUComputePipelines.cjs.js +0 -1
  1118. package/renderers/webgpu/WebGPUGeometries.cjs.js +0 -1
  1119. package/renderers/webgpu/WebGPUInfo.cjs.js +0 -1
  1120. package/renderers/webgpu/WebGPUObjects.cjs.js +0 -1
  1121. package/renderers/webgpu/WebGPUProperties.cjs.js +0 -1
  1122. package/renderers/webgpu/WebGPURenderLists.cjs.js +0 -1
  1123. package/renderers/webgpu/WebGPURenderPipelines.cjs.js +0 -1
  1124. package/renderers/webgpu/WebGPURenderer.cjs.js +0 -1
  1125. package/renderers/webgpu/WebGPUSampledTexture.cjs.js +0 -1
  1126. package/renderers/webgpu/WebGPUSampler.cjs.js +0 -1
  1127. package/renderers/webgpu/WebGPUStorageBuffer.cjs.js +0 -1
  1128. package/renderers/webgpu/WebGPUTextureRenderer.cjs.js +0 -1
  1129. package/renderers/webgpu/WebGPUTextureUtils.cjs.js +0 -1
  1130. package/renderers/webgpu/WebGPUTextures.cjs.js +0 -1
  1131. package/renderers/webgpu/WebGPUUniform.cjs.js +0 -1
  1132. package/renderers/webgpu/WebGPUUniformsGroup.cjs.js +0 -1
  1133. package/renderers/webgpu/constants.cjs.js +0 -1
  1134. package/renderers/webgpu/nodes/ShaderLib.cjs.js +0 -1
  1135. package/renderers/webgpu/nodes/WebGPUNodeBuilder.cjs.js +0 -1
  1136. package/renderers/webgpu/nodes/WebGPUNodeUniform.cjs.js +0 -1
  1137. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.cjs.js +0 -1
  1138. package/renderers/webgpu/nodes/WebGPUNodes.cjs.js +0 -1
  1139. package/shaders/ACESFilmicToneMappingShader.cjs.js +0 -1
  1140. package/shaders/AfterimageShader.cjs.js +0 -1
  1141. package/shaders/BasicShader.cjs.js +0 -1
  1142. package/shaders/BleachBypassShader.cjs.js +0 -1
  1143. package/shaders/BlendShader.cjs.js +0 -1
  1144. package/shaders/BokehShader.cjs.js +0 -1
  1145. package/shaders/BokehShader2.cjs.js +0 -1
  1146. package/shaders/BrightnessContrastShader.cjs.js +0 -1
  1147. package/shaders/ColorCorrectionShader.cjs.js +0 -1
  1148. package/shaders/ColorifyShader.cjs.js +0 -1
  1149. package/shaders/ConvolutionShader.cjs.js +0 -1
  1150. package/shaders/CopyShader.cjs.js +0 -1
  1151. package/shaders/DOFMipMapShader.cjs.js +0 -1
  1152. package/shaders/DepthLimitedBlurShader.cjs.js +0 -1
  1153. package/shaders/DigitalGlitch.cjs.js +0 -1
  1154. package/shaders/DotScreenShader.cjs.js +0 -1
  1155. package/shaders/FXAAShader.cjs.js +0 -1
  1156. package/shaders/FilmShader.cjs.js +0 -1
  1157. package/shaders/FocusShader.cjs.js +0 -1
  1158. package/shaders/FreiChenShader.cjs.js +0 -1
  1159. package/shaders/FresnelShader.cjs.js +0 -1
  1160. package/shaders/GammaCorrectionShader.cjs.js +0 -1
  1161. package/shaders/GodRaysShader.cjs.js +0 -1
  1162. package/shaders/HalftoneShader.cjs.js +0 -1
  1163. package/shaders/HorizontalBlurShader.cjs.js +0 -1
  1164. package/shaders/HorizontalTiltShiftShader.cjs.js +0 -1
  1165. package/shaders/HueSaturationShader.cjs.js +0 -1
  1166. package/shaders/KaleidoShader.cjs.js +0 -1
  1167. package/shaders/LuminosityHighPassShader.cjs.js +0 -1
  1168. package/shaders/LuminosityShader.cjs.js +0 -1
  1169. package/shaders/MirrorShader.cjs.js +0 -1
  1170. package/shaders/NormalMapShader.cjs.js +0 -1
  1171. package/shaders/ParallaxShader.cjs.js +0 -1
  1172. package/shaders/PixelShader.cjs.js +0 -1
  1173. package/shaders/RGBShiftShader.cjs.js +0 -1
  1174. package/shaders/SAOShader.cjs.js +0 -1
  1175. package/shaders/SMAAShader.cjs.js +0 -1
  1176. package/shaders/SSAOShader.cjs.js +0 -1
  1177. package/shaders/SSRShader.cjs.js +0 -1
  1178. package/shaders/SepiaShader.cjs.js +0 -1
  1179. package/shaders/SobelOperatorShader.cjs.js +0 -1
  1180. package/shaders/SubsurfaceScatteringShader.cjs.js +0 -1
  1181. package/shaders/TechnicolorShader.cjs.js +0 -1
  1182. package/shaders/ToneMapShader.cjs.js +0 -1
  1183. package/shaders/ToonShader.cjs.js +0 -1
  1184. package/shaders/TriangleBlurShader.cjs.js +0 -1
  1185. package/shaders/UnpackDepthRGBAShader.cjs.js +0 -1
  1186. package/shaders/VerticalBlurShader.cjs.js +0 -1
  1187. package/shaders/VerticalTiltShiftShader.cjs.js +0 -1
  1188. package/shaders/VignetteShader.cjs.js +0 -1
  1189. package/shaders/VolumeShader.cjs.js +0 -1
  1190. package/shaders/WaterRefractionShader.cjs.js +0 -1
  1191. package/shaders/index.cjs.js +0 -1
  1192. package/shaders/index.d.ts +0 -54
  1193. package/shaders/index.js +0 -53
  1194. package/shaders/types.cjs.js +0 -1
  1195. package/textures/FlakesTexture.cjs.js +0 -1
  1196. package/types/helpers.cjs.js +0 -1
  1197. package/types/shared.cjs.js +0 -1
  1198. package/types/shared.js +0 -1
  1199. package/types/utils.cjs.js +0 -1
  1200. package/types/utils.js +0 -1
  1201. package/utils/BufferGeometryUtils.cjs.js +0 -1
  1202. package/utils/GeometryCompressionUtils.cjs.js +0 -1
  1203. package/utils/GeometryUtils.cjs.js +0 -1
  1204. package/utils/LDrawUtils.cjs.js +0 -1
  1205. package/utils/LDrawUtils.d.ts +0 -5
  1206. package/utils/LDrawUtils.js +0 -144
  1207. package/utils/RoughnessMipmapper.cjs.js +0 -1
  1208. package/utils/SceneUtils.cjs.js +0 -1
  1209. package/utils/ShadowMapViewer.cjs.js +0 -1
  1210. package/utils/SkeletonUtils.cjs.js +0 -1
  1211. package/utils/UVsDebug.cjs.js +0 -1
  1212. package/utils/WorkerPool.cjs.js +0 -1
  1213. package/webxr/ARButton.cjs.js +0 -1
  1214. package/webxr/OculusHandModel.cjs.js +0 -1
  1215. package/webxr/OculusHandPointerModel.cjs.js +0 -1
  1216. package/webxr/Text2D.cjs.js +0 -1
  1217. package/webxr/VRButton.cjs.js +0 -1
  1218. package/webxr/XRControllerModelFactory.cjs.js +0 -1
  1219. package/webxr/XREstimatedLight.cjs.js +0 -1
  1220. package/webxr/XRHandMeshModel.cjs.js +0 -1
  1221. package/webxr/XRHandModelFactory.cjs.js +0 -1
  1222. package/webxr/XRHandPrimitiveModel.cjs.js +0 -1
@@ -0,0 +1,166 @@
1
+ import { Scene, WebGLRenderTarget, FloatType, MeshPhongMaterial, MeshBasicMaterial, DoubleSide, PlaneGeometry, Mesh } from "three";
2
+ import potpack from "potpack";
3
+ class ProgressiveLightMap {
4
+ constructor(renderer, res = 1024) {
5
+ this.renderer = renderer;
6
+ this.res = res;
7
+ this.lightMapContainers = [];
8
+ this.compiled = false;
9
+ this.scene = new Scene();
10
+ this.scene.background = null;
11
+ this.tinyTarget = new WebGLRenderTarget(1, 1);
12
+ this.buffer1Active = false;
13
+ this.firstUpdate = true;
14
+ this.warned = false;
15
+ const format = /(Android|iPad|iPhone|iPod)/g.test(navigator.userAgent) ? alfFloatType : FloatType;
16
+ this.progressiveLightMap1 = new WebGLRenderTarget(this.res, this.res, { type: format });
17
+ this.progressiveLightMap2 = new WebGLRenderTarget(this.res, this.res, { type: format });
18
+ this.uvMat = new MeshPhongMaterial();
19
+ this.uvMat.uniforms = {};
20
+ this.uvMat.onBeforeCompile = (shader) => {
21
+ shader.vertexShader = "#define USE_LIGHTMAP\n" + shader.vertexShader.slice(0, -1) + " gl_Position = vec4((uv2 - 0.5) * 2.0, 1.0, 1.0); }";
22
+ const bodyStart = shader.fragmentShader.indexOf("void main() {");
23
+ shader.fragmentShader = "varying vec2 vUv2;\n" + shader.fragmentShader.slice(0, bodyStart) + " uniform sampler2D previousShadowMap;\n uniform float averagingWindow;\n" + shader.fragmentShader.slice(bodyStart - 1, -1) + `
24
+ vec3 texelOld = texture2D(previousShadowMap, vUv2).rgb;
25
+ gl_FragColor.rgb = mix(texelOld, gl_FragColor.rgb, 1.0/averagingWindow);
26
+ }`;
27
+ shader.uniforms.previousShadowMap = { value: this.progressiveLightMap1.texture };
28
+ shader.uniforms.averagingWindow = { value: 100 };
29
+ this.uvMat.uniforms = shader.uniforms;
30
+ this.uvMat.userData.shader = shader;
31
+ this.compiled = true;
32
+ };
33
+ }
34
+ addObjectsToLightMap(objects) {
35
+ this.uv_boxes = [];
36
+ const padding = 3 / this.res;
37
+ for (let ob = 0; ob < objects.length; ob++) {
38
+ const object = objects[ob];
39
+ if (object.isLight) {
40
+ this.scene.attach(object);
41
+ continue;
42
+ }
43
+ if (!object.geometry.hasAttribute("uv")) {
44
+ console.warn("All lightmap objects need UVs!");
45
+ continue;
46
+ }
47
+ if (this.blurringPlane == null) {
48
+ this._initializeBlurPlane(this.res, this.progressiveLightMap1);
49
+ }
50
+ object.material.lightMap = this.progressiveLightMap2.texture;
51
+ object.material.dithering = true;
52
+ object.castShadow = true;
53
+ object.receiveShadow = true;
54
+ object.renderOrder = 1e3 + ob;
55
+ this.uv_boxes.push({ w: 1 + padding * 2, h: 1 + padding * 2, index: ob });
56
+ this.lightMapContainers.push({ basicMat: object.material, object });
57
+ this.compiled = false;
58
+ }
59
+ const dimensions = potpack(this.uv_boxes);
60
+ this.uv_boxes.forEach((box) => {
61
+ const uv2 = objects[box.index].geometry.getAttribute("uv").clone();
62
+ for (let i = 0; i < uv2.array.length; i += uv2.itemSize) {
63
+ uv2.array[i] = (uv2.array[i] + box.x + padding) / dimensions.w;
64
+ uv2.array[i + 1] = (uv2.array[i + 1] + box.y + padding) / dimensions.h;
65
+ }
66
+ objects[box.index].geometry.setAttribute("uv2", uv2);
67
+ objects[box.index].geometry.getAttribute("uv2").needsUpdate = true;
68
+ });
69
+ }
70
+ update(camera, blendWindow = 100, blurEdges = true) {
71
+ if (this.blurringPlane == null) {
72
+ return;
73
+ }
74
+ const oldTarget = this.renderer.getRenderTarget();
75
+ this.blurringPlane.visible = blurEdges;
76
+ for (let l = 0; l < this.lightMapContainers.length; l++) {
77
+ this.lightMapContainers[l].object.oldScene = this.lightMapContainers[l].object.parent;
78
+ this.scene.attach(this.lightMapContainers[l].object);
79
+ }
80
+ if (this.firstUpdate) {
81
+ this.renderer.setRenderTarget(this.tinyTarget);
82
+ this.renderer.render(this.scene, camera);
83
+ this.firstUpdate = false;
84
+ }
85
+ for (let l = 0; l < this.lightMapContainers.length; l++) {
86
+ this.uvMat.uniforms.averagingWindow = { value: blendWindow };
87
+ this.lightMapContainers[l].object.material = this.uvMat;
88
+ this.lightMapContainers[l].object.oldFrustumCulled = this.lightMapContainers[l].object.frustumCulled;
89
+ this.lightMapContainers[l].object.frustumCulled = false;
90
+ }
91
+ const activeMap = this.buffer1Active ? this.progressiveLightMap1 : this.progressiveLightMap2;
92
+ const inactiveMap = this.buffer1Active ? this.progressiveLightMap2 : this.progressiveLightMap1;
93
+ this.renderer.setRenderTarget(activeMap);
94
+ this.uvMat.uniforms.previousShadowMap = { value: inactiveMap.texture };
95
+ this.blurringPlane.material.uniforms.previousShadowMap = { value: inactiveMap.texture };
96
+ this.buffer1Active = !this.buffer1Active;
97
+ this.renderer.render(this.scene, camera);
98
+ for (let l = 0; l < this.lightMapContainers.length; l++) {
99
+ this.lightMapContainers[l].object.frustumCulled = this.lightMapContainers[l].object.oldFrustumCulled;
100
+ this.lightMapContainers[l].object.material = this.lightMapContainers[l].basicMat;
101
+ this.lightMapContainers[l].object.oldScene.attach(this.lightMapContainers[l].object);
102
+ }
103
+ this.renderer.setRenderTarget(oldTarget);
104
+ }
105
+ showDebugLightmap(visible, position = void 0) {
106
+ if (this.lightMapContainers.length == 0) {
107
+ if (!this.warned) {
108
+ console.warn("Call this after adding the objects!");
109
+ this.warned = true;
110
+ }
111
+ return;
112
+ }
113
+ if (this.labelMesh == null) {
114
+ this.labelMaterial = new MeshBasicMaterial({
115
+ map: this.progressiveLightMap1.texture,
116
+ side: DoubleSide
117
+ });
118
+ this.labelPlane = new PlaneGeometry(100, 100);
119
+ this.labelMesh = new Mesh(this.labelPlane, this.labelMaterial);
120
+ this.labelMesh.position.y = 250;
121
+ this.lightMapContainers[0].object.parent.add(this.labelMesh);
122
+ }
123
+ if (position != void 0) {
124
+ this.labelMesh.position.copy(position);
125
+ }
126
+ this.labelMesh.visible = visible;
127
+ }
128
+ _initializeBlurPlane(res, lightMap = null) {
129
+ const blurMaterial = new MeshBasicMaterial();
130
+ blurMaterial.uniforms = {
131
+ previousShadowMap: { value: null },
132
+ pixelOffset: { value: 1 / res },
133
+ polygonOffset: true,
134
+ polygonOffsetFactor: -1,
135
+ polygonOffsetUnits: 3
136
+ };
137
+ blurMaterial.onBeforeCompile = (shader) => {
138
+ shader.vertexShader = "#define USE_UV\n" + shader.vertexShader.slice(0, -1) + " gl_Position = vec4((uv - 0.5) * 2.0, 1.0, 1.0); }";
139
+ const bodyStart = shader.fragmentShader.indexOf("void main() {");
140
+ shader.fragmentShader = "#define USE_UV\n" + shader.fragmentShader.slice(0, bodyStart) + " uniform sampler2D previousShadowMap;\n uniform float pixelOffset;\n" + shader.fragmentShader.slice(bodyStart - 1, -1) + ` gl_FragColor.rgb = (
141
+ texture2D(previousShadowMap, vUv + vec2( pixelOffset, 0.0 )).rgb +
142
+ texture2D(previousShadowMap, vUv + vec2( 0.0 , pixelOffset)).rgb +
143
+ texture2D(previousShadowMap, vUv + vec2( 0.0 , -pixelOffset)).rgb +
144
+ texture2D(previousShadowMap, vUv + vec2(-pixelOffset, 0.0 )).rgb +
145
+ texture2D(previousShadowMap, vUv + vec2( pixelOffset, pixelOffset)).rgb +
146
+ texture2D(previousShadowMap, vUv + vec2(-pixelOffset, pixelOffset)).rgb +
147
+ texture2D(previousShadowMap, vUv + vec2( pixelOffset, -pixelOffset)).rgb +
148
+ texture2D(previousShadowMap, vUv + vec2(-pixelOffset, -pixelOffset)).rgb)/8.0;
149
+ }`;
150
+ shader.uniforms.previousShadowMap = { value: lightMap.texture };
151
+ shader.uniforms.pixelOffset = { value: 0.5 / res };
152
+ blurMaterial.uniforms = shader.uniforms;
153
+ blurMaterial.userData.shader = shader;
154
+ this.compiled = true;
155
+ };
156
+ this.blurringPlane = new Mesh(new PlaneGeometry(1, 1), blurMaterial);
157
+ this.blurringPlane.name = "Blurring Plane";
158
+ this.blurringPlane.frustumCulled = false;
159
+ this.blurringPlane.renderOrder = 0;
160
+ this.blurringPlane.material.depthWrite = false;
161
+ this.scene.add(this.blurringPlane);
162
+ }
163
+ }
164
+ export {
165
+ ProgressiveLightMap
166
+ };
@@ -1,46 +1,47 @@
1
- import { BufferGeometry, Vector3, Quaternion, BufferAttribute, Raycaster } from 'three';
2
-
3
- var RollerCoasterGeometry = function (curve, divisions) {
4
- BufferGeometry.call(this);
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const THREE = require("three");
4
+ var RollerCoasterGeometry = function(curve, divisions) {
5
+ THREE.BufferGeometry.call(this);
5
6
  var vertices = [];
6
7
  var normals = [];
7
8
  var colors = [];
8
9
  var color1 = [1, 1, 1];
9
10
  var color2 = [1, 1, 0];
10
- var up = new Vector3(0, 1, 0);
11
- var forward = new Vector3();
12
- var right = new Vector3();
13
- var quaternion = new Quaternion();
14
- var prevQuaternion = new Quaternion();
11
+ var up = new THREE.Vector3(0, 1, 0);
12
+ var forward = new THREE.Vector3();
13
+ var right = new THREE.Vector3();
14
+ var quaternion = new THREE.Quaternion();
15
+ var prevQuaternion = new THREE.Quaternion();
15
16
  prevQuaternion.setFromAxisAngle(up, Math.PI / 2);
16
- var point = new Vector3();
17
- var prevPoint = new Vector3();
18
- prevPoint.copy(curve.getPointAt(0)); // shapes
19
-
20
- var step = [new Vector3(-0.225, 0, 0), new Vector3(0, -0.05, 0), new Vector3(0, -0.175, 0), new Vector3(0, -0.05, 0), new Vector3(0.225, 0, 0), new Vector3(0, -0.175, 0)];
17
+ var point = new THREE.Vector3();
18
+ var prevPoint = new THREE.Vector3();
19
+ prevPoint.copy(curve.getPointAt(0));
20
+ var step = [
21
+ new THREE.Vector3(-0.225, 0, 0),
22
+ new THREE.Vector3(0, -0.05, 0),
23
+ new THREE.Vector3(0, -0.175, 0),
24
+ new THREE.Vector3(0, -0.05, 0),
25
+ new THREE.Vector3(0.225, 0, 0),
26
+ new THREE.Vector3(0, -0.175, 0)
27
+ ];
21
28
  var PI2 = Math.PI * 2;
22
29
  var sides = 5;
23
30
  var tube1 = [];
24
-
25
31
  for (let i = 0; i < sides; i++) {
26
32
  var angle = i / sides * PI2;
27
- tube1.push(new Vector3(Math.sin(angle) * 0.06, Math.cos(angle) * 0.06, 0));
33
+ tube1.push(new THREE.Vector3(Math.sin(angle) * 0.06, Math.cos(angle) * 0.06, 0));
28
34
  }
29
-
30
35
  var sides = 6;
31
36
  var tube2 = [];
32
-
33
37
  for (let i = 0; i < sides; i++) {
34
38
  var angle = i / sides * PI2;
35
- tube2.push(new Vector3(Math.sin(angle) * 0.025, Math.cos(angle) * 0.025, 0));
39
+ tube2.push(new THREE.Vector3(Math.sin(angle) * 0.025, Math.cos(angle) * 0.025, 0));
36
40
  }
37
-
38
- var vector = new Vector3();
39
- var normal = new Vector3();
40
-
41
+ var vector = new THREE.Vector3();
42
+ var normal = new THREE.Vector3();
41
43
  function drawShape(shape, color) {
42
44
  normal.set(0, 0, -1).applyQuaternion(quaternion);
43
-
44
45
  for (let j = 0; j < shape.length; j++) {
45
46
  vector.copy(shape[j]);
46
47
  vector.applyQuaternion(quaternion);
@@ -49,9 +50,7 @@ var RollerCoasterGeometry = function (curve, divisions) {
49
50
  normals.push(normal.x, normal.y, normal.z);
50
51
  colors.push(color[0], color[1], color[2]);
51
52
  }
52
-
53
53
  normal.set(0, 0, 1).applyQuaternion(quaternion);
54
-
55
54
  for (let j = shape.length - 1; j >= 0; j--) {
56
55
  vector.copy(shape[j]);
57
56
  vector.applyQuaternion(quaternion);
@@ -61,30 +60,28 @@ var RollerCoasterGeometry = function (curve, divisions) {
61
60
  colors.push(color[0], color[1], color[2]);
62
61
  }
63
62
  }
64
-
65
- var vector1 = new Vector3();
66
- var vector2 = new Vector3();
67
- var vector3 = new Vector3();
68
- var vector4 = new Vector3();
69
- var normal1 = new Vector3();
70
- var normal2 = new Vector3();
71
- var normal3 = new Vector3();
72
- var normal4 = new Vector3();
73
-
74
- function extrudeShape(shape, offset, color) {
63
+ var vector1 = new THREE.Vector3();
64
+ var vector2 = new THREE.Vector3();
65
+ var vector3 = new THREE.Vector3();
66
+ var vector4 = new THREE.Vector3();
67
+ var normal1 = new THREE.Vector3();
68
+ var normal2 = new THREE.Vector3();
69
+ var normal3 = new THREE.Vector3();
70
+ var normal4 = new THREE.Vector3();
71
+ function extrudeShape(shape, offset2, color) {
75
72
  for (let j = 0, jl = shape.length; j < jl; j++) {
76
73
  var point1 = shape[j];
77
74
  var point2 = shape[(j + 1) % jl];
78
- vector1.copy(point1).add(offset);
75
+ vector1.copy(point1).add(offset2);
79
76
  vector1.applyQuaternion(quaternion);
80
77
  vector1.add(point);
81
- vector2.copy(point2).add(offset);
78
+ vector2.copy(point2).add(offset2);
82
79
  vector2.applyQuaternion(quaternion);
83
80
  vector2.add(point);
84
- vector3.copy(point2).add(offset);
81
+ vector3.copy(point2).add(offset2);
85
82
  vector3.applyQuaternion(prevQuaternion);
86
83
  vector3.add(prevPoint);
87
- vector4.copy(point1).add(offset);
84
+ vector4.copy(point1).add(offset2);
88
85
  vector4.applyQuaternion(prevQuaternion);
89
86
  vector4.add(prevPoint);
90
87
  vertices.push(vector1.x, vector1.y, vector1.z);
@@ -92,8 +89,7 @@ var RollerCoasterGeometry = function (curve, divisions) {
92
89
  vertices.push(vector4.x, vector4.y, vector4.z);
93
90
  vertices.push(vector2.x, vector2.y, vector2.z);
94
91
  vertices.push(vector3.x, vector3.y, vector3.z);
95
- vertices.push(vector4.x, vector4.y, vector4.z); //
96
-
92
+ vertices.push(vector4.x, vector4.y, vector4.z);
97
93
  normal1.copy(point1);
98
94
  normal1.applyQuaternion(quaternion);
99
95
  normal1.normalize();
@@ -120,9 +116,7 @@ var RollerCoasterGeometry = function (curve, divisions) {
120
116
  colors.push(color[0], color[1], color[2]);
121
117
  }
122
118
  }
123
-
124
- var offset = new Vector3();
125
-
119
+ var offset = new THREE.Vector3();
126
120
  for (let i = 1; i <= divisions; i++) {
127
121
  point.copy(curve.getPointAt(i / divisions));
128
122
  up.set(0, 1, 0);
@@ -131,70 +125,61 @@ var RollerCoasterGeometry = function (curve, divisions) {
131
125
  up.crossVectors(forward, right);
132
126
  var angle = Math.atan2(forward.x, forward.z);
133
127
  quaternion.setFromAxisAngle(up, angle);
134
-
135
128
  if (i % 2 === 0) {
136
129
  drawShape(step, color2);
137
130
  }
138
-
139
131
  extrudeShape(tube1, offset.set(0, -0.125, 0), color2);
140
132
  extrudeShape(tube2, offset.set(0.2, 0, 0), color1);
141
133
  extrudeShape(tube2, offset.set(-0.2, 0, 0), color1);
142
134
  prevPoint.copy(point);
143
135
  prevQuaternion.copy(quaternion);
144
- } // console.log( vertices.length );
145
-
146
-
147
- this.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
148
- this.setAttribute('normal', new BufferAttribute(new Float32Array(normals), 3));
149
- this.setAttribute('color', new BufferAttribute(new Float32Array(colors), 3));
136
+ }
137
+ this.setAttribute("position", new THREE.BufferAttribute(new Float32Array(vertices), 3));
138
+ this.setAttribute("normal", new THREE.BufferAttribute(new Float32Array(normals), 3));
139
+ this.setAttribute("color", new THREE.BufferAttribute(new Float32Array(colors), 3));
150
140
  };
151
-
152
- RollerCoasterGeometry.prototype = Object.create(BufferGeometry.prototype);
153
-
154
- var RollerCoasterLiftersGeometry = function (curve, divisions) {
155
- BufferGeometry.call(this);
141
+ RollerCoasterGeometry.prototype = Object.create(THREE.BufferGeometry.prototype);
142
+ var RollerCoasterLiftersGeometry = function(curve, divisions) {
143
+ THREE.BufferGeometry.call(this);
156
144
  var vertices = [];
157
145
  var normals = [];
158
- var quaternion = new Quaternion();
159
- var up = new Vector3(0, 1, 0);
160
- var point = new Vector3();
161
- var tangent = new Vector3(); // shapes
162
-
163
- var tube1 = [new Vector3(0, 0.05, -0.05), new Vector3(0, 0.05, 0.05), new Vector3(0, -0.05, 0)];
164
- var tube2 = [new Vector3(-0.05, 0, 0.05), new Vector3(-0.05, 0, -0.05), new Vector3(0.05, 0, 0)];
165
- var tube3 = [new Vector3(0.05, 0, -0.05), new Vector3(0.05, 0, 0.05), new Vector3(-0.05, 0, 0)];
166
- var vector1 = new Vector3();
167
- var vector2 = new Vector3();
168
- var vector3 = new Vector3();
169
- var vector4 = new Vector3();
170
- var normal1 = new Vector3();
171
- var normal2 = new Vector3();
172
- var normal3 = new Vector3();
173
- var normal4 = new Vector3();
174
-
175
- function extrudeShape(shape, fromPoint, toPoint) {
146
+ var quaternion = new THREE.Quaternion();
147
+ var up = new THREE.Vector3(0, 1, 0);
148
+ var point = new THREE.Vector3();
149
+ var tangent = new THREE.Vector3();
150
+ var tube1 = [new THREE.Vector3(0, 0.05, -0.05), new THREE.Vector3(0, 0.05, 0.05), new THREE.Vector3(0, -0.05, 0)];
151
+ var tube2 = [new THREE.Vector3(-0.05, 0, 0.05), new THREE.Vector3(-0.05, 0, -0.05), new THREE.Vector3(0.05, 0, 0)];
152
+ var tube3 = [new THREE.Vector3(0.05, 0, -0.05), new THREE.Vector3(0.05, 0, 0.05), new THREE.Vector3(-0.05, 0, 0)];
153
+ var vector1 = new THREE.Vector3();
154
+ var vector2 = new THREE.Vector3();
155
+ var vector3 = new THREE.Vector3();
156
+ var vector4 = new THREE.Vector3();
157
+ var normal1 = new THREE.Vector3();
158
+ var normal2 = new THREE.Vector3();
159
+ var normal3 = new THREE.Vector3();
160
+ var normal4 = new THREE.Vector3();
161
+ function extrudeShape(shape, fromPoint2, toPoint2) {
176
162
  for (let j = 0, jl = shape.length; j < jl; j++) {
177
163
  var point1 = shape[j];
178
164
  var point2 = shape[(j + 1) % jl];
179
165
  vector1.copy(point1);
180
166
  vector1.applyQuaternion(quaternion);
181
- vector1.add(fromPoint);
167
+ vector1.add(fromPoint2);
182
168
  vector2.copy(point2);
183
169
  vector2.applyQuaternion(quaternion);
184
- vector2.add(fromPoint);
170
+ vector2.add(fromPoint2);
185
171
  vector3.copy(point2);
186
172
  vector3.applyQuaternion(quaternion);
187
- vector3.add(toPoint);
173
+ vector3.add(toPoint2);
188
174
  vector4.copy(point1);
189
175
  vector4.applyQuaternion(quaternion);
190
- vector4.add(toPoint);
176
+ vector4.add(toPoint2);
191
177
  vertices.push(vector1.x, vector1.y, vector1.z);
192
178
  vertices.push(vector2.x, vector2.y, vector2.z);
193
179
  vertices.push(vector4.x, vector4.y, vector4.z);
194
180
  vertices.push(vector2.x, vector2.y, vector2.z);
195
181
  vertices.push(vector3.x, vector3.y, vector3.z);
196
- vertices.push(vector4.x, vector4.y, vector4.z); //
197
-
182
+ vertices.push(vector4.x, vector4.y, vector4.z);
198
183
  normal1.copy(point1);
199
184
  normal1.applyQuaternion(quaternion);
200
185
  normal1.normalize();
@@ -215,16 +200,13 @@ var RollerCoasterLiftersGeometry = function (curve, divisions) {
215
200
  normals.push(normal4.x, normal4.y, normal4.z);
216
201
  }
217
202
  }
218
-
219
- var fromPoint = new Vector3();
220
- var toPoint = new Vector3();
221
-
203
+ var fromPoint = new THREE.Vector3();
204
+ var toPoint = new THREE.Vector3();
222
205
  for (let i = 1; i <= divisions; i++) {
223
206
  point.copy(curve.getPointAt(i / divisions));
224
207
  tangent.copy(curve.getTangentAt(i / divisions));
225
208
  var angle = Math.atan2(tangent.x, tangent.z);
226
- quaternion.setFromAxisAngle(up, angle); //
227
-
209
+ quaternion.setFromAxisAngle(up, angle);
228
210
  if (point.y > 10) {
229
211
  fromPoint.set(-0.75, -0.35, 0);
230
212
  fromPoint.applyQuaternion(quaternion);
@@ -257,30 +239,26 @@ var RollerCoasterLiftersGeometry = function (curve, divisions) {
257
239
  extrudeShape(tube3, fromPoint, toPoint);
258
240
  }
259
241
  }
260
-
261
- this.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
262
- this.setAttribute('normal', new BufferAttribute(new Float32Array(normals), 3));
242
+ this.setAttribute("position", new THREE.BufferAttribute(new Float32Array(vertices), 3));
243
+ this.setAttribute("normal", new THREE.BufferAttribute(new Float32Array(normals), 3));
263
244
  };
264
-
265
- RollerCoasterLiftersGeometry.prototype = Object.create(BufferGeometry.prototype);
266
-
267
- var RollerCoasterShadowGeometry = function (curve, divisions) {
268
- BufferGeometry.call(this);
245
+ RollerCoasterLiftersGeometry.prototype = Object.create(THREE.BufferGeometry.prototype);
246
+ var RollerCoasterShadowGeometry = function(curve, divisions) {
247
+ THREE.BufferGeometry.call(this);
269
248
  var vertices = [];
270
- var up = new Vector3(0, 1, 0);
271
- var forward = new Vector3();
272
- var quaternion = new Quaternion();
273
- var prevQuaternion = new Quaternion();
249
+ var up = new THREE.Vector3(0, 1, 0);
250
+ var forward = new THREE.Vector3();
251
+ var quaternion = new THREE.Quaternion();
252
+ var prevQuaternion = new THREE.Quaternion();
274
253
  prevQuaternion.setFromAxisAngle(up, Math.PI / 2);
275
- var point = new Vector3();
276
- var prevPoint = new Vector3();
254
+ var point = new THREE.Vector3();
255
+ var prevPoint = new THREE.Vector3();
277
256
  prevPoint.copy(curve.getPointAt(0));
278
257
  prevPoint.y = 0;
279
- var vector1 = new Vector3();
280
- var vector2 = new Vector3();
281
- var vector3 = new Vector3();
282
- var vector4 = new Vector3();
283
-
258
+ var vector1 = new THREE.Vector3();
259
+ var vector2 = new THREE.Vector3();
260
+ var vector3 = new THREE.Vector3();
261
+ var vector4 = new THREE.Vector3();
284
262
  for (let i = 1; i <= divisions; i++) {
285
263
  point.copy(curve.getPointAt(i / divisions));
286
264
  point.y = 0;
@@ -308,16 +286,12 @@ var RollerCoasterShadowGeometry = function (curve, divisions) {
308
286
  prevPoint.copy(point);
309
287
  prevQuaternion.copy(quaternion);
310
288
  }
311
-
312
- this.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
289
+ this.setAttribute("position", new THREE.BufferAttribute(new Float32Array(vertices), 3));
313
290
  };
314
-
315
- RollerCoasterShadowGeometry.prototype = Object.create(BufferGeometry.prototype);
316
-
317
- var SkyGeometry = function () {
318
- BufferGeometry.call(this);
291
+ RollerCoasterShadowGeometry.prototype = Object.create(THREE.BufferGeometry.prototype);
292
+ var SkyGeometry = function() {
293
+ THREE.BufferGeometry.call(this);
319
294
  var vertices = [];
320
-
321
295
  for (let i = 0; i < 100; i++) {
322
296
  var x = Math.random() * 800 - 400;
323
297
  var y = Math.random() * 50 + 50;
@@ -330,25 +304,22 @@ var SkyGeometry = function () {
330
304
  vertices.push(x + size, y, z + size);
331
305
  vertices.push(x - size, y, z + size);
332
306
  }
333
-
334
- this.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
307
+ this.setAttribute("position", new THREE.BufferAttribute(new Float32Array(vertices), 3));
335
308
  };
336
-
337
- SkyGeometry.prototype = Object.create(BufferGeometry.prototype);
338
-
339
- var TreesGeometry = function (landscape) {
340
- BufferGeometry.call(this);
309
+ SkyGeometry.prototype = Object.create(THREE.BufferGeometry.prototype);
310
+ var TreesGeometry = function(landscape) {
311
+ THREE.BufferGeometry.call(this);
341
312
  var vertices = [];
342
313
  var colors = [];
343
- var raycaster = new Raycaster();
314
+ var raycaster = new THREE.Raycaster();
344
315
  raycaster.ray.direction.set(0, -1, 0);
345
-
346
- for (let i = 0; i < 2000; i++) {
316
+ for (let i = 0; i < 2e3; i++) {
347
317
  var x = Math.random() * 500 - 250;
348
318
  var z = Math.random() * 500 - 250;
349
319
  raycaster.ray.origin.set(x, 50, z);
350
320
  var intersections = raycaster.intersectObject(landscape);
351
- if (intersections.length === 0) continue;
321
+ if (intersections.length === 0)
322
+ continue;
352
323
  var y = intersections[0].point.y;
353
324
  var height = Math.random() * 5 + 0.5;
354
325
  var angle = Math.random() * Math.PI * 2;
@@ -360,16 +331,16 @@ var TreesGeometry = function (landscape) {
360
331
  vertices.push(x, y + height, z);
361
332
  vertices.push(x + Math.sin(angle + Math.PI), y, z + Math.cos(angle + Math.PI));
362
333
  var random = Math.random() * 0.1;
363
-
364
334
  for (let j = 0; j < 6; j++) {
365
335
  colors.push(0.2 + random, 0.4 + random, 0);
366
336
  }
367
337
  }
368
-
369
- this.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
370
- this.setAttribute('color', new BufferAttribute(new Float32Array(colors), 3));
338
+ this.setAttribute("position", new THREE.BufferAttribute(new Float32Array(vertices), 3));
339
+ this.setAttribute("color", new THREE.BufferAttribute(new Float32Array(colors), 3));
371
340
  };
372
-
373
- TreesGeometry.prototype = Object.create(BufferGeometry.prototype);
374
-
375
- export { RollerCoasterGeometry, RollerCoasterLiftersGeometry, RollerCoasterShadowGeometry, SkyGeometry, TreesGeometry };
341
+ TreesGeometry.prototype = Object.create(THREE.BufferGeometry.prototype);
342
+ exports.RollerCoasterGeometry = RollerCoasterGeometry;
343
+ exports.RollerCoasterLiftersGeometry = RollerCoasterLiftersGeometry;
344
+ exports.RollerCoasterShadowGeometry = RollerCoasterShadowGeometry;
345
+ exports.SkyGeometry = SkyGeometry;
346
+ exports.TreesGeometry = TreesGeometry;