three-stdlib 2.22.8 → 2.22.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (629) hide show
  1. package/dist/animation/AnimationClipCreator.js +49 -50
  2. package/dist/animation/AnimationClipCreator.mjs +49 -50
  3. package/dist/animation/CCDIKSolver.d.ts +9 -4
  4. package/dist/animation/CCDIKSolver.js +193 -148
  5. package/dist/animation/CCDIKSolver.mjs +194 -149
  6. package/dist/animation/MMDAnimationHelper.js +613 -515
  7. package/dist/animation/MMDAnimationHelper.mjs +613 -515
  8. package/dist/animation/MMDPhysics.d.ts +6 -1
  9. package/dist/animation/MMDPhysics.js +728 -718
  10. package/dist/animation/MMDPhysics.mjs +729 -719
  11. package/dist/cameras/CinematicCamera.d.ts +2 -2
  12. package/dist/controls/ArcballControls.d.ts +1 -1
  13. package/dist/controls/ArcballControls.js +38 -44
  14. package/dist/controls/ArcballControls.mjs +39 -45
  15. package/dist/controls/DeviceOrientationControls.js +2 -1
  16. package/dist/controls/DeviceOrientationControls.mjs +2 -1
  17. package/dist/controls/FirstPersonControls.d.ts +1 -1
  18. package/dist/controls/FirstPersonControls.js +1 -1
  19. package/dist/controls/FirstPersonControls.mjs +1 -1
  20. package/dist/controls/PointerLockControls.js +2 -2
  21. package/dist/controls/PointerLockControls.mjs +2 -2
  22. package/dist/controls/TransformControls.d.ts +1 -1
  23. package/dist/controls/experimental/CameraControls.d.ts +1 -1
  24. package/dist/csm/CSM.js +4 -4
  25. package/dist/csm/CSM.mjs +4 -4
  26. package/dist/csm/CSMFrustum.js +1 -1
  27. package/dist/csm/CSMFrustum.mjs +1 -1
  28. package/dist/csm/CSMShader.js +14 -10
  29. package/dist/csm/CSMShader.mjs +14 -10
  30. package/dist/curves/CurveExtras.js +52 -62
  31. package/dist/curves/CurveExtras.mjs +53 -63
  32. package/dist/curves/NURBSUtils.d.ts +18 -20
  33. package/dist/curves/NURBSUtils.js +17 -17
  34. package/dist/curves/NURBSUtils.mjs +17 -17
  35. package/dist/deprecated/Geometry.js +26 -26
  36. package/dist/deprecated/Geometry.mjs +27 -27
  37. package/dist/effects/AnaglyphEffect.js +95 -114
  38. package/dist/effects/AnaglyphEffect.mjs +95 -114
  39. package/dist/effects/AsciiEffect.js +144 -162
  40. package/dist/effects/AsciiEffect.mjs +144 -162
  41. package/dist/effects/OutlineEffect.js +253 -276
  42. package/dist/effects/OutlineEffect.mjs +253 -276
  43. package/dist/effects/ParallaxBarrierEffect.js +61 -60
  44. package/dist/effects/ParallaxBarrierEffect.mjs +61 -60
  45. package/dist/effects/PeppersGhostEffect.js +84 -81
  46. package/dist/effects/PeppersGhostEffect.mjs +84 -81
  47. package/dist/effects/StereoEffect.js +31 -28
  48. package/dist/effects/StereoEffect.mjs +31 -28
  49. package/dist/environments/RoomEnvironment.d.ts +6 -5
  50. package/dist/exporters/GLTFExporter.d.ts +109 -441
  51. package/dist/exporters/GLTFExporter.js +912 -581
  52. package/dist/exporters/GLTFExporter.mjs +912 -581
  53. package/dist/geometries/ConvexGeometry.js +0 -3
  54. package/dist/geometries/ConvexGeometry.mjs +0 -3
  55. package/dist/geometries/LightningStrike.d.ts +3 -3
  56. package/dist/geometries/LightningStrike.js +80 -75
  57. package/dist/geometries/LightningStrike.mjs +80 -75
  58. package/dist/geometries/ParametricGeometries.js +75 -74
  59. package/dist/geometries/ParametricGeometries.mjs +75 -74
  60. package/dist/geometries/RoundedBoxGeometry.js +1 -1
  61. package/dist/geometries/RoundedBoxGeometry.mjs +1 -1
  62. package/dist/geometries/TextGeometry.d.ts +1 -1
  63. package/dist/helpers/RectAreaLightHelper.d.ts +4 -3
  64. package/dist/helpers/RectAreaLightHelper.js +2 -2
  65. package/dist/helpers/RectAreaLightHelper.mjs +2 -2
  66. package/dist/helpers/VertexNormalsHelper.d.ts +3 -0
  67. package/dist/helpers/VertexNormalsHelper.js +15 -22
  68. package/dist/helpers/VertexNormalsHelper.mjs +16 -23
  69. package/dist/helpers/VertexTangentsHelper.d.ts +3 -0
  70. package/dist/helpers/VertexTangentsHelper.js +12 -14
  71. package/dist/helpers/VertexTangentsHelper.mjs +12 -14
  72. package/dist/index.d.ts +1 -66
  73. package/dist/index.js +5 -370
  74. package/dist/index.mjs +9 -374
  75. package/dist/interactive/InteractiveGroup.js +1 -1
  76. package/dist/interactive/InteractiveGroup.mjs +1 -1
  77. package/dist/interactive/SelectionBox.js +122 -125
  78. package/dist/interactive/SelectionBox.mjs +122 -125
  79. package/dist/interactive/SelectionHelper.js +45 -48
  80. package/dist/interactive/SelectionHelper.mjs +45 -48
  81. package/dist/libs/MeshoptDecoder.d.ts +1 -1
  82. package/dist/libs/MotionControllers.d.ts +15 -14
  83. package/dist/libs/MotionControllers.js +10 -10
  84. package/dist/libs/MotionControllers.mjs +10 -10
  85. package/dist/lights/LightProbeGenerator.js +43 -43
  86. package/dist/lights/LightProbeGenerator.mjs +43 -43
  87. package/dist/lights/RectAreaLightUniformsLib.js +9 -5
  88. package/dist/lights/RectAreaLightUniformsLib.mjs +9 -5
  89. package/dist/lines/LineMaterial.js +271 -271
  90. package/dist/lines/LineMaterial.mjs +272 -272
  91. package/dist/lines/LineSegments2.js +12 -12
  92. package/dist/lines/LineSegments2.mjs +12 -12
  93. package/dist/lines/LineSegmentsGeometry.js +2 -2
  94. package/dist/lines/LineSegmentsGeometry.mjs +2 -2
  95. package/dist/lines/Wireframe.js +2 -2
  96. package/dist/lines/Wireframe.mjs +2 -2
  97. package/dist/loaders/3DMLoader.d.ts +2 -1
  98. package/dist/loaders/3MFLoader.d.ts +2 -1
  99. package/dist/loaders/AMFLoader.d.ts +2 -1
  100. package/dist/loaders/AssimpLoader.d.ts +20 -0
  101. package/dist/loaders/AssimpLoader.js +520 -482
  102. package/dist/loaders/AssimpLoader.mjs +520 -482
  103. package/dist/loaders/BVHLoader.d.ts +2 -1
  104. package/dist/loaders/BasisTextureLoader.d.ts +2 -1
  105. package/dist/loaders/BasisTextureLoader.js +23 -14
  106. package/dist/loaders/BasisTextureLoader.mjs +24 -15
  107. package/dist/loaders/ColladaLoader.d.ts +2 -1
  108. package/dist/loaders/DRACOLoader.d.ts +2 -1
  109. package/dist/loaders/FBXLoader.d.ts +2 -1
  110. package/dist/loaders/FBXLoader.js +2 -2
  111. package/dist/loaders/FBXLoader.mjs +2 -2
  112. package/dist/loaders/FontLoader.d.ts +4 -4
  113. package/dist/loaders/FontLoader.js +2 -1
  114. package/dist/loaders/FontLoader.mjs +2 -1
  115. package/dist/loaders/GCodeLoader.d.ts +2 -1
  116. package/dist/loaders/GLTFLoader.d.ts +11 -9
  117. package/dist/loaders/GLTFLoader.js +2 -2
  118. package/dist/loaders/GLTFLoader.mjs +2 -2
  119. package/dist/loaders/HDRCubeTextureLoader.d.ts +2 -1
  120. package/dist/loaders/KMZLoader.d.ts +2 -1
  121. package/dist/loaders/KTX2Loader.js +34 -15
  122. package/dist/loaders/KTX2Loader.mjs +35 -16
  123. package/dist/loaders/LDrawLoader.d.ts +2 -1
  124. package/dist/loaders/LDrawLoader.js +3 -3
  125. package/dist/loaders/LDrawLoader.mjs +3 -3
  126. package/dist/loaders/LUT3dlLoader.d.ts +3 -2
  127. package/dist/loaders/LUTCubeLoader.d.ts +3 -2
  128. package/dist/loaders/LWOLoader.d.ts +2 -1
  129. package/dist/loaders/LottieLoader.d.ts +2 -1
  130. package/dist/loaders/MD2Loader.d.ts +2 -1
  131. package/dist/loaders/MDDLoader.d.ts +2 -1
  132. package/dist/loaders/MMDLoader.d.ts +2 -1
  133. package/dist/loaders/MTLLoader.d.ts +2 -1
  134. package/dist/loaders/OBJLoader.d.ts +2 -1
  135. package/dist/loaders/OBJLoader.js +5 -5
  136. package/dist/loaders/OBJLoader.mjs +5 -5
  137. package/dist/loaders/PCDLoader.d.ts +2 -1
  138. package/dist/loaders/PDBLoader.d.ts +2 -1
  139. package/dist/loaders/PLYLoader.d.ts +2 -1
  140. package/dist/loaders/PRWMLoader.d.ts +2 -1
  141. package/dist/loaders/RGBMLoader.js +924 -918
  142. package/dist/loaders/RGBMLoader.mjs +924 -918
  143. package/dist/loaders/STLLoader.d.ts +2 -1
  144. package/dist/loaders/SVGLoader.d.ts +2 -1
  145. package/dist/loaders/TDSLoader.d.ts +2 -1
  146. package/dist/loaders/TTFLoader.d.ts +2 -1
  147. package/dist/loaders/TiltLoader.d.ts +2 -1
  148. package/dist/loaders/TiltLoader.js +3 -1
  149. package/dist/loaders/TiltLoader.mjs +3 -1
  150. package/dist/loaders/VOXLoader.d.ts +4 -2
  151. package/dist/loaders/VRMLLoader.d.ts +2 -1
  152. package/dist/loaders/VRMLoader.d.ts +20 -0
  153. package/dist/loaders/VTKLoader.d.ts +2 -1
  154. package/dist/loaders/XLoader.d.ts +20 -0
  155. package/dist/loaders/XLoader.js +1 -1
  156. package/dist/loaders/XLoader.mjs +1 -1
  157. package/dist/loaders/XYZLoader.d.ts +2 -1
  158. package/dist/loaders/lwo/IFFParser.js +104 -110
  159. package/dist/loaders/lwo/IFFParser.mjs +104 -110
  160. package/dist/loaders/lwo/LWO2Parser.js +18 -33
  161. package/dist/loaders/lwo/LWO2Parser.mjs +18 -33
  162. package/dist/loaders/lwo/LWO3Parser.js +17 -33
  163. package/dist/loaders/lwo/LWO3Parser.mjs +17 -33
  164. package/dist/math/Capsule.d.ts +1 -1
  165. package/dist/math/Capsule.js +90 -92
  166. package/dist/math/Capsule.mjs +90 -92
  167. package/dist/math/ColorConverter.js +26 -36
  168. package/dist/math/ColorConverter.mjs +26 -36
  169. package/dist/math/ConvexHull.js +16 -17
  170. package/dist/math/ConvexHull.mjs +17 -18
  171. package/dist/math/ImprovedNoise.js +41 -39
  172. package/dist/math/ImprovedNoise.mjs +41 -39
  173. package/dist/math/Lut.js +65 -63
  174. package/dist/math/Lut.mjs +66 -64
  175. package/dist/math/MeshSurfaceSampler.d.ts +3 -0
  176. package/dist/math/MeshSurfaceSampler.js +85 -89
  177. package/dist/math/MeshSurfaceSampler.mjs +85 -89
  178. package/dist/math/OBB.js +68 -88
  179. package/dist/math/OBB.mjs +68 -88
  180. package/dist/math/Octree.js +240 -245
  181. package/dist/math/Octree.mjs +240 -245
  182. package/dist/misc/ConvexObjectBreaker.js +114 -120
  183. package/dist/misc/ConvexObjectBreaker.mjs +115 -121
  184. package/dist/misc/GPUComputationRenderer.d.ts +1 -0
  185. package/dist/misc/GPUComputationRenderer.js +191 -157
  186. package/dist/misc/GPUComputationRenderer.mjs +192 -158
  187. package/dist/misc/Gyroscope.js +16 -18
  188. package/dist/misc/Gyroscope.mjs +17 -19
  189. package/dist/misc/MD2Character.js +88 -86
  190. package/dist/misc/MD2Character.mjs +89 -87
  191. package/dist/misc/MD2CharacterComplex.js +106 -105
  192. package/dist/misc/MD2CharacterComplex.mjs +107 -106
  193. package/dist/misc/MorphAnimMesh.d.ts +1 -1
  194. package/dist/misc/MorphAnimMesh.js +33 -33
  195. package/dist/misc/MorphAnimMesh.mjs +33 -33
  196. package/dist/misc/MorphBlendMesh.js +68 -68
  197. package/dist/misc/MorphBlendMesh.mjs +68 -68
  198. package/dist/misc/ProgressiveLightmap.d.ts +1 -2
  199. package/dist/misc/RollerCoaster.js +321 -314
  200. package/dist/misc/RollerCoaster.mjs +322 -315
  201. package/dist/misc/Volume.d.ts +1 -1
  202. package/dist/misc/Volume.js +169 -166
  203. package/dist/misc/Volume.mjs +170 -167
  204. package/dist/misc/VolumeSlice.js +50 -51
  205. package/dist/misc/VolumeSlice.mjs +50 -51
  206. package/dist/modifiers/CurveModifier.d.ts +2 -2
  207. package/dist/modifiers/CurveModifier.js +1 -1
  208. package/dist/modifiers/CurveModifier.mjs +1 -1
  209. package/dist/modifiers/SimplifyModifier.js +2 -1
  210. package/dist/modifiers/SimplifyModifier.mjs +2 -1
  211. package/dist/objects/Lensflare.js +32 -21
  212. package/dist/objects/Lensflare.mjs +33 -22
  213. package/dist/objects/LightningStorm.d.ts +3 -3
  214. package/dist/objects/LightningStorm.js +3 -3
  215. package/dist/objects/LightningStorm.mjs +3 -3
  216. package/dist/objects/MarchingCubes.d.ts +1 -0
  217. package/dist/objects/MarchingCubes.js +4362 -10
  218. package/dist/objects/MarchingCubes.mjs +4363 -11
  219. package/dist/objects/Reflector.d.ts +5 -2
  220. package/dist/objects/Reflector.js +39 -12
  221. package/dist/objects/Reflector.mjs +40 -13
  222. package/dist/objects/ReflectorForSSRPass.js +25 -21
  223. package/dist/objects/ReflectorForSSRPass.mjs +26 -22
  224. package/dist/objects/ReflectorRTT.d.ts +6 -0
  225. package/dist/objects/Refractor.d.ts +5 -2
  226. package/dist/objects/Refractor.js +39 -12
  227. package/dist/objects/Refractor.mjs +40 -13
  228. package/dist/objects/ShadowMesh.d.ts +6 -3
  229. package/dist/objects/ShadowMesh.js +7 -3
  230. package/dist/objects/ShadowMesh.mjs +8 -4
  231. package/dist/objects/Sky.js +181 -137
  232. package/dist/objects/Sky.mjs +182 -138
  233. package/dist/objects/Water.d.ts +3 -3
  234. package/dist/objects/Water.js +3 -2
  235. package/dist/objects/Water.mjs +3 -2
  236. package/dist/objects/Water2.d.ts +2 -2
  237. package/dist/objects/Water2.js +16 -18
  238. package/dist/objects/Water2.mjs +17 -19
  239. package/dist/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
  240. package/dist/postprocessing/AdaptiveToneMappingPass.js +105 -112
  241. package/dist/postprocessing/AdaptiveToneMappingPass.mjs +107 -114
  242. package/dist/postprocessing/BokehPass.d.ts +1 -1
  243. package/dist/postprocessing/ClearPass.d.ts +3 -3
  244. package/dist/postprocessing/CubeTexturePass.js +37 -33
  245. package/dist/postprocessing/CubeTexturePass.mjs +37 -33
  246. package/dist/postprocessing/HalftonePass.d.ts +1 -1
  247. package/dist/postprocessing/LUTPass.d.ts +3 -3
  248. package/dist/postprocessing/RenderPixelatedPass.d.ts +28 -0
  249. package/dist/postprocessing/SAOPass.d.ts +5 -6
  250. package/dist/postprocessing/SAOPass.js +151 -145
  251. package/dist/postprocessing/SAOPass.mjs +153 -147
  252. package/dist/postprocessing/SSAARenderPass.d.ts +5 -5
  253. package/dist/postprocessing/SSAARenderPass.js +78 -55
  254. package/dist/postprocessing/SSAARenderPass.mjs +80 -57
  255. package/dist/postprocessing/SSAOPass.d.ts +4 -5
  256. package/dist/postprocessing/SSAOPass.js +17 -10
  257. package/dist/postprocessing/SSAOPass.mjs +17 -10
  258. package/dist/postprocessing/SSRPass.d.ts +6 -7
  259. package/dist/postprocessing/SSRPass.js +235 -262
  260. package/dist/postprocessing/SSRPass.mjs +237 -264
  261. package/dist/postprocessing/TAARenderPass.d.ts +2 -2
  262. package/dist/postprocessing/TAARenderPass.js +106 -27
  263. package/dist/postprocessing/TAARenderPass.mjs +107 -28
  264. package/dist/postprocessing/TexturePass.d.ts +2 -2
  265. package/dist/postprocessing/TexturePass.js +24 -22
  266. package/dist/postprocessing/TexturePass.mjs +25 -23
  267. package/dist/postprocessing/UnrealBloomPass.js +175 -118
  268. package/dist/postprocessing/UnrealBloomPass.mjs +177 -120
  269. package/dist/renderers/CSS2DRenderer.d.ts +2 -1
  270. package/dist/renderers/CSS2DRenderer.js +5 -4
  271. package/dist/renderers/CSS2DRenderer.mjs +6 -5
  272. package/dist/renderers/CSS3DRenderer.d.ts +1 -1
  273. package/dist/renderers/CSS3DRenderer.js +147 -113
  274. package/dist/renderers/CSS3DRenderer.mjs +148 -114
  275. package/dist/renderers/Projector.js +377 -389
  276. package/dist/renderers/Projector.mjs +377 -389
  277. package/dist/renderers/SVGRenderer.js +280 -275
  278. package/dist/renderers/SVGRenderer.mjs +280 -275
  279. package/dist/shaders/ACESFilmicToneMappingShader.d.ts +1 -1
  280. package/dist/shaders/AfterimageShader.d.ts +1 -1
  281. package/dist/shaders/BasicShader.d.ts +1 -1
  282. package/dist/shaders/BleachBypassShader.d.ts +1 -1
  283. package/dist/shaders/BokehShader.d.ts +2 -2
  284. package/dist/shaders/BokehShader2.d.ts +2 -2
  285. package/dist/shaders/BokehShader2.js +1 -1
  286. package/dist/shaders/BokehShader2.mjs +1 -1
  287. package/dist/shaders/ColorCorrectionShader.js +3 -3
  288. package/dist/shaders/ColorCorrectionShader.mjs +3 -3
  289. package/dist/shaders/ColorifyShader.js +1 -1
  290. package/dist/shaders/ColorifyShader.mjs +1 -1
  291. package/dist/shaders/ConvolutionShader.d.ts +2 -2
  292. package/dist/shaders/ConvolutionShader.js +1 -1
  293. package/dist/shaders/ConvolutionShader.mjs +1 -1
  294. package/dist/shaders/CopyShader.d.ts +1 -1
  295. package/dist/shaders/DepthLimitedBlurShader.d.ts +2 -2
  296. package/dist/shaders/DepthLimitedBlurShader.js +2 -2
  297. package/dist/shaders/DepthLimitedBlurShader.mjs +2 -2
  298. package/dist/shaders/DotScreenShader.js +2 -2
  299. package/dist/shaders/DotScreenShader.mjs +2 -2
  300. package/dist/shaders/FXAAShader.js +1 -1
  301. package/dist/shaders/FXAAShader.mjs +1 -1
  302. package/dist/shaders/FreiChenShader.js +1 -1
  303. package/dist/shaders/FreiChenShader.mjs +1 -1
  304. package/dist/shaders/GammaCorrectionShader.d.ts +1 -1
  305. package/dist/shaders/GodRaysShader.js +4 -4
  306. package/dist/shaders/GodRaysShader.mjs +4 -4
  307. package/dist/shaders/HorizontalBlurShader.d.ts +1 -1
  308. package/dist/shaders/LuminosityHighPassShader.js +1 -1
  309. package/dist/shaders/LuminosityHighPassShader.mjs +1 -1
  310. package/dist/shaders/NormalMapShader.js +2 -2
  311. package/dist/shaders/NormalMapShader.mjs +2 -2
  312. package/dist/shaders/SAOShader.d.ts +2 -2
  313. package/dist/shaders/SAOShader.js +3 -3
  314. package/dist/shaders/SAOShader.mjs +3 -3
  315. package/dist/shaders/SMAAShader.js +3 -3
  316. package/dist/shaders/SMAAShader.mjs +3 -3
  317. package/dist/shaders/SSAOShader.js +4 -4
  318. package/dist/shaders/SSAOShader.mjs +4 -4
  319. package/dist/shaders/SSRShader.js +4 -4
  320. package/dist/shaders/SSRShader.mjs +4 -4
  321. package/dist/shaders/SobelOperatorShader.js +1 -1
  322. package/dist/shaders/SobelOperatorShader.mjs +1 -1
  323. package/dist/shaders/SubsurfaceScatteringShader.d.ts +2 -2
  324. package/dist/shaders/SubsurfaceScatteringShader.js +91 -52
  325. package/dist/shaders/SubsurfaceScatteringShader.mjs +91 -52
  326. package/dist/shaders/ToonShader.js +25 -25
  327. package/dist/shaders/ToonShader.mjs +25 -25
  328. package/dist/shaders/TriangleBlurShader.js +1 -1
  329. package/dist/shaders/TriangleBlurShader.mjs +1 -1
  330. package/dist/shaders/VerticalBlurShader.d.ts +1 -1
  331. package/dist/shaders/VolumeShader.js +2 -2
  332. package/dist/shaders/VolumeShader.mjs +2 -2
  333. package/dist/shaders/types.d.ts +2 -2
  334. package/dist/types/Loader.d.ts +4 -0
  335. package/dist/types/Loader.js +26 -0
  336. package/dist/types/Loader.mjs +9 -0
  337. package/dist/types/shared.d.ts +2 -2
  338. package/dist/types/utils.d.ts +1 -1
  339. package/dist/utils/BufferGeometryUtils.d.ts +2 -2
  340. package/dist/utils/BufferGeometryUtils.js +1 -1
  341. package/dist/utils/BufferGeometryUtils.mjs +1 -1
  342. package/dist/utils/RoughnessMipmapper.d.ts +8 -0
  343. package/dist/utils/RoughnessMipmapper.js +79 -75
  344. package/dist/utils/RoughnessMipmapper.mjs +79 -75
  345. package/dist/utils/ShadowMapViewer.js +103 -106
  346. package/dist/utils/ShadowMapViewer.mjs +103 -106
  347. package/dist/utils/SkeletonUtils.d.ts +5 -21
  348. package/dist/utils/SkeletonUtils.js +182 -263
  349. package/dist/utils/SkeletonUtils.mjs +183 -264
  350. package/dist/utils/UVsDebug.js +37 -42
  351. package/dist/utils/UVsDebug.mjs +37 -42
  352. package/dist/webxr/ARButton.d.ts +2 -1
  353. package/dist/webxr/OculusHandModel.d.ts +2 -1
  354. package/dist/webxr/OculusHandPointerModel.d.ts +2 -2
  355. package/dist/webxr/OculusHandPointerModel.js +2 -2
  356. package/dist/webxr/OculusHandPointerModel.mjs +2 -2
  357. package/dist/webxr/VRButton.d.ts +2 -1
  358. package/dist/webxr/XRHandPrimitiveModel.js +2 -2
  359. package/dist/webxr/XRHandPrimitiveModel.mjs +2 -2
  360. package/package.json +5 -6
  361. package/dist/custom.d.ts +0 -5
  362. package/dist/loaders/NodeMaterialLoader.js +0 -146
  363. package/dist/loaders/NodeMaterialLoader.mjs +0 -146
  364. package/dist/nodes/Nodes.js +0 -347
  365. package/dist/nodes/Nodes.mjs +0 -347
  366. package/dist/nodes/ShaderNode.js +0 -408
  367. package/dist/nodes/ShaderNode.mjs +0 -408
  368. package/dist/nodes/accessors/BufferNode.js +0 -14
  369. package/dist/nodes/accessors/BufferNode.mjs +0 -15
  370. package/dist/nodes/accessors/CameraNode.js +0 -43
  371. package/dist/nodes/accessors/CameraNode.mjs +0 -44
  372. package/dist/nodes/accessors/CubeTextureNode.js +0 -41
  373. package/dist/nodes/accessors/CubeTextureNode.mjs +0 -42
  374. package/dist/nodes/accessors/MaterialNode.js +0 -70
  375. package/dist/nodes/accessors/MaterialNode.mjs +0 -71
  376. package/dist/nodes/accessors/MaterialReferenceNode.js +0 -13
  377. package/dist/nodes/accessors/MaterialReferenceNode.mjs +0 -14
  378. package/dist/nodes/accessors/ModelNode.js +0 -8
  379. package/dist/nodes/accessors/ModelNode.mjs +0 -9
  380. package/dist/nodes/accessors/ModelViewProjectionNode.js +0 -23
  381. package/dist/nodes/accessors/ModelViewProjectionNode.mjs +0 -24
  382. package/dist/nodes/accessors/NormalNode.js +0 -61
  383. package/dist/nodes/accessors/NormalNode.mjs +0 -62
  384. package/dist/nodes/accessors/Object3DNode.js +0 -75
  385. package/dist/nodes/accessors/Object3DNode.mjs +0 -76
  386. package/dist/nodes/accessors/PointUVNode.js +0 -12
  387. package/dist/nodes/accessors/PointUVNode.mjs +0 -13
  388. package/dist/nodes/accessors/PositionNode.js +0 -64
  389. package/dist/nodes/accessors/PositionNode.mjs +0 -65
  390. package/dist/nodes/accessors/ReferenceNode.js +0 -36
  391. package/dist/nodes/accessors/ReferenceNode.mjs +0 -37
  392. package/dist/nodes/accessors/ReflectNode.js +0 -42
  393. package/dist/nodes/accessors/ReflectNode.mjs +0 -43
  394. package/dist/nodes/accessors/SkinningNode.js +0 -57
  395. package/dist/nodes/accessors/SkinningNode.mjs +0 -58
  396. package/dist/nodes/accessors/TextureNode.js +0 -53
  397. package/dist/nodes/accessors/TextureNode.mjs +0 -54
  398. package/dist/nodes/accessors/UVNode.js +0 -22
  399. package/dist/nodes/accessors/UVNode.mjs +0 -23
  400. package/dist/nodes/core/ArrayUniformNode.js +0 -13
  401. package/dist/nodes/core/ArrayUniformNode.mjs +0 -14
  402. package/dist/nodes/core/AttributeNode.js +0 -29
  403. package/dist/nodes/core/AttributeNode.mjs +0 -30
  404. package/dist/nodes/core/BypassNode.js +0 -21
  405. package/dist/nodes/core/BypassNode.mjs +0 -22
  406. package/dist/nodes/core/CodeNode.js +0 -27
  407. package/dist/nodes/core/CodeNode.mjs +0 -28
  408. package/dist/nodes/core/ConstNode.js +0 -13
  409. package/dist/nodes/core/ConstNode.mjs +0 -14
  410. package/dist/nodes/core/ContextNode.js +0 -21
  411. package/dist/nodes/core/ContextNode.mjs +0 -22
  412. package/dist/nodes/core/ExpressionNode.js +0 -18
  413. package/dist/nodes/core/ExpressionNode.mjs +0 -19
  414. package/dist/nodes/core/FunctionCallNode.js +0 -36
  415. package/dist/nodes/core/FunctionCallNode.mjs +0 -37
  416. package/dist/nodes/core/FunctionNode.js +0 -55
  417. package/dist/nodes/core/FunctionNode.mjs +0 -56
  418. package/dist/nodes/core/InputNode.js +0 -37
  419. package/dist/nodes/core/InputNode.mjs +0 -38
  420. package/dist/nodes/core/Node.js +0 -138
  421. package/dist/nodes/core/Node.mjs +0 -139
  422. package/dist/nodes/core/NodeAttribute.js +0 -9
  423. package/dist/nodes/core/NodeAttribute.mjs +0 -10
  424. package/dist/nodes/core/NodeBuilder.js +0 -402
  425. package/dist/nodes/core/NodeBuilder.mjs +0 -402
  426. package/dist/nodes/core/NodeCode.js +0 -10
  427. package/dist/nodes/core/NodeCode.mjs +0 -11
  428. package/dist/nodes/core/NodeFrame.js +0 -34
  429. package/dist/nodes/core/NodeFrame.mjs +0 -35
  430. package/dist/nodes/core/NodeFunctionInput.js +0 -12
  431. package/dist/nodes/core/NodeFunctionInput.mjs +0 -13
  432. package/dist/nodes/core/NodeKeywords.js +0 -43
  433. package/dist/nodes/core/NodeKeywords.mjs +0 -44
  434. package/dist/nodes/core/NodeUniform.js +0 -17
  435. package/dist/nodes/core/NodeUniform.mjs +0 -18
  436. package/dist/nodes/core/NodeUtils.js +0 -57
  437. package/dist/nodes/core/NodeUtils.mjs +0 -57
  438. package/dist/nodes/core/NodeVar.js +0 -9
  439. package/dist/nodes/core/NodeVar.mjs +0 -10
  440. package/dist/nodes/core/NodeVary.js +0 -9
  441. package/dist/nodes/core/NodeVary.mjs +0 -10
  442. package/dist/nodes/core/PropertyNode.js +0 -20
  443. package/dist/nodes/core/PropertyNode.mjs +0 -21
  444. package/dist/nodes/core/TempNode.js +0 -24
  445. package/dist/nodes/core/TempNode.mjs +0 -25
  446. package/dist/nodes/core/UniformNode.js +0 -22
  447. package/dist/nodes/core/UniformNode.mjs +0 -23
  448. package/dist/nodes/core/VarNode.js +0 -30
  449. package/dist/nodes/core/VarNode.mjs +0 -31
  450. package/dist/nodes/core/VaryNode.js +0 -29
  451. package/dist/nodes/core/VaryNode.mjs +0 -30
  452. package/dist/nodes/core/constants.js +0 -24
  453. package/dist/nodes/core/constants.mjs +0 -24
  454. package/dist/nodes/display/ColorSpaceNode.js +0 -62
  455. package/dist/nodes/display/ColorSpaceNode.mjs +0 -62
  456. package/dist/nodes/display/NormalMapNode.js +0 -53
  457. package/dist/nodes/display/NormalMapNode.mjs +0 -54
  458. package/dist/nodes/fog/FogNode.js +0 -14
  459. package/dist/nodes/fog/FogNode.mjs +0 -15
  460. package/dist/nodes/fog/FogRangeNode.js +0 -16
  461. package/dist/nodes/fog/FogRangeNode.mjs +0 -17
  462. package/dist/nodes/functions/BSDFs.js +0 -64
  463. package/dist/nodes/functions/BSDFs.mjs +0 -64
  464. package/dist/nodes/lights/LightContextNode.js +0 -34
  465. package/dist/nodes/lights/LightContextNode.mjs +0 -35
  466. package/dist/nodes/lights/LightNode.js +0 -57
  467. package/dist/nodes/lights/LightNode.mjs +0 -58
  468. package/dist/nodes/lights/LightsNode.js +0 -58
  469. package/dist/nodes/lights/LightsNode.mjs +0 -59
  470. package/dist/nodes/loaders/NodeLoader.js +0 -195
  471. package/dist/nodes/loaders/NodeLoader.mjs +0 -196
  472. package/dist/nodes/loaders/NodeMaterialLoader.js +0 -23
  473. package/dist/nodes/loaders/NodeMaterialLoader.mjs +0 -24
  474. package/dist/nodes/loaders/NodeObjectLoader.js +0 -39
  475. package/dist/nodes/loaders/NodeObjectLoader.mjs +0 -40
  476. package/dist/nodes/materials/LineBasicNodeMaterial.js +0 -26
  477. package/dist/nodes/materials/LineBasicNodeMaterial.mjs +0 -27
  478. package/dist/nodes/materials/Materials.js +0 -24
  479. package/dist/nodes/materials/Materials.mjs +0 -24
  480. package/dist/nodes/materials/MeshBasicNodeMaterial.js +0 -27
  481. package/dist/nodes/materials/MeshBasicNodeMaterial.mjs +0 -28
  482. package/dist/nodes/materials/MeshStandardNodeMaterial.js +0 -40
  483. package/dist/nodes/materials/MeshStandardNodeMaterial.mjs +0 -41
  484. package/dist/nodes/materials/NodeMaterial.js +0 -63
  485. package/dist/nodes/materials/NodeMaterial.mjs +0 -64
  486. package/dist/nodes/materials/PointsNodeMaterial.js +0 -29
  487. package/dist/nodes/materials/PointsNodeMaterial.mjs +0 -30
  488. package/dist/nodes/math/CondNode.js +0 -40
  489. package/dist/nodes/math/CondNode.mjs +0 -41
  490. package/dist/nodes/math/MathNode.js +0 -165
  491. package/dist/nodes/math/MathNode.mjs +0 -166
  492. package/dist/nodes/math/OperatorNode.js +0 -102
  493. package/dist/nodes/math/OperatorNode.mjs +0 -103
  494. package/dist/nodes/procedural/CheckerNode.js +0 -20
  495. package/dist/nodes/procedural/CheckerNode.mjs +0 -21
  496. package/dist/nodes/utils/ArrayElementNode.js +0 -18
  497. package/dist/nodes/utils/ArrayElementNode.mjs +0 -19
  498. package/dist/nodes/utils/ConvertNode.js +0 -24
  499. package/dist/nodes/utils/ConvertNode.mjs +0 -25
  500. package/dist/nodes/utils/JoinNode.js +0 -25
  501. package/dist/nodes/utils/JoinNode.mjs +0 -26
  502. package/dist/nodes/utils/MatcapUVNode.js +0 -15
  503. package/dist/nodes/utils/MatcapUVNode.mjs +0 -16
  504. package/dist/nodes/utils/OscNode.js +0 -49
  505. package/dist/nodes/utils/OscNode.mjs +0 -50
  506. package/dist/nodes/utils/SplitNode.js +0 -44
  507. package/dist/nodes/utils/SplitNode.mjs +0 -45
  508. package/dist/nodes/utils/SpriteSheetUVNode.js +0 -39
  509. package/dist/nodes/utils/SpriteSheetUVNode.mjs +0 -40
  510. package/dist/nodes/utils/TimerNode.js +0 -43
  511. package/dist/nodes/utils/TimerNode.mjs +0 -44
  512. package/dist/offscreen/jank.js +0 -26
  513. package/dist/offscreen/jank.mjs +0 -27
  514. package/dist/offscreen/offscreen.js +0 -8
  515. package/dist/offscreen/offscreen.mjs +0 -7
  516. package/dist/offscreen/scene.js +0 -68
  517. package/dist/offscreen/scene.mjs +0 -52
  518. package/dist/renderers/nodes/accessors/CameraNode.js +0 -62
  519. package/dist/renderers/nodes/accessors/CameraNode.mjs +0 -63
  520. package/dist/renderers/nodes/accessors/ModelNode.js +0 -60
  521. package/dist/renderers/nodes/accessors/ModelNode.mjs +0 -61
  522. package/dist/renderers/nodes/accessors/ModelViewProjectionNode.js +0 -20
  523. package/dist/renderers/nodes/accessors/ModelViewProjectionNode.mjs +0 -21
  524. package/dist/renderers/nodes/accessors/NormalNode.js +0 -60
  525. package/dist/renderers/nodes/accessors/NormalNode.mjs +0 -61
  526. package/dist/renderers/nodes/accessors/PositionNode.js +0 -29
  527. package/dist/renderers/nodes/accessors/PositionNode.mjs +0 -30
  528. package/dist/renderers/nodes/accessors/UVNode.js +0 -12
  529. package/dist/renderers/nodes/accessors/UVNode.mjs +0 -13
  530. package/dist/renderers/nodes/core/AttributeNode.js +0 -34
  531. package/dist/renderers/nodes/core/AttributeNode.mjs +0 -35
  532. package/dist/renderers/nodes/core/InputNode.js +0 -30
  533. package/dist/renderers/nodes/core/InputNode.mjs +0 -31
  534. package/dist/renderers/nodes/core/Node.js +0 -33
  535. package/dist/renderers/nodes/core/Node.mjs +0 -34
  536. package/dist/renderers/nodes/core/NodeAttribute.js +0 -9
  537. package/dist/renderers/nodes/core/NodeAttribute.mjs +0 -10
  538. package/dist/renderers/nodes/core/NodeBuilder.js +0 -248
  539. package/dist/renderers/nodes/core/NodeBuilder.mjs +0 -249
  540. package/dist/renderers/nodes/core/NodeFrame.js +0 -34
  541. package/dist/renderers/nodes/core/NodeFrame.mjs +0 -35
  542. package/dist/renderers/nodes/core/NodeSlot.js +0 -9
  543. package/dist/renderers/nodes/core/NodeSlot.mjs +0 -10
  544. package/dist/renderers/nodes/core/NodeUniform.js +0 -17
  545. package/dist/renderers/nodes/core/NodeUniform.mjs +0 -18
  546. package/dist/renderers/nodes/core/NodeVary.js +0 -10
  547. package/dist/renderers/nodes/core/NodeVary.mjs +0 -11
  548. package/dist/renderers/nodes/core/VaryNode.js +0 -21
  549. package/dist/renderers/nodes/core/VaryNode.mjs +0 -22
  550. package/dist/renderers/nodes/core/constants.js +0 -22
  551. package/dist/renderers/nodes/core/constants.mjs +0 -22
  552. package/dist/renderers/nodes/inputs/ColorNode.js +0 -10
  553. package/dist/renderers/nodes/inputs/ColorNode.mjs +0 -11
  554. package/dist/renderers/nodes/inputs/FloatNode.js +0 -10
  555. package/dist/renderers/nodes/inputs/FloatNode.mjs +0 -11
  556. package/dist/renderers/nodes/inputs/Matrix3Node.js +0 -11
  557. package/dist/renderers/nodes/inputs/Matrix3Node.mjs +0 -12
  558. package/dist/renderers/nodes/inputs/Matrix4Node.js +0 -11
  559. package/dist/renderers/nodes/inputs/Matrix4Node.mjs +0 -12
  560. package/dist/renderers/nodes/inputs/TextureNode.js +0 -19
  561. package/dist/renderers/nodes/inputs/TextureNode.mjs +0 -20
  562. package/dist/renderers/nodes/inputs/Vector2Node.js +0 -10
  563. package/dist/renderers/nodes/inputs/Vector2Node.mjs +0 -11
  564. package/dist/renderers/nodes/inputs/Vector3Node.js +0 -11
  565. package/dist/renderers/nodes/inputs/Vector3Node.mjs +0 -12
  566. package/dist/renderers/nodes/inputs/Vector4Node.js +0 -11
  567. package/dist/renderers/nodes/inputs/Vector4Node.mjs +0 -12
  568. package/dist/renderers/nodes/math/MathNode.js +0 -54
  569. package/dist/renderers/nodes/math/MathNode.mjs +0 -55
  570. package/dist/renderers/nodes/math/OperatorNode.js +0 -41
  571. package/dist/renderers/nodes/math/OperatorNode.mjs +0 -42
  572. package/dist/renderers/nodes/utils/SwitchNode.js +0 -19
  573. package/dist/renderers/nodes/utils/SwitchNode.mjs +0 -20
  574. package/dist/renderers/nodes/utils/TimerNode.js +0 -13
  575. package/dist/renderers/nodes/utils/TimerNode.mjs +0 -14
  576. package/dist/renderers/webgpu/WebGPU.js +0 -23
  577. package/dist/renderers/webgpu/WebGPU.mjs +0 -24
  578. package/dist/renderers/webgpu/WebGPUAttributes.js +0 -68
  579. package/dist/renderers/webgpu/WebGPUAttributes.mjs +0 -69
  580. package/dist/renderers/webgpu/WebGPUBackground.js +0 -60
  581. package/dist/renderers/webgpu/WebGPUBackground.mjs +0 -61
  582. package/dist/renderers/webgpu/WebGPUBinding.js +0 -13
  583. package/dist/renderers/webgpu/WebGPUBinding.mjs +0 -14
  584. package/dist/renderers/webgpu/WebGPUBindings.js +0 -154
  585. package/dist/renderers/webgpu/WebGPUBindings.mjs +0 -155
  586. package/dist/renderers/webgpu/WebGPUComputePipelines.js +0 -43
  587. package/dist/renderers/webgpu/WebGPUComputePipelines.mjs +0 -44
  588. package/dist/renderers/webgpu/WebGPUGeometries.js +0 -40
  589. package/dist/renderers/webgpu/WebGPUGeometries.mjs +0 -41
  590. package/dist/renderers/webgpu/WebGPUInfo.js +0 -45
  591. package/dist/renderers/webgpu/WebGPUInfo.mjs +0 -46
  592. package/dist/renderers/webgpu/WebGPUObjects.js +0 -24
  593. package/dist/renderers/webgpu/WebGPUObjects.mjs +0 -25
  594. package/dist/renderers/webgpu/WebGPUProperties.js +0 -21
  595. package/dist/renderers/webgpu/WebGPUProperties.mjs +0 -22
  596. package/dist/renderers/webgpu/WebGPURenderLists.js +0 -118
  597. package/dist/renderers/webgpu/WebGPURenderLists.mjs +0 -119
  598. package/dist/renderers/webgpu/WebGPURenderPipelines.js +0 -545
  599. package/dist/renderers/webgpu/WebGPURenderPipelines.mjs +0 -546
  600. package/dist/renderers/webgpu/WebGPURenderer.js +0 -596
  601. package/dist/renderers/webgpu/WebGPURenderer.mjs +0 -575
  602. package/dist/renderers/webgpu/WebGPUSampledTexture.js +0 -40
  603. package/dist/renderers/webgpu/WebGPUSampledTexture.mjs +0 -40
  604. package/dist/renderers/webgpu/WebGPUSampler.js +0 -14
  605. package/dist/renderers/webgpu/WebGPUSampler.mjs +0 -15
  606. package/dist/renderers/webgpu/WebGPUStorageBuffer.js +0 -14
  607. package/dist/renderers/webgpu/WebGPUStorageBuffer.mjs +0 -15
  608. package/dist/renderers/webgpu/WebGPUTextureRenderer.js +0 -22
  609. package/dist/renderers/webgpu/WebGPUTextureRenderer.mjs +0 -23
  610. package/dist/renderers/webgpu/WebGPUTextureUtils.js +0 -97
  611. package/dist/renderers/webgpu/WebGPUTextureUtils.mjs +0 -98
  612. package/dist/renderers/webgpu/WebGPUTextures.js +0 -483
  613. package/dist/renderers/webgpu/WebGPUTextures.mjs +0 -484
  614. package/dist/renderers/webgpu/WebGPUUniform.js +0 -81
  615. package/dist/renderers/webgpu/WebGPUUniform.mjs +0 -81
  616. package/dist/renderers/webgpu/WebGPUUniformsGroup.js +0 -175
  617. package/dist/renderers/webgpu/WebGPUUniformsGroup.mjs +0 -176
  618. package/dist/renderers/webgpu/constants.js +0 -241
  619. package/dist/renderers/webgpu/constants.mjs +0 -241
  620. package/dist/renderers/webgpu/nodes/ShaderLib.js +0 -41
  621. package/dist/renderers/webgpu/nodes/ShaderLib.mjs +0 -42
  622. package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.js +0 -164
  623. package/dist/renderers/webgpu/nodes/WebGPUNodeBuilder.mjs +0 -165
  624. package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.js +0 -73
  625. package/dist/renderers/webgpu/nodes/WebGPUNodeUniform.mjs +0 -73
  626. package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +0 -14
  627. package/dist/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.mjs +0 -15
  628. package/dist/renderers/webgpu/nodes/WebGPUNodes.js +0 -39
  629. package/dist/renderers/webgpu/nodes/WebGPUNodes.mjs +0 -40
