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