three-stdlib 2.22.5 → 2.22.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1091) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +0 -2
  3. package/package.json +34 -14
  4. package/BufferGeometryUtils-903f7ecb.js +0 -1
  5. package/BufferGeometryUtils-f2288d1c.js +0 -740
  6. package/Nodes-2106b101.js +0 -352
  7. package/Nodes-8947ba9a.js +0 -1
  8. package/_polyfill/CompressedArrayTexture.cjs.js +0 -1
  9. package/_polyfill/CompressedArrayTexture.js +0 -13
  10. package/_polyfill/Data3DTexture.cjs.js +0 -1
  11. package/_polyfill/Data3DTexture.js +0 -23
  12. package/animation/AnimationClipCreator.cjs.js +0 -1
  13. package/animation/AnimationClipCreator.d.ts +0 -12
  14. package/animation/AnimationClipCreator.js +0 -77
  15. package/animation/CCDIKSolver.cjs.js +0 -1
  16. package/animation/CCDIKSolver.d.ts +0 -25
  17. package/animation/CCDIKSolver.js +0 -304
  18. package/animation/MMDAnimationHelper.cjs.js +0 -1
  19. package/animation/MMDAnimationHelper.d.ts +0 -103
  20. package/animation/MMDAnimationHelper.js +0 -705
  21. package/animation/MMDPhysics.cjs.js +0 -1
  22. package/animation/MMDPhysics.d.ts +0 -119
  23. package/animation/MMDPhysics.js +0 -976
  24. package/cameras/CinematicCamera.cjs.js +0 -1
  25. package/cameras/CinematicCamera.d.ts +0 -41
  26. package/cameras/CinematicCamera.js +0 -139
  27. package/controls/ArcballControls.cjs.js +0 -1
  28. package/controls/ArcballControls.d.ts +0 -161
  29. package/controls/ArcballControls.js +0 -2642
  30. package/controls/DeviceOrientationControls.cjs.js +0 -1
  31. package/controls/DeviceOrientationControls.d.ts +0 -24
  32. package/controls/DeviceOrientationControls.js +0 -119
  33. package/controls/DragControls.cjs.js +0 -1
  34. package/controls/DragControls.d.ts +0 -34
  35. package/controls/DragControls.js +0 -274
  36. package/controls/FirstPersonControls.cjs.js +0 -1
  37. package/controls/FirstPersonControls.d.ts +0 -48
  38. package/controls/FirstPersonControls.js +0 -290
  39. package/controls/FlyControls.cjs.js +0 -1
  40. package/controls/FlyControls.d.ts +0 -32
  41. package/controls/FlyControls.js +0 -309
  42. package/controls/OrbitControls.cjs.js +0 -1
  43. package/controls/OrbitControls.d.ts +0 -63
  44. package/controls/OrbitControls.js +0 -980
  45. package/controls/PointerLockControls.cjs.js +0 -1
  46. package/controls/PointerLockControls.d.ts +0 -24
  47. package/controls/PointerLockControls.js +0 -135
  48. package/controls/TrackballControls.cjs.js +0 -1
  49. package/controls/TrackballControls.d.ts +0 -95
  50. package/controls/TrackballControls.js +0 -653
  51. package/controls/TransformControls.cjs.js +0 -1
  52. package/controls/TransformControls.d.ts +0 -151
  53. package/controls/TransformControls.js +0 -1275
  54. package/controls/experimental/CameraControls.cjs.js +0 -1
  55. package/controls/experimental/CameraControls.d.ts +0 -170
  56. package/controls/experimental/CameraControls.js +0 -953
  57. package/csm/CSM.cjs.js +0 -1
  58. package/csm/CSM.d.ts +0 -61
  59. package/csm/CSM.js +0 -305
  60. package/csm/CSMFrustum.cjs.js +0 -1
  61. package/csm/CSMFrustum.d.ts +0 -19
  62. package/csm/CSMFrustum.js +0 -90
  63. package/csm/CSMHelper.cjs.js +0 -1
  64. package/csm/CSMHelper.d.ts +0 -26
  65. package/csm/CSMHelper.js +0 -128
  66. package/csm/CSMShader.cjs.js +0 -1
  67. package/csm/CSMShader.d.ts +0 -4
  68. package/csm/CSMShader.js +0 -255
  69. package/curves/CurveExtras.cjs.js +0 -1
  70. package/curves/CurveExtras.d.ts +0 -68
  71. package/curves/CurveExtras.js +0 -266
  72. package/curves/NURBSCurve.cjs.js +0 -1
  73. package/curves/NURBSCurve.d.ts +0 -11
  74. package/curves/NURBSCurve.js +0 -63
  75. package/curves/NURBSSurface.cjs.js +0 -1
  76. package/curves/NURBSSurface.d.ts +0 -13
  77. package/curves/NURBSSurface.js +0 -44
  78. package/curves/NURBSUtils.cjs.js +0 -1
  79. package/curves/NURBSUtils.d.ts +0 -22
  80. package/curves/NURBSUtils.js +0 -375
  81. package/custom.d.cjs.js +0 -1
  82. package/custom.d.js +0 -1
  83. package/deprecated/Geometry.cjs.js +0 -1
  84. package/deprecated/Geometry.d.ts +0 -342
  85. package/deprecated/Geometry.js +0 -1261
  86. package/effects/AnaglyphEffect.cjs.js +0 -1
  87. package/effects/AnaglyphEffect.d.ts +0 -11
  88. package/effects/AnaglyphEffect.js +0 -85
  89. package/effects/AsciiEffect.cjs.js +0 -1
  90. package/effects/AsciiEffect.d.ts +0 -18
  91. package/effects/AsciiEffect.js +0 -203
  92. package/effects/OutlineEffect.cjs.js +0 -1
  93. package/effects/OutlineEffect.d.ts +0 -28
  94. package/effects/OutlineEffect.js +0 -378
  95. package/effects/ParallaxBarrierEffect.cjs.js +0 -1
  96. package/effects/ParallaxBarrierEffect.d.ts +0 -8
  97. package/effects/ParallaxBarrierEffect.js +0 -63
  98. package/effects/PeppersGhostEffect.cjs.js +0 -1
  99. package/effects/PeppersGhostEffect.d.ts +0 -10
  100. package/effects/PeppersGhostEffect.js +0 -134
  101. package/effects/StereoEffect.cjs.js +0 -1
  102. package/effects/StereoEffect.d.ts +0 -9
  103. package/effects/StereoEffect.js +0 -36
  104. package/environments/RoomEnvironment.cjs.js +0 -1
  105. package/environments/RoomEnvironment.d.ts +0 -5
  106. package/environments/RoomEnvironment.js +0 -92
  107. package/exporters/ColladaExporter.cjs.js +0 -1
  108. package/exporters/ColladaExporter.d.ts +0 -39
  109. package/exporters/ColladaExporter.js +0 -425
  110. package/exporters/DRACOExporter.cjs.js +0 -1
  111. package/exporters/DRACOExporter.d.ts +0 -23
  112. package/exporters/DRACOExporter.js +0 -186
  113. package/exporters/GLTFExporter.cjs.js +0 -1
  114. package/exporters/GLTFExporter.d.ts +0 -270
  115. package/exporters/GLTFExporter.js +0 -1932
  116. package/exporters/MMDExporter.cjs.js +0 -1
  117. package/exporters/MMDExporter.d.ts +0 -8
  118. package/exporters/MMDExporter.js +0 -160
  119. package/exporters/OBJExporter.cjs.js +0 -1
  120. package/exporters/OBJExporter.d.ts +0 -18
  121. package/exporters/OBJExporter.js +0 -228
  122. package/exporters/PLYExporter.cjs.js +0 -1
  123. package/exporters/PLYExporter.d.ts +0 -11
  124. package/exporters/PLYExporter.js +0 -339
  125. package/exporters/STLExporter.cjs.js +0 -1
  126. package/exporters/STLExporter.d.ts +0 -23
  127. package/exporters/STLExporter.js +0 -180
  128. package/exporters/USDZExporter.cjs.js +0 -1
  129. package/exporters/USDZExporter.d.ts +0 -27
  130. package/exporters/USDZExporter.js +0 -388
  131. package/geometries/BoxLineGeometry.cjs.js +0 -1
  132. package/geometries/BoxLineGeometry.d.ts +0 -12
  133. package/geometries/BoxLineGeometry.js +0 -52
  134. package/geometries/ConvexGeometry.cjs.js +0 -1
  135. package/geometries/ConvexGeometry.d.ts +0 -5
  136. package/geometries/ConvexGeometry.js +0 -38
  137. package/geometries/DecalGeometry.cjs.js +0 -1
  138. package/geometries/DecalGeometry.d.ts +0 -10
  139. package/geometries/DecalGeometry.js +0 -238
  140. package/geometries/LightningStrike.cjs.js +0 -1
  141. package/geometries/LightningStrike.d.ts +0 -108
  142. package/geometries/LightningStrike.js +0 -740
  143. package/geometries/ParametricGeometries.cjs.js +0 -1
  144. package/geometries/ParametricGeometries.d.ts +0 -32
  145. package/geometries/ParametricGeometries.js +0 -179
  146. package/geometries/ParametricGeometry.cjs.js +0 -1
  147. package/geometries/ParametricGeometry.d.ts +0 -18
  148. package/geometries/ParametricGeometry.js +0 -87
  149. package/geometries/RoundedBoxGeometry.cjs.js +0 -1
  150. package/geometries/RoundedBoxGeometry.d.ts +0 -5
  151. package/geometries/RoundedBoxGeometry.js +0 -122
  152. package/geometries/TeapotGeometry.cjs.js +0 -1
  153. package/geometries/TeapotGeometry.d.ts +0 -13
  154. package/geometries/TeapotGeometry.js +0 -297
  155. package/geometries/TextGeometry.cjs.js +0 -1
  156. package/geometries/TextGeometry.d.ts +0 -18
  157. package/geometries/TextGeometry.js +0 -37
  158. package/helpers/LightProbeHelper.cjs.js +0 -1
  159. package/helpers/LightProbeHelper.d.ts +0 -10
  160. package/helpers/LightProbeHelper.js +0 -40
  161. package/helpers/PositionalAudioHelper.cjs.js +0 -1
  162. package/helpers/PositionalAudioHelper.d.ts +0 -13
  163. package/helpers/PositionalAudioHelper.js +0 -75
  164. package/helpers/RectAreaLightHelper.cjs.js +0 -1
  165. package/helpers/RectAreaLightHelper.d.ts +0 -10
  166. package/helpers/RectAreaLightHelper.js +0 -60
  167. package/helpers/VertexNormalsHelper.cjs.js +0 -1
  168. package/helpers/VertexNormalsHelper.d.ts +0 -10
  169. package/helpers/VertexNormalsHelper.js +0 -75
  170. package/helpers/VertexTangentsHelper.cjs.js +0 -1
  171. package/helpers/VertexTangentsHelper.d.ts +0 -10
  172. package/helpers/VertexTangentsHelper.js +0 -63
  173. package/index.cjs.js +0 -1
  174. package/index.d.ts +0 -254
  175. package/index.js +0 -337
  176. package/interactive/HTMLMesh.cjs.js +0 -1
  177. package/interactive/HTMLMesh.d.ts +0 -6
  178. package/interactive/HTMLMesh.js +0 -406
  179. package/interactive/InteractiveGroup.cjs.js +0 -1
  180. package/interactive/InteractiveGroup.d.ts +0 -5
  181. package/interactive/InteractiveGroup.js +0 -87
  182. package/interactive/SelectionBox.cjs.js +0 -1
  183. package/interactive/SelectionBox.d.ts +0 -15
  184. package/interactive/SelectionBox.js +0 -152
  185. package/interactive/SelectionHelper.cjs.js +0 -1
  186. package/interactive/SelectionHelper.d.ts +0 -17
  187. package/interactive/SelectionHelper.js +0 -59
  188. package/libs/MeshoptDecoder.cjs.js +0 -1
  189. package/libs/MeshoptDecoder.d.ts +0 -12
  190. package/libs/MeshoptDecoder.js +0 -124
  191. package/libs/MotionControllers.cjs.js +0 -1
  192. package/libs/MotionControllers.d.ts +0 -132
  193. package/libs/MotionControllers.js +0 -455
  194. package/lights/LightProbeGenerator.cjs.js +0 -1
  195. package/lights/LightProbeGenerator.d.ts +0 -6
  196. package/lights/LightProbeGenerator.js +0 -200
  197. package/lights/RectAreaLightUniformsLib.cjs.js +0 -1
  198. package/lights/RectAreaLightUniformsLib.d.ts +0 -3
  199. package/lights/RectAreaLightUniformsLib.js +0 -9
  200. package/lines/Line2.cjs.js +0 -1
  201. package/lines/Line2.d.ts +0 -11
  202. package/lines/Line2.js +0 -16
  203. package/lines/LineGeometry.cjs.js +0 -1
  204. package/lines/LineGeometry.d.ts +0 -10
  205. package/lines/LineGeometry.js +0 -56
  206. package/lines/LineMaterial.cjs.js +0 -1
  207. package/lines/LineMaterial.d.ts +0 -31
  208. package/lines/LineMaterial.js +0 -577
  209. package/lines/LineSegments2.cjs.js +0 -1
  210. package/lines/LineSegments2.d.ts +0 -14
  211. package/lines/LineSegments2.js +0 -311
  212. package/lines/LineSegmentsGeometry.cjs.js +0 -1
  213. package/lines/LineSegmentsGeometry.d.ts +0 -23
  214. package/lines/LineSegmentsGeometry.js +0 -166
  215. package/lines/Wireframe.cjs.js +0 -1
  216. package/lines/Wireframe.d.ts +0 -11
  217. package/lines/Wireframe.js +0 -45
  218. package/lines/WireframeGeometry2.cjs.js +0 -1
  219. package/lines/WireframeGeometry2.d.ts +0 -8
  220. package/lines/WireframeGeometry2.js +0 -14
  221. package/loaders/3DMLoader.cjs.js +0 -1
  222. package/loaders/3DMLoader.d.ts +0 -17
  223. package/loaders/3DMLoader.js +0 -1037
  224. package/loaders/3MFLoader.cjs.js +0 -1
  225. package/loaders/3MFLoader.d.ts +0 -16
  226. package/loaders/3MFLoader.js +0 -1053
  227. package/loaders/AMFLoader.cjs.js +0 -1
  228. package/loaders/AMFLoader.d.ts +0 -14
  229. package/loaders/AMFLoader.js +0 -389
  230. package/loaders/AssimpLoader.cjs.js +0 -1
  231. package/loaders/AssimpLoader.js +0 -1793
  232. package/loaders/BVHLoader.cjs.js +0 -1
  233. package/loaders/BVHLoader.d.ts +0 -21
  234. package/loaders/BVHLoader.js +0 -313
  235. package/loaders/BasisTextureLoader.cjs.js +0 -1
  236. package/loaders/BasisTextureLoader.d.ts +0 -32
  237. package/loaders/BasisTextureLoader.js +0 -602
  238. package/loaders/ColladaLoader.cjs.js +0 -1
  239. package/loaders/ColladaLoader.d.ts +0 -20
  240. package/loaders/ColladaLoader.js +0 -2993
  241. package/loaders/DDSLoader.cjs.js +0 -1
  242. package/loaders/DDSLoader.d.ts +0 -16
  243. package/loaders/DDSLoader.js +0 -214
  244. package/loaders/DRACOLoader.cjs.js +0 -1
  245. package/loaders/DRACOLoader.d.ts +0 -18
  246. package/loaders/DRACOLoader.js +0 -447
  247. package/loaders/EXRLoader.cjs.js +0 -1
  248. package/loaders/EXRLoader.d.ts +0 -18
  249. package/loaders/EXRLoader.js +0 -1699
  250. package/loaders/FBXLoader.cjs.js +0 -1
  251. package/loaders/FBXLoader.d.ts +0 -14
  252. package/loaders/FBXLoader.js +0 -2917
  253. package/loaders/FontLoader.cjs.js +0 -1
  254. package/loaders/FontLoader.d.ts +0 -36
  255. package/loaders/FontLoader.js +0 -144
  256. package/loaders/GCodeLoader.cjs.js +0 -1
  257. package/loaders/GCodeLoader.d.ts +0 -15
  258. package/loaders/GCodeLoader.js +0 -189
  259. package/loaders/GLTFLoader.cjs.js +0 -1
  260. package/loaders/GLTFLoader.d.ts +0 -151
  261. package/loaders/GLTFLoader.js +0 -3136
  262. package/loaders/HDRCubeTextureLoader.cjs.js +0 -1
  263. package/loaders/HDRCubeTextureLoader.d.ts +0 -18
  264. package/loaders/HDRCubeTextureLoader.js +0 -77
  265. package/loaders/KMZLoader.cjs.js +0 -1
  266. package/loaders/KMZLoader.d.ts +0 -16
  267. package/loaders/KMZLoader.js +0 -88
  268. package/loaders/KTX2Loader.cjs.js +0 -1
  269. package/loaders/KTX2Loader.d.ts +0 -16
  270. package/loaders/KTX2Loader.js +0 -596
  271. package/loaders/KTXLoader.cjs.js +0 -1
  272. package/loaders/KTXLoader.d.ts +0 -16
  273. package/loaders/KTXLoader.js +0 -149
  274. package/loaders/LDrawLoader.cjs.js +0 -1
  275. package/loaders/LDrawLoader.d.ts +0 -26
  276. package/loaders/LDrawLoader.js +0 -1842
  277. package/loaders/LUT3dlLoader.cjs.js +0 -1
  278. package/loaders/LUT3dlLoader.d.ts +0 -20
  279. package/loaders/LUT3dlLoader.js +0 -115
  280. package/loaders/LUTCubeLoader.cjs.js +0 -1
  281. package/loaders/LUTCubeLoader.d.ts +0 -23
  282. package/loaders/LUTCubeLoader.js +0 -118
  283. package/loaders/LWOLoader.cjs.js +0 -1
  284. package/loaders/LWOLoader.d.ts +0 -26
  285. package/loaders/LWOLoader.js +0 -737
  286. package/loaders/LottieLoader.cjs.js +0 -1
  287. package/loaders/LottieLoader.d.ts +0 -15
  288. package/loaders/LottieLoader.js +0 -49
  289. package/loaders/MD2Loader.cjs.js +0 -1
  290. package/loaders/MD2Loader.d.ts +0 -14
  291. package/loaders/MD2Loader.js +0 -202
  292. package/loaders/MDDLoader.cjs.js +0 -1
  293. package/loaders/MDDLoader.d.ts +0 -19
  294. package/loaders/MDDLoader.js +0 -78
  295. package/loaders/MMDLoader.cjs.js +0 -1
  296. package/loaders/MMDLoader.d.ts +0 -63
  297. package/loaders/MMDLoader.js +0 -1434
  298. package/loaders/MTLLoader.cjs.js +0 -1
  299. package/loaders/MTLLoader.d.ts +0 -112
  300. package/loaders/MTLLoader.js +0 -390
  301. package/loaders/NRRDLoader.cjs.js +0 -1
  302. package/loaders/NRRDLoader.d.ts +0 -21
  303. package/loaders/NRRDLoader.js +0 -482
  304. package/loaders/NodeMaterialLoader.cjs.js +0 -1
  305. package/loaders/NodeMaterialLoader.js +0 -39
  306. package/loaders/OBJLoader.cjs.js +0 -1
  307. package/loaders/OBJLoader.d.ts +0 -17
  308. package/loaders/OBJLoader.js +0 -609
  309. package/loaders/PCDLoader.cjs.js +0 -1
  310. package/loaders/PCDLoader.d.ts +0 -15
  311. package/loaders/PCDLoader.js +0 -267
  312. package/loaders/PDBLoader.cjs.js +0 -1
  313. package/loaders/PDBLoader.d.ts +0 -22
  314. package/loaders/PDBLoader.js +0 -264
  315. package/loaders/PLYLoader.cjs.js +0 -1
  316. package/loaders/PLYLoader.d.ts +0 -16
  317. package/loaders/PLYLoader.js +0 -414
  318. package/loaders/PRWMLoader.cjs.js +0 -1
  319. package/loaders/PRWMLoader.d.ts +0 -16
  320. package/loaders/PRWMLoader.js +0 -197
  321. package/loaders/PVRLoader.cjs.js +0 -1
  322. package/loaders/PVRLoader.d.ts +0 -16
  323. package/loaders/PVRLoader.js +0 -192
  324. package/loaders/RGBELoader.cjs.js +0 -1
  325. package/loaders/RGBELoader.d.ts +0 -20
  326. package/loaders/RGBELoader.js +0 -382
  327. package/loaders/RGBMLoader.cjs.js +0 -1
  328. package/loaders/RGBMLoader.d.ts +0 -32
  329. package/loaders/RGBMLoader.js +0 -1168
  330. package/loaders/STLLoader.cjs.js +0 -1
  331. package/loaders/STLLoader.d.ts +0 -14
  332. package/loaders/STLLoader.js +0 -296
  333. package/loaders/SVGLoader.cjs.js +0 -1
  334. package/loaders/SVGLoader.d.ts +0 -63
  335. package/loaders/SVGLoader.js +0 -2083
  336. package/loaders/TDSLoader.cjs.js +0 -1
  337. package/loaders/TDSLoader.d.ts +0 -42
  338. package/loaders/TDSLoader.js +0 -870
  339. package/loaders/TGALoader.cjs.js +0 -1
  340. package/loaders/TGALoader.d.ts +0 -14
  341. package/loaders/TGALoader.js +0 -396
  342. package/loaders/TTFLoader.cjs.js +0 -1
  343. package/loaders/TTFLoader.d.ts +0 -15
  344. package/loaders/TTFLoader.js +0 -152
  345. package/loaders/TiltLoader.cjs.js +0 -1
  346. package/loaders/TiltLoader.d.ts +0 -14
  347. package/loaders/TiltLoader.js +0 -411
  348. package/loaders/VOXLoader.cjs.js +0 -1
  349. package/loaders/VOXLoader.d.ts +0 -28
  350. package/loaders/VOXLoader.js +0 -196
  351. package/loaders/VRMLLoader.cjs.js +0 -1
  352. package/loaders/VRMLLoader.d.ts +0 -14
  353. package/loaders/VRMLLoader.js +0 -2575
  354. package/loaders/VRMLoader.cjs.js +0 -1
  355. package/loaders/VRMLoader.js +0 -46
  356. package/loaders/VTKLoader.cjs.js +0 -1
  357. package/loaders/VTKLoader.d.ts +0 -14
  358. package/loaders/VTKLoader.js +0 -834
  359. package/loaders/XLoader.cjs.js +0 -1
  360. package/loaders/XLoader.js +0 -1434
  361. package/loaders/XYZLoader.cjs.js +0 -1
  362. package/loaders/XYZLoader.d.ts +0 -14
  363. package/loaders/XYZLoader.js +0 -66
  364. package/loaders/lwo/IFFParser.cjs.js +0 -1
  365. package/loaders/lwo/IFFParser.js +0 -951
  366. package/loaders/lwo/LWO2Parser.cjs.js +0 -1
  367. package/loaders/lwo/LWO2Parser.js +0 -430
  368. package/loaders/lwo/LWO3Parser.cjs.js +0 -1
  369. package/loaders/lwo/LWO3Parser.js +0 -385
  370. package/math/Capsule.cjs.js +0 -1
  371. package/math/Capsule.d.ts +0 -27
  372. package/math/Capsule.js +0 -87
  373. package/math/ColorConverter.cjs.js +0 -1
  374. package/math/ColorConverter.d.ts +0 -21
  375. package/math/ColorConverter.js +0 -65
  376. package/math/ConvexHull.cjs.js +0 -1
  377. package/math/ConvexHull.d.ts +0 -89
  378. package/math/ConvexHull.js +0 -834
  379. package/math/ImprovedNoise.cjs.js +0 -1
  380. package/math/ImprovedNoise.d.ts +0 -4
  381. package/math/ImprovedNoise.js +0 -52
  382. package/math/Lut.cjs.js +0 -1
  383. package/math/Lut.d.ts +0 -27
  384. package/math/Lut.js +0 -119
  385. package/math/MeshSurfaceSampler.cjs.js +0 -1
  386. package/math/MeshSurfaceSampler.d.ts +0 -15
  387. package/math/MeshSurfaceSampler.js +0 -150
  388. package/math/OBB.cjs.js +0 -1
  389. package/math/OBB.d.ts +0 -24
  390. package/math/OBB.js +0 -296
  391. package/math/Octree.cjs.js +0 -1
  392. package/math/Octree.d.ts +0 -24
  393. package/math/Octree.js +0 -341
  394. package/math/SimplexNoise.cjs.js +0 -1
  395. package/math/SimplexNoise.d.ts +0 -17
  396. package/math/SimplexNoise.js +0 -446
  397. package/misc/ConvexObjectBreaker.cjs.js +0 -1
  398. package/misc/ConvexObjectBreaker.d.ts +0 -25
  399. package/misc/ConvexObjectBreaker.js +0 -398
  400. package/misc/GPUComputationRenderer.cjs.js +0 -1
  401. package/misc/GPUComputationRenderer.d.ts +0 -52
  402. package/misc/GPUComputationRenderer.js +0 -296
  403. package/misc/Gyroscope.cjs.js +0 -1
  404. package/misc/Gyroscope.d.ts +0 -5
  405. package/misc/Gyroscope.js +0 -41
  406. package/misc/MD2Character.cjs.js +0 -1
  407. package/misc/MD2Character.d.ts +0 -33
  408. package/misc/MD2Character.js +0 -184
  409. package/misc/MD2CharacterComplex.cjs.js +0 -1
  410. package/misc/MD2CharacterComplex.d.ts +0 -47
  411. package/misc/MD2CharacterComplex.js +0 -379
  412. package/misc/MorphAnimMesh.cjs.js +0 -1
  413. package/misc/MorphAnimMesh.d.ts +0 -13
  414. package/misc/MorphAnimMesh.js +0 -48
  415. package/misc/MorphBlendMesh.cjs.js +0 -1
  416. package/misc/MorphBlendMesh.d.ts +0 -21
  417. package/misc/MorphBlendMesh.js +0 -203
  418. package/misc/ProgressiveLightmap.cjs.js +0 -1
  419. package/misc/ProgressiveLightmap.js +0 -285
  420. package/misc/RollerCoaster.cjs.js +0 -1
  421. package/misc/RollerCoaster.d.ts +0 -21
  422. package/misc/RollerCoaster.js +0 -375
  423. package/misc/Timer.cjs.js +0 -1
  424. package/misc/Timer.d.ts +0 -27
  425. package/misc/Timer.js +0 -125
  426. package/misc/TubePainter.cjs.js +0 -1
  427. package/misc/TubePainter.d.ts +0 -10
  428. package/misc/TubePainter.js +0 -141
  429. package/misc/Volume.cjs.js +0 -1
  430. package/misc/Volume.d.ts +0 -37
  431. package/misc/Volume.js +0 -406
  432. package/misc/VolumeSlice.cjs.js +0 -1
  433. package/misc/VolumeSlice.d.ts +0 -28
  434. package/misc/VolumeSlice.js +0 -194
  435. package/misc/WebGL.cjs.js +0 -1
  436. package/misc/WebGL.d.ts +0 -5
  437. package/misc/WebGL.js +0 -71
  438. package/modifiers/CurveModifier.cjs.js +0 -1
  439. package/modifiers/CurveModifier.d.ts +0 -39
  440. package/modifiers/CurveModifier.js +0 -288
  441. package/modifiers/EdgeSplitModifier.cjs.js +0 -1
  442. package/modifiers/EdgeSplitModifier.d.ts +0 -19
  443. package/modifiers/EdgeSplitModifier.js +0 -205
  444. package/modifiers/SimplifyModifier.cjs.js +0 -1
  445. package/modifiers/SimplifyModifier.d.ts +0 -12
  446. package/modifiers/SimplifyModifier.js +0 -407
  447. package/modifiers/TessellateModifier.cjs.js +0 -1
  448. package/modifiers/TessellateModifier.d.ts +0 -8
  449. package/modifiers/TessellateModifier.js +0 -231
  450. package/nodes/Nodes.cjs.js +0 -1
  451. package/nodes/Nodes.js +0 -204
  452. package/nodes/ShaderNode.cjs.js +0 -1
  453. package/nodes/ShaderNode.js +0 -308
  454. package/nodes/accessors/BufferNode.cjs.js +0 -1
  455. package/nodes/accessors/BufferNode.js +0 -18
  456. package/nodes/accessors/CameraNode.cjs.js +0 -1
  457. package/nodes/accessors/CameraNode.js +0 -48
  458. package/nodes/accessors/CubeTextureNode.cjs.js +0 -1
  459. package/nodes/accessors/CubeTextureNode.js +0 -53
  460. package/nodes/accessors/MaterialNode.cjs.js +0 -1
  461. package/nodes/accessors/MaterialNode.js +0 -80
  462. package/nodes/accessors/MaterialReferenceNode.cjs.js +0 -1
  463. package/nodes/accessors/MaterialReferenceNode.js +0 -16
  464. package/nodes/accessors/ModelNode.cjs.js +0 -1
  465. package/nodes/accessors/ModelNode.js +0 -10
  466. package/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  467. package/nodes/accessors/ModelViewProjectionNode.js +0 -22
  468. package/nodes/accessors/NormalNode.cjs.js +0 -1
  469. package/nodes/accessors/NormalNode.js +0 -60
  470. package/nodes/accessors/Object3DNode.cjs.js +0 -1
  471. package/nodes/accessors/Object3DNode.js +0 -85
  472. package/nodes/accessors/PointUVNode.cjs.js +0 -1
  473. package/nodes/accessors/PointUVNode.js +0 -16
  474. package/nodes/accessors/PositionNode.cjs.js +0 -1
  475. package/nodes/accessors/PositionNode.js +0 -63
  476. package/nodes/accessors/ReferenceNode.cjs.js +0 -1
  477. package/nodes/accessors/ReferenceNode.js +0 -43
  478. package/nodes/accessors/ReflectNode.cjs.js +0 -1
  479. package/nodes/accessors/ReflectNode.js +0 -45
  480. package/nodes/accessors/SkinningNode.cjs.js +0 -1
  481. package/nodes/accessors/SkinningNode.js +0 -59
  482. package/nodes/accessors/TextureNode.cjs.js +0 -1
  483. package/nodes/accessors/TextureNode.js +0 -68
  484. package/nodes/accessors/UVNode.cjs.js +0 -1
  485. package/nodes/accessors/UVNode.js +0 -28
  486. package/nodes/core/ArrayUniformNode.cjs.js +0 -1
  487. package/nodes/core/ArrayUniformNode.js +0 -17
  488. package/nodes/core/AttributeNode.cjs.js +0 -1
  489. package/nodes/core/AttributeNode.js +0 -36
  490. package/nodes/core/BypassNode.cjs.js +0 -1
  491. package/nodes/core/BypassNode.js +0 -28
  492. package/nodes/core/CodeNode.cjs.js +0 -1
  493. package/nodes/core/CodeNode.js +0 -35
  494. package/nodes/core/ConstNode.cjs.js +0 -1
  495. package/nodes/core/ConstNode.js +0 -17
  496. package/nodes/core/ContextNode.cjs.js +0 -1
  497. package/nodes/core/ContextNode.js +0 -26
  498. package/nodes/core/ExpressionNode.cjs.js +0 -1
  499. package/nodes/core/ExpressionNode.js +0 -22
  500. package/nodes/core/FunctionCallNode.cjs.js +0 -1
  501. package/nodes/core/FunctionCallNode.js +0 -45
  502. package/nodes/core/FunctionNode.cjs.js +0 -1
  503. package/nodes/core/FunctionNode.js +0 -70
  504. package/nodes/core/InputNode.cjs.js +0 -1
  505. package/nodes/core/InputNode.js +0 -48
  506. package/nodes/core/Node.cjs.js +0 -1
  507. package/nodes/core/Node.js +0 -178
  508. package/nodes/core/NodeAttribute.cjs.js +0 -1
  509. package/nodes/core/NodeAttribute.js +0 -11
  510. package/nodes/core/NodeBuilder.cjs.js +0 -1
  511. package/nodes/core/NodeBuilder.js +0 -509
  512. package/nodes/core/NodeCode.cjs.js +0 -1
  513. package/nodes/core/NodeCode.js +0 -13
  514. package/nodes/core/NodeFrame.cjs.js +0 -1
  515. package/nodes/core/NodeFrame.js +0 -37
  516. package/nodes/core/NodeFunction.cjs.js +0 -1
  517. package/nodes/core/NodeFunction.js +0 -17
  518. package/nodes/core/NodeFunctionInput.cjs.js +0 -1
  519. package/nodes/core/NodeFunctionInput.js +0 -14
  520. package/nodes/core/NodeKeywords.cjs.js +0 -1
  521. package/nodes/core/NodeKeywords.js +0 -54
  522. package/nodes/core/NodeParser.cjs.js +0 -1
  523. package/nodes/core/NodeParser.js +0 -8
  524. package/nodes/core/NodeUniform.cjs.js +0 -1
  525. package/nodes/core/NodeUniform.js +0 -21
  526. package/nodes/core/NodeUtils.cjs.js +0 -1
  527. package/nodes/core/NodeUtils.js +0 -61
  528. package/nodes/core/NodeVar.cjs.js +0 -1
  529. package/nodes/core/NodeVar.js +0 -11
  530. package/nodes/core/NodeVary.cjs.js +0 -1
  531. package/nodes/core/NodeVary.js +0 -11
  532. package/nodes/core/PropertyNode.cjs.js +0 -1
  533. package/nodes/core/PropertyNode.js +0 -26
  534. package/nodes/core/TempNode.cjs.js +0 -1
  535. package/nodes/core/TempNode.js +0 -30
  536. package/nodes/core/UniformNode.cjs.js +0 -1
  537. package/nodes/core/UniformNode.js +0 -28
  538. package/nodes/core/VarNode.cjs.js +0 -1
  539. package/nodes/core/VarNode.js +0 -38
  540. package/nodes/core/VaryNode.cjs.js +0 -1
  541. package/nodes/core/VaryNode.js +0 -38
  542. package/nodes/core/constants.cjs.js +0 -1
  543. package/nodes/core/constants.js +0 -11
  544. package/nodes/display/ColorSpaceNode.cjs.js +0 -1
  545. package/nodes/display/ColorSpaceNode.js +0 -66
  546. package/nodes/display/NormalMapNode.cjs.js +0 -1
  547. package/nodes/display/NormalMapNode.js +0 -71
  548. package/nodes/fog/FogNode.cjs.js +0 -1
  549. package/nodes/fog/FogNode.js +0 -18
  550. package/nodes/fog/FogRangeNode.cjs.js +0 -1
  551. package/nodes/fog/FogRangeNode.js +0 -20
  552. package/nodes/functions/BSDFs.cjs.js +0 -1
  553. package/nodes/functions/BSDFs.js +0 -121
  554. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +0 -1
  555. package/nodes/functions/PhysicalMaterialFunctions.js +0 -57
  556. package/nodes/lights/LightContextNode.cjs.js +0 -1
  557. package/nodes/lights/LightContextNode.js +0 -43
  558. package/nodes/lights/LightNode.cjs.js +0 -1
  559. package/nodes/lights/LightNode.js +0 -61
  560. package/nodes/lights/LightsNode.cjs.js +0 -1
  561. package/nodes/lights/LightsNode.js +0 -77
  562. package/nodes/loaders/NodeLoader.cjs.js +0 -1
  563. package/nodes/loaders/NodeLoader.js +0 -212
  564. package/nodes/loaders/NodeMaterialLoader.cjs.js +0 -1
  565. package/nodes/loaders/NodeMaterialLoader.js +0 -29
  566. package/nodes/loaders/NodeObjectLoader.cjs.js +0 -1
  567. package/nodes/loaders/NodeObjectLoader.js +0 -49
  568. package/nodes/materials/LineBasicNodeMaterial.cjs.js +0 -1
  569. package/nodes/materials/LineBasicNodeMaterial.js +0 -31
  570. package/nodes/materials/Materials.cjs.js +0 -1
  571. package/nodes/materials/Materials.js +0 -27
  572. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +0 -1
  573. package/nodes/materials/MeshBasicNodeMaterial.js +0 -32
  574. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +0 -1
  575. package/nodes/materials/MeshStandardNodeMaterial.js +0 -43
  576. package/nodes/materials/NodeMaterial.cjs.js +0 -1
  577. package/nodes/materials/NodeMaterial.js +0 -79
  578. package/nodes/materials/PointsNodeMaterial.cjs.js +0 -1
  579. package/nodes/materials/PointsNodeMaterial.js +0 -34
  580. package/nodes/math/CondNode.cjs.js +0 -1
  581. package/nodes/math/CondNode.js +0 -49
  582. package/nodes/math/MathNode.cjs.js +0 -1
  583. package/nodes/math/MathNode.js +0 -206
  584. package/nodes/math/OperatorNode.cjs.js +0 -1
  585. package/nodes/math/OperatorNode.js +0 -124
  586. package/nodes/parsers/GLSLNodeFunction.cjs.js +0 -1
  587. package/nodes/parsers/GLSLNodeFunction.js +0 -101
  588. package/nodes/parsers/GLSLNodeParser.cjs.js +0 -1
  589. package/nodes/parsers/GLSLNodeParser.js +0 -13
  590. package/nodes/parsers/WGSLNodeFunction.cjs.js +0 -1
  591. package/nodes/parsers/WGSLNodeFunction.js +0 -71
  592. package/nodes/parsers/WGSLNodeParser.cjs.js +0 -1
  593. package/nodes/parsers/WGSLNodeParser.js +0 -13
  594. package/nodes/procedural/CheckerNode.cjs.js +0 -1
  595. package/nodes/procedural/CheckerNode.js +0 -26
  596. package/nodes/utils/ArrayElementNode.cjs.js +0 -1
  597. package/nodes/utils/ArrayElementNode.js +0 -22
  598. package/nodes/utils/ConvertNode.cjs.js +0 -1
  599. package/nodes/utils/ConvertNode.js +0 -29
  600. package/nodes/utils/JoinNode.cjs.js +0 -1
  601. package/nodes/utils/JoinNode.js +0 -29
  602. package/nodes/utils/MatcapUVNode.cjs.js +0 -1
  603. package/nodes/utils/MatcapUVNode.js +0 -18
  604. package/nodes/utils/OscNode.cjs.js +0 -1
  605. package/nodes/utils/OscNode.js +0 -55
  606. package/nodes/utils/SplitNode.cjs.js +0 -1
  607. package/nodes/utils/SplitNode.js +0 -58
  608. package/nodes/utils/SpriteSheetUVNode.cjs.js +0 -1
  609. package/nodes/utils/SpriteSheetUVNode.js +0 -39
  610. package/nodes/utils/TimerNode.cjs.js +0 -1
  611. package/nodes/utils/TimerNode.js +0 -47
  612. package/objects/GroundProjectedEnv.cjs.js +0 -1
  613. package/objects/GroundProjectedEnv.d.ts +0 -12
  614. package/objects/GroundProjectedEnv.js +0 -145
  615. package/objects/Lensflare.cjs.js +0 -1
  616. package/objects/Lensflare.d.ts +0 -17
  617. package/objects/Lensflare.js +0 -332
  618. package/objects/LightningStorm.cjs.js +0 -1
  619. package/objects/LightningStorm.d.ts +0 -32
  620. package/objects/LightningStorm.js +0 -174
  621. package/objects/MarchingCubes.cjs.js +0 -1
  622. package/objects/MarchingCubes.d.ts +0 -75
  623. package/objects/MarchingCubes.js +0 -610
  624. package/objects/Reflector.cjs.js +0 -1
  625. package/objects/Reflector.d.ts +0 -19
  626. package/objects/Reflector.js +0 -188
  627. package/objects/ReflectorForSSRPass.cjs.js +0 -1
  628. package/objects/ReflectorForSSRPass.d.ts +0 -57
  629. package/objects/ReflectorForSSRPass.js +0 -298
  630. package/objects/ReflectorRTT.cjs.js +0 -1
  631. package/objects/ReflectorRTT.js +0 -11
  632. package/objects/Refractor.cjs.js +0 -1
  633. package/objects/Refractor.d.ts +0 -19
  634. package/objects/Refractor.js +0 -220
  635. package/objects/ShadowMesh.cjs.js +0 -1
  636. package/objects/ShadowMesh.d.ts +0 -7
  637. package/objects/ShadowMesh.js +0 -50
  638. package/objects/Sky.cjs.js +0 -1
  639. package/objects/Sky.d.ts +0 -30
  640. package/objects/Sky.js +0 -85
  641. package/objects/Water.cjs.js +0 -1
  642. package/objects/Water.d.ts +0 -22
  643. package/objects/Water.js +0 -279
  644. package/objects/Water2.cjs.js +0 -1
  645. package/objects/Water2.d.ts +0 -30
  646. package/objects/Water2.js +0 -288
  647. package/offscreen/jank.cjs.js +0 -1
  648. package/offscreen/jank.js +0 -30
  649. package/offscreen/offscreen.cjs.js +0 -1
  650. package/offscreen/offscreen.js +0 -7
  651. package/offscreen/scene.cjs.js +0 -1
  652. package/offscreen/scene.js +0 -73
  653. package/physics/AmmoPhysics.cjs.js +0 -1
  654. package/physics/AmmoPhysics.d.ts +0 -7
  655. package/physics/AmmoPhysics.js +0 -206
  656. package/postprocessing/AdaptiveToneMappingPass.cjs.js +0 -1
  657. package/postprocessing/AdaptiveToneMappingPass.d.ts +0 -29
  658. package/postprocessing/AdaptiveToneMappingPass.js +0 -247
  659. package/postprocessing/AfterimagePass.cjs.js +0 -1
  660. package/postprocessing/AfterimagePass.d.ts +0 -15
  661. package/postprocessing/AfterimagePass.js +0 -76
  662. package/postprocessing/BloomPass.cjs.js +0 -1
  663. package/postprocessing/BloomPass.d.ts +0 -16
  664. package/postprocessing/BloomPass.js +0 -116
  665. package/postprocessing/BokehPass.cjs.js +0 -1
  666. package/postprocessing/BokehPass.d.ts +0 -23
  667. package/postprocessing/BokehPass.js +0 -106
  668. package/postprocessing/ClearPass.cjs.js +0 -1
  669. package/postprocessing/ClearPass.d.ts +0 -10
  670. package/postprocessing/ClearPass.js +0 -42
  671. package/postprocessing/CubeTexturePass.cjs.js +0 -1
  672. package/postprocessing/CubeTexturePass.d.ts +0 -14
  673. package/postprocessing/CubeTexturePass.js +0 -48
  674. package/postprocessing/DotScreenPass.cjs.js +0 -1
  675. package/postprocessing/DotScreenPass.d.ts +0 -10
  676. package/postprocessing/DotScreenPass.js +0 -48
  677. package/postprocessing/EffectComposer.cjs.js +0 -1
  678. package/postprocessing/EffectComposer.d.ts +0 -27
  679. package/postprocessing/EffectComposer.js +0 -186
  680. package/postprocessing/FilmPass.cjs.js +0 -1
  681. package/postprocessing/FilmPass.d.ts +0 -10
  682. package/postprocessing/FilmPass.js +0 -47
  683. package/postprocessing/GlitchPass.cjs.js +0 -1
  684. package/postprocessing/GlitchPass.d.ts +0 -15
  685. package/postprocessing/GlitchPass.js +0 -96
  686. package/postprocessing/HalftonePass.cjs.js +0 -1
  687. package/postprocessing/HalftonePass.d.ts +0 -23
  688. package/postprocessing/HalftonePass.js +0 -64
  689. package/postprocessing/LUTPass.cjs.js +0 -1
  690. package/postprocessing/LUTPass.d.ts +0 -13
  691. package/postprocessing/LUTPass.js +0 -161
  692. package/postprocessing/MaskPass.cjs.js +0 -1
  693. package/postprocessing/MaskPass.d.ts +0 -14
  694. package/postprocessing/MaskPass.js +0 -79
  695. package/postprocessing/OutlinePass.cjs.js +0 -1
  696. package/postprocessing/OutlinePass.d.ts +0 -53
  697. package/postprocessing/OutlinePass.js +0 -580
  698. package/postprocessing/Pass.cjs.js +0 -1
  699. package/postprocessing/Pass.d.ts +0 -20
  700. package/postprocessing/Pass.js +0 -61
  701. package/postprocessing/RenderPass.cjs.js +0 -1
  702. package/postprocessing/RenderPass.d.ts +0 -14
  703. package/postprocessing/RenderPass.js +0 -71
  704. package/postprocessing/RenderPixelatedPass.cjs.js +0 -1
  705. package/postprocessing/RenderPixelatedPass.js +0 -213
  706. package/postprocessing/SAOPass.cjs.js +0 -1
  707. package/postprocessing/SAOPass.d.ts +0 -79
  708. package/postprocessing/SAOPass.js +0 -317
  709. package/postprocessing/SMAAPass.cjs.js +0 -1
  710. package/postprocessing/SMAAPass.d.ts +0 -21
  711. package/postprocessing/SMAAPass.js +0 -132
  712. package/postprocessing/SSAARenderPass.cjs.js +0 -1
  713. package/postprocessing/SSAARenderPass.d.ts +0 -17
  714. package/postprocessing/SSAARenderPass.js +0 -118
  715. package/postprocessing/SSAOPass.cjs.js +0 -1
  716. package/postprocessing/SSAOPass.d.ts +0 -71
  717. package/postprocessing/SSAOPass.js +0 -314
  718. package/postprocessing/SSRPass.cjs.js +0 -1
  719. package/postprocessing/SSRPass.d.ts +0 -124
  720. package/postprocessing/SSRPass.js +0 -508
  721. package/postprocessing/SavePass.cjs.js +0 -1
  722. package/postprocessing/SavePass.d.ts +0 -12
  723. package/postprocessing/SavePass.js +0 -42
  724. package/postprocessing/ShaderPass.cjs.js +0 -1
  725. package/postprocessing/ShaderPass.d.ts +0 -13
  726. package/postprocessing/ShaderPass.js +0 -55
  727. package/postprocessing/TAARenderPass.cjs.js +0 -1
  728. package/postprocessing/TAARenderPass.d.ts +0 -8
  729. package/postprocessing/TAARenderPass.js +0 -107
  730. package/postprocessing/TexturePass.cjs.js +0 -1
  731. package/postprocessing/TexturePass.d.ts +0 -12
  732. package/postprocessing/TexturePass.js +0 -40
  733. package/postprocessing/UnrealBloomPass.cjs.js +0 -1
  734. package/postprocessing/UnrealBloomPass.d.ts +0 -31
  735. package/postprocessing/UnrealBloomPass.js +0 -273
  736. package/postprocessing/WaterPass.cjs.js +0 -1
  737. package/postprocessing/WaterPass.d.ts +0 -12
  738. package/postprocessing/WaterPass.js +0 -102
  739. package/renderers/CSS2DRenderer.cjs.js +0 -1
  740. package/renderers/CSS2DRenderer.d.ts +0 -22
  741. package/renderers/CSS2DRenderer.js +0 -152
  742. package/renderers/CSS3DRenderer.cjs.js +0 -1
  743. package/renderers/CSS3DRenderer.d.ts +0 -26
  744. package/renderers/CSS3DRenderer.js +0 -166
  745. package/renderers/Projector.cjs.js +0 -1
  746. package/renderers/Projector.d.ts +0 -60
  747. package/renderers/Projector.js +0 -678
  748. package/renderers/SVGRenderer.cjs.js +0 -1
  749. package/renderers/SVGRenderer.d.ts +0 -25
  750. package/renderers/SVGRenderer.js +0 -416
  751. package/renderers/nodes/accessors/CameraNode.cjs.js +0 -1
  752. package/renderers/nodes/accessors/CameraNode.js +0 -73
  753. package/renderers/nodes/accessors/ModelNode.cjs.js +0 -1
  754. package/renderers/nodes/accessors/ModelNode.js +0 -69
  755. package/renderers/nodes/accessors/ModelViewProjectionNode.cjs.js +0 -1
  756. package/renderers/nodes/accessors/ModelViewProjectionNode.js +0 -33
  757. package/renderers/nodes/accessors/NormalNode.cjs.js +0 -1
  758. package/renderers/nodes/accessors/NormalNode.js +0 -70
  759. package/renderers/nodes/accessors/PositionNode.cjs.js +0 -1
  760. package/renderers/nodes/accessors/PositionNode.js +0 -30
  761. package/renderers/nodes/accessors/UVNode.cjs.js +0 -1
  762. package/renderers/nodes/accessors/UVNode.js +0 -17
  763. package/renderers/nodes/core/AttributeNode.cjs.js +0 -1
  764. package/renderers/nodes/core/AttributeNode.js +0 -43
  765. package/renderers/nodes/core/InputNode.cjs.js +0 -1
  766. package/renderers/nodes/core/InputNode.js +0 -40
  767. package/renderers/nodes/core/Node.cjs.js +0 -1
  768. package/renderers/nodes/core/Node.js +0 -43
  769. package/renderers/nodes/core/NodeAttribute.cjs.js +0 -1
  770. package/renderers/nodes/core/NodeAttribute.js +0 -12
  771. package/renderers/nodes/core/NodeBuilder.cjs.js +0 -1
  772. package/renderers/nodes/core/NodeBuilder.js +0 -309
  773. package/renderers/nodes/core/NodeFrame.cjs.js +0 -1
  774. package/renderers/nodes/core/NodeFrame.js +0 -37
  775. package/renderers/nodes/core/NodeSlot.cjs.js +0 -1
  776. package/renderers/nodes/core/NodeSlot.js +0 -10
  777. package/renderers/nodes/core/NodeUniform.cjs.js +0 -1
  778. package/renderers/nodes/core/NodeUniform.js +0 -22
  779. package/renderers/nodes/core/NodeVary.cjs.js +0 -1
  780. package/renderers/nodes/core/NodeVary.js +0 -13
  781. package/renderers/nodes/core/VaryNode.cjs.js +0 -1
  782. package/renderers/nodes/core/VaryNode.js +0 -27
  783. package/renderers/nodes/core/constants.cjs.js +0 -1
  784. package/renderers/nodes/core/constants.js +0 -19
  785. package/renderers/nodes/inputs/ColorNode.cjs.js +0 -1
  786. package/renderers/nodes/inputs/ColorNode.js +0 -16
  787. package/renderers/nodes/inputs/FloatNode.cjs.js +0 -1
  788. package/renderers/nodes/inputs/FloatNode.js +0 -16
  789. package/renderers/nodes/inputs/Matrix3Node.cjs.js +0 -1
  790. package/renderers/nodes/inputs/Matrix3Node.js +0 -17
  791. package/renderers/nodes/inputs/Matrix4Node.cjs.js +0 -1
  792. package/renderers/nodes/inputs/Matrix4Node.js +0 -17
  793. package/renderers/nodes/inputs/TextureNode.cjs.js +0 -1
  794. package/renderers/nodes/inputs/TextureNode.js +0 -27
  795. package/renderers/nodes/inputs/Vector2Node.cjs.js +0 -1
  796. package/renderers/nodes/inputs/Vector2Node.js +0 -16
  797. package/renderers/nodes/inputs/Vector3Node.cjs.js +0 -1
  798. package/renderers/nodes/inputs/Vector3Node.js +0 -17
  799. package/renderers/nodes/inputs/Vector4Node.cjs.js +0 -1
  800. package/renderers/nodes/inputs/Vector4Node.js +0 -17
  801. package/renderers/nodes/math/MathNode.cjs.js +0 -1
  802. package/renderers/nodes/math/MathNode.js +0 -64
  803. package/renderers/nodes/math/OperatorNode.cjs.js +0 -1
  804. package/renderers/nodes/math/OperatorNode.js +0 -57
  805. package/renderers/nodes/utils/SwitchNode.cjs.js +0 -1
  806. package/renderers/nodes/utils/SwitchNode.js +0 -24
  807. package/renderers/nodes/utils/TimerNode.cjs.js +0 -1
  808. package/renderers/nodes/utils/TimerNode.js +0 -18
  809. package/renderers/webgpu/WebGPU.cjs.js +0 -1
  810. package/renderers/webgpu/WebGPU.js +0 -25
  811. package/renderers/webgpu/WebGPUAttributes.cjs.js +0 -1
  812. package/renderers/webgpu/WebGPUAttributes.js +0 -75
  813. package/renderers/webgpu/WebGPUBackground.cjs.js +0 -1
  814. package/renderers/webgpu/WebGPUBackground.js +0 -77
  815. package/renderers/webgpu/WebGPUBinding.cjs.js +0 -1
  816. package/renderers/webgpu/WebGPUBinding.js +0 -16
  817. package/renderers/webgpu/WebGPUBindings.cjs.js +0 -1
  818. package/renderers/webgpu/WebGPUBindings.js +0 -190
  819. package/renderers/webgpu/WebGPUComputePipelines.cjs.js +0 -1
  820. package/renderers/webgpu/WebGPUComputePipelines.js +0 -54
  821. package/renderers/webgpu/WebGPUGeometries.cjs.js +0 -1
  822. package/renderers/webgpu/WebGPUGeometries.js +0 -50
  823. package/renderers/webgpu/WebGPUInfo.cjs.js +0 -1
  824. package/renderers/webgpu/WebGPUInfo.js +0 -50
  825. package/renderers/webgpu/WebGPUObjects.cjs.js +0 -1
  826. package/renderers/webgpu/WebGPUObjects.js +0 -29
  827. package/renderers/webgpu/WebGPUProperties.cjs.js +0 -1
  828. package/renderers/webgpu/WebGPUProperties.js +0 -27
  829. package/renderers/webgpu/WebGPURenderLists.cjs.js +0 -1
  830. package/renderers/webgpu/WebGPURenderLists.js +0 -134
  831. package/renderers/webgpu/WebGPURenderPipelines.cjs.js +0 -1
  832. package/renderers/webgpu/WebGPURenderPipelines.js +0 -671
  833. package/renderers/webgpu/WebGPURenderer.cjs.js +0 -1
  834. package/renderers/webgpu/WebGPURenderer.js +0 -713
  835. package/renderers/webgpu/WebGPUSampledTexture.cjs.js +0 -1
  836. package/renderers/webgpu/WebGPUSampledTexture.js +0 -53
  837. package/renderers/webgpu/WebGPUSampler.cjs.js +0 -1
  838. package/renderers/webgpu/WebGPUSampler.js +0 -19
  839. package/renderers/webgpu/WebGPUStorageBuffer.cjs.js +0 -1
  840. package/renderers/webgpu/WebGPUStorageBuffer.js +0 -19
  841. package/renderers/webgpu/WebGPUTextureRenderer.cjs.js +0 -1
  842. package/renderers/webgpu/WebGPUTextureRenderer.js +0 -28
  843. package/renderers/webgpu/WebGPUTextureUtils.cjs.js +0 -1
  844. package/renderers/webgpu/WebGPUTextureUtils.js +0 -108
  845. package/renderers/webgpu/WebGPUTextures.cjs.js +0 -1
  846. package/renderers/webgpu/WebGPUTextures.js +0 -630
  847. package/renderers/webgpu/WebGPUUniform.cjs.js +0 -1
  848. package/renderers/webgpu/WebGPUUniform.js +0 -107
  849. package/renderers/webgpu/WebGPUUniformsGroup.cjs.js +0 -1
  850. package/renderers/webgpu/WebGPUUniformsGroup.js +0 -215
  851. package/renderers/webgpu/constants.cjs.js +0 -1
  852. package/renderers/webgpu/constants.js +0 -221
  853. package/renderers/webgpu/nodes/ShaderLib.cjs.js +0 -1
  854. package/renderers/webgpu/nodes/ShaderLib.js +0 -41
  855. package/renderers/webgpu/nodes/WebGPUNodeBuilder.cjs.js +0 -1
  856. package/renderers/webgpu/nodes/WebGPUNodeBuilder.js +0 -235
  857. package/renderers/webgpu/nodes/WebGPUNodeUniform.cjs.js +0 -1
  858. package/renderers/webgpu/nodes/WebGPUNodeUniform.js +0 -87
  859. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.cjs.js +0 -1
  860. package/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +0 -15
  861. package/renderers/webgpu/nodes/WebGPUNodes.cjs.js +0 -1
  862. package/renderers/webgpu/nodes/WebGPUNodes.js +0 -77
  863. package/shaders/ACESFilmicToneMappingShader.cjs.js +0 -1
  864. package/shaders/ACESFilmicToneMappingShader.d.ts +0 -9
  865. package/shaders/ACESFilmicToneMappingShader.js +0 -28
  866. package/shaders/AfterimageShader.cjs.js +0 -1
  867. package/shaders/AfterimageShader.d.ts +0 -10
  868. package/shaders/AfterimageShader.js +0 -22
  869. package/shaders/BasicShader.cjs.js +0 -1
  870. package/shaders/BasicShader.d.ts +0 -5
  871. package/shaders/BasicShader.js +0 -10
  872. package/shaders/BleachBypassShader.cjs.js +0 -1
  873. package/shaders/BleachBypassShader.d.ts +0 -9
  874. package/shaders/BleachBypassShader.js +0 -19
  875. package/shaders/BlendShader.cjs.js +0 -1
  876. package/shaders/BlendShader.d.ts +0 -18
  877. package/shaders/BlendShader.js +0 -23
  878. package/shaders/BokehShader.cjs.js +0 -1
  879. package/shaders/BokehShader.d.ts +0 -19
  880. package/shaders/BokehShader.js +0 -44
  881. package/shaders/BokehShader2.cjs.js +0 -1
  882. package/shaders/BokehShader2.d.ts +0 -43
  883. package/shaders/BokehShader2.js +0 -98
  884. package/shaders/BrightnessContrastShader.cjs.js +0 -1
  885. package/shaders/BrightnessContrastShader.d.ts +0 -15
  886. package/shaders/BrightnessContrastShader.js +0 -23
  887. package/shaders/ColorCorrectionShader.cjs.js +0 -1
  888. package/shaders/ColorCorrectionShader.d.ts +0 -19
  889. package/shaders/ColorCorrectionShader.js +0 -26
  890. package/shaders/ColorifyShader.cjs.js +0 -1
  891. package/shaders/ColorifyShader.d.ts +0 -13
  892. package/shaders/ColorifyShader.js +0 -20
  893. package/shaders/ConvolutionShader.cjs.js +0 -1
  894. package/shaders/ConvolutionShader.d.ts +0 -16
  895. package/shaders/ConvolutionShader.js +0 -51
  896. package/shaders/CopyShader.cjs.js +0 -1
  897. package/shaders/CopyShader.d.ts +0 -9
  898. package/shaders/CopyShader.js +0 -17
  899. package/shaders/DOFMipMapShader.cjs.js +0 -1
  900. package/shaders/DOFMipMapShader.d.ts +0 -18
  901. package/shaders/DOFMipMapShader.js +0 -25
  902. package/shaders/DepthLimitedBlurShader.cjs.js +0 -1
  903. package/shaders/DepthLimitedBlurShader.d.ts +0 -28
  904. package/shaders/DepthLimitedBlurShader.js +0 -69
  905. package/shaders/DigitalGlitch.cjs.js +0 -1
  906. package/shaders/DigitalGlitch.d.ts +0 -39
  907. package/shaders/DigitalGlitch.js +0 -106
  908. package/shaders/DotScreenShader.cjs.js +0 -1
  909. package/shaders/DotScreenShader.d.ts +0 -22
  910. package/shaders/DotScreenShader.js +0 -31
  911. package/shaders/FXAAShader.cjs.js +0 -1
  912. package/shaders/FXAAShader.d.ts +0 -13
  913. package/shaders/FXAAShader.js +0 -23
  914. package/shaders/FilmShader.cjs.js +0 -1
  915. package/shaders/FilmShader.d.ts +0 -24
  916. package/shaders/FilmShader.js +0 -56
  917. package/shaders/FocusShader.cjs.js +0 -1
  918. package/shaders/FocusShader.d.ts +0 -21
  919. package/shaders/FocusShader.js +0 -28
  920. package/shaders/FreiChenShader.cjs.js +0 -1
  921. package/shaders/FreiChenShader.d.ts +0 -13
  922. package/shaders/FreiChenShader.js +0 -28
  923. package/shaders/FresnelShader.cjs.js +0 -1
  924. package/shaders/FresnelShader.d.ts +0 -21
  925. package/shaders/FresnelShader.js +0 -26
  926. package/shaders/GammaCorrectionShader.cjs.js +0 -1
  927. package/shaders/GammaCorrectionShader.d.ts +0 -8
  928. package/shaders/GammaCorrectionShader.js +0 -15
  929. package/shaders/GodRaysShader.cjs.js +0 -1
  930. package/shaders/GodRaysShader.d.ts +0 -58
  931. package/shaders/GodRaysShader.js +0 -137
  932. package/shaders/HalftoneShader.cjs.js +0 -1
  933. package/shaders/HalftoneShader.d.ts +0 -45
  934. package/shaders/HalftoneShader.js +0 -69
  935. package/shaders/HorizontalBlurShader.cjs.js +0 -1
  936. package/shaders/HorizontalBlurShader.d.ts +0 -9
  937. package/shaders/HorizontalBlurShader.js +0 -59
  938. package/shaders/HorizontalTiltShiftShader.cjs.js +0 -1
  939. package/shaders/HorizontalTiltShiftShader.d.ts +0 -15
  940. package/shaders/HorizontalTiltShiftShader.js +0 -25
  941. package/shaders/HueSaturationShader.cjs.js +0 -1
  942. package/shaders/HueSaturationShader.d.ts +0 -15
  943. package/shaders/HueSaturationShader.js +0 -25
  944. package/shaders/KaleidoShader.cjs.js +0 -1
  945. package/shaders/KaleidoShader.d.ts +0 -15
  946. package/shaders/KaleidoShader.js +0 -26
  947. package/shaders/LuminosityHighPassShader.cjs.js +0 -1
  948. package/shaders/LuminosityHighPassShader.d.ts +0 -23
  949. package/shaders/LuminosityHighPassShader.js +0 -31
  950. package/shaders/LuminosityShader.cjs.js +0 -1
  951. package/shaders/LuminosityShader.d.ts +0 -9
  952. package/shaders/LuminosityShader.js +0 -15
  953. package/shaders/MirrorShader.cjs.js +0 -1
  954. package/shaders/MirrorShader.d.ts +0 -12
  955. package/shaders/MirrorShader.js +0 -20
  956. package/shaders/NormalMapShader.cjs.js +0 -1
  957. package/shaders/NormalMapShader.d.ts +0 -19
  958. package/shaders/NormalMapShader.js +0 -27
  959. package/shaders/ParallaxShader.cjs.js +0 -1
  960. package/shaders/ParallaxShader.d.ts +0 -28
  961. package/shaders/ParallaxShader.js +0 -54
  962. package/shaders/PixelShader.cjs.js +0 -1
  963. package/shaders/PixelShader.d.ts +0 -15
  964. package/shaders/PixelShader.js +0 -20
  965. package/shaders/RGBShiftShader.cjs.js +0 -1
  966. package/shaders/RGBShiftShader.d.ts +0 -15
  967. package/shaders/RGBShiftShader.js +0 -26
  968. package/shaders/SAOShader.cjs.js +0 -1
  969. package/shaders/SAOShader.d.ts +0 -25
  970. package/shaders/SAOShader.js +0 -60
  971. package/shaders/SMAAShader.cjs.js +0 -1
  972. package/shaders/SMAAShader.d.ts +0 -55
  973. package/shaders/SMAAShader.js +0 -151
  974. package/shaders/SSAOShader.cjs.js +0 -1
  975. package/shaders/SSAOShader.d.ts +0 -80
  976. package/shaders/SSAOShader.js +0 -100
  977. package/shaders/SSRShader.cjs.js +0 -1
  978. package/shaders/SSRShader.d.ts +0 -90
  979. package/shaders/SSRShader.js +0 -379
  980. package/shaders/SepiaShader.cjs.js +0 -1
  981. package/shaders/SepiaShader.d.ts +0 -12
  982. package/shaders/SepiaShader.js +0 -19
  983. package/shaders/SobelOperatorShader.cjs.js +0 -1
  984. package/shaders/SobelOperatorShader.d.ts +0 -13
  985. package/shaders/SobelOperatorShader.js +0 -33
  986. package/shaders/SubsurfaceScatteringShader.cjs.js +0 -1
  987. package/shaders/SubsurfaceScatteringShader.d.ts +0 -5
  988. package/shaders/SubsurfaceScatteringShader.js +0 -45
  989. package/shaders/TechnicolorShader.cjs.js +0 -1
  990. package/shaders/TechnicolorShader.d.ts +0 -9
  991. package/shaders/TechnicolorShader.js +0 -17
  992. package/shaders/ToneMapShader.cjs.js +0 -1
  993. package/shaders/ToneMapShader.d.ts +0 -24
  994. package/shaders/ToneMapShader.js +0 -32
  995. package/shaders/ToonShader.cjs.js +0 -1
  996. package/shaders/ToonShader.d.ts +0 -100
  997. package/shaders/ToonShader.js +0 -112
  998. package/shaders/TriangleBlurShader.cjs.js +0 -1
  999. package/shaders/TriangleBlurShader.d.ts +0 -13
  1000. package/shaders/TriangleBlurShader.js +0 -27
  1001. package/shaders/UnpackDepthRGBAShader.cjs.js +0 -1
  1002. package/shaders/UnpackDepthRGBAShader.d.ts +0 -12
  1003. package/shaders/UnpackDepthRGBAShader.js +0 -18
  1004. package/shaders/VerticalBlurShader.cjs.js +0 -1
  1005. package/shaders/VerticalBlurShader.d.ts +0 -9
  1006. package/shaders/VerticalBlurShader.js +0 -60
  1007. package/shaders/VerticalTiltShiftShader.cjs.js +0 -1
  1008. package/shaders/VerticalTiltShiftShader.d.ts +0 -15
  1009. package/shaders/VerticalTiltShiftShader.js +0 -25
  1010. package/shaders/VignetteShader.cjs.js +0 -1
  1011. package/shaders/VignetteShader.d.ts +0 -15
  1012. package/shaders/VignetteShader.js +0 -32
  1013. package/shaders/VolumeShader.cjs.js +0 -1
  1014. package/shaders/VolumeShader.d.ts +0 -25
  1015. package/shaders/VolumeShader.js +0 -81
  1016. package/shaders/WaterRefractionShader.cjs.js +0 -1
  1017. package/shaders/WaterRefractionShader.d.ts +0 -21
  1018. package/shaders/WaterRefractionShader.js +0 -25
  1019. package/shaders/types.cjs.js +0 -1
  1020. package/shaders/types.d.ts +0 -14
  1021. package/shaders/types.js +0 -1
  1022. package/textures/FlakesTexture.cjs.js +0 -1
  1023. package/textures/FlakesTexture.d.ts +0 -4
  1024. package/textures/FlakesTexture.js +0 -32
  1025. package/types/helpers.cjs.js +0 -1
  1026. package/types/helpers.d.ts +0 -1
  1027. package/types/helpers.js +0 -3
  1028. package/types/shared.cjs.js +0 -1
  1029. package/types/shared.d.ts +0 -2
  1030. package/types/shared.js +0 -1
  1031. package/types/utils.cjs.js +0 -1
  1032. package/types/utils.d.ts +0 -3
  1033. package/types/utils.js +0 -1
  1034. package/utils/BufferGeometryUtils.cjs.js +0 -1
  1035. package/utils/BufferGeometryUtils.d.ts +0 -15
  1036. package/utils/BufferGeometryUtils.js +0 -728
  1037. package/utils/GeometryCompressionUtils.cjs.js +0 -1
  1038. package/utils/GeometryCompressionUtils.d.ts +0 -7
  1039. package/utils/GeometryCompressionUtils.js +0 -545
  1040. package/utils/GeometryUtils.cjs.js +0 -1
  1041. package/utils/GeometryUtils.d.ts +0 -6
  1042. package/utils/GeometryUtils.js +0 -161
  1043. package/utils/LDrawUtils.cjs.js +0 -1
  1044. package/utils/LDrawUtils.d.ts +0 -5
  1045. package/utils/LDrawUtils.js +0 -144
  1046. package/utils/RoughnessMipmapper.cjs.js +0 -1
  1047. package/utils/RoughnessMipmapper.js +0 -257
  1048. package/utils/SceneUtils.cjs.js +0 -1
  1049. package/utils/SceneUtils.d.ts +0 -9
  1050. package/utils/SceneUtils.js +0 -41
  1051. package/utils/ShadowMapViewer.cjs.js +0 -1
  1052. package/utils/ShadowMapViewer.d.ts +0 -24
  1053. package/utils/ShadowMapViewer.js +0 -160
  1054. package/utils/SkeletonUtils.cjs.js +0 -1
  1055. package/utils/SkeletonUtils.d.ts +0 -30
  1056. package/utils/SkeletonUtils.js +0 -383
  1057. package/utils/UVsDebug.cjs.js +0 -1
  1058. package/utils/UVsDebug.d.ts +0 -3
  1059. package/utils/UVsDebug.js +0 -115
  1060. package/utils/WorkerPool.cjs.js +0 -1
  1061. package/utils/WorkerPool.js +0 -82
  1062. package/webxr/ARButton.cjs.js +0 -1
  1063. package/webxr/ARButton.d.ts +0 -5
  1064. package/webxr/ARButton.js +0 -145
  1065. package/webxr/OculusHandModel.cjs.js +0 -1
  1066. package/webxr/OculusHandModel.d.ts +0 -22
  1067. package/webxr/OculusHandModel.js +0 -90
  1068. package/webxr/OculusHandPointerModel.cjs.js +0 -1
  1069. package/webxr/OculusHandPointerModel.d.ts +0 -63
  1070. package/webxr/OculusHandPointerModel.js +0 -248
  1071. package/webxr/Text2D.cjs.js +0 -1
  1072. package/webxr/Text2D.d.ts +0 -3
  1073. package/webxr/Text2D.js +0 -32
  1074. package/webxr/VRButton.cjs.js +0 -1
  1075. package/webxr/VRButton.d.ts +0 -7
  1076. package/webxr/VRButton.js +0 -136
  1077. package/webxr/XRControllerModelFactory.cjs.js +0 -1
  1078. package/webxr/XRControllerModelFactory.d.ts +0 -19
  1079. package/webxr/XRControllerModelFactory.js +0 -237
  1080. package/webxr/XREstimatedLight.cjs.js +0 -1
  1081. package/webxr/XREstimatedLight.d.ts +0 -32
  1082. package/webxr/XREstimatedLight.js +0 -153
  1083. package/webxr/XRHandMeshModel.cjs.js +0 -1
  1084. package/webxr/XRHandMeshModel.d.ts +0 -9
  1085. package/webxr/XRHandMeshModel.js +0 -62
  1086. package/webxr/XRHandModelFactory.cjs.js +0 -1
  1087. package/webxr/XRHandModelFactory.d.ts +0 -25
  1088. package/webxr/XRHandModelFactory.js +0 -64
  1089. package/webxr/XRHandPrimitiveModel.cjs.js +0 -1
  1090. package/webxr/XRHandPrimitiveModel.d.ts +0 -24
  1091. package/webxr/XRHandPrimitiveModel.js +0 -54
