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