@@ -1,10 +1,6 @@
1
1
  import { Loader, LoaderUtils, FileLoader, TextureLoader, Vector3, Quaternion, Matrix4, Bone, Skeleton, BufferGeometry, MeshLambertMaterial, BufferAttribute, Mesh, SkinnedMesh, Color, Object3D, MeshPhongMaterial } from "three";
2
- var AssimpLoader = function(manager) {
3
- Loader.call(this, manager);
4
- };
5
- AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
6
- constructor: AssimpLoader,
7
- load: function(url, onLoad, onProgress, onError) {
2
+ class AssimpLoader extends Loader {
3
+ load(url, onLoad, onProgress, onError) {
8
4
  var scope = this;
9
5
  var path = scope.path === "" ? LoaderUtils.extractUrlBase(url) : scope.path;
10
6
  var loader = new FileLoader(scope.manager);
@@ -29,42 +25,44 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
29
25
  onProgress,
30
26
  onError
31
27
  );
32
- },
33
- parse: function(buffer, path) {
28
+ }
29
+ parse(buffer, path) {
34
30
  var textureLoader = new TextureLoader(this.manager);
35
31
  textureLoader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
36
32
  var Virtulous = {};
37
- Virtulous.KeyFrame = function(time, matrix) {
38
- this.time = time;
39
- this.matrix = matrix.clone();
40
- this.position = new Vector3();
41
- this.quaternion = new Quaternion();
42
- this.scale = new Vector3(1, 1, 1);
43
- this.matrix.decompose(this.position, this.quaternion, this.scale);
44
- this.clone = function() {
45
- var n = new Virtulous.KeyFrame(this.time, this.matrix);
46
- return n;
47
- };
48
- this.lerp = function(nextKey, time2) {
49
- time2 -= this.time;
50
- var dist = nextKey.time - this.time;
51
- var l = time2 / dist;
52
- var l2 = 1 - l;
53
- var keypos = this.position;
54
- var keyrot = this.quaternion;
55
- var key2pos = nextKey.position;
56
- var key2rot = nextKey.quaternion;
57
- Virtulous.KeyFrame.tempAniPos.x = keypos.x * l2 + key2pos.x * l;
58
- Virtulous.KeyFrame.tempAniPos.y = keypos.y * l2 + key2pos.y * l;
59
- Virtulous.KeyFrame.tempAniPos.z = keypos.z * l2 + key2pos.z * l;
60
- Virtulous.KeyFrame.tempAniQuat.set(keyrot.x, keyrot.y, keyrot.z, keyrot.w);
61
- Virtulous.KeyFrame.tempAniQuat.slerp(key2rot, l);
62
- return Virtulous.KeyFrame.tempAniMatrix.compose(
63
- Virtulous.KeyFrame.tempAniPos,
64
- Virtulous.KeyFrame.tempAniQuat,
65
- Virtulous.KeyFrame.tempAniScale
66
- );
67
- };
33
+ Virtulous.KeyFrame = class {
34
+ constructor(time, matrix) {
35
+ this.time = time;
36
+ this.matrix = matrix.clone();
37
+ this.position = new Vector3();
38
+ this.quaternion = new Quaternion();
39
+ this.scale = new Vector3(1, 1, 1);
40
+ this.matrix.decompose(this.position, this.quaternion, this.scale);
41
+ this.clone = function() {
42
+ var n = new Virtulous.KeyFrame(this.time, this.matrix);
43
+ return n;
44
+ };
45
+ this.lerp = function(nextKey, time2) {
46
+ time2 -= this.time;
47
+ var dist = nextKey.time - this.time;
48
+ var l = time2 / dist;
49
+ var l2 = 1 - l;
50
+ var keypos = this.position;
51
+ var keyrot = this.quaternion;
52
+ var key2pos = nextKey.position;
53
+ var key2rot = nextKey.quaternion;
54
+ Virtulous.KeyFrame.tempAniPos.x = keypos.x * l2 + key2pos.x * l;
55
+ Virtulous.KeyFrame.tempAniPos.y = keypos.y * l2 + key2pos.y * l;
56
+ Virtulous.KeyFrame.tempAniPos.z = keypos.z * l2 + key2pos.z * l;
57
+ Virtulous.KeyFrame.tempAniQuat.set(keyrot.x, keyrot.y, keyrot.z, keyrot.w);
58
+ Virtulous.KeyFrame.tempAniQuat.slerp(key2rot, l);
59
+ return Virtulous.KeyFrame.tempAniMatrix.compose(
60
+ Virtulous.KeyFrame.tempAniPos,
61
+ Virtulous.KeyFrame.tempAniQuat,
62
+ Virtulous.KeyFrame.tempAniScale
63
+ );
64
+ };
65
+ }
68
66
  };
69
67
  Virtulous.KeyFrame.tempAniPos = new Vector3();
70
68
  Virtulous.KeyFrame.tempAniQuat = new Quaternion();
@@ -332,253 +330,277 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
332
330
  }
333
331
  return void 0;
334
332
  }
335
- function aiMesh() {
336
- this.mPrimitiveTypes = 0;
337
- this.mNumVertices = 0;
338
- this.mNumFaces = 0;
339
- this.mNumBones = 0;
340
- this.mMaterialIndex = 0;
341
- this.mVertices = [];
342
- this.mNormals = [];
343
- this.mTangents = [];
344
- this.mBitangents = [];
345
- this.mColors = [[]];
346
- this.mTextureCoords = [[]];
347
- this.mFaces = [];
348
- this.mBones = [];
349
- this.hookupSkeletons = function(scene) {
350
- if (this.mBones.length == 0)
351
- return;
352
- var allBones = [];
353
- var offsetMatrix = [];
354
- var skeletonRoot = scene.findNode(this.mBones[0].mName);
355
- while (skeletonRoot.mParent && skeletonRoot.mParent.isBone) {
356
- skeletonRoot = skeletonRoot.mParent;
357
- }
358
- var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
359
- var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
360
- this.threeNode.add(threeSkeletonRootBone);
361
- for (let i = 0; i < this.mBones.length; i++) {
362
- var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
363
- if (bone) {
364
- var tbone = bone;
365
- allBones.push(tbone);
366
- offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
367
- } else {
368
- var skeletonRoot = scene.findNode(this.mBones[i].mName);
369
- if (!skeletonRoot)
370
- return;
371
- var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
372
- var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
373
- this.threeNode.add(threeSkeletonRootBone);
374
- var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
375
- var tbone = bone;
376
- allBones.push(tbone);
377
- offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
333
+ class aiMesh {
334
+ constructor() {
335
+ this.mPrimitiveTypes = 0;
336
+ this.mNumVertices = 0;
337
+ this.mNumFaces = 0;
338
+ this.mNumBones = 0;
339
+ this.mMaterialIndex = 0;
340
+ this.mVertices = [];
341
+ this.mNormals = [];
342
+ this.mTangents = [];
343
+ this.mBitangents = [];
344
+ this.mColors = [[]];
345
+ this.mTextureCoords = [[]];
346
+ this.mFaces = [];
347
+ this.mBones = [];
348
+ this.hookupSkeletons = function(scene) {
349
+ if (this.mBones.length == 0)
350
+ return;
351
+ var allBones = [];
352
+ var offsetMatrix = [];
353
+ var skeletonRoot = scene.findNode(this.mBones[0].mName);
354
+ while (skeletonRoot.mParent && skeletonRoot.mParent.isBone) {
355
+ skeletonRoot = skeletonRoot.mParent;
378
356
  }
379
- }
380
- var skeleton = new Skeleton(allBones, offsetMatrix);
381
- this.threeNode.bind(skeleton, new Matrix4());
382
- this.threeNode.material.skinning = true;
383
- };
384
- this.toTHREE = function(scene) {
385
- if (this.threeNode)
386
- return this.threeNode;
387
- var geometry = new BufferGeometry();
388
- var mat;
389
- if (scene.mMaterials[this.mMaterialIndex])
390
- mat = scene.mMaterials[this.mMaterialIndex].toTHREE(scene);
391
- else
392
- mat = new MeshLambertMaterial();
393
- geometry.setIndex(new BufferAttribute(new Uint32Array(this.mIndexArray), 1));
394
- geometry.setAttribute("position", new BufferAttribute(this.mVertexBuffer, 3));
395
- if (this.mNormalBuffer && this.mNormalBuffer.length > 0) {
396
- geometry.setAttribute("normal", new BufferAttribute(this.mNormalBuffer, 3));
397
- }
398
- if (this.mColorBuffer && this.mColorBuffer.length > 0) {
399
- geometry.setAttribute("color", new BufferAttribute(this.mColorBuffer, 4));
400
- }
401
- if (this.mTexCoordsBuffers[0] && this.mTexCoordsBuffers[0].length > 0) {
402
- geometry.setAttribute("uv", new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]), 2));
403
- }
404
- if (this.mTexCoordsBuffers[1] && this.mTexCoordsBuffers[1].length > 0) {
405
- geometry.setAttribute("uv1", new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]), 2));
406
- }
407
- if (this.mTangentBuffer && this.mTangentBuffer.length > 0) {
408
- geometry.setAttribute("tangents", new BufferAttribute(this.mTangentBuffer, 3));
409
- }
410
- if (this.mBitangentBuffer && this.mBitangentBuffer.length > 0) {
411
- geometry.setAttribute("bitangents", new BufferAttribute(this.mBitangentBuffer, 3));
412
- }
413
- if (this.mBones.length > 0) {
414
- var weights = [];
415
- var bones = [];
357
+ var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
358
+ var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
359
+ this.threeNode.add(threeSkeletonRootBone);
416
360
  for (let i = 0; i < this.mBones.length; i++) {
417
- for (let j = 0; j < this.mBones[i].mWeights.length; j++) {
418
- var weight = this.mBones[i].mWeights[j];
419
- if (weight) {
420
- if (!weights[weight.mVertexId])
421
- weights[weight.mVertexId] = [];
422
- if (!bones[weight.mVertexId])
423
- bones[weight.mVertexId] = [];
424
- weights[weight.mVertexId].push(weight.mWeight);
425
- bones[weight.mVertexId].push(parseInt(i));
426
- }
361
+ var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
362
+ if (bone) {
363
+ var tbone = bone;
364
+ allBones.push(tbone);
365
+ offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
366
+ } else {
367
+ var skeletonRoot = scene.findNode(this.mBones[i].mName);
368
+ if (!skeletonRoot)
369
+ return;
370
+ var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
371
+ var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
372
+ this.threeNode.add(threeSkeletonRootBone);
373
+ var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
374
+ var tbone = bone;
375
+ allBones.push(tbone);
376
+ offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
427
377
  }
428
378
  }
429
- for (let i in bones) {
430
- sortWeights(bones[i], weights[i]);
379
+ var skeleton = new Skeleton(allBones, offsetMatrix);
380
+ this.threeNode.bind(skeleton, new Matrix4());
381
+ this.threeNode.material.skinning = true;
382
+ };
383
+ this.toTHREE = function(scene) {
384
+ if (this.threeNode)
385
+ return this.threeNode;
386
+ var geometry = new BufferGeometry();
387
+ var mat;
388
+ if (scene.mMaterials[this.mMaterialIndex])
389
+ mat = scene.mMaterials[this.mMaterialIndex].toTHREE(scene);
390
+ else
391
+ mat = new MeshLambertMaterial();
392
+ geometry.setIndex(new BufferAttribute(new Uint32Array(this.mIndexArray), 1));
393
+ geometry.setAttribute("position", new BufferAttribute(this.mVertexBuffer, 3));
394
+ if (this.mNormalBuffer && this.mNormalBuffer.length > 0) {
395
+ geometry.setAttribute("normal", new BufferAttribute(this.mNormalBuffer, 3));
431
396
  }
432
- var _weights = [];
433
- var _bones = [];
434
- for (let i = 0; i < weights.length; i++) {
435
- for (let j = 0; j < 4; j++) {
436
- if (weights[i] && bones[i]) {
437
- _weights.push(weights[i][j]);
438
- _bones.push(bones[i][j]);
439
- } else {
440
- _weights.push(0);
441
- _bones.push(0);
397
+ if (this.mColorBuffer && this.mColorBuffer.length > 0) {
398
+ geometry.setAttribute("color", new BufferAttribute(this.mColorBuffer, 4));
399
+ }
400
+ if (this.mTexCoordsBuffers[0] && this.mTexCoordsBuffers[0].length > 0) {
401
+ geometry.setAttribute("uv", new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]), 2));
402
+ }
403
+ if (this.mTexCoordsBuffers[1] && this.mTexCoordsBuffers[1].length > 0) {
404
+ geometry.setAttribute("uv1", new BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]), 2));
405
+ }
406
+ if (this.mTangentBuffer && this.mTangentBuffer.length > 0) {
407
+ geometry.setAttribute("tangents", new BufferAttribute(this.mTangentBuffer, 3));
408
+ }
409
+ if (this.mBitangentBuffer && this.mBitangentBuffer.length > 0) {
410
+ geometry.setAttribute("bitangents", new BufferAttribute(this.mBitangentBuffer, 3));
411
+ }
412
+ if (this.mBones.length > 0) {
413
+ var weights = [];
414
+ var bones = [];
415
+ for (let i = 0; i < this.mBones.length; i++) {
416
+ for (let j = 0; j < this.mBones[i].mWeights.length; j++) {
417
+ var weight = this.mBones[i].mWeights[j];
418
+ if (weight) {
419
+ if (!weights[weight.mVertexId])
420
+ weights[weight.mVertexId] = [];
421
+ if (!bones[weight.mVertexId])
422
+ bones[weight.mVertexId] = [];
423
+ weights[weight.mVertexId].push(weight.mWeight);
424
+ bones[weight.mVertexId].push(parseInt(i));
425
+ }
426
+ }
427
+ }
428
+ for (let i in bones) {
429
+ sortWeights(bones[i], weights[i]);
430
+ }
431
+ var _weights = [];
432
+ var _bones = [];
433
+ for (let i = 0; i < weights.length; i++) {
434
+ for (let j = 0; j < 4; j++) {
435
+ if (weights[i] && bones[i]) {
436
+ _weights.push(weights[i][j]);
437
+ _bones.push(bones[i][j]);
438
+ } else {
439
+ _weights.push(0);
440
+ _bones.push(0);
441
+ }
442
442
  }
443
443
  }
444
+ geometry.setAttribute("skinWeight", new BufferAttribute(new Float32Array(_weights), BONESPERVERT));
445
+ geometry.setAttribute("skinIndex", new BufferAttribute(new Float32Array(_bones), BONESPERVERT));
444
446
  }
445
- geometry.setAttribute("skinWeight", new BufferAttribute(new Float32Array(_weights), BONESPERVERT));
446
- geometry.setAttribute("skinIndex", new BufferAttribute(new Float32Array(_bones), BONESPERVERT));
447
- }
448
- var mesh;
449
- if (this.mBones.length == 0)
450
- mesh = new Mesh(geometry, mat);
451
- if (this.mBones.length > 0) {
452
- mesh = new SkinnedMesh(geometry, mat);
453
- mesh.normalizeSkinWeights();
454
- }
455
- this.threeNode = mesh;
456
- return mesh;
457
- };
447
+ var mesh;
448
+ if (this.mBones.length == 0)
449
+ mesh = new Mesh(geometry, mat);
450
+ if (this.mBones.length > 0) {
451
+ mesh = new SkinnedMesh(geometry, mat);
452
+ mesh.normalizeSkinWeights();
453
+ }
454
+ this.threeNode = mesh;
455
+ return mesh;
456
+ };
457
+ }
458
458
  }
