@loaders.gl/gltf 4.0.0-alpha.7 → 4.0.0-alpha.9
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.
- package/dist/dist.min.js +149 -23
- package/dist/es5/lib/api/gltf-scenegraph.js +6 -3
- package/dist/es5/lib/api/gltf-scenegraph.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +193 -15
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/es5/lib/parsers/parse-gltf.js +13 -16
- package/dist/es5/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/es5/lib/types/gltf-json-schema.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/esm/lib/api/gltf-scenegraph.js +6 -3
- package/dist/esm/lib/api/gltf-scenegraph.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +160 -14
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/esm/lib/parsers/parse-gltf.js +2 -6
- package/dist/esm/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/esm/lib/types/gltf-json-schema.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/api/gltf-extensions.js +1 -1
- package/dist/lib/api/gltf-scenegraph.d.ts +2 -1
- package/dist/lib/api/gltf-scenegraph.d.ts.map +1 -1
- package/dist/lib/api/gltf-scenegraph.js +5 -4
- package/dist/lib/encoders/encode-glb.js +1 -1
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +2 -1
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +193 -18
- package/dist/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-gltf.js +4 -7
- package/dist/lib/types/gltf-json-schema.d.ts +2 -1
- package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/lib/api/gltf-scenegraph.ts +6 -5
- package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +262 -21
- package/src/lib/parsers/parse-gltf.ts +4 -9
- package/src/lib/types/gltf-json-schema.ts +3 -0
|
@@ -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 /** 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};\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\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":""}
|
|
@@ -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.
|
|
7
|
+
var VERSION = typeof "4.0.0-alpha.9" !== 'undefined' ? "4.0.0-alpha.9" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -22,7 +22,8 @@ export class GLTFScenegraph {
|
|
|
22
22
|
_defineProperty(this, "byteLength", void 0);
|
|
23
23
|
this.gltf = {
|
|
24
24
|
json: (gltf === null || gltf === void 0 ? void 0 : gltf.json) || makeDefaultGLTFJson(),
|
|
25
|
-
buffers: (gltf === null || gltf === void 0 ? void 0 : gltf.buffers) || []
|
|
25
|
+
buffers: (gltf === null || gltf === void 0 ? void 0 : gltf.buffers) || [],
|
|
26
|
+
images: (gltf === null || gltf === void 0 ? void 0 : gltf.images) || []
|
|
26
27
|
};
|
|
27
28
|
this.sourceBuffers = [];
|
|
28
29
|
this.byteLength = 0;
|
|
@@ -295,13 +296,15 @@ export class GLTFScenegraph {
|
|
|
295
296
|
return this.json.images.length - 1;
|
|
296
297
|
}
|
|
297
298
|
addBufferView(buffer) {
|
|
299
|
+
let bufferIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
300
|
+
let byteOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.byteLength;
|
|
298
301
|
const byteLength = buffer.byteLength;
|
|
299
302
|
assert(Number.isFinite(byteLength));
|
|
300
303
|
this.sourceBuffers = this.sourceBuffers || [];
|
|
301
304
|
this.sourceBuffers.push(buffer);
|
|
302
305
|
const glTFBufferView = {
|
|
303
|
-
buffer:
|
|
304
|
-
byteOffset
|
|
306
|
+
buffer: bufferIndex,
|
|
307
|
+
byteOffset,
|
|
305
308
|
byteLength
|
|
306
309
|
};
|
|
307
310
|
this.byteLength += padToNBytes(byteLength, 4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-scenegraph.js","names":["getBinaryImageMetadata","padToNBytes","copyToArray","assert","getAccessorArrayTypeAndLength","getAccessorTypeFromSize","getComponentTypeFromArray","makeDefaultGLTFJson","asset","version","generator","buffers","extensions","extensionsRequired","extensionsUsed","GLTFScenegraph","constructor","gltf","_defineProperty","json","sourceBuffers","byteLength","getApplicationData","key","data","getExtraData","extras","hasExtension","extensionName","isUsedExtension","getUsedExtensions","find","name","isRequiredExtension","getRequiredExtensions","getExtension","isExtension","getRequiredExtension","isRequired","getRemovedExtensions","extensionsRemoved","getObjectExtension","object","getScene","index","getObject","getNode","getSkin","getMesh","getMaterial","getAccessor","getTexture","getSampler","getImage","getBufferView","getBuffer","array","Error","concat","getTypedArrayForBufferView","bufferView","bufferIndex","buffer","binChunk","byteOffset","Uint8Array","arrayBuffer","getTypedArrayForAccessor","accessor","ArrayType","length","getTypedArrayForImageData","image","addApplicationData","addExtraData","addObjectExtension","registerUsedExtension","setObjectExtension","removeObjectExtension","includes","push","addExtension","extensionData","arguments","undefined","addRequiredExtension","registerRequiredExtension","ext","removeExtension","_this$json$extensions","_removeStringFromArray","setDefaultScene","sceneIndex","scene","addScene","nodeIndices","scenes","nodes","addNode","node","meshIndex","matrix","nodeData","mesh","addMesh","attributes","indices","material","mode","accessors","_addAttributes","glTFMesh","primitives","indicesAccessor","_addIndices","Number","isFinite","meshes","addPointCloud","accessorIndices","addImage","imageData","mimeTypeOpt","metadata","mimeType","bufferViewIndex","addBufferView","glTFImage","images","glTFBufferView","bufferViews","addAccessor","glTFAccessor","type","size","componentType","count","max","min","addBinaryBuffer","sourceBuffer","minMax","_getAccessorMinMax","accessorDefaults","Math","round","Object","assign","addTexture","texture","imageIndex","glTFTexture","source","textures","addMaterial","pbrMaterialInfo","materials","createBinaryChunk","_this$json","_this$json$buffers","totalByteLength","ArrayBuffer","targetArray","dstByteOffset","binary","string","found","indexOf","splice","result","attributeKey","attributeData","attrName","_getGltfAttributeName","value","attributeName","toLowerCase","initValues","subarray","componentIndex"],"sources":["../../../../src/lib/api/gltf-scenegraph.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {GLTFWithBuffers} from '../types/gltf-types';\nimport type {\n GLTF,\n GLTFScene,\n GLTFNode,\n GLTFMesh,\n GLTFSkin,\n GLTFMaterial,\n GLTFAccessor,\n GLTFSampler,\n GLTFTexture,\n GLTFImage,\n GLTFBuffer,\n GLTFBufferView\n} from '../types/gltf-json-schema';\n\nimport {getBinaryImageMetadata} from '@loaders.gl/images';\nimport {padToNBytes, copyToArray} from '@loaders.gl/loader-utils';\nimport {assert} from '../utils/assert';\nimport {\n getAccessorArrayTypeAndLength,\n getAccessorTypeFromSize,\n getComponentTypeFromArray\n} from '../gltf-utils/gltf-utils';\n\ntype Extension = {[key: string]: any};\n\nfunction makeDefaultGLTFJson(): GLTF {\n return {\n asset: {\n version: '2.0',\n generator: 'loaders.gl'\n },\n buffers: [],\n extensions: {},\n extensionsRequired: [],\n extensionsUsed: []\n };\n}\n\n/**\n * Class for structured access to GLTF data\n */\nexport class GLTFScenegraph {\n // internal\n gltf: GLTFWithBuffers;\n sourceBuffers: any[];\n byteLength: number;\n\n // TODO - why is this not GLTFWithBuffers - what happens to images?\n constructor(gltf?: {json: GLTF; buffers?: any[]}) {\n // Declare locally so\n\n this.gltf = {\n json: gltf?.json || makeDefaultGLTFJson(),\n buffers: gltf?.buffers || []\n };\n this.sourceBuffers = [];\n this.byteLength = 0;\n\n // Initialize buffers\n if (this.gltf.buffers && this.gltf.buffers[0]) {\n this.byteLength = this.gltf.buffers[0].byteLength;\n this.sourceBuffers = [this.gltf.buffers[0]];\n }\n }\n\n // Accessors\n\n get json(): GLTF {\n return this.gltf.json;\n }\n\n getApplicationData(key: string): unknown {\n // TODO - Data is already unpacked by GLBParser\n const data = this.json[key];\n return data;\n }\n\n getExtraData(key: string): {[key: string]: unknown} {\n // TODO - Data is already unpacked by GLBParser\n const extras = this.json.extras || {};\n return extras[key];\n }\n\n hasExtension(extensionName: string): boolean {\n const isUsedExtension = this.getUsedExtensions().find((name) => name === extensionName);\n const isRequiredExtension = this.getRequiredExtensions().find((name) => name === extensionName);\n return typeof isUsedExtension === 'string' || typeof isRequiredExtension === 'string';\n }\n\n getExtension<T = Extension>(extensionName: string): T | null {\n const isExtension = this.getUsedExtensions().find((name) => name === extensionName);\n const extensions = this.json.extensions || {};\n return isExtension ? (extensions[extensionName] as T) : null;\n }\n\n getRequiredExtension<T = Extension>(extensionName: string): T | null {\n const isRequired = this.getRequiredExtensions().find((name) => name === extensionName);\n return isRequired ? this.getExtension(extensionName) : null;\n }\n\n getRequiredExtensions(): string[] {\n return this.json.extensionsRequired || [];\n }\n\n getUsedExtensions(): string[] {\n return this.json.extensionsUsed || [];\n }\n\n getRemovedExtensions(): string[] {\n return (this.json.extensionsRemoved || []) as string[];\n }\n\n getObjectExtension<T = Extension>(object: {[key: string]: any}, extensionName: string): T | null {\n const extensions = object.extensions || {};\n return extensions[extensionName];\n }\n\n getScene(index: number): GLTFScene {\n return this.getObject('scenes', index) as GLTFScene;\n }\n\n getNode(index: number): GLTFNode {\n return this.getObject('nodes', index) as GLTFNode;\n }\n\n getSkin(index: number): GLTFSkin {\n return this.getObject('skins', index) as GLTFSkin;\n }\n\n getMesh(index: number): GLTFMesh {\n return this.getObject('meshes', index) as GLTFMesh;\n }\n\n getMaterial(index: number): GLTFMaterial {\n return this.getObject('materials', index) as GLTFMaterial;\n }\n\n getAccessor(index: number): GLTFAccessor {\n return this.getObject('accessors', index) as GLTFAccessor;\n }\n\n // getCamera(index: number): object | null {\n // return null; // TODO: fix thi: object as null;\n // }\n\n getTexture(index: number): GLTFTexture {\n return this.getObject('textures', index) as GLTFTexture;\n }\n\n getSampler(index: number): GLTFSampler {\n return this.getObject('samplers', index) as GLTFSampler;\n }\n\n getImage(index: number): GLTFImage {\n return this.getObject('images', index) as GLTFImage;\n }\n\n getBufferView(index: number | object): GLTFBufferView {\n return this.getObject('bufferViews', index) as GLTFBufferView;\n }\n\n getBuffer(index: number): GLTFBuffer {\n return this.getObject('buffers', index) as GLTFBuffer;\n }\n\n getObject(array: string, index: number | object): object {\n // check if already resolved\n if (typeof index === 'object') {\n return index;\n }\n const object = this.json[array] && (this.json[array] as {}[])[index];\n if (!object) {\n throw new Error(`glTF file error: Could not find ${array}[${index}]`); // eslint-disable-line\n }\n return object;\n }\n\n /**\n * Accepts buffer view index or buffer view object\n * @returns a `Uint8Array`\n */\n getTypedArrayForBufferView(bufferView: number | object): Uint8Array {\n bufferView = this.getBufferView(bufferView);\n // @ts-ignore\n const bufferIndex = bufferView.buffer;\n\n // Get hold of the arrayBuffer\n // const buffer = this.getBuffer(bufferIndex);\n const binChunk = this.gltf.buffers[bufferIndex];\n assert(binChunk);\n\n // @ts-ignore\n const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;\n // @ts-ignore\n return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);\n }\n\n /** Accepts accessor index or accessor object\n * @returns a typed array with type that matches the types\n */\n getTypedArrayForAccessor(accessor: number | object): any {\n // @ts-ignore\n accessor = this.getAccessor(accessor);\n // @ts-ignore\n const bufferView = this.getBufferView(accessor.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n // @ts-ignore\n const arrayBuffer = buffer.data;\n\n // Create a new typed array as a view into the combined buffer\n const {ArrayType, length} = getAccessorArrayTypeAndLength(accessor, bufferView);\n // @ts-ignore\n const byteOffset = bufferView.byteOffset + accessor.byteOffset;\n return new ArrayType(arrayBuffer, byteOffset, length);\n }\n\n /** accepts accessor index or accessor object\n * returns a `Uint8Array`\n */\n getTypedArrayForImageData(image: number | object): Uint8Array {\n // @ts-ignore\n image = this.getAccessor(image);\n // @ts-ignore\n const bufferView = this.getBufferView(image.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n // @ts-ignore\n const arrayBuffer = buffer.data;\n\n const byteOffset = bufferView.byteOffset || 0;\n return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);\n }\n\n // MODIFERS\n\n /**\n * Add an extra application-defined key to the top-level data structure\n */\n addApplicationData(key: string, data: object): GLTFScenegraph {\n this.json[key] = data;\n return this;\n }\n\n /**\n * `extras` - Standard GLTF field for storing application specific data\n */\n addExtraData(key: string, data: object): GLTFScenegraph {\n this.json.extras = this.json.extras || {};\n (this.json.extras as Record<string, unknown>)[key] = data;\n return this;\n }\n\n addObjectExtension(object: object, extensionName: string, data: object): GLTFScenegraph {\n // @ts-ignore\n object.extensions = object.extensions || {};\n // TODO - clobber or merge?\n // @ts-ignore\n object.extensions[extensionName] = data;\n this.registerUsedExtension(extensionName);\n return this;\n }\n\n setObjectExtension(object: any, extensionName: string, data: object): void {\n const extensions = object.extensions || {};\n extensions[extensionName] = data;\n // TODO - add to usedExtensions...\n }\n\n removeObjectExtension(object: any, extensionName: string): void {\n const extensions = object?.extensions || {};\n\n if (extensions[extensionName]) {\n this.json.extensionsRemoved = this.json.extensionsRemoved || [];\n const extensionsRemoved = this.json.extensionsRemoved as string[];\n if (!extensionsRemoved.includes(extensionName)) {\n extensionsRemoved.push(extensionName);\n }\n }\n\n delete extensions[extensionName];\n }\n\n /**\n * Add to standard GLTF top level extension object, mark as used\n */\n addExtension(extensionName: string, extensionData: object = {}): object {\n assert(extensionData);\n this.json.extensions = this.json.extensions || {};\n this.json.extensions[extensionName] = extensionData;\n this.registerUsedExtension(extensionName);\n return extensionData;\n }\n\n /**\n * Standard GLTF top level extension object, mark as used and required\n */\n addRequiredExtension(extensionName, extensionData: object = {}): object {\n assert(extensionData);\n this.addExtension(extensionName, extensionData);\n this.registerRequiredExtension(extensionName);\n return extensionData;\n }\n\n /**\n * Add extensionName to list of used extensions\n */\n registerUsedExtension(extensionName: string): void {\n this.json.extensionsUsed = this.json.extensionsUsed || [];\n if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {\n this.json.extensionsUsed.push(extensionName);\n }\n }\n\n /**\n * Add extensionName to list of required extensions\n */\n registerRequiredExtension(extensionName: string): void {\n this.registerUsedExtension(extensionName);\n this.json.extensionsRequired = this.json.extensionsRequired || [];\n if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {\n this.json.extensionsRequired.push(extensionName);\n }\n }\n\n /**\n * Removes an extension from the top-level list\n */\n removeExtension(extensionName: string): void {\n if (this.json.extensions?.[extensionName]) {\n this.json.extensionsRemoved = this.json.extensionsRemoved || [];\n const extensionsRemoved = this.json.extensionsRemoved as string[];\n if (!extensionsRemoved.includes(extensionName)) {\n extensionsRemoved.push(extensionName);\n }\n }\n if (this.json.extensions) {\n delete this.json.extensions[extensionName];\n }\n if (this.json.extensionsRequired) {\n this._removeStringFromArray(this.json.extensionsRequired, extensionName);\n }\n if (this.json.extensionsUsed) {\n this._removeStringFromArray(this.json.extensionsUsed, extensionName);\n }\n }\n\n /**\n * Set default scene which is to be displayed at load time\n */\n setDefaultScene(sceneIndex: number): void {\n this.json.scene = sceneIndex;\n }\n\n /**\n * @todo: add more properties for scene initialization:\n * name`, `extensions`, `extras`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-scene\n */\n addScene(scene: {nodeIndices: number[]}): number {\n const {nodeIndices} = scene;\n this.json.scenes = this.json.scenes || [];\n this.json.scenes.push({nodes: nodeIndices});\n return this.json.scenes.length - 1;\n }\n\n /**\n * @todo: add more properties for node initialization:\n * `name`, `extensions`, `extras`, `camera`, `children`, `skin`, `rotation`, `scale`, `translation`, `weights`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#node\n */\n addNode(node: {meshIndex: number; matrix?: number[]}): number {\n const {meshIndex, matrix} = node;\n this.json.nodes = this.json.nodes || [];\n const nodeData = {mesh: meshIndex};\n if (matrix) {\n // @ts-ignore\n nodeData.matrix = matrix;\n }\n this.json.nodes.push(nodeData);\n return this.json.nodes.length - 1;\n }\n\n /** Adds a mesh to the json part */\n addMesh(mesh: {attributes: object; indices?: object; material?: number; mode?: number}): number {\n const {attributes, indices, material, mode = 4} = mesh;\n const accessors = this._addAttributes(attributes);\n\n const glTFMesh = {\n primitives: [\n {\n attributes: accessors,\n mode\n }\n ]\n };\n\n if (indices) {\n const indicesAccessor = this._addIndices(indices);\n // @ts-ignore\n glTFMesh.primitives[0].indices = indicesAccessor;\n }\n\n if (Number.isFinite(material)) {\n // @ts-ignore\n glTFMesh.primitives[0].material = material;\n }\n\n this.json.meshes = this.json.meshes || [];\n this.json.meshes.push(glTFMesh);\n return this.json.meshes.length - 1;\n }\n\n addPointCloud(attributes: object): number {\n // @ts-ignore\n const accessorIndices = this._addAttributes(attributes);\n\n const glTFMesh = {\n primitives: [\n {\n attributes: accessorIndices,\n mode: 0 // GL.POINTS\n }\n ]\n };\n\n this.json.meshes = this.json.meshes || [];\n this.json.meshes.push(glTFMesh);\n return this.json.meshes.length - 1;\n }\n\n /**\n * Adds a binary image. Builds glTF \"JSON metadata\" and saves buffer reference\n * Buffer will be copied into BIN chunk during \"pack\"\n * Currently encodes as glTF image\n * @param imageData\n * @param mimeType\n */\n addImage(imageData: any, mimeTypeOpt?: string): number {\n // If image is referencing a bufferView instead of URI, mimeType must be defined:\n // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#images\n // \"a reference to a bufferView; in that case mimeType must be defined.\"\n const metadata = getBinaryImageMetadata(imageData);\n const mimeType = mimeTypeOpt || metadata?.mimeType;\n\n const bufferViewIndex = this.addBufferView(imageData);\n\n const glTFImage = {\n bufferView: bufferViewIndex,\n mimeType\n };\n\n this.json.images = this.json.images || [];\n this.json.images.push(glTFImage);\n return this.json.images.length - 1;\n }\n\n /**\n * Add one untyped source buffer, create a matching glTF `bufferView`, and return its index\n * @param buffer\n */\n addBufferView(buffer: any): number {\n const byteLength = buffer.byteLength;\n assert(Number.isFinite(byteLength));\n\n // Add this buffer to the list of buffers to be written to the body.\n this.sourceBuffers = this.sourceBuffers || [];\n this.sourceBuffers.push(buffer);\n\n const glTFBufferView = {\n buffer: 0,\n // Write offset from the start of the binary body\n byteOffset: this.byteLength,\n byteLength\n };\n\n // We've now added the contents to the body, so update the total length\n // Every sub-chunk needs to be 4-byte align ed\n this.byteLength += padToNBytes(byteLength, 4);\n\n // Add a bufferView indicating start and length of this binary sub-chunk\n this.json.bufferViews = this.json.bufferViews || [];\n this.json.bufferViews.push(glTFBufferView);\n return this.json.bufferViews.length - 1;\n }\n\n /**\n * Adds an accessor to a bufferView\n * @param bufferViewIndex\n * @param accessor\n */\n addAccessor(bufferViewIndex: number, accessor: object): number {\n const glTFAccessor = {\n bufferView: bufferViewIndex,\n // @ts-ignore\n type: getAccessorTypeFromSize(accessor.size),\n // @ts-ignore\n componentType: accessor.componentType,\n // @ts-ignore\n count: accessor.count,\n // @ts-ignore\n max: accessor.max,\n // @ts-ignore\n min: accessor.min\n };\n\n this.json.accessors = this.json.accessors || [];\n this.json.accessors.push(glTFAccessor);\n return this.json.accessors.length - 1;\n }\n\n /**\n * Add a binary buffer. Builds glTF \"JSON metadata\" and saves buffer reference\n * Buffer will be copied into BIN chunk during \"pack\"\n * Currently encodes buffers as glTF accessors, but this could be optimized\n * @param sourceBuffer\n * @param accessor\n */\n addBinaryBuffer(sourceBuffer: any, accessor: object = {size: 3}): number {\n const bufferViewIndex = this.addBufferView(sourceBuffer);\n // @ts-ignore\n let minMax = {min: accessor.min, max: accessor.max};\n if (!minMax.min || !minMax.max) {\n // @ts-ignore\n minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);\n }\n\n const accessorDefaults = {\n // @ts-ignore\n size: accessor.size,\n componentType: getComponentTypeFromArray(sourceBuffer),\n // @ts-ignore\n count: Math.round(sourceBuffer.length / accessor.size),\n min: minMax.min,\n max: minMax.max\n };\n\n return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));\n }\n\n /**\n * Adds a texture to the json part\n * @todo: add more properties for texture initialization\n * `sampler`, `name`, `extensions`, `extras`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#texture\n */\n addTexture(texture: {imageIndex: number}): number {\n const {imageIndex} = texture;\n const glTFTexture = {\n source: imageIndex\n };\n\n this.json.textures = this.json.textures || [];\n this.json.textures.push(glTFTexture);\n return this.json.textures.length - 1;\n }\n\n /** Adds a material to the json part */\n addMaterial(pbrMaterialInfo: Object): number {\n this.json.materials = this.json.materials || [];\n this.json.materials.push(pbrMaterialInfo);\n return this.json.materials.length - 1;\n }\n\n /** Pack the binary chunk */\n createBinaryChunk(): void {\n // Encoder expects this array undefined or empty\n this.gltf.buffers = [];\n\n // Allocate total array\n const totalByteLength = this.byteLength;\n const arrayBuffer = new ArrayBuffer(totalByteLength);\n const targetArray = new Uint8Array(arrayBuffer);\n\n // Copy each array into\n let dstByteOffset = 0;\n for (const sourceBuffer of this.sourceBuffers || []) {\n dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);\n }\n\n // Update the glTF BIN CHUNK byte length\n if (this.json?.buffers?.[0]) {\n this.json.buffers[0].byteLength = totalByteLength;\n } else {\n this.json.buffers = [{byteLength: totalByteLength}];\n }\n\n // Save generated arrayBuffer\n this.gltf.binary = arrayBuffer;\n\n // Put arrayBuffer to sourceBuffers for possible additional writing data in the chunk\n this.sourceBuffers = [arrayBuffer];\n }\n\n // PRIVATE\n\n _removeStringFromArray(array, string) {\n let found = true;\n while (found) {\n const index = array.indexOf(string);\n if (index > -1) {\n array.splice(index, 1);\n } else {\n found = false;\n }\n }\n }\n\n /**\n * Add attributes to buffers and create `attributes` object which is part of `mesh`\n */\n _addAttributes(attributes = {}) {\n const result = {};\n for (const attributeKey in attributes) {\n const attributeData = attributes[attributeKey];\n const attrName = this._getGltfAttributeName(attributeKey);\n const accessor = this.addBinaryBuffer(attributeData.value, attributeData);\n result[attrName] = accessor;\n }\n return result;\n }\n\n /**\n * Add indices to buffers\n */\n _addIndices(indices) {\n return this.addBinaryBuffer(indices, {size: 1});\n }\n\n /**\n * Deduce gltf specific attribue name from input attribute name\n */\n _getGltfAttributeName(attributeName) {\n switch (attributeName.toLowerCase()) {\n case 'position':\n case 'positions':\n case 'vertices':\n return 'POSITION';\n case 'normal':\n case 'normals':\n return 'NORMAL';\n case 'color':\n case 'colors':\n return 'COLOR_0';\n case 'texcoord':\n case 'texcoords':\n return 'TEXCOORD_0';\n default:\n return attributeName;\n }\n }\n\n /**\n * Calculate `min` and `max` arrays of accessor according to spec:\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-accessor\n */\n _getAccessorMinMax(buffer, size) {\n const result = {min: null, max: null};\n if (buffer.length < size) {\n return result;\n }\n // @ts-ignore\n result.min = [];\n // @ts-ignore\n result.max = [];\n const initValues = buffer.subarray(0, size);\n for (const value of initValues) {\n // @ts-ignore\n result.min.push(value);\n // @ts-ignore\n result.max.push(value);\n }\n\n for (let index = size; index < buffer.length; index += size) {\n for (let componentIndex = 0; componentIndex < size; componentIndex++) {\n // @ts-ignore\n result.min[0 + componentIndex] = Math.min(\n // @ts-ignore\n result.min[0 + componentIndex],\n buffer[index + componentIndex]\n );\n // @ts-ignore\n result.max[0 + componentIndex] = Math.max(\n // @ts-ignore\n result.max[0 + componentIndex],\n buffer[index + componentIndex]\n );\n }\n }\n return result;\n }\n}\n"],"mappings":";AAkBA,SAAQA,sBAAsB,QAAO,oBAAoB;AACzD,SAAQC,WAAW,EAAEC,WAAW,QAAO,0BAA0B;AACjE,SAAQC,MAAM,QAAO,iBAAiB;AACtC,SACEC,6BAA6B,EAC7BC,uBAAuB,EACvBC,yBAAyB,QACpB,0BAA0B;AAIjC,SAASC,mBAAmBA,CAAA,EAAS;EACnC,OAAO;IACLC,KAAK,EAAE;MACLC,OAAO,EAAE,KAAK;MACdC,SAAS,EAAE;IACb,CAAC;IACDC,OAAO,EAAE,EAAE;IACXC,UAAU,EAAE,CAAC,CAAC;IACdC,kBAAkB,EAAE,EAAE;IACtB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oH,QAAQ,CAAC,CAAC,EAAE5C,IAAI,CAAC;IAC3C,KAAK,MAAMwC,KAAK,IAAIG,UAAU,EAAE;MAE9BR,MAAM,CAAC/B,GAAG,CAAC1D,IAAI,CAAC8F,KAAK,CAAC;MAEtBL,MAAM,CAAChC,GAAG,CAACzD,IAAI,CAAC8F,KAAK,CAAC;IACxB;IAEA,KAAK,IAAIlI,KAAK,GAAG0F,IAAI,EAAE1F,KAAK,GAAGkB,MAAM,CAACQ,MAAM,EAAE1B,KAAK,IAAI0F,IAAI,EAAE;MAC3D,KAAK,IAAI6C,cAAc,GAAG,CAAC,EAAEA,cAAc,GAAG7C,IAAI,EAAE6C,cAAc,EAAE,EAAE;QAEpEV,MAAM,CAAC/B,GAAG,CAAC,CAAC,GAAGyC,cAAc,CAAC,GAAGnC,IAAI,CAACN,GAAG,CAEvC+B,MAAM,CAAC/B,GAAG,CAAC,CAAC,GAAGyC,cAAc,CAAC,EAC9BrH,MAAM,CAAClB,KAAK,GAAGuI,cAAc,CAC/B,CAAC;QAEDV,MAAM,CAAChC,GAAG,CAAC,CAAC,GAAG0C,cAAc,CAAC,GAAGnC,IAAI,CAACP,GAAG,CAEvCgC,MAAM,CAAChC,GAAG,CAAC,CAAC,GAAG0C,cAAc,CAAC,EAC9BrH,MAAM,CAAClB,KAAK,GAAGuI,cAAc,CAC/B,CAAC;MACH;IACF;IACA,OAAOV,MAAM;EACf;AACF"}
|
|
1
|
+
{"version":3,"file":"gltf-scenegraph.js","names":["getBinaryImageMetadata","padToNBytes","copyToArray","assert","getAccessorArrayTypeAndLength","getAccessorTypeFromSize","getComponentTypeFromArray","makeDefaultGLTFJson","asset","version","generator","buffers","extensions","extensionsRequired","extensionsUsed","GLTFScenegraph","constructor","gltf","_defineProperty","json","images","sourceBuffers","byteLength","getApplicationData","key","data","getExtraData","extras","hasExtension","extensionName","isUsedExtension","getUsedExtensions","find","name","isRequiredExtension","getRequiredExtensions","getExtension","isExtension","getRequiredExtension","isRequired","getRemovedExtensions","extensionsRemoved","getObjectExtension","object","getScene","index","getObject","getNode","getSkin","getMesh","getMaterial","getAccessor","getTexture","getSampler","getImage","getBufferView","getBuffer","array","Error","concat","getTypedArrayForBufferView","bufferView","bufferIndex","buffer","binChunk","byteOffset","Uint8Array","arrayBuffer","getTypedArrayForAccessor","accessor","ArrayType","length","getTypedArrayForImageData","image","addApplicationData","addExtraData","addObjectExtension","registerUsedExtension","setObjectExtension","removeObjectExtension","includes","push","addExtension","extensionData","arguments","undefined","addRequiredExtension","registerRequiredExtension","ext","removeExtension","_this$json$extensions","_removeStringFromArray","setDefaultScene","sceneIndex","scene","addScene","nodeIndices","scenes","nodes","addNode","node","meshIndex","matrix","nodeData","mesh","addMesh","attributes","indices","material","mode","accessors","_addAttributes","glTFMesh","primitives","indicesAccessor","_addIndices","Number","isFinite","meshes","addPointCloud","accessorIndices","addImage","imageData","mimeTypeOpt","metadata","mimeType","bufferViewIndex","addBufferView","glTFImage","glTFBufferView","bufferViews","addAccessor","glTFAccessor","type","size","componentType","count","max","min","addBinaryBuffer","sourceBuffer","minMax","_getAccessorMinMax","accessorDefaults","Math","round","Object","assign","addTexture","texture","imageIndex","glTFTexture","source","textures","addMaterial","pbrMaterialInfo","materials","createBinaryChunk","_this$json","_this$json$buffers","totalByteLength","ArrayBuffer","targetArray","dstByteOffset","binary","string","found","indexOf","splice","result","attributeKey","attributeData","attrName","_getGltfAttributeName","value","attributeName","toLowerCase","initValues","subarray","componentIndex"],"sources":["../../../../src/lib/api/gltf-scenegraph.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {GLTFWithBuffers} from '../types/gltf-types';\nimport type {\n GLTF,\n GLTFScene,\n GLTFNode,\n GLTFMesh,\n GLTFSkin,\n GLTFMaterial,\n GLTFAccessor,\n GLTFSampler,\n GLTFTexture,\n GLTFImage,\n GLTFBuffer,\n GLTFBufferView\n} from '../types/gltf-json-schema';\n\nimport {getBinaryImageMetadata} from '@loaders.gl/images';\nimport {padToNBytes, copyToArray} from '@loaders.gl/loader-utils';\nimport {assert} from '../utils/assert';\nimport {\n getAccessorArrayTypeAndLength,\n getAccessorTypeFromSize,\n getComponentTypeFromArray\n} from '../gltf-utils/gltf-utils';\n\ntype Extension = {[key: string]: any};\n\nfunction makeDefaultGLTFJson(): GLTF {\n return {\n asset: {\n version: '2.0',\n generator: 'loaders.gl'\n },\n buffers: [],\n extensions: {},\n extensionsRequired: [],\n extensionsUsed: []\n };\n}\n\n/**\n * Class for structured access to GLTF data\n */\nexport class GLTFScenegraph {\n // internal\n gltf: GLTFWithBuffers;\n sourceBuffers: any[];\n byteLength: number;\n\n // TODO - why is this not GLTFWithBuffers - what happens to images?\n constructor(gltf?: {json: GLTF; buffers?: any[]; images?: any[]}) {\n // Declare locally so\n\n this.gltf = {\n json: gltf?.json || makeDefaultGLTFJson(),\n buffers: gltf?.buffers || [],\n images: gltf?.images || []\n };\n this.sourceBuffers = [];\n this.byteLength = 0;\n\n // Initialize buffers\n if (this.gltf.buffers && this.gltf.buffers[0]) {\n this.byteLength = this.gltf.buffers[0].byteLength;\n this.sourceBuffers = [this.gltf.buffers[0]];\n }\n }\n\n // Accessors\n\n get json(): GLTF {\n return this.gltf.json;\n }\n\n getApplicationData(key: string): unknown {\n // TODO - Data is already unpacked by GLBParser\n const data = this.json[key];\n return data;\n }\n\n getExtraData(key: string): {[key: string]: unknown} {\n // TODO - Data is already unpacked by GLBParser\n const extras = this.json.extras || {};\n return extras[key];\n }\n\n hasExtension(extensionName: string): boolean {\n const isUsedExtension = this.getUsedExtensions().find((name) => name === extensionName);\n const isRequiredExtension = this.getRequiredExtensions().find((name) => name === extensionName);\n return typeof isUsedExtension === 'string' || typeof isRequiredExtension === 'string';\n }\n\n getExtension<T = Extension>(extensionName: string): T | null {\n const isExtension = this.getUsedExtensions().find((name) => name === extensionName);\n const extensions = this.json.extensions || {};\n return isExtension ? (extensions[extensionName] as T) : null;\n }\n\n getRequiredExtension<T = Extension>(extensionName: string): T | null {\n const isRequired = this.getRequiredExtensions().find((name) => name === extensionName);\n return isRequired ? this.getExtension(extensionName) : null;\n }\n\n getRequiredExtensions(): string[] {\n return this.json.extensionsRequired || [];\n }\n\n getUsedExtensions(): string[] {\n return this.json.extensionsUsed || [];\n }\n\n getRemovedExtensions(): string[] {\n return (this.json.extensionsRemoved || []) as string[];\n }\n\n getObjectExtension<T = Extension>(object: {[key: string]: any}, extensionName: string): T | null {\n const extensions = object.extensions || {};\n return extensions[extensionName];\n }\n\n getScene(index: number): GLTFScene {\n return this.getObject('scenes', index) as GLTFScene;\n }\n\n getNode(index: number): GLTFNode {\n return this.getObject('nodes', index) as GLTFNode;\n }\n\n getSkin(index: number): GLTFSkin {\n return this.getObject('skins', index) as GLTFSkin;\n }\n\n getMesh(index: number): GLTFMesh {\n return this.getObject('meshes', index) as GLTFMesh;\n }\n\n getMaterial(index: number): GLTFMaterial {\n return this.getObject('materials', index) as GLTFMaterial;\n }\n\n getAccessor(index: number): GLTFAccessor {\n return this.getObject('accessors', index) as GLTFAccessor;\n }\n\n // getCamera(index: number): object | null {\n // return null; // TODO: fix thi: object as null;\n // }\n\n getTexture(index: number): GLTFTexture {\n return this.getObject('textures', index) as GLTFTexture;\n }\n\n getSampler(index: number): GLTFSampler {\n return this.getObject('samplers', index) as GLTFSampler;\n }\n\n getImage(index: number): GLTFImage {\n return this.getObject('images', index) as GLTFImage;\n }\n\n getBufferView(index: number | object): GLTFBufferView {\n return this.getObject('bufferViews', index) as GLTFBufferView;\n }\n\n getBuffer(index: number): GLTFBuffer {\n return this.getObject('buffers', index) as GLTFBuffer;\n }\n\n getObject(array: string, index: number | object): object {\n // check if already resolved\n if (typeof index === 'object') {\n return index;\n }\n const object = this.json[array] && (this.json[array] as {}[])[index];\n if (!object) {\n throw new Error(`glTF file error: Could not find ${array}[${index}]`); // eslint-disable-line\n }\n return object;\n }\n\n /**\n * Accepts buffer view index or buffer view object\n * @returns a `Uint8Array`\n */\n getTypedArrayForBufferView(bufferView: number | object): Uint8Array {\n bufferView = this.getBufferView(bufferView);\n // @ts-ignore\n const bufferIndex = bufferView.buffer;\n\n // Get hold of the arrayBuffer\n // const buffer = this.getBuffer(bufferIndex);\n const binChunk = this.gltf.buffers[bufferIndex];\n assert(binChunk);\n\n // @ts-ignore\n const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;\n // @ts-ignore\n return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);\n }\n\n /** Accepts accessor index or accessor object\n * @returns a typed array with type that matches the types\n */\n getTypedArrayForAccessor(accessor: number | object): any {\n // @ts-ignore\n accessor = this.getAccessor(accessor);\n // @ts-ignore\n const bufferView = this.getBufferView(accessor.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n // @ts-ignore\n const arrayBuffer = buffer.data;\n\n // Create a new typed array as a view into the combined buffer\n const {ArrayType, length} = getAccessorArrayTypeAndLength(accessor, bufferView);\n // @ts-ignore\n const byteOffset = bufferView.byteOffset + accessor.byteOffset;\n return new ArrayType(arrayBuffer, byteOffset, length);\n }\n\n /** accepts accessor index or accessor object\n * returns a `Uint8Array`\n */\n getTypedArrayForImageData(image: number | object): Uint8Array {\n // @ts-ignore\n image = this.getAccessor(image);\n // @ts-ignore\n const bufferView = this.getBufferView(image.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n // @ts-ignore\n const arrayBuffer = buffer.data;\n\n const byteOffset = bufferView.byteOffset || 0;\n return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);\n }\n\n // MODIFERS\n\n /**\n * Add an extra application-defined key to the top-level data structure\n */\n addApplicationData(key: string, data: object): GLTFScenegraph {\n this.json[key] = data;\n return this;\n }\n\n /**\n * `extras` - Standard GLTF field for storing application specific data\n */\n addExtraData(key: string, data: object): GLTFScenegraph {\n this.json.extras = this.json.extras || {};\n (this.json.extras as Record<string, unknown>)[key] = data;\n return this;\n }\n\n addObjectExtension(object: object, extensionName: string, data: object): GLTFScenegraph {\n // @ts-ignore\n object.extensions = object.extensions || {};\n // TODO - clobber or merge?\n // @ts-ignore\n object.extensions[extensionName] = data;\n this.registerUsedExtension(extensionName);\n return this;\n }\n\n setObjectExtension(object: any, extensionName: string, data: object): void {\n const extensions = object.extensions || {};\n extensions[extensionName] = data;\n // TODO - add to usedExtensions...\n }\n\n removeObjectExtension(object: any, extensionName: string): void {\n const extensions = object?.extensions || {};\n\n if (extensions[extensionName]) {\n this.json.extensionsRemoved = this.json.extensionsRemoved || [];\n const extensionsRemoved = this.json.extensionsRemoved as string[];\n if (!extensionsRemoved.includes(extensionName)) {\n extensionsRemoved.push(extensionName);\n }\n }\n\n delete extensions[extensionName];\n }\n\n /**\n * Add to standard GLTF top level extension object, mark as used\n */\n addExtension(extensionName: string, extensionData: object = {}): object {\n assert(extensionData);\n this.json.extensions = this.json.extensions || {};\n this.json.extensions[extensionName] = extensionData;\n this.registerUsedExtension(extensionName);\n return extensionData;\n }\n\n /**\n * Standard GLTF top level extension object, mark as used and required\n */\n addRequiredExtension(extensionName, extensionData: object = {}): object {\n assert(extensionData);\n this.addExtension(extensionName, extensionData);\n this.registerRequiredExtension(extensionName);\n return extensionData;\n }\n\n /**\n * Add extensionName to list of used extensions\n */\n registerUsedExtension(extensionName: string): void {\n this.json.extensionsUsed = this.json.extensionsUsed || [];\n if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {\n this.json.extensionsUsed.push(extensionName);\n }\n }\n\n /**\n * Add extensionName to list of required extensions\n */\n registerRequiredExtension(extensionName: string): void {\n this.registerUsedExtension(extensionName);\n this.json.extensionsRequired = this.json.extensionsRequired || [];\n if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {\n this.json.extensionsRequired.push(extensionName);\n }\n }\n\n /**\n * Removes an extension from the top-level list\n */\n removeExtension(extensionName: string): void {\n if (this.json.extensions?.[extensionName]) {\n this.json.extensionsRemoved = this.json.extensionsRemoved || [];\n const extensionsRemoved = this.json.extensionsRemoved as string[];\n if (!extensionsRemoved.includes(extensionName)) {\n extensionsRemoved.push(extensionName);\n }\n }\n if (this.json.extensions) {\n delete this.json.extensions[extensionName];\n }\n if (this.json.extensionsRequired) {\n this._removeStringFromArray(this.json.extensionsRequired, extensionName);\n }\n if (this.json.extensionsUsed) {\n this._removeStringFromArray(this.json.extensionsUsed, extensionName);\n }\n }\n\n /**\n * Set default scene which is to be displayed at load time\n */\n setDefaultScene(sceneIndex: number): void {\n this.json.scene = sceneIndex;\n }\n\n /**\n * @todo: add more properties for scene initialization:\n * name`, `extensions`, `extras`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-scene\n */\n addScene(scene: {nodeIndices: number[]}): number {\n const {nodeIndices} = scene;\n this.json.scenes = this.json.scenes || [];\n this.json.scenes.push({nodes: nodeIndices});\n return this.json.scenes.length - 1;\n }\n\n /**\n * @todo: add more properties for node initialization:\n * `name`, `extensions`, `extras`, `camera`, `children`, `skin`, `rotation`, `scale`, `translation`, `weights`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#node\n */\n addNode(node: {meshIndex: number; matrix?: number[]}): number {\n const {meshIndex, matrix} = node;\n this.json.nodes = this.json.nodes || [];\n const nodeData = {mesh: meshIndex};\n if (matrix) {\n // @ts-ignore\n nodeData.matrix = matrix;\n }\n this.json.nodes.push(nodeData);\n return this.json.nodes.length - 1;\n }\n\n /** Adds a mesh to the json part */\n addMesh(mesh: {attributes: object; indices?: object; material?: number; mode?: number}): number {\n const {attributes, indices, material, mode = 4} = mesh;\n const accessors = this._addAttributes(attributes);\n\n const glTFMesh = {\n primitives: [\n {\n attributes: accessors,\n mode\n }\n ]\n };\n\n if (indices) {\n const indicesAccessor = this._addIndices(indices);\n // @ts-ignore\n glTFMesh.primitives[0].indices = indicesAccessor;\n }\n\n if (Number.isFinite(material)) {\n // @ts-ignore\n glTFMesh.primitives[0].material = material;\n }\n\n this.json.meshes = this.json.meshes || [];\n this.json.meshes.push(glTFMesh);\n return this.json.meshes.length - 1;\n }\n\n addPointCloud(attributes: object): number {\n // @ts-ignore\n const accessorIndices = this._addAttributes(attributes);\n\n const glTFMesh = {\n primitives: [\n {\n attributes: accessorIndices,\n mode: 0 // GL.POINTS\n }\n ]\n };\n\n this.json.meshes = this.json.meshes || [];\n this.json.meshes.push(glTFMesh);\n return this.json.meshes.length - 1;\n }\n\n /**\n * Adds a binary image. Builds glTF \"JSON metadata\" and saves buffer reference\n * Buffer will be copied into BIN chunk during \"pack\"\n * Currently encodes as glTF image\n * @param imageData\n * @param mimeType\n */\n addImage(imageData: any, mimeTypeOpt?: string): number {\n // If image is referencing a bufferView instead of URI, mimeType must be defined:\n // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#images\n // \"a reference to a bufferView; in that case mimeType must be defined.\"\n const metadata = getBinaryImageMetadata(imageData);\n const mimeType = mimeTypeOpt || metadata?.mimeType;\n\n const bufferViewIndex = this.addBufferView(imageData);\n\n const glTFImage = {\n bufferView: bufferViewIndex,\n mimeType\n };\n\n this.json.images = this.json.images || [];\n this.json.images.push(glTFImage);\n return this.json.images.length - 1;\n }\n\n /**\n * Add one untyped source buffer, create a matching glTF `bufferView`, and return its index\n * @param buffer\n */\n addBufferView(buffer: any, bufferIndex = 0, byteOffset = this.byteLength): number {\n const byteLength = buffer.byteLength;\n assert(Number.isFinite(byteLength));\n\n // Add this buffer to the list of buffers to be written to the body.\n this.sourceBuffers = this.sourceBuffers || [];\n this.sourceBuffers.push(buffer);\n\n const glTFBufferView = {\n buffer: bufferIndex,\n // Write offset from the start of the binary body\n byteOffset,\n byteLength\n };\n\n // We've now added the contents to the body, so update the total length\n // Every sub-chunk needs to be 4-byte align ed\n this.byteLength += padToNBytes(byteLength, 4);\n\n // Add a bufferView indicating start and length of this binary sub-chunk\n this.json.bufferViews = this.json.bufferViews || [];\n this.json.bufferViews.push(glTFBufferView);\n return this.json.bufferViews.length - 1;\n }\n\n /**\n * Adds an accessor to a bufferView\n * @param bufferViewIndex\n * @param accessor\n */\n addAccessor(bufferViewIndex: number, accessor: object): number {\n const glTFAccessor = {\n bufferView: bufferViewIndex,\n // @ts-ignore\n type: getAccessorTypeFromSize(accessor.size),\n // @ts-ignore\n componentType: accessor.componentType,\n // @ts-ignore\n count: accessor.count,\n // @ts-ignore\n max: accessor.max,\n // @ts-ignore\n min: accessor.min\n };\n\n this.json.accessors = this.json.accessors || [];\n this.json.accessors.push(glTFAccessor);\n return this.json.accessors.length - 1;\n }\n\n /**\n * Add a binary buffer. Builds glTF \"JSON metadata\" and saves buffer reference\n * Buffer will be copied into BIN chunk during \"pack\"\n * Currently encodes buffers as glTF accessors, but this could be optimized\n * @param sourceBuffer\n * @param accessor\n */\n addBinaryBuffer(sourceBuffer: any, accessor: object = {size: 3}): number {\n const bufferViewIndex = this.addBufferView(sourceBuffer);\n // @ts-ignore\n let minMax = {min: accessor.min, max: accessor.max};\n if (!minMax.min || !minMax.max) {\n // @ts-ignore\n minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);\n }\n\n const accessorDefaults = {\n // @ts-ignore\n size: accessor.size,\n componentType: getComponentTypeFromArray(sourceBuffer),\n // @ts-ignore\n count: Math.round(sourceBuffer.length / accessor.size),\n min: minMax.min,\n max: minMax.max\n };\n\n return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));\n }\n\n /**\n * Adds a texture to the json part\n * @todo: add more properties for texture initialization\n * `sampler`, `name`, `extensions`, `extras`\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#texture\n */\n addTexture(texture: {imageIndex: number}): number {\n const {imageIndex} = texture;\n const glTFTexture = {\n source: imageIndex\n };\n\n this.json.textures = this.json.textures || [];\n this.json.textures.push(glTFTexture);\n return this.json.textures.length - 1;\n }\n\n /** Adds a material to the json part */\n addMaterial(pbrMaterialInfo: Object): number {\n this.json.materials = this.json.materials || [];\n this.json.materials.push(pbrMaterialInfo);\n return this.json.materials.length - 1;\n }\n\n /** Pack the binary chunk */\n createBinaryChunk(): void {\n // Encoder expects this array undefined or empty\n this.gltf.buffers = [];\n\n // Allocate total array\n const totalByteLength = this.byteLength;\n const arrayBuffer = new ArrayBuffer(totalByteLength);\n const targetArray = new Uint8Array(arrayBuffer);\n\n // Copy each array into\n let dstByteOffset = 0;\n for (const sourceBuffer of this.sourceBuffers || []) {\n dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);\n }\n\n // Update the glTF BIN CHUNK byte length\n if (this.json?.buffers?.[0]) {\n this.json.buffers[0].byteLength = totalByteLength;\n } else {\n this.json.buffers = [{byteLength: totalByteLength}];\n }\n\n // Save generated arrayBuffer\n this.gltf.binary = arrayBuffer;\n\n // Put arrayBuffer to sourceBuffers for possible additional writing data in the chunk\n this.sourceBuffers = [arrayBuffer];\n }\n\n // PRIVATE\n\n _removeStringFromArray(array, string) {\n let found = true;\n while (found) {\n const index = array.indexOf(string);\n if (index > -1) {\n array.splice(index, 1);\n } else {\n found = false;\n }\n }\n }\n\n /**\n * Add attributes to buffers and create `attributes` object which is part of `mesh`\n */\n _addAttributes(attributes = {}) {\n const result = {};\n for (const attributeKey in attributes) {\n const attributeData = attributes[attributeKey];\n const attrName = this._getGltfAttributeName(attributeKey);\n const accessor = this.addBinaryBuffer(attributeData.value, attributeData);\n result[attrName] = accessor;\n }\n return result;\n }\n\n /**\n * Add indices to buffers\n */\n _addIndices(indices) {\n return this.addBinaryBuffer(indices, {size: 1});\n }\n\n /**\n * Deduce gltf specific attribue name from input attribute name\n */\n _getGltfAttributeName(attributeName) {\n switch (attributeName.toLowerCase()) {\n case 'position':\n case 'positions':\n case 'vertices':\n return 'POSITION';\n case 'normal':\n case 'normals':\n return 'NORMAL';\n case 'color':\n case 'colors':\n return 'COLOR_0';\n case 'texcoord':\n case 'texcoords':\n return 'TEXCOORD_0';\n default:\n return attributeName;\n }\n }\n\n /**\n * Calculate `min` and `max` arrays of accessor according to spec:\n * https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-accessor\n */\n _getAccessorMinMax(buffer, size) {\n const result = {min: null, max: null};\n if (buffer.length < size) {\n return result;\n }\n // @ts-ignore\n result.min = [];\n // @ts-ignore\n result.max = [];\n const initValues = buffer.subarray(0, size);\n for (const value of initValues) {\n // @ts-ignore\n result.min.push(value);\n // @ts-ignore\n result.max.push(value);\n }\n\n for (let index = size; index < buffer.length; index += size) {\n for (let componentIndex = 0; componentIndex < size; componentIndex++) {\n // @ts-ignore\n result.min[0 + componentIndex] = Math.min(\n // @ts-ignore\n result.min[0 + componentIndex],\n buffer[index + componentIndex]\n );\n // @ts-ignore\n result.max[0 + componentIndex] = Math.max(\n // @ts-ignore\n result.max[0 + componentIndex],\n buffer[index + componentIndex]\n );\n }\n }\n return result;\n }\n}\n"],"mappings":";AAkBA,SAAQA,sBAAsB,QAAO,oBAAoB;AACzD,SAAQC,WAAW,EAAEC,WAAW,QAAO,0BAA0B;AACjE,SAAQC,MAAM,QAAO,iBAAiB;AACtC,SACEC,6BAA6B,EAC7BC,uBAAuB,EACvBC,yBAAyB,QACpB,0BAA0B;AAIjC,SAASC,mBAAmBA,CAAA,EAAS;EACnC,OAAO;IACLC,KAAK,EAAE;MACLC,OAAO,EAAE,KAAK;MACdC,SAAS,EAAE;IACb,CAAC;IACDC,OAAO,EAAE,EAAE;IACXC,UAAU,EAAE,CAAC,CAAC;IACdC,kBAAkB,EAAE,EAAE;IACtBC,cAAc,EAAE;EAClB,CAAC;AACH;AAKA,OAAO,MAAMC,cAAc,CAAC;EAO1BC,WAAWA,CAACC,IAAoD,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAGhE,IAAI,CAACD,IAAI,GAAG;MACVE,IAAI,EAAE,CAAAF,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEE,IAAI,KAAIZ,mBAAmB,CAAC,CAAC;MACzCI,OAAO,EAAE,CAAAM,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEN,OAAO,KAAI,EAAE;MAC5BS,MAAM,EAAE,CAAAH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,MAAM,KAAI;IAC1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