1 line
174 KiB
Plaintext
1 line
174 KiB
Plaintext
|
|
{"version":3,"file":"GLTFLoader.cjs","sources":["../../src/loaders/GLTFLoader.js"],"sourcesContent":["import {\n AnimationClip,\n Bone,\n Box3,\n BufferAttribute,\n BufferGeometry,\n ClampToEdgeWrapping,\n Color,\n DirectionalLight,\n DoubleSide,\n FileLoader,\n FrontSide,\n Group,\n ImageBitmapLoader,\n InstancedMesh,\n InterleavedBuffer,\n InterleavedBufferAttribute,\n Interpolant,\n InterpolateDiscrete,\n InterpolateLinear,\n Line,\n LineBasicMaterial,\n LineLoop,\n LineSegments,\n LinearFilter,\n LinearMipmapLinearFilter,\n LinearMipmapNearestFilter,\n Loader,\n LoaderUtils,\n Material,\n MathUtils,\n Matrix4,\n Mesh,\n MeshBasicMaterial,\n MeshPhysicalMaterial,\n MeshStandardMaterial,\n MirroredRepeatWrapping,\n NearestFilter,\n NearestMipmapLinearFilter,\n NearestMipmapNearestFilter,\n NumberKeyframeTrack,\n Object3D,\n OrthographicCamera,\n PerspectiveCamera,\n PointLight,\n Points,\n PointsMaterial,\n PropertyBinding,\n Quaternion,\n QuaternionKeyframeTrack,\n RepeatWrapping,\n Skeleton,\n SkinnedMesh,\n Sphere,\n SpotLight,\n Texture,\n TextureLoader,\n TriangleFanDrawMode,\n TriangleStripDrawMode,\n Vector2,\n Vector3,\n VectorKeyframeTrack,\n InstancedBufferAttribute,\n} from 'three'\nimport { toTrianglesDrawMode } from '../utils/BufferGeometryUtils'\nimport { version } from '../_polyfill/constants'\nimport { decodeText } from '../_polyfill/LoaderUtils'\n\nconst SRGBColorSpace = 'srgb'\nconst LinearSRGBColorSpace = 'srgb-linear'\nconst sRGBEncoding = 3001\nconst LinearEncoding = 3000\n\nclass GLTFLoader extends Loader {\n constructor(manager) {\n super(manager)\n\n this.dracoLoader = null\n this.ktx2Loader = null\n this.meshoptDecoder = null\n\n this.pluginCallbacks = []\n\n this.register(function (parser) {\n return new GLTFMaterialsClearcoatExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsDispersionExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFTextureBasisUExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFTextureWebPExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFTextureAVIFExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsSheenExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsTransmissionExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsVolumeExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsIorExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsEmissiveStrengthExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsSpecularExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsIridescenceExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsAnisotropyExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMaterialsBumpExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFLightsExtension(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMeshoptCompression(parser)\n })\n\n this.register(function (parser) {\n return new GLTFMeshGpuInstancing(parser)\n })\n }\n\n load(url, onLoad, onProgress, onError) {\n const scope = this\n\n let resourcePath\n\n if (this.resourcePath !== '') {\n resourcePath = this.resourcePath\n } else if (this.path !== '') {\n // If a base path is set, resources will be relative paths from that plus the relative path of the gltf file\n // Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf'\n // resourcePath = 'https://my-cnd-server.com/assets/models/'\n // referenced resource 'model.bin' will be loade
|