three-stdlib 2.22.9 → 2.23.0

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