opal-js_wrap-three 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -4
- data/lib/opal/js_wrap/three/version.rb +1 -1
- data/lib-opal/js_wrap/three/WebGL.js +102 -0
- data/lib-opal/js_wrap/three/animation/AnimationClipCreator.js +116 -0
- data/lib-opal/js_wrap/three/animation/CCDIKSolver.js +436 -0
- data/lib-opal/js_wrap/three/animation/MMDAnimationHelper.js +941 -0
- data/lib-opal/js_wrap/three/animation/MMDPhysics.js +1183 -0
- data/lib-opal/js_wrap/three/cameras/CinematicCamera.js +204 -0
- data/lib-opal/js_wrap/three/controls/ArcballControls.js +2649 -0
- data/lib-opal/js_wrap/three/controls/DragControls.js +234 -0
- data/lib-opal/js_wrap/three/controls/FirstPersonControls.js +301 -0
- data/lib-opal/js_wrap/three/controls/FlyControls.js +357 -0
- data/lib-opal/js_wrap/three/controls/OrbitControls.js +908 -0
- data/lib-opal/js_wrap/three/controls/PointerLockControls.js +173 -0
- data/lib-opal/js_wrap/three/controls/TrackballControls.js +666 -0
- data/lib-opal/js_wrap/three/controls/TransformControls.js +1210 -0
- data/lib-opal/js_wrap/three/controls/experimental/CameraControls.js +860 -0
- data/lib-opal/js_wrap/three/csm/CSM.js +346 -0
- data/lib-opal/js_wrap/three/csm/CSMFrustum.js +123 -0
- data/lib-opal/js_wrap/three/csm/CSMHelper.js +197 -0
- data/lib-opal/js_wrap/three/csm/CSMShader.js +29 -0
- data/lib-opal/js_wrap/three/curves/CurveExtras.js +544 -0
- data/lib-opal/js_wrap/three/curves/NURBSCurve.js +122 -0
- data/lib-opal/js_wrap/three/curves/NURBSSurface.js +78 -0
- data/lib-opal/js_wrap/three/curves/NURBSUtils.js +413 -0
- data/lib-opal/js_wrap/three/deprecated/Geometry.js +1373 -0
- data/lib-opal/js_wrap/three/effects/AnaglyphEffect.js +113 -0
- data/lib-opal/js_wrap/three/effects/AsciiEffect.js +267 -0
- data/lib-opal/js_wrap/three/effects/OutlineEffect.js +400 -0
- data/lib-opal/js_wrap/three/effects/ParallaxBarrierEffect.js +90 -0
- data/lib-opal/js_wrap/three/effects/PeppersGhostEffect.js +160 -0
- data/lib-opal/js_wrap/three/effects/StereoEffect.js +63 -0
- data/lib-opal/js_wrap/three/environments/DebugEnvironment.js +107 -0
- data/lib-opal/js_wrap/three/environments/RoomEnvironment.js +166 -0
- data/lib-opal/js_wrap/three/exporters/ColladaExporter.js +442 -0
- data/lib-opal/js_wrap/three/exporters/DRACOExporter.js +205 -0
- data/lib-opal/js_wrap/three/exporters/GLTFExporter.js +2042 -0
- data/lib-opal/js_wrap/three/exporters/MMDExporter.js +189 -0
- data/lib-opal/js_wrap/three/exporters/OBJExporter.js +241 -0
- data/lib-opal/js_wrap/three/exporters/PLYExporter.js +370 -0
- data/lib-opal/js_wrap/three/exporters/STLExporter.js +186 -0
- data/lib-opal/js_wrap/three/exporters/USDZExporter.js +402 -0
- data/lib-opal/js_wrap/three/geometries/BoxLineGeometry.js +106 -0
- data/lib-opal/js_wrap/three/geometries/ConvexGeometry.js +88 -0
- data/lib-opal/js_wrap/three/geometries/DecalGeometry.js +302 -0
- data/lib-opal/js_wrap/three/geometries/LightningStrike.js +817 -0
- data/lib-opal/js_wrap/three/geometries/ParametricGeometries.js +280 -0
- data/lib-opal/js_wrap/three/geometries/ParametricGeometry.js +146 -0
- data/lib-opal/js_wrap/three/geometries/RoundedBoxGeometry.js +183 -0
- data/lib-opal/js_wrap/three/geometries/TeapotGeometry.js +352 -0
- data/lib-opal/js_wrap/three/geometries/TextGeometry.js +76 -0
- data/lib-opal/js_wrap/three/helpers/LightProbeHelper.js +95 -0
- data/lib-opal/js_wrap/three/helpers/PositionalAudioHelper.js +138 -0
- data/lib-opal/js_wrap/three/helpers/RectAreaLightHelper.js +115 -0
- data/lib-opal/js_wrap/three/helpers/VertexNormalsHelper.js +131 -0
- data/lib-opal/js_wrap/three/helpers/VertexTangentsHelper.js +118 -0
- data/lib-opal/js_wrap/three/interactive/HTMLMesh.js +307 -0
- data/lib-opal/js_wrap/three/interactive/InteractiveGroup.js +138 -0
- data/lib-opal/js_wrap/three/interactive/SelectionBox.js +264 -0
- data/lib-opal/js_wrap/three/interactive/SelectionHelper.js +88 -0
- data/lib-opal/js_wrap/three/libs/OimoPhysics/OimoPhysics.js +46059 -0
- data/lib-opal/js_wrap/three/libs/OimoPhysics/index.js +92 -0
- data/lib-opal/js_wrap/three/libs/chevrotain.module.min.js +6947 -0
- data/lib-opal/js_wrap/three/libs/ecsy.module.js +1999 -0
- data/lib-opal/js_wrap/three/libs/fflate.module.js +3002 -0
- data/lib-opal/js_wrap/three/libs/flow.module.js +3033 -0
- data/lib-opal/js_wrap/three/libs/ktx-parse.module.js +392 -0
- data/lib-opal/js_wrap/three/libs/lil-gui.module.min.js +821 -0
- data/lib-opal/js_wrap/three/libs/meshopt_decoder.module.js +136 -0
- data/lib-opal/js_wrap/three/libs/mmdparser.module.js +11022 -0
- data/lib-opal/js_wrap/three/libs/motion-controllers.module.js +589 -0
- data/lib-opal/js_wrap/three/libs/opentype.module.min.js +6132 -0
- data/lib-opal/js_wrap/three/libs/potpack.module.js +171 -0
- data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.js +6781 -0
- data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.module.js +6783 -0
- data/lib-opal/js_wrap/three/libs/stats.module.js +139 -0
- data/lib-opal/js_wrap/three/libs/tween.module.min.js +349 -0
- data/lib-opal/js_wrap/three/lights/LightProbeGenerator.js +233 -0
- data/lib-opal/js_wrap/three/lights/RectAreaLightUniformsLib.js +75 -0
- data/lib-opal/js_wrap/three/lines/Line2.js +66 -0
- data/lib-opal/js_wrap/three/lines/LineGeometry.js +122 -0
- data/lib-opal/js_wrap/three/lines/LineMaterial.js +227 -0
- data/lib-opal/js_wrap/three/lines/LineSegments2.js +312 -0
- data/lib-opal/js_wrap/three/lines/LineSegmentsGeometry.js +238 -0
- data/lib-opal/js_wrap/three/lines/Wireframe.js +98 -0
- data/lib-opal/js_wrap/three/lines/WireframeGeometry2.js +65 -0
- data/lib-opal/js_wrap/three/loaders/3DMLoader.js +1230 -0
- data/lib-opal/js_wrap/three/loaders/3MFLoader.js +1123 -0
- data/lib-opal/js_wrap/three/loaders/AMFLoader.js +445 -0
- data/lib-opal/js_wrap/three/loaders/BVHLoader.js +365 -0
- data/lib-opal/js_wrap/three/loaders/BasisTextureLoader.js +692 -0
- data/lib-opal/js_wrap/three/loaders/ColladaLoader.js +3046 -0
- data/lib-opal/js_wrap/three/loaders/DDSLoader.js +264 -0
- data/lib-opal/js_wrap/three/loaders/DRACOLoader.js +531 -0
- data/lib-opal/js_wrap/three/loaders/EXRLoader.js +1834 -0
- data/lib-opal/js_wrap/three/loaders/FBXLoader.js +3125 -0
- data/lib-opal/js_wrap/three/loaders/FontLoader.js +201 -0
- data/lib-opal/js_wrap/three/loaders/GCodeLoader.js +248 -0
- data/lib-opal/js_wrap/three/loaders/GLTFLoader.js +3334 -0
- data/lib-opal/js_wrap/three/loaders/HDRCubeTextureLoader.js +144 -0
- data/lib-opal/js_wrap/three/loaders/IFCLoader.js +2395 -0
- data/lib-opal/js_wrap/three/loaders/KMZLoader.js +142 -0
- data/lib-opal/js_wrap/three/loaders/KTX2Loader.js +535 -0
- data/lib-opal/js_wrap/three/loaders/KTXLoader.js +202 -0
- data/lib-opal/js_wrap/three/loaders/LDrawLoader.js +1737 -0
- data/lib-opal/js_wrap/three/loaders/LUT3dlLoader.js +163 -0
- data/lib-opal/js_wrap/three/loaders/LUTCubeLoader.js +171 -0
- data/lib-opal/js_wrap/three/loaders/LWOLoader.js +831 -0
- data/lib-opal/js_wrap/three/loaders/LogLuvLoader.js +713 -0
- data/lib-opal/js_wrap/three/loaders/LottieLoader.js +103 -0
- data/lib-opal/js_wrap/three/loaders/MD2Loader.js +258 -0
- data/lib-opal/js_wrap/three/loaders/MDDLoader.js +116 -0
- data/lib-opal/js_wrap/three/loaders/MMDLoader.js +1687 -0
- data/lib-opal/js_wrap/three/loaders/MTLLoader.js +465 -0
- data/lib-opal/js_wrap/three/loaders/NRRDLoader.js +554 -0
- data/lib-opal/js_wrap/three/loaders/NodeMaterialLoader.js +248 -0
- data/lib-opal/js_wrap/three/loaders/OBJLoader.js +673 -0
- data/lib-opal/js_wrap/three/loaders/PCDLoader.js +322 -0
- data/lib-opal/js_wrap/three/loaders/PDBLoader.js +318 -0
- data/lib-opal/js_wrap/three/loaders/PLYLoader.js +489 -0
- data/lib-opal/js_wrap/three/loaders/PRWMLoader.js +247 -0
- data/lib-opal/js_wrap/three/loaders/PVRLoader.js +240 -0
- data/lib-opal/js_wrap/three/loaders/RGBELoader.js +462 -0
- data/lib-opal/js_wrap/three/loaders/RGBMLoader.js +1169 -0
- data/lib-opal/js_wrap/three/loaders/STLLoader.js +345 -0
- data/lib-opal/js_wrap/three/loaders/SVGLoader.js +2162 -0
- data/lib-opal/js_wrap/three/loaders/TDSLoader.js +982 -0
- data/lib-opal/js_wrap/three/loaders/TGALoader.js +444 -0
- data/lib-opal/js_wrap/three/loaders/TTFLoader.js +210 -0
- data/lib-opal/js_wrap/three/loaders/TiltLoader.js +391 -0
- data/lib-opal/js_wrap/three/loaders/VOXLoader.js +272 -0
- data/lib-opal/js_wrap/three/loaders/VRMLLoader.js +2685 -0
- data/lib-opal/js_wrap/three/loaders/VRMLoader.js +103 -0
- data/lib-opal/js_wrap/three/loaders/VTKLoader.js +894 -0
- data/lib-opal/js_wrap/three/loaders/XYZLoader.js +136 -0
- data/lib-opal/js_wrap/three/loaders/ifc/web-ifc-api.js +60504 -0
- data/lib-opal/js_wrap/three/loaders/lwo/IFFParser.js +931 -0
- data/lib-opal/js_wrap/three/loaders/lwo/LWO2Parser.js +450 -0
- data/lib-opal/js_wrap/three/loaders/lwo/LWO3Parser.js +406 -0
- data/lib-opal/js_wrap/three/math/Capsule.js +133 -0
- data/lib-opal/js_wrap/three/math/ColorConverter.js +104 -0
- data/lib-opal/js_wrap/three/math/ConvexHull.js +924 -0
- data/lib-opal/js_wrap/three/math/ImprovedNoise.js +86 -0
- data/lib-opal/js_wrap/three/math/Lut.js +170 -0
- data/lib-opal/js_wrap/three/math/MeshSurfaceSampler.js +187 -0
- data/lib-opal/js_wrap/three/math/OBB.js +345 -0
- data/lib-opal/js_wrap/three/math/Octree.js +409 -0
- data/lib-opal/js_wrap/three/math/SimplexNoise.js +425 -0
- data/lib-opal/js_wrap/three/misc/ConvexObjectBreaker.js +447 -0
- data/lib-opal/js_wrap/three/misc/GPUComputationRenderer.js +322 -0
- data/lib-opal/js_wrap/three/misc/Gyroscope.js +94 -0
- data/lib-opal/js_wrap/three/misc/MD2Character.js +225 -0
- data/lib-opal/js_wrap/three/misc/MD2CharacterComplex.js +424 -0
- data/lib-opal/js_wrap/three/misc/MorphAnimMesh.js +109 -0
- data/lib-opal/js_wrap/three/misc/MorphBlendMesh.js +283 -0
- data/lib-opal/js_wrap/three/misc/ProgressiveLightMap.js +324 -0
- data/lib-opal/js_wrap/three/misc/RollerCoaster.js +489 -0
- data/lib-opal/js_wrap/three/misc/TubePainter.js +158 -0
- data/lib-opal/js_wrap/three/misc/Volume.js +427 -0
- data/lib-opal/js_wrap/three/misc/VolumeSlice.js +210 -0
- data/lib-opal/js_wrap/three/modifiers/CurveModifier.js +291 -0
- data/lib-opal/js_wrap/three/modifiers/EdgeSplitModifier.js +308 -0
- data/lib-opal/js_wrap/three/modifiers/SimplifyModifier.js +435 -0
- data/lib-opal/js_wrap/three/modifiers/TessellateModifier.js +264 -0
- data/lib-opal/js_wrap/three/node-editor/NodeEditor.js +402 -0
- data/lib-opal/js_wrap/three/node-editor/accessors/NormalEditor.js +80 -0
- data/lib-opal/js_wrap/three/node-editor/accessors/PositionEditor.js +80 -0
- data/lib-opal/js_wrap/three/node-editor/accessors/UVEditor.js +71 -0
- data/lib-opal/js_wrap/three/node-editor/display/BlendEditor.js +78 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/ColorEditor.js +111 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/FloatEditor.js +69 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/SliderEditor.js +97 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/Vector2Editor.js +73 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/Vector3Editor.js +75 -0
- data/lib-opal/js_wrap/three/node-editor/inputs/Vector4Editor.js +77 -0
- data/lib-opal/js_wrap/three/node-editor/materials/StandardMaterialEditor.js +121 -0
- data/lib-opal/js_wrap/three/node-editor/math/DotEditor.js +76 -0
- data/lib-opal/js_wrap/three/node-editor/math/InvertEditor.js +80 -0
- data/lib-opal/js_wrap/three/node-editor/math/LimiterEditor.js +85 -0
- data/lib-opal/js_wrap/three/node-editor/math/NormalizeEditor.js +69 -0
- data/lib-opal/js_wrap/three/node-editor/math/OperatorEditor.js +91 -0
- data/lib-opal/js_wrap/three/node-editor/math/PowerEditor.js +73 -0
- data/lib-opal/js_wrap/three/node-editor/math/TrigonometryEditor.js +83 -0
- data/lib-opal/js_wrap/three/node-editor/procedural/CheckerEditor.js +69 -0
- data/lib-opal/js_wrap/three/node-editor/utils/OscillatorEditor.js +87 -0
- data/lib-opal/js_wrap/three/node-editor/utils/TimerEditor.js +89 -0
- data/lib-opal/js_wrap/three/nodes/Nodes.js +481 -0
- data/lib-opal/js_wrap/three/nodes/accessors/CameraNode.js +222 -0
- data/lib-opal/js_wrap/three/nodes/accessors/ColorsNode.js +99 -0
- data/lib-opal/js_wrap/three/nodes/accessors/LightNode.js +100 -0
- data/lib-opal/js_wrap/three/nodes/accessors/NormalNode.js +152 -0
- data/lib-opal/js_wrap/three/nodes/accessors/PositionNode.js +163 -0
- data/lib-opal/js_wrap/three/nodes/accessors/ReflectNode.js +161 -0
- data/lib-opal/js_wrap/three/nodes/accessors/ResolutionNode.js +99 -0
- data/lib-opal/js_wrap/three/nodes/accessors/ScreenUVNode.js +101 -0
- data/lib-opal/js_wrap/three/nodes/accessors/UVNode.js +105 -0
- data/lib-opal/js_wrap/three/nodes/core/AttributeNode.js +106 -0
- data/lib-opal/js_wrap/three/nodes/core/ConstNode.js +149 -0
- data/lib-opal/js_wrap/three/nodes/core/ExpressionNode.js +57 -0
- data/lib-opal/js_wrap/three/nodes/core/FunctionCallNode.js +138 -0
- data/lib-opal/js_wrap/three/nodes/core/FunctionNode.js +259 -0
- data/lib-opal/js_wrap/three/nodes/core/InputNode.js +124 -0
- data/lib-opal/js_wrap/three/nodes/core/Node.js +193 -0
- data/lib-opal/js_wrap/three/nodes/core/NodeBuilder.js +782 -0
- data/lib-opal/js_wrap/three/nodes/core/NodeFrame.js +69 -0
- data/lib-opal/js_wrap/three/nodes/core/NodeLib.js +56 -0
- data/lib-opal/js_wrap/three/nodes/core/NodeUniform.js +53 -0
- data/lib-opal/js_wrap/three/nodes/core/NodeUtils.js +60 -0
- data/lib-opal/js_wrap/three/nodes/core/StructNode.js +131 -0
- data/lib-opal/js_wrap/three/nodes/core/TempNode.js +160 -0
- data/lib-opal/js_wrap/three/nodes/core/VarNode.js +105 -0
- data/lib-opal/js_wrap/three/nodes/effects/BlurNode.js +160 -0
- data/lib-opal/js_wrap/three/nodes/effects/ColorAdjustmentNode.js +139 -0
- data/lib-opal/js_wrap/three/nodes/effects/LuminanceNode.js +106 -0
- data/lib-opal/js_wrap/three/nodes/inputs/BoolNode.js +95 -0
- data/lib-opal/js_wrap/three/nodes/inputs/ColorNode.js +99 -0
- data/lib-opal/js_wrap/three/nodes/inputs/CubeTextureNode.js +136 -0
- data/lib-opal/js_wrap/three/nodes/inputs/FloatNode.js +95 -0
- data/lib-opal/js_wrap/three/nodes/inputs/IntNode.js +95 -0
- data/lib-opal/js_wrap/three/nodes/inputs/Matrix3Node.js +102 -0
- data/lib-opal/js_wrap/three/nodes/inputs/Matrix4Node.js +102 -0
- data/lib-opal/js_wrap/three/nodes/inputs/PropertyNode.js +85 -0
- data/lib-opal/js_wrap/three/nodes/inputs/RTTNode.js +164 -0
- data/lib-opal/js_wrap/three/nodes/inputs/ReflectorNode.js +111 -0
- data/lib-opal/js_wrap/three/nodes/inputs/ScreenNode.js +69 -0
- data/lib-opal/js_wrap/three/nodes/inputs/TextureNode.js +140 -0
- data/lib-opal/js_wrap/three/nodes/inputs/Vector2Node.js +98 -0
- data/lib-opal/js_wrap/three/nodes/inputs/Vector3Node.js +99 -0
- data/lib-opal/js_wrap/three/nodes/inputs/Vector4Node.js +100 -0
- data/lib-opal/js_wrap/three/nodes/materials/BasicNodeMaterial.js +63 -0
- data/lib-opal/js_wrap/three/nodes/materials/MeshStandardNodeMaterial.js +63 -0
- data/lib-opal/js_wrap/three/nodes/materials/NodeMaterial.js +202 -0
- data/lib-opal/js_wrap/three/nodes/materials/PhongNodeMaterial.js +63 -0
- data/lib-opal/js_wrap/three/nodes/materials/SpriteNodeMaterial.js +63 -0
- data/lib-opal/js_wrap/three/nodes/materials/StandardNodeMaterial.js +63 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/BasicNode.js +146 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/MeshStandardNode.js +133 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/PhongNode.js +273 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/RawNode.js +101 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/SpriteNode.js +176 -0
- data/lib-opal/js_wrap/three/nodes/materials/nodes/StandardNode.js +397 -0
- data/lib-opal/js_wrap/three/nodes/math/CondNode.js +151 -0
- data/lib-opal/js_wrap/three/nodes/math/MathNode.js +266 -0
- data/lib-opal/js_wrap/three/nodes/math/OperatorNode.js +120 -0
- data/lib-opal/js_wrap/three/nodes/misc/BumpMapNode.js +139 -0
- data/lib-opal/js_wrap/three/nodes/misc/NormalMapNode.js +122 -0
- data/lib-opal/js_wrap/three/nodes/misc/TextureCubeNode.js +107 -0
- data/lib-opal/js_wrap/three/nodes/misc/TextureCubeUVNode.js +191 -0
- data/lib-opal/js_wrap/three/nodes/postprocessing/NodePass.js +117 -0
- data/lib-opal/js_wrap/three/nodes/postprocessing/NodePostProcessing.js +128 -0
- data/lib-opal/js_wrap/three/nodes/procedural/CheckerNode.js +104 -0
- data/lib-opal/js_wrap/three/nodes/procedural/Fractal3DNode.js +121 -0
- data/lib-opal/js_wrap/three/nodes/procedural/Noise2DNode.js +115 -0
- data/lib-opal/js_wrap/three/nodes/procedural/Noise3DNode.js +112 -0
- data/lib-opal/js_wrap/three/nodes/utils/BypassNode.js +115 -0
- data/lib-opal/js_wrap/three/nodes/utils/ColorSpaceNode.js +214 -0
- data/lib-opal/js_wrap/three/nodes/utils/JoinNode.js +138 -0
- data/lib-opal/js_wrap/three/nodes/utils/MaxMIPLevelNode.js +88 -0
- data/lib-opal/js_wrap/three/nodes/utils/RemapNode.js +117 -0
- data/lib-opal/js_wrap/three/nodes/utils/SpecularMIPLevelNode.js +121 -0
- data/lib-opal/js_wrap/three/nodes/utils/SubSlotNode.js +112 -0
- data/lib-opal/js_wrap/three/nodes/utils/SwitchNode.js +129 -0
- data/lib-opal/js_wrap/three/nodes/utils/TimerNode.js +126 -0
- data/lib-opal/js_wrap/three/nodes/utils/UVTransformNode.js +104 -0
- data/lib-opal/js_wrap/three/nodes/utils/VelocityNode.js +181 -0
- data/lib-opal/js_wrap/three/objects/Lensflare.js +285 -0
- data/lib-opal/js_wrap/three/objects/LightningStorm.js +238 -0
- data/lib-opal/js_wrap/three/objects/MarchingCubes.js +667 -0
- data/lib-opal/js_wrap/three/objects/Reflector.js +205 -0
- data/lib-opal/js_wrap/three/objects/ReflectorForSSRPass.js +288 -0
- data/lib-opal/js_wrap/three/objects/ReflectorRTT.js +63 -0
- data/lib-opal/js_wrap/three/objects/Refractor.js +243 -0
- data/lib-opal/js_wrap/three/objects/ShadowMesh.js +100 -0
- data/lib-opal/js_wrap/three/objects/Sky.js +107 -0
- data/lib-opal/js_wrap/three/objects/Water.js +246 -0
- data/lib-opal/js_wrap/three/objects/Water2.js +238 -0
- data/lib-opal/js_wrap/three/offscreen/jank.js +51 -0
- data/lib-opal/js_wrap/three/offscreen/offscreen.js +24 -0
- data/lib-opal/js_wrap/three/offscreen/scene.js +99 -0
- data/lib-opal/js_wrap/three/physics/AmmoPhysics.js +266 -0
- data/lib-opal/js_wrap/three/physics/OimoPhysics.js +214 -0
- data/lib-opal/js_wrap/three/postprocessing/AdaptiveToneMappingPass.js +307 -0
- data/lib-opal/js_wrap/three/postprocessing/AfterimagePass.js +116 -0
- data/lib-opal/js_wrap/three/postprocessing/BloomPass.js +132 -0
- data/lib-opal/js_wrap/three/postprocessing/BokehPass.js +143 -0
- data/lib-opal/js_wrap/three/postprocessing/ClearPass.js +85 -0
- data/lib-opal/js_wrap/three/postprocessing/CubeTexturePass.js +104 -0
- data/lib-opal/js_wrap/three/postprocessing/DotScreenPass.js +90 -0
- data/lib-opal/js_wrap/three/postprocessing/EffectComposer.js +272 -0
- data/lib-opal/js_wrap/three/postprocessing/FilmPass.js +91 -0
- data/lib-opal/js_wrap/three/postprocessing/GlitchPass.js +140 -0
- data/lib-opal/js_wrap/three/postprocessing/HalftonePass.js +108 -0
- data/lib-opal/js_wrap/three/postprocessing/LUTPass.js +132 -0
- data/lib-opal/js_wrap/three/postprocessing/MaskPass.js +142 -0
- data/lib-opal/js_wrap/three/postprocessing/OutlinePass.js +480 -0
- data/lib-opal/js_wrap/three/postprocessing/Pass.js +101 -0
- data/lib-opal/js_wrap/three/postprocessing/RenderPass.js +109 -0
- data/lib-opal/js_wrap/three/postprocessing/SAOPass.js +384 -0
- data/lib-opal/js_wrap/three/postprocessing/SMAAPass.js +199 -0
- data/lib-opal/js_wrap/three/postprocessing/SSAARenderPass.js +186 -0
- data/lib-opal/js_wrap/three/postprocessing/SSAOPass.js +388 -0
- data/lib-opal/js_wrap/three/postprocessing/SSRPass.js +537 -0
- data/lib-opal/js_wrap/three/postprocessing/SSRrPass.js +481 -0
- data/lib-opal/js_wrap/three/postprocessing/SavePass.js +96 -0
- data/lib-opal/js_wrap/three/postprocessing/ShaderPass.js +98 -0
- data/lib-opal/js_wrap/three/postprocessing/TAARenderPass.js +159 -0
- data/lib-opal/js_wrap/three/postprocessing/TexturePass.js +91 -0
- data/lib-opal/js_wrap/three/postprocessing/UnrealBloomPass.js +335 -0
- data/lib-opal/js_wrap/three/renderers/CSS2DRenderer.js +213 -0
- data/lib-opal/js_wrap/three/renderers/CSS3DRenderer.js +277 -0
- data/lib-opal/js_wrap/three/renderers/Projector.js +733 -0
- data/lib-opal/js_wrap/three/renderers/SVGRenderer.js +470 -0
- data/lib-opal/js_wrap/three/renderers/nodes/Nodes.js +531 -0
- data/lib-opal/js_wrap/three/renderers/nodes/ShaderNode.js +386 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/CameraNode.js +114 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialNode.js +140 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialReferenceNode.js +79 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelNode.js +62 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelViewProjectionNode.js +80 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/NormalNode.js +113 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/Object3DNode.js +136 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/PointUVNode.js +70 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/PositionNode.js +117 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/ReferenceNode.js +124 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/SkinningNode.js +129 -0
- data/lib-opal/js_wrap/three/renderers/nodes/accessors/UVNode.js +77 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/ArrayInputNode.js +74 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/AttributeNode.js +97 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/BypassNode.js +84 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/CodeNode.js +131 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/ContextNode.js +84 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/ExpressionNode.js +81 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionCallNode.js +123 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionNode.js +126 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/InputNode.js +103 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/Node.js +120 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeAttribute.js +37 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeBuilder.js +650 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeCode.js +42 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFrame.js +70 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunction.js +55 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunctionInput.js +44 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeKeywords.js +117 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeParser.js +46 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeUniform.js +55 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVar.js +37 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVary.js +37 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/PropertyNode.js +90 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/TempNode.js +89 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/VarNode.js +101 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/VaryNode.js +101 -0
- data/lib-opal/js_wrap/three/renderers/nodes/core/constants.js +42 -0
- data/lib-opal/js_wrap/three/renderers/nodes/display/ColorSpaceNode.js +165 -0
- data/lib-opal/js_wrap/three/renderers/nodes/display/NormalMapNode.js +120 -0
- data/lib-opal/js_wrap/three/renderers/nodes/functions/BSDFs.js +133 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/BufferNode.js +78 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/ColorNode.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/FloatNode.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/IntNode.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix3Node.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix4Node.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/TextureNode.js +120 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector2Node.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector3Node.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector4Node.js +67 -0
- data/lib-opal/js_wrap/three/renderers/nodes/lights/LightContextNode.js +103 -0
- data/lib-opal/js_wrap/three/renderers/nodes/lights/LightNode.js +115 -0
- data/lib-opal/js_wrap/three/renderers/nodes/lights/LightsNode.js +117 -0
- data/lib-opal/js_wrap/three/renderers/nodes/materials/LineBasicNodeMaterial.js +82 -0
- data/lib-opal/js_wrap/three/renderers/nodes/materials/Materials.js +49 -0
- data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshBasicNodeMaterial.js +82 -0
- data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshStandardNodeMaterial.js +96 -0
- data/lib-opal/js_wrap/three/renderers/nodes/materials/PointsNodeMaterial.js +84 -0
- data/lib-opal/js_wrap/three/renderers/nodes/math/CondNode.js +98 -0
- data/lib-opal/js_wrap/three/renderers/nodes/math/MathNode.js +255 -0
- data/lib-opal/js_wrap/three/renderers/nodes/math/OperatorNode.js +163 -0
- data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeFunction.js +158 -0
- data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeParser.js +68 -0
- data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeFunction.js +126 -0
- data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeParser.js +68 -0
- data/lib-opal/js_wrap/three/renderers/nodes/procedural/CheckerNode.js +84 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/ArrayElementNode.js +79 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/ConvertNode.js +82 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/JoinNode.js +88 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/OscNode.js +105 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/SplitNode.js +96 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/SpriteSheetUVNode.js +98 -0
- data/lib-opal/js_wrap/three/renderers/nodes/utils/TimerNode.js +93 -0
- data/lib-opal/js_wrap/three/renderers/webgl/nodes/SlotNode.js +72 -0
- data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodeBuilder.js +463 -0
- data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodes.js +62 -0
- data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLPhysicalContextNode.js +95 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPU.js +62 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUAttributes.js +118 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBackground.js +109 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBinding.js +52 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBindings.js +254 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBufferUtils.js +39 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUComputePipelines.js +82 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUGeometries.js +84 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUInfo.js +86 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUObjects.js +64 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProgrammableStage.js +46 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProperties.js +63 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderLists.js +180 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipeline.js +662 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipelines.js +275 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderer.js +883 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampledTexture.js +139 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampler.js +76 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUStorageBuffer.js +69 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureRenderer.js +64 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureUtils.js +125 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextures.js +681 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniform.js +237 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformBuffer.js +90 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformsGroup.js +294 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/constants.js +263 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeBuilder.js +619 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampledTexture.js +67 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampler.js +71 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniform.js +229 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +68 -0
- data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodes.js +106 -0
- data/lib-opal/js_wrap/three/shaders/ACESFilmicToneMappingShader.js +45 -0
- data/lib-opal/js_wrap/three/shaders/AfterimageShader.js +46 -0
- data/lib-opal/js_wrap/three/shaders/BasicShader.js +34 -0
- data/lib-opal/js_wrap/three/shaders/BleachBypassShader.js +43 -0
- data/lib-opal/js_wrap/three/shaders/BlendShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/BokehShader.js +65 -0
- data/lib-opal/js_wrap/three/shaders/BokehShader2.js +125 -0
- data/lib-opal/js_wrap/three/shaders/BrightnessContrastShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/ColorCorrectionShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/ColorifyShader.js +41 -0
- data/lib-opal/js_wrap/three/shaders/ConvolutionShader.js +75 -0
- data/lib-opal/js_wrap/three/shaders/CopyShader.js +41 -0
- data/lib-opal/js_wrap/three/shaders/DOFMipMapShader.js +49 -0
- data/lib-opal/js_wrap/three/shaders/DepthLimitedBlurShader.js +95 -0
- data/lib-opal/js_wrap/three/shaders/DigitalGlitch.js +79 -0
- data/lib-opal/js_wrap/three/shaders/DotScreenShader.js +52 -0
- data/lib-opal/js_wrap/three/shaders/FXAAShader.js +78 -0
- data/lib-opal/js_wrap/three/shaders/FilmShader.js +69 -0
- data/lib-opal/js_wrap/three/shaders/FocusShader.js +52 -0
- data/lib-opal/js_wrap/three/shaders/FreiChenShader.js +44 -0
- data/lib-opal/js_wrap/three/shaders/GammaCorrectionShader.js +39 -0
- data/lib-opal/js_wrap/three/shaders/GodRaysShader.js +140 -0
- data/lib-opal/js_wrap/three/shaders/HalftoneShader.js +77 -0
- data/lib-opal/js_wrap/three/shaders/HorizontalBlurShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/HorizontalTiltShiftShader.js +49 -0
- data/lib-opal/js_wrap/three/shaders/HueSaturationShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/KaleidoShader.js +50 -0
- data/lib-opal/js_wrap/three/shaders/LuminosityHighPassShader.js +52 -0
- data/lib-opal/js_wrap/three/shaders/LuminosityShader.js +39 -0
- data/lib-opal/js_wrap/three/shaders/MMDToonShader.js +48 -0
- data/lib-opal/js_wrap/three/shaders/MirrorShader.js +44 -0
- data/lib-opal/js_wrap/three/shaders/NormalMapShader.js +48 -0
- data/lib-opal/js_wrap/three/shaders/PixelShader.js +44 -0
- data/lib-opal/js_wrap/three/shaders/RGBShiftShader.js +50 -0
- data/lib-opal/js_wrap/three/shaders/SAOShader.js +85 -0
- data/lib-opal/js_wrap/three/shaders/SMAAShader.js +95 -0
- data/lib-opal/js_wrap/three/shaders/SSAOShader.js +113 -0
- data/lib-opal/js_wrap/three/shaders/SSRShader.js +126 -0
- data/lib-opal/js_wrap/three/shaders/SSRrShader.js +106 -0
- data/lib-opal/js_wrap/three/shaders/SepiaShader.js +43 -0
- data/lib-opal/js_wrap/three/shaders/SobelOperatorShader.js +44 -0
- data/lib-opal/js_wrap/three/shaders/SubsurfaceScatteringShader.js +64 -0
- data/lib-opal/js_wrap/three/shaders/TechnicolorShader.js +41 -0
- data/lib-opal/js_wrap/three/shaders/ToneMapShader.js +53 -0
- data/lib-opal/js_wrap/three/shaders/ToonShader.js +148 -0
- data/lib-opal/js_wrap/three/shaders/TriangleBlurShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/UnpackDepthRGBAShader.js +42 -0
- data/lib-opal/js_wrap/three/shaders/VerticalBlurShader.js +47 -0
- data/lib-opal/js_wrap/three/shaders/VerticalTiltShiftShader.js +49 -0
- data/lib-opal/js_wrap/three/shaders/VignetteShader.js +46 -0
- data/lib-opal/js_wrap/three/shaders/VolumeShader.js +55 -0
- data/lib-opal/js_wrap/three/shaders/WaterRefractionShader.js +46 -0
- data/lib-opal/js_wrap/three/textures/FlakesTexture.js +61 -0
- data/lib-opal/js_wrap/three/utils/BufferGeometryUtils.js +683 -0
- data/lib-opal/js_wrap/three/utils/CameraUtils.js +97 -0
- data/lib-opal/js_wrap/three/utils/GPUStatsPanel.js +154 -0
- data/lib-opal/js_wrap/three/utils/GeometryCompressionUtils.js +468 -0
- data/lib-opal/js_wrap/three/utils/GeometryUtils.js +192 -0
- data/lib-opal/js_wrap/three/utils/PackedPhongMaterial.js +77 -0
- data/lib-opal/js_wrap/three/utils/RoughnessMipmapper.js +169 -0
- data/lib-opal/js_wrap/three/utils/SceneUtils.js +62 -0
- data/lib-opal/js_wrap/three/utils/ShadowMapViewer.js +182 -0
- data/lib-opal/js_wrap/three/utils/SkeletonUtils.js +400 -0
- data/lib-opal/js_wrap/three/utils/UVsDebug.js +132 -0
- data/lib-opal/js_wrap/three/utils/WorkerPool.js +130 -0
- data/lib-opal/js_wrap/three/webxr/ARButton.js +203 -0
- data/lib-opal/js_wrap/three/webxr/OculusHandModel.js +131 -0
- data/lib-opal/js_wrap/three/webxr/OculusHandPointerModel.js +328 -0
- data/lib-opal/js_wrap/three/webxr/Text2D.js +54 -0
- data/lib-opal/js_wrap/three/webxr/VRButton.js +181 -0
- data/lib-opal/js_wrap/three/webxr/XRControllerModelFactory.js +266 -0
- data/lib-opal/js_wrap/three/webxr/XREstimatedLight.js +221 -0
- data/lib-opal/js_wrap/three/webxr/XRHandMeshModel.js +93 -0
- data/lib-opal/js_wrap/three/webxr/XRHandModelFactory.js +127 -0
- data/lib-opal/js_wrap/three/webxr/XRHandPrimitiveModel.js +85 -0
- data/opal-js_wrap-three.gemspec +4 -4
- metadata +502 -5
@@ -0,0 +1,982 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "three"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("three"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.three);
|
11
|
+
global.TDSLoader = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
Object.defineProperty(_exports, "__esModule", {
|
17
|
+
value: true
|
18
|
+
});
|
19
|
+
_exports.TDSLoader = void 0;
|
20
|
+
|
21
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
22
|
+
|
23
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
24
|
+
|
25
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
26
|
+
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
28
|
+
|
29
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
30
|
+
|
31
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
32
|
+
|
33
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
34
|
+
|
35
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
36
|
+
|
37
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
38
|
+
|
39
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Autodesk 3DS three.js file loader, based on lib3ds.
|
43
|
+
*
|
44
|
+
* Loads geometry with uv and materials basic properties with texture support.
|
45
|
+
*
|
46
|
+
* @class TDSLoader
|
47
|
+
* @constructor
|
48
|
+
*/
|
49
|
+
var TDSLoader = /*#__PURE__*/function (_Loader) {
|
50
|
+
_inherits(TDSLoader, _Loader);
|
51
|
+
|
52
|
+
var _super = _createSuper(TDSLoader);
|
53
|
+
|
54
|
+
function TDSLoader(manager) {
|
55
|
+
var _this;
|
56
|
+
|
57
|
+
_classCallCheck(this, TDSLoader);
|
58
|
+
|
59
|
+
_this = _super.call(this, manager);
|
60
|
+
_this.debug = false;
|
61
|
+
_this.group = null;
|
62
|
+
_this.materials = [];
|
63
|
+
_this.meshes = [];
|
64
|
+
return _this;
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* Load 3ds file from url.
|
68
|
+
*
|
69
|
+
* @method load
|
70
|
+
* @param {[type]} url URL for the file.
|
71
|
+
* @param {Function} onLoad onLoad callback, receives group Object3D as argument.
|
72
|
+
* @param {Function} onProgress onProgress callback.
|
73
|
+
* @param {Function} onError onError callback.
|
74
|
+
*/
|
75
|
+
|
76
|
+
|
77
|
+
_createClass(TDSLoader, [{
|
78
|
+
key: "load",
|
79
|
+
value: function load(url, onLoad, onProgress, onError) {
|
80
|
+
var scope = this;
|
81
|
+
var path = this.path === '' ? _three.LoaderUtils.extractUrlBase(url) : this.path;
|
82
|
+
var loader = new _three.FileLoader(this.manager);
|
83
|
+
loader.setPath(this.path);
|
84
|
+
loader.setResponseType('arraybuffer');
|
85
|
+
loader.setRequestHeader(this.requestHeader);
|
86
|
+
loader.setWithCredentials(this.withCredentials);
|
87
|
+
loader.load(url, function (data) {
|
88
|
+
try {
|
89
|
+
onLoad(scope.parse(data, path));
|
90
|
+
} catch (e) {
|
91
|
+
if (onError) {
|
92
|
+
onError(e);
|
93
|
+
} else {
|
94
|
+
console.error(e);
|
95
|
+
}
|
96
|
+
|
97
|
+
scope.manager.itemError(url);
|
98
|
+
}
|
99
|
+
}, onProgress, onError);
|
100
|
+
}
|
101
|
+
/**
|
102
|
+
* Parse arraybuffer data and load 3ds file.
|
103
|
+
*
|
104
|
+
* @method parse
|
105
|
+
* @param {ArrayBuffer} arraybuffer Arraybuffer data to be loaded.
|
106
|
+
* @param {String} path Path for external resources.
|
107
|
+
* @return {Group} Group loaded from 3ds file.
|
108
|
+
*/
|
109
|
+
|
110
|
+
}, {
|
111
|
+
key: "parse",
|
112
|
+
value: function parse(arraybuffer, path) {
|
113
|
+
this.group = new _three.Group();
|
114
|
+
this.materials = [];
|
115
|
+
this.meshes = [];
|
116
|
+
this.readFile(arraybuffer, path);
|
117
|
+
|
118
|
+
for (var i = 0; i < this.meshes.length; i++) {
|
119
|
+
this.group.add(this.meshes[i]);
|
120
|
+
}
|
121
|
+
|
122
|
+
return this.group;
|
123
|
+
}
|
124
|
+
/**
|
125
|
+
* Decode file content to read 3ds data.
|
126
|
+
*
|
127
|
+
* @method readFile
|
128
|
+
* @param {ArrayBuffer} arraybuffer Arraybuffer data to be loaded.
|
129
|
+
* @param {String} path Path for external resources.
|
130
|
+
*/
|
131
|
+
|
132
|
+
}, {
|
133
|
+
key: "readFile",
|
134
|
+
value: function readFile(arraybuffer, path) {
|
135
|
+
var data = new DataView(arraybuffer);
|
136
|
+
var chunk = new Chunk(data, 0, this.debugMessage);
|
137
|
+
|
138
|
+
if (chunk.id === MLIBMAGIC || chunk.id === CMAGIC || chunk.id === M3DMAGIC) {
|
139
|
+
var next = chunk.readChunk();
|
140
|
+
|
141
|
+
while (next) {
|
142
|
+
if (next.id === M3D_VERSION) {
|
143
|
+
var version = next.readDWord();
|
144
|
+
this.debugMessage('3DS file version: ' + version);
|
145
|
+
} else if (next.id === MDATA) {
|
146
|
+
this.readMeshData(next, path);
|
147
|
+
} else {
|
148
|
+
this.debugMessage('Unknown main chunk: ' + next.hexId);
|
149
|
+
}
|
150
|
+
|
151
|
+
next = chunk.readChunk();
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
this.debugMessage('Parsed ' + this.meshes.length + ' meshes');
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Read mesh data chunk.
|
159
|
+
*
|
160
|
+
* @method readMeshData
|
161
|
+
* @param {Chunk} chunk to read mesh from
|
162
|
+
* @param {String} path Path for external resources.
|
163
|
+
*/
|
164
|
+
|
165
|
+
}, {
|
166
|
+
key: "readMeshData",
|
167
|
+
value: function readMeshData(chunk, path) {
|
168
|
+
var next = chunk.readChunk();
|
169
|
+
|
170
|
+
while (next) {
|
171
|
+
if (next.id === MESH_VERSION) {
|
172
|
+
var version = +next.readDWord();
|
173
|
+
this.debugMessage('Mesh Version: ' + version);
|
174
|
+
} else if (next.id === MASTER_SCALE) {
|
175
|
+
var scale = next.readFloat();
|
176
|
+
this.debugMessage('Master scale: ' + scale);
|
177
|
+
this.group.scale.set(scale, scale, scale);
|
178
|
+
} else if (next.id === NAMED_OBJECT) {
|
179
|
+
this.debugMessage('Named Object');
|
180
|
+
this.readNamedObject(next);
|
181
|
+
} else if (next.id === MAT_ENTRY) {
|
182
|
+
this.debugMessage('Material');
|
183
|
+
this.readMaterialEntry(next, path);
|
184
|
+
} else {
|
185
|
+
this.debugMessage('Unknown MDATA chunk: ' + next.hexId);
|
186
|
+
}
|
187
|
+
|
188
|
+
next = chunk.readChunk();
|
189
|
+
}
|
190
|
+
}
|
191
|
+
/**
|
192
|
+
* Read named object chunk.
|
193
|
+
*
|
194
|
+
* @method readNamedObject
|
195
|
+
* @param {Chunk} chunk Chunk in use.
|
196
|
+
*/
|
197
|
+
|
198
|
+
}, {
|
199
|
+
key: "readNamedObject",
|
200
|
+
value: function readNamedObject(chunk) {
|
201
|
+
var name = chunk.readString();
|
202
|
+
var next = chunk.readChunk();
|
203
|
+
|
204
|
+
while (next) {
|
205
|
+
if (next.id === N_TRI_OBJECT) {
|
206
|
+
var mesh = this.readMesh(next);
|
207
|
+
mesh.name = name;
|
208
|
+
this.meshes.push(mesh);
|
209
|
+
} else {
|
210
|
+
this.debugMessage('Unknown named object chunk: ' + next.hexId);
|
211
|
+
}
|
212
|
+
|
213
|
+
next = chunk.readChunk();
|
214
|
+
}
|
215
|
+
}
|
216
|
+
/**
|
217
|
+
* Read material data chunk and add it to the material list.
|
218
|
+
*
|
219
|
+
* @method readMaterialEntry
|
220
|
+
* @param {Chunk} chunk Chunk in use.
|
221
|
+
* @param {String} path Path for external resources.
|
222
|
+
*/
|
223
|
+
|
224
|
+
}, {
|
225
|
+
key: "readMaterialEntry",
|
226
|
+
value: function readMaterialEntry(chunk, path) {
|
227
|
+
var next = chunk.readChunk();
|
228
|
+
var material = new _three.MeshPhongMaterial();
|
229
|
+
|
230
|
+
while (next) {
|
231
|
+
if (next.id === MAT_NAME) {
|
232
|
+
material.name = next.readString();
|
233
|
+
this.debugMessage(' Name: ' + material.name);
|
234
|
+
} else if (next.id === MAT_WIRE) {
|
235
|
+
this.debugMessage(' Wireframe');
|
236
|
+
material.wireframe = true;
|
237
|
+
} else if (next.id === MAT_WIRE_SIZE) {
|
238
|
+
var value = next.readByte();
|
239
|
+
material.wireframeLinewidth = value;
|
240
|
+
this.debugMessage(' Wireframe Thickness: ' + value);
|
241
|
+
} else if (next.id === MAT_TWO_SIDE) {
|
242
|
+
material.side = _three.DoubleSide;
|
243
|
+
this.debugMessage(' DoubleSided');
|
244
|
+
} else if (next.id === MAT_ADDITIVE) {
|
245
|
+
this.debugMessage(' Additive Blending');
|
246
|
+
material.blending = _three.AdditiveBlending;
|
247
|
+
} else if (next.id === MAT_DIFFUSE) {
|
248
|
+
this.debugMessage(' Diffuse Color');
|
249
|
+
material.color = this.readColor(next);
|
250
|
+
} else if (next.id === MAT_SPECULAR) {
|
251
|
+
this.debugMessage(' Specular Color');
|
252
|
+
material.specular = this.readColor(next);
|
253
|
+
} else if (next.id === MAT_AMBIENT) {
|
254
|
+
this.debugMessage(' Ambient color');
|
255
|
+
material.color = this.readColor(next);
|
256
|
+
} else if (next.id === MAT_SHININESS) {
|
257
|
+
var shininess = this.readPercentage(next);
|
258
|
+
material.shininess = shininess * 100;
|
259
|
+
this.debugMessage(' Shininess : ' + shininess);
|
260
|
+
} else if (next.id === MAT_TRANSPARENCY) {
|
261
|
+
var transparency = this.readPercentage(next);
|
262
|
+
material.opacity = 1 - transparency;
|
263
|
+
this.debugMessage(' Transparency : ' + transparency);
|
264
|
+
material.transparent = material.opacity < 1 ? true : false;
|
265
|
+
} else if (next.id === MAT_TEXMAP) {
|
266
|
+
this.debugMessage(' ColorMap');
|
267
|
+
material.map = this.readMap(next, path);
|
268
|
+
} else if (next.id === MAT_BUMPMAP) {
|
269
|
+
this.debugMessage(' BumpMap');
|
270
|
+
material.bumpMap = this.readMap(next, path);
|
271
|
+
} else if (next.id === MAT_OPACMAP) {
|
272
|
+
this.debugMessage(' OpacityMap');
|
273
|
+
material.alphaMap = this.readMap(next, path);
|
274
|
+
} else if (next.id === MAT_SPECMAP) {
|
275
|
+
this.debugMessage(' SpecularMap');
|
276
|
+
material.specularMap = this.readMap(next, path);
|
277
|
+
} else {
|
278
|
+
this.debugMessage(' Unknown material chunk: ' + next.hexId);
|
279
|
+
}
|
280
|
+
|
281
|
+
next = chunk.readChunk();
|
282
|
+
}
|
283
|
+
|
284
|
+
this.materials[material.name] = material;
|
285
|
+
}
|
286
|
+
/**
|
287
|
+
* Read mesh data chunk.
|
288
|
+
*
|
289
|
+
* @method readMesh
|
290
|
+
* @param {Chunk} chunk Chunk in use.
|
291
|
+
* @return {Mesh} The parsed mesh.
|
292
|
+
*/
|
293
|
+
|
294
|
+
}, {
|
295
|
+
key: "readMesh",
|
296
|
+
value: function readMesh(chunk) {
|
297
|
+
var next = chunk.readChunk();
|
298
|
+
var geometry = new _three.BufferGeometry();
|
299
|
+
var material = new _three.MeshPhongMaterial();
|
300
|
+
var mesh = new _three.Mesh(geometry, material);
|
301
|
+
mesh.name = 'mesh';
|
302
|
+
|
303
|
+
while (next) {
|
304
|
+
if (next.id === POINT_ARRAY) {
|
305
|
+
var points = next.readWord();
|
306
|
+
this.debugMessage(' Vertex: ' + points); //BufferGeometry
|
307
|
+
|
308
|
+
var vertices = [];
|
309
|
+
|
310
|
+
for (var i = 0; i < points; i++) {
|
311
|
+
vertices.push(next.readFloat());
|
312
|
+
vertices.push(next.readFloat());
|
313
|
+
vertices.push(next.readFloat());
|
314
|
+
}
|
315
|
+
|
316
|
+
geometry.setAttribute('position', new _three.Float32BufferAttribute(vertices, 3));
|
317
|
+
} else if (next.id === FACE_ARRAY) {
|
318
|
+
this.readFaceArray(next, mesh);
|
319
|
+
} else if (next.id === TEX_VERTS) {
|
320
|
+
var texels = next.readWord();
|
321
|
+
this.debugMessage(' UV: ' + texels); //BufferGeometry
|
322
|
+
|
323
|
+
var uvs = [];
|
324
|
+
|
325
|
+
for (var _i = 0; _i < texels; _i++) {
|
326
|
+
uvs.push(next.readFloat());
|
327
|
+
uvs.push(next.readFloat());
|
328
|
+
}
|
329
|
+
|
330
|
+
geometry.setAttribute('uv', new _three.Float32BufferAttribute(uvs, 2));
|
331
|
+
} else if (next.id === MESH_MATRIX) {
|
332
|
+
this.debugMessage(' Tranformation Matrix (TODO)');
|
333
|
+
var values = [];
|
334
|
+
|
335
|
+
for (var _i2 = 0; _i2 < 12; _i2++) {
|
336
|
+
values[_i2] = next.readFloat();
|
337
|
+
}
|
338
|
+
|
339
|
+
var matrix = new _three.Matrix4(); //X Line
|
340
|
+
|
341
|
+
matrix.elements[0] = values[0];
|
342
|
+
matrix.elements[1] = values[6];
|
343
|
+
matrix.elements[2] = values[3];
|
344
|
+
matrix.elements[3] = values[9]; //Y Line
|
345
|
+
|
346
|
+
matrix.elements[4] = values[2];
|
347
|
+
matrix.elements[5] = values[8];
|
348
|
+
matrix.elements[6] = values[5];
|
349
|
+
matrix.elements[7] = values[11]; //Z Line
|
350
|
+
|
351
|
+
matrix.elements[8] = values[1];
|
352
|
+
matrix.elements[9] = values[7];
|
353
|
+
matrix.elements[10] = values[4];
|
354
|
+
matrix.elements[11] = values[10]; //W Line
|
355
|
+
|
356
|
+
matrix.elements[12] = 0;
|
357
|
+
matrix.elements[13] = 0;
|
358
|
+
matrix.elements[14] = 0;
|
359
|
+
matrix.elements[15] = 1;
|
360
|
+
matrix.transpose();
|
361
|
+
var inverse = new _three.Matrix4();
|
362
|
+
inverse.copy(matrix).invert();
|
363
|
+
geometry.applyMatrix4(inverse);
|
364
|
+
matrix.decompose(mesh.position, mesh.quaternion, mesh.scale);
|
365
|
+
} else {
|
366
|
+
this.debugMessage(' Unknown mesh chunk: ' + next.hexId);
|
367
|
+
}
|
368
|
+
|
369
|
+
next = chunk.readChunk();
|
370
|
+
}
|
371
|
+
|
372
|
+
geometry.computeVertexNormals();
|
373
|
+
return mesh;
|
374
|
+
}
|
375
|
+
/**
|
376
|
+
* Read face array data chunk.
|
377
|
+
*
|
378
|
+
* @method readFaceArray
|
379
|
+
* @param {Chunk} chunk Chunk in use.
|
380
|
+
* @param {Mesh} mesh Mesh to be filled with the data read.
|
381
|
+
*/
|
382
|
+
|
383
|
+
}, {
|
384
|
+
key: "readFaceArray",
|
385
|
+
value: function readFaceArray(chunk, mesh) {
|
386
|
+
var faces = chunk.readWord();
|
387
|
+
this.debugMessage(' Faces: ' + faces);
|
388
|
+
var index = [];
|
389
|
+
|
390
|
+
for (var i = 0; i < faces; ++i) {
|
391
|
+
index.push(chunk.readWord(), chunk.readWord(), chunk.readWord());
|
392
|
+
chunk.readWord(); // visibility
|
393
|
+
}
|
394
|
+
|
395
|
+
mesh.geometry.setIndex(index); //The rest of the FACE_ARRAY chunk is subchunks
|
396
|
+
|
397
|
+
var materialIndex = 0;
|
398
|
+
var start = 0;
|
399
|
+
|
400
|
+
while (!chunk.endOfChunk) {
|
401
|
+
var subchunk = chunk.readChunk();
|
402
|
+
|
403
|
+
if (subchunk.id === MSH_MAT_GROUP) {
|
404
|
+
this.debugMessage(' Material Group');
|
405
|
+
var group = this.readMaterialGroup(subchunk);
|
406
|
+
var count = group.index.length * 3; // assuming successive indices
|
407
|
+
|
408
|
+
mesh.geometry.addGroup(start, count, materialIndex);
|
409
|
+
start += count;
|
410
|
+
materialIndex++;
|
411
|
+
var material = this.materials[group.name];
|
412
|
+
if (Array.isArray(mesh.material) === false) mesh.material = [];
|
413
|
+
|
414
|
+
if (material !== undefined) {
|
415
|
+
mesh.material.push(material);
|
416
|
+
}
|
417
|
+
} else {
|
418
|
+
this.debugMessage(' Unknown face array chunk: ' + subchunk.hexId);
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
if (mesh.material.length === 1) mesh.material = mesh.material[0]; // for backwards compatibility
|
423
|
+
}
|
424
|
+
/**
|
425
|
+
* Read texture map data chunk.
|
426
|
+
*
|
427
|
+
* @method readMap
|
428
|
+
* @param {Chunk} chunk Chunk in use.
|
429
|
+
* @param {String} path Path for external resources.
|
430
|
+
* @return {Texture} Texture read from this data chunk.
|
431
|
+
*/
|
432
|
+
|
433
|
+
}, {
|
434
|
+
key: "readMap",
|
435
|
+
value: function readMap(chunk, path) {
|
436
|
+
var next = chunk.readChunk();
|
437
|
+
var texture = {};
|
438
|
+
var loader = new _three.TextureLoader(this.manager);
|
439
|
+
loader.setPath(this.resourcePath || path).setCrossOrigin(this.crossOrigin);
|
440
|
+
|
441
|
+
while (next) {
|
442
|
+
if (next.id === MAT_MAPNAME) {
|
443
|
+
var name = next.readString();
|
444
|
+
texture = loader.load(name);
|
445
|
+
this.debugMessage(' File: ' + path + name);
|
446
|
+
} else if (next.id === MAT_MAP_UOFFSET) {
|
447
|
+
texture.offset.x = next.readFloat();
|
448
|
+
this.debugMessage(' OffsetX: ' + texture.offset.x);
|
449
|
+
} else if (next.id === MAT_MAP_VOFFSET) {
|
450
|
+
texture.offset.y = next.readFloat();
|
451
|
+
this.debugMessage(' OffsetY: ' + texture.offset.y);
|
452
|
+
} else if (next.id === MAT_MAP_USCALE) {
|
453
|
+
texture.repeat.x = next.readFloat();
|
454
|
+
this.debugMessage(' RepeatX: ' + texture.repeat.x);
|
455
|
+
} else if (next.id === MAT_MAP_VSCALE) {
|
456
|
+
texture.repeat.y = next.readFloat();
|
457
|
+
this.debugMessage(' RepeatY: ' + texture.repeat.y);
|
458
|
+
} else {
|
459
|
+
this.debugMessage(' Unknown map chunk: ' + next.hexId);
|
460
|
+
}
|
461
|
+
|
462
|
+
next = chunk.readChunk();
|
463
|
+
}
|
464
|
+
|
465
|
+
return texture;
|
466
|
+
}
|
467
|
+
/**
|
468
|
+
* Read material group data chunk.
|
469
|
+
*
|
470
|
+
* @method readMaterialGroup
|
471
|
+
* @param {Chunk} chunk Chunk in use.
|
472
|
+
* @return {Object} Object with name and index of the object.
|
473
|
+
*/
|
474
|
+
|
475
|
+
}, {
|
476
|
+
key: "readMaterialGroup",
|
477
|
+
value: function readMaterialGroup(chunk) {
|
478
|
+
var name = chunk.readString();
|
479
|
+
var numFaces = chunk.readWord();
|
480
|
+
this.debugMessage(' Name: ' + name);
|
481
|
+
this.debugMessage(' Faces: ' + numFaces);
|
482
|
+
var index = [];
|
483
|
+
|
484
|
+
for (var i = 0; i < numFaces; ++i) {
|
485
|
+
index.push(chunk.readWord());
|
486
|
+
}
|
487
|
+
|
488
|
+
return {
|
489
|
+
name: name,
|
490
|
+
index: index
|
491
|
+
};
|
492
|
+
}
|
493
|
+
/**
|
494
|
+
* Read a color value.
|
495
|
+
*
|
496
|
+
* @method readColor
|
497
|
+
* @param {Chunk} chunk Chunk.
|
498
|
+
* @return {Color} Color value read..
|
499
|
+
*/
|
500
|
+
|
501
|
+
}, {
|
502
|
+
key: "readColor",
|
503
|
+
value: function readColor(chunk) {
|
504
|
+
var subChunk = chunk.readChunk();
|
505
|
+
var color = new _three.Color();
|
506
|
+
|
507
|
+
if (subChunk.id === COLOR_24 || subChunk.id === LIN_COLOR_24) {
|
508
|
+
var r = subChunk.readByte();
|
509
|
+
var g = subChunk.readByte();
|
510
|
+
var b = subChunk.readByte();
|
511
|
+
color.setRGB(r / 255, g / 255, b / 255);
|
512
|
+
this.debugMessage(' Color: ' + color.r + ', ' + color.g + ', ' + color.b);
|
513
|
+
} else if (subChunk.id === COLOR_F || subChunk.id === LIN_COLOR_F) {
|
514
|
+
var _r = subChunk.readFloat();
|
515
|
+
|
516
|
+
var _g = subChunk.readFloat();
|
517
|
+
|
518
|
+
var _b = subChunk.readFloat();
|
519
|
+
|
520
|
+
color.setRGB(_r, _g, _b);
|
521
|
+
this.debugMessage(' Color: ' + color.r + ', ' + color.g + ', ' + color.b);
|
522
|
+
} else {
|
523
|
+
this.debugMessage(' Unknown color chunk: ' + subChunk.hexId);
|
524
|
+
}
|
525
|
+
|
526
|
+
return color;
|
527
|
+
}
|
528
|
+
/**
|
529
|
+
* Read percentage value.
|
530
|
+
*
|
531
|
+
* @method readPercentage
|
532
|
+
* @param {Chunk} chunk Chunk to read data from.
|
533
|
+
* @return {Number} Data read from the dataview.
|
534
|
+
*/
|
535
|
+
|
536
|
+
}, {
|
537
|
+
key: "readPercentage",
|
538
|
+
value: function readPercentage(chunk) {
|
539
|
+
var subChunk = chunk.readChunk();
|
540
|
+
|
541
|
+
switch (subChunk.id) {
|
542
|
+
case INT_PERCENTAGE:
|
543
|
+
return subChunk.readShort() / 100;
|
544
|
+
break;
|
545
|
+
|
546
|
+
case FLOAT_PERCENTAGE:
|
547
|
+
return subChunk.readFloat();
|
548
|
+
break;
|
549
|
+
|
550
|
+
default:
|
551
|
+
this.debugMessage(' Unknown percentage chunk: ' + subChunk.hexId);
|
552
|
+
return 0;
|
553
|
+
}
|
554
|
+
}
|
555
|
+
/**
|
556
|
+
* Print debug message to the console.
|
557
|
+
*
|
558
|
+
* Is controlled by a flag to show or hide debug messages.
|
559
|
+
*
|
560
|
+
* @method debugMessage
|
561
|
+
* @param {Object} message Debug message to print to the console.
|
562
|
+
*/
|
563
|
+
|
564
|
+
}, {
|
565
|
+
key: "debugMessage",
|
566
|
+
value: function debugMessage(message) {
|
567
|
+
if (this.debug) {
|
568
|
+
console.log(message);
|
569
|
+
}
|
570
|
+
}
|
571
|
+
}]);
|
572
|
+
|
573
|
+
return TDSLoader;
|
574
|
+
}(_three.Loader);
|
575
|
+
/** Read data/sub-chunks from chunk */
|
576
|
+
|
577
|
+
|
578
|
+
_exports.TDSLoader = TDSLoader;
|
579
|
+
|
580
|
+
var Chunk = /*#__PURE__*/function () {
|
581
|
+
/**
|
582
|
+
* Create a new chunk
|
583
|
+
*
|
584
|
+
* @class Chunk
|
585
|
+
* @param {DataView} data DataView to read from.
|
586
|
+
* @param {Number} position in data.
|
587
|
+
* @param {Function} debugMessage logging callback.
|
588
|
+
*/
|
589
|
+
function Chunk(data, position, debugMessage) {
|
590
|
+
_classCallCheck(this, Chunk);
|
591
|
+
|
592
|
+
this.data = data; // the offset to the begin of this chunk
|
593
|
+
|
594
|
+
this.offset = position; // the current reading position
|
595
|
+
|
596
|
+
this.position = position;
|
597
|
+
this.debugMessage = debugMessage;
|
598
|
+
|
599
|
+
if (this.debugMessage instanceof Function) {
|
600
|
+
this.debugMessage = function () {};
|
601
|
+
}
|
602
|
+
|
603
|
+
this.id = this.readWord();
|
604
|
+
this.size = this.readDWord();
|
605
|
+
this.end = this.offset + this.size;
|
606
|
+
|
607
|
+
if (this.end > data.byteLength) {
|
608
|
+
this.debugMessage('Bad chunk size for chunk at ' + position);
|
609
|
+
}
|
610
|
+
}
|
611
|
+
/**
|
612
|
+
* read a sub cchunk.
|
613
|
+
*
|
614
|
+
* @method readChunk
|
615
|
+
* @return {Chunk | null} next sub chunk
|
616
|
+
*/
|
617
|
+
|
618
|
+
|
619
|
+
_createClass(Chunk, [{
|
620
|
+
key: "readChunk",
|
621
|
+
value: function readChunk() {
|
622
|
+
if (this.endOfChunk) {
|
623
|
+
return null;
|
624
|
+
}
|
625
|
+
|
626
|
+
try {
|
627
|
+
var next = new Chunk(this.data, this.position, this.debugMessage);
|
628
|
+
this.position += next.size;
|
629
|
+
return next;
|
630
|
+
} catch (e) {
|
631
|
+
this.debugMessage('Unable to read chunk at ' + this.position);
|
632
|
+
return null;
|
633
|
+
}
|
634
|
+
}
|
635
|
+
/**
|
636
|
+
* return the ID of this chunk as Hex
|
637
|
+
*
|
638
|
+
* @method idToString
|
639
|
+
* @return {String} hex-string of id
|
640
|
+
*/
|
641
|
+
|
642
|
+
}, {
|
643
|
+
key: "hexId",
|
644
|
+
get: function get() {
|
645
|
+
return this.id.toString(16);
|
646
|
+
}
|
647
|
+
}, {
|
648
|
+
key: "endOfChunk",
|
649
|
+
get: function get() {
|
650
|
+
return this.position >= this.end;
|
651
|
+
}
|
652
|
+
/**
|
653
|
+
* Read byte value.
|
654
|
+
*
|
655
|
+
* @method readByte
|
656
|
+
* @return {Number} Data read from the dataview.
|
657
|
+
*/
|
658
|
+
|
659
|
+
}, {
|
660
|
+
key: "readByte",
|
661
|
+
value: function readByte() {
|
662
|
+
var v = this.data.getUint8(this.position, true);
|
663
|
+
this.position += 1;
|
664
|
+
return v;
|
665
|
+
}
|
666
|
+
/**
|
667
|
+
* Read 32 bit float value.
|
668
|
+
*
|
669
|
+
* @method readFloat
|
670
|
+
* @return {Number} Data read from the dataview.
|
671
|
+
*/
|
672
|
+
|
673
|
+
}, {
|
674
|
+
key: "readFloat",
|
675
|
+
value: function readFloat() {
|
676
|
+
try {
|
677
|
+
var v = this.data.getFloat32(this.position, true);
|
678
|
+
this.position += 4;
|
679
|
+
return v;
|
680
|
+
} catch (e) {
|
681
|
+
this.debugMessage(e + ' ' + this.position + ' ' + this.data.byteLength);
|
682
|
+
return 0;
|
683
|
+
}
|
684
|
+
}
|
685
|
+
/**
|
686
|
+
* Read 32 bit signed integer value.
|
687
|
+
*
|
688
|
+
* @method readInt
|
689
|
+
* @return {Number} Data read from the dataview.
|
690
|
+
*/
|
691
|
+
|
692
|
+
}, {
|
693
|
+
key: "readInt",
|
694
|
+
value: function readInt() {
|
695
|
+
var v = this.data.getInt32(this.position, true);
|
696
|
+
this.position += 4;
|
697
|
+
return v;
|
698
|
+
}
|
699
|
+
/**
|
700
|
+
* Read 16 bit signed integer value.
|
701
|
+
*
|
702
|
+
* @method readShort
|
703
|
+
* @return {Number} Data read from the dataview.
|
704
|
+
*/
|
705
|
+
|
706
|
+
}, {
|
707
|
+
key: "readShort",
|
708
|
+
value: function readShort() {
|
709
|
+
var v = this.data.getInt16(this.position, true);
|
710
|
+
this.position += 2;
|
711
|
+
return v;
|
712
|
+
}
|
713
|
+
/**
|
714
|
+
* Read 64 bit unsigned integer value.
|
715
|
+
*
|
716
|
+
* @method readDWord
|
717
|
+
* @return {Number} Data read from the dataview.
|
718
|
+
*/
|
719
|
+
|
720
|
+
}, {
|
721
|
+
key: "readDWord",
|
722
|
+
value: function readDWord() {
|
723
|
+
var v = this.data.getUint32(this.position, true);
|
724
|
+
this.position += 4;
|
725
|
+
return v;
|
726
|
+
}
|
727
|
+
/**
|
728
|
+
* Read 32 bit unsigned integer value.
|
729
|
+
*
|
730
|
+
* @method readWord
|
731
|
+
* @return {Number} Data read from the dataview.
|
732
|
+
*/
|
733
|
+
|
734
|
+
}, {
|
735
|
+
key: "readWord",
|
736
|
+
value: function readWord() {
|
737
|
+
var v = this.data.getUint16(this.position, true);
|
738
|
+
this.position += 2;
|
739
|
+
return v;
|
740
|
+
}
|
741
|
+
/**
|
742
|
+
* Read NULL terminated ASCII string value from chunk-pos.
|
743
|
+
*
|
744
|
+
* @method readString
|
745
|
+
* @return {String} Data read from the dataview.
|
746
|
+
*/
|
747
|
+
|
748
|
+
}, {
|
749
|
+
key: "readString",
|
750
|
+
value: function readString() {
|
751
|
+
var s = '';
|
752
|
+
var c = this.readByte();
|
753
|
+
|
754
|
+
while (c) {
|
755
|
+
s += String.fromCharCode(c);
|
756
|
+
c = this.readByte();
|
757
|
+
}
|
758
|
+
|
759
|
+
return s;
|
760
|
+
}
|
761
|
+
}]);
|
762
|
+
|
763
|
+
return Chunk;
|
764
|
+
}(); // const NULL_CHUNK = 0x0000;
|
765
|
+
|
766
|
+
|
767
|
+
var M3DMAGIC = 0x4D4D; // const SMAGIC = 0x2D2D;
|
768
|
+
// const LMAGIC = 0x2D3D;
|
769
|
+
|
770
|
+
var MLIBMAGIC = 0x3DAA; // const MATMAGIC = 0x3DFF;
|
771
|
+
|
772
|
+
var CMAGIC = 0xC23D;
|
773
|
+
var M3D_VERSION = 0x0002; // const M3D_KFVERSION = 0x0005;
|
774
|
+
|
775
|
+
var COLOR_F = 0x0010;
|
776
|
+
var COLOR_24 = 0x0011;
|
777
|
+
var LIN_COLOR_24 = 0x0012;
|
778
|
+
var LIN_COLOR_F = 0x0013;
|
779
|
+
var INT_PERCENTAGE = 0x0030;
|
780
|
+
var FLOAT_PERCENTAGE = 0x0031;
|
781
|
+
var MDATA = 0x3D3D;
|
782
|
+
var MESH_VERSION = 0x3D3E;
|
783
|
+
var MASTER_SCALE = 0x0100; // const LO_SHADOW_BIAS = 0x1400;
|
784
|
+
// const HI_SHADOW_BIAS = 0x1410;
|
785
|
+
// const SHADOW_MAP_SIZE = 0x1420;
|
786
|
+
// const SHADOW_SAMPLES = 0x1430;
|
787
|
+
// const SHADOW_RANGE = 0x1440;
|
788
|
+
// const SHADOW_FILTER = 0x1450;
|
789
|
+
// const RAY_BIAS = 0x1460;
|
790
|
+
// const O_CONSTS = 0x1500;
|
791
|
+
// const AMBIENT_LIGHT = 0x2100;
|
792
|
+
// const BIT_MAP = 0x1100;
|
793
|
+
// const SOLID_BGND = 0x1200;
|
794
|
+
// const V_GRADIENT = 0x1300;
|
795
|
+
// const USE_BIT_MAP = 0x1101;
|
796
|
+
// const USE_SOLID_BGND = 0x1201;
|
797
|
+
// const USE_V_GRADIENT = 0x1301;
|
798
|
+
// const FOG = 0x2200;
|
799
|
+
// const FOG_BGND = 0x2210;
|
800
|
+
// const LAYER_FOG = 0x2302;
|
801
|
+
// const DISTANCE_CUE = 0x2300;
|
802
|
+
// const DCUE_BGND = 0x2310;
|
803
|
+
// const USE_FOG = 0x2201;
|
804
|
+
// const USE_LAYER_FOG = 0x2303;
|
805
|
+
// const USE_DISTANCE_CUE = 0x2301;
|
806
|
+
|
807
|
+
var MAT_ENTRY = 0xAFFF;
|
808
|
+
var MAT_NAME = 0xA000;
|
809
|
+
var MAT_AMBIENT = 0xA010;
|
810
|
+
var MAT_DIFFUSE = 0xA020;
|
811
|
+
var MAT_SPECULAR = 0xA030;
|
812
|
+
var MAT_SHININESS = 0xA040; // const MAT_SHIN2PCT = 0xA041;
|
813
|
+
|
814
|
+
var MAT_TRANSPARENCY = 0xA050; // const MAT_XPFALL = 0xA052;
|
815
|
+
// const MAT_USE_XPFALL = 0xA240;
|
816
|
+
// const MAT_REFBLUR = 0xA053;
|
817
|
+
// const MAT_SHADING = 0xA100;
|
818
|
+
// const MAT_USE_REFBLUR = 0xA250;
|
819
|
+
// const MAT_SELF_ILLUM = 0xA084;
|
820
|
+
|
821
|
+
var MAT_TWO_SIDE = 0xA081; // const MAT_DECAL = 0xA082;
|
822
|
+
|
823
|
+
var MAT_ADDITIVE = 0xA083;
|
824
|
+
var MAT_WIRE = 0xA085; // const MAT_FACEMAP = 0xA088;
|
825
|
+
// const MAT_TRANSFALLOFF_IN = 0xA08A;
|
826
|
+
// const MAT_PHONGSOFT = 0xA08C;
|
827
|
+
// const MAT_WIREABS = 0xA08E;
|
828
|
+
|
829
|
+
var MAT_WIRE_SIZE = 0xA087;
|
830
|
+
var MAT_TEXMAP = 0xA200; // const MAT_SXP_TEXT_DATA = 0xA320;
|
831
|
+
// const MAT_TEXMASK = 0xA33E;
|
832
|
+
// const MAT_SXP_TEXTMASK_DATA = 0xA32A;
|
833
|
+
// const MAT_TEX2MAP = 0xA33A;
|
834
|
+
// const MAT_SXP_TEXT2_DATA = 0xA321;
|
835
|
+
// const MAT_TEX2MASK = 0xA340;
|
836
|
+
// const MAT_SXP_TEXT2MASK_DATA = 0xA32C;
|
837
|
+
|
838
|
+
var MAT_OPACMAP = 0xA210; // const MAT_SXP_OPAC_DATA = 0xA322;
|
839
|
+
// const MAT_OPACMASK = 0xA342;
|
840
|
+
// const MAT_SXP_OPACMASK_DATA = 0xA32E;
|
841
|
+
|
842
|
+
var MAT_BUMPMAP = 0xA230; // const MAT_SXP_BUMP_DATA = 0xA324;
|
843
|
+
// const MAT_BUMPMASK = 0xA344;
|
844
|
+
// const MAT_SXP_BUMPMASK_DATA = 0xA330;
|
845
|
+
|
846
|
+
var MAT_SPECMAP = 0xA204; // const MAT_SXP_SPEC_DATA = 0xA325;
|
847
|
+
// const MAT_SPECMASK = 0xA348;
|
848
|
+
// const MAT_SXP_SPECMASK_DATA = 0xA332;
|
849
|
+
// const MAT_SHINMAP = 0xA33C;
|
850
|
+
// const MAT_SXP_SHIN_DATA = 0xA326;
|
851
|
+
// const MAT_SHINMASK = 0xA346;
|
852
|
+
// const MAT_SXP_SHINMASK_DATA = 0xA334;
|
853
|
+
// const MAT_SELFIMAP = 0xA33D;
|
854
|
+
// const MAT_SXP_SELFI_DATA = 0xA328;
|
855
|
+
// const MAT_SELFIMASK = 0xA34A;
|
856
|
+
// const MAT_SXP_SELFIMASK_DATA = 0xA336;
|
857
|
+
// const MAT_REFLMAP = 0xA220;
|
858
|
+
// const MAT_REFLMASK = 0xA34C;
|
859
|
+
// const MAT_SXP_REFLMASK_DATA = 0xA338;
|
860
|
+
// const MAT_ACUBIC = 0xA310;
|
861
|
+
|
862
|
+
var MAT_MAPNAME = 0xA300; // const MAT_MAP_TILING = 0xA351;
|
863
|
+
// const MAT_MAP_TEXBLUR = 0xA353;
|
864
|
+
|
865
|
+
var MAT_MAP_USCALE = 0xA354;
|
866
|
+
var MAT_MAP_VSCALE = 0xA356;
|
867
|
+
var MAT_MAP_UOFFSET = 0xA358;
|
868
|
+
var MAT_MAP_VOFFSET = 0xA35A; // const MAT_MAP_ANG = 0xA35C;
|
869
|
+
// const MAT_MAP_COL1 = 0xA360;
|
870
|
+
// const MAT_MAP_COL2 = 0xA362;
|
871
|
+
// const MAT_MAP_RCOL = 0xA364;
|
872
|
+
// const MAT_MAP_GCOL = 0xA366;
|
873
|
+
// const MAT_MAP_BCOL = 0xA368;
|
874
|
+
|
875
|
+
var NAMED_OBJECT = 0x4000; // const N_DIRECT_LIGHT = 0x4600;
|
876
|
+
// const DL_OFF = 0x4620;
|
877
|
+
// const DL_OUTER_RANGE = 0x465A;
|
878
|
+
// const DL_INNER_RANGE = 0x4659;
|
879
|
+
// const DL_MULTIPLIER = 0x465B;
|
880
|
+
// const DL_EXCLUDE = 0x4654;
|
881
|
+
// const DL_ATTENUATE = 0x4625;
|
882
|
+
// const DL_SPOTLIGHT = 0x4610;
|
883
|
+
// const DL_SPOT_ROLL = 0x4656;
|
884
|
+
// const DL_SHADOWED = 0x4630;
|
885
|
+
// const DL_LOCAL_SHADOW2 = 0x4641;
|
886
|
+
// const DL_SEE_CONE = 0x4650;
|
887
|
+
// const DL_SPOT_RECTANGULAR = 0x4651;
|
888
|
+
// const DL_SPOT_ASPECT = 0x4657;
|
889
|
+
// const DL_SPOT_PROJECTOR = 0x4653;
|
890
|
+
// const DL_SPOT_OVERSHOOT = 0x4652;
|
891
|
+
// const DL_RAY_BIAS = 0x4658;
|
892
|
+
// const DL_RAYSHAD = 0x4627;
|
893
|
+
// const N_CAMERA = 0x4700;
|
894
|
+
// const CAM_SEE_CONE = 0x4710;
|
895
|
+
// const CAM_RANGES = 0x4720;
|
896
|
+
// const OBJ_HIDDEN = 0x4010;
|
897
|
+
// const OBJ_VIS_LOFTER = 0x4011;
|
898
|
+
// const OBJ_DOESNT_CAST = 0x4012;
|
899
|
+
// const OBJ_DONT_RECVSHADOW = 0x4017;
|
900
|
+
// const OBJ_MATTE = 0x4013;
|
901
|
+
// const OBJ_FAST = 0x4014;
|
902
|
+
// const OBJ_PROCEDURAL = 0x4015;
|
903
|
+
// const OBJ_FROZEN = 0x4016;
|
904
|
+
|
905
|
+
var N_TRI_OBJECT = 0x4100;
|
906
|
+
var POINT_ARRAY = 0x4110; // const POINT_FLAG_ARRAY = 0x4111;
|
907
|
+
|
908
|
+
var FACE_ARRAY = 0x4120;
|
909
|
+
var MSH_MAT_GROUP = 0x4130; // const SMOOTH_GROUP = 0x4150;
|
910
|
+
// const MSH_BOXMAP = 0x4190;
|
911
|
+
|
912
|
+
var TEX_VERTS = 0x4140;
|
913
|
+
var MESH_MATRIX = 0x4160; // const MESH_COLOR = 0x4165;
|
914
|
+
// const MESH_TEXTURE_INFO = 0x4170;
|
915
|
+
// const KFDATA = 0xB000;
|
916
|
+
// const KFHDR = 0xB00A;
|
917
|
+
// const KFSEG = 0xB008;
|
918
|
+
// const KFCURTIME = 0xB009;
|
919
|
+
// const AMBIENT_NODE_TAG = 0xB001;
|
920
|
+
// const OBJECT_NODE_TAG = 0xB002;
|
921
|
+
// const CAMERA_NODE_TAG = 0xB003;
|
922
|
+
// const TARGET_NODE_TAG = 0xB004;
|
923
|
+
// const LIGHT_NODE_TAG = 0xB005;
|
924
|
+
// const L_TARGET_NODE_TAG = 0xB006;
|
925
|
+
// const SPOTLIGHT_NODE_TAG = 0xB007;
|
926
|
+
// const NODE_ID = 0xB030;
|
927
|
+
// const NODE_HDR = 0xB010;
|
928
|
+
// const PIVOT = 0xB013;
|
929
|
+
// const INSTANCE_NAME = 0xB011;
|
930
|
+
// const MORPH_SMOOTH = 0xB015;
|
931
|
+
// const BOUNDBOX = 0xB014;
|
932
|
+
// const POS_TRACK_TAG = 0xB020;
|
933
|
+
// const COL_TRACK_TAG = 0xB025;
|
934
|
+
// const ROT_TRACK_TAG = 0xB021;
|
935
|
+
// const SCL_TRACK_TAG = 0xB022;
|
936
|
+
// const MORPH_TRACK_TAG = 0xB026;
|
937
|
+
// const FOV_TRACK_TAG = 0xB023;
|
938
|
+
// const ROLL_TRACK_TAG = 0xB024;
|
939
|
+
// const HOT_TRACK_TAG = 0xB027;
|
940
|
+
// const FALL_TRACK_TAG = 0xB028;
|
941
|
+
// const HIDE_TRACK_TAG = 0xB029;
|
942
|
+
// const POLY_2D = 0x5000;
|
943
|
+
// const SHAPE_OK = 0x5010;
|
944
|
+
// const SHAPE_NOT_OK = 0x5011;
|
945
|
+
// const SHAPE_HOOK = 0x5020;
|
946
|
+
// const PATH_3D = 0x6000;
|
947
|
+
// const PATH_MATRIX = 0x6005;
|
948
|
+
// const SHAPE_2D = 0x6010;
|
949
|
+
// const M_SCALE = 0x6020;
|
950
|
+
// const M_TWIST = 0x6030;
|
951
|
+
// const M_TEETER = 0x6040;
|
952
|
+
// const M_FIT = 0x6050;
|
953
|
+
// const M_BEVEL = 0x6060;
|
954
|
+
// const XZ_CURVE = 0x6070;
|
955
|
+
// const YZ_CURVE = 0x6080;
|
956
|
+
// const INTERPCT = 0x6090;
|
957
|
+
// const DEFORM_LIMIT = 0x60A0;
|
958
|
+
// const USE_CONTOUR = 0x6100;
|
959
|
+
// const USE_TWEEN = 0x6110;
|
960
|
+
// const USE_SCALE = 0x6120;
|
961
|
+
// const USE_TWIST = 0x6130;
|
962
|
+
// const USE_TEETER = 0x6140;
|
963
|
+
// const USE_FIT = 0x6150;
|
964
|
+
// const USE_BEVEL = 0x6160;
|
965
|
+
// const DEFAULT_VIEW = 0x3000;
|
966
|
+
// const VIEW_TOP = 0x3010;
|
967
|
+
// const VIEW_BOTTOM = 0x3020;
|
968
|
+
// const VIEW_LEFT = 0x3030;
|
969
|
+
// const VIEW_RIGHT = 0x3040;
|
970
|
+
// const VIEW_FRONT = 0x3050;
|
971
|
+
// const VIEW_BACK = 0x3060;
|
972
|
+
// const VIEW_USER = 0x3070;
|
973
|
+
// const VIEW_CAMERA = 0x3080;
|
974
|
+
// const VIEW_WINDOW = 0x3090;
|
975
|
+
// const VIEWPORT_LAYOUT_OLD = 0x7000;
|
976
|
+
// const VIEWPORT_DATA_OLD = 0x7010;
|
977
|
+
// const VIEWPORT_LAYOUT = 0x7001;
|
978
|
+
// const VIEWPORT_DATA = 0x7011;
|
979
|
+
// const VIEWPORT_DATA_3 = 0x7012;
|
980
|
+
// const VIEWPORT_SIZE = 0x7020;
|
981
|
+
// const NETWORK_VIEW = 0x7030;
|
982
|
+
});
|