three-stdlib 2.24.2 → 2.25.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (540) hide show
  1. package/controls/OrbitControls.d.ts +2 -0
  2. package/index.cjs +116401 -611
  3. package/index.js +116037 -263
  4. package/package.json +17 -4
  5. package/_polyfill/CapsuleGeometry.cjs +0 -22
  6. package/_polyfill/CapsuleGeometry.js +0 -22
  7. package/_polyfill/CompressedArrayTexture.cjs +0 -12
  8. package/_polyfill/CompressedArrayTexture.js +0 -12
  9. package/_polyfill/Data3DTexture.cjs +0 -17
  10. package/_polyfill/Data3DTexture.js +0 -17
  11. package/animation/AnimationClipCreator.cjs +0 -56
  12. package/animation/AnimationClipCreator.js +0 -56
  13. package/animation/CCDIKSolver.cjs +0 -269
  14. package/animation/CCDIKSolver.js +0 -269
  15. package/animation/MMDAnimationHelper.cjs +0 -688
  16. package/animation/MMDAnimationHelper.js +0 -688
  17. package/animation/MMDPhysics.cjs +0 -830
  18. package/animation/MMDPhysics.js +0 -830
  19. package/cameras/CinematicCamera.cjs +0 -131
  20. package/cameras/CinematicCamera.js +0 -131
  21. package/controls/ArcballControls.cjs +0 -2033
  22. package/controls/ArcballControls.js +0 -2033
  23. package/controls/DeviceOrientationControls.cjs +0 -85
  24. package/controls/DeviceOrientationControls.js +0 -85
  25. package/controls/DragControls.cjs +0 -182
  26. package/controls/DragControls.js +0 -182
  27. package/controls/FirstPersonControls.cjs +0 -229
  28. package/controls/FirstPersonControls.js +0 -229
  29. package/controls/FlyControls.cjs +0 -248
  30. package/controls/FlyControls.js +0 -248
  31. package/controls/OrbitControls.cjs +0 -787
  32. package/controls/OrbitControls.js +0 -787
  33. package/controls/PointerLockControls.cjs +0 -103
  34. package/controls/PointerLockControls.js +0 -103
  35. package/controls/TrackballControls.cjs +0 -502
  36. package/controls/TrackballControls.js +0 -502
  37. package/controls/TransformControls.cjs +0 -1089
  38. package/controls/TransformControls.js +0 -1089
  39. package/controls/experimental/CameraControls.cjs +0 -736
  40. package/controls/experimental/CameraControls.js +0 -736
  41. package/csm/CSM.cjs +0 -244
  42. package/csm/CSM.js +0 -244
  43. package/csm/CSMFrustum.cjs +0 -75
  44. package/csm/CSMFrustum.js +0 -75
  45. package/csm/CSMHelper.cjs +0 -114
  46. package/csm/CSMHelper.js +0 -114
  47. package/csm/CSMShader.cjs +0 -261
  48. package/csm/CSMShader.js +0 -261
  49. package/curves/CurveExtras.cjs +0 -214
  50. package/curves/CurveExtras.js +0 -214
  51. package/curves/NURBSCurve.cjs +0 -35
  52. package/curves/NURBSCurve.js +0 -35
  53. package/curves/NURBSSurface.cjs +0 -28
  54. package/curves/NURBSSurface.js +0 -28
  55. package/curves/NURBSUtils.cjs +0 -226
  56. package/curves/NURBSUtils.js +0 -226
  57. package/deprecated/Geometry.cjs +0 -971
  58. package/deprecated/Geometry.js +0 -971
  59. package/effects/AnaglyphEffect.cjs +0 -102
  60. package/effects/AnaglyphEffect.js +0 -102
  61. package/effects/AsciiEffect.cjs +0 -155
  62. package/effects/AsciiEffect.js +0 -155
  63. package/effects/OutlineEffect.cjs +0 -275
  64. package/effects/OutlineEffect.js +0 -275
  65. package/effects/ParallaxBarrierEffect.cjs +0 -65
  66. package/effects/ParallaxBarrierEffect.js +0 -65
  67. package/effects/PeppersGhostEffect.cjs +0 -88
  68. package/effects/PeppersGhostEffect.js +0 -88
  69. package/effects/StereoEffect.cjs +0 -35
  70. package/effects/StereoEffect.js +0 -35
  71. package/environments/RoomEnvironment.cjs +0 -95
  72. package/environments/RoomEnvironment.js +0 -78
  73. package/exporters/ColladaExporter.cjs +0 -331
  74. package/exporters/ColladaExporter.js +0 -331
  75. package/exporters/DRACOExporter.cjs +0 -141
  76. package/exporters/DRACOExporter.js +0 -141
  77. package/exporters/GLTFExporter.cjs +0 -1909
  78. package/exporters/GLTFExporter.js +0 -1909
  79. package/exporters/MMDExporter.cjs +0 -131
  80. package/exporters/MMDExporter.js +0 -131
  81. package/exporters/OBJExporter.cjs +0 -181
  82. package/exporters/OBJExporter.js +0 -181
  83. package/exporters/PLYExporter.cjs +0 -280
  84. package/exporters/PLYExporter.js +0 -280
  85. package/exporters/STLExporter.cjs +0 -146
  86. package/exporters/STLExporter.js +0 -146
  87. package/exporters/USDZExporter.cjs +0 -340
  88. package/exporters/USDZExporter.js +0 -340
  89. package/geometries/BoxLineGeometry.cjs +0 -45
  90. package/geometries/BoxLineGeometry.js +0 -45
  91. package/geometries/ConvexGeometry.cjs +0 -26
  92. package/geometries/ConvexGeometry.js +0 -26
  93. package/geometries/DecalGeometry.cjs +0 -184
  94. package/geometries/DecalGeometry.js +0 -184
  95. package/geometries/LightningStrike.cjs +0 -553
  96. package/geometries/LightningStrike.js +0 -553
  97. package/geometries/ParametricGeometries.cjs +0 -130
  98. package/geometries/ParametricGeometries.js +0 -130
  99. package/geometries/ParametricGeometry.cjs +0 -63
  100. package/geometries/ParametricGeometry.js +0 -63
  101. package/geometries/RoundedBoxGeometry.cjs +0 -91
  102. package/geometries/RoundedBoxGeometry.js +0 -91
  103. package/geometries/TeapotGeometry.cjs +0 -1563
  104. package/geometries/TeapotGeometry.js +0 -1563
  105. package/geometries/TextGeometry.cjs +0 -27
  106. package/geometries/TextGeometry.js +0 -27
  107. package/helpers/LightProbeHelper.cjs +0 -73
  108. package/helpers/LightProbeHelper.js +0 -73
  109. package/helpers/PositionalAudioHelper.cjs +0 -68
  110. package/helpers/PositionalAudioHelper.js +0 -68
  111. package/helpers/RectAreaLightHelper.cjs +0 -44
  112. package/helpers/RectAreaLightHelper.js +0 -44
  113. package/helpers/VertexNormalsHelper.cjs +0 -47
  114. package/helpers/VertexNormalsHelper.js +0 -47
  115. package/helpers/VertexTangentsHelper.cjs +0 -43
  116. package/helpers/VertexTangentsHelper.js +0 -43
  117. package/interactive/HTMLMesh.cjs +0 -325
  118. package/interactive/HTMLMesh.js +0 -325
  119. package/interactive/InteractiveGroup.cjs +0 -68
  120. package/interactive/InteractiveGroup.js +0 -68
  121. package/interactive/SelectionBox.cjs +0 -134
  122. package/interactive/SelectionBox.js +0 -134
  123. package/interactive/SelectionHelper.cjs +0 -51
  124. package/interactive/SelectionHelper.js +0 -51
  125. package/libs/MeshoptDecoder.cjs +0 -221
  126. package/libs/MeshoptDecoder.js +0 -221
  127. package/libs/MotionControllers.cjs +0 -325
  128. package/libs/MotionControllers.js +0 -325
  129. package/lights/LightProbeGenerator.cjs +0 -145
  130. package/lights/LightProbeGenerator.js +0 -145
  131. package/lights/RectAreaLightUniformsLib.cjs +0 -32846
  132. package/lights/RectAreaLightUniformsLib.js +0 -32846
  133. package/lines/Line2.cjs +0 -13
  134. package/lines/Line2.js +0 -13
  135. package/lines/LineGeometry.cjs +0 -44
  136. package/lines/LineGeometry.js +0 -44
  137. package/lines/LineMaterial.cjs +0 -547
  138. package/lines/LineMaterial.js +0 -547
  139. package/lines/LineSegments2.cjs +0 -203
  140. package/lines/LineSegments2.js +0 -203
  141. package/lines/LineSegmentsGeometry.cjs +0 -124
  142. package/lines/LineSegmentsGeometry.js +0 -124
  143. package/lines/Wireframe.cjs +0 -32
  144. package/lines/Wireframe.js +0 -32
  145. package/lines/WireframeGeometry2.cjs +0 -13
  146. package/lines/WireframeGeometry2.js +0 -13
  147. package/loaders/3DMLoader.cjs +0 -803
  148. package/loaders/3DMLoader.js +0 -803
  149. package/loaders/3MFLoader.cjs +0 -854
  150. package/loaders/3MFLoader.js +0 -854
  151. package/loaders/AMFLoader.cjs +0 -284
  152. package/loaders/AMFLoader.js +0 -284
  153. package/loaders/AssimpLoader.cjs +0 -1434
  154. package/loaders/AssimpLoader.js +0 -1434
  155. package/loaders/BVHLoader.cjs +0 -207
  156. package/loaders/BVHLoader.js +0 -207
  157. package/loaders/BasisTextureLoader.cjs +0 -489
  158. package/loaders/BasisTextureLoader.js +0 -489
  159. package/loaders/ColladaLoader.cjs +0 -2405
  160. package/loaders/ColladaLoader.js +0 -2405
  161. package/loaders/DDSLoader.cjs +0 -148
  162. package/loaders/DDSLoader.js +0 -148
  163. package/loaders/DRACOLoader.cjs +0 -341
  164. package/loaders/DRACOLoader.js +0 -341
  165. package/loaders/EXRLoader.cjs +0 -1356
  166. package/loaders/EXRLoader.js +0 -1356
  167. package/loaders/FBXLoader.cjs +0 -2457
  168. package/loaders/FBXLoader.js +0 -2457
  169. package/loaders/FontLoader.cjs +0 -123
  170. package/loaders/FontLoader.js +0 -123
  171. package/loaders/GCodeLoader.cjs +0 -141
  172. package/loaders/GCodeLoader.js +0 -141
  173. package/loaders/GLTFLoader.cjs +0 -2504
  174. package/loaders/GLTFLoader.js +0 -2504
  175. package/loaders/HDRCubeTextureLoader.cjs +0 -75
  176. package/loaders/HDRCubeTextureLoader.js +0 -75
  177. package/loaders/KMZLoader.cjs +0 -75
  178. package/loaders/KMZLoader.js +0 -75
  179. package/loaders/KTX2Loader.cjs +0 -480
  180. package/loaders/KTX2Loader.js +0 -480
  181. package/loaders/KTXLoader.cjs +0 -93
  182. package/loaders/KTXLoader.js +0 -93
  183. package/loaders/LDrawLoader.cjs +0 -1424
  184. package/loaders/LDrawLoader.js +0 -1424
  185. package/loaders/LUT3dlLoader.cjs +0 -103
  186. package/loaders/LUT3dlLoader.js +0 -103
  187. package/loaders/LUTCubeLoader.cjs +0 -107
  188. package/loaders/LUTCubeLoader.js +0 -107
  189. package/loaders/LWOLoader.cjs +0 -645
  190. package/loaders/LWOLoader.js +0 -645
  191. package/loaders/LottieLoader.cjs +0 -47
  192. package/loaders/LottieLoader.js +0 -47
  193. package/loaders/MD2Loader.cjs +0 -359
  194. package/loaders/MD2Loader.js +0 -359
  195. package/loaders/MDDLoader.cjs +0 -58
  196. package/loaders/MDDLoader.js +0 -58
  197. package/loaders/MMDLoader.cjs +0 -1121
  198. package/loaders/MMDLoader.js +0 -1121
  199. package/loaders/MTLLoader.cjs +0 -304
  200. package/loaders/MTLLoader.js +0 -304
  201. package/loaders/NRRDLoader.cjs +0 -401
  202. package/loaders/NRRDLoader.js +0 -401
  203. package/loaders/OBJLoader.cjs +0 -487
  204. package/loaders/OBJLoader.js +0 -487
  205. package/loaders/PCDLoader.cjs +0 -248
  206. package/loaders/PCDLoader.js +0 -248
  207. package/loaders/PDBLoader.cjs +0 -247
  208. package/loaders/PDBLoader.js +0 -247
  209. package/loaders/PLYLoader.cjs +0 -317
  210. package/loaders/PLYLoader.js +0 -317
  211. package/loaders/PRWMLoader.cjs +0 -160
  212. package/loaders/PRWMLoader.js +0 -160
  213. package/loaders/PVRLoader.cjs +0 -131
  214. package/loaders/PVRLoader.js +0 -131
  215. package/loaders/RGBELoader.cjs +0 -252
  216. package/loaders/RGBELoader.js +0 -252
  217. package/loaders/RGBMLoader.cjs +0 -1004
  218. package/loaders/RGBMLoader.js +0 -1004
  219. package/loaders/STLLoader.cjs +0 -190
  220. package/loaders/STLLoader.js +0 -190
  221. package/loaders/SVGLoader.cjs +0 -1712
  222. package/loaders/SVGLoader.js +0 -1712
  223. package/loaders/TDSLoader.cjs +0 -650
  224. package/loaders/TDSLoader.js +0 -650
  225. package/loaders/TGALoader.cjs +0 -285
  226. package/loaders/TGALoader.js +0 -285
  227. package/loaders/TTFLoader.cjs +0 -131
  228. package/loaders/TTFLoader.js +0 -131
  229. package/loaders/TiltLoader.cjs +0 -375
  230. package/loaders/TiltLoader.js +0 -375
  231. package/loaders/VOXLoader.cjs +0 -432
  232. package/loaders/VOXLoader.js +0 -432
  233. package/loaders/VRMLLoader.cjs +0 -2105
  234. package/loaders/VRMLLoader.js +0 -2105
  235. package/loaders/VRMLoader.cjs +0 -38
  236. package/loaders/VRMLoader.js +0 -38
  237. package/loaders/VTKLoader.cjs +0 -648
  238. package/loaders/VTKLoader.js +0 -648
  239. package/loaders/XLoader.cjs +0 -1258
  240. package/loaders/XLoader.js +0 -1258
  241. package/loaders/XYZLoader.cjs +0 -60
  242. package/loaders/XYZLoader.js +0 -60
  243. package/loaders/lwo/IFFParser.cjs +0 -743
  244. package/loaders/lwo/IFFParser.js +0 -743
  245. package/loaders/lwo/LWO2Parser.cjs +0 -312
  246. package/loaders/lwo/LWO2Parser.js +0 -312
  247. package/loaders/lwo/LWO3Parser.cjs +0 -282
  248. package/loaders/lwo/LWO3Parser.js +0 -282
  249. package/math/Capsule.cjs +0 -98
  250. package/math/Capsule.js +0 -98
  251. package/math/ColorConverter.cjs +0 -42
  252. package/math/ColorConverter.js +0 -42
  253. package/math/ConvexHull.cjs +0 -596
  254. package/math/ConvexHull.js +0 -596
  255. package/math/ImprovedNoise.cjs +0 -304
  256. package/math/ImprovedNoise.js +0 -304
  257. package/math/Lut.cjs +0 -137
  258. package/math/Lut.js +0 -137
  259. package/math/MeshSurfaceSampler.cjs +0 -103
  260. package/math/MeshSurfaceSampler.js +0 -103
  261. package/math/OBB.cjs +0 -242
  262. package/math/OBB.js +0 -242
  263. package/math/Octree.cjs +0 -273
  264. package/math/Octree.js +0 -273
  265. package/math/SimplexNoise.cjs +0 -440
  266. package/math/SimplexNoise.js +0 -440
  267. package/misc/ConvexObjectBreaker.cjs +0 -292
  268. package/misc/ConvexObjectBreaker.js +0 -292
  269. package/misc/GPUComputationRenderer.cjs +0 -205
  270. package/misc/GPUComputationRenderer.js +0 -205
  271. package/misc/Gyroscope.cjs +0 -33
  272. package/misc/Gyroscope.js +0 -33
  273. package/misc/MD2Character.cjs +0 -167
  274. package/misc/MD2Character.js +0 -167
  275. package/misc/MD2CharacterComplex.cjs +0 -332
  276. package/misc/MD2CharacterComplex.js +0 -332
  277. package/misc/MorphAnimMesh.cjs +0 -40
  278. package/misc/MorphAnimMesh.js +0 -40
  279. package/misc/MorphBlendMesh.cjs +0 -179
  280. package/misc/MorphBlendMesh.js +0 -179
  281. package/misc/ProgressiveLightmap.cjs +0 -186
  282. package/misc/ProgressiveLightmap.js +0 -186
  283. package/misc/RollerCoaster.cjs +0 -353
  284. package/misc/RollerCoaster.js +0 -353
  285. package/misc/Timer.cjs +0 -101
  286. package/misc/Timer.js +0 -101
  287. package/misc/TubePainter.cjs +0 -123
  288. package/misc/TubePainter.js +0 -123
  289. package/misc/Volume.cjs +0 -305
  290. package/misc/Volume.js +0 -305
  291. package/misc/VolumeSlice.cjs +0 -114
  292. package/misc/VolumeSlice.js +0 -114
  293. package/misc/WebGL.cjs +0 -74
  294. package/misc/WebGL.js +0 -74
  295. package/modifiers/CurveModifier.cjs +0 -232
  296. package/modifiers/CurveModifier.js +0 -232
  297. package/modifiers/EdgeSplitModifier.cjs +0 -167
  298. package/modifiers/EdgeSplitModifier.js +0 -168
  299. package/modifiers/SimplifyModifier.cjs +0 -301
  300. package/modifiers/SimplifyModifier.js +0 -301
  301. package/modifiers/TessellateModifier.cjs +0 -214
  302. package/modifiers/TessellateModifier.js +0 -214
  303. package/objects/GroundProjectedEnv.cjs +0 -134
  304. package/objects/GroundProjectedEnv.js +0 -134
  305. package/objects/Lensflare.cjs +0 -291
  306. package/objects/Lensflare.js +0 -291
  307. package/objects/LightningStorm.cjs +0 -110
  308. package/objects/LightningStorm.js +0 -110
  309. package/objects/MarchingCubes.cjs +0 -4809
  310. package/objects/MarchingCubes.js +0 -4809
  311. package/objects/Reflector.cjs +0 -202
  312. package/objects/Reflector.js +0 -202
  313. package/objects/ReflectorForSSRPass.cjs +0 -260
  314. package/objects/ReflectorForSSRPass.js +0 -260
  315. package/objects/ReflectorRTT.cjs +0 -10
  316. package/objects/ReflectorRTT.js +0 -10
  317. package/objects/Refractor.cjs +0 -215
  318. package/objects/Refractor.js +0 -215
  319. package/objects/ShadowMesh.cjs +0 -45
  320. package/objects/ShadowMesh.js +0 -45
  321. package/objects/Sky.cjs +0 -200
  322. package/objects/Sky.js +0 -200
  323. package/objects/Water.cjs +0 -242
  324. package/objects/Water.js +0 -242
  325. package/objects/Water2.cjs +0 -256
  326. package/objects/Water2.js +0 -256
  327. package/physics/AmmoPhysics.cjs +0 -166
  328. package/physics/AmmoPhysics.js +0 -166
  329. package/postprocessing/AdaptiveToneMappingPass.cjs +0 -218
  330. package/postprocessing/AdaptiveToneMappingPass.js +0 -218
  331. package/postprocessing/AfterimagePass.cjs +0 -68
  332. package/postprocessing/AfterimagePass.js +0 -68
  333. package/postprocessing/BloomPass.cjs +0 -109
  334. package/postprocessing/BloomPass.js +0 -109
  335. package/postprocessing/BokehPass.cjs +0 -90
  336. package/postprocessing/BokehPass.js +0 -90
  337. package/postprocessing/ClearPass.cjs +0 -36
  338. package/postprocessing/ClearPass.js +0 -36
  339. package/postprocessing/CubeTexturePass.cjs +0 -53
  340. package/postprocessing/CubeTexturePass.js +0 -53
  341. package/postprocessing/DotScreenPass.cjs +0 -49
  342. package/postprocessing/DotScreenPass.js +0 -49
  343. package/postprocessing/EffectComposer.cjs +0 -157
  344. package/postprocessing/EffectComposer.js +0 -157
  345. package/postprocessing/FilmPass.cjs +0 -51
  346. package/postprocessing/FilmPass.js +0 -51
  347. package/postprocessing/GlitchPass.cjs +0 -84
  348. package/postprocessing/GlitchPass.js +0 -84
  349. package/postprocessing/HalftonePass.cjs +0 -53
  350. package/postprocessing/HalftonePass.js +0 -53
  351. package/postprocessing/LUTPass.cjs +0 -142
  352. package/postprocessing/LUTPass.js +0 -142
  353. package/postprocessing/MaskPass.cjs +0 -69
  354. package/postprocessing/MaskPass.js +0 -69
  355. package/postprocessing/OutlinePass.cjs +0 -479
  356. package/postprocessing/OutlinePass.js +0 -479
  357. package/postprocessing/Pass.cjs +0 -48
  358. package/postprocessing/Pass.js +0 -48
  359. package/postprocessing/RenderPass.cjs +0 -59
  360. package/postprocessing/RenderPass.js +0 -59
  361. package/postprocessing/RenderPixelatedPass.cjs +0 -199
  362. package/postprocessing/RenderPixelatedPass.js +0 -199
  363. package/postprocessing/SAOPass.cjs +0 -288
  364. package/postprocessing/SAOPass.js +0 -288
  365. package/postprocessing/SMAAPass.cjs +0 -112
  366. package/postprocessing/SMAAPass.js +0 -112
  367. package/postprocessing/SSAARenderPass.cjs +0 -189
  368. package/postprocessing/SSAARenderPass.js +0 -189
  369. package/postprocessing/SSAOPass.cjs +0 -272
  370. package/postprocessing/SSAOPass.js +0 -272
  371. package/postprocessing/SSRPass.cjs +0 -411
  372. package/postprocessing/SSRPass.js +0 -411
  373. package/postprocessing/SavePass.cjs +0 -38
  374. package/postprocessing/SavePass.js +0 -38
  375. package/postprocessing/ShaderPass.cjs +0 -49
  376. package/postprocessing/ShaderPass.js +0 -49
  377. package/postprocessing/TAARenderPass.cjs +0 -174
  378. package/postprocessing/TAARenderPass.js +0 -174
  379. package/postprocessing/TexturePass.cjs +0 -42
  380. package/postprocessing/TexturePass.js +0 -42
  381. package/postprocessing/UnrealBloomPass.cjs +0 -277
  382. package/postprocessing/UnrealBloomPass.js +0 -277
  383. package/postprocessing/WaterPass.cjs +0 -72
  384. package/postprocessing/WaterPass.js +0 -72
  385. package/renderers/CSS2DRenderer.cjs +0 -122
  386. package/renderers/CSS2DRenderer.js +0 -122
  387. package/renderers/CSS3DRenderer.cjs +0 -167
  388. package/renderers/CSS3DRenderer.js +0 -167
  389. package/renderers/Projector.cjs +0 -499
  390. package/renderers/Projector.js +0 -499
  391. package/renderers/SVGRenderer.cjs +0 -311
  392. package/renderers/SVGRenderer.js +0 -311
  393. package/shaders/ACESFilmicToneMappingShader.cjs +0 -55
  394. package/shaders/ACESFilmicToneMappingShader.js +0 -55
  395. package/shaders/AfterimageShader.cjs +0 -32
  396. package/shaders/AfterimageShader.js +0 -32
  397. package/shaders/BasicShader.cjs +0 -12
  398. package/shaders/BasicShader.js +0 -12
  399. package/shaders/BleachBypassShader.cjs +0 -35
  400. package/shaders/BleachBypassShader.js +0 -35
  401. package/shaders/BlendShader.cjs +0 -30
  402. package/shaders/BlendShader.js +0 -30
  403. package/shaders/BokehShader.cjs +0 -109
  404. package/shaders/BokehShader.js +0 -109
  405. package/shaders/BokehShader2.cjs +0 -269
  406. package/shaders/BokehShader2.js +0 -269
  407. package/shaders/BrightnessContrastShader.cjs +0 -32
  408. package/shaders/BrightnessContrastShader.js +0 -32
  409. package/shaders/ColorCorrectionShader.cjs +0 -30
  410. package/shaders/ColorCorrectionShader.js +0 -30
  411. package/shaders/ColorifyShader.cjs +0 -28
  412. package/shaders/ColorifyShader.js +0 -28
  413. package/shaders/ConvolutionShader.cjs +0 -55
  414. package/shaders/ConvolutionShader.js +0 -55
  415. package/shaders/CopyShader.cjs +0 -25
  416. package/shaders/CopyShader.js +0 -25
  417. package/shaders/DOFMipMapShader.cjs +0 -32
  418. package/shaders/DOFMipMapShader.js +0 -32
  419. package/shaders/DepthLimitedBlurShader.cjs +0 -114
  420. package/shaders/DepthLimitedBlurShader.js +0 -114
  421. package/shaders/DigitalGlitch.cjs +0 -85
  422. package/shaders/DigitalGlitch.js +0 -85
  423. package/shaders/DotScreenShader.cjs +0 -39
  424. package/shaders/DotScreenShader.js +0 -39
  425. package/shaders/FXAAShader.cjs +0 -1098
  426. package/shaders/FXAAShader.js +0 -1098
  427. package/shaders/FilmShader.cjs +0 -53
  428. package/shaders/FilmShader.js +0 -53
  429. package/shaders/FocusShader.cjs +0 -55
  430. package/shaders/FocusShader.js +0 -55
  431. package/shaders/FreiChenShader.cjs +0 -64
  432. package/shaders/FreiChenShader.js +0 -64
  433. package/shaders/FresnelShader.cjs +0 -47
  434. package/shaders/FresnelShader.js +0 -47
  435. package/shaders/GammaCorrectionShader.cjs +0 -23
  436. package/shaders/GammaCorrectionShader.js +0 -23
  437. package/shaders/GodRaysShader.cjs +0 -183
  438. package/shaders/GodRaysShader.js +0 -183
  439. package/shaders/HalftoneShader.cjs +0 -228
  440. package/shaders/HalftoneShader.js +0 -228
  441. package/shaders/HorizontalBlurShader.cjs +0 -49
  442. package/shaders/HorizontalBlurShader.js +0 -49
  443. package/shaders/HorizontalTiltShiftShader.cjs +0 -37
  444. package/shaders/HorizontalTiltShiftShader.js +0 -37
  445. package/shaders/HueSaturationShader.cjs +0 -43
  446. package/shaders/HueSaturationShader.js +0 -43
  447. package/shaders/KaleidoShader.cjs +0 -34
  448. package/shaders/KaleidoShader.js +0 -34
  449. package/shaders/LuminosityHighPassShader.cjs +0 -37
  450. package/shaders/LuminosityHighPassShader.js +0 -37
  451. package/shaders/LuminosityShader.cjs +0 -25
  452. package/shaders/LuminosityShader.js +0 -25
  453. package/shaders/MirrorShader.cjs +0 -35
  454. package/shaders/MirrorShader.js +0 -35
  455. package/shaders/NormalMapShader.cjs +0 -31
  456. package/shaders/NormalMapShader.js +0 -31
  457. package/shaders/ParallaxShader.cjs +0 -133
  458. package/shaders/ParallaxShader.js +0 -133
  459. package/shaders/PixelShader.cjs +0 -28
  460. package/shaders/PixelShader.js +0 -28
  461. package/shaders/RGBShiftShader.cjs +0 -30
  462. package/shaders/RGBShiftShader.js +0 -30
  463. package/shaders/SAOShader.cjs +0 -144
  464. package/shaders/SAOShader.js +0 -144
  465. package/shaders/SMAAShader.cjs +0 -358
  466. package/shaders/SMAAShader.js +0 -358
  467. package/shaders/SSAOShader.cjs +0 -182
  468. package/shaders/SSAOShader.js +0 -182
  469. package/shaders/SSRShader.cjs +0 -342
  470. package/shaders/SSRShader.js +0 -342
  471. package/shaders/SepiaShader.cjs +0 -29
  472. package/shaders/SepiaShader.js +0 -29
  473. package/shaders/SobelOperatorShader.cjs +0 -54
  474. package/shaders/SobelOperatorShader.js +0 -54
  475. package/shaders/SubsurfaceScatteringShader.cjs +0 -98
  476. package/shaders/SubsurfaceScatteringShader.js +0 -98
  477. package/shaders/TechnicolorShader.cjs +0 -24
  478. package/shaders/TechnicolorShader.js +0 -24
  479. package/shaders/ToneMapShader.cjs +0 -51
  480. package/shaders/ToneMapShader.js +0 -51
  481. package/shaders/ToonShader.cjs +0 -188
  482. package/shaders/ToonShader.js +0 -188
  483. package/shaders/TriangleBlurShader.cjs +0 -37
  484. package/shaders/TriangleBlurShader.js +0 -37
  485. package/shaders/UnpackDepthRGBAShader.cjs +0 -26
  486. package/shaders/UnpackDepthRGBAShader.js +0 -26
  487. package/shaders/VerticalBlurShader.cjs +0 -50
  488. package/shaders/VerticalBlurShader.js +0 -50
  489. package/shaders/VerticalTiltShiftShader.cjs +0 -37
  490. package/shaders/VerticalTiltShiftShader.js +0 -37
  491. package/shaders/VignetteShader.cjs +0 -38
  492. package/shaders/VignetteShader.js +0 -38
  493. package/shaders/VolumeShader.cjs +0 -225
  494. package/shaders/VolumeShader.js +0 -225
  495. package/shaders/WaterRefractionShader.cjs +0 -59
  496. package/shaders/WaterRefractionShader.js +0 -59
  497. package/shaders/types.cjs +0 -1
  498. package/shaders/types.js +0 -1
  499. package/textures/FlakesTexture.cjs +0 -30
  500. package/textures/FlakesTexture.js +0 -30
  501. package/types/helpers.cjs +0 -4
  502. package/types/helpers.js +0 -4
  503. package/utils/BufferGeometryUtils.cjs +0 -636
  504. package/utils/BufferGeometryUtils.js +0 -636
  505. package/utils/GeometryCompressionUtils.cjs +0 -573
  506. package/utils/GeometryCompressionUtils.js +0 -573
  507. package/utils/GeometryUtils.cjs +0 -109
  508. package/utils/GeometryUtils.js +0 -109
  509. package/utils/RoughnessMipmapper.cjs +0 -223
  510. package/utils/RoughnessMipmapper.js +0 -223
  511. package/utils/SceneUtils.cjs +0 -36
  512. package/utils/SceneUtils.js +0 -36
  513. package/utils/ShadowMapViewer.cjs +0 -111
  514. package/utils/ShadowMapViewer.js +0 -111
  515. package/utils/SkeletonUtils.cjs +0 -211
  516. package/utils/SkeletonUtils.js +0 -211
  517. package/utils/UVsDebug.cjs +0 -80
  518. package/utils/UVsDebug.js +0 -80
  519. package/utils/WorkerPool.cjs +0 -62
  520. package/utils/WorkerPool.js +0 -62
  521. package/webxr/ARButton.cjs +0 -119
  522. package/webxr/ARButton.js +0 -119
  523. package/webxr/OculusHandModel.cjs +0 -82
  524. package/webxr/OculusHandModel.js +0 -82
  525. package/webxr/OculusHandPointerModel.cjs +0 -241
  526. package/webxr/OculusHandPointerModel.js +0 -224
  527. package/webxr/Text2D.cjs +0 -48
  528. package/webxr/Text2D.js +0 -31
  529. package/webxr/VRButton.cjs +0 -111
  530. package/webxr/VRButton.js +0 -111
  531. package/webxr/XRControllerModelFactory.cjs +0 -174
  532. package/webxr/XRControllerModelFactory.js +0 -174
  533. package/webxr/XREstimatedLight.cjs +0 -126
  534. package/webxr/XREstimatedLight.js +0 -126
  535. package/webxr/XRHandMeshModel.cjs +0 -82
  536. package/webxr/XRHandMeshModel.js +0 -82
  537. package/webxr/XRHandModelFactory.cjs +0 -61
  538. package/webxr/XRHandModelFactory.js +0 -61
  539. package/webxr/XRHandPrimitiveModel.cjs +0 -68
  540. package/webxr/XRHandPrimitiveModel.js +0 -68