459
- function aiFace() {
460
- this.mNumIndices = 0;
461
- this.mIndices = [];
459
+ class aiFace {
460
+ constructor() {
461
+ this.mNumIndices = 0;
462
+ this.mIndices = [];
463
+ }
462
464
  }
463
- function aiVector3D() {
464
- this.x = 0;
465
- this.y = 0;
466
- this.z = 0;
467
- this.toTHREE = function() {
468
- return new Vector3(this.x, this.y, this.z);
469
- };
465
+ class aiVector3D {
466
+ constructor() {
467
+ this.x = 0;
468
+ this.y = 0;
469
+ this.z = 0;
470
+ this.toTHREE = function() {
471
+ return new Vector3(this.x, this.y, this.z);
472
+ };
473
+ }
470
474
  }
471
- function aiColor3D() {
472
- this.r = 0;
473
- this.g = 0;
474
- this.b = 0;
475
- this.a = 0;
476
- this.toTHREE = function() {
477
- return new Color(this.r, this.g, this.b);
478
- };
475
+ class aiColor3D {
476
+ constructor() {
477
+ this.r = 0;
478
+ this.g = 0;
479
+ this.b = 0;
480
+ this.a = 0;
481
+ this.toTHREE = function() {
482
+ return new Color(this.r, this.g, this.b);
483
+ };
484
+ }
479
485
  }
480
- function aiQuaternion() {
481
- this.x = 0;
482
- this.y = 0;
483
- this.z = 0;
484
- this.w = 0;
485
- this.toTHREE = function() {
486
- return new Quaternion(this.x, this.y, this.z, this.w);
487
- };
486
+ class aiQuaternion {
487
+ constructor() {
488
+ this.x = 0;
489
+ this.y = 0;
490
+ this.z = 0;
491
+ this.w = 0;
492
+ this.toTHREE = function() {
493
+ return new Quaternion(this.x, this.y, this.z, this.w);
494
+ };
495
+ }
488
496
  }
489
- function aiVertexWeight() {
490
- this.mVertexId = 0;
491
- this.mWeight = 0;
497
+ class aiVertexWeight {
498
+ constructor() {
499
+ this.mVertexId = 0;
500
+ this.mWeight = 0;
501
+ }
492
502
  }
493
- function aiString() {
494
- this.data = [];
495
- this.toString = function() {
496
- var str = "";
497
- this.data.forEach(function(i) {
498
- str += String.fromCharCode(i);
499
- });
500
- return str.replace(/[^\x20-\x7E]+/g, "");
501
- };
503
+ class aiString {
504
+ constructor() {
505
+ this.data = [];
506
+ this.toString = function() {
507
+ var str = "";
508
+ this.data.forEach(function(i) {
509
+ str += String.fromCharCode(i);
510
+ });
511
+ return str.replace(/[^\x20-\x7E]+/g, "");
512
+ };
513
+ }
502
514
  }
503
- function aiVectorKey() {
504
- this.mTime = 0;
505
- this.mValue = null;
515
+ class aiVectorKey {
516
+ constructor() {
517
+ this.mTime = 0;
518
+ this.mValue = null;
519
+ }
506
520
  }
507
- function aiQuatKey() {
508
- this.mTime = 0;
509
- this.mValue = null;
521
+ class aiQuatKey {
522
+ constructor() {
523
+ this.mTime = 0;
524
+ this.mValue = null;
525
+ }
510
526
  }
511
- function aiNode() {
512
- this.mName = "";
513
- this.mTransformation = [];
514
- this.mNumChildren = 0;
515
- this.mNumMeshes = 0;
516
- this.mMeshes = [];
517
- this.mChildren = [];
518
- this.toTHREE = function(scene) {
519
- if (this.threeNode)
520
- return this.threeNode;
521
- var o = new Object3D();
522
- o.name = this.mName;
523
- o.matrix = this.mTransformation.toTHREE();
524
- for (let i = 0; i < this.mChildren.length; i++) {
525
- o.add(this.mChildren[i].toTHREE(scene));
526
- }
527
- for (let i = 0; i < this.mMeshes.length; i++) {
528
- o.add(scene.mMeshes[this.mMeshes[i]].toTHREE(scene));
529
- }
530
- this.threeNode = o;
531
- o.matrix.decompose(o.position, o.quaternion, o.scale);
532
- return o;
533
- };
527
+ class aiNode {
528
+ constructor() {
529
+ this.mName = "";
530
+ this.mTransformation = [];
531
+ this.mNumChildren = 0;
532
+ this.mNumMeshes = 0;
533
+ this.mMeshes = [];
534
+ this.mChildren = [];
535
+ this.toTHREE = function(scene) {
536
+ if (this.threeNode)
537
+ return this.threeNode;
538
+ var o = new Object3D();
539
+ o.name = this.mName;
540
+ o.matrix = this.mTransformation.toTHREE();
541
+ for (let i = 0; i < this.mChildren.length; i++) {
542
+ o.add(this.mChildren[i].toTHREE(scene));
543
+ }
544
+ for (let i = 0; i < this.mMeshes.length; i++) {
545
+ o.add(scene.mMeshes[this.mMeshes[i]].toTHREE(scene));
546
+ }
547
+ this.threeNode = o;
548
+ o.matrix.decompose(o.position, o.quaternion, o.scale);
549
+ return o;
550
+ };
551
+ }
534
552
  }
535
- function aiBone() {
536
- this.mName = "";
537
- this.mNumWeights = 0;
538
- this.mOffsetMatrix = 0;
553
+ class aiBone {
554
+ constructor() {
555
+ this.mName = "";
556
+ this.mNumWeights = 0;
557
+ this.mOffsetMatrix = 0;
558
+ }
539
559
  }
540
- function aiMaterialProperty() {
541
- this.mKey = "";
542
- this.mSemantic = 0;
543
- this.mIndex = 0;
544
- this.mData = [];
545
- this.mDataLength = 0;
546
- this.mType = 0;
547
- this.dataAsColor = function() {
548
- var array = new Uint8Array(this.mData).buffer;
549
- var reader = new DataView(array);
550
- var r = reader.getFloat32(0, true);
551
- var g = reader.getFloat32(4, true);
552
- var b = reader.getFloat32(8, true);
553
- return new Color(r, g, b);
554
- };
555
- this.dataAsFloat = function() {
556
- var array = new Uint8Array(this.mData).buffer;
557
- var reader = new DataView(array);
558
- var r = reader.getFloat32(0, true);
559
- return r;
560
- };
561
- this.dataAsBool = function() {
562
- var array = new Uint8Array(this.mData).buffer;
563
- var reader = new DataView(array);
564
- var r = reader.getFloat32(0, true);
565
- return !!r;
566
- };
567
- this.dataAsString = function() {
568
- var s = new aiString();
569
- s.data = this.mData;
570
- return s.toString();
571
- };
572
- this.dataAsMap = function() {
573
- var s = new aiString();
574
- s.data = this.mData;
575
- var path2 = s.toString();
576
- path2 = path2.replace(/\\/g, "/");
577
- if (path2.indexOf("/") != -1) {
578
- path2 = path2.substr(path2.lastIndexOf("/") + 1);
579
- }
580
- return textureLoader.load(path2);
581
- };
560
+ class aiMaterialProperty {
561
+ constructor() {
562
+ this.mKey = "";
563
+ this.mSemantic = 0;
564
+ this.mIndex = 0;
565
+ this.mData = [];
566
+ this.mDataLength = 0;
567
+ this.mType = 0;
568
+ this.dataAsColor = function() {
569
+ var array = new Uint8Array(this.mData).buffer;
570
+ var reader = new DataView(array);
571
+ var r = reader.getFloat32(0, true);
572
+ var g = reader.getFloat32(4, true);
573
+ var b = reader.getFloat32(8, true);
574
+ return new Color(r, g, b);
575
+ };
576
+ this.dataAsFloat = function() {
577
+ var array = new Uint8Array(this.mData).buffer;
578
+ var reader = new DataView(array);
579
+ var r = reader.getFloat32(0, true);
580
+ return r;
581
+ };
582
+ this.dataAsBool = function() {
583
+ var array = new Uint8Array(this.mData).buffer;
584
+ var reader = new DataView(array);
585
+ var r = reader.getFloat32(0, true);
586
+ return !!r;
587
+ };
588
+ this.dataAsString = function() {
589
+ var s = new aiString();
590
+ s.data = this.mData;
591
+ return s.toString();
592
+ };
593
+ this.dataAsMap = function() {
594
+ var s = new aiString();
595
+ s.data = this.mData;
596
+ var path2 = s.toString();
597
+ path2 = path2.replace(/\\/g, "/");
598
+ if (path2.indexOf("/") != -1) {
599
+ path2 = path2.substr(path2.lastIndexOf("/") + 1);
600
+ }
601
+ return textureLoader.load(path2);
602
+ };
603
+ }
582
604
  }
583
605
  var namePropMapping = {
584
606
  "?mat.name": "name",
@@ -612,45 +634,47 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
612
634
  "$mat.refracti": "float",
613
635
  "$tex.file": "map"
614
636
  };
615
- function aiMaterial() {
616
- this.mNumAllocated = 0;
617
- this.mNumProperties = 0;
618
- this.mProperties = [];
619
- this.toTHREE = function() {
620
- var mat = new MeshPhongMaterial();
621
- for (let i = 0; i < this.mProperties.length; i++) {
622
- if (nameTypeMapping[this.mProperties[i].mKey] == "float") {
623
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsFloat();
624
- }
625
- if (nameTypeMapping[this.mProperties[i].mKey] == "color") {
626
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsColor();
627
- }
628
- if (nameTypeMapping[this.mProperties[i].mKey] == "bool") {
629
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsBool();
630
- }
631
- if (nameTypeMapping[this.mProperties[i].mKey] == "string") {
632
- mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsString();
633
- }
634
- if (nameTypeMapping[this.mProperties[i].mKey] == "map") {
635
- var prop = this.mProperties[i];
636
- if (prop.mSemantic == aiTextureType_DIFFUSE)
637
- mat.map = this.mProperties[i].dataAsMap();
638
- if (prop.mSemantic == aiTextureType_NORMALS)
639
- mat.normalMap = this.mProperties[i].dataAsMap();
640
- if (prop.mSemantic == aiTextureType_LIGHTMAP)
641
- mat.lightMap = this.mProperties[i].dataAsMap();
642
- if (prop.mSemantic == aiTextureType_OPACITY)
643
- mat.alphaMap = this.mProperties[i].dataAsMap();
637
+ class aiMaterial {
638
+ constructor() {
639
+ this.mNumAllocated = 0;
640
+ this.mNumProperties = 0;
641
+ this.mProperties = [];
642
+ this.toTHREE = function() {
643
+ var mat = new MeshPhongMaterial();
644
+ for (let i = 0; i < this.mProperties.length; i++) {
645
+ if (nameTypeMapping[this.mProperties[i].mKey] == "float") {
646
+ mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsFloat();
647
+ }
648
+ if (nameTypeMapping[this.mProperties[i].mKey] == "color") {
649
+ mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsColor();
650
+ }
651
+ if (nameTypeMapping[this.mProperties[i].mKey] == "bool") {
652
+ mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsBool();
653
+ }
654
+ if (nameTypeMapping[this.mProperties[i].mKey] == "string") {
655
+ mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsString();
656
+ }
657
+ if (nameTypeMapping[this.mProperties[i].mKey] == "map") {
658
+ var prop = this.mProperties[i];
659
+ if (prop.mSemantic == aiTextureType_DIFFUSE)
660
+ mat.map = this.mProperties[i].dataAsMap();
661
+ if (prop.mSemantic == aiTextureType_NORMALS)
662
+ mat.normalMap = this.mProperties[i].dataAsMap();
663
+ if (prop.mSemantic == aiTextureType_LIGHTMAP)
664
+ mat.lightMap = this.mProperties[i].dataAsMap();
665
+ if (prop.mSemantic == aiTextureType_OPACITY)
666
+ mat.alphaMap = this.mProperties[i].dataAsMap();
667
+ }
644
668
  }
645
- }
646
- mat.ambient.r = 0.53;
647
- mat.ambient.g = 0.53;
648
- mat.ambient.b = 0.53;
649
- mat.color.r = 1;
650
- mat.color.g = 1;
651
- mat.color.b = 1;
652
- return mat;
653
- };
669
+ mat.ambient.r = 0.53;
670
+ mat.ambient.g = 0.53;
671
+ mat.ambient.b = 0.53;
672
+ mat.color.r = 1;
673
+ mat.color.g = 1;
674
+ mat.color.b = 1;
675
+ return mat;
676
+ };
677
+ }
654
678
  }
655
679
  function veclerp(v1, v2, l) {
656
680
  var v = new Vector3();
@@ -693,191 +717,205 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
693
717
  return lerp(key.mValue.toTHREE(), nextKey.mValue.toTHREE(), l);
694
718
  }
695
719
  }
696
- function aiNodeAnim() {
697
- this.mNodeName = "";
698
- this.mNumPositionKeys = 0;
699
- this.mNumRotationKeys = 0;
700
- this.mNumScalingKeys = 0;
701
- this.mPositionKeys = [];
702
- this.mRotationKeys = [];
703
- this.mScalingKeys = [];
704
- this.mPreState = "";
705
- this.mPostState = "";
706
- this.init = function(tps) {
707
- if (!tps)
708
- tps = 1;
709
- function t(t2) {
710
- t2.mTime /= tps;
711
- }
712
- this.mPositionKeys.forEach(t);
713
- this.mRotationKeys.forEach(t);
714
- this.mScalingKeys.forEach(t);
715
- };
716
- this.sortKeys = function() {
717
- function comp(a, b) {
718
- return a.mTime - b.mTime;
719
- }
720
- this.mPositionKeys.sort(comp);
721
- this.mRotationKeys.sort(comp);
722
- this.mScalingKeys.sort(comp);
723
- };
724
- this.getLength = function() {
725
- return Math.max(
726
- Math.max.apply(
727
- null,
728
- this.mPositionKeys.map(function(a) {
729
- return a.mTime;
730
- })
731
- ),
732
- Math.max.apply(
733
- null,
734
- this.mRotationKeys.map(function(a) {
735
- return a.mTime;
736
- })
737
- ),
738
- Math.max.apply(
739
- null,
740
- this.mScalingKeys.map(function(a) {
741
- return a.mTime;
742
- })
743
- )
744
- );
745
- };
746
- this.toTHREE = function(o) {
747
- this.sortKeys();
748
- var length = this.getLength();
749
- var track = new Virtulous.KeyFrameTrack();
750
- for (let i = 0; i < length; i += 0.05) {
751
- var matrix = new Matrix4();
752
- var time = i;
753
- var pos = sampleTrack(this.mPositionKeys, time, length, veclerp);
754
- var scale = sampleTrack(this.mScalingKeys, time, length, veclerp);
755
- var rotation = sampleTrack(this.mRotationKeys, time, length, quatlerp);
756
- matrix.compose(pos, rotation, scale);
757
- var key = new Virtulous.KeyFrame(time, matrix);
758
- track.addKey(key);
759
- }
760
- track.target = o.findNode(this.mNodeName).toTHREE();
761
- var tracks = [track];
762
- if (o.nodeToBoneMap[this.mNodeName]) {
763
- for (let i = 0; i < o.nodeToBoneMap[this.mNodeName].length; i++) {
764
- var t2 = track.clone();
765
- t2.target = o.nodeToBoneMap[this.mNodeName][i];
766
- tracks.push(t2);
720
+ class aiNodeAnim {
721
+ constructor() {
722
+ this.mNodeName = "";
723
+ this.mNumPositionKeys = 0;
724
+ this.mNumRotationKeys = 0;
725
+ this.mNumScalingKeys = 0;
726
+ this.mPositionKeys = [];
727
+ this.mRotationKeys = [];
728
+ this.mScalingKeys = [];
729
+ this.mPreState = "";
730
+ this.mPostState = "";
731
+ this.init = function(tps) {
732
+ if (!tps)
733
+ tps = 1;
734
+ function t(t2) {
735
+ t2.mTime /= tps;
767
736
  }
768
- }
769
- return tracks;
770
- };
737
+ this.mPositionKeys.forEach(t);
738
+ this.mRotationKeys.forEach(t);
739
+ this.mScalingKeys.forEach(t);
740
+ };
741
+ this.sortKeys = function() {
742
+ function comp(a, b) {
743
+ return a.mTime - b.mTime;
744
+ }
745
+ this.mPositionKeys.sort(comp);
746
+ this.mRotationKeys.sort(comp);
747
+ this.mScalingKeys.sort(comp);
748
+ };
749
+ this.getLength = function() {
750
+ return Math.max(
751
+ Math.max.apply(
752
+ null,
753
+ this.mPositionKeys.map(function(a) {
754
+ return a.mTime;
755
+ })
756
+ ),
757
+ Math.max.apply(
758
+ null,
759
+ this.mRotationKeys.map(function(a) {
760
+ return a.mTime;
761
+ })
762
+ ),
763
+ Math.max.apply(
764
+ null,
765
+ this.mScalingKeys.map(function(a) {
766
+ return a.mTime;
767
+ })
768
+ )
769
+ );
770
+ };
771
+ this.toTHREE = function(o) {
772
+ this.sortKeys();
773
+ var length = this.getLength();
774
+ var track = new Virtulous.KeyFrameTrack();
775
+ for (let i = 0; i < length; i += 0.05) {
776
+ var matrix = new Matrix4();
777
+ var time = i;
778
+ var pos = sampleTrack(this.mPositionKeys, time, length, veclerp);
779
+ var scale = sampleTrack(this.mScalingKeys, time, length, veclerp);
780
+ var rotation = sampleTrack(this.mRotationKeys, time, length, quatlerp);
781
+ matrix.compose(pos, rotation, scale);
782
+ var key = new Virtulous.KeyFrame(time, matrix);
783
+ track.addKey(key);
784
+ }
785
+ track.target = o.findNode(this.mNodeName).toTHREE();
786
+ var tracks = [track];
787
+ if (o.nodeToBoneMap[this.mNodeName]) {
788
+ for (let i = 0; i < o.nodeToBoneMap[this.mNodeName].length; i++) {
789
+ var t2 = track.clone();
790
+ t2.target = o.nodeToBoneMap[this.mNodeName][i];
791
+ tracks.push(t2);
792
+ }
793
+ }
794
+ return tracks;
795
+ };
796
+ }
771
797
  }
772
- function aiAnimation() {
773
- this.mName = "";
774
- this.mDuration = 0;
775
- this.mTicksPerSecond = 0;
776
- this.mNumChannels = 0;
777
- this.mChannels = [];
778
- this.toTHREE = function(root) {
779
- var animationHandle = new Virtulous.Animation();
780
- for (let i in this.mChannels) {
781
- this.mChannels[i].init(this.mTicksPerSecond);
782
- var tracks = this.mChannels[i].toTHREE(root);
783
- for (let j in tracks) {
784
- tracks[j].init();
785
- animationHandle.addTrack(tracks[j]);
798
+ class aiAnimation {
799
+ constructor() {
800
+ this.mName = "";
801
+ this.mDuration = 0;
802
+ this.mTicksPerSecond = 0;
803
+ this.mNumChannels = 0;
804
+ this.mChannels = [];
805
+ this.toTHREE = function(root) {
806
+ var animationHandle = new Virtulous.Animation();
807
+ for (let i in this.mChannels) {
808
+ this.mChannels[i].init(this.mTicksPerSecond);
809
+ var tracks = this.mChannels[i].toTHREE(root);
810
+ for (let j in tracks) {
811
+ tracks[j].init();
812
+ animationHandle.addTrack(tracks[j]);
813
+ }
786
814
  }
787
- }
788
- animationHandle.length = Math.max.apply(
789
- null,
790
- animationHandle.tracks.map(function(e) {
791
- return e.length;
792
- })
793
- );
794
- return animationHandle;
795
- };
815
+ animationHandle.length = Math.max.apply(
816
+ null,
817
+ animationHandle.tracks.map(function(e) {
818
+ return e.length;
819
+ })
820
+ );
821
+ return animationHandle;
822
+ };
823
+ }
796
824
  }
797
- function aiTexture() {
798
- this.mWidth = 0;
799
- this.mHeight = 0;
800
- this.texAchFormatHint = [];
801
- this.pcData = [];
825
+ class aiTexture {
826
+ constructor() {
827
+ this.mWidth = 0;
828
+ this.mHeight = 0;
829
+ this.texAchFormatHint = [];
830
+ this.pcData = [];
831
+ }
802
832
  }
803
- function aiLight() {
804
- this.mName = "";
805
- this.mType = 0;
806
- this.mAttenuationConstant = 0;
807
- this.mAttenuationLinear = 0;
808
- this.mAttenuationQuadratic = 0;
809
- this.mAngleInnerCone = 0;
810
- this.mAngleOuterCone = 0;
811
- this.mColorDiffuse = null;
812
- this.mColorSpecular = null;
813
- this.mColorAmbient = null;
833
+ class aiLight {
834
+ constructor() {
835
+ this.mName = "";
836
+ this.mType = 0;
837
+ this.mAttenuationConstant = 0;
838
+ this.mAttenuationLinear = 0;
839
+ this.mAttenuationQuadratic = 0;
840
+ this.mAngleInnerCone = 0;
841
+ this.mAngleOuterCone = 0;
842
+ this.mColorDiffuse = null;
843
+ this.mColorSpecular = null;
844
+ this.mColorAmbient = null;
845
+ }
814
846
  }
815
- function aiCamera() {
816
- this.mName = "";
817
- this.mPosition = null;
818
- this.mLookAt = null;
819
- this.mUp = null;
820
- this.mHorizontalFOV = 0;
821
- this.mClipPlaneNear = 0;
822
- this.mClipPlaneFar = 0;
823
- this.mAspect = 0;
847
+ class aiCamera {
848
+ constructor() {
849
+ this.mName = "";
850
+ this.mPosition = null;
851
+ this.mLookAt = null;
852
+ this.mUp = null;
853
+ this.mHorizontalFOV = 0;
854
+ this.mClipPlaneNear = 0;
855
+ this.mClipPlaneFar = 0;
856
+ this.mAspect = 0;
857
+ }
824
858
  }
825
- function aiScene() {
826
- this.versionMajor = 0;
827
- this.versionMinor = 0;
828
- this.versionRevision = 0;
829
- this.compileFlags = 0;
830
- this.mFlags = 0;
831
- this.mNumMeshes = 0;
832
- this.mNumMaterials = 0;
833
- this.mNumAnimations = 0;
834
- this.mNumTextures = 0;
835
- this.mNumLights = 0;
836
- this.mNumCameras = 0;
837
- this.mRootNode = null;
838
- this.mMeshes = [];
839
- this.mMaterials = [];
840
- this.mAnimations = [];
841
- this.mLights = [];
842
- this.mCameras = [];
843
- this.nodeToBoneMap = {};
844
- this.findNode = function(name, root) {
845
- if (!root) {
846
- root = this.mRootNode;
847
- }
848
- if (root.mName == name) {
849
- return root;
850
- }
851
- for (let i = 0; i < root.mChildren.length; i++) {
852
- var ret = this.findNode(name, root.mChildren[i]);
853
- if (ret)
854
- return ret;
855
- }
856
- return null;
857
- };
858
- this.toTHREE = function() {
859
- this.nodeCount = 0;
860
- markBones(this);
861
- var o = this.mRootNode.toTHREE(this);
862
- for (let i in this.mMeshes)
863
- this.mMeshes[i].hookupSkeletons(this);
864
- if (this.mAnimations.length > 0) {
865
- var a = this.mAnimations[0].toTHREE(this);
866
- }
867
- return { object: o, animation: a };
868
- };
859
+ class aiScene {
860
+ constructor() {
861
+ this.versionMajor = 0;
862
+ this.versionMinor = 0;
863
+ this.versionRevision = 0;
864
+ this.compileFlags = 0;
865
+ this.mFlags = 0;
866
+ this.mNumMeshes = 0;
867
+ this.mNumMaterials = 0;
868
+ this.mNumAnimations = 0;
869
+ this.mNumTextures = 0;
870
+ this.mNumLights = 0;
871
+ this.mNumCameras = 0;
872
+ this.mRootNode = null;
873
+ this.mMeshes = [];
874
+ this.mMaterials = [];
875
+ this.mAnimations = [];
876
+ this.mLights = [];
877
+ this.mCameras = [];
878
+ this.nodeToBoneMap = {};
879
+ this.findNode = function(name, root) {
880
+ if (!root) {
881
+ root = this.mRootNode;
882
+ }
883
+ if (root.mName == name) {
884
+ return root;
885
+ }
886
+ for (let i = 0; i < root.mChildren.length; i++) {
887
+ var ret = this.findNode(name, root.mChildren[i]);
888
+ if (ret)
889
+ return ret;
890
+ }
891
+ return null;
892
+ };
893
+ this.toTHREE = function() {
894
+ this.nodeCount = 0;
895
+ markBones(this);
896
+ var o = this.mRootNode.toTHREE(this);
897
+ for (let i in this.mMeshes)
898
+ this.mMeshes[i].hookupSkeletons(this);
899
+ if (this.mAnimations.length > 0) {
900
+ var a = this.mAnimations[0].toTHREE(this);
901
+ }
902
+ return { object: o, animation: a };
903
+ };
904
+ }
869
905
  }
870
- function aiMatrix4() {
871
- this.elements = [[], [], [], []];
872
- this.toTHREE = function() {
873
- var m = new Matrix4();
874
- for (let i = 0; i < 4; ++i) {
875
- for (let i2 = 0; i2 < 4; ++i2) {
876
- m.elements[i * 4 + i2] = this.elements[i2][i];
906
+ class aiMatrix4 {
907
+ constructor() {
908
+ this.elements = [[], [], [], []];
909
+ this.toTHREE = function() {
910
+ var m = new Matrix4();
911
+ for (let i = 0; i < 4; ++i) {
912
+ for (let i2 = 0; i2 < 4; ++i2) {
913
+ m.elements[i * 4 + i2] = this.elements[i2][i];
914
+ }
877
915
  }
878
- }
879
- return m;
880
- };
916
+ return m;
917
+ };
918
+ }
881
919
  }
882
920
  var littleEndian = true;
883
921
  function readFloat(dataview) {
@@ -1390,7 +1428,7 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
1390
1428
  }
1391
1429
  return InternReadFile(buffer);
1392
1430
  }
1393
- });
1431
+ }
1394
1432
  export {
1395
1433
  AssimpLoader
1396
1434
  };