@@ -1,1793 +0,0 @@
1
- import { Loader, LoaderUtils, FileLoader, TextureLoader, Vector3, Quaternion, Matrix4, Skeleton, BufferGeometry, MeshLambertMaterial, BufferAttribute, Mesh, SkinnedMesh, Object3D, MeshPhongMaterial, Bone, Color } from 'three';
2
-
3
- var AssimpLoader = function (manager) {
4
- Loader.call(this, manager);
5
- };
6
-
7
- AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
8
- constructor: AssimpLoader,
9
- load: function (url, onLoad, onProgress, onError) {
10
- var scope = this;
11
- var path = scope.path === '' ? LoaderUtils.extractUrlBase(url) : scope.path;
12
- var loader = new FileLoader(scope.manager);
13
- loader.setPath(scope.path);
14
- loader.setResponseType('arraybuffer');
15
- loader.setRequestHeader(scope.requestHeader);
16
- loader.setWithCredentials(scope.withCredentials);
17
- loader.load(url, function (buffer) {
18
- try {
19
- onLoad(scope.parse(buffer, path));
20
- } catch (e) {
21
- if (onError) {
22
- onError(e);
23
- } else {
24
- console.error(e);
25
- }
26
-
27
- scope.manager.itemError(url);
28
- }
29
- }, onProgress, onError);
30
- },
31
- parse: function (buffer, path) {
32
- var textureLoader = new TextureLoader(this.manager);
33
- textureLoader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
34
- var Virtulous = {};
35
-
36
- Virtulous.KeyFrame = function (time, matrix) {
37
- this.time = time;
38
- this.matrix = matrix.clone();
39
- this.position = new Vector3();
40
- this.quaternion = new Quaternion();
41
- this.scale = new Vector3(1, 1, 1);
42
- this.matrix.decompose(this.position, this.quaternion, this.scale);
43
-
44
- this.clone = function () {
45
- var n = new Virtulous.KeyFrame(this.time, this.matrix);
46
- return n;
47
- };
48
-
49
- this.lerp = function (nextKey, time) {
50
- time -= this.time;
51
- var dist = nextKey.time - this.time;
52
- var l = time / dist;
53
- var l2 = 1 - l;
54
- var keypos = this.position;
55
- var keyrot = this.quaternion; // var keyscl = key.parentspaceScl || key.scl;
56
-
57
- var key2pos = nextKey.position;
58
- var key2rot = nextKey.quaternion; // var key2scl = key2.parentspaceScl || key2.scl;
59
-
60
- Virtulous.KeyFrame.tempAniPos.x = keypos.x * l2 + key2pos.x * l;
61
- Virtulous.KeyFrame.tempAniPos.y = keypos.y * l2 + key2pos.y * l;
62
- Virtulous.KeyFrame.tempAniPos.z = keypos.z * l2 + key2pos.z * l; // tempAniScale.x = keyscl[0] * l2 + key2scl[0] * l;
63
- // tempAniScale.y = keyscl[1] * l2 + key2scl[1] * l;
64
- // tempAniScale.z = keyscl[2] * l2 + key2scl[2] * l;
65
-
66
- Virtulous.KeyFrame.tempAniQuat.set(keyrot.x, keyrot.y, keyrot.z, keyrot.w);
67
- Virtulous.KeyFrame.tempAniQuat.slerp(key2rot, l);
68
- return Virtulous.KeyFrame.tempAniMatrix.compose(Virtulous.KeyFrame.tempAniPos, Virtulous.KeyFrame.tempAniQuat, Virtulous.KeyFrame.tempAniScale);
69
- };
70
- };
71
-
72
- Virtulous.KeyFrame.tempAniPos = new Vector3();
73
- Virtulous.KeyFrame.tempAniQuat = new Quaternion();
74
- Virtulous.KeyFrame.tempAniScale = new Vector3(1, 1, 1);
75
- Virtulous.KeyFrame.tempAniMatrix = new Matrix4();
76
-
77
- Virtulous.KeyFrameTrack = function () {
78
- this.keys = [];
79
- this.target = null;
80
- this.time = 0;
81
- this.length = 0;
82
- this._accelTable = {};
83
- this.fps = 20;
84
-
85
- this.addKey = function (key) {
86
- this.keys.push(key);
87
- };
88
-
89
- this.init = function () {
90
- this.sortKeys();
91
- if (this.keys.length > 0) this.length = this.keys[this.keys.length - 1].time;else this.length = 0;
92
- if (!this.fps) return;
93
-
94
- for (let j = 0; j < this.length * this.fps; j++) {
95
- for (let i = 0; i < this.keys.length; i++) {
96
- if (this.keys[i].time == j) {
97
- this._accelTable[j] = i;
98
- break;
99
- } else if (this.keys[i].time < j / this.fps && this.keys[i + 1] && this.keys[i + 1].time >= j / this.fps) {
100
- this._accelTable[j] = i;
101
- break;
102
- }
103
- }
104
- }
105
- };
106
-
107
- this.parseFromThree = function (data) {
108
- var fps = data.fps;
109
- this.target = data.node;
110
- var track = data.hierarchy[0].keys;
111
-
112
- for (let i = 0; i < track.length; i++) {
113
- this.addKey(new Virtulous.KeyFrame(i / fps || track[i].time, track[i].targets[0].data));
114
- }
115
-
116
- this.init();
117
- };
118
-
119
- this.parseFromCollada = function (data) {
120
- var track = data.keys;
121
- var fps = this.fps;
122
-
123
- for (let i = 0; i < track.length; i++) {
124
- this.addKey(new Virtulous.KeyFrame(i / fps || track[i].time, track[i].matrix));
125
- }
126
-
127
- this.init();
128
- };
129
-
130
- this.sortKeys = function () {
131
- this.keys.sort(this.keySortFunc);
132
- };
133
-
134
- this.keySortFunc = function (a, b) {
135
- return a.time - b.time;
136
- };
137
-
138
- this.clone = function () {
139
- var t = new Virtulous.KeyFrameTrack();
140
- t.target = this.target;
141
- t.time = this.time;
142
- t.length = this.length;
143
-
144
- for (let i = 0; i < this.keys.length; i++) {
145
- t.addKey(this.keys[i].clone());
146
- }
147
-
148
- t.init();
149
- return t;
150
- };
151
-
152
- this.reTarget = function (root, compareitor) {
153
- if (!compareitor) compareitor = Virtulous.TrackTargetNodeNameCompare;
154
- this.target = compareitor(root, this.target);
155
- };
156
-
157
- this.keySearchAccel = function (time) {
158
- time *= this.fps;
159
- time = Math.floor(time);
160
- return this._accelTable[time] || 0;
161
- };
162
-
163
- this.setTime = function (time) {
164
- time = Math.abs(time);
165
- if (this.length) time = time % this.length + 0.05;
166
- var key0 = null;
167
- var key1 = null;
168
-
169
- for (let i = this.keySearchAccel(time); i < this.keys.length; i++) {
170
- if (this.keys[i].time == time) {
171
- key0 = this.keys[i];
172
- key1 = this.keys[i];
173
- break;
174
- } else if (this.keys[i].time < time && this.keys[i + 1] && this.keys[i + 1].time > time) {
175
- key0 = this.keys[i];
176
- key1 = this.keys[i + 1];
177
- break;
178
- } else if (this.keys[i].time < time && i == this.keys.length - 1) {
179
- key0 = this.keys[i];
180
- key1 = this.keys[0].clone();
181
- key1.time += this.length + 0.05;
182
- break;
183
- }
184
- }
185
-
186
- if (key0 && key1 && key0 !== key1) {
187
- this.target.matrixAutoUpdate = false;
188
- this.target.matrix.copy(key0.lerp(key1, time));
189
- this.target.matrixWorldNeedsUpdate = true;
190
- return;
191
- }
192
-
193
- if (key0 && key1 && key0 == key1) {
194
- this.target.matrixAutoUpdate = false;
195
- this.target.matrix.copy(key0.matrix);
196
- this.target.matrixWorldNeedsUpdate = true;
197
- return;
198
- }
199
- };
200
- };
201
-
202
- Virtulous.TrackTargetNodeNameCompare = function (root, target) {
203
- function find(node, name) {
204
- if (node.name == name) return node;
205
-
206
- for (let i = 0; i < node.children.length; i++) {
207
- var r = find(node.children[i], name);
208
- if (r) return r;
209
- }
210
-
211
- return null;
212
- }
213
-
214
- return find(root, target.name);
215
- };
216
-
217
- Virtulous.Animation = function () {
218
- this.tracks = [];
219
- this.length = 0;
220
-
221
- this.addTrack = function (track) {
222
- this.tracks.push(track);
223
- this.length = Math.max(track.length, this.length);
224
- };
225
-
226
- this.setTime = function (time) {
227
- this.time = time;
228
-
229
- for (let i = 0; i < this.tracks.length; i++) this.tracks[i].setTime(time);
230
- };
231
-
232
- this.clone = function (target, compareitor) {
233
- if (!compareitor) compareitor = Virtulous.TrackTargetNodeNameCompare;
234
- var n = new Virtulous.Animation();
235
- n.target = target;
236
-
237
- for (let i = 0; i < this.tracks.length; i++) {
238
- var track = this.tracks[i].clone();
239
- track.reTarget(target, compareitor);
240
- n.addTrack(track);
241
- }
242
-
243
- return n;
244
- };
245
- };
246
-
247
- var ASSBIN_CHUNK_AICAMERA = 0x1234;
248
- var ASSBIN_CHUNK_AILIGHT = 0x1235;
249
- var ASSBIN_CHUNK_AITEXTURE = 0x1236;
250
- var ASSBIN_CHUNK_AIMESH = 0x1237;
251
- var ASSBIN_CHUNK_AINODEANIM = 0x1238;
252
- var ASSBIN_CHUNK_AISCENE = 0x1239;
253
- var ASSBIN_CHUNK_AIBONE = 0x123a;
254
- var ASSBIN_CHUNK_AIANIMATION = 0x123b;
255
- var ASSBIN_CHUNK_AINODE = 0x123c;
256
- var ASSBIN_CHUNK_AIMATERIAL = 0x123d;
257
- var ASSBIN_CHUNK_AIMATERIALPROPERTY = 0x123e;
258
- var ASSBIN_MESH_HAS_POSITIONS = 0x1;
259
- var ASSBIN_MESH_HAS_NORMALS = 0x2;
260
- var ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS = 0x4;
261
- var ASSBIN_MESH_HAS_TEXCOORD_BASE = 0x100;
262
- var ASSBIN_MESH_HAS_COLOR_BASE = 0x10000;
263
- var AI_MAX_NUMBER_OF_COLOR_SETS = 1;
264
- var AI_MAX_NUMBER_OF_TEXTURECOORDS = 4; //var aiLightSource_UNDEFINED = 0x0;
265
- //! A directional light source has a well-defined direction
266
- //! but is infinitely far away. That's quite a good
267
- //! approximation for sun light.
268
-
269
- var aiLightSource_DIRECTIONAL = 0x1; //! A point light source has a well-defined position
270
- //! in space but no direction - it emits light in all
271
- //! directions. A normal bulb is a point light.
272
- //var aiLightSource_POINT = 0x2;
273
- //! A spot light source emits light in a specific
274
- //! angle. It has a position and a direction it is pointing to.
275
- //! A good example for a spot light is a light spot in
276
- //! sport arenas.
277
-
278
- var aiLightSource_SPOT = 0x3; //! The generic light level of the world, including the bounces
279
- //! of all other lightsources.
280
- //! Typically, there's at most one ambient light in a scene.
281
- //! This light type doesn't have a valid position, direction, or
282
- //! other properties, just a color.
283
- //var aiLightSource_AMBIENT = 0x4;
284
-
285
- /** Flat shading. Shading is done on per-face base,
286
- * diffuse only. Also known as 'faceted shading'.
287
- */
288
- //var aiShadingMode_Flat = 0x1;
289
-
290
- /** Simple Gouraud shading.
291
- */
292
- //var aiShadingMode_Gouraud = 0x2;
293
-
294
- /** Phong-Shading -
295
- */
296
- //var aiShadingMode_Phong = 0x3;
297
-
298
- /** Phong-Blinn-Shading
299
- */
300
- //var aiShadingMode_Blinn = 0x4;
301
-
302
- /** Toon-Shading per pixel
303
- *
304
- * Also known as 'comic' shader.
305
- */
306
- //var aiShadingMode_Toon = 0x5;
307
-
308
- /** OrenNayar-Shading per pixel
309
- *
310
- * Extension to standard Lambertian shading, taking the
311
- * roughness of the material into account
312
- */
313
- //var aiShadingMode_OrenNayar = 0x6;
314
-
315
- /** Minnaert-Shading per pixel
316
- *
317
- * Extension to standard Lambertian shading, taking the
318
- * "darkness" of the material into account
319
- */
320
- //var aiShadingMode_Minnaert = 0x7;
321
-
322
- /** CookTorrance-Shading per pixel
323
- *
324
- * Special shader for metallic surfaces.
325
- */
326
- //var aiShadingMode_CookTorrance = 0x8;
327
-
328
- /** No shading at all. Constant light influence of 1.0.
329
- */
330
- //var aiShadingMode_NoShading = 0x9;
331
-
332
- /** Fresnel shading
333
- */
334
- //var aiShadingMode_Fresnel = 0xa;
335
- //var aiTextureType_NONE = 0x0;
336
-
337
- /** The texture is combined with the result of the diffuse
338
- * lighting equation.
339
- */
340
-
341
- var aiTextureType_DIFFUSE = 0x1;
342
- /** The texture is combined with the result of the specular
343
- * lighting equation.
344
- */
345
- //var aiTextureType_SPECULAR = 0x2;
346
-
347
- /** The texture is combined with the result of the ambient
348
- * lighting equation.
349
- */
350
- //var aiTextureType_AMBIENT = 0x3;
351
-
352
- /** The texture is added to the result of the lighting
353
- * calculation. It isn't influenced by incoming light.
354
- */
355
- //var aiTextureType_EMISSIVE = 0x4;
356
-
357
- /** The texture is a height map.
358
- *
359
- * By convention, higher gray-scale values stand for
360
- * higher elevations from the base height.
361
- */
362
- //var aiTextureType_HEIGHT = 0x5;
363
-
364
- /** The texture is a (tangent space) normal-map.
365
- *
366
- * Again, there are several conventions for tangent-space
367
- * normal maps. Assimp does (intentionally) not
368
- * distinguish here.
369
- */
370
-
371
- var aiTextureType_NORMALS = 0x6;
372
- /** The texture defines the glossiness of the material.
373
- *
374
- * The glossiness is in fact the exponent of the specular
375
- * (phong) lighting equation. Usually there is a conversion
376
- * function defined to map the linear color values in the
377
- * texture to a suitable exponent. Have fun.
378
- */
379
- //var aiTextureType_SHININESS = 0x7;
380
-
381
- /** The texture defines per-pixel opacity.
382
- *
383
- * Usually 'white' means opaque and 'black' means
384
- * 'transparency'. Or quite the opposite. Have fun.
385
- */
386
-
387
- var aiTextureType_OPACITY = 0x8;
388
- /** Displacement texture
389
- *
390
- * The exact purpose and format is application-dependent.
391
- * Higher color values stand for higher vertex displacements.
392
- */
393
- //var aiTextureType_DISPLACEMENT = 0x9;
394
-
395
- /** Lightmap texture (aka Ambient Occlusion)
396
- *
397
- * Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
398
- * covered by this material property. The texture contains a
399
- * scaling value for the final color value of a pixel. Its
400
- * intensity is not affected by incoming light.
401
- */
402
-
403
- var aiTextureType_LIGHTMAP = 0xa;
404
- /** Reflection texture
405
- *
406
- * Contains the color of a perfect mirror reflection.
407
- * Rarely used, almost never for real-time applications.
408
- */
409
- //var aiTextureType_REFLECTION = 0xB;
410
-
411
- /** Unknown texture
412
- *
413
- * A texture reference that does not match any of the definitions
414
- * above is considered to be 'unknown'. It is still imported,
415
- * but is excluded from any further postprocessing.
416
- */
417
- //var aiTextureType_UNKNOWN = 0xC;
418
-
419
- var BONESPERVERT = 4;
420
-
421
- function ASSBIN_MESH_HAS_TEXCOORD(n) {
422
- return ASSBIN_MESH_HAS_TEXCOORD_BASE << n;
423
- }
424
-
425
- function ASSBIN_MESH_HAS_COLOR(n) {
426
- return ASSBIN_MESH_HAS_COLOR_BASE << n;
427
- }
428
-
429
- function markBones(scene) {
430
- for (let i in scene.mMeshes) {
431
- var mesh = scene.mMeshes[i];
432
-
433
- for (let k in mesh.mBones) {
434
- var boneNode = scene.findNode(mesh.mBones[k].mName);
435
- if (boneNode) boneNode.isBone = true;
436
- }
437
- }
438
- }
439
-
440
- function cloneTreeToBones(root, scene) {
441
- var rootBone = new Bone();
442
- rootBone.matrix.copy(root.matrix);
443
- rootBone.matrixWorld.copy(root.matrixWorld);
444
- rootBone.position.copy(root.position);
445
- rootBone.quaternion.copy(root.quaternion);
446
- rootBone.scale.copy(root.scale);
447
- scene.nodeCount++;
448
- rootBone.name = 'bone_' + root.name + scene.nodeCount.toString();
449
- if (!scene.nodeToBoneMap[root.name]) scene.nodeToBoneMap[root.name] = [];
450
- scene.nodeToBoneMap[root.name].push(rootBone);
451
-
452
- for (let i in root.children) {
453
- var child = cloneTreeToBones(root.children[i], scene);
454
- rootBone.add(child);
455
- }
456
-
457
- return rootBone;
458
- }
459
-
460
- function sortWeights(indexes, weights) {
461
- var pairs = [];
462
-
463
- for (let i = 0; i < indexes.length; i++) {
464
- pairs.push({
465
- i: indexes[i],
466
- w: weights[i]
467
- });
468
- }
469
-
470
- pairs.sort(function (a, b) {
471
- return b.w - a.w;
472
- });
473
-
474
- while (pairs.length < 4) {
475
- pairs.push({
476
- i: 0,
477
- w: 0
478
- });
479
- }
480
-
481
- if (pairs.length > 4) pairs.length = 4;
482
- var sum = 0;
483
-
484
- for (let i = 0; i < 4; i++) {
485
- sum += pairs[i].w * pairs[i].w;
486
- }
487
-
488
- sum = Math.sqrt(sum);
489
-
490
- for (let i = 0; i < 4; i++) {
491
- pairs[i].w = pairs[i].w / sum;
492
- indexes[i] = pairs[i].i;
493
- weights[i] = pairs[i].w;
494
- }
495
- }
496
-
497
- function findMatchingBone(root, name) {
498
- if (root.name.indexOf('bone_' + name) == 0) return root;
499
-
500
- for (let i in root.children) {
501
- var ret = findMatchingBone(root.children[i], name);
502
- if (ret) return ret;
503
- }
504
-
505
- return undefined;
506
- }
507
-
508
- function aiMesh() {
509
- this.mPrimitiveTypes = 0;
510
- this.mNumVertices = 0;
511
- this.mNumFaces = 0;
512
- this.mNumBones = 0;
513
- this.mMaterialIndex = 0;
514
- this.mVertices = [];
515
- this.mNormals = [];
516
- this.mTangents = [];
517
- this.mBitangents = [];
518
- this.mColors = [[]];
519
- this.mTextureCoords = [[]];
520
- this.mFaces = [];
521
- this.mBones = [];
522
-
523
- this.hookupSkeletons = function (scene) {
524
- if (this.mBones.length == 0) return;
525
- var allBones = [];
526
- var offsetMatrix = [];
527
- var skeletonRoot = scene.findNode(this.mBones[0].mName);
528
-
529
- while (skeletonRoot.mParent && skeletonRoot.mParent.isBone) {
530
- skeletonRoot = skeletonRoot.mParent;
531
- }
532
-
533
- var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
534
- var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
535
- this.threeNode.add(threeSkeletonRootBone);
536
-
537
- for (let i = 0; i < this.mBones.length; i++) {
538
- var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
539
-
540
- if (bone) {
541
- var tbone = bone;
542
- allBones.push(tbone); //tbone.matrixAutoUpdate = false;
543
-
544
- offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
545
- } else {
546
- var skeletonRoot = scene.findNode(this.mBones[i].mName);
547
- if (!skeletonRoot) return;
548
- var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
549
- var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
550
- this.threeNode.add(threeSkeletonRootBone);
551
- var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
552
- var tbone = bone;
553
- allBones.push(tbone); //tbone.matrixAutoUpdate = false;
554
-
555
- offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
556
- }
557
- }
558
-
559
- var skeleton = new Skeleton(allBones, offsetMatrix);
560
- this.threeNode.bind(skeleton, new Matrix4());
561
- this.threeNode.material.skinning = true;
562
- };
563
-
564
- this.toTHREE = function (scene) {
565
- if (this.threeNode) return this.threeNode;
566
- var geometry = new BufferGeometry();
567
- var mat;
568
- if (scene.mMaterials[this.mMaterialIndex]) mat = scene.mMaterials[this.mMaterialIndex].toTHREE(scene);else mat = new MeshLambertMaterial();
569
- geometry.setIndex(new BufferAttribute(new Uint32Array(this.mIndexArray), 1));
570
- geometry.setAttribute('position', new BufferAttribute(this.mVertexBuffer, 3));
571
-
572
- if (this.mNormalBuffer && this.mNormalBuffer.length > 0) {
573
- geometry.setAttribute('normal', new BufferAttribute(this.mNormalBuffer, 3));
574
- }
575
-
576
- if (this.mColorBuffer && this.mColorBuffer.length > 0) {
577
- geometry.setAttribute('color', new BufferAttribute(this.mColorBuffer, 4));
578
- }
579
-
580
- if (this.mTexCoordsBuffers[0] && this.mTexCoordsBuffers[0].length > 0) {
581
- geometry.setAttribute('uv', new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]), 2));
582
- }
583
-
584
- if (this.mTexCoordsBuffers[1] && this.mTexCoordsBuffers[1].length > 0) {
585
- geometry.setAttribute('uv1', new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]), 2));
586
- }
587
-
588
- if (this.mTangentBuffer && this.mTangentBuffer.length > 0) {
589
- geometry.setAttribute('tangents', new BufferAttribute(this.mTangentBuffer, 3));
590
- }
591
-
592
- if (this.mBitangentBuffer && this.mBitangentBuffer.length > 0) {
593
- geometry.setAttribute('bitangents', new BufferAttribute(this.mBitangentBuffer, 3));
594
- }
595
-
596
- if (this.mBones.length > 0) {
597
- var weights = [];
598
- var bones = [];
599
-
600
- for (let i = 0; i < this.mBones.length; i++) {
601
- for (let j = 0; j < this.mBones[i].mWeights.length; j++) {
602
- var weight = this.mBones[i].mWeights[j];
603
-
604
- if (weight) {
605
- if (!weights[weight.mVertexId]) weights[weight.mVertexId] = [];
606
- if (!bones[weight.mVertexId]) bones[weight.mVertexId] = [];
607
- weights[weight.mVertexId].push(weight.mWeight);
608
- bones[weight.mVertexId].push(parseInt(i));
609
- }
610
- }
611
- }
612
-
613
- for (let i in bones) {
614
- sortWeights(bones[i], weights[i]);
615
- }
616
-
617
- var _weights = [];
618
- var _bones = [];
619
-
620
- for (let i = 0; i < weights.length; i++) {
621
- for (let j = 0; j < 4; j++) {
622
- if (weights[i] && bones[i]) {
623
- _weights.push(weights[i][j]);
624
-
625
- _bones.push(bones[i][j]);
626
- } else {
627
- _weights.push(0);
628
-
629
- _bones.push(0);
630
- }
631
- }
632
- }
633
-
634
- geometry.setAttribute('skinWeight', new BufferAttribute(new Float32Array(_weights), BONESPERVERT));
635
- geometry.setAttribute('skinIndex', new BufferAttribute(new Float32Array(_bones), BONESPERVERT));
636
- }
637
-
638
- var mesh;
639
- if (this.mBones.length == 0) mesh = new Mesh(geometry, mat);
640
-
641
- if (this.mBones.length > 0) {
642
- mesh = new SkinnedMesh(geometry, mat);
643
- mesh.normalizeSkinWeights();
644
- }
645
-
646
- this.threeNode = mesh; //mesh.matrixAutoUpdate = false;
647
-
648
- return mesh;
649
- };
650
- }
651
-
652
- function aiFace() {
653
- this.mNumIndices = 0;
654
- this.mIndices = [];
655
- }
656
-
657
- function aiVector3D() {
658
- this.x = 0;
659
- this.y = 0;
660
- this.z = 0;
661
-
662
- this.toTHREE = function () {
663
- return new Vector3(this.x, this.y, this.z);
664
- };
665
- }
666
-
667
- function aiColor3D() {
668
- this.r = 0;
669
- this.g = 0;
670
- this.b = 0;
671
- this.a = 0;
672
-
673
- this.toTHREE = function () {
674
- return new Color(this.r, this.g, this.b);
675
- };
676
- }
677
-
678
- function aiQuaternion() {
679
- this.x = 0;
680
- this.y = 0;
681
- this.z = 0;
682
- this.w = 0;
683
-
684
- this.toTHREE = function () {
685
- return new Quaternion(this.x, this.y, this.z, this.w);
686
- };
687
- }
688
-
689
- function aiVertexWeight() {
690
- this.mVertexId = 0;
691
- this.mWeight = 0;
692
- }
693
-
694
- function aiString() {
695
- this.data = [];
696
-
697
- this.toString = function () {
698
- var str = '';
699
- this.data.forEach(function (i) {
700
- str += String.fromCharCode(i);
701
- });
702
- return str.replace(/[^\x20-\x7E]+/g, '');
703
- };
704
- }
705
-
706
- function aiVectorKey() {
707
- this.mTime = 0;
708
- this.mValue = null;
709
- }
710
-
711
- function aiQuatKey() {
712
- this.mTime = 0;
713
- this.mValue = null;
714
- }
715
-
716
- function aiNode() {
717
- this.mName = '';
718
- this.mTransformation = [];
719
- this.mNumChildren = 0;
720
- this.mNumMeshes = 0;
721
- this.mMeshes = [];
722
- this.mChildren = [];
723
-
724
- this.toTHREE = function (scene) {
725
- if (this.threeNode) return this.threeNode;
726
- var o = new Object3D();
727
- o.name = this.mName;
728
- o.matrix = this.mTransformation.toTHREE();
729
-
730
- for (let i = 0; i < this.mChildren.length; i++) {
731
- o.add(this.mChildren[i].toTHREE(scene));
732
- }
733
-
734
- for (let i = 0; i < this.mMeshes.length; i++) {
735
- o.add(scene.mMeshes[this.mMeshes[i]].toTHREE(scene));
736
- }
737
-
738
- this.threeNode = o; //o.matrixAutoUpdate = false;
739
-
740
- o.matrix.decompose(o.position, o.quaternion, o.scale);
741
- return o;
742
- };
743
- }
744
-
745
- function aiBone() {
746
- this.mName = '';
747
- this.mNumWeights = 0;
748
- this.mOffsetMatrix = 0;
749
- }
750
-
751
- function aiMaterialProperty() {
752
- this.mKey = '';
753
- this.mSemantic = 0;
754
- this.mIndex = 0;
755
- this.mData = [];
756
- this.mDataLength = 0;
757
- this.mType = 0;
758
-
759
- this.dataAsColor = function () {
760
- var array = new Uint8Array(this.mData).buffer;
761
- var reader = new DataView(array);
762
- var r = reader.getFloat32(0, true);
763
- var g = reader.getFloat32(4, true);
764
- var b = reader.getFloat32(8, true); //var a = reader.getFloat32(12, true);
765
-
766
- return new Color(r, g, b);
767
- };
768
-
769
- this.dataAsFloat = function () {
770
- var array = new Uint8Array(this.mData).buffer;
771
- var reader = new DataView(array);
772
- var r = reader.getFloat32(0, true);
773
- return r;
774
- };
775
-
776
- this.dataAsBool = function () {
777
- var array = new Uint8Array(this.mData).buffer;
778
- var reader = new DataView(array);
779
- var r = reader.getFloat32(0, true);
780
- return !!r;
781
- };
782
-
783
- this.dataAsString = function () {
784
- var s = new aiString();
785
- s.data = this.mData;
786
- return s.toString();
787
- };
788
-
789
- this.dataAsMap = function () {
790
- var s = new aiString();
791
- s.data = this.mData;
792
- var path = s.toString();
793
- path = path.replace(/\\/g, '/');
794
-
795
- if (path.indexOf('/') != -1) {
796
- path = path.substr(path.lastIndexOf('/') + 1);
797
- }
798
-
799
- return textureLoader.load(path);
800
- };
801
- }
802
-
803
- var namePropMapping = {
804
- '?mat.name': 'name',
805
- '$mat.shadingm': 'shading',
806
- '$mat.twosided': 'twoSided',
807
- '$mat.wireframe': 'wireframe',
808
- '$clr.ambient': 'ambient',
809
- '$clr.diffuse': 'color',
810
- '$clr.specular': 'specular',
811
- '$clr.emissive': 'emissive',
812
- '$clr.transparent': 'transparent',
813
- '$clr.reflective': 'reflect',
814
- '$mat.shininess': 'shininess',
815
- '$mat.reflectivity': 'reflectivity',
816
- '$mat.refracti': 'refraction',
817
- '$tex.file': 'map'
818
- };
819
- var nameTypeMapping = {
820
- '?mat.name': 'string',
821
- '$mat.shadingm': 'bool',
822
- '$mat.twosided': 'bool',
823
- '$mat.wireframe': 'bool',
824
- '$clr.ambient': 'color',
825
- '$clr.diffuse': 'color',
826
- '$clr.specular': 'color',
827
- '$clr.emissive': 'color',
828
- '$clr.transparent': 'color',
829
- '$clr.reflective': 'color',
830
- '$mat.shininess': 'float',
831
- '$mat.reflectivity': 'float',
832
- '$mat.refracti': 'float',
833
- '$tex.file': 'map'
834
- };
835
-
836
- function aiMaterial() {
837
- this.mNumAllocated = 0;
838
- this.mNumProperties = 0;
839
- this.mProperties = [];
840
-
841
- this.toTHREE = function () {
842
- var mat = new MeshPhongMaterial();
843
-
844
- for (let i = 0; i < this.mProperties.length; i++) {
845
- if (nameTypeMapping[this.mProperties[i].mKey] == 'float') {
846
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsFloat();
847
- }
848
-
849
- if (nameTypeMapping[this.mProperties[i].mKey] == 'color') {
850
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsColor();
851
- }
852
-
853
- if (nameTypeMapping[this.mProperties[i].mKey] == 'bool') {
854
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsBool();
855
- }
856
-
857
- if (nameTypeMapping[this.mProperties[i].mKey] == 'string') {
858
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsString();
859
- }
860
-
861
- if (nameTypeMapping[this.mProperties[i].mKey] == 'map') {
862
- var prop = this.mProperties[i];
863
- if (prop.mSemantic == aiTextureType_DIFFUSE) mat.map = this.mProperties[i].dataAsMap();
864
- if (prop.mSemantic == aiTextureType_NORMALS) mat.normalMap = this.mProperties[i].dataAsMap();
865
- if (prop.mSemantic == aiTextureType_LIGHTMAP) mat.lightMap = this.mProperties[i].dataAsMap();
866
- if (prop.mSemantic == aiTextureType_OPACITY) mat.alphaMap = this.mProperties[i].dataAsMap();
867
- }
868
- }
869
-
870
- mat.ambient.r = 0.53;
871
- mat.ambient.g = 0.53;
872
- mat.ambient.b = 0.53;
873
- mat.color.r = 1;
874
- mat.color.g = 1;
875
- mat.color.b = 1;
876
- return mat;
877
- };
878
- }
879
-
880
- function veclerp(v1, v2, l) {
881
- var v = new Vector3();
882
- var lm1 = 1 - l;
883
- v.x = v1.x * l + v2.x * lm1;
884
- v.y = v1.y * l + v2.y * lm1;
885
- v.z = v1.z * l + v2.z * lm1;
886
- return v;
887
- }
888
-
889
- function quatlerp(q1, q2, l) {
890
- return q1.clone().slerp(q2, 1 - l);
891
- }
892
-
893
- function sampleTrack(keys, time, lne, lerp) {
894
- if (keys.length == 1) return keys[0].mValue.toTHREE();
895
- var dist = Infinity;
896
- var key = null;
897
- var nextKey = null;
898
-
899
- for (let i = 0; i < keys.length; i++) {
900
- var timeDist = Math.abs(keys[i].mTime - time);
901
-
902
- if (timeDist < dist && keys[i].mTime <= time) {
903
- dist = timeDist;
904
- key = keys[i];
905
- nextKey = keys[i + 1];
906
- }
907
- }
908
-
909
- if (!key) {
910
- return null;
911
- } else if (nextKey) {
912
- var dT = nextKey.mTime - key.mTime;
913
- var T = key.mTime - time;
914
- var l = T / dT;
915
- return lerp(key.mValue.toTHREE(), nextKey.mValue.toTHREE(), l);
916
- } else {
917
- nextKey = keys[0].clone();
918
- nextKey.mTime += lne;
919
- var dT = nextKey.mTime - key.mTime;
920
- var T = key.mTime - time;
921
- var l = T / dT;
922
- return lerp(key.mValue.toTHREE(), nextKey.mValue.toTHREE(), l);
923
- }
924
- }
925
-
926
- function aiNodeAnim() {
927
- this.mNodeName = '';
928
- this.mNumPositionKeys = 0;
929
- this.mNumRotationKeys = 0;
930
- this.mNumScalingKeys = 0;
931
- this.mPositionKeys = [];
932
- this.mRotationKeys = [];
933
- this.mScalingKeys = [];
934
- this.mPreState = '';
935
- this.mPostState = '';
936
-
937
- this.init = function (tps) {
938
- if (!tps) tps = 1;
939
-
940
- function t(t) {
941
- t.mTime /= tps;
942
- }
943
-
944
- this.mPositionKeys.forEach(t);
945
- this.mRotationKeys.forEach(t);
946
- this.mScalingKeys.forEach(t);
947
- };
948
-
949
- this.sortKeys = function () {
950
- function comp(a, b) {
951
- return a.mTime - b.mTime;
952
- }
953
-
954
- this.mPositionKeys.sort(comp);
955
- this.mRotationKeys.sort(comp);
956
- this.mScalingKeys.sort(comp);
957
- };
958
-
959
- this.getLength = function () {
960
- return Math.max(Math.max.apply(null, this.mPositionKeys.map(function (a) {
961
- return a.mTime;
962
- })), Math.max.apply(null, this.mRotationKeys.map(function (a) {
963
- return a.mTime;
964
- })), Math.max.apply(null, this.mScalingKeys.map(function (a) {
965
- return a.mTime;
966
- })));
967
- };
968
-
969
- this.toTHREE = function (o) {
970
- this.sortKeys();
971
- var length = this.getLength();
972
- var track = new Virtulous.KeyFrameTrack();
973
-
974
- for (let i = 0; i < length; i += 0.05) {
975
- var matrix = new Matrix4();
976
- var time = i;
977
- var pos = sampleTrack(this.mPositionKeys, time, length, veclerp);
978
- var scale = sampleTrack(this.mScalingKeys, time, length, veclerp);
979
- var rotation = sampleTrack(this.mRotationKeys, time, length, quatlerp);
980
- matrix.compose(pos, rotation, scale);
981
- var key = new Virtulous.KeyFrame(time, matrix);
982
- track.addKey(key);
983
- }
984
-
985
- track.target = o.findNode(this.mNodeName).toTHREE();
986
- var tracks = [track];
987
-
988
- if (o.nodeToBoneMap[this.mNodeName]) {
989
- for (let i = 0; i < o.nodeToBoneMap[this.mNodeName].length; i++) {
990
- var t2 = track.clone();
991
- t2.target = o.nodeToBoneMap[this.mNodeName][i];
992
- tracks.push(t2);
993
- }
994
- }
995
-
996
- return tracks;
997
- };
998
- }
999
-
1000
- function aiAnimation() {
1001
- this.mName = '';
1002
- this.mDuration = 0;
1003
- this.mTicksPerSecond = 0;
1004
- this.mNumChannels = 0;
1005
- this.mChannels = [];
1006
-
1007
- this.toTHREE = function (root) {
1008
- var animationHandle = new Virtulous.Animation();
1009
-
1010
- for (let i in this.mChannels) {
1011
- this.mChannels[i].init(this.mTicksPerSecond);
1012
- var tracks = this.mChannels[i].toTHREE(root);
1013
-
1014
- for (let j in tracks) {
1015
- tracks[j].init();
1016
- animationHandle.addTrack(tracks[j]);
1017
- }
1018
- }
1019
-
1020
- animationHandle.length = Math.max.apply(null, animationHandle.tracks.map(function (e) {
1021
- return e.length;
1022
- }));
1023
- return animationHandle;
1024
- };
1025
- }
1026
-
1027
- function aiTexture() {
1028
- this.mWidth = 0;
1029
- this.mHeight = 0;
1030
- this.texAchFormatHint = [];
1031
- this.pcData = [];
1032
- }
1033
-
1034
- function aiLight() {
1035
- this.mName = '';
1036
- this.mType = 0;
1037
- this.mAttenuationConstant = 0;
1038
- this.mAttenuationLinear = 0;
1039
- this.mAttenuationQuadratic = 0;
1040
- this.mAngleInnerCone = 0;
1041
- this.mAngleOuterCone = 0;
1042
- this.mColorDiffuse = null;
1043
- this.mColorSpecular = null;
1044
- this.mColorAmbient = null;
1045
- }
1046
-
1047
- function aiCamera() {
1048
- this.mName = '';
1049
- this.mPosition = null;
1050
- this.mLookAt = null;
1051
- this.mUp = null;
1052
- this.mHorizontalFOV = 0;
1053
- this.mClipPlaneNear = 0;
1054
- this.mClipPlaneFar = 0;
1055
- this.mAspect = 0;
1056
- }
1057
-
1058
- function aiScene() {
1059
- this.versionMajor = 0;
1060
- this.versionMinor = 0;
1061
- this.versionRevision = 0;
1062
- this.compileFlags = 0;
1063
- this.mFlags = 0;
1064
- this.mNumMeshes = 0;
1065
- this.mNumMaterials = 0;
1066
- this.mNumAnimations = 0;
1067
- this.mNumTextures = 0;
1068
- this.mNumLights = 0;
1069
- this.mNumCameras = 0;
1070
- this.mRootNode = null;
1071
- this.mMeshes = [];
1072
- this.mMaterials = [];
1073
- this.mAnimations = [];
1074
- this.mLights = [];
1075
- this.mCameras = [];
1076
- this.nodeToBoneMap = {};
1077
-
1078
- this.findNode = function (name, root) {
1079
- if (!root) {
1080
- root = this.mRootNode;
1081
- }
1082
-
1083
- if (root.mName == name) {
1084
- return root;
1085
- }
1086
-
1087
- for (let i = 0; i < root.mChildren.length; i++) {
1088
- var ret = this.findNode(name, root.mChildren[i]);
1089
- if (ret) return ret;
1090
- }
1091
-
1092
- return null;
1093
- };
1094
-
1095
- this.toTHREE = function () {
1096
- this.nodeCount = 0;
1097
- markBones(this);
1098
- var o = this.mRootNode.toTHREE(this);
1099
-
1100
- for (let i in this.mMeshes) this.mMeshes[i].hookupSkeletons(this);
1101
-
1102
- if (this.mAnimations.length > 0) {
1103
- var a = this.mAnimations[0].toTHREE(this);
1104
- }
1105
-
1106
- return {
1107
- object: o,
1108
- animation: a
1109
- };
1110
- };
1111
- }
1112
-
1113
- function aiMatrix4() {
1114
- this.elements = [[], [], [], []];
1115
-
1116
- this.toTHREE = function () {
1117
- var m = new Matrix4();
1118
-
1119
- for (let i = 0; i < 4; ++i) {
1120
- for (let i2 = 0; i2 < 4; ++i2) {
1121
- m.elements[i * 4 + i2] = this.elements[i2][i];
1122
- }
1123
- }
1124
-
1125
- return m;
1126
- };
1127
- }
1128
-
1129
- var littleEndian = true;
1130
-
1131
- function readFloat(dataview) {
1132
- var val = dataview.getFloat32(dataview.readOffset, littleEndian);
1133
- dataview.readOffset += 4;
1134
- return val;
1135
- }
1136
-
1137
- function Read_double(dataview) {
1138
- var val = dataview.getFloat64(dataview.readOffset, littleEndian);
1139
- dataview.readOffset += 8;
1140
- return val;
1141
- }
1142
-
1143
- function Read_uint8_t(dataview) {
1144
- var val = dataview.getUint8(dataview.readOffset);
1145
- dataview.readOffset += 1;
1146
- return val;
1147
- }
1148
-
1149
- function Read_uint16_t(dataview) {
1150
- var val = dataview.getUint16(dataview.readOffset, littleEndian);
1151
- dataview.readOffset += 2;
1152
- return val;
1153
- }
1154
-
1155
- function Read_unsigned_int(dataview) {
1156
- var val = dataview.getUint32(dataview.readOffset, littleEndian);
1157
- dataview.readOffset += 4;
1158
- return val;
1159
- }
1160
-
1161
- function Read_uint32_t(dataview) {
1162
- var val = dataview.getUint32(dataview.readOffset, littleEndian);
1163
- dataview.readOffset += 4;
1164
- return val;
1165
- }
1166
-
1167
- function Read_aiVector3D(stream) {
1168
- var v = new aiVector3D();
1169
- v.x = readFloat(stream);
1170
- v.y = readFloat(stream);
1171
- v.z = readFloat(stream);
1172
- return v;
1173
- }
1174
-
1175
- function Read_aiColor3D(stream) {
1176
- var c = new aiColor3D();
1177
- c.r = readFloat(stream);
1178
- c.g = readFloat(stream);
1179
- c.b = readFloat(stream);
1180
- return c;
1181
- }
1182
-
1183
- function Read_aiQuaternion(stream) {
1184
- var v = new aiQuaternion();
1185
- v.w = readFloat(stream);
1186
- v.x = readFloat(stream);
1187
- v.y = readFloat(stream);
1188
- v.z = readFloat(stream);
1189
- return v;
1190
- }
1191
-
1192
- function Read_aiString(stream) {
1193
- var s = new aiString();
1194
- var stringlengthbytes = Read_unsigned_int(stream);
1195
- stream.ReadBytes(s.data, 1, stringlengthbytes);
1196
- return s.toString();
1197
- }
1198
-
1199
- function Read_aiVertexWeight(stream) {
1200
- var w = new aiVertexWeight();
1201
- w.mVertexId = Read_unsigned_int(stream);
1202
- w.mWeight = readFloat(stream);
1203
- return w;
1204
- }
1205
-
1206
- function Read_aiMatrix4x4(stream) {
1207
- var m = new aiMatrix4();
1208
-
1209
- for (let i = 0; i < 4; ++i) {
1210
- for (let i2 = 0; i2 < 4; ++i2) {
1211
- m.elements[i][i2] = readFloat(stream);
1212
- }
1213
- }
1214
-
1215
- return m;
1216
- }
1217
-
1218
- function Read_aiVectorKey(stream) {
1219
- var v = new aiVectorKey();
1220
- v.mTime = Read_double(stream);
1221
- v.mValue = Read_aiVector3D(stream);
1222
- return v;
1223
- }
1224
-
1225
- function Read_aiQuatKey(stream) {
1226
- var v = new aiQuatKey();
1227
- v.mTime = Read_double(stream);
1228
- v.mValue = Read_aiQuaternion(stream);
1229
- return v;
1230
- }
1231
-
1232
- function ReadArray_aiVertexWeight(stream, data, size) {
1233
- for (let i = 0; i < size; i++) data[i] = Read_aiVertexWeight(stream);
1234
- }
1235
-
1236
- function ReadArray_aiVectorKey(stream, data, size) {
1237
- for (let i = 0; i < size; i++) data[i] = Read_aiVectorKey(stream);
1238
- }
1239
-
1240
- function ReadArray_aiQuatKey(stream, data, size) {
1241
- for (let i = 0; i < size; i++) data[i] = Read_aiQuatKey(stream);
1242
- }
1243
-
1244
- function ReadBounds(stream, T
1245
- /*p*/
1246
- , n) {
1247
- // not sure what to do here, the data isn't really useful.
1248
- return stream.Seek(sizeof(T) * n, aiOrigin_CUR); // eslint-disable-line no-undef
1249
- }
1250
-
1251
- function ai_assert(bool) {
1252
- if (!bool) throw 'asset failed';
1253
- }
1254
-
1255
- function ReadBinaryNode(stream, parent, depth) {
1256
- var chunkID = Read_uint32_t(stream);
1257
- ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
1258
- /*uint32_t size =*/
1259
-
1260
- Read_uint32_t(stream);
1261
- var node = new aiNode();
1262
- node.mParent = parent;
1263
- node.mDepth = depth;
1264
- node.mName = Read_aiString(stream);
1265
- node.mTransformation = Read_aiMatrix4x4(stream);
1266
- node.mNumChildren = Read_unsigned_int(stream);
1267
- node.mNumMeshes = Read_unsigned_int(stream);
1268
-
1269
- if (node.mNumMeshes) {
1270
- node.mMeshes = [];
1271
-
1272
- for (let i = 0; i < node.mNumMeshes; ++i) {
1273
- node.mMeshes[i] = Read_unsigned_int(stream);
1274
- }
1275
- }
1276
-
1277
- if (node.mNumChildren) {
1278
- node.mChildren = [];
1279
-
1280
- for (let i = 0; i < node.mNumChildren; ++i) {
1281
- var node2 = ReadBinaryNode(stream, node, depth++);
1282
- node.mChildren[i] = node2;
1283
- }
1284
- }
1285
-
1286
- return node;
1287
- } // -----------------------------------------------------------------------------------
1288
-
1289
-
1290
- function ReadBinaryBone(stream, b) {
1291
- var chunkID = Read_uint32_t(stream);
1292
- ai_assert(chunkID == ASSBIN_CHUNK_AIBONE);
1293
- /*uint32_t size =*/
1294
-
1295
- Read_uint32_t(stream);
1296
- b.mName = Read_aiString(stream);
1297
- b.mNumWeights = Read_unsigned_int(stream);
1298
- b.mOffsetMatrix = Read_aiMatrix4x4(stream); // for the moment we write dumb min/max values for the bones, too.
1299
- // maybe I'll add a better, hash-like solution later
1300
-
1301
- if (shortened) {
1302
- ReadBounds(stream, b.mWeights, b.mNumWeights);
1303
- } else {
1304
- // else write as usual
1305
- b.mWeights = [];
1306
- ReadArray_aiVertexWeight(stream, b.mWeights, b.mNumWeights);
1307
- }
1308
-
1309
- return b;
1310
- }
1311
-
1312
- function ReadBinaryMesh(stream, mesh) {
1313
- var chunkID = Read_uint32_t(stream);
1314
- ai_assert(chunkID == ASSBIN_CHUNK_AIMESH);
1315
- /*uint32_t size =*/
1316
-
1317
- Read_uint32_t(stream);
1318
- mesh.mPrimitiveTypes = Read_unsigned_int(stream);
1319
- mesh.mNumVertices = Read_unsigned_int(stream);
1320
- mesh.mNumFaces = Read_unsigned_int(stream);
1321
- mesh.mNumBones = Read_unsigned_int(stream);
1322
- mesh.mMaterialIndex = Read_unsigned_int(stream);
1323
- mesh.mNumUVComponents = []; // first of all, write bits for all existent vertex components
1324
-
1325
- var c = Read_unsigned_int(stream);
1326
-
1327
- if (c & ASSBIN_MESH_HAS_POSITIONS) {
1328
- if (shortened) {
1329
- ReadBounds(stream, mesh.mVertices, mesh.mNumVertices);
1330
- } else {
1331
- // else write as usual
1332
- mesh.mVertices = [];
1333
- mesh.mVertexBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
1334
- stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
1335
- }
1336
- }
1337
-
1338
- if (c & ASSBIN_MESH_HAS_NORMALS) {
1339
- if (shortened) {
1340
- ReadBounds(stream, mesh.mNormals, mesh.mNumVertices);
1341
- } else {
1342
- // else write as usual
1343
- mesh.mNormals = [];
1344
- mesh.mNormalBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
1345
- stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
1346
- }
1347
- }
1348
-
1349
- if (c & ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS) {
1350
- if (shortened) {
1351
- ReadBounds(stream, mesh.mTangents, mesh.mNumVertices);
1352
- ReadBounds(stream, mesh.mBitangents, mesh.mNumVertices);
1353
- } else {
1354
- // else write as usual
1355
- mesh.mTangents = [];
1356
- mesh.mTangentBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
1357
- stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
1358
- mesh.mBitangents = [];
1359
- mesh.mBitangentBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
1360
- stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
1361
- }
1362
- }
1363
-
1364
- for (let n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS; ++n) {
1365
- if (!(c & ASSBIN_MESH_HAS_COLOR(n))) break;
1366
-
1367
- if (shortened) {
1368
- ReadBounds(stream, mesh.mColors[n], mesh.mNumVertices);
1369
- } else {
1370
- // else write as usual
1371
- mesh.mColors[n] = [];
1372
- mesh.mColorBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 4 * 4);
1373
- stream.Seek(mesh.mNumVertices * 4 * 4, aiOrigin_CUR);
1374
- }
1375
- }
1376
-
1377
- mesh.mTexCoordsBuffers = [];
1378
-
1379
- for (let n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++n) {
1380
- if (!(c & ASSBIN_MESH_HAS_TEXCOORD(n))) break; // write number of UV components
1381
-
1382
- mesh.mNumUVComponents[n] = Read_unsigned_int(stream);
1383
-
1384
- if (shortened) {
1385
- ReadBounds(stream, mesh.mTextureCoords[n], mesh.mNumVertices);
1386
- } else {
1387
- // else write as usual
1388
- mesh.mTextureCoords[n] = []; //note that assbin always writes 3d texcoords
1389
-
1390
- mesh.mTexCoordsBuffers[n] = [];
1391
-
1392
- for (let uv = 0; uv < mesh.mNumVertices; uv++) {
1393
- mesh.mTexCoordsBuffers[n].push(readFloat(stream));
1394
- mesh.mTexCoordsBuffers[n].push(readFloat(stream));
1395
- readFloat(stream);
1396
- }
1397
- }
1398
- } // write faces. There are no floating-point calculations involved
1399
- // in these, so we can write a simple hash over the face data
1400
- // to the dump file. We generate a single 32 Bit hash for 512 faces
1401
- // using Assimp's standard hashing function.
1402
-
1403
-
1404
- if (shortened) {
1405
- Read_unsigned_int(stream);
1406
- } else {
1407
- // else write as usual
1408
- // if there are less than 2^16 vertices, we can simply use 16 bit integers ...
1409
- mesh.mFaces = [];
1410
- mesh.mIndexArray = [];
1411
-
1412
- for (let i = 0; i < mesh.mNumFaces; ++i) {
1413
- var f = mesh.mFaces[i] = new aiFace(); // BOOST_STATIC_ASSERT(AI_MAX_FACE_INDICES <= 0xffff);
1414
-
1415
- f.mNumIndices = Read_uint16_t(stream);
1416
- f.mIndices = [];
1417
-
1418
- for (let a = 0; a < f.mNumIndices; ++a) {
1419
- if (mesh.mNumVertices < 1 << 16) {
1420
- f.mIndices[a] = Read_uint16_t(stream);
1421
- } else {
1422
- f.mIndices[a] = Read_unsigned_int(stream);
1423
- }
1424
- }
1425
-
1426
- if (f.mNumIndices === 3) {
1427
- mesh.mIndexArray.push(f.mIndices[0]);
1428
- mesh.mIndexArray.push(f.mIndices[1]);
1429
- mesh.mIndexArray.push(f.mIndices[2]);
1430
- } else if (f.mNumIndices === 4) {
1431
- mesh.mIndexArray.push(f.mIndices[0]);
1432
- mesh.mIndexArray.push(f.mIndices[1]);
1433
- mesh.mIndexArray.push(f.mIndices[2]);
1434
- mesh.mIndexArray.push(f.mIndices[2]);
1435
- mesh.mIndexArray.push(f.mIndices[3]);
1436
- mesh.mIndexArray.push(f.mIndices[0]);
1437
- } else {
1438
- throw new Error("Sorry, can't currently triangulate polys. Use the triangulate preprocessor in Assimp.");
1439
- }
1440
- }
1441
- } // write bones
1442
-
1443
-
1444
- if (mesh.mNumBones) {
1445
- mesh.mBones = [];
1446
-
1447
- for (let a = 0; a < mesh.mNumBones; ++a) {
1448
- mesh.mBones[a] = new aiBone();
1449
- ReadBinaryBone(stream, mesh.mBones[a]);
1450
- }
1451
- }
1452
- }
1453
-
1454
- function ReadBinaryMaterialProperty(stream, prop) {
1455
- var chunkID = Read_uint32_t(stream);
1456
- ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIALPROPERTY);
1457
- /*uint32_t size =*/
1458
-
1459
- Read_uint32_t(stream);
1460
- prop.mKey = Read_aiString(stream);
1461
- prop.mSemantic = Read_unsigned_int(stream);
1462
- prop.mIndex = Read_unsigned_int(stream);
1463
- prop.mDataLength = Read_unsigned_int(stream);
1464
- prop.mType = Read_unsigned_int(stream);
1465
- prop.mData = [];
1466
- stream.ReadBytes(prop.mData, 1, prop.mDataLength);
1467
- } // -----------------------------------------------------------------------------------
1468
-
1469
-
1470
- function ReadBinaryMaterial(stream, mat) {
1471
- var chunkID = Read_uint32_t(stream);
1472
- ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIAL);
1473
- /*uint32_t size =*/
1474
-
1475
- Read_uint32_t(stream);
1476
- mat.mNumAllocated = mat.mNumProperties = Read_unsigned_int(stream);
1477
-
1478
- if (mat.mNumProperties) {
1479
- if (mat.mProperties) {
1480
- delete mat.mProperties;
1481
- }
1482
-
1483
- mat.mProperties = [];
1484
-
1485
- for (let i = 0; i < mat.mNumProperties; ++i) {
1486
- mat.mProperties[i] = new aiMaterialProperty();
1487
- ReadBinaryMaterialProperty(stream, mat.mProperties[i]);
1488
- }
1489
- }
1490
- }
1491
-
1492
- function ReadBinaryNodeAnim(stream, nd) {
1493
- var chunkID = Read_uint32_t(stream);
1494
- ai_assert(chunkID == ASSBIN_CHUNK_AINODEANIM);
1495
- /*uint32_t size =*/
1496
-
1497
- Read_uint32_t(stream);
1498
- nd.mNodeName = Read_aiString(stream);
1499
- nd.mNumPositionKeys = Read_unsigned_int(stream);
1500
- nd.mNumRotationKeys = Read_unsigned_int(stream);
1501
- nd.mNumScalingKeys = Read_unsigned_int(stream);
1502
- nd.mPreState = Read_unsigned_int(stream);
1503
- nd.mPostState = Read_unsigned_int(stream);
1504
-
1505
- if (nd.mNumPositionKeys) {
1506
- if (shortened) {
1507
- ReadBounds(stream, nd.mPositionKeys, nd.mNumPositionKeys);
1508
- } else {
1509
- // else write as usual
1510
- nd.mPositionKeys = [];
1511
- ReadArray_aiVectorKey(stream, nd.mPositionKeys, nd.mNumPositionKeys);
1512
- }
1513
- }
1514
-
1515
- if (nd.mNumRotationKeys) {
1516
- if (shortened) {
1517
- ReadBounds(stream, nd.mRotationKeys, nd.mNumRotationKeys);
1518
- } else {
1519
- // else write as usual
1520
- nd.mRotationKeys = [];
1521
- ReadArray_aiQuatKey(stream, nd.mRotationKeys, nd.mNumRotationKeys);
1522
- }
1523
- }
1524
-
1525
- if (nd.mNumScalingKeys) {
1526
- if (shortened) {
1527
- ReadBounds(stream, nd.mScalingKeys, nd.mNumScalingKeys);
1528
- } else {
1529
- // else write as usual
1530
- nd.mScalingKeys = [];
1531
- ReadArray_aiVectorKey(stream, nd.mScalingKeys, nd.mNumScalingKeys);
1532
- }
1533
- }
1534
- }
1535
-
1536
- function ReadBinaryAnim(stream, anim) {
1537
- var chunkID = Read_uint32_t(stream);
1538
- ai_assert(chunkID == ASSBIN_CHUNK_AIANIMATION);
1539
- /*uint32_t size =*/
1540
-
1541
- Read_uint32_t(stream);
1542
- anim.mName = Read_aiString(stream);
1543
- anim.mDuration = Read_double(stream);
1544
- anim.mTicksPerSecond = Read_double(stream);
1545
- anim.mNumChannels = Read_unsigned_int(stream);
1546
-
1547
- if (anim.mNumChannels) {
1548
- anim.mChannels = [];
1549
-
1550
- for (let a = 0; a < anim.mNumChannels; ++a) {
1551
- anim.mChannels[a] = new aiNodeAnim();
1552
- ReadBinaryNodeAnim(stream, anim.mChannels[a]);
1553
- }
1554
- }
1555
- }
1556
-
1557
- function ReadBinaryTexture(stream, tex) {
1558
- var chunkID = Read_uint32_t(stream);
1559
- ai_assert(chunkID == ASSBIN_CHUNK_AITEXTURE);
1560
- /*uint32_t size =*/
1561
-
1562
- Read_uint32_t(stream);
1563
- tex.mWidth = Read_unsigned_int(stream);
1564
- tex.mHeight = Read_unsigned_int(stream);
1565
- stream.ReadBytes(tex.achFormatHint, 1, 4);
1566
-
1567
- if (!shortened) {
1568
- if (!tex.mHeight) {
1569
- tex.pcData = [];
1570
- stream.ReadBytes(tex.pcData, 1, tex.mWidth);
1571
- } else {
1572
- tex.pcData = [];
1573
- stream.ReadBytes(tex.pcData, 1, tex.mWidth * tex.mHeight * 4);
1574
- }
1575
- }
1576
- }
1577
-
1578
- function ReadBinaryLight(stream, l) {
1579
- var chunkID = Read_uint32_t(stream);
1580
- ai_assert(chunkID == ASSBIN_CHUNK_AILIGHT);
1581
- /*uint32_t size =*/
1582
-
1583
- Read_uint32_t(stream);
1584
- l.mName = Read_aiString(stream);
1585
- l.mType = Read_unsigned_int(stream);
1586
-
1587
- if (l.mType != aiLightSource_DIRECTIONAL) {
1588
- l.mAttenuationConstant = readFloat(stream);
1589
- l.mAttenuationLinear = readFloat(stream);
1590
- l.mAttenuationQuadratic = readFloat(stream);
1591
- }
1592
-
1593
- l.mColorDiffuse = Read_aiColor3D(stream);
1594
- l.mColorSpecular = Read_aiColor3D(stream);
1595
- l.mColorAmbient = Read_aiColor3D(stream);
1596
-
1597
- if (l.mType == aiLightSource_SPOT) {
1598
- l.mAngleInnerCone = readFloat(stream);
1599
- l.mAngleOuterCone = readFloat(stream);
1600
- }
1601
- }
1602
-
1603
- function ReadBinaryCamera(stream, cam) {
1604
- var chunkID = Read_uint32_t(stream);
1605
- ai_assert(chunkID == ASSBIN_CHUNK_AICAMERA);
1606
- /*uint32_t size =*/
1607
-
1608
- Read_uint32_t(stream);
1609
- cam.mName = Read_aiString(stream);
1610
- cam.mPosition = Read_aiVector3D(stream);
1611
- cam.mLookAt = Read_aiVector3D(stream);
1612
- cam.mUp = Read_aiVector3D(stream);
1613
- cam.mHorizontalFOV = readFloat(stream);
1614
- cam.mClipPlaneNear = readFloat(stream);
1615
- cam.mClipPlaneFar = readFloat(stream);
1616
- cam.mAspect = readFloat(stream);
1617
- }
1618
-
1619
- function ReadBinaryScene(stream, scene) {
1620
- var chunkID = Read_uint32_t(stream);
1621
- ai_assert(chunkID == ASSBIN_CHUNK_AISCENE);
1622
- /*uint32_t size =*/
1623
-
1624
- Read_uint32_t(stream);
1625
- scene.mFlags = Read_unsigned_int(stream);
1626
- scene.mNumMeshes = Read_unsigned_int(stream);
1627
- scene.mNumMaterials = Read_unsigned_int(stream);
1628
- scene.mNumAnimations = Read_unsigned_int(stream);
1629
- scene.mNumTextures = Read_unsigned_int(stream);
1630
- scene.mNumLights = Read_unsigned_int(stream);
1631
- scene.mNumCameras = Read_unsigned_int(stream); // Read node graph
1632
-
1633
- scene.mRootNode = new aiNode();
1634
- scene.mRootNode = ReadBinaryNode(stream, null, 0); // Read all meshes
1635
-
1636
- if (scene.mNumMeshes) {
1637
- scene.mMeshes = [];
1638
-
1639
- for (let i = 0; i < scene.mNumMeshes; ++i) {
1640
- scene.mMeshes[i] = new aiMesh();
1641
- ReadBinaryMesh(stream, scene.mMeshes[i]);
1642
- }
1643
- } // Read materials
1644
-
1645
-
1646
- if (scene.mNumMaterials) {
1647
- scene.mMaterials = [];
1648
-
1649
- for (let i = 0; i < scene.mNumMaterials; ++i) {
1650
- scene.mMaterials[i] = new aiMaterial();
1651
- ReadBinaryMaterial(stream, scene.mMaterials[i]);
1652
- }
1653
- } // Read all animations
1654
-
1655
-
1656
- if (scene.mNumAnimations) {
1657
- scene.mAnimations = [];
1658
-
1659
- for (let i = 0; i < scene.mNumAnimations; ++i) {
1660
- scene.mAnimations[i] = new aiAnimation();
1661
- ReadBinaryAnim(stream, scene.mAnimations[i]);
1662
- }
1663
- } // Read all textures
1664
-
1665
-
1666
- if (scene.mNumTextures) {
1667
- scene.mTextures = [];
1668
-
1669
- for (let i = 0; i < scene.mNumTextures; ++i) {
1670
- scene.mTextures[i] = new aiTexture();
1671
- ReadBinaryTexture(stream, scene.mTextures[i]);
1672
- }
1673
- } // Read lights
1674
-
1675
-
1676
- if (scene.mNumLights) {
1677
- scene.mLights = [];
1678
-
1679
- for (let i = 0; i < scene.mNumLights; ++i) {
1680
- scene.mLights[i] = new aiLight();
1681
- ReadBinaryLight(stream, scene.mLights[i]);
1682
- }
1683
- } // Read cameras
1684
-
1685
-
1686
- if (scene.mNumCameras) {
1687
- scene.mCameras = [];
1688
-
1689
- for (let i = 0; i < scene.mNumCameras; ++i) {
1690
- scene.mCameras[i] = new aiCamera();
1691
- ReadBinaryCamera(stream, scene.mCameras[i]);
1692
- }
1693
- }
1694
- }
1695
-
1696
- var aiOrigin_CUR = 0;
1697
- var aiOrigin_BEG = 1;
1698
-
1699
- function extendStream(stream) {
1700
- stream.readOffset = 0;
1701
-
1702
- stream.Seek = function (off, ori) {
1703
- if (ori == aiOrigin_CUR) {
1704
- stream.readOffset += off;
1705
- }
1706
-
1707
- if (ori == aiOrigin_BEG) {
1708
- stream.readOffset = off;
1709
- }
1710
- };
1711
-
1712
- stream.ReadBytes = function (buff, size, n) {
1713
- var bytes = size * n;
1714
-
1715
- for (let i = 0; i < bytes; i++) buff[i] = Read_uint8_t(this);
1716
- };
1717
-
1718
- stream.subArray32 = function (start, end) {
1719
- var buff = this.buffer;
1720
- var newbuff = buff.slice(start, end);
1721
- return new Float32Array(newbuff);
1722
- };
1723
-
1724
- stream.subArrayUint16 = function (start, end) {
1725
- var buff = this.buffer;
1726
- var newbuff = buff.slice(start, end);
1727
- return new Uint16Array(newbuff);
1728
- };
1729
-
1730
- stream.subArrayUint8 = function (start, end) {
1731
- var buff = this.buffer;
1732
- var newbuff = buff.slice(start, end);
1733
- return new Uint8Array(newbuff);
1734
- };
1735
-
1736
- stream.subArrayUint32 = function (start, end) {
1737
- var buff = this.buffer;
1738
- var newbuff = buff.slice(start, end);
1739
- return new Uint32Array(newbuff);
1740
- };
1741
- }
1742
-
1743
- var shortened, compressed;
1744
-
1745
- function InternReadFile(pFiledata) {
1746
- var pScene = new aiScene();
1747
- var stream = new DataView(pFiledata);
1748
- extendStream(stream);
1749
- stream.Seek(44, aiOrigin_CUR); // signature
1750
-
1751
- /*unsigned int versionMajor =*/
1752
-
1753
- pScene.versionMajor = Read_unsigned_int(stream);
1754
- /*unsigned int versionMinor =*/
1755
-
1756
- pScene.versionMinor = Read_unsigned_int(stream);
1757
- /*unsigned int versionRevision =*/
1758
-
1759
- pScene.versionRevision = Read_unsigned_int(stream);
1760
- /*unsigned int compileFlags =*/
1761
-
1762
- pScene.compileFlags = Read_unsigned_int(stream);
1763
- shortened = Read_uint16_t(stream) > 0;
1764
- compressed = Read_uint16_t(stream) > 0;
1765
- if (shortened) throw 'Shortened binaries are not supported!';
1766
- stream.Seek(256, aiOrigin_CUR); // original filename
1767
-
1768
- stream.Seek(128, aiOrigin_CUR); // options
1769
-
1770
- stream.Seek(64, aiOrigin_CUR); // padding
1771
-
1772
- if (compressed) {
1773
- var uncompressedSize = Read_uint32_t(stream);
1774
- var compressedSize = stream.FileSize() - stream.Tell();
1775
- var compressedData = [];
1776
- stream.Read(compressedData, 1, compressedSize);
1777
- var uncompressedData = [];
1778
- uncompress(uncompressedData, uncompressedSize, compressedData, compressedSize); // eslint-disable-line no-undef
1779
-
1780
- var buff = new ArrayBuffer(uncompressedData);
1781
- ReadBinaryScene(buff, pScene);
1782
- } else {
1783
- ReadBinaryScene(stream, pScene);
1784
- }
1785
-
1786
- return pScene.toTHREE();
1787
- }
1788
-
1789
- return InternReadFile(buffer);
1790
- }
1791
- });
1792
-
1793
- export { AssimpLoader };