three-stdlib 2.15.1 → 2.16.0
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 +196 -302
- package/animation/CCDIKSolver.mjs +223 -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 +969 -333
- package/index.mjs +969 -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/AssimpLoader.js
CHANGED
@@ -1,96 +1,95 @@
|
|
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 AssimpLoader = function(manager) {
|
5
|
+
THREE.Loader.call(this, manager);
|
5
6
|
};
|
6
|
-
|
7
|
-
AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
7
|
+
AssimpLoader.prototype = Object.assign(Object.create(THREE.Loader.prototype), {
|
8
8
|
constructor: AssimpLoader,
|
9
|
-
load: function
|
9
|
+
load: function(url, onLoad, onProgress, onError) {
|
10
10
|
var scope = this;
|
11
|
-
var path = scope.path ===
|
12
|
-
var loader = new FileLoader(scope.manager);
|
11
|
+
var path = scope.path === "" ? THREE.LoaderUtils.extractUrlBase(url) : scope.path;
|
12
|
+
var loader = new THREE.FileLoader(scope.manager);
|
13
13
|
loader.setPath(scope.path);
|
14
|
-
loader.setResponseType(
|
14
|
+
loader.setResponseType("arraybuffer");
|
15
15
|
loader.setRequestHeader(scope.requestHeader);
|
16
16
|
loader.setWithCredentials(scope.withCredentials);
|
17
|
-
loader.load(
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
loader.load(
|
18
|
+
url,
|
19
|
+
function(buffer) {
|
20
|
+
try {
|
21
|
+
onLoad(scope.parse(buffer, path));
|
22
|
+
} catch (e) {
|
23
|
+
if (onError) {
|
24
|
+
onError(e);
|
25
|
+
} else {
|
26
|
+
console.error(e);
|
27
|
+
}
|
28
|
+
scope.manager.itemError(url);
|
25
29
|
}
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
},
|
31
|
+
onProgress,
|
32
|
+
onError
|
33
|
+
);
|
30
34
|
},
|
31
|
-
parse: function
|
32
|
-
var textureLoader = new TextureLoader(this.manager);
|
35
|
+
parse: function(buffer, path) {
|
36
|
+
var textureLoader = new THREE.TextureLoader(this.manager);
|
33
37
|
textureLoader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
|
34
38
|
var Virtulous = {};
|
35
|
-
|
36
|
-
Virtulous.KeyFrame = function (time, matrix) {
|
39
|
+
Virtulous.KeyFrame = function(time, matrix) {
|
37
40
|
this.time = time;
|
38
41
|
this.matrix = matrix.clone();
|
39
|
-
this.position = new Vector3();
|
40
|
-
this.quaternion = new Quaternion();
|
41
|
-
this.scale = new Vector3(1, 1, 1);
|
42
|
+
this.position = new THREE.Vector3();
|
43
|
+
this.quaternion = new THREE.Quaternion();
|
44
|
+
this.scale = new THREE.Vector3(1, 1, 1);
|
42
45
|
this.matrix.decompose(this.position, this.quaternion, this.scale);
|
43
|
-
|
44
|
-
this.clone = function () {
|
46
|
+
this.clone = function() {
|
45
47
|
var n = new Virtulous.KeyFrame(this.time, this.matrix);
|
46
48
|
return n;
|
47
49
|
};
|
48
|
-
|
49
|
-
|
50
|
-
time -= this.time;
|
50
|
+
this.lerp = function(nextKey, time2) {
|
51
|
+
time2 -= this.time;
|
51
52
|
var dist = nextKey.time - this.time;
|
52
|
-
var l =
|
53
|
+
var l = time2 / dist;
|
53
54
|
var l2 = 1 - l;
|
54
55
|
var keypos = this.position;
|
55
|
-
var keyrot = this.quaternion;
|
56
|
-
|
56
|
+
var keyrot = this.quaternion;
|
57
57
|
var key2pos = nextKey.position;
|
58
|
-
var key2rot = nextKey.quaternion;
|
59
|
-
|
58
|
+
var key2rot = nextKey.quaternion;
|
60
59
|
Virtulous.KeyFrame.tempAniPos.x = keypos.x * l2 + key2pos.x * l;
|
61
60
|
Virtulous.KeyFrame.tempAniPos.y = keypos.y * l2 + key2pos.y * l;
|
62
|
-
Virtulous.KeyFrame.tempAniPos.z = keypos.z * l2 + key2pos.z * l;
|
63
|
-
// tempAniScale.y = keyscl[1] * l2 + key2scl[1] * l;
|
64
|
-
// tempAniScale.z = keyscl[2] * l2 + key2scl[2] * l;
|
65
|
-
|
61
|
+
Virtulous.KeyFrame.tempAniPos.z = keypos.z * l2 + key2pos.z * l;
|
66
62
|
Virtulous.KeyFrame.tempAniQuat.set(keyrot.x, keyrot.y, keyrot.z, keyrot.w);
|
67
63
|
Virtulous.KeyFrame.tempAniQuat.slerp(key2rot, l);
|
68
|
-
return Virtulous.KeyFrame.tempAniMatrix.compose(
|
64
|
+
return Virtulous.KeyFrame.tempAniMatrix.compose(
|
65
|
+
Virtulous.KeyFrame.tempAniPos,
|
66
|
+
Virtulous.KeyFrame.tempAniQuat,
|
67
|
+
Virtulous.KeyFrame.tempAniScale
|
68
|
+
);
|
69
69
|
};
|
70
70
|
};
|
71
|
-
|
72
|
-
Virtulous.KeyFrame.
|
73
|
-
Virtulous.KeyFrame.
|
74
|
-
Virtulous.KeyFrame.
|
75
|
-
Virtulous.
|
76
|
-
|
77
|
-
Virtulous.KeyFrameTrack = function () {
|
71
|
+
Virtulous.KeyFrame.tempAniPos = new THREE.Vector3();
|
72
|
+
Virtulous.KeyFrame.tempAniQuat = new THREE.Quaternion();
|
73
|
+
Virtulous.KeyFrame.tempAniScale = new THREE.Vector3(1, 1, 1);
|
74
|
+
Virtulous.KeyFrame.tempAniMatrix = new THREE.Matrix4();
|
75
|
+
Virtulous.KeyFrameTrack = function() {
|
78
76
|
this.keys = [];
|
79
77
|
this.target = null;
|
80
78
|
this.time = 0;
|
81
79
|
this.length = 0;
|
82
80
|
this._accelTable = {};
|
83
81
|
this.fps = 20;
|
84
|
-
|
85
|
-
this.addKey = function (key) {
|
82
|
+
this.addKey = function(key) {
|
86
83
|
this.keys.push(key);
|
87
84
|
};
|
88
|
-
|
89
|
-
this.init = function () {
|
85
|
+
this.init = function() {
|
90
86
|
this.sortKeys();
|
91
|
-
if (this.keys.length > 0)
|
92
|
-
|
93
|
-
|
87
|
+
if (this.keys.length > 0)
|
88
|
+
this.length = this.keys[this.keys.length - 1].time;
|
89
|
+
else
|
90
|
+
this.length = 0;
|
91
|
+
if (!this.fps)
|
92
|
+
return;
|
94
93
|
for (let j = 0; j < this.length * this.fps; j++) {
|
95
94
|
for (let i = 0; i < this.keys.length; i++) {
|
96
95
|
if (this.keys[i].time == j) {
|
@@ -103,69 +102,56 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
103
102
|
}
|
104
103
|
}
|
105
104
|
};
|
106
|
-
|
107
|
-
this.parseFromThree = function (data) {
|
105
|
+
this.parseFromThree = function(data) {
|
108
106
|
var fps = data.fps;
|
109
107
|
this.target = data.node;
|
110
108
|
var track = data.hierarchy[0].keys;
|
111
|
-
|
112
109
|
for (let i = 0; i < track.length; i++) {
|
113
110
|
this.addKey(new Virtulous.KeyFrame(i / fps || track[i].time, track[i].targets[0].data));
|
114
111
|
}
|
115
|
-
|
116
112
|
this.init();
|
117
113
|
};
|
118
|
-
|
119
|
-
this.parseFromCollada = function (data) {
|
114
|
+
this.parseFromCollada = function(data) {
|
120
115
|
var track = data.keys;
|
121
116
|
var fps = this.fps;
|
122
|
-
|
123
117
|
for (let i = 0; i < track.length; i++) {
|
124
118
|
this.addKey(new Virtulous.KeyFrame(i / fps || track[i].time, track[i].matrix));
|
125
119
|
}
|
126
|
-
|
127
120
|
this.init();
|
128
121
|
};
|
129
|
-
|
130
|
-
this.sortKeys = function () {
|
122
|
+
this.sortKeys = function() {
|
131
123
|
this.keys.sort(this.keySortFunc);
|
132
124
|
};
|
133
|
-
|
134
|
-
this.keySortFunc = function (a, b) {
|
125
|
+
this.keySortFunc = function(a, b) {
|
135
126
|
return a.time - b.time;
|
136
127
|
};
|
137
|
-
|
138
|
-
this.clone = function () {
|
128
|
+
this.clone = function() {
|
139
129
|
var t = new Virtulous.KeyFrameTrack();
|
140
130
|
t.target = this.target;
|
141
131
|
t.time = this.time;
|
142
132
|
t.length = this.length;
|
143
|
-
|
144
133
|
for (let i = 0; i < this.keys.length; i++) {
|
145
134
|
t.addKey(this.keys[i].clone());
|
146
135
|
}
|
147
|
-
|
148
136
|
t.init();
|
149
137
|
return t;
|
150
138
|
};
|
151
|
-
|
152
|
-
|
153
|
-
|
139
|
+
this.reTarget = function(root, compareitor) {
|
140
|
+
if (!compareitor)
|
141
|
+
compareitor = Virtulous.TrackTargetNodeNameCompare;
|
154
142
|
this.target = compareitor(root, this.target);
|
155
143
|
};
|
156
|
-
|
157
|
-
this.keySearchAccel = function (time) {
|
144
|
+
this.keySearchAccel = function(time) {
|
158
145
|
time *= this.fps;
|
159
146
|
time = Math.floor(time);
|
160
147
|
return this._accelTable[time] || 0;
|
161
148
|
};
|
162
|
-
|
163
|
-
this.setTime = function (time) {
|
149
|
+
this.setTime = function(time) {
|
164
150
|
time = Math.abs(time);
|
165
|
-
if (this.length)
|
151
|
+
if (this.length)
|
152
|
+
time = time % this.length + 0.05;
|
166
153
|
var key0 = null;
|
167
154
|
var key1 = null;
|
168
|
-
|
169
155
|
for (let i = this.keySearchAccel(time); i < this.keys.length; i++) {
|
170
156
|
if (this.keys[i].time == time) {
|
171
157
|
key0 = this.keys[i];
|
@@ -182,14 +168,12 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
182
168
|
break;
|
183
169
|
}
|
184
170
|
}
|
185
|
-
|
186
171
|
if (key0 && key1 && key0 !== key1) {
|
187
172
|
this.target.matrixAutoUpdate = false;
|
188
173
|
this.target.matrix.copy(key0.lerp(key1, time));
|
189
174
|
this.target.matrixWorldNeedsUpdate = true;
|
190
175
|
return;
|
191
176
|
}
|
192
|
-
|
193
177
|
if (key0 && key1 && key0 == key1) {
|
194
178
|
this.target.matrixAutoUpdate = false;
|
195
179
|
this.target.matrix.copy(key0.matrix);
|
@@ -198,313 +182,158 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
198
182
|
}
|
199
183
|
};
|
200
184
|
};
|
201
|
-
|
202
|
-
Virtulous.TrackTargetNodeNameCompare = function (root, target) {
|
185
|
+
Virtulous.TrackTargetNodeNameCompare = function(root, target) {
|
203
186
|
function find(node, name) {
|
204
|
-
if (node.name == name)
|
205
|
-
|
187
|
+
if (node.name == name)
|
188
|
+
return node;
|
206
189
|
for (let i = 0; i < node.children.length; i++) {
|
207
190
|
var r = find(node.children[i], name);
|
208
|
-
if (r)
|
191
|
+
if (r)
|
192
|
+
return r;
|
209
193
|
}
|
210
|
-
|
211
194
|
return null;
|
212
195
|
}
|
213
|
-
|
214
196
|
return find(root, target.name);
|
215
197
|
};
|
216
|
-
|
217
|
-
Virtulous.Animation = function () {
|
198
|
+
Virtulous.Animation = function() {
|
218
199
|
this.tracks = [];
|
219
200
|
this.length = 0;
|
220
|
-
|
221
|
-
this.addTrack = function (track) {
|
201
|
+
this.addTrack = function(track) {
|
222
202
|
this.tracks.push(track);
|
223
203
|
this.length = Math.max(track.length, this.length);
|
224
204
|
};
|
225
|
-
|
226
|
-
this.setTime = function (time) {
|
205
|
+
this.setTime = function(time) {
|
227
206
|
this.time = time;
|
228
|
-
|
229
|
-
|
207
|
+
for (let i = 0; i < this.tracks.length; i++)
|
208
|
+
this.tracks[i].setTime(time);
|
230
209
|
};
|
231
|
-
|
232
|
-
|
233
|
-
|
210
|
+
this.clone = function(target, compareitor) {
|
211
|
+
if (!compareitor)
|
212
|
+
compareitor = Virtulous.TrackTargetNodeNameCompare;
|
234
213
|
var n = new Virtulous.Animation();
|
235
214
|
n.target = target;
|
236
|
-
|
237
215
|
for (let i = 0; i < this.tracks.length; i++) {
|
238
216
|
var track = this.tracks[i].clone();
|
239
217
|
track.reTarget(target, compareitor);
|
240
218
|
n.addTrack(track);
|
241
219
|
}
|
242
|
-
|
243
220
|
return n;
|
244
221
|
};
|
245
222
|
};
|
246
|
-
|
247
|
-
var
|
248
|
-
var
|
249
|
-
var
|
250
|
-
var
|
251
|
-
var
|
252
|
-
var
|
253
|
-
var
|
254
|
-
var
|
255
|
-
var
|
256
|
-
var
|
257
|
-
var
|
258
|
-
var
|
259
|
-
var
|
260
|
-
var
|
261
|
-
var
|
262
|
-
var ASSBIN_MESH_HAS_COLOR_BASE = 0x10000;
|
223
|
+
var ASSBIN_CHUNK_AICAMERA = 4660;
|
224
|
+
var ASSBIN_CHUNK_AILIGHT = 4661;
|
225
|
+
var ASSBIN_CHUNK_AITEXTURE = 4662;
|
226
|
+
var ASSBIN_CHUNK_AIMESH = 4663;
|
227
|
+
var ASSBIN_CHUNK_AINODEANIM = 4664;
|
228
|
+
var ASSBIN_CHUNK_AISCENE = 4665;
|
229
|
+
var ASSBIN_CHUNK_AIBONE = 4666;
|
230
|
+
var ASSBIN_CHUNK_AIANIMATION = 4667;
|
231
|
+
var ASSBIN_CHUNK_AINODE = 4668;
|
232
|
+
var ASSBIN_CHUNK_AIMATERIAL = 4669;
|
233
|
+
var ASSBIN_CHUNK_AIMATERIALPROPERTY = 4670;
|
234
|
+
var ASSBIN_MESH_HAS_POSITIONS = 1;
|
235
|
+
var ASSBIN_MESH_HAS_NORMALS = 2;
|
236
|
+
var ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS = 4;
|
237
|
+
var ASSBIN_MESH_HAS_TEXCOORD_BASE = 256;
|
238
|
+
var ASSBIN_MESH_HAS_COLOR_BASE = 65536;
|
263
239
|
var AI_MAX_NUMBER_OF_COLOR_SETS = 1;
|
264
|
-
var AI_MAX_NUMBER_OF_TEXTURECOORDS = 4;
|
240
|
+
var AI_MAX_NUMBER_OF_TEXTURECOORDS = 4;
|
265
241
|
//! A directional light source has a well-defined direction
|
266
242
|
//! but is infinitely far away. That's quite a good
|
267
243
|
//! approximation for sun light.
|
268
|
-
|
269
|
-
|
244
|
+
var aiLightSource_DIRECTIONAL = 1;
|
245
|
+
//! A point light source has a well-defined position
|
270
246
|
//! in space but no direction - it emits light in all
|
271
247
|
//! directions. A normal bulb is a point light.
|
272
|
-
//var aiLightSource_POINT = 0x2;
|
273
248
|
//! A spot light source emits light in a specific
|
274
249
|
//! angle. It has a position and a direction it is pointing to.
|
275
250
|
//! A good example for a spot light is a light spot in
|
276
251
|
//! sport arenas.
|
277
|
-
|
278
|
-
|
252
|
+
var aiLightSource_SPOT = 3;
|
253
|
+
//! The generic light level of the world, including the bounces
|
279
254
|
//! of all other lightsources.
|
280
255
|
//! Typically, there's at most one ambient light in a scene.
|
281
256
|
//! This light type doesn't have a valid position, direction, or
|
282
257
|
//! other properties, just a color.
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
*/
|
288
|
-
//var aiShadingMode_Flat = 0x1;
|
289
|
-
|
290
|
-
/** Simple Gouraud shading.
|
291
|
-
*/
|
292
|
-
//var aiShadingMode_Gouraud = 0x2;
|
293
|
-
|
294
|
-
/** Phong-Shading -
|
295
|
-
*/
|
296
|
-
//var aiShadingMode_Phong = 0x3;
|
297
|
-
|
298
|
-
/** Phong-Blinn-Shading
|
299
|
-
*/
|
300
|
-
//var aiShadingMode_Blinn = 0x4;
|
301
|
-
|
302
|
-
/** Toon-Shading per pixel
|
303
|
-
*
|
304
|
-
* Also known as 'comic' shader.
|
305
|
-
*/
|
306
|
-
//var aiShadingMode_Toon = 0x5;
|
307
|
-
|
308
|
-
/** OrenNayar-Shading per pixel
|
309
|
-
*
|
310
|
-
* Extension to standard Lambertian shading, taking the
|
311
|
-
* roughness of the material into account
|
312
|
-
*/
|
313
|
-
//var aiShadingMode_OrenNayar = 0x6;
|
314
|
-
|
315
|
-
/** Minnaert-Shading per pixel
|
316
|
-
*
|
317
|
-
* Extension to standard Lambertian shading, taking the
|
318
|
-
* "darkness" of the material into account
|
319
|
-
*/
|
320
|
-
//var aiShadingMode_Minnaert = 0x7;
|
321
|
-
|
322
|
-
/** CookTorrance-Shading per pixel
|
323
|
-
*
|
324
|
-
* Special shader for metallic surfaces.
|
325
|
-
*/
|
326
|
-
//var aiShadingMode_CookTorrance = 0x8;
|
327
|
-
|
328
|
-
/** No shading at all. Constant light influence of 1.0.
|
329
|
-
*/
|
330
|
-
//var aiShadingMode_NoShading = 0x9;
|
331
|
-
|
332
|
-
/** Fresnel shading
|
333
|
-
*/
|
334
|
-
//var aiShadingMode_Fresnel = 0xa;
|
335
|
-
//var aiTextureType_NONE = 0x0;
|
336
|
-
|
337
|
-
/** The texture is combined with the result of the diffuse
|
338
|
-
* lighting equation.
|
339
|
-
*/
|
340
|
-
|
341
|
-
var aiTextureType_DIFFUSE = 0x1;
|
342
|
-
/** The texture is combined with the result of the specular
|
343
|
-
* lighting equation.
|
344
|
-
*/
|
345
|
-
//var aiTextureType_SPECULAR = 0x2;
|
346
|
-
|
347
|
-
/** The texture is combined with the result of the ambient
|
348
|
-
* lighting equation.
|
349
|
-
*/
|
350
|
-
//var aiTextureType_AMBIENT = 0x3;
|
351
|
-
|
352
|
-
/** The texture is added to the result of the lighting
|
353
|
-
* calculation. It isn't influenced by incoming light.
|
354
|
-
*/
|
355
|
-
//var aiTextureType_EMISSIVE = 0x4;
|
356
|
-
|
357
|
-
/** The texture is a height map.
|
358
|
-
*
|
359
|
-
* By convention, higher gray-scale values stand for
|
360
|
-
* higher elevations from the base height.
|
361
|
-
*/
|
362
|
-
//var aiTextureType_HEIGHT = 0x5;
|
363
|
-
|
364
|
-
/** The texture is a (tangent space) normal-map.
|
365
|
-
*
|
366
|
-
* Again, there are several conventions for tangent-space
|
367
|
-
* normal maps. Assimp does (intentionally) not
|
368
|
-
* distinguish here.
|
369
|
-
*/
|
370
|
-
|
371
|
-
var aiTextureType_NORMALS = 0x6;
|
372
|
-
/** The texture defines the glossiness of the material.
|
373
|
-
*
|
374
|
-
* The glossiness is in fact the exponent of the specular
|
375
|
-
* (phong) lighting equation. Usually there is a conversion
|
376
|
-
* function defined to map the linear color values in the
|
377
|
-
* texture to a suitable exponent. Have fun.
|
378
|
-
*/
|
379
|
-
//var aiTextureType_SHININESS = 0x7;
|
380
|
-
|
381
|
-
/** The texture defines per-pixel opacity.
|
382
|
-
*
|
383
|
-
* Usually 'white' means opaque and 'black' means
|
384
|
-
* 'transparency'. Or quite the opposite. Have fun.
|
385
|
-
*/
|
386
|
-
|
387
|
-
var aiTextureType_OPACITY = 0x8;
|
388
|
-
/** Displacement texture
|
389
|
-
*
|
390
|
-
* The exact purpose and format is application-dependent.
|
391
|
-
* Higher color values stand for higher vertex displacements.
|
392
|
-
*/
|
393
|
-
//var aiTextureType_DISPLACEMENT = 0x9;
|
394
|
-
|
395
|
-
/** Lightmap texture (aka Ambient Occlusion)
|
396
|
-
*
|
397
|
-
* Both 'Lightmaps' and dedicated 'ambient occlusion maps' are
|
398
|
-
* covered by this material property. The texture contains a
|
399
|
-
* scaling value for the final color value of a pixel. Its
|
400
|
-
* intensity is not affected by incoming light.
|
401
|
-
*/
|
402
|
-
|
403
|
-
var aiTextureType_LIGHTMAP = 0xa;
|
404
|
-
/** Reflection texture
|
405
|
-
*
|
406
|
-
* Contains the color of a perfect mirror reflection.
|
407
|
-
* Rarely used, almost never for real-time applications.
|
408
|
-
*/
|
409
|
-
//var aiTextureType_REFLECTION = 0xB;
|
410
|
-
|
411
|
-
/** Unknown texture
|
412
|
-
*
|
413
|
-
* A texture reference that does not match any of the definitions
|
414
|
-
* above is considered to be 'unknown'. It is still imported,
|
415
|
-
* but is excluded from any further postprocessing.
|
416
|
-
*/
|
417
|
-
//var aiTextureType_UNKNOWN = 0xC;
|
418
|
-
|
258
|
+
var aiTextureType_DIFFUSE = 1;
|
259
|
+
var aiTextureType_NORMALS = 6;
|
260
|
+
var aiTextureType_OPACITY = 8;
|
261
|
+
var aiTextureType_LIGHTMAP = 10;
|
419
262
|
var BONESPERVERT = 4;
|
420
|
-
|
421
263
|
function ASSBIN_MESH_HAS_TEXCOORD(n) {
|
422
264
|
return ASSBIN_MESH_HAS_TEXCOORD_BASE << n;
|
423
265
|
}
|
424
|
-
|
425
266
|
function ASSBIN_MESH_HAS_COLOR(n) {
|
426
267
|
return ASSBIN_MESH_HAS_COLOR_BASE << n;
|
427
268
|
}
|
428
|
-
|
429
269
|
function markBones(scene) {
|
430
270
|
for (let i in scene.mMeshes) {
|
431
271
|
var mesh = scene.mMeshes[i];
|
432
|
-
|
433
272
|
for (let k in mesh.mBones) {
|
434
273
|
var boneNode = scene.findNode(mesh.mBones[k].mName);
|
435
|
-
if (boneNode)
|
274
|
+
if (boneNode)
|
275
|
+
boneNode.isBone = true;
|
436
276
|
}
|
437
277
|
}
|
438
278
|
}
|
439
|
-
|
440
279
|
function cloneTreeToBones(root, scene) {
|
441
|
-
var rootBone = new Bone();
|
280
|
+
var rootBone = new THREE.Bone();
|
442
281
|
rootBone.matrix.copy(root.matrix);
|
443
282
|
rootBone.matrixWorld.copy(root.matrixWorld);
|
444
283
|
rootBone.position.copy(root.position);
|
445
284
|
rootBone.quaternion.copy(root.quaternion);
|
446
285
|
rootBone.scale.copy(root.scale);
|
447
286
|
scene.nodeCount++;
|
448
|
-
rootBone.name =
|
449
|
-
if (!scene.nodeToBoneMap[root.name])
|
287
|
+
rootBone.name = "bone_" + root.name + scene.nodeCount.toString();
|
288
|
+
if (!scene.nodeToBoneMap[root.name])
|
289
|
+
scene.nodeToBoneMap[root.name] = [];
|
450
290
|
scene.nodeToBoneMap[root.name].push(rootBone);
|
451
|
-
|
452
291
|
for (let i in root.children) {
|
453
292
|
var child = cloneTreeToBones(root.children[i], scene);
|
454
293
|
rootBone.add(child);
|
455
294
|
}
|
456
|
-
|
457
295
|
return rootBone;
|
458
296
|
}
|
459
|
-
|
460
297
|
function sortWeights(indexes, weights) {
|
461
298
|
var pairs = [];
|
462
|
-
|
463
299
|
for (let i = 0; i < indexes.length; i++) {
|
464
300
|
pairs.push({
|
465
301
|
i: indexes[i],
|
466
302
|
w: weights[i]
|
467
303
|
});
|
468
304
|
}
|
469
|
-
|
470
|
-
pairs.sort(function (a, b) {
|
305
|
+
pairs.sort(function(a, b) {
|
471
306
|
return b.w - a.w;
|
472
307
|
});
|
473
|
-
|
474
308
|
while (pairs.length < 4) {
|
475
309
|
pairs.push({
|
476
310
|
i: 0,
|
477
311
|
w: 0
|
478
312
|
});
|
479
313
|
}
|
480
|
-
|
481
|
-
|
314
|
+
if (pairs.length > 4)
|
315
|
+
pairs.length = 4;
|
482
316
|
var sum = 0;
|
483
|
-
|
484
317
|
for (let i = 0; i < 4; i++) {
|
485
318
|
sum += pairs[i].w * pairs[i].w;
|
486
319
|
}
|
487
|
-
|
488
320
|
sum = Math.sqrt(sum);
|
489
|
-
|
490
321
|
for (let i = 0; i < 4; i++) {
|
491
322
|
pairs[i].w = pairs[i].w / sum;
|
492
323
|
indexes[i] = pairs[i].i;
|
493
324
|
weights[i] = pairs[i].w;
|
494
325
|
}
|
495
326
|
}
|
496
|
-
|
497
327
|
function findMatchingBone(root, name) {
|
498
|
-
if (root.name.indexOf(
|
499
|
-
|
328
|
+
if (root.name.indexOf("bone_" + name) == 0)
|
329
|
+
return root;
|
500
330
|
for (let i in root.children) {
|
501
331
|
var ret = findMatchingBone(root.children[i], name);
|
502
|
-
if (ret)
|
332
|
+
if (ret)
|
333
|
+
return ret;
|
503
334
|
}
|
504
|
-
|
505
|
-
return undefined;
|
335
|
+
return void 0;
|
506
336
|
}
|
507
|
-
|
508
337
|
function aiMesh() {
|
509
338
|
this.mPrimitiveTypes = 0;
|
510
339
|
this.mNumVertices = 0;
|
@@ -519,354 +348,303 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
519
348
|
this.mTextureCoords = [[]];
|
520
349
|
this.mFaces = [];
|
521
350
|
this.mBones = [];
|
522
|
-
|
523
|
-
|
524
|
-
|
351
|
+
this.hookupSkeletons = function(scene) {
|
352
|
+
if (this.mBones.length == 0)
|
353
|
+
return;
|
525
354
|
var allBones = [];
|
526
355
|
var offsetMatrix = [];
|
527
356
|
var skeletonRoot = scene.findNode(this.mBones[0].mName);
|
528
|
-
|
529
357
|
while (skeletonRoot.mParent && skeletonRoot.mParent.isBone) {
|
530
358
|
skeletonRoot = skeletonRoot.mParent;
|
531
359
|
}
|
532
|
-
|
533
360
|
var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
|
534
361
|
var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
|
535
362
|
this.threeNode.add(threeSkeletonRootBone);
|
536
|
-
|
537
363
|
for (let i = 0; i < this.mBones.length; i++) {
|
538
364
|
var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
|
539
|
-
|
540
365
|
if (bone) {
|
541
366
|
var tbone = bone;
|
542
|
-
allBones.push(tbone);
|
543
|
-
|
367
|
+
allBones.push(tbone);
|
544
368
|
offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
|
545
369
|
} else {
|
546
370
|
var skeletonRoot = scene.findNode(this.mBones[i].mName);
|
547
|
-
if (!skeletonRoot)
|
371
|
+
if (!skeletonRoot)
|
372
|
+
return;
|
548
373
|
var threeSkeletonRoot = skeletonRoot.toTHREE(scene);
|
549
374
|
var threeSkeletonRootBone = cloneTreeToBones(threeSkeletonRoot, scene);
|
550
375
|
this.threeNode.add(threeSkeletonRootBone);
|
551
376
|
var bone = findMatchingBone(threeSkeletonRootBone, this.mBones[i].mName);
|
552
377
|
var tbone = bone;
|
553
|
-
allBones.push(tbone);
|
554
|
-
|
378
|
+
allBones.push(tbone);
|
555
379
|
offsetMatrix.push(this.mBones[i].mOffsetMatrix.toTHREE());
|
556
380
|
}
|
557
381
|
}
|
558
|
-
|
559
|
-
|
560
|
-
this.threeNode.bind(skeleton, new Matrix4());
|
382
|
+
var skeleton = new THREE.Skeleton(allBones, offsetMatrix);
|
383
|
+
this.threeNode.bind(skeleton, new THREE.Matrix4());
|
561
384
|
this.threeNode.material.skinning = true;
|
562
385
|
};
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
var geometry = new BufferGeometry();
|
386
|
+
this.toTHREE = function(scene) {
|
387
|
+
if (this.threeNode)
|
388
|
+
return this.threeNode;
|
389
|
+
var geometry = new THREE.BufferGeometry();
|
567
390
|
var mat;
|
568
|
-
if (scene.mMaterials[this.mMaterialIndex])
|
569
|
-
|
570
|
-
|
571
|
-
|
391
|
+
if (scene.mMaterials[this.mMaterialIndex])
|
392
|
+
mat = scene.mMaterials[this.mMaterialIndex].toTHREE(scene);
|
393
|
+
else
|
394
|
+
mat = new THREE.MeshLambertMaterial();
|
395
|
+
geometry.setIndex(new THREE.BufferAttribute(new Uint32Array(this.mIndexArray), 1));
|
396
|
+
geometry.setAttribute("position", new THREE.BufferAttribute(this.mVertexBuffer, 3));
|
572
397
|
if (this.mNormalBuffer && this.mNormalBuffer.length > 0) {
|
573
|
-
geometry.setAttribute(
|
398
|
+
geometry.setAttribute("normal", new THREE.BufferAttribute(this.mNormalBuffer, 3));
|
574
399
|
}
|
575
|
-
|
576
400
|
if (this.mColorBuffer && this.mColorBuffer.length > 0) {
|
577
|
-
geometry.setAttribute(
|
401
|
+
geometry.setAttribute("color", new THREE.BufferAttribute(this.mColorBuffer, 4));
|
578
402
|
}
|
579
|
-
|
580
403
|
if (this.mTexCoordsBuffers[0] && this.mTexCoordsBuffers[0].length > 0) {
|
581
|
-
geometry.setAttribute(
|
404
|
+
geometry.setAttribute("uv", new THREE.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]), 2));
|
582
405
|
}
|
583
|
-
|
584
406
|
if (this.mTexCoordsBuffers[1] && this.mTexCoordsBuffers[1].length > 0) {
|
585
|
-
geometry.setAttribute(
|
407
|
+
geometry.setAttribute("uv1", new THREE.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]), 2));
|
586
408
|
}
|
587
|
-
|
588
409
|
if (this.mTangentBuffer && this.mTangentBuffer.length > 0) {
|
589
|
-
geometry.setAttribute(
|
410
|
+
geometry.setAttribute("tangents", new THREE.BufferAttribute(this.mTangentBuffer, 3));
|
590
411
|
}
|
591
|
-
|
592
412
|
if (this.mBitangentBuffer && this.mBitangentBuffer.length > 0) {
|
593
|
-
geometry.setAttribute(
|
413
|
+
geometry.setAttribute("bitangents", new THREE.BufferAttribute(this.mBitangentBuffer, 3));
|
594
414
|
}
|
595
|
-
|
596
415
|
if (this.mBones.length > 0) {
|
597
416
|
var weights = [];
|
598
417
|
var bones = [];
|
599
|
-
|
600
418
|
for (let i = 0; i < this.mBones.length; i++) {
|
601
419
|
for (let j = 0; j < this.mBones[i].mWeights.length; j++) {
|
602
420
|
var weight = this.mBones[i].mWeights[j];
|
603
|
-
|
604
421
|
if (weight) {
|
605
|
-
if (!weights[weight.mVertexId])
|
606
|
-
|
422
|
+
if (!weights[weight.mVertexId])
|
423
|
+
weights[weight.mVertexId] = [];
|
424
|
+
if (!bones[weight.mVertexId])
|
425
|
+
bones[weight.mVertexId] = [];
|
607
426
|
weights[weight.mVertexId].push(weight.mWeight);
|
608
427
|
bones[weight.mVertexId].push(parseInt(i));
|
609
428
|
}
|
610
429
|
}
|
611
430
|
}
|
612
|
-
|
613
431
|
for (let i in bones) {
|
614
432
|
sortWeights(bones[i], weights[i]);
|
615
433
|
}
|
616
|
-
|
617
434
|
var _weights = [];
|
618
435
|
var _bones = [];
|
619
|
-
|
620
436
|
for (let i = 0; i < weights.length; i++) {
|
621
437
|
for (let j = 0; j < 4; j++) {
|
622
438
|
if (weights[i] && bones[i]) {
|
623
439
|
_weights.push(weights[i][j]);
|
624
|
-
|
625
440
|
_bones.push(bones[i][j]);
|
626
441
|
} else {
|
627
442
|
_weights.push(0);
|
628
|
-
|
629
443
|
_bones.push(0);
|
630
444
|
}
|
631
445
|
}
|
632
446
|
}
|
633
|
-
|
634
|
-
geometry.setAttribute(
|
635
|
-
geometry.setAttribute('skinIndex', new BufferAttribute(new Float32Array(_bones), BONESPERVERT));
|
447
|
+
geometry.setAttribute("skinWeight", new THREE.BufferAttribute(new Float32Array(_weights), BONESPERVERT));
|
448
|
+
geometry.setAttribute("skinIndex", new THREE.BufferAttribute(new Float32Array(_bones), BONESPERVERT));
|
636
449
|
}
|
637
|
-
|
638
450
|
var mesh;
|
639
|
-
if (this.mBones.length == 0)
|
640
|
-
|
451
|
+
if (this.mBones.length == 0)
|
452
|
+
mesh = new THREE.Mesh(geometry, mat);
|
641
453
|
if (this.mBones.length > 0) {
|
642
|
-
mesh = new SkinnedMesh(geometry, mat);
|
454
|
+
mesh = new THREE.SkinnedMesh(geometry, mat);
|
643
455
|
mesh.normalizeSkinWeights();
|
644
456
|
}
|
645
|
-
|
646
|
-
this.threeNode = mesh; //mesh.matrixAutoUpdate = false;
|
647
|
-
|
457
|
+
this.threeNode = mesh;
|
648
458
|
return mesh;
|
649
459
|
};
|
650
460
|
}
|
651
|
-
|
652
461
|
function aiFace() {
|
653
462
|
this.mNumIndices = 0;
|
654
463
|
this.mIndices = [];
|
655
464
|
}
|
656
|
-
|
657
465
|
function aiVector3D() {
|
658
466
|
this.x = 0;
|
659
467
|
this.y = 0;
|
660
468
|
this.z = 0;
|
661
|
-
|
662
|
-
|
663
|
-
return new Vector3(this.x, this.y, this.z);
|
469
|
+
this.toTHREE = function() {
|
470
|
+
return new THREE.Vector3(this.x, this.y, this.z);
|
664
471
|
};
|
665
472
|
}
|
666
|
-
|
667
473
|
function aiColor3D() {
|
668
474
|
this.r = 0;
|
669
475
|
this.g = 0;
|
670
476
|
this.b = 0;
|
671
477
|
this.a = 0;
|
672
|
-
|
673
|
-
|
674
|
-
return new Color(this.r, this.g, this.b);
|
478
|
+
this.toTHREE = function() {
|
479
|
+
return new THREE.Color(this.r, this.g, this.b);
|
675
480
|
};
|
676
481
|
}
|
677
|
-
|
678
482
|
function aiQuaternion() {
|
679
483
|
this.x = 0;
|
680
484
|
this.y = 0;
|
681
485
|
this.z = 0;
|
682
486
|
this.w = 0;
|
683
|
-
|
684
|
-
|
685
|
-
return new Quaternion(this.x, this.y, this.z, this.w);
|
487
|
+
this.toTHREE = function() {
|
488
|
+
return new THREE.Quaternion(this.x, this.y, this.z, this.w);
|
686
489
|
};
|
687
490
|
}
|
688
|
-
|
689
491
|
function aiVertexWeight() {
|
690
492
|
this.mVertexId = 0;
|
691
493
|
this.mWeight = 0;
|
692
494
|
}
|
693
|
-
|
694
495
|
function aiString() {
|
695
496
|
this.data = [];
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
this.data.forEach(function (i) {
|
497
|
+
this.toString = function() {
|
498
|
+
var str = "";
|
499
|
+
this.data.forEach(function(i) {
|
700
500
|
str += String.fromCharCode(i);
|
701
501
|
});
|
702
|
-
return str.replace(/[^\x20-\x7E]+/g,
|
502
|
+
return str.replace(/[^\x20-\x7E]+/g, "");
|
703
503
|
};
|
704
504
|
}
|
705
|
-
|
706
505
|
function aiVectorKey() {
|
707
506
|
this.mTime = 0;
|
708
507
|
this.mValue = null;
|
709
508
|
}
|
710
|
-
|
711
509
|
function aiQuatKey() {
|
712
510
|
this.mTime = 0;
|
713
511
|
this.mValue = null;
|
714
512
|
}
|
715
|
-
|
716
513
|
function aiNode() {
|
717
|
-
this.mName =
|
514
|
+
this.mName = "";
|
718
515
|
this.mTransformation = [];
|
719
516
|
this.mNumChildren = 0;
|
720
517
|
this.mNumMeshes = 0;
|
721
518
|
this.mMeshes = [];
|
722
519
|
this.mChildren = [];
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
var o = new Object3D();
|
520
|
+
this.toTHREE = function(scene) {
|
521
|
+
if (this.threeNode)
|
522
|
+
return this.threeNode;
|
523
|
+
var o = new THREE.Object3D();
|
727
524
|
o.name = this.mName;
|
728
525
|
o.matrix = this.mTransformation.toTHREE();
|
729
|
-
|
730
526
|
for (let i = 0; i < this.mChildren.length; i++) {
|
731
527
|
o.add(this.mChildren[i].toTHREE(scene));
|
732
528
|
}
|
733
|
-
|
734
529
|
for (let i = 0; i < this.mMeshes.length; i++) {
|
735
530
|
o.add(scene.mMeshes[this.mMeshes[i]].toTHREE(scene));
|
736
531
|
}
|
737
|
-
|
738
|
-
this.threeNode = o; //o.matrixAutoUpdate = false;
|
739
|
-
|
532
|
+
this.threeNode = o;
|
740
533
|
o.matrix.decompose(o.position, o.quaternion, o.scale);
|
741
534
|
return o;
|
742
535
|
};
|
743
536
|
}
|
744
|
-
|
745
537
|
function aiBone() {
|
746
|
-
this.mName =
|
538
|
+
this.mName = "";
|
747
539
|
this.mNumWeights = 0;
|
748
540
|
this.mOffsetMatrix = 0;
|
749
541
|
}
|
750
|
-
|
751
542
|
function aiMaterialProperty() {
|
752
|
-
this.mKey =
|
543
|
+
this.mKey = "";
|
753
544
|
this.mSemantic = 0;
|
754
545
|
this.mIndex = 0;
|
755
546
|
this.mData = [];
|
756
547
|
this.mDataLength = 0;
|
757
548
|
this.mType = 0;
|
758
|
-
|
759
|
-
this.dataAsColor = function () {
|
549
|
+
this.dataAsColor = function() {
|
760
550
|
var array = new Uint8Array(this.mData).buffer;
|
761
551
|
var reader = new DataView(array);
|
762
552
|
var r = reader.getFloat32(0, true);
|
763
553
|
var g = reader.getFloat32(4, true);
|
764
|
-
var b = reader.getFloat32(8, true);
|
765
|
-
|
766
|
-
return new Color(r, g, b);
|
554
|
+
var b = reader.getFloat32(8, true);
|
555
|
+
return new THREE.Color(r, g, b);
|
767
556
|
};
|
768
|
-
|
769
|
-
this.dataAsFloat = function () {
|
557
|
+
this.dataAsFloat = function() {
|
770
558
|
var array = new Uint8Array(this.mData).buffer;
|
771
559
|
var reader = new DataView(array);
|
772
560
|
var r = reader.getFloat32(0, true);
|
773
561
|
return r;
|
774
562
|
};
|
775
|
-
|
776
|
-
this.dataAsBool = function () {
|
563
|
+
this.dataAsBool = function() {
|
777
564
|
var array = new Uint8Array(this.mData).buffer;
|
778
565
|
var reader = new DataView(array);
|
779
566
|
var r = reader.getFloat32(0, true);
|
780
567
|
return !!r;
|
781
568
|
};
|
782
|
-
|
783
|
-
this.dataAsString = function () {
|
569
|
+
this.dataAsString = function() {
|
784
570
|
var s = new aiString();
|
785
571
|
s.data = this.mData;
|
786
572
|
return s.toString();
|
787
573
|
};
|
788
|
-
|
789
|
-
this.dataAsMap = function () {
|
574
|
+
this.dataAsMap = function() {
|
790
575
|
var s = new aiString();
|
791
576
|
s.data = this.mData;
|
792
|
-
var
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
path = path.substr(path.lastIndexOf('/') + 1);
|
577
|
+
var path2 = s.toString();
|
578
|
+
path2 = path2.replace(/\\/g, "/");
|
579
|
+
if (path2.indexOf("/") != -1) {
|
580
|
+
path2 = path2.substr(path2.lastIndexOf("/") + 1);
|
797
581
|
}
|
798
|
-
|
799
|
-
return textureLoader.load(path);
|
582
|
+
return textureLoader.load(path2);
|
800
583
|
};
|
801
584
|
}
|
802
|
-
|
803
585
|
var namePropMapping = {
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
586
|
+
"?mat.name": "name",
|
587
|
+
"$mat.shadingm": "shading",
|
588
|
+
"$mat.twosided": "twoSided",
|
589
|
+
"$mat.wireframe": "wireframe",
|
590
|
+
"$clr.ambient": "ambient",
|
591
|
+
"$clr.diffuse": "color",
|
592
|
+
"$clr.specular": "specular",
|
593
|
+
"$clr.emissive": "emissive",
|
594
|
+
"$clr.transparent": "transparent",
|
595
|
+
"$clr.reflective": "reflect",
|
596
|
+
"$mat.shininess": "shininess",
|
597
|
+
"$mat.reflectivity": "reflectivity",
|
598
|
+
"$mat.refracti": "refraction",
|
599
|
+
"$tex.file": "map"
|
818
600
|
};
|
819
601
|
var nameTypeMapping = {
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
602
|
+
"?mat.name": "string",
|
603
|
+
"$mat.shadingm": "bool",
|
604
|
+
"$mat.twosided": "bool",
|
605
|
+
"$mat.wireframe": "bool",
|
606
|
+
"$clr.ambient": "color",
|
607
|
+
"$clr.diffuse": "color",
|
608
|
+
"$clr.specular": "color",
|
609
|
+
"$clr.emissive": "color",
|
610
|
+
"$clr.transparent": "color",
|
611
|
+
"$clr.reflective": "color",
|
612
|
+
"$mat.shininess": "float",
|
613
|
+
"$mat.reflectivity": "float",
|
614
|
+
"$mat.refracti": "float",
|
615
|
+
"$tex.file": "map"
|
834
616
|
};
|
835
|
-
|
836
617
|
function aiMaterial() {
|
837
618
|
this.mNumAllocated = 0;
|
838
619
|
this.mNumProperties = 0;
|
839
620
|
this.mProperties = [];
|
840
|
-
|
841
|
-
|
842
|
-
var mat = new MeshPhongMaterial();
|
843
|
-
|
621
|
+
this.toTHREE = function() {
|
622
|
+
var mat = new THREE.MeshPhongMaterial();
|
844
623
|
for (let i = 0; i < this.mProperties.length; i++) {
|
845
|
-
if (nameTypeMapping[this.mProperties[i].mKey] ==
|
624
|
+
if (nameTypeMapping[this.mProperties[i].mKey] == "float") {
|
846
625
|
mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsFloat();
|
847
626
|
}
|
848
|
-
|
849
|
-
if (nameTypeMapping[this.mProperties[i].mKey] == 'color') {
|
627
|
+
if (nameTypeMapping[this.mProperties[i].mKey] == "color") {
|
850
628
|
mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsColor();
|
851
629
|
}
|
852
|
-
|
853
|
-
if (nameTypeMapping[this.mProperties[i].mKey] == 'bool') {
|
630
|
+
if (nameTypeMapping[this.mProperties[i].mKey] == "bool") {
|
854
631
|
mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsBool();
|
855
632
|
}
|
856
|
-
|
857
|
-
if (nameTypeMapping[this.mProperties[i].mKey] == 'string') {
|
633
|
+
if (nameTypeMapping[this.mProperties[i].mKey] == "string") {
|
858
634
|
mat[namePropMapping[this.mProperties[i].mKey]] = this.mProperties[i].dataAsString();
|
859
635
|
}
|
860
|
-
|
861
|
-
if (nameTypeMapping[this.mProperties[i].mKey] == 'map') {
|
636
|
+
if (nameTypeMapping[this.mProperties[i].mKey] == "map") {
|
862
637
|
var prop = this.mProperties[i];
|
863
|
-
if (prop.mSemantic == aiTextureType_DIFFUSE)
|
864
|
-
|
865
|
-
if (prop.mSemantic ==
|
866
|
-
|
638
|
+
if (prop.mSemantic == aiTextureType_DIFFUSE)
|
639
|
+
mat.map = this.mProperties[i].dataAsMap();
|
640
|
+
if (prop.mSemantic == aiTextureType_NORMALS)
|
641
|
+
mat.normalMap = this.mProperties[i].dataAsMap();
|
642
|
+
if (prop.mSemantic == aiTextureType_LIGHTMAP)
|
643
|
+
mat.lightMap = this.mProperties[i].dataAsMap();
|
644
|
+
if (prop.mSemantic == aiTextureType_OPACITY)
|
645
|
+
mat.alphaMap = this.mProperties[i].dataAsMap();
|
867
646
|
}
|
868
647
|
}
|
869
|
-
|
870
648
|
mat.ambient.r = 0.53;
|
871
649
|
mat.ambient.g = 0.53;
|
872
650
|
mat.ambient.b = 0.53;
|
@@ -876,36 +654,31 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
876
654
|
return mat;
|
877
655
|
};
|
878
656
|
}
|
879
|
-
|
880
657
|
function veclerp(v1, v2, l) {
|
881
|
-
var v = new Vector3();
|
658
|
+
var v = new THREE.Vector3();
|
882
659
|
var lm1 = 1 - l;
|
883
660
|
v.x = v1.x * l + v2.x * lm1;
|
884
661
|
v.y = v1.y * l + v2.y * lm1;
|
885
662
|
v.z = v1.z * l + v2.z * lm1;
|
886
663
|
return v;
|
887
664
|
}
|
888
|
-
|
889
665
|
function quatlerp(q1, q2, l) {
|
890
666
|
return q1.clone().slerp(q2, 1 - l);
|
891
667
|
}
|
892
|
-
|
893
668
|
function sampleTrack(keys, time, lne, lerp) {
|
894
|
-
if (keys.length == 1)
|
669
|
+
if (keys.length == 1)
|
670
|
+
return keys[0].mValue.toTHREE();
|
895
671
|
var dist = Infinity;
|
896
672
|
var key = null;
|
897
673
|
var nextKey = null;
|
898
|
-
|
899
674
|
for (let i = 0; i < keys.length; i++) {
|
900
675
|
var timeDist = Math.abs(keys[i].mTime - time);
|
901
|
-
|
902
676
|
if (timeDist < dist && keys[i].mTime <= time) {
|
903
677
|
dist = timeDist;
|
904
678
|
key = keys[i];
|
905
679
|
nextKey = keys[i + 1];
|
906
680
|
}
|
907
681
|
}
|
908
|
-
|
909
682
|
if (!key) {
|
910
683
|
return null;
|
911
684
|
} else if (nextKey) {
|
@@ -922,57 +695,62 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
922
695
|
return lerp(key.mValue.toTHREE(), nextKey.mValue.toTHREE(), l);
|
923
696
|
}
|
924
697
|
}
|
925
|
-
|
926
698
|
function aiNodeAnim() {
|
927
|
-
this.mNodeName =
|
699
|
+
this.mNodeName = "";
|
928
700
|
this.mNumPositionKeys = 0;
|
929
701
|
this.mNumRotationKeys = 0;
|
930
702
|
this.mNumScalingKeys = 0;
|
931
703
|
this.mPositionKeys = [];
|
932
704
|
this.mRotationKeys = [];
|
933
705
|
this.mScalingKeys = [];
|
934
|
-
this.mPreState =
|
935
|
-
this.mPostState =
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
t.mTime /= tps;
|
706
|
+
this.mPreState = "";
|
707
|
+
this.mPostState = "";
|
708
|
+
this.init = function(tps) {
|
709
|
+
if (!tps)
|
710
|
+
tps = 1;
|
711
|
+
function t(t2) {
|
712
|
+
t2.mTime /= tps;
|
942
713
|
}
|
943
|
-
|
944
714
|
this.mPositionKeys.forEach(t);
|
945
715
|
this.mRotationKeys.forEach(t);
|
946
716
|
this.mScalingKeys.forEach(t);
|
947
717
|
};
|
948
|
-
|
949
|
-
this.sortKeys = function () {
|
718
|
+
this.sortKeys = function() {
|
950
719
|
function comp(a, b) {
|
951
720
|
return a.mTime - b.mTime;
|
952
721
|
}
|
953
|
-
|
954
722
|
this.mPositionKeys.sort(comp);
|
955
723
|
this.mRotationKeys.sort(comp);
|
956
724
|
this.mScalingKeys.sort(comp);
|
957
725
|
};
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
726
|
+
this.getLength = function() {
|
727
|
+
return Math.max(
|
728
|
+
Math.max.apply(
|
729
|
+
null,
|
730
|
+
this.mPositionKeys.map(function(a) {
|
731
|
+
return a.mTime;
|
732
|
+
})
|
733
|
+
),
|
734
|
+
Math.max.apply(
|
735
|
+
null,
|
736
|
+
this.mRotationKeys.map(function(a) {
|
737
|
+
return a.mTime;
|
738
|
+
})
|
739
|
+
),
|
740
|
+
Math.max.apply(
|
741
|
+
null,
|
742
|
+
this.mScalingKeys.map(function(a) {
|
743
|
+
return a.mTime;
|
744
|
+
})
|
745
|
+
)
|
746
|
+
);
|
967
747
|
};
|
968
|
-
|
969
|
-
this.toTHREE = function (o) {
|
748
|
+
this.toTHREE = function(o) {
|
970
749
|
this.sortKeys();
|
971
750
|
var length = this.getLength();
|
972
751
|
var track = new Virtulous.KeyFrameTrack();
|
973
|
-
|
974
752
|
for (let i = 0; i < length; i += 0.05) {
|
975
|
-
var matrix = new Matrix4();
|
753
|
+
var matrix = new THREE.Matrix4();
|
976
754
|
var time = i;
|
977
755
|
var pos = sampleTrack(this.mPositionKeys, time, length, veclerp);
|
978
756
|
var scale = sampleTrack(this.mScalingKeys, time, length, veclerp);
|
@@ -981,10 +759,8 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
981
759
|
var key = new Virtulous.KeyFrame(time, matrix);
|
982
760
|
track.addKey(key);
|
983
761
|
}
|
984
|
-
|
985
762
|
track.target = o.findNode(this.mNodeName).toTHREE();
|
986
763
|
var tracks = [track];
|
987
|
-
|
988
764
|
if (o.nodeToBoneMap[this.mNodeName]) {
|
989
765
|
for (let i = 0; i < o.nodeToBoneMap[this.mNodeName].length; i++) {
|
990
766
|
var t2 = track.clone();
|
@@ -992,47 +768,42 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
992
768
|
tracks.push(t2);
|
993
769
|
}
|
994
770
|
}
|
995
|
-
|
996
771
|
return tracks;
|
997
772
|
};
|
998
773
|
}
|
999
|
-
|
1000
774
|
function aiAnimation() {
|
1001
|
-
this.mName =
|
775
|
+
this.mName = "";
|
1002
776
|
this.mDuration = 0;
|
1003
777
|
this.mTicksPerSecond = 0;
|
1004
778
|
this.mNumChannels = 0;
|
1005
779
|
this.mChannels = [];
|
1006
|
-
|
1007
|
-
this.toTHREE = function (root) {
|
780
|
+
this.toTHREE = function(root) {
|
1008
781
|
var animationHandle = new Virtulous.Animation();
|
1009
|
-
|
1010
782
|
for (let i in this.mChannels) {
|
1011
783
|
this.mChannels[i].init(this.mTicksPerSecond);
|
1012
784
|
var tracks = this.mChannels[i].toTHREE(root);
|
1013
|
-
|
1014
785
|
for (let j in tracks) {
|
1015
786
|
tracks[j].init();
|
1016
787
|
animationHandle.addTrack(tracks[j]);
|
1017
788
|
}
|
1018
789
|
}
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
790
|
+
animationHandle.length = Math.max.apply(
|
791
|
+
null,
|
792
|
+
animationHandle.tracks.map(function(e) {
|
793
|
+
return e.length;
|
794
|
+
})
|
795
|
+
);
|
1023
796
|
return animationHandle;
|
1024
797
|
};
|
1025
798
|
}
|
1026
|
-
|
1027
799
|
function aiTexture() {
|
1028
800
|
this.mWidth = 0;
|
1029
801
|
this.mHeight = 0;
|
1030
802
|
this.texAchFormatHint = [];
|
1031
803
|
this.pcData = [];
|
1032
804
|
}
|
1033
|
-
|
1034
805
|
function aiLight() {
|
1035
|
-
this.mName =
|
806
|
+
this.mName = "";
|
1036
807
|
this.mType = 0;
|
1037
808
|
this.mAttenuationConstant = 0;
|
1038
809
|
this.mAttenuationLinear = 0;
|
@@ -1043,9 +814,8 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1043
814
|
this.mColorSpecular = null;
|
1044
815
|
this.mColorAmbient = null;
|
1045
816
|
}
|
1046
|
-
|
1047
817
|
function aiCamera() {
|
1048
|
-
this.mName =
|
818
|
+
this.mName = "";
|
1049
819
|
this.mPosition = null;
|
1050
820
|
this.mLookAt = null;
|
1051
821
|
this.mUp = null;
|
@@ -1054,7 +824,6 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1054
824
|
this.mClipPlaneFar = 0;
|
1055
825
|
this.mAspect = 0;
|
1056
826
|
}
|
1057
|
-
|
1058
827
|
function aiScene() {
|
1059
828
|
this.versionMajor = 0;
|
1060
829
|
this.versionMinor = 0;
|
@@ -1074,96 +843,75 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1074
843
|
this.mLights = [];
|
1075
844
|
this.mCameras = [];
|
1076
845
|
this.nodeToBoneMap = {};
|
1077
|
-
|
1078
|
-
this.findNode = function (name, root) {
|
846
|
+
this.findNode = function(name, root) {
|
1079
847
|
if (!root) {
|
1080
848
|
root = this.mRootNode;
|
1081
849
|
}
|
1082
|
-
|
1083
850
|
if (root.mName == name) {
|
1084
851
|
return root;
|
1085
852
|
}
|
1086
|
-
|
1087
853
|
for (let i = 0; i < root.mChildren.length; i++) {
|
1088
854
|
var ret = this.findNode(name, root.mChildren[i]);
|
1089
|
-
if (ret)
|
855
|
+
if (ret)
|
856
|
+
return ret;
|
1090
857
|
}
|
1091
|
-
|
1092
858
|
return null;
|
1093
859
|
};
|
1094
|
-
|
1095
|
-
this.toTHREE = function () {
|
860
|
+
this.toTHREE = function() {
|
1096
861
|
this.nodeCount = 0;
|
1097
862
|
markBones(this);
|
1098
863
|
var o = this.mRootNode.toTHREE(this);
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
864
|
+
for (let i in this.mMeshes)
|
865
|
+
this.mMeshes[i].hookupSkeletons(this);
|
1102
866
|
if (this.mAnimations.length > 0) {
|
1103
867
|
var a = this.mAnimations[0].toTHREE(this);
|
1104
868
|
}
|
1105
|
-
|
1106
|
-
return {
|
1107
|
-
object: o,
|
1108
|
-
animation: a
|
1109
|
-
};
|
869
|
+
return { object: o, animation: a };
|
1110
870
|
};
|
1111
871
|
}
|
1112
|
-
|
1113
872
|
function aiMatrix4() {
|
1114
873
|
this.elements = [[], [], [], []];
|
1115
|
-
|
1116
|
-
|
1117
|
-
var m = new Matrix4();
|
1118
|
-
|
874
|
+
this.toTHREE = function() {
|
875
|
+
var m = new THREE.Matrix4();
|
1119
876
|
for (let i = 0; i < 4; ++i) {
|
1120
877
|
for (let i2 = 0; i2 < 4; ++i2) {
|
1121
878
|
m.elements[i * 4 + i2] = this.elements[i2][i];
|
1122
879
|
}
|
1123
880
|
}
|
1124
|
-
|
1125
881
|
return m;
|
1126
882
|
};
|
1127
883
|
}
|
1128
|
-
|
1129
884
|
var littleEndian = true;
|
1130
|
-
|
1131
885
|
function readFloat(dataview) {
|
1132
886
|
var val = dataview.getFloat32(dataview.readOffset, littleEndian);
|
1133
887
|
dataview.readOffset += 4;
|
1134
888
|
return val;
|
1135
889
|
}
|
1136
|
-
|
1137
890
|
function Read_double(dataview) {
|
1138
891
|
var val = dataview.getFloat64(dataview.readOffset, littleEndian);
|
1139
892
|
dataview.readOffset += 8;
|
1140
893
|
return val;
|
1141
894
|
}
|
1142
|
-
|
1143
895
|
function Read_uint8_t(dataview) {
|
1144
896
|
var val = dataview.getUint8(dataview.readOffset);
|
1145
897
|
dataview.readOffset += 1;
|
1146
898
|
return val;
|
1147
899
|
}
|
1148
|
-
|
1149
900
|
function Read_uint16_t(dataview) {
|
1150
901
|
var val = dataview.getUint16(dataview.readOffset, littleEndian);
|
1151
902
|
dataview.readOffset += 2;
|
1152
903
|
return val;
|
1153
904
|
}
|
1154
|
-
|
1155
905
|
function Read_unsigned_int(dataview) {
|
1156
906
|
var val = dataview.getUint32(dataview.readOffset, littleEndian);
|
1157
907
|
dataview.readOffset += 4;
|
1158
908
|
return val;
|
1159
909
|
}
|
1160
|
-
|
1161
910
|
function Read_uint32_t(dataview) {
|
1162
911
|
var val = dataview.getUint32(dataview.readOffset, littleEndian);
|
1163
912
|
dataview.readOffset += 4;
|
1164
913
|
return val;
|
1165
914
|
}
|
1166
|
-
|
1167
915
|
function Read_aiVector3D(stream) {
|
1168
916
|
var v = new aiVector3D();
|
1169
917
|
v.x = readFloat(stream);
|
@@ -1171,7 +919,6 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1171
919
|
v.z = readFloat(stream);
|
1172
920
|
return v;
|
1173
921
|
}
|
1174
|
-
|
1175
922
|
function Read_aiColor3D(stream) {
|
1176
923
|
var c = new aiColor3D();
|
1177
924
|
c.r = readFloat(stream);
|
@@ -1179,7 +926,6 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1179
926
|
c.b = readFloat(stream);
|
1180
927
|
return c;
|
1181
928
|
}
|
1182
|
-
|
1183
929
|
function Read_aiQuaternion(stream) {
|
1184
930
|
var v = new aiQuaternion();
|
1185
931
|
v.w = readFloat(stream);
|
@@ -1188,75 +934,61 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1188
934
|
v.z = readFloat(stream);
|
1189
935
|
return v;
|
1190
936
|
}
|
1191
|
-
|
1192
937
|
function Read_aiString(stream) {
|
1193
938
|
var s = new aiString();
|
1194
939
|
var stringlengthbytes = Read_unsigned_int(stream);
|
1195
940
|
stream.ReadBytes(s.data, 1, stringlengthbytes);
|
1196
941
|
return s.toString();
|
1197
942
|
}
|
1198
|
-
|
1199
943
|
function Read_aiVertexWeight(stream) {
|
1200
944
|
var w = new aiVertexWeight();
|
1201
945
|
w.mVertexId = Read_unsigned_int(stream);
|
1202
946
|
w.mWeight = readFloat(stream);
|
1203
947
|
return w;
|
1204
948
|
}
|
1205
|
-
|
1206
949
|
function Read_aiMatrix4x4(stream) {
|
1207
950
|
var m = new aiMatrix4();
|
1208
|
-
|
1209
951
|
for (let i = 0; i < 4; ++i) {
|
1210
952
|
for (let i2 = 0; i2 < 4; ++i2) {
|
1211
953
|
m.elements[i][i2] = readFloat(stream);
|
1212
954
|
}
|
1213
955
|
}
|
1214
|
-
|
1215
956
|
return m;
|
1216
957
|
}
|
1217
|
-
|
1218
958
|
function Read_aiVectorKey(stream) {
|
1219
959
|
var v = new aiVectorKey();
|
1220
960
|
v.mTime = Read_double(stream);
|
1221
961
|
v.mValue = Read_aiVector3D(stream);
|
1222
962
|
return v;
|
1223
963
|
}
|
1224
|
-
|
1225
964
|
function Read_aiQuatKey(stream) {
|
1226
965
|
var v = new aiQuatKey();
|
1227
966
|
v.mTime = Read_double(stream);
|
1228
967
|
v.mValue = Read_aiQuaternion(stream);
|
1229
968
|
return v;
|
1230
969
|
}
|
1231
|
-
|
1232
970
|
function ReadArray_aiVertexWeight(stream, data, size) {
|
1233
|
-
for (let i = 0; i < size; i++)
|
971
|
+
for (let i = 0; i < size; i++)
|
972
|
+
data[i] = Read_aiVertexWeight(stream);
|
1234
973
|
}
|
1235
|
-
|
1236
974
|
function ReadArray_aiVectorKey(stream, data, size) {
|
1237
|
-
for (let i = 0; i < size; i++)
|
975
|
+
for (let i = 0; i < size; i++)
|
976
|
+
data[i] = Read_aiVectorKey(stream);
|
1238
977
|
}
|
1239
|
-
|
1240
978
|
function ReadArray_aiQuatKey(stream, data, size) {
|
1241
|
-
for (let i = 0; i < size; i++)
|
979
|
+
for (let i = 0; i < size; i++)
|
980
|
+
data[i] = Read_aiQuatKey(stream);
|
1242
981
|
}
|
1243
|
-
|
1244
|
-
|
1245
|
-
/*p*/
|
1246
|
-
, n) {
|
1247
|
-
// not sure what to do here, the data isn't really useful.
|
1248
|
-
return stream.Seek(sizeof(T) * n, aiOrigin_CUR); // eslint-disable-line no-undef
|
982
|
+
function ReadBounds(stream, T, n) {
|
983
|
+
return stream.Seek(sizeof(T) * n, aiOrigin_CUR);
|
1249
984
|
}
|
1250
|
-
|
1251
985
|
function ai_assert(bool) {
|
1252
|
-
if (!bool)
|
986
|
+
if (!bool)
|
987
|
+
throw "asset failed";
|
1253
988
|
}
|
1254
|
-
|
1255
989
|
function ReadBinaryNode(stream, parent, depth) {
|
1256
990
|
var chunkID = Read_uint32_t(stream);
|
1257
991
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODE);
|
1258
|
-
/*uint32_t size =*/
|
1259
|
-
|
1260
992
|
Read_uint32_t(stream);
|
1261
993
|
var node = new aiNode();
|
1262
994
|
node.mParent = parent;
|
@@ -1265,93 +997,70 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1265
997
|
node.mTransformation = Read_aiMatrix4x4(stream);
|
1266
998
|
node.mNumChildren = Read_unsigned_int(stream);
|
1267
999
|
node.mNumMeshes = Read_unsigned_int(stream);
|
1268
|
-
|
1269
1000
|
if (node.mNumMeshes) {
|
1270
1001
|
node.mMeshes = [];
|
1271
|
-
|
1272
1002
|
for (let i = 0; i < node.mNumMeshes; ++i) {
|
1273
1003
|
node.mMeshes[i] = Read_unsigned_int(stream);
|
1274
1004
|
}
|
1275
1005
|
}
|
1276
|
-
|
1277
1006
|
if (node.mNumChildren) {
|
1278
1007
|
node.mChildren = [];
|
1279
|
-
|
1280
1008
|
for (let i = 0; i < node.mNumChildren; ++i) {
|
1281
1009
|
var node2 = ReadBinaryNode(stream, node, depth++);
|
1282
1010
|
node.mChildren[i] = node2;
|
1283
1011
|
}
|
1284
1012
|
}
|
1285
|
-
|
1286
1013
|
return node;
|
1287
|
-
}
|
1288
|
-
|
1289
|
-
|
1014
|
+
}
|
1290
1015
|
function ReadBinaryBone(stream, b) {
|
1291
1016
|
var chunkID = Read_uint32_t(stream);
|
1292
1017
|
ai_assert(chunkID == ASSBIN_CHUNK_AIBONE);
|
1293
|
-
/*uint32_t size =*/
|
1294
|
-
|
1295
1018
|
Read_uint32_t(stream);
|
1296
1019
|
b.mName = Read_aiString(stream);
|
1297
1020
|
b.mNumWeights = Read_unsigned_int(stream);
|
1298
|
-
b.mOffsetMatrix = Read_aiMatrix4x4(stream);
|
1299
|
-
// maybe I'll add a better, hash-like solution later
|
1300
|
-
|
1021
|
+
b.mOffsetMatrix = Read_aiMatrix4x4(stream);
|
1301
1022
|
if (shortened) {
|
1302
1023
|
ReadBounds(stream, b.mWeights, b.mNumWeights);
|
1303
1024
|
} else {
|
1304
|
-
// else write as usual
|
1305
1025
|
b.mWeights = [];
|
1306
1026
|
ReadArray_aiVertexWeight(stream, b.mWeights, b.mNumWeights);
|
1307
1027
|
}
|
1308
|
-
|
1309
1028
|
return b;
|
1310
1029
|
}
|
1311
|
-
|
1312
1030
|
function ReadBinaryMesh(stream, mesh) {
|
1313
1031
|
var chunkID = Read_uint32_t(stream);
|
1314
1032
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMESH);
|
1315
|
-
/*uint32_t size =*/
|
1316
|
-
|
1317
1033
|
Read_uint32_t(stream);
|
1318
1034
|
mesh.mPrimitiveTypes = Read_unsigned_int(stream);
|
1319
1035
|
mesh.mNumVertices = Read_unsigned_int(stream);
|
1320
1036
|
mesh.mNumFaces = Read_unsigned_int(stream);
|
1321
1037
|
mesh.mNumBones = Read_unsigned_int(stream);
|
1322
1038
|
mesh.mMaterialIndex = Read_unsigned_int(stream);
|
1323
|
-
mesh.mNumUVComponents = [];
|
1324
|
-
|
1039
|
+
mesh.mNumUVComponents = [];
|
1325
1040
|
var c = Read_unsigned_int(stream);
|
1326
|
-
|
1327
1041
|
if (c & ASSBIN_MESH_HAS_POSITIONS) {
|
1328
1042
|
if (shortened) {
|
1329
1043
|
ReadBounds(stream, mesh.mVertices, mesh.mNumVertices);
|
1330
1044
|
} else {
|
1331
|
-
// else write as usual
|
1332
1045
|
mesh.mVertices = [];
|
1333
1046
|
mesh.mVertexBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
|
1334
1047
|
stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
|
1335
1048
|
}
|
1336
1049
|
}
|
1337
|
-
|
1338
1050
|
if (c & ASSBIN_MESH_HAS_NORMALS) {
|
1339
1051
|
if (shortened) {
|
1340
1052
|
ReadBounds(stream, mesh.mNormals, mesh.mNumVertices);
|
1341
1053
|
} else {
|
1342
|
-
// else write as usual
|
1343
1054
|
mesh.mNormals = [];
|
1344
1055
|
mesh.mNormalBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
|
1345
1056
|
stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
|
1346
1057
|
}
|
1347
1058
|
}
|
1348
|
-
|
1349
1059
|
if (c & ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS) {
|
1350
1060
|
if (shortened) {
|
1351
1061
|
ReadBounds(stream, mesh.mTangents, mesh.mNumVertices);
|
1352
1062
|
ReadBounds(stream, mesh.mBitangents, mesh.mNumVertices);
|
1353
1063
|
} else {
|
1354
|
-
// else write as usual
|
1355
1064
|
mesh.mTangents = [];
|
1356
1065
|
mesh.mTangentBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 3 * 4);
|
1357
1066
|
stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
|
@@ -1360,61 +1069,43 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1360
1069
|
stream.Seek(mesh.mNumVertices * 3 * 4, aiOrigin_CUR);
|
1361
1070
|
}
|
1362
1071
|
}
|
1363
|
-
|
1364
1072
|
for (let n = 0; n < AI_MAX_NUMBER_OF_COLOR_SETS; ++n) {
|
1365
|
-
if (!(c & ASSBIN_MESH_HAS_COLOR(n)))
|
1366
|
-
|
1073
|
+
if (!(c & ASSBIN_MESH_HAS_COLOR(n)))
|
1074
|
+
break;
|
1367
1075
|
if (shortened) {
|
1368
1076
|
ReadBounds(stream, mesh.mColors[n], mesh.mNumVertices);
|
1369
1077
|
} else {
|
1370
|
-
// else write as usual
|
1371
1078
|
mesh.mColors[n] = [];
|
1372
1079
|
mesh.mColorBuffer = stream.subArray32(stream.readOffset, stream.readOffset + mesh.mNumVertices * 4 * 4);
|
1373
1080
|
stream.Seek(mesh.mNumVertices * 4 * 4, aiOrigin_CUR);
|
1374
1081
|
}
|
1375
1082
|
}
|
1376
|
-
|
1377
1083
|
mesh.mTexCoordsBuffers = [];
|
1378
|
-
|
1379
1084
|
for (let n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++n) {
|
1380
|
-
if (!(c & ASSBIN_MESH_HAS_TEXCOORD(n)))
|
1381
|
-
|
1085
|
+
if (!(c & ASSBIN_MESH_HAS_TEXCOORD(n)))
|
1086
|
+
break;
|
1382
1087
|
mesh.mNumUVComponents[n] = Read_unsigned_int(stream);
|
1383
|
-
|
1384
1088
|
if (shortened) {
|
1385
1089
|
ReadBounds(stream, mesh.mTextureCoords[n], mesh.mNumVertices);
|
1386
1090
|
} else {
|
1387
|
-
|
1388
|
-
mesh.mTextureCoords[n] = []; //note that assbin always writes 3d texcoords
|
1389
|
-
|
1091
|
+
mesh.mTextureCoords[n] = [];
|
1390
1092
|
mesh.mTexCoordsBuffers[n] = [];
|
1391
|
-
|
1392
1093
|
for (let uv = 0; uv < mesh.mNumVertices; uv++) {
|
1393
1094
|
mesh.mTexCoordsBuffers[n].push(readFloat(stream));
|
1394
1095
|
mesh.mTexCoordsBuffers[n].push(readFloat(stream));
|
1395
1096
|
readFloat(stream);
|
1396
1097
|
}
|
1397
1098
|
}
|
1398
|
-
}
|
1399
|
-
// in these, so we can write a simple hash over the face data
|
1400
|
-
// to the dump file. We generate a single 32 Bit hash for 512 faces
|
1401
|
-
// using Assimp's standard hashing function.
|
1402
|
-
|
1403
|
-
|
1099
|
+
}
|
1404
1100
|
if (shortened) {
|
1405
1101
|
Read_unsigned_int(stream);
|
1406
1102
|
} else {
|
1407
|
-
// else write as usual
|
1408
|
-
// if there are less than 2^16 vertices, we can simply use 16 bit integers ...
|
1409
1103
|
mesh.mFaces = [];
|
1410
1104
|
mesh.mIndexArray = [];
|
1411
|
-
|
1412
1105
|
for (let i = 0; i < mesh.mNumFaces; ++i) {
|
1413
|
-
var f = mesh.mFaces[i] = new aiFace();
|
1414
|
-
|
1106
|
+
var f = mesh.mFaces[i] = new aiFace();
|
1415
1107
|
f.mNumIndices = Read_uint16_t(stream);
|
1416
1108
|
f.mIndices = [];
|
1417
|
-
|
1418
1109
|
for (let a = 0; a < f.mNumIndices; ++a) {
|
1419
1110
|
if (mesh.mNumVertices < 1 << 16) {
|
1420
1111
|
f.mIndices[a] = Read_uint16_t(stream);
|
@@ -1422,7 +1113,6 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1422
1113
|
f.mIndices[a] = Read_unsigned_int(stream);
|
1423
1114
|
}
|
1424
1115
|
}
|
1425
|
-
|
1426
1116
|
if (f.mNumIndices === 3) {
|
1427
1117
|
mesh.mIndexArray.push(f.mIndices[0]);
|
1428
1118
|
mesh.mIndexArray.push(f.mIndices[1]);
|
@@ -1438,24 +1128,18 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1438
1128
|
throw new Error("Sorry, can't currently triangulate polys. Use the triangulate preprocessor in Assimp.");
|
1439
1129
|
}
|
1440
1130
|
}
|
1441
|
-
}
|
1442
|
-
|
1443
|
-
|
1131
|
+
}
|
1444
1132
|
if (mesh.mNumBones) {
|
1445
1133
|
mesh.mBones = [];
|
1446
|
-
|
1447
1134
|
for (let a = 0; a < mesh.mNumBones; ++a) {
|
1448
1135
|
mesh.mBones[a] = new aiBone();
|
1449
1136
|
ReadBinaryBone(stream, mesh.mBones[a]);
|
1450
1137
|
}
|
1451
1138
|
}
|
1452
1139
|
}
|
1453
|
-
|
1454
1140
|
function ReadBinaryMaterialProperty(stream, prop) {
|
1455
1141
|
var chunkID = Read_uint32_t(stream);
|
1456
1142
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIALPROPERTY);
|
1457
|
-
/*uint32_t size =*/
|
1458
|
-
|
1459
1143
|
Read_uint32_t(stream);
|
1460
1144
|
prop.mKey = Read_aiString(stream);
|
1461
1145
|
prop.mSemantic = Read_unsigned_int(stream);
|
@@ -1464,36 +1148,26 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1464
1148
|
prop.mType = Read_unsigned_int(stream);
|
1465
1149
|
prop.mData = [];
|
1466
1150
|
stream.ReadBytes(prop.mData, 1, prop.mDataLength);
|
1467
|
-
}
|
1468
|
-
|
1469
|
-
|
1151
|
+
}
|
1470
1152
|
function ReadBinaryMaterial(stream, mat) {
|
1471
1153
|
var chunkID = Read_uint32_t(stream);
|
1472
1154
|
ai_assert(chunkID == ASSBIN_CHUNK_AIMATERIAL);
|
1473
|
-
/*uint32_t size =*/
|
1474
|
-
|
1475
1155
|
Read_uint32_t(stream);
|
1476
1156
|
mat.mNumAllocated = mat.mNumProperties = Read_unsigned_int(stream);
|
1477
|
-
|
1478
1157
|
if (mat.mNumProperties) {
|
1479
1158
|
if (mat.mProperties) {
|
1480
1159
|
delete mat.mProperties;
|
1481
1160
|
}
|
1482
|
-
|
1483
1161
|
mat.mProperties = [];
|
1484
|
-
|
1485
1162
|
for (let i = 0; i < mat.mNumProperties; ++i) {
|
1486
1163
|
mat.mProperties[i] = new aiMaterialProperty();
|
1487
1164
|
ReadBinaryMaterialProperty(stream, mat.mProperties[i]);
|
1488
1165
|
}
|
1489
1166
|
}
|
1490
1167
|
}
|
1491
|
-
|
1492
1168
|
function ReadBinaryNodeAnim(stream, nd) {
|
1493
1169
|
var chunkID = Read_uint32_t(stream);
|
1494
1170
|
ai_assert(chunkID == ASSBIN_CHUNK_AINODEANIM);
|
1495
|
-
/*uint32_t size =*/
|
1496
|
-
|
1497
1171
|
Read_uint32_t(stream);
|
1498
1172
|
nd.mNodeName = Read_aiString(stream);
|
1499
1173
|
nd.mNumPositionKeys = Read_unsigned_int(stream);
|
@@ -1501,69 +1175,54 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1501
1175
|
nd.mNumScalingKeys = Read_unsigned_int(stream);
|
1502
1176
|
nd.mPreState = Read_unsigned_int(stream);
|
1503
1177
|
nd.mPostState = Read_unsigned_int(stream);
|
1504
|
-
|
1505
1178
|
if (nd.mNumPositionKeys) {
|
1506
1179
|
if (shortened) {
|
1507
1180
|
ReadBounds(stream, nd.mPositionKeys, nd.mNumPositionKeys);
|
1508
1181
|
} else {
|
1509
|
-
// else write as usual
|
1510
1182
|
nd.mPositionKeys = [];
|
1511
1183
|
ReadArray_aiVectorKey(stream, nd.mPositionKeys, nd.mNumPositionKeys);
|
1512
1184
|
}
|
1513
1185
|
}
|
1514
|
-
|
1515
1186
|
if (nd.mNumRotationKeys) {
|
1516
1187
|
if (shortened) {
|
1517
1188
|
ReadBounds(stream, nd.mRotationKeys, nd.mNumRotationKeys);
|
1518
1189
|
} else {
|
1519
|
-
// else write as usual
|
1520
1190
|
nd.mRotationKeys = [];
|
1521
1191
|
ReadArray_aiQuatKey(stream, nd.mRotationKeys, nd.mNumRotationKeys);
|
1522
1192
|
}
|
1523
1193
|
}
|
1524
|
-
|
1525
1194
|
if (nd.mNumScalingKeys) {
|
1526
1195
|
if (shortened) {
|
1527
1196
|
ReadBounds(stream, nd.mScalingKeys, nd.mNumScalingKeys);
|
1528
1197
|
} else {
|
1529
|
-
// else write as usual
|
1530
1198
|
nd.mScalingKeys = [];
|
1531
1199
|
ReadArray_aiVectorKey(stream, nd.mScalingKeys, nd.mNumScalingKeys);
|
1532
1200
|
}
|
1533
1201
|
}
|
1534
1202
|
}
|
1535
|
-
|
1536
1203
|
function ReadBinaryAnim(stream, anim) {
|
1537
1204
|
var chunkID = Read_uint32_t(stream);
|
1538
1205
|
ai_assert(chunkID == ASSBIN_CHUNK_AIANIMATION);
|
1539
|
-
/*uint32_t size =*/
|
1540
|
-
|
1541
1206
|
Read_uint32_t(stream);
|
1542
1207
|
anim.mName = Read_aiString(stream);
|
1543
1208
|
anim.mDuration = Read_double(stream);
|
1544
1209
|
anim.mTicksPerSecond = Read_double(stream);
|
1545
1210
|
anim.mNumChannels = Read_unsigned_int(stream);
|
1546
|
-
|
1547
1211
|
if (anim.mNumChannels) {
|
1548
1212
|
anim.mChannels = [];
|
1549
|
-
|
1550
1213
|
for (let a = 0; a < anim.mNumChannels; ++a) {
|
1551
1214
|
anim.mChannels[a] = new aiNodeAnim();
|
1552
1215
|
ReadBinaryNodeAnim(stream, anim.mChannels[a]);
|
1553
1216
|
}
|
1554
1217
|
}
|
1555
1218
|
}
|
1556
|
-
|
1557
1219
|
function ReadBinaryTexture(stream, tex) {
|
1558
1220
|
var chunkID = Read_uint32_t(stream);
|
1559
1221
|
ai_assert(chunkID == ASSBIN_CHUNK_AITEXTURE);
|
1560
|
-
/*uint32_t size =*/
|
1561
|
-
|
1562
1222
|
Read_uint32_t(stream);
|
1563
1223
|
tex.mWidth = Read_unsigned_int(stream);
|
1564
1224
|
tex.mHeight = Read_unsigned_int(stream);
|
1565
1225
|
stream.ReadBytes(tex.achFormatHint, 1, 4);
|
1566
|
-
|
1567
1226
|
if (!shortened) {
|
1568
1227
|
if (!tex.mHeight) {
|
1569
1228
|
tex.pcData = [];
|
@@ -1574,37 +1233,28 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1574
1233
|
}
|
1575
1234
|
}
|
1576
1235
|
}
|
1577
|
-
|
1578
1236
|
function ReadBinaryLight(stream, l) {
|
1579
1237
|
var chunkID = Read_uint32_t(stream);
|
1580
1238
|
ai_assert(chunkID == ASSBIN_CHUNK_AILIGHT);
|
1581
|
-
/*uint32_t size =*/
|
1582
|
-
|
1583
1239
|
Read_uint32_t(stream);
|
1584
1240
|
l.mName = Read_aiString(stream);
|
1585
1241
|
l.mType = Read_unsigned_int(stream);
|
1586
|
-
|
1587
1242
|
if (l.mType != aiLightSource_DIRECTIONAL) {
|
1588
1243
|
l.mAttenuationConstant = readFloat(stream);
|
1589
1244
|
l.mAttenuationLinear = readFloat(stream);
|
1590
1245
|
l.mAttenuationQuadratic = readFloat(stream);
|
1591
1246
|
}
|
1592
|
-
|
1593
1247
|
l.mColorDiffuse = Read_aiColor3D(stream);
|
1594
1248
|
l.mColorSpecular = Read_aiColor3D(stream);
|
1595
1249
|
l.mColorAmbient = Read_aiColor3D(stream);
|
1596
|
-
|
1597
1250
|
if (l.mType == aiLightSource_SPOT) {
|
1598
1251
|
l.mAngleInnerCone = readFloat(stream);
|
1599
1252
|
l.mAngleOuterCone = readFloat(stream);
|
1600
1253
|
}
|
1601
1254
|
}
|
1602
|
-
|
1603
1255
|
function ReadBinaryCamera(stream, cam) {
|
1604
1256
|
var chunkID = Read_uint32_t(stream);
|
1605
1257
|
ai_assert(chunkID == ASSBIN_CHUNK_AICAMERA);
|
1606
|
-
/*uint32_t size =*/
|
1607
|
-
|
1608
1258
|
Read_uint32_t(stream);
|
1609
1259
|
cam.mName = Read_aiString(stream);
|
1610
1260
|
cam.mPosition = Read_aiVector3D(stream);
|
@@ -1615,12 +1265,9 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1615
1265
|
cam.mClipPlaneFar = readFloat(stream);
|
1616
1266
|
cam.mAspect = readFloat(stream);
|
1617
1267
|
}
|
1618
|
-
|
1619
1268
|
function ReadBinaryScene(stream, scene) {
|
1620
1269
|
var chunkID = Read_uint32_t(stream);
|
1621
1270
|
ai_assert(chunkID == ASSBIN_CHUNK_AISCENE);
|
1622
|
-
/*uint32_t size =*/
|
1623
|
-
|
1624
1271
|
Read_uint32_t(stream);
|
1625
1272
|
scene.mFlags = Read_unsigned_int(stream);
|
1626
1273
|
scene.mNumMeshes = Read_unsigned_int(stream);
|
@@ -1628,166 +1275,122 @@ AssimpLoader.prototype = Object.assign(Object.create(Loader.prototype), {
|
|
1628
1275
|
scene.mNumAnimations = Read_unsigned_int(stream);
|
1629
1276
|
scene.mNumTextures = Read_unsigned_int(stream);
|
1630
1277
|
scene.mNumLights = Read_unsigned_int(stream);
|
1631
|
-
scene.mNumCameras = Read_unsigned_int(stream);
|
1632
|
-
|
1278
|
+
scene.mNumCameras = Read_unsigned_int(stream);
|
1633
1279
|
scene.mRootNode = new aiNode();
|
1634
|
-
scene.mRootNode = ReadBinaryNode(stream, null, 0);
|
1635
|
-
|
1280
|
+
scene.mRootNode = ReadBinaryNode(stream, null, 0);
|
1636
1281
|
if (scene.mNumMeshes) {
|
1637
1282
|
scene.mMeshes = [];
|
1638
|
-
|
1639
1283
|
for (let i = 0; i < scene.mNumMeshes; ++i) {
|
1640
1284
|
scene.mMeshes[i] = new aiMesh();
|
1641
1285
|
ReadBinaryMesh(stream, scene.mMeshes[i]);
|
1642
1286
|
}
|
1643
|
-
}
|
1644
|
-
|
1645
|
-
|
1287
|
+
}
|
1646
1288
|
if (scene.mNumMaterials) {
|
1647
1289
|
scene.mMaterials = [];
|
1648
|
-
|
1649
1290
|
for (let i = 0; i < scene.mNumMaterials; ++i) {
|
1650
1291
|
scene.mMaterials[i] = new aiMaterial();
|
1651
1292
|
ReadBinaryMaterial(stream, scene.mMaterials[i]);
|
1652
1293
|
}
|
1653
|
-
}
|
1654
|
-
|
1655
|
-
|
1294
|
+
}
|
1656
1295
|
if (scene.mNumAnimations) {
|
1657
1296
|
scene.mAnimations = [];
|
1658
|
-
|
1659
1297
|
for (let i = 0; i < scene.mNumAnimations; ++i) {
|
1660
1298
|
scene.mAnimations[i] = new aiAnimation();
|
1661
1299
|
ReadBinaryAnim(stream, scene.mAnimations[i]);
|
1662
1300
|
}
|
1663
|
-
}
|
1664
|
-
|
1665
|
-
|
1301
|
+
}
|
1666
1302
|
if (scene.mNumTextures) {
|
1667
1303
|
scene.mTextures = [];
|
1668
|
-
|
1669
1304
|
for (let i = 0; i < scene.mNumTextures; ++i) {
|
1670
1305
|
scene.mTextures[i] = new aiTexture();
|
1671
1306
|
ReadBinaryTexture(stream, scene.mTextures[i]);
|
1672
1307
|
}
|
1673
|
-
}
|
1674
|
-
|
1675
|
-
|
1308
|
+
}
|
1676
1309
|
if (scene.mNumLights) {
|
1677
1310
|
scene.mLights = [];
|
1678
|
-
|
1679
1311
|
for (let i = 0; i < scene.mNumLights; ++i) {
|
1680
1312
|
scene.mLights[i] = new aiLight();
|
1681
1313
|
ReadBinaryLight(stream, scene.mLights[i]);
|
1682
1314
|
}
|
1683
|
-
}
|
1684
|
-
|
1685
|
-
|
1315
|
+
}
|
1686
1316
|
if (scene.mNumCameras) {
|
1687
1317
|
scene.mCameras = [];
|
1688
|
-
|
1689
1318
|
for (let i = 0; i < scene.mNumCameras; ++i) {
|
1690
1319
|
scene.mCameras[i] = new aiCamera();
|
1691
1320
|
ReadBinaryCamera(stream, scene.mCameras[i]);
|
1692
1321
|
}
|
1693
1322
|
}
|
1694
1323
|
}
|
1695
|
-
|
1696
1324
|
var aiOrigin_CUR = 0;
|
1697
1325
|
var aiOrigin_BEG = 1;
|
1698
|
-
|
1699
1326
|
function extendStream(stream) {
|
1700
1327
|
stream.readOffset = 0;
|
1701
|
-
|
1702
|
-
stream.Seek = function (off, ori) {
|
1328
|
+
stream.Seek = function(off, ori) {
|
1703
1329
|
if (ori == aiOrigin_CUR) {
|
1704
1330
|
stream.readOffset += off;
|
1705
1331
|
}
|
1706
|
-
|
1707
1332
|
if (ori == aiOrigin_BEG) {
|
1708
1333
|
stream.readOffset = off;
|
1709
1334
|
}
|
1710
1335
|
};
|
1711
|
-
|
1712
|
-
stream.ReadBytes = function (buff, size, n) {
|
1336
|
+
stream.ReadBytes = function(buff, size, n) {
|
1713
1337
|
var bytes = size * n;
|
1714
|
-
|
1715
|
-
|
1338
|
+
for (let i = 0; i < bytes; i++)
|
1339
|
+
buff[i] = Read_uint8_t(this);
|
1716
1340
|
};
|
1717
|
-
|
1718
|
-
stream.subArray32 = function (start, end) {
|
1341
|
+
stream.subArray32 = function(start, end) {
|
1719
1342
|
var buff = this.buffer;
|
1720
1343
|
var newbuff = buff.slice(start, end);
|
1721
1344
|
return new Float32Array(newbuff);
|
1722
1345
|
};
|
1723
|
-
|
1724
|
-
stream.subArrayUint16 = function (start, end) {
|
1346
|
+
stream.subArrayUint16 = function(start, end) {
|
1725
1347
|
var buff = this.buffer;
|
1726
1348
|
var newbuff = buff.slice(start, end);
|
1727
1349
|
return new Uint16Array(newbuff);
|
1728
1350
|
};
|
1729
|
-
|
1730
|
-
stream.subArrayUint8 = function (start, end) {
|
1351
|
+
stream.subArrayUint8 = function(start, end) {
|
1731
1352
|
var buff = this.buffer;
|
1732
1353
|
var newbuff = buff.slice(start, end);
|
1733
1354
|
return new Uint8Array(newbuff);
|
1734
1355
|
};
|
1735
|
-
|
1736
|
-
stream.subArrayUint32 = function (start, end) {
|
1356
|
+
stream.subArrayUint32 = function(start, end) {
|
1737
1357
|
var buff = this.buffer;
|
1738
1358
|
var newbuff = buff.slice(start, end);
|
1739
1359
|
return new Uint32Array(newbuff);
|
1740
1360
|
};
|
1741
1361
|
}
|
1742
|
-
|
1743
1362
|
var shortened, compressed;
|
1744
|
-
|
1745
1363
|
function InternReadFile(pFiledata) {
|
1746
1364
|
var pScene = new aiScene();
|
1747
1365
|
var stream = new DataView(pFiledata);
|
1748
1366
|
extendStream(stream);
|
1749
|
-
stream.Seek(44, aiOrigin_CUR);
|
1750
|
-
|
1751
|
-
/*unsigned int versionMajor =*/
|
1752
|
-
|
1367
|
+
stream.Seek(44, aiOrigin_CUR);
|
1753
1368
|
pScene.versionMajor = Read_unsigned_int(stream);
|
1754
|
-
/*unsigned int versionMinor =*/
|
1755
|
-
|
1756
1369
|
pScene.versionMinor = Read_unsigned_int(stream);
|
1757
|
-
/*unsigned int versionRevision =*/
|
1758
|
-
|
1759
1370
|
pScene.versionRevision = Read_unsigned_int(stream);
|
1760
|
-
/*unsigned int compileFlags =*/
|
1761
|
-
|
1762
1371
|
pScene.compileFlags = Read_unsigned_int(stream);
|
1763
1372
|
shortened = Read_uint16_t(stream) > 0;
|
1764
1373
|
compressed = Read_uint16_t(stream) > 0;
|
1765
|
-
if (shortened)
|
1766
|
-
|
1767
|
-
|
1768
|
-
stream.Seek(128, aiOrigin_CUR);
|
1769
|
-
|
1770
|
-
stream.Seek(64, aiOrigin_CUR); // padding
|
1771
|
-
|
1374
|
+
if (shortened)
|
1375
|
+
throw "Shortened binaries are not supported!";
|
1376
|
+
stream.Seek(256, aiOrigin_CUR);
|
1377
|
+
stream.Seek(128, aiOrigin_CUR);
|
1378
|
+
stream.Seek(64, aiOrigin_CUR);
|
1772
1379
|
if (compressed) {
|
1773
1380
|
var uncompressedSize = Read_uint32_t(stream);
|
1774
1381
|
var compressedSize = stream.FileSize() - stream.Tell();
|
1775
1382
|
var compressedData = [];
|
1776
1383
|
stream.Read(compressedData, 1, compressedSize);
|
1777
1384
|
var uncompressedData = [];
|
1778
|
-
uncompress(uncompressedData, uncompressedSize, compressedData, compressedSize);
|
1779
|
-
|
1385
|
+
uncompress(uncompressedData, uncompressedSize, compressedData, compressedSize);
|
1780
1386
|
var buff = new ArrayBuffer(uncompressedData);
|
1781
1387
|
ReadBinaryScene(buff, pScene);
|
1782
1388
|
} else {
|
1783
1389
|
ReadBinaryScene(stream, pScene);
|
1784
1390
|
}
|
1785
|
-
|
1786
1391
|
return pScene.toTHREE();
|
1787
1392
|
}
|
1788
|
-
|
1789
1393
|
return InternReadFile(buffer);
|
1790
1394
|
}
|
1791
1395
|
});
|
1792
|
-
|
1793
|
-
export { AssimpLoader };
|
1396
|
+
exports.AssimpLoader = AssimpLoader;
|