@@ -1,1258 +0,0 @@
1
- import { Vector3, Quaternion, Loader, TextureLoader, FileLoader, LoaderUtils, Matrix4, Bone, BufferGeometry, Float32BufferAttribute, Uint16BufferAttribute, MeshPhongMaterial, FrontSide, Vector2, SkinnedMesh, Mesh, Skeleton, AnimationClip, AnimationMixer } from "three";
2
- var XLoader = /* @__PURE__ */ function() {
3
- var classCallCheck = function(instance, Constructor) {
4
- if (!(instance instanceof Constructor)) {
5
- throw new TypeError("Cannot call a class as a function");
6
- }
7
- };
8
- var createClass = function() {
9
- function defineProperties(target, props) {
10
- for (let i2 = 0; i2 < props.length; i2++) {
11
- var descriptor = props[i2];
12
- descriptor.enumerable = descriptor.enumerable || false;
13
- descriptor.configurable = true;
14
- if ("value" in descriptor)
15
- descriptor.writable = true;
16
- Object.defineProperty(target, descriptor.key, descriptor);
17
- }
18
- }
19
- return function(Constructor, protoProps, staticProps) {
20
- if (protoProps)
21
- defineProperties(Constructor.prototype, protoProps);
22
- if (staticProps)
23
- defineProperties(Constructor, staticProps);
24
- return Constructor;
25
- };
26
- }();
27
- var XboneInf = function XboneInf2() {
28
- classCallCheck(this, XboneInf2);
29
- this.boneName = "";
30
- this.BoneIndex = 0;
31
- this.Indeces = [];
32
- this.Weights = [];
33
- this.initMatrix = null;
34
- this.OffsetMatrix = null;
35
- };
36
- var XAnimationInfo = function XAnimationInfo2() {
37
- classCallCheck(this, XAnimationInfo2);
38
- this.animeName = "";
39
- this.boneName = "";
40
- this.targetBone = null;
41
- this.keyType = 4;
42
- this.frameStartLv = 0;
43
- this.keyFrames = [];
44
- this.InverseMx = null;
45
- };
46
- var XAnimationObj = function() {
47
- function XAnimationObj2(_flags) {
48
- classCallCheck(this, XAnimationObj2);
49
- this.fps = 30;
50
- this.name = "xanimation";
51
- this.length = 0;
52
- this.hierarchy = [];
53
- this.putFlags = _flags;
54
- if (this.putFlags.putPos === void 0) {
55
- this.putFlags.putPos = true;
56
- }
57
- if (this.putFlags.putRot === void 0) {
58
- this.putFlags.putRot = true;
59
- }
60
- if (this.putFlags.putScl === void 0) {
61
- this.putFlags.putScl = true;
62
- }
63
- }
64
- createClass(XAnimationObj2, [
65
- {
66
- key: "make",
67
- value: function make(XAnimationInfoArray) {
68
- for (let i2 = 0; i2 < XAnimationInfoArray.length; i2++) {
69
- this.hierarchy.push(this.makeBonekeys(XAnimationInfoArray[i2]));
70
- }
71
- this.length = this.hierarchy[0].keys[this.hierarchy[0].keys.length - 1].time;
72
- }
73
- },
74
- {
75
- key: "clone",
76
- value: function clone() {
77
- return Object.assign({}, this);
78
- }
79
- },
80
- {
81
- key: "makeBonekeys",
82
- value: function makeBonekeys(XAnimationInfo2) {
83
- var refObj = {};
84
- refObj.name = XAnimationInfo2.boneName;
85
- refObj.parent = "";
86
- refObj.keys = this.keyFrameRefactor(XAnimationInfo2);
87
- refObj.copy = function() {
88
- return Object.assign({}, this);
89
- };
90
- return refObj;
91
- }
92
- },
93
- {
94
- key: "keyFrameRefactor",
95
- value: function keyFrameRefactor(XAnimationInfo2) {
96
- var keys = [];
97
- for (let i2 = 0; i2 < XAnimationInfo2.keyFrames.length; i2++) {
98
- var keyframe = {};
99
- keyframe.time = XAnimationInfo2.keyFrames[i2].time * this.fps;
100
- if (XAnimationInfo2.keyFrames[i2].pos && this.putFlags.putPos) {
101
- keyframe.pos = XAnimationInfo2.keyFrames[i2].pos;
102
- }
103
- if (XAnimationInfo2.keyFrames[i2].rot && this.putFlags.putRot) {
104
- keyframe.rot = XAnimationInfo2.keyFrames[i2].rot;
105
- }
106
- if (XAnimationInfo2.keyFrames[i2].scl && this.putFlags.putScl) {
107
- keyframe.scl = XAnimationInfo2.keyFrames[i2].scl;
108
- }
109
- if (XAnimationInfo2.keyFrames[i2].matrix) {
110
- keyframe.matrix = XAnimationInfo2.keyFrames[i2].matrix;
111
- if (this.putFlags.putPos) {
112
- keyframe.pos = new Vector3().setFromMatrixPosition(keyframe.matrix);
113
- }
114
- if (this.putFlags.putRot) {
115
- keyframe.rot = new Quaternion().setFromRotationMatrix(keyframe.matrix);
116
- }
117
- if (this.putFlags.putScl) {
118
- keyframe.scl = new Vector3().setFromMatrixScale(keyframe.matrix);
119
- }
120
- }
121
- keys.push(keyframe);
122
- }
123
- return keys;
124
- }
125
- }
126
- ]);
127
- return XAnimationObj2;
128
- }();
129
- var XKeyFrameInfo = function XKeyFrameInfo2() {
130
- classCallCheck(this, XKeyFrameInfo2);
131
- this.index = 0;
132
- this.Frame = 0;
133
- this.time = 0;
134
- this.matrix = null;
135
- };
136
- var XLoader2 = function() {
137
- function XLoader3(manager) {
138
- Loader.call(this, manager);
139
- classCallCheck(this, XLoader3);
140
- this.debug = false;
141
- this.texloader = new TextureLoader(this.manager);
142
- this.url = "";
143
- this._putMatLength = 0;
144
- this._nowMat = null;
145
- this._nowFrameName = "";
146
- this.frameHierarchie = [];
147
- this.Hierarchies = {};
148
- this.HieStack = [];
149
- this._currentObject = {};
150
- this._currentFrame = {};
151
- this._data = null;
152
- this.onLoad = null;
153
- this.IsUvYReverse = true;
154
- this.Meshes = [];
155
- this.animations = [];
156
- this.animTicksPerSecond = 30;
157
- this._currentGeo = null;
158
- this._currentAnime = null;
159
- this._currentAnimeFrames = null;
160
- }
161
- createClass(XLoader3, [
162
- {
163
- key: "_setArgOption",
164
- value: function _setArgOption(_arg) {
165
- var _start = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
166
- if (!_arg) {
167
- return;
168
- }
169
- for (let i2 = _start; i2 < _arg.length; i2++) {
170
- switch (i2) {
171
- case 0:
172
- this.url = _arg[i2];
173
- break;
174
- case 1:
175
- this.options = _arg[i2];
176
- break;
177
- }
178
- }
179
- if (this.options === void 0) {
180
- this.options = {};
181
- }
182
- }
183
- },
184
- {
185
- key: "load",
186
- value: function load(_arg, onLoad, onProgress, onError) {
187
- var _this = this;
188
- this._setArgOption(_arg);
189
- var loader = new FileLoader(this.manager);
190
- loader.setPath(this.path);
191
- loader.setResponseType("arraybuffer");
192
- loader.setRequestHeader(this.requestHeader);
193
- loader.setWithCredentials(this.withCredentials);
194
- loader.load(
195
- this.url,
196
- function(response) {
197
- try {
198
- _this.parse(response, onLoad);
199
- } catch (e) {
200
- if (onError) {
201
- onError(e);
202
- } else {
203
- console.error(e);
204
- }
205
- _this.manager.itemError(_this.url);
206
- }
207
- },
208
- onProgress,
209
- onError
210
- );
211
- }
212
- },
213
- {
214
- key: "_readLine",
215
- value: function _readLine(line) {
216
- var readed = 0;
217
- while (true) {
218
- var find = -1;
219
- find = line.indexOf("//", readed);
220
- if (find === -1) {
221
- find = line.indexOf("#", readed);
222
- }
223
- if (find > -1 && find < 2) {
224
- var foundNewLine = -1;
225
- foundNewLine = line.indexOf("\r\n", readed);
226
- if (foundNewLine > 0) {
227
- readed = foundNewLine + 2;
228
- } else {
229
- foundNewLine = line.indexOf("\r", readed);
230
- if (foundNewLine > 0) {
231
- readed = foundNewLine + 1;
232
- } else {
233
- readed = line.indexOf("\n", readed) + 1;
234
- }
235
- }
236
- } else {
237
- break;
238
- }
239
- }
240
- return line.substr(readed);
241
- }
242
- },
243
- {
244
- key: "_readLine",
245
- value: function _readLine(line) {
246
- var readed = 0;
247
- while (true) {
248
- var find = -1;
249
- find = line.indexOf("//", readed);
250
- if (find === -1) {
251
- find = line.indexOf("#", readed);
252
- }
253
- if (find > -1 && find < 2) {
254
- var foundNewLine = -1;
255
- foundNewLine = line.indexOf("\r\n", readed);
256
- if (foundNewLine > 0) {
257
- readed = foundNewLine + 2;
258
- } else {
259
- foundNewLine = line.indexOf("\r", readed);
260
- if (foundNewLine > 0) {
261
- readed = foundNewLine + 1;
262
- } else {
263
- readed = line.indexOf("\n", readed) + 1;
264
- }
265
- }
266
- } else {
267
- break;
268
- }
269
- }
270
- return line.substr(readed);
271
- }
272
- },
273
- {
274
- key: "_isBinary",
275
- value: function _isBinary(binData) {
276
- var reader = new DataView(binData);
277
- var face_size = 32 / 8 * 3 + 32 / 8 * 3 * 3 + 16 / 8;
278
- var n_faces = reader.getUint32(80, true);
279
- var expect = 80 + 32 / 8 + n_faces * face_size;
280
- if (expect === reader.byteLength) {
281
- return true;
282
- }
283
- var fileLength = reader.byteLength;
284
- for (let index = 0; index < fileLength; index++) {
285
- if (reader.getUint8(index, false) > 127) {
286
- return true;
287
- }
288
- }
289
- return false;
290
- }
291
- },
292
- {
293
- key: "_ensureBinary",
294
- value: function _ensureBinary(buf) {
295
- if (typeof buf === "string") {
296
- var array_buffer = new Uint8Array(buf.length);
297
- for (let i2 = 0; i2 < buf.length; i2++) {
298
- array_buffer[i2] = buf.charCodeAt(i2) & 255;
299
- }
300
- return array_buffer.buffer || array_buffer;
301
- } else {
302
- return buf;
303
- }
304
- }
305
- },
306
- {
307
- key: "_ensureString",
308
- value: function _ensureString(buf) {
309
- if (typeof buf !== "string") {
310
- return LoaderUtils.decodeText(new Uint8Array(buf));
311
- } else {
312
- return buf;
313
- }
314
- }
315
- },
316
- {
317
- key: "parse",
318
- value: function _parse(data, onLoad) {
319
- var binData = this._ensureBinary(data);
320
- this._data = this._ensureString(data);
321
- this.onLoad = onLoad;
322
- return this._isBinary(binData) ? this._parseBinary(binData) : this._parseASCII();
323
- }
324
- },
325
- {
326
- key: "_parseBinary",
327
- value: function _parseBinary(data) {
328
- return this._parseASCII(LoaderUtils.decodeText(new Uint8Array(data)));
329
- }
330
- },
331
- {
332
- key: "_parseASCII",
333
- value: function _parseASCII() {
334
- var path;
335
- if (this.resourcePath !== "") {
336
- path = this.resourcePath;
337
- } else if (this.path !== "") {
338
- path = this.path;
339
- } else {
340
- path = LoaderUtils.extractUrlBase(this.url);
341
- }
342
- this.texloader.setPath(path).setCrossOrigin(this.crossOrigin);
343
- var endRead = 16;
344
- this.Hierarchies.children = [];
345
- this._hierarchieParse(this.Hierarchies, endRead);
346
- this._changeRoot();
347
- this._currentObject = this.Hierarchies.children.shift();
348
- this._mainloop();
349
- }
350
- },
351
- {
352
- key: "_hierarchieParse",
353
- value: function _hierarchieParse(_parent, _end) {
354
- var endRead = _end;
355
- while (true) {
356
- var find1 = this._data.indexOf("{", endRead) + 1;
357
- var findEnd = this._data.indexOf("}", endRead);
358
- var findNext = this._data.indexOf("{", find1) + 1;
359
- if (find1 > 0 && findEnd > find1) {
360
- var _currentObject = {};
361
- _currentObject.children = [];
362
- var nameData = this._readLine(this._data.substr(endRead, find1 - endRead - 1)).trim();
363
- var word = nameData.split(/ /g);
364
- if (word.length > 0) {
365
- _currentObject.type = word[0];
366
- if (word.length >= 2) {
367
- _currentObject.name = word[1];
368
- } else {
369
- _currentObject.name = word[0] + this.Hierarchies.children.length;
370
- }
371
- } else {
372
- _currentObject.name = nameData;
373
- _currentObject.type = "";
374
- }
375
- if (_currentObject.type === "Animation") {
376
- _currentObject.data = this._data.substr(findNext, findEnd - findNext).trim();
377
- var refs = this._hierarchieParse(_currentObject, findEnd + 1);
378
- endRead = refs.end;
379
- _currentObject.children = refs.parent.children;
380
- } else {
381
- var DataEnder = this._data.lastIndexOf(";", findNext > 0 ? Math.min(findNext, findEnd) : findEnd);
382
- _currentObject.data = this._data.substr(find1, DataEnder - find1).trim();
383
- if (findNext <= 0 || findEnd < findNext) {
384
- endRead = findEnd + 1;
385
- } else {
386
- var nextStart = Math.max(DataEnder + 1, find1);
387
- var _refs = this._hierarchieParse(_currentObject, nextStart);
388
- endRead = _refs.end;
389
- _currentObject.children = _refs.parent.children;
390
- }
391
- }
392
- _currentObject.parent = _parent;
393
- if (_currentObject.type != "template") {
394
- _parent.children.push(_currentObject);
395
- }
396
- } else {
397
- endRead = find1 === -1 ? this._data.length : findEnd + 1;
398
- break;
399
- }
400
- }
401
- return {
402
- parent: _parent,
403
- end: endRead
404
- };
405
- }
406
- },
407
- {
408
- key: "_mainloop",
409
- value: function _mainloop() {
410
- var _this2 = this;
411
- this._mainProc();
412
- if (this._currentObject.parent || this._currentObject.children.length > 0 || !this._currentObject.worked) {
413
- setTimeout(function() {
414
- _this2._mainloop();
415
- }, 1);
416
- } else {
417
- setTimeout(function() {
418
- _this2.onLoad({
419
- models: _this2.Meshes,
420
- animations: _this2.animations
421
- });
422
- }, 1);
423
- }
424
- }
425
- },
426
- {
427
- key: "_mainProc",
428
- value: function _mainProc() {
429
- var breakFlag = false;
430
- while (true) {
431
- if (!this._currentObject.worked) {
432
- switch (this._currentObject.type) {
433
- case "template":
434
- break;
435
- case "AnimTicksPerSecond":
436
- this.animTicksPerSecond = parseInt(this._currentObject.data);
437
- break;
438
- case "Frame":
439
- this._setFrame();
440
- break;
441
- case "FrameTransformMatrix":
442
- this._setFrameTransformMatrix();
443
- break;
444
- case "Mesh":
445
- this._changeRoot();
446
- this._currentGeo = {};
447
- this._currentGeo.name = this._currentObject.name.trim();
448
- this._currentGeo.parentName = this._getParentName(this._currentObject).trim();
449
- this._currentGeo.VertexSetedBoneCount = [];
450
- this._currentGeo.GeometryData = {
451
- vertices: [],
452
- normals: [],
453
- uvs: [],
454
- skinIndices: [],
455
- skinWeights: [],
456
- indices: [],
457
- materialIndices: []
458
- };
459
- this._currentGeo.Materials = [];
460
- this._currentGeo.normalVectors = [];
461
- this._currentGeo.BoneInfs = [];
462
- this._currentGeo.baseFrame = this._currentFrame;
463
- this._makeBoneFrom_CurrentFrame();
464
- this._readVertexDatas();
465
- breakFlag = true;
466
- break;
467
- case "MeshNormals":
468
- this._readVertexDatas();
469
- break;
470
- case "MeshTextureCoords":
471
- this._setMeshTextureCoords();
472
- break;
473
- case "VertexDuplicationIndices":
474
- break;
475
- case "MeshMaterialList":
476
- this._setMeshMaterialList();
477
- break;
478
- case "Material":
479
- this._setMaterial();
480
- break;
481
- case "SkinWeights":
482
- this._setSkinWeights();
483
- break;
484
- case "AnimationSet":
485
- this._changeRoot();
486
- this._currentAnime = {};
487
- this._currentAnime.name = this._currentObject.name.trim();
488
- this._currentAnime.AnimeFrames = [];
489
- break;
490
- case "Animation":
491
- if (this._currentAnimeFrames) {
492
- this._currentAnime.AnimeFrames.push(this._currentAnimeFrames);
493
- }
494
- this._currentAnimeFrames = new XAnimationInfo();
495
- this._currentAnimeFrames.boneName = this._currentObject.data.trim();
496
- break;
497
- case "AnimationKey":
498
- this._readAnimationKey();
499
- breakFlag = true;
500
- break;
501
- }
502
- this._currentObject.worked = true;
503
- }
504
- if (this._currentObject.children.length > 0) {
505
- this._currentObject = this._currentObject.children.shift();
506
- if (this.debug) {
507
- console.log("processing " + this._currentObject.name);
508
- }
509
- if (breakFlag)
510
- break;
511
- } else {
512
- if (this._currentObject.worked) {
513
- if (this._currentObject.parent && !this._currentObject.parent.parent) {
514
- this._changeRoot();
515
- }
516
- }
517
- if (this._currentObject.parent) {
518
- this._currentObject = this._currentObject.parent;
519
- } else {
520
- breakFlag = true;
521
- }
522
- if (breakFlag)
523
- break;
524
- }
525
- }
526
- return;
527
- }
528
- },
529
- {
530
- key: "_changeRoot",
531
- value: function _changeRoot() {
532
- if (this._currentGeo != null && this._currentGeo.name) {
533
- this._makeOutputGeometry();
534
- }
535
- this._currentGeo = {};
536
- if (this._currentAnime != null && this._currentAnime.name) {
537
- if (this._currentAnimeFrames) {
538
- this._currentAnime.AnimeFrames.push(this._currentAnimeFrames);
539
- this._currentAnimeFrames = null;
540
- }
541
- this._makeOutputAnimation();
542
- }
543
- this._currentAnime = {};
544
- }
545
- },
546
- {
547
- key: "_getParentName",
548
- value: function _getParentName(_obj) {
549
- if (_obj.parent) {
550
- if (_obj.parent.name) {
551
- return _obj.parent.name;
552
- } else {
553
- return this._getParentName(_obj.parent);
554
- }
555
- } else {
556
- return "";
557
- }
558
- }
559
- },
560
- {
561
- key: "_setFrame",
562
- value: function _setFrame() {
563
- this._nowFrameName = this._currentObject.name.trim();
564
- this._currentFrame = {};
565
- this._currentFrame.name = this._nowFrameName;
566
- this._currentFrame.children = [];
567
- if (this._currentObject.parent && this._currentObject.parent.name) {
568
- this._currentFrame.parentName = this._currentObject.parent.name;
569
- }
570
- this.frameHierarchie.push(this._nowFrameName);
571
- this.HieStack[this._nowFrameName] = this._currentFrame;
572
- }
573
- },
574
- {
575
- key: "_setFrameTransformMatrix",
576
- value: function _setFrameTransformMatrix() {
577
- this._currentFrame.FrameTransformMatrix = new Matrix4();
578
- var data = this._currentObject.data.split(",");
579
- this._ParseMatrixData(this._currentFrame.FrameTransformMatrix, data);
580
- this._makeBoneFrom_CurrentFrame();
581
- }
582
- },
583
- {
584
- key: "_makeBoneFrom_CurrentFrame",
585
- value: function _makeBoneFrom_CurrentFrame() {
586
- if (!this._currentFrame.FrameTransformMatrix) {
587
- return;
588
- }
589
- var b = new Bone();
590
- b.name = this._currentFrame.name;
591
- b.applyMatrix4(this._currentFrame.FrameTransformMatrix);
592
- b.matrixWorld = b.matrix;
593
- b.FrameTransformMatrix = this._currentFrame.FrameTransformMatrix;
594
- this._currentFrame.putBone = b;
595
- if (this._currentFrame.parentName) {
596
- for (let frame in this.HieStack) {
597
- if (this.HieStack[frame].name === this._currentFrame.parentName) {
598
- this.HieStack[frame].putBone.add(this._currentFrame.putBone);
599
- }
600
- }
601
- }
602
- }
603
- },
604
- {
605
- key: "_readVertexDatas",
606
- value: function _readVertexDatas() {
607
- var endRead = 0;
608
- var mode = 0;
609
- var mode_local = 0;
610
- var maxLength = 0;
611
- while (true) {
612
- var changeMode = false;
613
- if (mode_local === 0) {
614
- var refO = this._readInt1(endRead);
615
- endRead = refO.endRead;
616
- mode_local = 1;
617
- maxLength = this._currentObject.data.indexOf(";;", endRead) + 1;
618
- if (maxLength <= 0) {
619
- maxLength = this._currentObject.data.length;
620
- }
621
- } else {
622
- var find = 0;
623
- switch (mode) {
624
- case 0:
625
- find = this._currentObject.data.indexOf(",", endRead) + 1;
626
- break;
627
- case 1:
628
- find = this._currentObject.data.indexOf(";,", endRead) + 1;
629
- break;
630
- }
631
- if (find === 0 || find > maxLength) {
632
- find = maxLength;
633
- mode_local = 0;
634
- changeMode = true;
635
- }
636
- switch (this._currentObject.type) {
637
- case "Mesh":
638
- switch (mode) {
639
- case 0:
640
- this._readVertex1(this._currentObject.data.substr(endRead, find - endRead));
641
- break;
642
- case 1:
643
- this._readFace1(this._currentObject.data.substr(endRead, find - endRead));
644
- break;
645
- }
646
- break;
647
- case "MeshNormals":
648
- switch (mode) {
649
- case 0:
650
- this._readNormalVector1(this._currentObject.data.substr(endRead, find - endRead));
651
- break;
652
- }
653
- break;
654
- }
655
- endRead = find + 1;
656
- if (changeMode) {
657
- mode++;
658
- }
659
- }
660
- if (endRead >= this._currentObject.data.length) {
661
- break;
662
- }
663
- }
664
- }
665
- },
666
- {
667
- key: "_readInt1",
668
- value: function _readInt1(start) {
669
- var find = this._currentObject.data.indexOf(";", start);
670
- return {
671
- refI: parseInt(this._currentObject.data.substr(start, find - start)),
672
- endRead: find + 1
673
- };
674
- }
675
- },
676
- {
677
- key: "_readVertex1",
678
- value: function _readVertex1(line) {
679
- var data = this._readLine(line.trim()).substr(0, line.length - 2).split(";");
680
- this._currentGeo.GeometryData.vertices.push(parseFloat(data[0]), parseFloat(data[1]), parseFloat(data[2]));
681
- this._currentGeo.GeometryData.skinIndices.push(0, 0, 0, 0);
682
- this._currentGeo.GeometryData.skinWeights.push(1, 0, 0, 0);
683
- this._currentGeo.VertexSetedBoneCount.push(0);
684
- }
685
- },
686
- {
687
- key: "_readFace1",
688
- value: function _readFace1(line) {
689
- var data = this._readLine(line.trim()).substr(2, line.length - 4).split(",");
690
- this._currentGeo.GeometryData.indices.push(
691
- parseInt(data[0], 10),
692
- parseInt(data[1], 10),
693
- parseInt(data[2], 10)
694
- );
695
- }
696
- },
697
- {
698
- key: "_readNormalVector1",
699
- value: function _readNormalVector1(line) {
700
- var data = this._readLine(line.trim()).substr(0, line.length - 2).split(";");
701
- this._currentGeo.GeometryData.normals.push(parseFloat(data[0]), parseFloat(data[1]), parseFloat(data[2]));
702
- }
703
- },
704
- {
705
- key: "_buildGeometry",
706
- value: function _buildGeometry() {
707
- var bufferGeometry = new BufferGeometry();
708
- var position = [];
709
- var normals = [];
710
- var uvs = [];
711
- var skinIndices = [];
712
- var skinWeights = [];
713
- var data = this._currentGeo.GeometryData;
714
- for (let i2 = 0, l = data.indices.length; i2 < l; i2++) {
715
- var stride2 = data.indices[i2] * 2;
716
- var stride3 = data.indices[i2] * 3;
717
- var stride4 = data.indices[i2] * 4;
718
- position.push(data.vertices[stride3], data.vertices[stride3 + 1], data.vertices[stride3 + 2]);
719
- normals.push(data.normals[stride3], data.normals[stride3 + 1], data.normals[stride3 + 2]);
720
- skinIndices.push(
721
- data.skinIndices[stride4],
722
- data.skinIndices[stride4 + 1],
723
- data.skinIndices[stride4 + 2],
724
- data.skinIndices[stride4 + 3]
725
- );
726
- skinWeights.push(
727
- data.skinWeights[stride4],
728
- data.skinWeights[stride4 + 1],
729
- data.skinWeights[stride4 + 2],
730
- data.skinWeights[stride4 + 3]
731
- );
732
- uvs.push(data.uvs[stride2], data.uvs[stride2 + 1]);
733
- }
734
- bufferGeometry.setAttribute("position", new Float32BufferAttribute(position, 3));
735
- bufferGeometry.setAttribute("normal", new Float32BufferAttribute(normals, 3));
736
- bufferGeometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
737
- bufferGeometry.setAttribute("skinIndex", new Uint16BufferAttribute(skinIndices, 4));
738
- bufferGeometry.setAttribute("skinWeight", new Float32BufferAttribute(skinWeights, 4));
739
- this._computeGroups(bufferGeometry, data.materialIndices);
740
- return bufferGeometry;
741
- }
742
- },
743
- {
744
- key: "_computeGroups",
745
- value: function _computeGroups(bufferGeometry, materialIndices) {
746
- var group;
747
- var groups = [];
748
- var materialIndex = void 0;
749
- for (let i2 = 0; i2 < materialIndices.length; i2++) {
750
- var currentMaterialIndex = materialIndices[i2];
751
- if (currentMaterialIndex !== materialIndex) {
752
- materialIndex = currentMaterialIndex;
753
- if (group !== void 0) {
754
- group.count = i2 * 3 - group.start;
755
- groups.push(group);
756
- }
757
- group = {
758
- start: i2 * 3,
759
- materialIndex
760
- };
761
- }
762
- }
763
- if (group !== void 0) {
764
- group.count = i * 3 - group.start;
765
- groups.push(group);
766
- }
767
- bufferGeometry.groups = groups;
768
- }
769
- },
770
- {
771
- key: "_setMeshTextureCoords",
772
- value: function _setMeshTextureCoords() {
773
- var endRead = 0;
774
- var mode = 0;
775
- var mode_local = 0;
776
- while (true) {
777
- switch (mode) {
778
- case 0:
779
- if (mode_local === 0) {
780
- var refO = this._readInt1(0);
781
- endRead = refO.endRead;
782
- mode_local = 1;
783
- } else {
784
- var find = this._currentObject.data.indexOf(",", endRead) + 1;
785
- if (find === 0) {
786
- find = this._currentObject.data.length;
787
- mode = 2;
788
- mode_local = 0;
789
- }
790
- var line = this._currentObject.data.substr(endRead, find - endRead);
791
- var data = this._readLine(line.trim()).split(";");
792
- if (this.IsUvYReverse) {
793
- this._currentGeo.GeometryData.uvs.push(parseFloat(data[0]), 1 - parseFloat(data[1]));
794
- } else {
795
- this._currentGeo.GeometryData.uvs.push(parseFloat(data[0]), parseFloat(data[1]));
796
- }
797
- endRead = find + 1;
798
- }
799
- break;
800
- }
801
- if (endRead >= this._currentObject.data.length) {
802
- break;
803
- }
804
- }
805
- }
806
- },
807
- {
808
- key: "_setMeshMaterialList",
809
- value: function _setMeshMaterialList() {
810
- var endRead = 0;
811
- var mode = 0;
812
- var mode_local = 0;
813
- while (true) {
814
- if (mode_local < 2) {
815
- var refO = this._readInt1(endRead);
816
- endRead = refO.endRead;
817
- mode_local++;
818
- } else {
819
- var find = this._currentObject.data.indexOf(";", endRead);
820
- if (find === -1) {
821
- find = this._currentObject.data.length;
822
- mode = 3;
823
- mode_local = 0;
824
- }
825
- var line = this._currentObject.data.substr(endRead, find - endRead);
826
- var data = this._readLine(line.trim()).split(",");
827
- for (let i2 = 0; i2 < data.length; i2++) {
828
- this._currentGeo.GeometryData.materialIndices[i2] = parseInt(data[i2]);
829
- }
830
- endRead = this._currentObject.data.length;
831
- }
832
- if (endRead >= this._currentObject.data.length || mode >= 3) {
833
- break;
834
- }
835
- }
836
- }
837
- },
838
- {
839
- key: "_setMaterial",
840
- value: function _setMaterial() {
841
- var _nowMat = new MeshPhongMaterial({
842
- color: Math.random() * 16777215
843
- });
844
- _nowMat.side = FrontSide;
845
- _nowMat.name = this._currentObject.name;
846
- var endRead = 0;
847
- var find = this._currentObject.data.indexOf(";;", endRead);
848
- var line = this._currentObject.data.substr(endRead, find - endRead);
849
- var data = this._readLine(line.trim()).split(";");
850
- _nowMat.color.r = parseFloat(data[0]);
851
- _nowMat.color.g = parseFloat(data[1]);
852
- _nowMat.color.b = parseFloat(data[2]);
853
- endRead = find + 2;
854
- find = this._currentObject.data.indexOf(";", endRead);
855
- line = this._currentObject.data.substr(endRead, find - endRead);
856
- _nowMat.shininess = parseFloat(this._readLine(line));
857
- endRead = find + 1;
858
- find = this._currentObject.data.indexOf(";;", endRead);
859
- line = this._currentObject.data.substr(endRead, find - endRead);
860
- var data2 = this._readLine(line.trim()).split(";");
861
- _nowMat.specular.r = parseFloat(data2[0]);
862
- _nowMat.specular.g = parseFloat(data2[1]);
863
- _nowMat.specular.b = parseFloat(data2[2]);
864
- endRead = find + 2;
865
- find = this._currentObject.data.indexOf(";;", endRead);
866
- if (find === -1) {
867
- find = this._currentObject.data.length;
868
- }
869
- line = this._currentObject.data.substr(endRead, find - endRead);
870
- var data3 = this._readLine(line.trim()).split(";");
871
- _nowMat.emissive.r = parseFloat(data3[0]);
872
- _nowMat.emissive.g = parseFloat(data3[1]);
873
- _nowMat.emissive.b = parseFloat(data3[2]);
874
- var localObject = null;
875
- while (true) {
876
- if (this._currentObject.children.length > 0) {
877
- localObject = this._currentObject.children.shift();
878
- if (this.debug) {
879
- console.log("processing " + localObject.name);
880
- }
881
- var fileName = localObject.data.substr(1, localObject.data.length - 2);
882
- switch (localObject.type) {
883
- case "TextureFilename":
884
- _nowMat.map = this.texloader.load(fileName);
885
- break;
886
- case "BumpMapFilename":
887
- _nowMat.bumpMap = this.texloader.load(fileName);
888
- _nowMat.bumpScale = 0.05;
889
- break;
890
- case "NormalMapFilename":
891
- _nowMat.normalMap = this.texloader.load(fileName);
892
- _nowMat.normalScale = new Vector2(2, 2);
893
- break;
894
- case "EmissiveMapFilename":
895
- _nowMat.emissiveMap = this.texloader.load(fileName);
896
- break;
897
- case "LightMapFilename":
898
- _nowMat.lightMap = this.texloader.load(fileName);
899
- break;
900
- }
901
- } else {
902
- break;
903
- }
904
- }
905
- this._currentGeo.Materials.push(_nowMat);
906
- }
907
- },
908
- {
909
- key: "_setSkinWeights",
910
- value: function _setSkinWeights() {
911
- var boneInf = new XboneInf();
912
- var endRead = 0;
913
- var find = this._currentObject.data.indexOf(";", endRead);
914
- var line = this._currentObject.data.substr(endRead, find - endRead);
915
- endRead = find + 1;
916
- boneInf.boneName = line.substr(1, line.length - 2);
917
- boneInf.BoneIndex = this._currentGeo.BoneInfs.length;
918
- find = this._currentObject.data.indexOf(";", endRead);
919
- endRead = find + 1;
920
- find = this._currentObject.data.indexOf(";", endRead);
921
- line = this._currentObject.data.substr(endRead, find - endRead);
922
- var data = this._readLine(line.trim()).split(",");
923
- for (let i2 = 0; i2 < data.length; i2++) {
924
- boneInf.Indeces.push(parseInt(data[i2]));
925
- }
926
- endRead = find + 1;
927
- find = this._currentObject.data.indexOf(";", endRead);
928
- line = this._currentObject.data.substr(endRead, find - endRead);
929
- var data2 = this._readLine(line.trim()).split(",");
930
- for (let _i = 0; _i < data2.length; _i++) {
931
- boneInf.Weights.push(parseFloat(data2[_i]));
932
- }
933
- endRead = find + 1;
934
- find = this._currentObject.data.indexOf(";", endRead);
935
- if (find <= 0) {
936
- find = this._currentObject.data.length;
937
- }
938
- line = this._currentObject.data.substr(endRead, find - endRead);
939
- var data3 = this._readLine(line.trim()).split(",");
940
- boneInf.OffsetMatrix = new Matrix4();
941
- this._ParseMatrixData(boneInf.OffsetMatrix, data3);
942
- this._currentGeo.BoneInfs.push(boneInf);
943
- }
944
- },
945
- {
946
- key: "_makePutBoneList",
947
- value: function _makePutBoneList(_RootName, _bones) {
948
- var putting = false;
949
- for (let frame in this.HieStack) {
950
- if (this.HieStack[frame].name === _RootName || putting) {
951
- putting = true;
952
- var b = new Bone();
953
- b.name = this.HieStack[frame].name;
954
- b.applyMatrix4(this.HieStack[frame].FrameTransformMatrix);
955
- b.matrixWorld = b.matrix;
956
- b.FrameTransformMatrix = this.HieStack[frame].FrameTransformMatrix;
957
- b.pos = new Vector3().setFromMatrixPosition(b.FrameTransformMatrix).toArray();
958
- b.rotq = new Quaternion().setFromRotationMatrix(b.FrameTransformMatrix).toArray();
959
- b.scl = new Vector3().setFromMatrixScale(b.FrameTransformMatrix).toArray();
960
- if (this.HieStack[frame].parentName && this.HieStack[frame].parentName.length > 0) {
961
- for (let i2 = 0; i2 < _bones.length; i2++) {
962
- if (this.HieStack[frame].parentName === _bones[i2].name) {
963
- _bones[i2].add(b);
964
- b.parent = i2;
965
- break;
966
- }
967
- }
968
- }
969
- _bones.push(b);
970
- }
971
- }
972
- }
973
- },
974
- {
975
- key: "_makeOutputGeometry",
976
- value: function _makeOutputGeometry() {
977
- var mesh = null;
978
- if (this._currentGeo.BoneInfs.length > 0) {
979
- var putBones = [];
980
- this._makePutBoneList(this._currentGeo.baseFrame.parentName, putBones);
981
- for (let bi = 0; bi < this._currentGeo.BoneInfs.length; bi++) {
982
- var boneIndex = 0;
983
- for (let bb = 0; bb < putBones.length; bb++) {
984
- if (putBones[bb].name === this._currentGeo.BoneInfs[bi].boneName) {
985
- boneIndex = bb;
986
- putBones[bb].OffsetMatrix = new Matrix4();
987
- putBones[bb].OffsetMatrix.copy(this._currentGeo.BoneInfs[bi].OffsetMatrix);
988
- break;
989
- }
990
- }
991
- for (let vi = 0; vi < this._currentGeo.BoneInfs[bi].Indeces.length; vi++) {
992
- var nowVertexID = this._currentGeo.BoneInfs[bi].Indeces[vi];
993
- var nowVal = this._currentGeo.BoneInfs[bi].Weights[vi];
994
- var stride = nowVertexID * 4;
995
- switch (this._currentGeo.VertexSetedBoneCount[nowVertexID]) {
996
- case 0:
997
- this._currentGeo.GeometryData.skinIndices[stride] = boneIndex;
998
- this._currentGeo.GeometryData.skinWeights[stride] = nowVal;
999
- break;
1000
- case 1:
1001
- this._currentGeo.GeometryData.skinIndices[stride + 1] = boneIndex;
1002
- this._currentGeo.GeometryData.skinWeights[stride + 1] = nowVal;
1003
- break;
1004
- case 2:
1005
- this._currentGeo.GeometryData.skinIndices[stride + 2] = boneIndex;
1006
- this._currentGeo.GeometryData.skinWeights[stride + 2] = nowVal;
1007
- break;
1008
- case 3:
1009
- this._currentGeo.GeometryData.skinIndices[stride + 3] = boneIndex;
1010
- this._currentGeo.GeometryData.skinWeights[stride + 3] = nowVal;
1011
- break;
1012
- }
1013
- this._currentGeo.VertexSetedBoneCount[nowVertexID]++;
1014
- if (this._currentGeo.VertexSetedBoneCount[nowVertexID] > 4) {
1015
- console.log("warn! over 4 bone weight! :" + nowVertexID);
1016
- }
1017
- }
1018
- }
1019
- for (let sk = 0; sk < this._currentGeo.Materials.length; sk++) {
1020
- this._currentGeo.Materials[sk].skinning = true;
1021
- }
1022
- var offsetList = [];
1023
- for (let _bi = 0; _bi < putBones.length; _bi++) {
1024
- if (putBones[_bi].OffsetMatrix) {
1025
- offsetList.push(putBones[_bi].OffsetMatrix);
1026
- } else {
1027
- offsetList.push(new Matrix4());
1028
- }
1029
- }
1030
- var bufferGeometry = this._buildGeometry();
1031
- mesh = new SkinnedMesh(
1032
- bufferGeometry,
1033
- this._currentGeo.Materials.length === 1 ? this._currentGeo.Materials[0] : this._currentGeo.Materials
1034
- );
1035
- this._initSkeleton(mesh, putBones, offsetList);
1036
- } else {
1037
- var _bufferGeometry = this._buildGeometry();
1038
- mesh = new Mesh(
1039
- _bufferGeometry,
1040
- this._currentGeo.Materials.length === 1 ? this._currentGeo.Materials[0] : this._currentGeo.Materials
1041
- );
1042
- }
1043
- mesh.name = this._currentGeo.name;
1044
- var worldBaseMx = new Matrix4();
1045
- var currentMxFrame = this._currentGeo.baseFrame.putBone;
1046
- if (currentMxFrame && currentMxFrame.parent) {
1047
- while (true) {
1048
- currentMxFrame = currentMxFrame.parent;
1049
- if (currentMxFrame) {
1050
- worldBaseMx.multiply(currentMxFrame.FrameTransformMatrix);
1051
- } else {
1052
- break;
1053
- }
1054
- }
1055
- mesh.applyMatrix4(worldBaseMx);
1056
- }
1057
- this.Meshes.push(mesh);
1058
- }
1059
- },
1060
- {
1061
- key: "_initSkeleton",
1062
- value: function _initSkeleton(mesh, boneList, boneInverses) {
1063
- var bones = [], bone, gbone;
1064
- var i2, il;
1065
- for (i2 = 0, il = boneList.length; i2 < il; i2++) {
1066
- gbone = boneList[i2];
1067
- bone = new Bone();
1068
- bones.push(bone);
1069
- bone.name = gbone.name;
1070
- bone.position.fromArray(gbone.pos);
1071
- bone.quaternion.fromArray(gbone.rotq);
1072
- if (gbone.scl !== void 0)
1073
- bone.scale.fromArray(gbone.scl);
1074
- }
1075
- for (i2 = 0, il = boneList.length; i2 < il; i2++) {
1076
- gbone = boneList[i2];
1077
- if (gbone.parent !== -1 && gbone.parent !== null && bones[gbone.parent] !== void 0) {
1078
- bones[gbone.parent].add(bones[i2]);
1079
- } else {
1080
- mesh.add(bones[i2]);
1081
- }
1082
- }
1083
- mesh.updateMatrixWorld(true);
1084
- var skeleton = new Skeleton(bones, boneInverses);
1085
- mesh.bind(skeleton, mesh.matrixWorld);
1086
- }
1087
- },
1088
- {
1089
- key: "_readAnimationKey",
1090
- value: function _readAnimationKey() {
1091
- var endRead = 0;
1092
- var find = this._currentObject.data.indexOf(";", endRead);
1093
- var line = this._currentObject.data.substr(endRead, find - endRead);
1094
- endRead = find + 1;
1095
- var nowKeyType = parseInt(this._readLine(line));
1096
- find = this._currentObject.data.indexOf(";", endRead);
1097
- endRead = find + 1;
1098
- line = this._currentObject.data.substr(endRead);
1099
- var data = this._readLine(line.trim()).split(";;,");
1100
- for (let i2 = 0; i2 < data.length; i2++) {
1101
- var data2 = data[i2].split(";");
1102
- var keyInfo = new XKeyFrameInfo();
1103
- keyInfo.type = nowKeyType;
1104
- keyInfo.Frame = parseInt(data2[0]);
1105
- keyInfo.index = this._currentAnimeFrames.keyFrames.length;
1106
- keyInfo.time = keyInfo.Frame;
1107
- if (nowKeyType != 4) {
1108
- var frameFound = false;
1109
- for (let mm = 0; mm < this._currentAnimeFrames.keyFrames.length; mm++) {
1110
- if (this._currentAnimeFrames.keyFrames[mm].Frame === keyInfo.Frame) {
1111
- keyInfo = this._currentAnimeFrames.keyFrames[mm];
1112
- frameFound = true;
1113
- break;
1114
- }
1115
- }
1116
- var frameValue = data2[2].split(",");
1117
- switch (nowKeyType) {
1118
- case 0:
1119
- keyInfo.rot = new Quaternion(
1120
- parseFloat(frameValue[1]),
1121
- parseFloat(frameValue[2]),
1122
- parseFloat(frameValue[3]),
1123
- parseFloat(frameValue[0]) * -1
1124
- );
1125
- break;
1126
- case 1:
1127
- keyInfo.scl = new Vector3(
1128
- parseFloat(frameValue[0]),
1129
- parseFloat(frameValue[1]),
1130
- parseFloat(frameValue[2])
1131
- );
1132
- break;
1133
- case 2:
1134
- keyInfo.pos = new Vector3(
1135
- parseFloat(frameValue[0]),
1136
- parseFloat(frameValue[1]),
1137
- parseFloat(frameValue[2])
1138
- );
1139
- break;
1140
- }
1141
- if (!frameFound) {
1142
- this._currentAnimeFrames.keyFrames.push(keyInfo);
1143
- }
1144
- } else {
1145
- keyInfo.matrix = new Matrix4();
1146
- this._ParseMatrixData(keyInfo.matrix, data2[2].split(","));
1147
- this._currentAnimeFrames.keyFrames.push(keyInfo);
1148
- }
1149
- }
1150
- }
1151
- },
1152
- {
1153
- key: "_makeOutputAnimation",
1154
- value: function _makeOutputAnimation() {
1155
- var animationObj = new XAnimationObj(this.options);
1156
- animationObj.fps = this.animTicksPerSecond;
1157
- animationObj.name = this._currentAnime.name;
1158
- animationObj.make(this._currentAnime.AnimeFrames);
1159
- this.animations.push(animationObj);
1160
- }
1161
- },
1162
- {
1163
- key: "assignAnimation",
1164
- value: function assignAnimation(_model, _animation) {
1165
- var model = _model;
1166
- var animation = _animation;
1167
- if (!model) {
1168
- model = this.Meshes[0];
1169
- }
1170
- if (!animation) {
1171
- animation = this.animations[0];
1172
- }
1173
- if (!model || !animation) {
1174
- return null;
1175
- }
1176
- var put = {};
1177
- put.fps = animation.fps;
1178
- put.name = animation.name;
1179
- put.length = animation.length;
1180
- put.hierarchy = [];
1181
- for (let b = 0; b < model.skeleton.bones.length; b++) {
1182
- var findAnimation = false;
1183
- for (let i2 = 0; i2 < animation.hierarchy.length; i2++) {
1184
- if (model.skeleton.bones[b].name === animation.hierarchy[i2].name) {
1185
- findAnimation = true;
1186
- var c_key = animation.hierarchy[i2].copy();
1187
- c_key.parent = -1;
1188
- if (model.skeleton.bones[b].parent && model.skeleton.bones[b].parent.type === "Bone") {
1189
- for (let bb = 0; bb < put.hierarchy.length; bb++) {
1190
- if (put.hierarchy[bb].name === model.skeleton.bones[b].parent.name) {
1191
- c_key.parent = bb;
1192
- c_key.parentName = model.skeleton.bones[b].parent.name;
1193
- }
1194
- }
1195
- }
1196
- put.hierarchy.push(c_key);
1197
- break;
1198
- }
1199
- }
1200
- if (!findAnimation) {
1201
- var _c_key = animation.hierarchy[0].copy();
1202
- _c_key.name = model.skeleton.bones[b].name;
1203
- _c_key.parent = -1;
1204
- for (let k = 0; k < _c_key.keys.length; k++) {
1205
- if (_c_key.keys[k].pos) {
1206
- _c_key.keys[k].pos.set(0, 0, 0);
1207
- }
1208
- if (_c_key.keys[k].scl) {
1209
- _c_key.keys[k].scl.set(1, 1, 1);
1210
- }
1211
- if (_c_key.keys[k].rot) {
1212
- _c_key.keys[k].rot.set(0, 0, 0, 1);
1213
- }
1214
- }
1215
- put.hierarchy.push(_c_key);
1216
- }
1217
- }
1218
- if (!model.geometry.animations) {
1219
- model.geometry.animations = [];
1220
- }
1221
- model.geometry.animations.push(AnimationClip.parseAnimation(put, model.skeleton.bones));
1222
- if (!model.animationMixer) {
1223
- model.animationMixer = new AnimationMixer(model);
1224
- }
1225
- return put;
1226
- }
1227
- },
1228
- {
1229
- key: "_ParseMatrixData",
1230
- value: function _ParseMatrixData(targetMatrix, data) {
1231
- targetMatrix.set(
1232
- parseFloat(data[0]),
1233
- parseFloat(data[4]),
1234
- parseFloat(data[8]),
1235
- parseFloat(data[12]),
1236
- parseFloat(data[1]),
1237
- parseFloat(data[5]),
1238
- parseFloat(data[9]),
1239
- parseFloat(data[13]),
1240
- parseFloat(data[2]),
1241
- parseFloat(data[6]),
1242
- parseFloat(data[10]),
1243
- parseFloat(data[14]),
1244
- parseFloat(data[3]),
1245
- parseFloat(data[7]),
1246
- parseFloat(data[11]),
1247
- parseFloat(data[15])
1248
- );
1249
- }
1250
- }
1251
- ]);
1252
- return XLoader3;
1253
- }();
1254
- return XLoader2;
1255
- }();
1256
- export {
1257
- XLoader
1258
- };