@loaders.gl/gltf 4.0.0-alpha.12 → 4.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_gltfLoader","require","_gltfWriter","_glbLoader","_glbWriter","_gltfScenegraph","_postProcessGltf","_gltfUtils"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable camelcase, indent */\nexport type {GLB} from './lib/types/glb-types';\n\n// Raw GLTF Types (i.e. not post-processed)\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTFObject,\n // The following extensions are handled by the GLTFLoader and removed from the parsed glTF (disable via options.gltf.excludeExtensions)\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n GLTF_EXT_feature_metadata,\n GLTF_EXT_feature_metadata_primitive,\n GLTF_EXT_feature_metadata_attribute,\n GLTF_EXT_mesh_features\n} from './lib/types/gltf-json-schema';\n\n// Postprocessed types (modified GLTF types)\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFNodePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFImagePostprocessed,\n GLTFTexturePostprocessed\n} from './lib/types/gltf-postprocessed-schema';\n\nexport type {GLTFWithBuffers} from './lib/types/gltf-types';\n\n// glTF loader/writer definition objects\nexport {GLTFLoader} from './gltf-loader';\nexport {GLTFWriter} from './gltf-writer';\n\n// GLB Loader & Writer (for custom formats that want to leverage the GLB binary \"envelope\")\nexport {GLBLoader} from './glb-loader';\nexport {GLBWriter} from './glb-writer';\n\n// glTF Data Access Helper Class\nexport {GLTFScenegraph} from './lib/api/gltf-scenegraph';\nexport {postProcessGLTF} from './lib/api/post-process-gltf';\nexport {getMemoryUsageGLTF as _getMemoryUsageGLTF} from './lib/gltf-utils/gltf-utils';\n\n/** @deprecated */\n// export type {GLTFMesh as Mesh} from './lib/types/gltf-json-schema';\n/** @deprecated */\n// export type {GLTFNodePostprocessed as Node} from './lib/types/gltf-postprocessed-schema';\n/** @deprecated */\n// export type {GLTFAccessorPostprocessed as Accessor} from './lib/types/gltf-postprocessed-schema';\n// /** @deprecated */\n// export type {GLTFImagePostprocessed as Image} from './lib/types/gltf-postprocessed-schema';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAGA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA"}
1
+ {"version":3,"file":"index.js","names":["_gltfLoader","require","_gltfWriter","_glbLoader","_glbWriter","_gltfScenegraph","_postProcessGltf","_gltfUtils"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable camelcase, indent */\nexport type {GLB} from './lib/types/glb-types';\n\n// Raw GLTF Types (i.e. not post-processed)\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTFObject,\n // The following extensions are handled by the GLTFLoader and removed from the parsed glTF (disable via options.gltf.excludeExtensions)\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n // 3DTiles extensions\n GLTF_EXT_mesh_features,\n GLTF_EXT_mesh_features_featureId,\n GLTF_EXT_mesh_features_featureIdTexture,\n GLTF_EXT_feature_metadata_GLTF,\n GLTF_EXT_feature_metadata_Schema,\n GLTF_EXT_feature_metadata_Class,\n GLTF_EXT_feature_metadata_ClassProperty,\n GLTF_EXT_feature_metadata_Enum,\n GLTF_EXT_feature_metadata_EnumValue,\n GLTF_EXT_feature_metadata_FeatureTable,\n GLTF_EXT_feature_metadata_FeatureTableProperty,\n GLTF_EXT_feature_metadata_FeatureTexture,\n GLTF_EXT_feature_metadata_TextureAccessor,\n GLTF_EXT_feature_metadata_Statistics,\n GLTF_EXT_feature_metadata_StatisticsClass,\n GLTF_EXT_feature_metadata_StatisticsClassProperty,\n GLTF_EXT_feature_metadata_Primitive,\n GLTF_EXT_feature_metadata_FeatureIdAttribute,\n GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds,\n GLTF_EXT_feature_metadata_FeatureIdTexture,\n GLTF_EXT_feature_metadata_FeatureIdTextureAccessor\n} from './lib/types/gltf-json-schema';\n\n// Postprocessed types (modified GLTF types)\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFNodePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFImagePostprocessed,\n GLTFTexturePostprocessed\n} from './lib/types/gltf-postprocessed-schema';\n\nexport type {GLTFWithBuffers} from './lib/types/gltf-types';\n\n// glTF loader/writer definition objects\nexport {GLTFLoader} from './gltf-loader';\nexport {GLTFWriter} from './gltf-writer';\n\n// GLB Loader & Writer (for custom formats that want to leverage the GLB binary \"envelope\")\nexport {GLBLoader} from './glb-loader';\nexport {GLBWriter} from './glb-writer';\n\n// glTF Data Access Helper Class\nexport {GLTFScenegraph} from './lib/api/gltf-scenegraph';\nexport {postProcessGLTF} from './lib/api/post-process-gltf';\nexport {getMemoryUsageGLTF as _getMemoryUsageGLTF} from './lib/gltf-utils/gltf-utils';\n\n/** @deprecated */\n// export type {GLTFMesh as Mesh} from './lib/types/gltf-json-schema';\n/** @deprecated */\n// export type {GLTFNodePostprocessed as Node} from './lib/types/gltf-postprocessed-schema';\n/** @deprecated */\n// export type {GLTFAccessorPostprocessed as Accessor} from './lib/types/gltf-postprocessed-schema';\n// /** @deprecated */\n// export type {GLTFImagePostprocessed as Image} from './lib/types/gltf-postprocessed-schema';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAGA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_feature_metadata.js","names":["_gltfScenegraph","require","_images","_gltfUtils","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","EXT_FEATURE_METADATA","exports","decode","_x","_x2","_decode","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","gltfData","options","scenegraph","wrap","_callee$","_context","prev","GLTFScenegraph","decodeExtFeatureMetadata","stop","_extension$schema","_options$gltf","extension","getExtension","schemaClasses","schema","classes","featureTables","schemaName","schemaClass","featureTable","findFeatureTableByName","handleFeatureTableProperties","featureTextures","gltf","loadImages","featureTexture","findFeatureTextureByName","handleFeatureTextureProperties","propertyName","properties","_featureTable$propert","schemaProperty","featureTableProperty","numberOfFeatures","count","data","getPropertyDataFromBinarySource","attributeName","class","_featureTexture$prope","featureTextureProperty","getPropertyDataFromTexture","bufferView","dataArray","getTypedArrayForBufferView","type","stringOffsetBufferView","offsetsData","getStringAttributes","json","meshes","featureTextureTable","_iterator","_step","mesh","_iterator2","primitives","_step2","primitive","processPrimitiveTextures","_json$textures","textureData","texCoordAccessorKey","concat","texture","texCoord","texCoordAccessorIndex","attributes","texCoordBufferView","getBufferView","texCoordArray","textureCoordinates","Float32Array","buffer","byteOffset","textureIndex","index","textures","imageIndex","source","_json$images","_scenegraph$gltf$imag","image","images","mimeType","parsedImage","getImageValueByCoordinates","channels","push","featureIndices","_loop","texelData","_textureData","_i","findIndex","item","typedArray","Uint32Array","bufferIndex","buffers","arrayBuffer","byteLength","bufferViewIndex","addBufferView","accessorIndex","addAccessor","size","componentType","getComponentTypeFromArray","CHANNELS_MAP","r","offset","shift","g","b","a","u","v","components","indexOf","coordinatesToOffset","_iterator3","_step3","c","map","val","getVal","imageData","getImageData","Error","componentsCount","undefined","w","width","iX","emod","indX","Math","round","h","height","iY","indY","schemaClassName","featureTableName","featureTexturesName","stringsCount","stringsArray","textDecoder","TextDecoder","stringOffset","bytesPerStringSize","stringByteSize","stringData","subarray","stringAttribute"],"sources":["../../../../../src/lib/extensions/deprecated/EXT_feature_metadata.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport type {GLTF} from '../../types/gltf-json-schema';\nimport {GLTFScenegraph} from '../../api/gltf-scenegraph';\nimport {getImageData} from '@loaders.gl/images';\nimport {\n ClassProperty,\n EXT_feature_metadata_class_object,\n EXT_feature_metadata_feature_table,\n FeatureTableProperty,\n GLTF_EXT_feature_metadata,\n EXT_feature_metadata_feature_texture,\n FeatureTextureProperty,\n GLTFMeshPrimitive\n} from '../../types/gltf-json-schema';\nimport {getComponentTypeFromArray} from '../../gltf-utils/gltf-utils';\nimport {GLTFLoaderOptions} from '../../../gltf-loader';\n\n/** Extension name */\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\n\nexport const name = EXT_FEATURE_METADATA;\n\nexport async function decode(gltfData: {json: GLTF}, options: GLTFLoaderOptions): Promise<void> {\n const scenegraph = new GLTFScenegraph(gltfData);\n decodeExtFeatureMetadata(scenegraph, options);\n}\n\n/**\n * Decodes feature metadata from extension\n * @param scenegraph\n */\nfunction decodeExtFeatureMetadata(scenegraph: GLTFScenegraph, options: GLTFLoaderOptions): void {\n const extension: GLTF_EXT_feature_metadata | null = scenegraph.getExtension(EXT_FEATURE_METADATA);\n if (!extension) return;\n\n const schemaClasses = extension.schema?.classes;\n\n const {featureTables} = extension;\n if (schemaClasses && featureTables) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTable = findFeatureTableByName(featureTables, schemaName);\n\n if (featureTable) {\n handleFeatureTableProperties(scenegraph, featureTable, schemaClass);\n }\n }\n }\n\n const {featureTextures} = extension;\n if (schemaClasses && featureTextures && options.gltf?.loadImages) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTexture = findFeatureTextureByName(featureTextures, schemaName);\n\n if (featureTexture) {\n handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);\n }\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature table and gets properties data.\n * @param scenegraph\n * @param featureTable\n * @param schemaClass\n */\nfunction handleFeatureTableProperties(\n scenegraph: GLTFScenegraph,\n featureTable: EXT_feature_metadata_feature_table,\n schemaClass: EXT_feature_metadata_class_object\n): void {\n for (const propertyName in schemaClass.properties) {\n const schemaProperty = schemaClass.properties[propertyName];\n const featureTableProperty = featureTable?.properties?.[propertyName];\n const numberOfFeatures = featureTable.count;\n\n if (featureTableProperty) {\n const data = getPropertyDataFromBinarySource(\n scenegraph,\n schemaProperty,\n numberOfFeatures,\n featureTableProperty\n );\n featureTableProperty.data = data;\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature texture and gets properties data.\n * Data will be stored in featureTexture.properties[propertyName].data\n * @param scenegraph\n * @param featureTexture\n * @param schemaClass\n */\nfunction handleFeatureTextureProperties(\n scenegraph: GLTFScenegraph,\n featureTexture: EXT_feature_metadata_feature_texture,\n schemaClass: EXT_feature_metadata_class_object\n): void {\n const attributeName = featureTexture.class;\n\n for (const propertyName in schemaClass.properties) {\n const featureTextureProperty = featureTexture?.properties?.[propertyName];\n\n if (featureTextureProperty) {\n const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);\n featureTextureProperty.data = data;\n }\n }\n}\n\n/**\n * Decode properties from binary sourse based on property type.\n * @param scenegraph\n * @param schemaProperty\n * @param numberOfFeatures\n * @param featureTableProperty\n */\nfunction getPropertyDataFromBinarySource(\n scenegraph: GLTFScenegraph,\n schemaProperty: ClassProperty,\n numberOfFeatures: number,\n featureTableProperty: FeatureTableProperty\n): Uint8Array | string[] {\n const bufferView = featureTableProperty.bufferView;\n // TODO think maybe we shouldn't get data only in Uint8Array format.\n const dataArray: Uint8Array = scenegraph.getTypedArrayForBufferView(bufferView);\n\n switch (schemaProperty.type) {\n case 'STRING': {\n // stringOffsetBufferView should be available for string type.\n const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView!;\n const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);\n return getStringAttributes(dataArray, offsetsData, numberOfFeatures);\n }\n default:\n }\n\n return dataArray;\n}\n\n/**\n * Get properties from texture associated with all mesh primitives.\n * @param scenegraph\n * @param featureTextureProperty\n * @param attributeName\n * @returns Feature texture data\n */\nfunction getPropertyDataFromTexture(\n scenegraph: GLTFScenegraph,\n featureTextureProperty: FeatureTextureProperty,\n attributeName: string\n): number[] {\n const json = scenegraph.gltf.json;\n if (!json.meshes) {\n return [];\n }\n const featureTextureTable: number[] = [];\n for (const mesh of json.meshes) {\n for (const primitive of mesh.primitives) {\n processPrimitiveTextures(\n scenegraph,\n attributeName,\n featureTextureProperty,\n featureTextureTable,\n primitive\n );\n }\n }\n return featureTextureTable;\n}\n\n// eslint-disable-next-line max-statements\n/**\n * Processes data encoded in the texture associated with the primitive. This data will be accessible through the attributes.\n * @param scenegraph\n * @param attributeName\n * @param featureTextureProperty\n * @param featureTextureTable\n * @param primitive\n */\nfunction processPrimitiveTextures(\n scenegraph: GLTFScenegraph,\n attributeName: string,\n featureTextureProperty: FeatureTextureProperty,\n featureTextureTable: number[],\n primitive: GLTFMeshPrimitive\n): void {\n /*\n texture.index is an index for the \"textures\" array.\n The texture object referenced by this index looks like this:\n {\n \"sampler\": 0,\n \"source\": 0\n }\n \"sampler\" is an index for the \"samplers\" array\n \"source\" is an index for the \"images\" array that contains data. These data are stored in rgba channels of the image.\n\n texture.texCoord is a number-suffix (like 1) for an attribute like \"TEXCOORD_1\" in meshes.primitives\n The value of \"TEXCOORD_1\" is an accessor that is used to get coordinates. These coordinates ared used to get data from the image.\n */\n const json = scenegraph.gltf.json;\n const textureData: number[] = [];\n const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;\n const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];\n const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);\n const texCoordArray: Uint8Array = scenegraph.getTypedArrayForBufferView(texCoordBufferView);\n\n const textureCoordinates: Float32Array = new Float32Array(\n texCoordArray.buffer,\n texCoordArray.byteOffset,\n texCoordArray.length / 4\n );\n // textureCoordinates contains UV coordinates of the actual data stored in the texture\n // accessor.count is a number of UV pairs (they are stored as VEC2)\n\n const textureIndex = featureTextureProperty.texture.index;\n const texture = json.textures?.[textureIndex];\n const imageIndex = texture?.source;\n if (typeof imageIndex !== 'undefined') {\n const image = json.images?.[imageIndex];\n const mimeType = image?.mimeType;\n const parsedImage = scenegraph.gltf.images?.[imageIndex];\n if (parsedImage) {\n for (let index = 0; index < textureCoordinates.length; index += 2) {\n const value = getImageValueByCoordinates(\n parsedImage,\n mimeType,\n textureCoordinates,\n index,\n featureTextureProperty.channels\n );\n textureData.push(value);\n }\n }\n }\n /*\n featureTextureTable will contain unique values, e.g.\n textureData = [24, 35, 28, 24]\n featureTextureTable = [24, 35, 28]\n featureIndices will contain indices hat refer featureTextureTable, e.g.\n featureIndices = [0, 1, 2, 0]\n */\n const featureIndices: number[] = [];\n for (const texelData of textureData) {\n let index = featureTextureTable.findIndex((item) => item === texelData);\n if (index === -1) {\n index = featureTextureTable.push(texelData) - 1;\n }\n featureIndices.push(index);\n }\n const typedArray = new Uint32Array(featureIndices);\n const bufferIndex =\n scenegraph.gltf.buffers.push({\n arrayBuffer: typedArray.buffer,\n byteOffset: 0,\n byteLength: typedArray.byteLength\n }) - 1;\n const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);\n const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {\n size: 1,\n componentType: getComponentTypeFromArray(typedArray),\n count: typedArray.length\n });\n primitive.attributes[attributeName] = accessorIndex;\n}\n\nfunction getImageValueByCoordinates(\n parsedImage: any,\n mimeType: string | undefined,\n textureCoordinates: Float32Array,\n index: number,\n channels: string\n) {\n const CHANNELS_MAP = {\n r: {offset: 0, shift: 0},\n g: {offset: 1, shift: 8},\n b: {offset: 2, shift: 16},\n a: {offset: 3, shift: 24}\n };\n\n const u = textureCoordinates[index];\n const v = textureCoordinates[index + 1];\n\n let components = 1;\n if (mimeType && (mimeType.indexOf('image/jpeg') !== -1 || mimeType.indexOf('image/png') !== -1))\n components = 4;\n const offset = coordinatesToOffset(u, v, parsedImage, components);\n let value = 0;\n for (const c of channels) {\n const map = CHANNELS_MAP[c];\n const val = getVal(parsedImage, offset + map.offset);\n value |= val << map.shift;\n }\n return value;\n}\n\nfunction getVal(parsedImage: any, offset: number): number {\n const imageData = getImageData(parsedImage);\n if (imageData.data.length <= offset) {\n throw new Error(`${imageData.data.length} <= ${offset}`);\n }\n return imageData.data[offset];\n}\n\nfunction coordinatesToOffset(\n u: number,\n v: number,\n parsedImage: any,\n componentsCount: number = 1\n): number {\n const w = parsedImage.width;\n const iX = emod(u) * (w - 1);\n const indX = Math.round(iX);\n\n const h = parsedImage.height;\n const iY = emod(v) * (h - 1);\n const indY = Math.round(iY);\n const components = parsedImage.components ? parsedImage.components : componentsCount;\n // components is a number of channels in the image\n const offset = (indY * w + indX) * components;\n return offset;\n}\n\n// The following is taken from tile-converter\\src\\i3s-converter\\helpers\\batch-ids-extensions.ts\n/**\n * Handle UVs if they are out of range [0,1].\n * @param n\n * @param m\n */\nfunction emod(n: number): number {\n const a = ((n % 1) + 1) % 1;\n return a;\n}\n\n/**\n * Find the feature table by class name.\n * @param featureTables\n * @param schemaClassName\n */\nfunction findFeatureTableByName(\n featureTables: {[key: string]: EXT_feature_metadata_feature_table},\n schemaClassName: string\n): EXT_feature_metadata_feature_table | null {\n for (const featureTableName in featureTables) {\n const featureTable = featureTables[featureTableName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\nfunction findFeatureTextureByName(\n featureTextures: {[key: string]: EXT_feature_metadata_feature_texture},\n schemaClassName: string\n): EXT_feature_metadata_feature_texture | null {\n for (const featureTexturesName in featureTextures) {\n const featureTable = featureTextures[featureTexturesName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\n/**\n * Getting string attributes from binary data.\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#strings\n * @param data\n * @param offsetsData\n * @param stringsCount\n */\nfunction getStringAttributes(\n data: Uint8Array,\n offsetsData: Uint8Array,\n stringsCount: number\n): string[] {\n const stringsArray: string[] = [];\n const textDecoder = new TextDecoder('utf8');\n\n let stringOffset = 0;\n const bytesPerStringSize = 4;\n\n for (let index = 0; index < stringsCount; index++) {\n // TODO check if it is multiplication on bytesPerStringSize is valid operation?\n const stringByteSize =\n offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];\n const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);\n const stringAttribute = textDecoder.decode(stringData);\n\n stringsArray.push(stringAttribute);\n stringOffset += stringByteSize;\n }\n\n return stringsArray;\n}\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,eAA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IAEzD,IAAI9H,YAAY,CAACmB,KAAK,KAAKyG,eAAe,EAAE;MAC1C,OAAO5H,YAAY;IACrB;EACF;EAEA,OAAO,IAAI;AACb;AASA,SAAS6B,mBAAmBA,CAC1Bb,IAAgB,EAChBY,WAAuB,EACvBmG,YAAoB,EACV;EACV,IAAMC,YAAsB,GAAG,EAAE;EACjC,IAAMC,WAAW,GAAG,IAAIC,WAAW,CAAC,MAAM,CAAC;EAE3C,IAAIC,YAAY,GAAG,CAAC;EACpB,IAAMC,kBAAkB,GAAG,CAAC;EAE5B,KAAK,IAAI3E,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGsE,YAAY,EAAEtE,KAAK,EAAE,EAAE;IAEjD,IAAM4E,cAAc,GAClBzG,WAAW,CAAC,CAAC6B,KAAK,GAAG,CAAC,IAAI2E,kBAAkB,CAAC,GAAGxG,WAAW,CAAC6B,KAAK,GAAG2E,kBAAkB,CAAC;IACzF,IAAME,UAAU,GAAGtH,IAAI,CAACuH,QAAQ,CAACJ,YAAY,EAAEE,cAAc,GAAGF,YAAY,CAAC;IAC7E,IAAMK,eAAe,GAAGP,WAAW,CAAChK,MAAM,CAACqK,UAAU,CAAC;IAEtDN,YAAY,CAAC3D,IAAI,CAACmE,eAAe,CAAC;IAClCL,YAAY,IAAIE,cAAc;EAChC;EAEA,OAAOL,YAAY;AACrB"}
1
+ {"version":3,"file":"EXT_feature_metadata.js","names":["_gltfScenegraph","require","_images","_gltfUtils","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","EXT_FEATURE_METADATA","exports","decode","_x","_x2","_decode","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","gltfData","options","scenegraph","wrap","_callee$","_context","prev","GLTFScenegraph","decodeExtFeatureMetadata","stop","_extension$schema","_options$gltf","extension","getExtension","schemaClasses","schema","classes","featureTables","schemaName","schemaClass","featureTable","findFeatureTableByName","handleFeatureTableProperties","featureTextures","gltf","loadImages","featureTexture","findFeatureTextureByName","handleFeatureTextureProperties","propertyName","properties","_featureTable$propert","schemaProperty","featureTableProperty","numberOfFeatures","count","data","getPropertyDataFromBinarySource","attributeName","class","_featureTexture$prope","featureTextureProperty","getPropertyDataFromTexture","bufferView","dataArray","getTypedArrayForBufferView","type","stringOffsetBufferView","offsetsData","getStringAttributes","json","meshes","featureTextureTable","_iterator","_step","mesh","_iterator2","primitives","_step2","primitive","processPrimitiveTextures","_json$textures","textureData","texCoordAccessorKey","concat","texture","texCoord","texCoordAccessorIndex","attributes","texCoordBufferView","getBufferView","texCoordArray","textureCoordinates","Float32Array","buffer","byteOffset","textureIndex","index","textures","imageIndex","source","_json$images","_scenegraph$gltf$imag","image","images","mimeType","parsedImage","getImageValueByCoordinates","channels","push","featureIndices","_loop","texelData","_textureData","_i","findIndex","item","typedArray","Uint32Array","bufferIndex","buffers","arrayBuffer","byteLength","bufferViewIndex","addBufferView","accessorIndex","addAccessor","size","componentType","getComponentTypeFromArray","CHANNELS_MAP","r","offset","shift","g","b","a","u","v","components","indexOf","coordinatesToOffset","_iterator3","_step3","c","map","val","getVal","imageData","getImageData","Error","componentsCount","undefined","w","width","iX","emod","indX","Math","round","h","height","iY","indY","schemaClassName","featureTableName","featureTexturesName","stringsCount","stringsArray","textDecoder","TextDecoder","stringOffset","bytesPerStringSize","stringByteSize","stringData","subarray","stringAttribute"],"sources":["../../../../../src/lib/extensions/deprecated/EXT_feature_metadata.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport type {\n GLTF,\n GLTF_EXT_feature_metadata_Class,\n GLTF_EXT_feature_metadata_ClassProperty,\n GLTF_EXT_feature_metadata_FeatureTable,\n GLTF_EXT_feature_metadata_FeatureTableProperty,\n GLTF_EXT_feature_metadata_FeatureTexture,\n GLTF_EXT_feature_metadata_GLTF,\n GLTF_EXT_feature_metadata_TextureAccessor\n} from '../../types/gltf-json-schema';\nimport {GLTFScenegraph} from '../../api/gltf-scenegraph';\nimport {getImageData} from '@loaders.gl/images';\nimport {GLTFMeshPrimitive} from '../../types/gltf-json-schema';\nimport {getComponentTypeFromArray} from '../../gltf-utils/gltf-utils';\nimport {GLTFLoaderOptions} from '../../../gltf-loader';\n\n/** Extension name */\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\n\nexport const name = EXT_FEATURE_METADATA;\n\nexport async function decode(gltfData: {json: GLTF}, options: GLTFLoaderOptions): Promise<void> {\n const scenegraph = new GLTFScenegraph(gltfData);\n decodeExtFeatureMetadata(scenegraph, options);\n}\n\n/**\n * Decodes feature metadata from extension\n * @param scenegraph\n */\nfunction decodeExtFeatureMetadata(scenegraph: GLTFScenegraph, options: GLTFLoaderOptions): void {\n const extension: GLTF_EXT_feature_metadata_GLTF | null =\n scenegraph.getExtension(EXT_FEATURE_METADATA);\n if (!extension) return;\n\n const schemaClasses = extension.schema?.classes;\n\n const {featureTables} = extension;\n if (schemaClasses && featureTables) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTable = findFeatureTableByName(featureTables, schemaName);\n\n if (featureTable) {\n handleFeatureTableProperties(scenegraph, featureTable, schemaClass);\n }\n }\n }\n\n const {featureTextures} = extension;\n if (schemaClasses && featureTextures && options.gltf?.loadImages) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTexture = findFeatureTextureByName(featureTextures, schemaName);\n\n if (featureTexture) {\n handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);\n }\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature table and gets properties data.\n * @param scenegraph\n * @param featureTable\n * @param schemaClass\n */\nfunction handleFeatureTableProperties(\n scenegraph: GLTFScenegraph,\n featureTable: GLTF_EXT_feature_metadata_FeatureTable,\n schemaClass: GLTF_EXT_feature_metadata_Class\n): void {\n for (const propertyName in schemaClass.properties) {\n const schemaProperty = schemaClass.properties[propertyName];\n const featureTableProperty = featureTable?.properties?.[propertyName];\n const numberOfFeatures = featureTable.count;\n\n if (featureTableProperty) {\n const data = getPropertyDataFromBinarySource(\n scenegraph,\n schemaProperty,\n numberOfFeatures,\n featureTableProperty\n );\n featureTableProperty.data = data;\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature texture and gets properties data.\n * Data will be stored in featureTexture.properties[propertyName].data\n * @param scenegraph\n * @param featureTexture\n * @param schemaClass\n */\nfunction handleFeatureTextureProperties(\n scenegraph: GLTFScenegraph,\n featureTexture: GLTF_EXT_feature_metadata_FeatureTexture,\n schemaClass: GLTF_EXT_feature_metadata_Class\n): void {\n const attributeName = featureTexture.class;\n\n for (const propertyName in schemaClass.properties) {\n const featureTextureProperty = featureTexture?.properties?.[propertyName];\n\n if (featureTextureProperty) {\n const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);\n featureTextureProperty.data = data;\n }\n }\n}\n\n/**\n * Decode properties from binary sourse based on property type.\n * @param scenegraph\n * @param schemaProperty\n * @param numberOfFeatures\n * @param featureTableProperty\n */\nfunction getPropertyDataFromBinarySource(\n scenegraph: GLTFScenegraph,\n schemaProperty: GLTF_EXT_feature_metadata_ClassProperty,\n numberOfFeatures: number,\n featureTableProperty: GLTF_EXT_feature_metadata_FeatureTableProperty\n): Uint8Array | string[] {\n const bufferView = featureTableProperty.bufferView;\n // TODO think maybe we shouldn't get data only in Uint8Array format.\n const dataArray: Uint8Array = scenegraph.getTypedArrayForBufferView(bufferView);\n\n switch (schemaProperty.type) {\n case 'STRING': {\n // stringOffsetBufferView should be available for string type.\n const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView!;\n const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);\n return getStringAttributes(dataArray, offsetsData, numberOfFeatures);\n }\n default:\n }\n\n return dataArray;\n}\n\n/**\n * Get properties from texture associated with all mesh primitives.\n * @param scenegraph\n * @param featureTextureProperty\n * @param attributeName\n * @returns Feature texture data\n */\nfunction getPropertyDataFromTexture(\n scenegraph: GLTFScenegraph,\n featureTextureProperty: GLTF_EXT_feature_metadata_TextureAccessor,\n attributeName: string\n): number[] {\n const json = scenegraph.gltf.json;\n if (!json.meshes) {\n return [];\n }\n const featureTextureTable: number[] = [];\n for (const mesh of json.meshes) {\n for (const primitive of mesh.primitives) {\n processPrimitiveTextures(\n scenegraph,\n attributeName,\n featureTextureProperty,\n featureTextureTable,\n primitive\n );\n }\n }\n return featureTextureTable;\n}\n\n// eslint-disable-next-line max-statements\n/**\n * Processes data encoded in the texture associated with the primitive. This data will be accessible through the attributes.\n * @param scenegraph\n * @param attributeName\n * @param featureTextureProperty\n * @param featureTextureTable\n * @param primitive\n */\n// eslint-disable-next-line max-statements\nfunction processPrimitiveTextures(\n scenegraph: GLTFScenegraph,\n attributeName: string,\n featureTextureProperty: GLTF_EXT_feature_metadata_TextureAccessor,\n featureTextureTable: number[],\n primitive: GLTFMeshPrimitive\n): void {\n /*\n texture.index is an index for the \"textures\" array.\n The texture object referenced by this index looks like this:\n {\n \"sampler\": 0,\n \"source\": 0\n }\n \"sampler\" is an index for the \"samplers\" array\n \"source\" is an index for the \"images\" array that contains data. These data are stored in rgba channels of the image.\n\n texture.texCoord is a number-suffix (like 1) for an attribute like \"TEXCOORD_1\" in meshes.primitives\n The value of \"TEXCOORD_1\" is an accessor that is used to get coordinates. These coordinates ared used to get data from the image.\n */\n const json = scenegraph.gltf.json;\n const textureData: number[] = [];\n const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;\n const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];\n const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);\n const texCoordArray: Uint8Array = scenegraph.getTypedArrayForBufferView(texCoordBufferView);\n\n const textureCoordinates: Float32Array = new Float32Array(\n texCoordArray.buffer,\n texCoordArray.byteOffset,\n texCoordArray.length / 4\n );\n // textureCoordinates contains UV coordinates of the actual data stored in the texture\n // accessor.count is a number of UV pairs (they are stored as VEC2)\n\n const textureIndex = featureTextureProperty.texture.index;\n const texture = json.textures?.[textureIndex];\n const imageIndex = texture?.source;\n if (typeof imageIndex !== 'undefined') {\n const image = json.images?.[imageIndex];\n const mimeType = image?.mimeType;\n const parsedImage = scenegraph.gltf.images?.[imageIndex];\n if (parsedImage) {\n for (let index = 0; index < textureCoordinates.length; index += 2) {\n const value = getImageValueByCoordinates(\n parsedImage,\n mimeType,\n textureCoordinates,\n index,\n featureTextureProperty.channels\n );\n textureData.push(value);\n }\n }\n }\n /*\n featureTextureTable will contain unique values, e.g.\n textureData = [24, 35, 28, 24]\n featureTextureTable = [24, 35, 28]\n featureIndices will contain indices hat refer featureTextureTable, e.g.\n featureIndices = [0, 1, 2, 0]\n */\n const featureIndices: number[] = [];\n for (const texelData of textureData) {\n let index = featureTextureTable.findIndex((item) => item === texelData);\n if (index === -1) {\n index = featureTextureTable.push(texelData) - 1;\n }\n featureIndices.push(index);\n }\n const typedArray = new Uint32Array(featureIndices);\n const bufferIndex =\n scenegraph.gltf.buffers.push({\n arrayBuffer: typedArray.buffer,\n byteOffset: 0,\n byteLength: typedArray.byteLength\n }) - 1;\n const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);\n const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {\n size: 1,\n componentType: getComponentTypeFromArray(typedArray),\n count: typedArray.length\n });\n primitive.attributes[attributeName] = accessorIndex;\n}\n\nfunction getImageValueByCoordinates(\n parsedImage: any,\n mimeType: string | undefined,\n textureCoordinates: Float32Array,\n index: number,\n channels: string\n) {\n const CHANNELS_MAP = {\n r: {offset: 0, shift: 0},\n g: {offset: 1, shift: 8},\n b: {offset: 2, shift: 16},\n a: {offset: 3, shift: 24}\n };\n\n const u = textureCoordinates[index];\n const v = textureCoordinates[index + 1];\n\n let components = 1;\n if (mimeType && (mimeType.indexOf('image/jpeg') !== -1 || mimeType.indexOf('image/png') !== -1))\n components = 4;\n const offset = coordinatesToOffset(u, v, parsedImage, components);\n let value = 0;\n for (const c of channels) {\n const map = CHANNELS_MAP[c];\n const val = getVal(parsedImage, offset + map.offset);\n value |= val << map.shift;\n }\n return value;\n}\n\nfunction getVal(parsedImage: any, offset: number): number {\n const imageData = getImageData(parsedImage);\n if (imageData.data.length <= offset) {\n throw new Error(`${imageData.data.length} <= ${offset}`);\n }\n return imageData.data[offset];\n}\n\nfunction coordinatesToOffset(\n u: number,\n v: number,\n parsedImage: any,\n componentsCount: number = 1\n): number {\n const w = parsedImage.width;\n const iX = emod(u) * (w - 1);\n const indX = Math.round(iX);\n\n const h = parsedImage.height;\n const iY = emod(v) * (h - 1);\n const indY = Math.round(iY);\n const components = parsedImage.components ? parsedImage.components : componentsCount;\n // components is a number of channels in the image\n const offset = (indY * w + indX) * components;\n return offset;\n}\n\n// The following is taken from tile-converter\\src\\i3s-converter\\helpers\\batch-ids-extensions.ts\n/**\n * Handle UVs if they are out of range [0,1].\n * @param n\n * @param m\n */\nfunction emod(n: number): number {\n const a = ((n % 1) + 1) % 1;\n return a;\n}\n\n/**\n * Find the feature table by class name.\n * @param featureTables\n * @param schemaClassName\n */\nfunction findFeatureTableByName(\n featureTables: {[key: string]: GLTF_EXT_feature_metadata_FeatureTable},\n schemaClassName: string\n): GLTF_EXT_feature_metadata_FeatureTable | null {\n for (const featureTableName in featureTables) {\n const featureTable = featureTables[featureTableName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\nfunction findFeatureTextureByName(\n featureTextures: {[key: string]: GLTF_EXT_feature_metadata_FeatureTexture},\n schemaClassName: string\n): GLTF_EXT_feature_metadata_FeatureTexture | null {\n for (const featureTexturesName in featureTextures) {\n const featureTable = featureTextures[featureTexturesName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\n/**\n * Getting string attributes from binary data.\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#strings\n * @param data\n * @param offsetsData\n * @param stringsCount\n */\nfunction getStringAttributes(\n data: Uint8Array,\n offsetsData: Uint8Array,\n stringsCount: number\n): string[] {\n const stringsArray: string[] = [];\n const textDecoder = new TextDecoder('utf8');\n\n let stringOffset = 0;\n const bytesPerStringSize = 4;\n\n for (let index = 0; index < stringsCount; index++) {\n // TODO check if it is multiplication on bytesPerStringSize is valid operation?\n const stringByteSize =\n offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];\n const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);\n const stringAttribute = textDecoder.decode(stringData);\n\n stringsArray.push(stringAttribute);\n stringOffset += stringByteSize;\n }\n\n return stringsArray;\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAAsE,SAAAG,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,EAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,EAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,cAAA,IAAAD,CAAA,WAAAA,CAAA,CAAAQ,MAAA,qBAAAN,EAAA,EAAAF,CAAA,GAAAE,EAAA,MAAAO,CAAA,UAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,QAAAH,CAAA,IAAAT,CAAA,CAAAQ,MAAA,WAAAK,IAAA,mBAAAA,IAAA,SAAAC,KAAA,EAAAd,CAAA,CAAAS,CAAA,UAAAM,CAAA,WAAAA,EAAAC,EAAA,UAAAA,EAAA,KAAAC,CAAA,EAAAP,CAAA,gBAAAQ,SAAA,iJAAAC,gBAAA,SAAAC,MAAA,UAAAC,GAAA,WAAAV,CAAA,WAAAA,EAA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CAAC3D,IAAI,CAACmE,eAAe,CAAC;IAClCL,YAAY,IAAIE,cAAc;EAChC;EAEA,OAAOL,YAAY;AACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-json-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-json-schema.ts"],"sourcesContent":["// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license\n// Generated from official JSON schema using `npm run generate-interface` on 2018-02-24\n\nexport type GLTFId = number;\n\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparseIndices = {\n /**\n * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n /**\n * The indices data type.\n */\n componentType: 5121 | 5123 | 5125 | number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.\n */\nexport type GLTFAccessorSparseValues = {\n /**\n * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Sparse storage of attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparse = {\n /**\n * Number of entries stored in the sparse array.\n */\n count: number;\n /**\n * Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.\n */\n indices: GLTFAccessorSparseIndices;\n /**\n * Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.\n */\n values: GLTFAccessorSparseValues;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.\n */\nexport type GLTFAccessor = {\n /**\n * The index of the bufferView.\n */\n bufferView?: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes.\n */\n byteOffset?: number;\n /**\n * The datatype of components in the attribute.\n */\n componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number;\n /**\n * Specifies whether integer data values should be normalized.\n */\n normalized?: boolean;\n /**\n * The number of attributes referenced by this accessor.\n */\n count: number;\n /**\n * Specifies if the attribute is a scalar, vector, or matrix.\n */\n type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | string;\n /**\n * Maximum value of each component in this attribute.\n */\n max?: number[];\n /**\n * Minimum value of each component in this attribute.\n */\n min?: number[];\n /**\n * Sparse storage of attributes that deviate from their initialization value.\n */\n sparse?: GLTFAccessorSparse;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The index of the node and TRS property that an animation channel targets.\n */\nexport type GLTFAnimationChannelTarget = {\n /**\n * The index of the node to target.\n */\n node?: GLTFId;\n /**\n * The name of the node's TRS property to modify, or the \"weights\" of the Morph Targets it instantiates. For the \"translation\" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the \"rotation\" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the \"scale\" property, the values are the scaling factors along the x, y, and z axes.\n */\n path: 'translation' | 'rotation' | 'scale' | 'weights' | string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Targets an animation's sampler at a node's property.\n */\nexport type GLTFAnimationChannel = {\n /**\n * The index of a sampler in this animation used to compute the value for the target.\n */\n sampler: GLTFId;\n /**\n * The index of the node and TRS property to target.\n */\n target: GLTFAnimationChannelTarget;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\nexport type GLTFAnimationSampler = {\n /**\n * The index of an accessor containing keyframe input values, e.g., time.\n */\n input: GLTFId;\n /**\n * Interpolation algorithm.\n */\n interpolation?: 'LINEAR' | 'STEP' | 'CUBICSPLINE' | string;\n /**\n * The index of an accessor, containing keyframe output values.\n */\n output: GLTFId;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A keyframe animation.\n */\nexport type GLTFAnimation = {\n /**\n * An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.\n */\n channels: GLTFAnimationChannel[];\n /**\n * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\n samplers: GLTFAnimationSampler[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Metadata about the glTF asset.\n */\nexport type GLTFAsset = {\n /**\n * A copyright message suitable for display to credit the content creator.\n */\n copyright?: string;\n /**\n * Tool that generated this glTF model. Useful for debugging.\n */\n generator?: string;\n /**\n * The glTF version that this asset targets.\n */\n version: string;\n /**\n * The minimum glTF version that this asset targets.\n */\n minVersion?: string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport type GLTFBuffer = {\n /**\n * The uri of the buffer.\n */\n uri?: string;\n /**\n * The length of the buffer in bytes.\n */\n byteLength: number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A view into a buffer generally representing a subset of the buffer.\n */\nexport type GLTFBufferView = {\n /**\n * The index of the buffer.\n */\n buffer: GLTFId;\n /**\n * The offset into the buffer in bytes.\n */\n byteOffset?: number;\n /**\n * The length of the bufferView in bytes.\n */\n byteLength: number;\n /**\n * The stride, in bytes.\n */\n byteStride?: number;\n /**\n * The target that the GPU buffer should be bound to.\n */\n target?: 34962 | 34963 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\nexport type GLTFCameraOrthographic = {\n /**\n * The floating-point horizontal magnification of the view. Must not be zero.\n */\n xmag: number;\n /**\n * The floating-point vertical magnification of the view. Must not be zero.\n */\n ymag: number;\n /**\n * The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.\n */\n zfar: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\nexport type GLTFCameraPerspective = {\n /**\n * The floating-point aspect ratio of the field of view.\n */\n aspectRatio?: number;\n /**\n * The floating-point vertical field of view in radians.\n */\n yfov: number;\n /**\n * The floating-point distance to the far clipping plane.\n */\n zfar?: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.\n */\nexport type GLTFCamera = {\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: GLTFCameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: GLTFCameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.\n */\nexport type GLTFImage = {\n /**\n * The uri of the image.\n */\n uri?: string;\n /**\n * The image's MIME type.\n */\n mimeType?: 'image/jpeg' | 'image/png' | string;\n /**\n * The index of the bufferView that contains the image. Use this instead of the image's uri property.\n */\n bufferView?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Reference to a texture.\n */\nexport type GLTFTextureInfo = {\n /**\n * The index of the texture.\n */\n index: GLTFId;\n /**\n * The set index of texture's TEXCOORD attribute used for texture coordinate mapping.\n */\n texCoord?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.\n */\nexport type GLTFMaterialPbrMetallicRoughness = {\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: GLTFTextureInfo;\n /**\n * The metalness of the material.\n */\n metallicFactor?: number;\n /**\n * The roughness of the material.\n */\n roughnessFactor?: number;\n /**\n * The metallic-roughness texture.\n */\n metallicRoughnessTexture?: GLTFTextureInfo;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialNormalTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * The scalar multiplier applied to each normal vector of the normal texture.\n */\n scale?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialOcclusionTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The material appearance of a primitive.\n */\nexport type GLTFMaterial = {\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n /**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.\n */\n pbrMetallicRoughness?: GLTFMaterialPbrMetallicRoughness;\n /**\n * The normal map texture.\n */\n normalTexture?: GLTFMaterialNormalTextureInfo;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: GLTFMaterialOcclusionTextureInfo;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: GLTFTextureInfo;\n /**\n * The emissive color of the material.\n */\n emissiveFactor?: number[];\n /**\n * The alpha rendering mode of the material.\n */\n alphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string;\n /**\n * The alpha cutoff value of the material.\n */\n alphaCutoff?: number;\n /**\n * Specifies whether the material is double sided.\n */\n doubleSided?: boolean;\n // [k: string]: any;\n};\n\n/**\n * Geometry to be rendered with the given material.\n */\nexport type GLTFMeshPrimitive = {\n /**\n * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.\n */\n attributes: {\n [k: string]: GLTFId;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: GLTFId;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: GLTFId;\n /**\n * The type of primitives to render.\n */\n mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;\n /**\n * An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target.\n */\n targets?: {\n [k: string]: GLTFId;\n }[];\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.\n */\n\nexport type GLTFMesh = {\n id?: string;\n /**\n * An array of primitives, each defining geometry to be rendered with a material.\n */\n primitives: GLTFMeshPrimitive[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.\n */\nexport type GLTFNode = {\n /**\n * The index of the camera referenced by this node.\n */\n camera?: GLTFId;\n /**\n * The indices of this node's children.\n */\n children?: GLTFId[];\n /**\n * The index of the skin referenced by this node.\n */\n skin?: GLTFId;\n /**\n * A floating-point 4x4 transformation matrix stored in column-major order.\n */\n matrix?: number[];\n /**\n * The index of the mesh in this node.\n */\n mesh?: GLTFId;\n /**\n * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.\n */\n rotation?: number[];\n /**\n * The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.\n */\n scale?: number[];\n /**\n * The node's translation along the x, y, and z axes.\n */\n translation?: number[];\n /**\n * The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Texture sampler properties for filtering and wrapping modes.\n */\nexport type GLTFSampler = {\n /**\n * Magnification filter.\n */\n magFilter?: 9728 | 9729 | number;\n /**\n * Minification filter.\n */\n minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;\n /**\n * s wrapping mode.\n */\n wrapS?: 33071 | 33648 | 10497 | number;\n /**\n * t wrapping mode.\n */\n wrapT?: 33071 | 33648 | 10497 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root nodes of a scene.\n */\nexport type GLTFScene = {\n /**\n * The indices of each root node.\n */\n nodes?: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Joints and matrices defining a skin.\n */\nexport type GLTFSkin = {\n id?: string;\n /**\n * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.\n */\n inverseBindMatrices?: GLTFId;\n /**\n * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.\n */\n skeleton?: GLTFId;\n /** Indices of skeleton nodes, used as joints in this skin. */\n joints: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A texture and its sampler.\n */\nexport type GLTFTexture = {\n /** The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used. */\n sampler?: GLTFId;\n /** The index of the image used by this texture. */\n source?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root object for a glTF asset.\n */\nexport type GLTF = {\n /**\n * Names of glTF extensions used somewhere in this asset.\n */\n extensionsUsed?: string[];\n /**\n * Names of glTF extensions required to properly load this asset.\n */\n extensionsRequired?: string[];\n /**\n * An array of accessors.\n */\n accessors?: GLTFAccessor[];\n /**\n * An array of keyframe animations.\n */\n animations?: GLTFAnimation[];\n /**\n * Metadata about the glTF asset.\n */\n asset: GLTFAsset;\n /**\n * An array of buffers.\n */\n buffers?: GLTFBuffer[];\n /**\n * An array of bufferViews.\n */\n bufferViews?: GLTFBufferView[];\n /**\n * An array of cameras.\n */\n cameras?: GLTFCamera[];\n /**\n * An array of images.\n */\n images?: GLTFImage[];\n /**\n * An array of materials.\n */\n materials?: GLTFMaterial[];\n /**\n * An array of meshes.\n */\n meshes?: GLTFMesh[];\n /**\n * An array of nodes.\n */\n nodes?: GLTFNode[];\n /**\n * An array of samplers.\n */\n samplers?: GLTFSampler[];\n /**\n * The index of the default scene.\n */\n scene?: GLTFId;\n /**\n * An array of scenes.\n */\n scenes?: GLTFScene[];\n /**\n * An array of skins.\n */\n skins?: GLTFSkin[];\n /**\n * An array of textures.\n */\n textures?: GLTFTexture[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n [k: string]: unknown;\n};\n\n// GLTF Extensions\n/* eslint-disable camelcase */\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/1.0/Khronos/KHR_binary_glTF\n * TODO - this can be used on both images and shaders\n */\nexport type GLTF_KHR_binary_glTF = {\n bufferView: number;\n // required for images but not shaders\n mimeType?: string;\n height?: number;\n width?: number;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\nexport type GLTF_KHR_draco_mesh_compression = {\n bufferView: GLTFId;\n attributes: {[name: string]: number};\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\nexport type GLTF_KHR_texture_basisu = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n * buffer: number; //\tThe index of the buffer with compressed data.\t✅ Required\n * byteOffset\tinteger\tThe offset into the buffer in bytes.\tDefault: 0\n * byteLength\tinteger\tThe length of the compressed data in bytes.\t✅ Required\n * byteStride\tinteger\tThe stride, in bytes.\t✅ Required\n * count\tinteger\tThe number of elements.\t✅ Required\n * mode\tstring\tThe compression mode.\t✅ Required\n * filter\tstring\tThe compression filter.\tDefault: \"NONE\"\n */\nexport type GLTF_EXT_meshopt_compression = {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: 'ATTRIBUTES' | 'TRIANGLES' | 'INDICES';\n filter?: 'NONE' | 'OCTAHEDRAL' | 'QUATERNION' | 'EXPONENTIAL';\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\nexport type GLTF_EXT_texture_webp = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds\n */\nexport type GLTF_MSFT_texture_dds = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1\n * @todo belom88 complete typings\n */\nexport type GLTF_EXT_mesh_features = {\n featureIds: {\n featureCount: number;\n nullFeatureId: number;\n label: string;\n attribute: any;\n texture: any;\n propertyTable: number;\n }[];\n extensions?: any;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1\n */\nexport type GLTF_EXT_feature_metadata = {\n /** An object defining classes and enums. */\n schema?: ExtFeatureMetadataSchema;\n /** A uri to an external schema file. */\n schemaUri?: string;\n /** An object containing statistics about features. */\n statistics?: Statistics;\n /** A dictionary, where each key is a feature table ID and each value is an object defining the feature table. */\n featureTables?: {\n [key: string]: EXT_feature_metadata_feature_table;\n };\n /** A dictionary, where each key is a feature texture ID and each value is an object defining the feature texture. */\n featureTextures?: {\n [key: string]: FeatureTexture;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#schema\n */\ntype ExtFeatureMetadataSchema = {\n /** The name of the schema. */\n name?: string;\n /** The description of the schema. */\n description?: string;\n /** Application-specific version of the schema. */\n version?: string;\n /** A dictionary, where each key is a class ID and each value is an object defining the class. */\n classes?: {\n [key: string]: EXT_feature_metadata_class_object;\n };\n /** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */\n enums?: {\n [key: string]: ExtFeatureMetadataEnum;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class\n */\nexport type EXT_feature_metadata_class_object = {\n /** The name of the class, e.g. for display purposes. */\n name?: string;\n /** The description of the class. */\n description?: string;\n /** A dictionary, where each key is a property ID and each value is an object defining the property. */\n properties: {\n [key: string]: ClassProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-property\n */\nexport type ClassProperty = {\n /** The name of the property, e.g. for display purposes. */\n name?: string;\n /** The description of the property. */\n description?: string;\n /**\n * The property type. If ENUM is used, then enumType must also be specified.\n * If ARRAY is used, then componentType must also be specified.\n * ARRAY is a fixed-length array when componentCount is defined, and variable-length otherwise.\n */\n type: ClassPropertyType;\n /**\n * An enum ID as declared in the enums dictionary.\n * This value must be specified when type or componentType is ENUM.\n */\n enumType?: string;\n /**\n * When type is ARRAY this indicates the type of each component of the array.\n * If ENUM is used, then enumType must also be specified.\n */\n componentType?:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM';\n /** The number of components per element for ARRAY elements. */\n componentCount?: number;\n /**\n * Specifies whether integer values are normalized.\n * This applies both when type is an integer type, or when type is ARRAY with a componentType that is an integer type.\n * For unsigned integer types, values are normalized between [0.0, 1.0].\n * For signed integer types, values are normalized between [-1.0, 1.0].\n * For all other types, this property is ignored.\n */\n normalized: boolean;\n /**\n * Maximum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n max?: number | number[];\n /**\n * Minimum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n min?: number | number[];\n\n /**\n * A default value to use when the property value is not defined.\n * If used, optional must be set to true.\n * The type of the default value must match the property definition: For BOOLEAN use true or false.\n * For STRING use a JSON string. For a numeric type use a JSON number.\n * For ENUM use the enum name, not the integer value.\n * For ARRAY use a JSON array containing values matching the componentType.\n */\n default?: boolean | number | string | number[];\n /** If true, this property is optional. */\n optional?: boolean; // default false;\n /**\n * An identifier that describes how this property should be interpreted.\n * The semantic cannot be used by other properties in the class.\n */\n semantic?: string;\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#classpropertytype\n */\ntype ClassPropertyType =\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | 'ARRAY';\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum\n */\ntype ExtFeatureMetadataEnum = {\n /** The name of the enum, e.g. for display purposes. */\n name?: string;\n /** The description of the enum. */\n description?: string;\n /** The type of the integer enum value. */\n valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: \"UINT16\"\n /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */\n values: EnumValue[];\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum-value\n */\ntype EnumValue = {\n /** The name of the enum value. */\n name: string;\n /** The description of the enum value. */\n description?: string;\n /** The integer enum value. */\n value: number; // default: \"UINT16\"\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table\n */\nexport type EXT_feature_metadata_feature_table = {\n featureTable: any;\n /** The class that property values conform to. The value must be a class ID declared in the classes dictionary. */\n class?: string;\n /** The number of features, as well as the number of elements in each property array. */\n count: number;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value is an object describing where property values are stored.\n * Optional properties may be excluded from this dictionary.\n */\n properties?: {\n [key: string]: FeatureTableProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table-property\n */\nexport type FeatureTableProperty = {\n /**\n * The index of the buffer view containing property values.\n * The data type of property values is determined by the property definition:\n * When type is BOOLEAN values are packed into a bitfield.\n * When type is STRING values are stored as byte sequences and decoded as UTF-8 strings.\n * When type is a numeric type values are stored as the provided type.\n * When type is ENUM values are stored as the enum's valueType.\n * Each enum value in the buffer must match one of the allowed values in the enum definition.\n * When type is ARRAY elements are packed tightly together and the data type is based on the componentType following the same rules as above.\n * arrayOffsetBufferView is required for variable-size arrays\n * and stringOffsetBufferView is required for strings (for variable-length arrays of strings, both are required)\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes.\n * If the buffer view's buffer is the GLB-stored BIN chunk the byte offset is measured relative to the beginning of the GLB.\n * Otherwise it is measured relative to the beginning of the buffer.\n */\n bufferView: number;\n\n /** The type of values in arrayOffsetBufferView and stringOffsetBufferView. */\n offsetType?: string; // default: \"UINT32\"\n /**\n * The index of the buffer view containing offsets for variable-length arrays.\n * The number of offsets is equal to the feature table count plus one.\n * The offsets represent the start positions of each array, with the last offset representing the position after the last array.\n * The array length is computed using the difference between the current offset and the subsequent offset.\n * If componentType is STRING the offsets index into the string offsets array (stored in stringOffsetBufferView),\n * otherwise they index into the property array (stored in bufferView).\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView\n */\n arrayOffsetBufferView?: number;\n /**\n * The index of the buffer view containing offsets for strings.\n * The number of offsets is equal to the number of string components plus one.\n * The offsets represent the byte offsets of each string in the main bufferView,\n * with the last offset representing the byte offset after the last string.\n * The string byte length is computed using the difference between the current offset and the subsequent offset.\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView.\n */\n stringOffsetBufferView?: number;\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-texture\n */\ntype FeatureTexture = {\n /** The class this feature texture conforms to. The value must be a class ID declared in the classes dictionary. */\n class: string;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value describes the texture channels containing property values.\n */\n properties: {\n [key: string]: TextureAccessor;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\nexport type {FeatureTexture as EXT_feature_metadata_feature_texture};\nexport type {TextureAccessor as FeatureTextureProperty};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#texture-accessor\n */\ntype TextureAccessor = {\n /** Texture channels containing property values. Channels are labeled by rgba and are swizzled with a string of 1-4 characters. */\n channels: string;\n /** The glTF texture and texture coordinates to use. */\n texture: GLTFTextureInfo;\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#statistics-1\n */\ntype Statistics = {\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about features that conform to the class.\n */\n classes?: {\n [key: string]: ClassStatistics;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-statistics\n */\ntype ClassStatistics = {\n /** The number of features that conform to the class. */\n count?: number;\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about property values.\n */\n properties?: {\n [key: string]: StatisticsClassProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#property-statistics\n * min, max, mean, median, standardDeviation, variance, sum are\n * only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values.\n */\ntype StatisticsClassProperty = {\n /** The minimum property value. */\n min?: number | number[];\n /** The maximum property value. */\n max?: number | number[];\n /** The arithmetic mean of the property values. */\n mean?: number | number[];\n /** The median of the property values. */\n median?: number | number[];\n /** The standard deviation of the property values. */\n standardDeviation?: number | number[];\n /** The variance of the property values. */\n variance?: number | number[];\n /** The sum of the property values. */\n sum?: number | number[];\n /**\n * A dictionary, where each key corresponds to an enum name and each value is the number of occurrences of that enum.\n * Only applicable when type or componentType is ENUM.\n * For fixed-length arrays, this is an array with componentCount number of elements.\n */\n occurrences: {\n [key: string]: number | number[];\n };\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * 3DTilesNext EXT_feature_metadata primitive extension\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extension\n */\nexport type GLTF_EXT_feature_metadata_primitive = {\n /** Feature ids definition in attributes */\n featureIdAttributes?: GLTF_EXT_feature_metadata_attribute[];\n /** Feature ids definition in textures */\n featureIdTextures?: GLTF_EXT_feature_metadata_attribute[];\n /** An array of IDs of feature textures from the root EXT_feature_metadata object. */\n featureTextures?: string[];\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Attribute which described featureIds definition.\n */\nexport type GLTF_EXT_feature_metadata_attribute = {\n /** Name of feature table */\n featureTable: string;\n /** Described how feature ids are defined */\n featureIds: ExtFeatureMetadataFeatureIds;\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * Defining featureIds by attributes or implicitly.\n */\ntype ExtFeatureMetadataFeatureIds = {\n /** Name of attribute where featureIds are defined */\n attribute?: string;\n /** Sets a constant feature ID for each vertex. The default is 0. */\n constant?: number;\n /** Sets the rate at which feature IDs increment.\n * If divisor is zero then constant is used.\n * If divisor is greater than zero the feature ID increments once per divisor sets of vertices, starting at constant.\n * The default is 0\n */\n divisor?: number;\n /** gLTF textureInfo object - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/specification/2.0/schema/textureInfo.schema.json */\n texture?: ExtFeatureMetadataTexture;\n /** Must be a single channel (\"r\", \"g\", \"b\", or \"a\") */\n channels?: 'r' | 'g' | 'b' | 'a';\n};\n\n/**\n * Reference to a texture.\n */\ntype ExtFeatureMetadataTexture = {\n /** The set index of texture's TEXCOORD attribute used for texture coordinate mapping.*/\n texCoord: number;\n /** The index of the texture. */\n index: number;\n};\n\nexport type GLTFObject =\n | GLTFAccessor\n | GLTFBuffer\n | GLTFBufferView\n | GLTFMeshPrimitive\n | GLTFMesh\n | GLTFNode\n | GLTFMaterial\n | GLTFSampler\n | GLTFScene\n | GLTFSkin\n | GLTFTexture\n | GLTFImage;\n"],"mappings":""}
1
+ {"version":3,"file":"gltf-json-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-json-schema.ts"],"sourcesContent":["// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license\n// Generated from official JSON schema using `npm run generate-interface` on 2018-02-24\n\nexport type GLTFId = number;\n\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparseIndices = {\n /**\n * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n /**\n * The indices data type.\n */\n componentType: 5121 | 5123 | 5125 | number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.\n */\nexport type GLTFAccessorSparseValues = {\n /**\n * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Sparse storage of attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparse = {\n /**\n * Number of entries stored in the sparse array.\n */\n count: number;\n /**\n * Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.\n */\n indices: GLTFAccessorSparseIndices;\n /**\n * Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.\n */\n values: GLTFAccessorSparseValues;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.\n */\nexport type GLTFAccessor = {\n /**\n * The index of the bufferView.\n */\n bufferView?: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes.\n */\n byteOffset?: number;\n /**\n * The datatype of components in the attribute.\n */\n componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number;\n /**\n * Specifies whether integer data values should be normalized.\n */\n normalized?: boolean;\n /**\n * The number of attributes referenced by this accessor.\n */\n count: number;\n /**\n * Specifies if the attribute is a scalar, vector, or matrix.\n */\n type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | string;\n /**\n * Maximum value of each component in this attribute.\n */\n max?: number[];\n /**\n * Minimum value of each component in this attribute.\n */\n min?: number[];\n /**\n * Sparse storage of attributes that deviate from their initialization value.\n */\n sparse?: GLTFAccessorSparse;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The index of the node and TRS property that an animation channel targets.\n */\nexport type GLTFAnimationChannelTarget = {\n /**\n * The index of the node to target.\n */\n node?: GLTFId;\n /**\n * The name of the node's TRS property to modify, or the \"weights\" of the Morph Targets it instantiates. For the \"translation\" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the \"rotation\" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the \"scale\" property, the values are the scaling factors along the x, y, and z axes.\n */\n path: 'translation' | 'rotation' | 'scale' | 'weights' | string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Targets an animation's sampler at a node's property.\n */\nexport type GLTFAnimationChannel = {\n /**\n * The index of a sampler in this animation used to compute the value for the target.\n */\n sampler: GLTFId;\n /**\n * The index of the node and TRS property to target.\n */\n target: GLTFAnimationChannelTarget;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\nexport type GLTFAnimationSampler = {\n /**\n * The index of an accessor containing keyframe input values, e.g., time.\n */\n input: GLTFId;\n /**\n * Interpolation algorithm.\n */\n interpolation?: 'LINEAR' | 'STEP' | 'CUBICSPLINE' | string;\n /**\n * The index of an accessor, containing keyframe output values.\n */\n output: GLTFId;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A keyframe animation.\n */\nexport type GLTFAnimation = {\n /**\n * An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.\n */\n channels: GLTFAnimationChannel[];\n /**\n * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\n samplers: GLTFAnimationSampler[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Metadata about the glTF asset.\n */\nexport type GLTFAsset = {\n /**\n * A copyright message suitable for display to credit the content creator.\n */\n copyright?: string;\n /**\n * Tool that generated this glTF model. Useful for debugging.\n */\n generator?: string;\n /**\n * The glTF version that this asset targets.\n */\n version: string;\n /**\n * The minimum glTF version that this asset targets.\n */\n minVersion?: string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport type GLTFBuffer = {\n /**\n * The uri of the buffer.\n */\n uri?: string;\n /**\n * The length of the buffer in bytes.\n */\n byteLength: number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A view into a buffer generally representing a subset of the buffer.\n */\nexport type GLTFBufferView = {\n /**\n * The index of the buffer.\n */\n buffer: GLTFId;\n /**\n * The offset into the buffer in bytes.\n */\n byteOffset?: number;\n /**\n * The length of the bufferView in bytes.\n */\n byteLength: number;\n /**\n * The stride, in bytes.\n */\n byteStride?: number;\n /**\n * The target that the GPU buffer should be bound to.\n */\n target?: 34962 | 34963 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\nexport type GLTFCameraOrthographic = {\n /**\n * The floating-point horizontal magnification of the view. Must not be zero.\n */\n xmag: number;\n /**\n * The floating-point vertical magnification of the view. Must not be zero.\n */\n ymag: number;\n /**\n * The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.\n */\n zfar: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\nexport type GLTFCameraPerspective = {\n /**\n * The floating-point aspect ratio of the field of view.\n */\n aspectRatio?: number;\n /**\n * The floating-point vertical field of view in radians.\n */\n yfov: number;\n /**\n * The floating-point distance to the far clipping plane.\n */\n zfar?: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.\n */\nexport type GLTFCamera = {\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: GLTFCameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: GLTFCameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.\n */\nexport type GLTFImage = {\n /**\n * The uri of the image.\n */\n uri?: string;\n /**\n * The image's MIME type.\n */\n mimeType?: 'image/jpeg' | 'image/png' | string;\n /**\n * The index of the bufferView that contains the image. Use this instead of the image's uri property.\n */\n bufferView?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Reference to a texture.\n */\nexport type GLTFTextureInfo = {\n /**\n * The index of the texture.\n */\n index: GLTFId;\n /**\n * The set index of texture's TEXCOORD attribute used for texture coordinate mapping.\n */\n texCoord?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.\n */\nexport type GLTFMaterialPbrMetallicRoughness = {\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: GLTFTextureInfo;\n /**\n * The metalness of the material.\n */\n metallicFactor?: number;\n /**\n * The roughness of the material.\n */\n roughnessFactor?: number;\n /**\n * The metallic-roughness texture.\n */\n metallicRoughnessTexture?: GLTFTextureInfo;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialNormalTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * The scalar multiplier applied to each normal vector of the normal texture.\n */\n scale?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialOcclusionTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The material appearance of a primitive.\n */\nexport type GLTFMaterial = {\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n /**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.\n */\n pbrMetallicRoughness?: GLTFMaterialPbrMetallicRoughness;\n /**\n * The normal map texture.\n */\n normalTexture?: GLTFMaterialNormalTextureInfo;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: GLTFMaterialOcclusionTextureInfo;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: GLTFTextureInfo;\n /**\n * The emissive color of the material.\n */\n emissiveFactor?: number[];\n /**\n * The alpha rendering mode of the material.\n */\n alphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string;\n /**\n * The alpha cutoff value of the material.\n */\n alphaCutoff?: number;\n /**\n * Specifies whether the material is double sided.\n */\n doubleSided?: boolean;\n // [k: string]: any;\n};\n\n/**\n * Geometry to be rendered with the given material.\n */\nexport type GLTFMeshPrimitive = {\n /**\n * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.\n */\n attributes: {\n [k: string]: GLTFId;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: GLTFId;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: GLTFId;\n /**\n * The type of primitives to render.\n */\n mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;\n /**\n * An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target.\n */\n targets?: {\n [k: string]: GLTFId;\n }[];\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.\n */\n\nexport type GLTFMesh = {\n id?: string;\n /**\n * An array of primitives, each defining geometry to be rendered with a material.\n */\n primitives: GLTFMeshPrimitive[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.\n */\nexport type GLTFNode = {\n /**\n * The index of the camera referenced by this node.\n */\n camera?: GLTFId;\n /**\n * The indices of this node's children.\n */\n children?: GLTFId[];\n /**\n * The index of the skin referenced by this node.\n */\n skin?: GLTFId;\n /**\n * A floating-point 4x4 transformation matrix stored in column-major order.\n */\n matrix?: number[];\n /**\n * The index of the mesh in this node.\n */\n mesh?: GLTFId;\n /**\n * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.\n */\n rotation?: number[];\n /**\n * The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.\n */\n scale?: number[];\n /**\n * The node's translation along the x, y, and z axes.\n */\n translation?: number[];\n /**\n * The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Texture sampler properties for filtering and wrapping modes.\n */\nexport type GLTFSampler = {\n /**\n * Magnification filter.\n */\n magFilter?: 9728 | 9729 | number;\n /**\n * Minification filter.\n */\n minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;\n /**\n * s wrapping mode.\n */\n wrapS?: 33071 | 33648 | 10497 | number;\n /**\n * t wrapping mode.\n */\n wrapT?: 33071 | 33648 | 10497 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root nodes of a scene.\n */\nexport type GLTFScene = {\n /**\n * The indices of each root node.\n */\n nodes?: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Joints and matrices defining a skin.\n */\nexport type GLTFSkin = {\n id?: string;\n /**\n * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.\n */\n inverseBindMatrices?: GLTFId;\n /**\n * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.\n */\n skeleton?: GLTFId;\n /** Indices of skeleton nodes, used as joints in this skin. */\n joints: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A texture and its sampler.\n */\nexport type GLTFTexture = {\n /** The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used. */\n sampler?: GLTFId;\n /** The index of the image used by this texture. */\n source?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root object for a glTF asset.\n */\nexport type GLTF = {\n /**\n * Names of glTF extensions used somewhere in this asset.\n */\n extensionsUsed?: string[];\n /**\n * Names of glTF extensions required to properly load this asset.\n */\n extensionsRequired?: string[];\n /**\n * An array of accessors.\n */\n accessors?: GLTFAccessor[];\n /**\n * An array of keyframe animations.\n */\n animations?: GLTFAnimation[];\n /**\n * Metadata about the glTF asset.\n */\n asset: GLTFAsset;\n /**\n * An array of buffers.\n */\n buffers?: GLTFBuffer[];\n /**\n * An array of bufferViews.\n */\n bufferViews?: GLTFBufferView[];\n /**\n * An array of cameras.\n */\n cameras?: GLTFCamera[];\n /**\n * An array of images.\n */\n images?: GLTFImage[];\n /**\n * An array of materials.\n */\n materials?: GLTFMaterial[];\n /**\n * An array of meshes.\n */\n meshes?: GLTFMesh[];\n /**\n * An array of nodes.\n */\n nodes?: GLTFNode[];\n /**\n * An array of samplers.\n */\n samplers?: GLTFSampler[];\n /**\n * The index of the default scene.\n */\n scene?: GLTFId;\n /**\n * An array of scenes.\n */\n scenes?: GLTFScene[];\n /**\n * An array of skins.\n */\n skins?: GLTFSkin[];\n /**\n * An array of textures.\n */\n textures?: GLTFTexture[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n [k: string]: unknown;\n};\n\nexport type GLTFObject =\n | GLTFAccessor\n | GLTFBuffer\n | GLTFBufferView\n | GLTFMeshPrimitive\n | GLTFMesh\n | GLTFNode\n | GLTFMaterial\n | GLTFSampler\n | GLTFScene\n | GLTFSkin\n | GLTFTexture\n | GLTFImage;\n\n// GLTF Extensions\n/* eslint-disable camelcase */\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/1.0/Khronos/KHR_binary_glTF\n * TODO - this can be used on both images and shaders\n */\nexport type GLTF_KHR_binary_glTF = {\n bufferView: number;\n // required for images but not shaders\n mimeType?: string;\n height?: number;\n width?: number;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\nexport type GLTF_KHR_draco_mesh_compression = {\n bufferView: GLTFId;\n attributes: {[name: string]: number};\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\nexport type GLTF_KHR_texture_basisu = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n * buffer: number; //\tThe index of the buffer with compressed data.\t✅ Required\n * byteOffset\tinteger\tThe offset into the buffer in bytes.\tDefault: 0\n * byteLength\tinteger\tThe length of the compressed data in bytes.\t✅ Required\n * byteStride\tinteger\tThe stride, in bytes.\t✅ Required\n * count\tinteger\tThe number of elements.\t✅ Required\n * mode\tstring\tThe compression mode.\t✅ Required\n * filter\tstring\tThe compression filter.\tDefault: \"NONE\"\n */\nexport type GLTF_EXT_meshopt_compression = {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: 'ATTRIBUTES' | 'TRIANGLES' | 'INDICES';\n filter?: 'NONE' | 'OCTAHEDRAL' | 'QUATERNION' | 'EXPONENTIAL';\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\nexport type GLTF_EXT_texture_webp = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds\n */\nexport type GLTF_MSFT_texture_dds = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * EXT_mesh_features extension types\n * This is a primitive-level extension\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features\n *\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_mesh_features/schema/mesh.primitive.EXT_mesh_features.schema.json\n * An object describing feature IDs for a mesh primitive.\n */\nexport type GLTF_EXT_mesh_features = {\n /** An array of feature ID sets. */\n featureIds: GLTF_EXT_mesh_features_featureId[];\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * JSON Schema https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_mesh_features/schema/featureId.schema.json\n * Feature IDs stored in an attribute or texture.\n */\nexport type GLTF_EXT_mesh_features_featureId = {\n /** The number of unique features in the attribute or texture. */\n featureCount: number;\n /** A value that indicates that no feature is associated with this vertex or texel. */\n nullFeatureId: number;\n /** A label assigned to this feature ID set. Labels must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. */\n label: string;\n /**\n * An attribute containing feature IDs. When `attribute` and `texture` are omitted the feature IDs are assigned to vertices by their index.\n * Schema https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features/schema/featureIdAttribute.schema.json\n * An integer value used to construct a string in the format `_FEATURE_ID_<set index>` which is a reference to a key in `mesh.primitives.attributes`\n * (e.g. a value of `0` corresponds to `_FEATURE_ID_0`).\n */\n attribute: number;\n /** A texture containing feature IDs. */\n texture: any;\n /** The index of the property table containing per-feature property values. Only applicable when using the `EXT_structural_metadata` extension. */\n propertyTable: number;\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * JSON Schema https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_mesh_features/schema/featureIdTexture.schema.json\n * Feature ID Texture in EXT_mesh_features\n */\nexport type GLTF_EXT_mesh_features_featureIdTexture = {\n /**\n * Texture channels containing feature IDs, identified by index. Feature IDs may be packed into multiple channels if a single channel does not have sufficient\n * bit depth to represent all feature ID values. The values are packed in little-endian order.\n */\n channels: number[];\n /** Texture index in the glTF textures array */\n index: number;\n /** Textcoord index in the primitive attribute (eg. 0 for TEXTCOORD_0, 1 for TEXTCOORD_1 etc...) */\n texCoord: number;\n extensions: Record<string, any>;\n extras: any;\n};\n\n/**\n * EXT_feature_metadata extension types\n * This extension has glTF-level metadata and primitive-level feature indexing and segmentation metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata\n *\n * glTF-level metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/glTF.EXT_feature_metadata.schema.json\n */\nexport type GLTF_EXT_feature_metadata_GLTF = {\n /** An object defining classes and enums. */\n schema?: GLTF_EXT_feature_metadata_Schema;\n /** A uri to an external schema file. */\n schemaUri?: string;\n /** An object containing statistics about features. */\n statistics?: GLTF_EXT_feature_metadata_Statistics;\n /** A dictionary, where each key is a feature table ID and each value is an object defining the feature table. */\n featureTables?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTable;\n };\n /** A dictionary, where each key is a feature texture ID and each value is an object defining the feature texture. */\n featureTextures?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTexture;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * An object defining classes and enums.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#schema\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/schema.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Schema = {\n /** The name of the schema. */\n name?: string;\n /** The description of the schema. */\n description?: string;\n /** Application-specific version of the schema. */\n version?: string;\n /** A dictionary, where each key is a class ID and each value is an object defining the class. */\n classes?: {\n [key: string]: GLTF_EXT_feature_metadata_Class;\n };\n /** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */\n enums?: {\n [key: string]: GLTF_EXT_feature_metadata_Enum;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * A class containing a set of properties.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/class.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Class = {\n /** The name of the class, e.g. for display purposes. */\n name?: string;\n /** The description of the class. */\n description?: string;\n /** A dictionary, where each key is a property ID and each value is an object defining the property. */\n properties: {\n [key: string]: GLTF_EXT_feature_metadata_ClassProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * A class property.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-property\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_ClassProperty = {\n /** The name of the property, e.g. for display purposes. */\n name?: string;\n /** The description of the property. */\n description?: string;\n /**\n * The property type. If ENUM is used, then enumType must also be specified.\n * If ARRAY is used, then componentType must also be specified.\n * ARRAY is a fixed-length array when componentCount is defined, and variable-length otherwise.\n */\n type:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | 'ARRAY'\n | string;\n /**\n * An enum ID as declared in the enums dictionary.\n * This value must be specified when type or componentType is ENUM.\n */\n enumType?: string;\n /**\n * When type is ARRAY this indicates the type of each component of the array.\n * If ENUM is used, then enumType must also be specified.\n */\n componentType?:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | string;\n /** The number of components per element for ARRAY elements. */\n componentCount?: number;\n /**\n * Specifies whether integer values are normalized.\n * This applies both when type is an integer type, or when type is ARRAY with a componentType that is an integer type.\n * For unsigned integer types, values are normalized between [0.0, 1.0].\n * For signed integer types, values are normalized between [-1.0, 1.0].\n * For all other types, this property is ignored.\n */\n normalized: boolean;\n /**\n * Maximum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n max?: number | number[];\n /**\n * Minimum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n min?: number | number[];\n /**\n * A default value to use when the property value is not defined.\n * If used, optional must be set to true.\n * The type of the default value must match the property definition: For BOOLEAN use true or false.\n * For STRING use a JSON string. For a numeric type use a JSON number.\n * For ENUM use the enum name, not the integer value.\n * For ARRAY use a JSON array containing values matching the componentType.\n */\n default?: boolean | number | string | number[];\n /** If true, this property is optional. */\n optional?: boolean; // default false;\n /**\n * An identifier that describes how this property should be interpreted.\n * The semantic cannot be used by other properties in the class.\n */\n semantic?: string;\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * An object defining the values of an enum.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/enum.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Enum = {\n /** The name of the enum, e.g. for display purposes. */\n name?: string;\n /** The description of the enum. */\n description?: string;\n /** The type of the integer enum value. */\n valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: \"UINT16\"\n /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */\n values: GLTF_EXT_feature_metadata_EnumValue[];\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * An enum value.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum-value\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/enum.value.schema.json\n */\nexport type GLTF_EXT_feature_metadata_EnumValue = {\n /** The name of the enum value. */\n name: string;\n /** The description of the enum value. */\n description?: string;\n /** The integer enum value. */\n value: number; // default: \"UINT16\"\n extensions?: Record<string, any>;\n extras?: any;\n [key: string]: any;\n};\n\n/**\n * A feature table defined by a class and property values stored in arrays.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table\n * JSON Schenma - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTable.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTable = {\n /** The class that property values conform to. The value must be a class ID declared in the classes dictionary. */\n class?: string;\n /** The number of features, as well as the number of elements in each property array. */\n count: number;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value is an object describing where property values are stored.\n * Optional properties may be excluded from this dictionary.\n */\n properties?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTableProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * An array of binary property values.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table-property\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTable.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTableProperty = {\n /**\n * The index of the buffer view containing property values.\n * The data type of property values is determined by the property definition:\n * When type is BOOLEAN values are packed into a bitfield.\n * When type is STRING values are stored as byte sequences and decoded as UTF-8 strings.\n * When type is a numeric type values are stored as the provided type.\n * When type is ENUM values are stored as the enum's valueType.\n * Each enum value in the buffer must match one of the allowed values in the enum definition.\n * When type is ARRAY elements are packed tightly together and the data type is based on the componentType following the same rules as above.\n * arrayOffsetBufferView is required for variable-size arrays\n * and stringOffsetBufferView is required for strings (for variable-length arrays of strings, both are required)\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes.\n * If the buffer view's buffer is the GLB-stored BIN chunk the byte offset is measured relative to the beginning of the GLB.\n * Otherwise it is measured relative to the beginning of the buffer.\n */\n bufferView: number;\n\n /** The type of values in arrayOffsetBufferView and stringOffsetBufferView. */\n offsetType?: string; // default: \"UINT32\"\n /**\n * The index of the buffer view containing offsets for variable-length arrays.\n * The number of offsets is equal to the feature table count plus one.\n * The offsets represent the start positions of each array, with the last offset representing the position after the last array.\n * The array length is computed using the difference between the current offset and the subsequent offset.\n * If componentType is STRING the offsets index into the string offsets array (stored in stringOffsetBufferView),\n * otherwise they index into the property array (stored in bufferView).\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView\n */\n arrayOffsetBufferView?: number;\n /**\n * The index of the buffer view containing offsets for strings.\n * The number of offsets is equal to the number of string components plus one.\n * The offsets represent the byte offsets of each string in the main bufferView,\n * with the last offset representing the byte offset after the last string.\n * The string byte length is computed using the difference between the current offset and the subsequent offset.\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView.\n */\n stringOffsetBufferView?: number;\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data: any;\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * Features whose property values are stored directly in texture channels. This is not to be confused with feature ID textures which store feature IDs for use with a feature table.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-texture\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTexture.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTexture = {\n /** The class this feature texture conforms to. The value must be a class ID declared in the classes dictionary. */\n class: string;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value describes the texture channels containing property values.\n */\n properties: {\n [key: string]: GLTF_EXT_feature_metadata_TextureAccessor;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * A description of how to access property values from the color channels of a texture.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#texture-accessor\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/textureAccessor.schema.json\n */\nexport type GLTF_EXT_feature_metadata_TextureAccessor = {\n /** Texture channels containing property values. Channels are labeled by rgba and are swizzled with a string of 1-4 characters. */\n channels: string;\n /** The glTF texture and texture coordinates to use. */\n texture: GLTFTextureInfo;\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data: any;\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * Statistics about features.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#statistics-1\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Statistics = {\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about features that conform to the class.\n */\n classes?: {\n [key: string]: GLTF_EXT_feature_metadata_StatisticsClass;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * Statistics about features that conform to the class.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-statistics\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_StatisticsClass = {\n /** The number of features that conform to the class. */\n count?: number;\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about property values.\n */\n properties?: {\n [key: string]: GLTF_EXT_feature_metadata_StatisticsClassProperty;\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * min, max, mean, median, standardDeviation, variance, sum are\n * only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#property-statistics\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_StatisticsClassProperty = {\n /** The minimum property value. */\n min?: number | number[];\n /** The maximum property value. */\n max?: number | number[];\n /** The arithmetic mean of the property values. */\n mean?: number | number[];\n /** The median of the property values. */\n median?: number | number[];\n /** The standard deviation of the property values. */\n standardDeviation?: number | number[];\n /** The variance of the property values. */\n variance?: number | number[];\n /** The sum of the property values. */\n sum?: number | number[];\n /**\n * A dictionary, where each key corresponds to an enum name and each value is the number of occurrences of that enum.\n * Only applicable when type or componentType is ENUM.\n * For fixed-length arrays, this is an array with componentCount number of elements.\n */\n occurrences: {\n [key: string]: number | number[];\n };\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * EXT_feature_metadata extension types\n * This extension has glTF-level metadata and primitive-level (feature indexing and segmentation) metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata\n *\n * primitive-level metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extension\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/mesh.primitive.EXT_feature_metadata.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Primitive = {\n /** Feature ids definition in attributes */\n featureIdAttributes?: GLTF_EXT_feature_metadata_FeatureIdAttribute[];\n /** Feature ids definition in textures */\n featureIdTextures?: GLTF_EXT_feature_metadata_FeatureIdTexture[];\n /** An array of IDs of feature textures from the root EXT_feature_metadata object. */\n featureTextures?: string[];\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * Attribute which described featureIds definition.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-id-attribute\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdAttribute.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdAttribute = {\n /** Name of feature table */\n featureTable: string;\n /** Described how feature ids are defined */\n featureIds: GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds;\n extensions?: Record<string, any>;\n extras?: any;\n};\n\n/**\n * Defining featureIds by attributes or implicitly.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extensionfeatureidattributes\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdAttribute.featureIds.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds = {\n /** Name of attribute where featureIds are defined */\n attribute?: string;\n /** Sets a constant feature ID for each vertex. The default is 0. */\n constant?: number;\n /** Sets the rate at which feature IDs increment.\n * If divisor is zero then constant is used.\n * If divisor is greater than zero the feature ID increments once per divisor sets of vertices, starting at constant.\n * The default is 0\n */\n divisor?: number;\n};\n\n/**\n * An object describing a texture used for storing per-texel feature IDs.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-id-texture\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdTexture.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdTexture = {\n /** The ID of the feature table in the model's root `EXT_feature_metadata.featureTables` dictionary. */\n featureTable: string;\n /** A description of the texture and channel to use for feature IDs. The `channels` property must have a single channel. Furthermore,\n * feature IDs must be whole numbers in the range `[0, count - 1]` (inclusive), where `count` is the total number of features\n * in the feature table. Texel values must be read as integers. Texture filtering should be disabled when fetching feature IDs.\n */\n featureIds: GLTF_EXT_feature_metadata_FeatureIdTextureAccessor;\n};\n\n/**\n * A description of how to access property values from the color channels of a texture.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#featureidtexturefeatureids\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/textureAccessor.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdTextureAccessor = {\n /** gLTF textureInfo object - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/specification/2.0/schema/textureInfo.schema.json */\n texture: GLTFTextureInfo;\n /** Must be a single channel (\"r\", \"g\", \"b\", or \"a\") */\n channels: 'r' | 'g' | 'b' | 'a';\n};\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"gltf-types.js","names":[],"sources":["../../../../src/lib/types/gltf-types.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {GLTF} from './gltf-json-schema';\n\n/** GLTFLoader removes processed extensions from `extensionsUsed` and `extensionsUsed`\n * `processedExtensions` is used to track those extensions\n */\nexport type GLTFWithBuffers = {\n json: GLTF;\n binary?: ArrayBuffer;\n buffers: GLTFExternalBuffer[];\n images?: GLTFExternalImage[];\n};\n\ntype GLTFExternalBuffer = {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n};\n\ntype GLTFExternalImage =\n | ImageType\n | {\n compressed: true;\n mipmaps: false;\n width: number;\n height: number;\n data: Uint8Array;\n };\n\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n // GLTFCamera,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n GLTF_EXT_feature_metadata,\n GLTF_EXT_mesh_features\n} from './gltf-json-schema';\n\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFImagePostprocessed,\n GLTFNodePostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFTexturePostprocessed\n} from './gltf-postprocessed-schema';\n"],"mappings":""}
1
+ {"version":3,"file":"gltf-types.js","names":[],"sources":["../../../../src/lib/types/gltf-types.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {GLTF} from './gltf-json-schema';\n\n/** GLTFLoader removes processed extensions from `extensionsUsed` and `extensionsUsed`\n * `processedExtensions` is used to track those extensions\n */\nexport type GLTFWithBuffers = {\n json: GLTF;\n binary?: ArrayBuffer;\n buffers: GLTFExternalBuffer[];\n images?: GLTFExternalImage[];\n};\n\ntype GLTFExternalBuffer = {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n};\n\ntype GLTFExternalImage =\n | ImageType\n | {\n compressed: true;\n mipmaps: false;\n width: number;\n height: number;\n data: Uint8Array;\n };\n\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n // GLTFCamera,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp\n} from './gltf-json-schema';\n\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFImagePostprocessed,\n GLTFNodePostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFTexturePostprocessed\n} from './gltf-postprocessed-schema';\n"],"mappings":""}
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- var VERSION = typeof "4.0.0-alpha.12" !== 'undefined' ? "4.0.0-alpha.12" : 'latest';
7
+ var VERSION = typeof "4.0.0-alpha.14" !== 'undefined' ? "4.0.0-alpha.14" : 'latest';
8
8
  exports.VERSION = VERSION;
9
9
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["GLTFLoader","GLTFWriter","GLBLoader","GLBWriter","GLTFScenegraph","postProcessGLTF","getMemoryUsageGLTF","_getMemoryUsageGLTF"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable camelcase, indent */\nexport type {GLB} from './lib/types/glb-types';\n\n// Raw GLTF Types (i.e. not post-processed)\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTFObject,\n // The following extensions are handled by the GLTFLoader and removed from the parsed glTF (disable via options.gltf.excludeExtensions)\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n GLTF_EXT_feature_metadata,\n GLTF_EXT_feature_metadata_primitive,\n GLTF_EXT_feature_metadata_attribute,\n GLTF_EXT_mesh_features\n} from './lib/types/gltf-json-schema';\n\n// Postprocessed types (modified GLTF types)\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFNodePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFImagePostprocessed,\n GLTFTexturePostprocessed\n} from './lib/types/gltf-postprocessed-schema';\n\nexport type {GLTFWithBuffers} from './lib/types/gltf-types';\n\n// glTF loader/writer definition objects\nexport {GLTFLoader} from './gltf-loader';\nexport {GLTFWriter} from './gltf-writer';\n\n// GLB Loader & Writer (for custom formats that want to leverage the GLB binary \"envelope\")\nexport {GLBLoader} from './glb-loader';\nexport {GLBWriter} from './glb-writer';\n\n// glTF Data Access Helper Class\nexport {GLTFScenegraph} from './lib/api/gltf-scenegraph';\nexport {postProcessGLTF} from './lib/api/post-process-gltf';\nexport {getMemoryUsageGLTF as _getMemoryUsageGLTF} from './lib/gltf-utils/gltf-utils';\n\n/** @deprecated */\n// export type {GLTFMesh as Mesh} from './lib/types/gltf-json-schema';\n/** @deprecated */\n// export type {GLTFNodePostprocessed as Node} from './lib/types/gltf-postprocessed-schema';\n/** @deprecated */\n// export type {GLTFAccessorPostprocessed as Accessor} from './lib/types/gltf-postprocessed-schema';\n// /** @deprecated */\n// export type {GLTFImagePostprocessed as Image} from './lib/types/gltf-postprocessed-schema';\n"],"mappings":"AA8CA,SAAQA,UAAU,QAAO,eAAe;AACxC,SAAQC,UAAU,QAAO,eAAe;AAGxC,SAAQC,SAAS,QAAO,cAAc;AACtC,SAAQC,SAAS,QAAO,cAAc;AAGtC,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,kBAAkB,IAAIC,mBAAmB,QAAO,6BAA6B"}
1
+ {"version":3,"file":"index.js","names":["GLTFLoader","GLTFWriter","GLBLoader","GLBWriter","GLTFScenegraph","postProcessGLTF","getMemoryUsageGLTF","_getMemoryUsageGLTF"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable camelcase, indent */\nexport type {GLB} from './lib/types/glb-types';\n\n// Raw GLTF Types (i.e. not post-processed)\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTFObject,\n // The following extensions are handled by the GLTFLoader and removed from the parsed glTF (disable via options.gltf.excludeExtensions)\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n // 3DTiles extensions\n GLTF_EXT_mesh_features,\n GLTF_EXT_mesh_features_featureId,\n GLTF_EXT_mesh_features_featureIdTexture,\n GLTF_EXT_feature_metadata_GLTF,\n GLTF_EXT_feature_metadata_Schema,\n GLTF_EXT_feature_metadata_Class,\n GLTF_EXT_feature_metadata_ClassProperty,\n GLTF_EXT_feature_metadata_Enum,\n GLTF_EXT_feature_metadata_EnumValue,\n GLTF_EXT_feature_metadata_FeatureTable,\n GLTF_EXT_feature_metadata_FeatureTableProperty,\n GLTF_EXT_feature_metadata_FeatureTexture,\n GLTF_EXT_feature_metadata_TextureAccessor,\n GLTF_EXT_feature_metadata_Statistics,\n GLTF_EXT_feature_metadata_StatisticsClass,\n GLTF_EXT_feature_metadata_StatisticsClassProperty,\n GLTF_EXT_feature_metadata_Primitive,\n GLTF_EXT_feature_metadata_FeatureIdAttribute,\n GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds,\n GLTF_EXT_feature_metadata_FeatureIdTexture,\n GLTF_EXT_feature_metadata_FeatureIdTextureAccessor\n} from './lib/types/gltf-json-schema';\n\n// Postprocessed types (modified GLTF types)\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFNodePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFImagePostprocessed,\n GLTFTexturePostprocessed\n} from './lib/types/gltf-postprocessed-schema';\n\nexport type {GLTFWithBuffers} from './lib/types/gltf-types';\n\n// glTF loader/writer definition objects\nexport {GLTFLoader} from './gltf-loader';\nexport {GLTFWriter} from './gltf-writer';\n\n// GLB Loader & Writer (for custom formats that want to leverage the GLB binary \"envelope\")\nexport {GLBLoader} from './glb-loader';\nexport {GLBWriter} from './glb-writer';\n\n// glTF Data Access Helper Class\nexport {GLTFScenegraph} from './lib/api/gltf-scenegraph';\nexport {postProcessGLTF} from './lib/api/post-process-gltf';\nexport {getMemoryUsageGLTF as _getMemoryUsageGLTF} from './lib/gltf-utils/gltf-utils';\n\n/** @deprecated */\n// export type {GLTFMesh as Mesh} from './lib/types/gltf-json-schema';\n/** @deprecated */\n// export type {GLTFNodePostprocessed as Node} from './lib/types/gltf-postprocessed-schema';\n/** @deprecated */\n// export type {GLTFAccessorPostprocessed as Accessor} from './lib/types/gltf-postprocessed-schema';\n// /** @deprecated */\n// export type {GLTFImagePostprocessed as Image} from './lib/types/gltf-postprocessed-schema';\n"],"mappings":"AAgEA,SAAQA,UAAU,QAAO,eAAe;AACxC,SAAQC,UAAU,QAAO,eAAe;AAGxC,SAAQC,SAAS,QAAO,cAAc;AACtC,SAAQC,SAAS,QAAO,cAAc;AAGtC,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,kBAAkB,IAAIC,mBAAmB,QAAO,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"file":"EXT_feature_metadata.js","names":["GLTFScenegraph","getImageData","getComponentTypeFromArray","EXT_FEATURE_METADATA","name","decode","gltfData","options","scenegraph","decodeExtFeatureMetadata","_extension$schema","_options$gltf","extension","getExtension","schemaClasses","schema","classes","featureTables","schemaName","schemaClass","featureTable","findFeatureTableByName","handleFeatureTableProperties","featureTextures","gltf","loadImages","featureTexture","findFeatureTextureByName","handleFeatureTextureProperties","propertyName","properties","_featureTable$propert","schemaProperty","featureTableProperty","numberOfFeatures","count","data","getPropertyDataFromBinarySource","attributeName","class","_featureTexture$prope","featureTextureProperty","getPropertyDataFromTexture","bufferView","dataArray","getTypedArrayForBufferView","type","stringOffsetBufferView","offsetsData","getStringAttributes","json","meshes","featureTextureTable","mesh","primitive","primitives","processPrimitiveTextures","_json$textures","textureData","texCoordAccessorKey","concat","texture","texCoord","texCoordAccessorIndex","attributes","texCoordBufferView","getBufferView","texCoordArray","textureCoordinates","Float32Array","buffer","byteOffset","length","textureIndex","index","textures","imageIndex","source","_json$images","_scenegraph$gltf$imag","image","images","mimeType","parsedImage","value","getImageValueByCoordinates","channels","push","featureIndices","texelData","findIndex","item","typedArray","Uint32Array","bufferIndex","buffers","arrayBuffer","byteLength","bufferViewIndex","addBufferView","accessorIndex","addAccessor","size","componentType","CHANNELS_MAP","r","offset","shift","g","b","a","u","v","components","indexOf","coordinatesToOffset","c","map","val","getVal","imageData","Error","componentsCount","arguments","undefined","w","width","iX","emod","indX","Math","round","h","height","iY","indY","n","schemaClassName","featureTableName","featureTexturesName","stringsCount","stringsArray","textDecoder","TextDecoder","stringOffset","bytesPerStringSize","stringByteSize","stringData","subarray","stringAttribute"],"sources":["../../../../../src/lib/extensions/deprecated/EXT_feature_metadata.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport type {GLTF} from '../../types/gltf-json-schema';\nimport {GLTFScenegraph} from '../../api/gltf-scenegraph';\nimport {getImageData} from '@loaders.gl/images';\nimport {\n ClassProperty,\n EXT_feature_metadata_class_object,\n EXT_feature_metadata_feature_table,\n FeatureTableProperty,\n GLTF_EXT_feature_metadata,\n EXT_feature_metadata_feature_texture,\n FeatureTextureProperty,\n GLTFMeshPrimitive\n} from '../../types/gltf-json-schema';\nimport {getComponentTypeFromArray} from '../../gltf-utils/gltf-utils';\nimport {GLTFLoaderOptions} from '../../../gltf-loader';\n\n/** Extension name */\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\n\nexport const name = EXT_FEATURE_METADATA;\n\nexport async function decode(gltfData: {json: GLTF}, options: GLTFLoaderOptions): Promise<void> {\n const scenegraph = new GLTFScenegraph(gltfData);\n decodeExtFeatureMetadata(scenegraph, options);\n}\n\n/**\n * Decodes feature metadata from extension\n * @param scenegraph\n */\nfunction decodeExtFeatureMetadata(scenegraph: GLTFScenegraph, options: GLTFLoaderOptions): void {\n const extension: GLTF_EXT_feature_metadata | null = scenegraph.getExtension(EXT_FEATURE_METADATA);\n if (!extension) return;\n\n const schemaClasses = extension.schema?.classes;\n\n const {featureTables} = extension;\n if (schemaClasses && featureTables) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTable = findFeatureTableByName(featureTables, schemaName);\n\n if (featureTable) {\n handleFeatureTableProperties(scenegraph, featureTable, schemaClass);\n }\n }\n }\n\n const {featureTextures} = extension;\n if (schemaClasses && featureTextures && options.gltf?.loadImages) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTexture = findFeatureTextureByName(featureTextures, schemaName);\n\n if (featureTexture) {\n handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);\n }\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature table and gets properties data.\n * @param scenegraph\n * @param featureTable\n * @param schemaClass\n */\nfunction handleFeatureTableProperties(\n scenegraph: GLTFScenegraph,\n featureTable: EXT_feature_metadata_feature_table,\n schemaClass: EXT_feature_metadata_class_object\n): void {\n for (const propertyName in schemaClass.properties) {\n const schemaProperty = schemaClass.properties[propertyName];\n const featureTableProperty = featureTable?.properties?.[propertyName];\n const numberOfFeatures = featureTable.count;\n\n if (featureTableProperty) {\n const data = getPropertyDataFromBinarySource(\n scenegraph,\n schemaProperty,\n numberOfFeatures,\n featureTableProperty\n );\n featureTableProperty.data = data;\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature texture and gets properties data.\n * Data will be stored in featureTexture.properties[propertyName].data\n * @param scenegraph\n * @param featureTexture\n * @param schemaClass\n */\nfunction handleFeatureTextureProperties(\n scenegraph: GLTFScenegraph,\n featureTexture: EXT_feature_metadata_feature_texture,\n schemaClass: EXT_feature_metadata_class_object\n): void {\n const attributeName = featureTexture.class;\n\n for (const propertyName in schemaClass.properties) {\n const featureTextureProperty = featureTexture?.properties?.[propertyName];\n\n if (featureTextureProperty) {\n const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);\n featureTextureProperty.data = data;\n }\n }\n}\n\n/**\n * Decode properties from binary sourse based on property type.\n * @param scenegraph\n * @param schemaProperty\n * @param numberOfFeatures\n * @param featureTableProperty\n */\nfunction getPropertyDataFromBinarySource(\n scenegraph: GLTFScenegraph,\n schemaProperty: ClassProperty,\n numberOfFeatures: number,\n featureTableProperty: FeatureTableProperty\n): Uint8Array | string[] {\n const bufferView = featureTableProperty.bufferView;\n // TODO think maybe we shouldn't get data only in Uint8Array format.\n const dataArray: Uint8Array = scenegraph.getTypedArrayForBufferView(bufferView);\n\n switch (schemaProperty.type) {\n case 'STRING': {\n // stringOffsetBufferView should be available for string type.\n const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView!;\n const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);\n return getStringAttributes(dataArray, offsetsData, numberOfFeatures);\n }\n default:\n }\n\n return dataArray;\n}\n\n/**\n * Get properties from texture associated with all mesh primitives.\n * @param scenegraph\n * @param featureTextureProperty\n * @param attributeName\n * @returns Feature texture data\n */\nfunction getPropertyDataFromTexture(\n scenegraph: GLTFScenegraph,\n featureTextureProperty: FeatureTextureProperty,\n attributeName: string\n): number[] {\n const json = scenegraph.gltf.json;\n if (!json.meshes) {\n return [];\n }\n const featureTextureTable: number[] = [];\n for (const mesh of json.meshes) {\n for (const primitive of mesh.primitives) {\n processPrimitiveTextures(\n scenegraph,\n attributeName,\n featureTextureProperty,\n featureTextureTable,\n primitive\n );\n }\n }\n return featureTextureTable;\n}\n\n// eslint-disable-next-line max-statements\n/**\n * Processes data encoded in the texture associated with the primitive. This data will be accessible through the attributes.\n * @param scenegraph\n * @param attributeName\n * @param featureTextureProperty\n * @param featureTextureTable\n * @param primitive\n */\nfunction processPrimitiveTextures(\n scenegraph: GLTFScenegraph,\n attributeName: string,\n featureTextureProperty: FeatureTextureProperty,\n featureTextureTable: number[],\n primitive: GLTFMeshPrimitive\n): void {\n /*\n texture.index is an index for the \"textures\" array.\n The texture object referenced by this index looks like this:\n {\n \"sampler\": 0,\n \"source\": 0\n }\n \"sampler\" is an index for the \"samplers\" array\n \"source\" is an index for the \"images\" array that contains data. These data are stored in rgba channels of the image.\n\n texture.texCoord is a number-suffix (like 1) for an attribute like \"TEXCOORD_1\" in meshes.primitives\n The value of \"TEXCOORD_1\" is an accessor that is used to get coordinates. These coordinates ared used to get data from the image.\n */\n const json = scenegraph.gltf.json;\n const textureData: number[] = [];\n const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;\n const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];\n const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);\n const texCoordArray: Uint8Array = scenegraph.getTypedArrayForBufferView(texCoordBufferView);\n\n const textureCoordinates: Float32Array = new Float32Array(\n texCoordArray.buffer,\n texCoordArray.byteOffset,\n texCoordArray.length / 4\n );\n // textureCoordinates contains UV coordinates of the actual data stored in the texture\n // accessor.count is a number of UV pairs (they are stored as VEC2)\n\n const textureIndex = featureTextureProperty.texture.index;\n const texture = json.textures?.[textureIndex];\n const imageIndex = texture?.source;\n if (typeof imageIndex !== 'undefined') {\n const image = json.images?.[imageIndex];\n const mimeType = image?.mimeType;\n const parsedImage = scenegraph.gltf.images?.[imageIndex];\n if (parsedImage) {\n for (let index = 0; index < textureCoordinates.length; index += 2) {\n const value = getImageValueByCoordinates(\n parsedImage,\n mimeType,\n textureCoordinates,\n index,\n featureTextureProperty.channels\n );\n textureData.push(value);\n }\n }\n }\n /*\n featureTextureTable will contain unique values, e.g.\n textureData = [24, 35, 28, 24]\n featureTextureTable = [24, 35, 28]\n featureIndices will contain indices hat refer featureTextureTable, e.g.\n featureIndices = [0, 1, 2, 0]\n */\n const featureIndices: number[] = [];\n for (const texelData of textureData) {\n let index = featureTextureTable.findIndex((item) => item === texelData);\n if (index === -1) {\n index = featureTextureTable.push(texelData) - 1;\n }\n featureIndices.push(index);\n }\n const typedArray = new Uint32Array(featureIndices);\n const bufferIndex =\n scenegraph.gltf.buffers.push({\n arrayBuffer: typedArray.buffer,\n byteOffset: 0,\n byteLength: typedArray.byteLength\n }) - 1;\n const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);\n const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {\n size: 1,\n componentType: getComponentTypeFromArray(typedArray),\n count: typedArray.length\n });\n primitive.attributes[attributeName] = accessorIndex;\n}\n\nfunction getImageValueByCoordinates(\n parsedImage: any,\n mimeType: string | undefined,\n textureCoordinates: Float32Array,\n index: number,\n channels: string\n) {\n const CHANNELS_MAP = {\n r: {offset: 0, shift: 0},\n g: {offset: 1, shift: 8},\n b: {offset: 2, shift: 16},\n a: {offset: 3, shift: 24}\n };\n\n const u = textureCoordinates[index];\n const v = textureCoordinates[index + 1];\n\n let components = 1;\n if (mimeType && (mimeType.indexOf('image/jpeg') !== -1 || mimeType.indexOf('image/png') !== -1))\n components = 4;\n const offset = coordinatesToOffset(u, v, parsedImage, components);\n let value = 0;\n for (const c of channels) {\n const map = CHANNELS_MAP[c];\n const val = getVal(parsedImage, offset + map.offset);\n value |= val << map.shift;\n }\n return value;\n}\n\nfunction getVal(parsedImage: any, offset: number): number {\n const imageData = getImageData(parsedImage);\n if (imageData.data.length <= offset) {\n throw new Error(`${imageData.data.length} <= ${offset}`);\n }\n return imageData.data[offset];\n}\n\nfunction coordinatesToOffset(\n u: number,\n v: number,\n parsedImage: any,\n componentsCount: number = 1\n): number {\n const w = parsedImage.width;\n const iX = emod(u) * (w - 1);\n const indX = Math.round(iX);\n\n const h = parsedImage.height;\n const iY = emod(v) * (h - 1);\n const indY = Math.round(iY);\n const components = parsedImage.components ? parsedImage.components : componentsCount;\n // components is a number of channels in the image\n const offset = (indY * w + indX) * components;\n return offset;\n}\n\n// The following is taken from tile-converter\\src\\i3s-converter\\helpers\\batch-ids-extensions.ts\n/**\n * Handle UVs if they are out of range [0,1].\n * @param n\n * @param m\n */\nfunction emod(n: number): number {\n const a = ((n % 1) + 1) % 1;\n return a;\n}\n\n/**\n * Find the feature table by class name.\n * @param featureTables\n * @param schemaClassName\n */\nfunction findFeatureTableByName(\n featureTables: {[key: string]: EXT_feature_metadata_feature_table},\n schemaClassName: string\n): EXT_feature_metadata_feature_table | null {\n for (const featureTableName in featureTables) {\n const featureTable = featureTables[featureTableName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\nfunction findFeatureTextureByName(\n featureTextures: {[key: string]: EXT_feature_metadata_feature_texture},\n schemaClassName: string\n): EXT_feature_metadata_feature_texture | null {\n for (const featureTexturesName in featureTextures) {\n const featureTable = featureTextures[featureTexturesName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\n/**\n * Getting string attributes from binary data.\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#strings\n * @param data\n * @param offsetsData\n * @param stringsCount\n */\nfunction getStringAttributes(\n data: Uint8Array,\n offsetsData: Uint8Array,\n stringsCount: number\n): string[] {\n const stringsArray: string[] = [];\n const textDecoder = new TextDecoder('utf8');\n\n let stringOffset = 0;\n const bytesPerStringSize = 4;\n\n for (let index = 0; index < stringsCount; index++) {\n // TODO check if it is multiplication on bytesPerStringSize is valid operation?\n const stringByteSize =\n offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];\n const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);\n const stringAttribute = textDecoder.decode(stringData);\n\n stringsArray.push(stringAttribute);\n stringOffset += stringByteSize;\n }\n\n return stringsArray;\n}\n"],"mappings":"AAEA,SAAQA,cAAc,QAAO,2BAA2B;AACxD,SAAQC,YAAY,QAAO,oBAAoB;AAW/C,SAAQC,yBAAyB,QAAO,6BAA6B;AAIrE,MAAMC,oBAAoB,GAAG,sBAAsB;AAEnD,OAAO,MAAMC,IAAI,GAAGD,oBAAoB;AAExC,OAAO,eAAeE,MAAMA,CAACC,QAAsB,EAAEC,OAA0B,EAAiB;EAC9F,MAAMC,UAAU,GAAG,IAAIR,cAAc,CAACM,QAAQ,CAAC;EAC/CG,wBAAwB,CAACD,UAAU,EAAED,OAAO,CAAC;AAC/C;AAMA,SAASE,wBAAwBA,CAACD,UAA0B,EAAED,OAA0B,EAAQ;EAAA,IAAAG,iBAAA,EAAAC,aAAA;EAC9F,MAAMC,SAA2C,GAAGJ,UAAU,CAACK,YAAY,CAACV,oBAAoB,CAAC;EACjG,IAAI,CAACS,SAAS,EAAE;EAEhB,MAAME,aAAa,IAAAJ,iBAAA,GAAGE,SAAS,CAACG,MAAM,cAAAL,iBAAA,uBAAhBA,iBAAA,CAAkBM,OAAO;EAE/C,MAAM;IAACC;EAAa,CAAC,GAAGL,SAAS;EACjC,IAAIE,aAAa,IAAIG,aAAa,EAAE;IAClC,KAAK,MAAMC,UAAU,IAAIJ,aAAa,EAAE;MACtC,MAAMK,WAAW,GAAGL,aAAa,CAACI,UAAU,CAAC;MAC7C,MAAME,YAAY,GAAGC,sBAAsB,CAACJ,aAAa,EAAEC,UAAU,CAAC;MAEtE,IAAIE,YAAY,EAAE;QAChBE,4BAA4B,CAACd,UAAU,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Q,CAACJ,YAAY,EAAEE,cAAc,GAAGF,YAAY,CAAC;IAC7E,MAAMK,eAAe,GAAGP,WAAW,CAACzI,MAAM,CAAC8I,UAAU,CAAC;IAEtDN,YAAY,CAACtD,IAAI,CAAC8D,eAAe,CAAC;IAClCL,YAAY,IAAIE,cAAc;EAChC;EAEA,OAAOL,YAAY;AACrB"}
1
+ {"version":3,"file":"EXT_feature_metadata.js","names":["GLTFScenegraph","getImageData","getComponentTypeFromArray","EXT_FEATURE_METADATA","name","decode","gltfData","options","scenegraph","decodeExtFeatureMetadata","_extension$schema","_options$gltf","extension","getExtension","schemaClasses","schema","classes","featureTables","schemaName","schemaClass","featureTable","findFeatureTableByName","handleFeatureTableProperties","featureTextures","gltf","loadImages","featureTexture","findFeatureTextureByName","handleFeatureTextureProperties","propertyName","properties","_featureTable$propert","schemaProperty","featureTableProperty","numberOfFeatures","count","data","getPropertyDataFromBinarySource","attributeName","class","_featureTexture$prope","featureTextureProperty","getPropertyDataFromTexture","bufferView","dataArray","getTypedArrayForBufferView","type","stringOffsetBufferView","offsetsData","getStringAttributes","json","meshes","featureTextureTable","mesh","primitive","primitives","processPrimitiveTextures","_json$textures","textureData","texCoordAccessorKey","concat","texture","texCoord","texCoordAccessorIndex","attributes","texCoordBufferView","getBufferView","texCoordArray","textureCoordinates","Float32Array","buffer","byteOffset","length","textureIndex","index","textures","imageIndex","source","_json$images","_scenegraph$gltf$imag","image","images","mimeType","parsedImage","value","getImageValueByCoordinates","channels","push","featureIndices","texelData","findIndex","item","typedArray","Uint32Array","bufferIndex","buffers","arrayBuffer","byteLength","bufferViewIndex","addBufferView","accessorIndex","addAccessor","size","componentType","CHANNELS_MAP","r","offset","shift","g","b","a","u","v","components","indexOf","coordinatesToOffset","c","map","val","getVal","imageData","Error","componentsCount","arguments","undefined","w","width","iX","emod","indX","Math","round","h","height","iY","indY","n","schemaClassName","featureTableName","featureTexturesName","stringsCount","stringsArray","textDecoder","TextDecoder","stringOffset","bytesPerStringSize","stringByteSize","stringData","subarray","stringAttribute"],"sources":["../../../../../src/lib/extensions/deprecated/EXT_feature_metadata.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport type {\n GLTF,\n GLTF_EXT_feature_metadata_Class,\n GLTF_EXT_feature_metadata_ClassProperty,\n GLTF_EXT_feature_metadata_FeatureTable,\n GLTF_EXT_feature_metadata_FeatureTableProperty,\n GLTF_EXT_feature_metadata_FeatureTexture,\n GLTF_EXT_feature_metadata_GLTF,\n GLTF_EXT_feature_metadata_TextureAccessor\n} from '../../types/gltf-json-schema';\nimport {GLTFScenegraph} from '../../api/gltf-scenegraph';\nimport {getImageData} from '@loaders.gl/images';\nimport {GLTFMeshPrimitive} from '../../types/gltf-json-schema';\nimport {getComponentTypeFromArray} from '../../gltf-utils/gltf-utils';\nimport {GLTFLoaderOptions} from '../../../gltf-loader';\n\n/** Extension name */\nconst EXT_FEATURE_METADATA = 'EXT_feature_metadata';\n\nexport const name = EXT_FEATURE_METADATA;\n\nexport async function decode(gltfData: {json: GLTF}, options: GLTFLoaderOptions): Promise<void> {\n const scenegraph = new GLTFScenegraph(gltfData);\n decodeExtFeatureMetadata(scenegraph, options);\n}\n\n/**\n * Decodes feature metadata from extension\n * @param scenegraph\n */\nfunction decodeExtFeatureMetadata(scenegraph: GLTFScenegraph, options: GLTFLoaderOptions): void {\n const extension: GLTF_EXT_feature_metadata_GLTF | null =\n scenegraph.getExtension(EXT_FEATURE_METADATA);\n if (!extension) return;\n\n const schemaClasses = extension.schema?.classes;\n\n const {featureTables} = extension;\n if (schemaClasses && featureTables) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTable = findFeatureTableByName(featureTables, schemaName);\n\n if (featureTable) {\n handleFeatureTableProperties(scenegraph, featureTable, schemaClass);\n }\n }\n }\n\n const {featureTextures} = extension;\n if (schemaClasses && featureTextures && options.gltf?.loadImages) {\n for (const schemaName in schemaClasses) {\n const schemaClass = schemaClasses[schemaName];\n const featureTexture = findFeatureTextureByName(featureTextures, schemaName);\n\n if (featureTexture) {\n handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);\n }\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature table and gets properties data.\n * @param scenegraph\n * @param featureTable\n * @param schemaClass\n */\nfunction handleFeatureTableProperties(\n scenegraph: GLTFScenegraph,\n featureTable: GLTF_EXT_feature_metadata_FeatureTable,\n schemaClass: GLTF_EXT_feature_metadata_Class\n): void {\n for (const propertyName in schemaClass.properties) {\n const schemaProperty = schemaClass.properties[propertyName];\n const featureTableProperty = featureTable?.properties?.[propertyName];\n const numberOfFeatures = featureTable.count;\n\n if (featureTableProperty) {\n const data = getPropertyDataFromBinarySource(\n scenegraph,\n schemaProperty,\n numberOfFeatures,\n featureTableProperty\n );\n featureTableProperty.data = data;\n }\n }\n}\n\n/**\n * Navigate throw all properies in feature texture and gets properties data.\n * Data will be stored in featureTexture.properties[propertyName].data\n * @param scenegraph\n * @param featureTexture\n * @param schemaClass\n */\nfunction handleFeatureTextureProperties(\n scenegraph: GLTFScenegraph,\n featureTexture: GLTF_EXT_feature_metadata_FeatureTexture,\n schemaClass: GLTF_EXT_feature_metadata_Class\n): void {\n const attributeName = featureTexture.class;\n\n for (const propertyName in schemaClass.properties) {\n const featureTextureProperty = featureTexture?.properties?.[propertyName];\n\n if (featureTextureProperty) {\n const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);\n featureTextureProperty.data = data;\n }\n }\n}\n\n/**\n * Decode properties from binary sourse based on property type.\n * @param scenegraph\n * @param schemaProperty\n * @param numberOfFeatures\n * @param featureTableProperty\n */\nfunction getPropertyDataFromBinarySource(\n scenegraph: GLTFScenegraph,\n schemaProperty: GLTF_EXT_feature_metadata_ClassProperty,\n numberOfFeatures: number,\n featureTableProperty: GLTF_EXT_feature_metadata_FeatureTableProperty\n): Uint8Array | string[] {\n const bufferView = featureTableProperty.bufferView;\n // TODO think maybe we shouldn't get data only in Uint8Array format.\n const dataArray: Uint8Array = scenegraph.getTypedArrayForBufferView(bufferView);\n\n switch (schemaProperty.type) {\n case 'STRING': {\n // stringOffsetBufferView should be available for string type.\n const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView!;\n const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);\n return getStringAttributes(dataArray, offsetsData, numberOfFeatures);\n }\n default:\n }\n\n return dataArray;\n}\n\n/**\n * Get properties from texture associated with all mesh primitives.\n * @param scenegraph\n * @param featureTextureProperty\n * @param attributeName\n * @returns Feature texture data\n */\nfunction getPropertyDataFromTexture(\n scenegraph: GLTFScenegraph,\n featureTextureProperty: GLTF_EXT_feature_metadata_TextureAccessor,\n attributeName: string\n): number[] {\n const json = scenegraph.gltf.json;\n if (!json.meshes) {\n return [];\n }\n const featureTextureTable: number[] = [];\n for (const mesh of json.meshes) {\n for (const primitive of mesh.primitives) {\n processPrimitiveTextures(\n scenegraph,\n attributeName,\n featureTextureProperty,\n featureTextureTable,\n primitive\n );\n }\n }\n return featureTextureTable;\n}\n\n// eslint-disable-next-line max-statements\n/**\n * Processes data encoded in the texture associated with the primitive. This data will be accessible through the attributes.\n * @param scenegraph\n * @param attributeName\n * @param featureTextureProperty\n * @param featureTextureTable\n * @param primitive\n */\n// eslint-disable-next-line max-statements\nfunction processPrimitiveTextures(\n scenegraph: GLTFScenegraph,\n attributeName: string,\n featureTextureProperty: GLTF_EXT_feature_metadata_TextureAccessor,\n featureTextureTable: number[],\n primitive: GLTFMeshPrimitive\n): void {\n /*\n texture.index is an index for the \"textures\" array.\n The texture object referenced by this index looks like this:\n {\n \"sampler\": 0,\n \"source\": 0\n }\n \"sampler\" is an index for the \"samplers\" array\n \"source\" is an index for the \"images\" array that contains data. These data are stored in rgba channels of the image.\n\n texture.texCoord is a number-suffix (like 1) for an attribute like \"TEXCOORD_1\" in meshes.primitives\n The value of \"TEXCOORD_1\" is an accessor that is used to get coordinates. These coordinates ared used to get data from the image.\n */\n const json = scenegraph.gltf.json;\n const textureData: number[] = [];\n const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;\n const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];\n const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);\n const texCoordArray: Uint8Array = scenegraph.getTypedArrayForBufferView(texCoordBufferView);\n\n const textureCoordinates: Float32Array = new Float32Array(\n texCoordArray.buffer,\n texCoordArray.byteOffset,\n texCoordArray.length / 4\n );\n // textureCoordinates contains UV coordinates of the actual data stored in the texture\n // accessor.count is a number of UV pairs (they are stored as VEC2)\n\n const textureIndex = featureTextureProperty.texture.index;\n const texture = json.textures?.[textureIndex];\n const imageIndex = texture?.source;\n if (typeof imageIndex !== 'undefined') {\n const image = json.images?.[imageIndex];\n const mimeType = image?.mimeType;\n const parsedImage = scenegraph.gltf.images?.[imageIndex];\n if (parsedImage) {\n for (let index = 0; index < textureCoordinates.length; index += 2) {\n const value = getImageValueByCoordinates(\n parsedImage,\n mimeType,\n textureCoordinates,\n index,\n featureTextureProperty.channels\n );\n textureData.push(value);\n }\n }\n }\n /*\n featureTextureTable will contain unique values, e.g.\n textureData = [24, 35, 28, 24]\n featureTextureTable = [24, 35, 28]\n featureIndices will contain indices hat refer featureTextureTable, e.g.\n featureIndices = [0, 1, 2, 0]\n */\n const featureIndices: number[] = [];\n for (const texelData of textureData) {\n let index = featureTextureTable.findIndex((item) => item === texelData);\n if (index === -1) {\n index = featureTextureTable.push(texelData) - 1;\n }\n featureIndices.push(index);\n }\n const typedArray = new Uint32Array(featureIndices);\n const bufferIndex =\n scenegraph.gltf.buffers.push({\n arrayBuffer: typedArray.buffer,\n byteOffset: 0,\n byteLength: typedArray.byteLength\n }) - 1;\n const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);\n const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {\n size: 1,\n componentType: getComponentTypeFromArray(typedArray),\n count: typedArray.length\n });\n primitive.attributes[attributeName] = accessorIndex;\n}\n\nfunction getImageValueByCoordinates(\n parsedImage: any,\n mimeType: string | undefined,\n textureCoordinates: Float32Array,\n index: number,\n channels: string\n) {\n const CHANNELS_MAP = {\n r: {offset: 0, shift: 0},\n g: {offset: 1, shift: 8},\n b: {offset: 2, shift: 16},\n a: {offset: 3, shift: 24}\n };\n\n const u = textureCoordinates[index];\n const v = textureCoordinates[index + 1];\n\n let components = 1;\n if (mimeType && (mimeType.indexOf('image/jpeg') !== -1 || mimeType.indexOf('image/png') !== -1))\n components = 4;\n const offset = coordinatesToOffset(u, v, parsedImage, components);\n let value = 0;\n for (const c of channels) {\n const map = CHANNELS_MAP[c];\n const val = getVal(parsedImage, offset + map.offset);\n value |= val << map.shift;\n }\n return value;\n}\n\nfunction getVal(parsedImage: any, offset: number): number {\n const imageData = getImageData(parsedImage);\n if (imageData.data.length <= offset) {\n throw new Error(`${imageData.data.length} <= ${offset}`);\n }\n return imageData.data[offset];\n}\n\nfunction coordinatesToOffset(\n u: number,\n v: number,\n parsedImage: any,\n componentsCount: number = 1\n): number {\n const w = parsedImage.width;\n const iX = emod(u) * (w - 1);\n const indX = Math.round(iX);\n\n const h = parsedImage.height;\n const iY = emod(v) * (h - 1);\n const indY = Math.round(iY);\n const components = parsedImage.components ? parsedImage.components : componentsCount;\n // components is a number of channels in the image\n const offset = (indY * w + indX) * components;\n return offset;\n}\n\n// The following is taken from tile-converter\\src\\i3s-converter\\helpers\\batch-ids-extensions.ts\n/**\n * Handle UVs if they are out of range [0,1].\n * @param n\n * @param m\n */\nfunction emod(n: number): number {\n const a = ((n % 1) + 1) % 1;\n return a;\n}\n\n/**\n * Find the feature table by class name.\n * @param featureTables\n * @param schemaClassName\n */\nfunction findFeatureTableByName(\n featureTables: {[key: string]: GLTF_EXT_feature_metadata_FeatureTable},\n schemaClassName: string\n): GLTF_EXT_feature_metadata_FeatureTable | null {\n for (const featureTableName in featureTables) {\n const featureTable = featureTables[featureTableName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\nfunction findFeatureTextureByName(\n featureTextures: {[key: string]: GLTF_EXT_feature_metadata_FeatureTexture},\n schemaClassName: string\n): GLTF_EXT_feature_metadata_FeatureTexture | null {\n for (const featureTexturesName in featureTextures) {\n const featureTable = featureTextures[featureTexturesName];\n\n if (featureTable.class === schemaClassName) {\n return featureTable;\n }\n }\n\n return null;\n}\n\n/**\n * Getting string attributes from binary data.\n * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/specification/Metadata#strings\n * @param data\n * @param offsetsData\n * @param stringsCount\n */\nfunction getStringAttributes(\n data: Uint8Array,\n offsetsData: Uint8Array,\n stringsCount: number\n): string[] {\n const stringsArray: string[] = [];\n const textDecoder = new TextDecoder('utf8');\n\n let stringOffset = 0;\n const bytesPerStringSize = 4;\n\n for (let index = 0; index < stringsCount; index++) {\n // TODO check if it is multiplication on bytesPerStringSize is valid operation?\n const stringByteSize =\n offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];\n const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);\n const stringAttribute = textDecoder.decode(stringData);\n\n stringsArray.push(stringAttribute);\n stringOffset += stringByteSize;\n }\n\n return stringsArray;\n}\n"],"mappings":"AAWA,SAAQA,cAAc,QAAO,2BAA2B;AACxD,SAAQC,YAAY,QAAO,oBAAoB;AAE/C,SAAQC,yBAAyB,QAAO,6BAA6B;AAIrE,MAAMC,oBAAoB,GAAG,sBAAsB;AAEnD,OAAO,MAAMC,IAAI,GAAGD,oBAAoB;AAExC,OAAO,eAAeE,MAAMA,CAACC,QAAsB,EAAEC,OAA0B,EAAiB;EAC9F,MAAMC,UAAU,GAAG,IAAIR,cAAc,CAACM,QAAQ,CAAC;EAC/CG,wBAAwB,CAACD,UAAU,EAAED,OAAO,CAAC;AAC/C;AAMA,SAASE,wBAAwBA,CAACD,UAA0B,EAAED,OAA0B,EAAQ;EAAA,IAAAG,iBAAA,EAAAC,aAAA;EAC9F,MAAMC,SAAgD,GACpDJ,UAAU,CA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