@itwin/core-frontend 5.6.0-dev.14 → 5.6.0-dev.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"GltfSchema.js","sourceRoot":"","sources":["../../../../src/common/gltf/GltfSchema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,iDAAS,CAAA;IACT,uDAAY,CAAA;IACZ,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,+BAA+B;IAC/B,iEAAiB,CAAA;IACjB,+BAA+B;IAC/B,6DAAe,CAAA;AACjB,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,8DAAmB,CAAA;IACnB,kEAAqB,CAAA;IACrB,gEAAkB,CAAA;IAClB,oEAAoB,CAAA;IACpB,sDAAa,CAAA;IACb,oDAAY,CAAA;IACZ,gDAAU,CAAA;IACV,kDAAW,CAAA;IACX,yDAAgB,CAAA;IAChB,yDAAgB,CAAA;IAChB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;AACnB,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB;AAED,gBAAgB;AAChB,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,0DAAc,CAAA;IACd,wDAAa,CAAA;AACf,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,gBAAgB;AAChB,MAAM,CAAN,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,0DAA+B,CAAA;IAC/B,wDAA6B,CAAA;IAC7B,oFAA2B,CAAA;IAC3B,kFAA0B,CA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U,CAAC,CAAC,iBAAiB,CAAC,GAAqB,EAAE,KAA+B,EAAE,SAAsB;IAChH,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAEhE,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI;YACP,SAAS;QAEX,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,MAAM,IAAI,CAAC;QACX,IAAI,IAAI,CAAC,QAAQ;YACf,KAAK,MAAM,KAAK,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC;gBACpE,MAAM,KAAK,CAAC;IAClB,CAAC;AACH,CAAC;AAwGD;;GAEG;AACH,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,8BAA8B;IAC9B,gEAAY,CAAA;AACd,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AA2FD,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,QAAsB;IACpD,MAAM,IAAI,GAAG,QAAyB,CAAC;IACvC,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM,CAAC;AACnE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\n/** Enumerates the types of [[GltfMeshPrimitive]] topologies.\r\n * @internal\r\n */\r\nexport enum GltfMeshMode {\r\n Points = 0,\r\n Lines = 1,\r\n LineLoop = 2,\r\n LineStrip = 3,\r\n Triangles = 4,\r\n /** Not currently supported. */\r\n TriangleStrip = 5,\r\n /** Not currently supported. */\r\n TriangleFan = 6,\r\n}\r\n\r\n/** Enumerates the basic data types supported by accessors, material values, technique uniforms, etc.\r\n * @internal\r\n */\r\nexport enum GltfDataType {\r\n SignedByte = 0x1400,\r\n UnsignedByte = 0x1401,\r\n SignedShort = 5122,\r\n UnsignedShort = 5123,\r\n UInt32 = 5125,\r\n Float = 5126,\r\n Rgb = 6407,\r\n Rgba = 6408,\r\n IntVec2 = 0x8b53,\r\n IntVec3 = 0x8b54,\r\n FloatVec2 = 35664,\r\n FloatVec3 = 35665,\r\n FloatVec4 = 35666,\r\n FloatMat3 = 35675,\r\n FloatMat4 = 35676,\r\n Sampler2d = 35678,\r\n}\r\n\r\n/** @internal */\r\nexport enum GltfMagFilter {\r\n Nearest = 9728,\r\n Linear = 9729,\r\n}\r\n\r\n/** @internal */\r\nexport enum GltfMinFilter {\r\n Nearest = GltfMagFilter.Nearest,\r\n Linear = GltfMagFilter.Linear,\r\n NearestMipMapNearest = 9984,\r\n LinearMipMapNearest = 9985,\r\n NearestMipMapLinear = 9986,\r\n LinearMipMapLinear = 9987,\r\n}\r\n\r\n/** Describes how texture coordinates outside of the range [0..1] are handled.\r\n * @internal\r\n */\r\nexport enum GltfWrapMode {\r\n ClampToEdge = 33071,\r\n MirroredRepeat = 33648,\r\n Repeat = 10497,\r\n}\r\n\r\n/** Describes the intended target of a [[GltfBufferViewProps]].\r\n * @internal\r\n */\r\nexport enum GltfBufferTarget {\r\n ArrayBuffer = 34962,\r\n ElementArrayBuffer = 24963,\r\n}\r\n\r\n/** The type used to refer to an entry in a GltfDictionary in a glTF 1.0 asset. @internal */\r\nexport type Gltf1Id = string;\r\n/** The type used to refer to an entry in a GltfDictionary in a glTF 2.0 asset. @internal */\r\nexport type Gltf2Id = number;\r\n/** The type used to refer to an entry in a GltfDictionary. @internal */\r\nexport type GltfId = Gltf1Id | Gltf2Id;\r\n\r\n/** A collection of resources of some type defined at the top-level of a [[GltfDocument]].\r\n * In glTF 1.0, these are defined as objects; each resource is referenced and accessed by its string key.\r\n * In glTF 2.0, these are defined as arrays; each resource is referenced and accessed by its integer array index.\r\n * @internal\r\n */\r\nexport interface GltfDictionary<T extends GltfChildOfRootProperty> {\r\n [key: GltfId]: T | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfStringMap<T> {\r\n [key: string]: T | undefined;\r\n}\r\n\r\n/** Iterate the contents of a [[GltfDictionary]].\r\n * @internal\r\n */\r\nexport function * gltfDictionaryIterator<T extends GltfChildOfRootProperty>(dict: GltfDictionary<T>): Iterable<T> {\r\n if (Array.isArray(dict)) {\r\n for (const elem of dict)\r\n yield elem;\r\n } else {\r\n for (const key of Object.keys(dict)) {\r\n const value = dict[key];\r\n if (undefined !== value)\r\n yield value;\r\n }\r\n }\r\n}\r\n\r\n/** Optional extensions applied to a [[GltfProperty]] to enable behavior not defined in the core specification.\r\n * @internal\r\n */\r\nexport type GltfExtensions = GltfStringMap<unknown>;\r\n\r\n/** The base interface provided by most objects in a glTF asset, permitting additional data to be associated with the object.\r\n * @internal\r\n */\r\nexport interface GltfProperty {\r\n extensions?: GltfExtensions;\r\n extras?: any;\r\n}\r\n\r\n/** The base interface provided by top-level properties of a [[GltfDocument]].\r\n * @internal\r\n */\r\nexport interface GltfChildOfRootProperty extends GltfProperty {\r\n /** Optional name, strictly for human consumption. */\r\n name?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DracoMeshCompression {\r\n bufferView: GltfId;\r\n // TEXCOORD_0, POSITION, etc\r\n attributes: GltfStringMap<number>;\r\n}\r\n\r\n/** @internal */\r\nexport interface MeshFeature extends GltfProperty {\r\n featureCount: number;\r\n nullFeatureId?: number;\r\n label?: string;\r\n propertyTable?: number;\r\n texture?: unknown;\r\n attribute?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface MeshFeatures {\r\n featureIds: MeshFeature[];\r\n}\r\n\r\n/** A unit of geometry belonging to a [[GltfMesh]]. @internal */\r\nexport interface GltfMeshPrimitive extends GltfProperty {\r\n /** Maps the name of each mesh attribute semantic to the Id of the [[GltfAccessor]] providing the attribute's data. */\r\n attributes: GltfStringMap<GltfId>;\r\n /** The Id of the [[GltfAccessor]] providing the vertex indices. */\r\n indices?: GltfId;\r\n /** The Id of the [[GltfMaterial]] to apply to the primitive when rendering. */\r\n material?: GltfId;\r\n /** The primitive topology type. */\r\n mode?: GltfMeshMode;\r\n /** Morph targets - currently unsupported. */\r\n targets?: GltfStringMap<GltfId>;\r\n extensions?: GltfExtensions & {\r\n /** The [CESIUM_primitive_outline](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline) extension\r\n * describes how to draw outline edges for a triangle mesh.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CESIUM_primitive_outline?: {\r\n /** The Id of the [[GltfBufferViewProps]] supplying the endpoints of each edge as indices into the triangle mesh's vertex array.\r\n * The number of indices must be even; each consecutive pair of indices describes one line segment. No connectivity between\r\n * line segments is implied.\r\n */\r\n indices?: GltfId;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_primitive_edge_visibility?: {\r\n visibility: GltfId;\r\n silhouetteNormals?: GltfId;\r\n material?: GltfId;\r\n lineStrings?: Array<{\r\n indices: GltfId;\r\n material?: GltfId;\r\n }>;\r\n };\r\n /** The [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md) extension\r\n * allows glTF to support geometry compressed with Draco geometry compression.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_draco_mesh_compression?: DracoMeshCompression;\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_features?: MeshFeatures;\r\n };\r\n}\r\n\r\n/** A collection of [[GltfMeshPrimitive]]s to be rendered. Each mesh is referenced by a node. Multiple nodes can refer to the same mesh.\r\n * The node's transform is applied when rendering the mesh.\r\n * @internal\r\n */\r\nexport interface GltfMesh extends GltfChildOfRootProperty {\r\n /** The collection of primitives to be rendered. */\r\n primitives?: GltfMeshPrimitive[];\r\n /** For morph targets - currently unsupported. */\r\n weights?: number[];\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_primitive_restart?: {\r\n primitiveGroups: Array<{\r\n primitives: number[];\r\n indices: number;\r\n }>;\r\n }\r\n };\r\n}\r\n\r\n/** Properties common to [[Gltf1Node]] and [[Gltf2Node]]. @internal */\r\nexport interface GltfNodeBaseProps {\r\n /** The Ids of the child nodes. @see [[GltfNode]]. */\r\n children?: GltfId[];\r\n /** Currently ignored. */\r\n camera?: GltfId;\r\n /** Currently ignored. */\r\n skin?: GltfId;\r\n /** A 4x4 column-major transformation matrix. Mutually exclusive with [[rotation]], [[scale]], and [[translation]]. */\r\n matrix?: number[];\r\n /** Unit quaternion as [x, y, z, w], where w is the scalar. */\r\n rotation?: [number, number, number, number];\r\n /** Non-uniform scale as [x, y, z]. */\r\n scale?: [number, number, number];\r\n /** Translation as [x, y, z]. */\r\n translation?: [number, number, number];\r\n}\r\n\r\n/** glTF 1.0 representation of a [[GltfNode]]. Unlike a [[Gltf2Node]], a Gltf1Node may refer to any number of [[GltfMesh]]es.\r\n * @internal\r\n */\r\nexport interface Gltf1Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\r\n /** The Ids of the [[GltfMesh]]es to be rendered by this node.\r\n * @note The spec defines this as an array of strings, but the original implementation of [[GltfReader]] was written to treat it as a string instead.\r\n * In case this was because of non-spec-compliant glTF that placed a string here instead of an array, either is permitted.\r\n */\r\n meshes?: GltfId[] | string;\r\n mesh?: never;\r\n /** Currently ignored. */\r\n jointName?: GltfId;\r\n /** Currently ignored. */\r\n skeletons?: GltfId[];\r\n}\r\n\r\n/** glTF 2.0 representation of a [[GltfNode]]. Unlike a [[Gltf1Node]], a Gltf2Node may refer to at most one [[GltfMesh]].\r\n * @internal\r\n */\r\nexport interface Gltf2Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\r\n /** The Id of the [[GltfMesh]] to be rendered by this node. */\r\n mesh?: GltfId;\r\n meshes?: never;\r\n /** Morph targets - currently ignored. */\r\n weights?: number[];\r\n extensions?: GltfExtensions & {\r\n /** The [EXT_mesh_gpu_instancing](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md) extension permits multiple\r\n * instances of the same mesh to be rendered with different translation, rotation, and/or scale.\r\n * All of the attribute accessors must have the same count (which indicates the number of instances to be drawn).\r\n * All attributes are optional (though omitting all of them would be silly).\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_gpu_instancing?: {\r\n attributes?: {\r\n /** VEC3; FLOAT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n TRANSLATION?: GltfId;\r\n /** VEC4 (quaternion); FLOAT, normalized BYTE, or normalized SHORT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ROTATION?: GltfId;\r\n /** VEC3; FLOAT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n SCALE?: GltfId;\r\n };\r\n };\r\n /** The [EXT_instance_features](https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features/README.md)\r\n * extension permits assigning identifiers to individual instances of a mesh, which can be used to look up per-instance data in a property table.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_instance_features?: {\r\n featureIds: {\r\n attribute?: number;\r\n featureCount: number;\r\n label?: string;\r\n nullFeatureId?: number;\r\n propertyTable: number;\r\n }[];\r\n };\r\n };\r\n}\r\n\r\n/** Describes a node in a [[GltfScene]]. Each node may be associated with zero, one (glTF 2.0), or any number of (glTF 1.0) [[GltfMesh]]es.\r\n * Each node may define a transform. Each node may have any number of child nodes. A child node's transform is multiplied by its parent node's transform.\r\n * Some nodes may be associated with other types of data like cameras, skins, lights, etc - these types of data are currently unsupported.\r\n * Rendering a node means rendering its meshes and the meshes of all of its descendants, with transforms applied.\r\n * @internal\r\n */\r\nexport type GltfNode = Gltf1Node | Gltf2Node;\r\n\r\n/** Get the Ids of the meshes associated with a node.\r\n * @internal\r\n */\r\nexport function getGltfNodeMeshIds(node: GltfNode): GltfId[] {\r\n if (undefined !== node.meshes)\r\n return typeof node.meshes === \"string\" ? [node.meshes] : node.meshes;\r\n else if (undefined !== node.mesh)\r\n return [node.mesh];\r\n\r\n return [];\r\n}\r\n\r\n/** @internal */\r\nexport function * traverseGltfNodes(ids: Iterable<GltfId>, nodes: GltfDictionary<GltfNode>, traversed: Set<GltfId>): Iterable<GltfNode> {\r\n for (const id of ids) {\r\n if (traversed.has(id))\r\n throw new Error(\"Cycle detected while traversing glTF nodes\");\r\n\r\n const node = nodes[id];\r\n if (!node)\r\n continue;\r\n\r\n traversed.add(id);\r\n yield node;\r\n if (node.children)\r\n for (const child of traverseGltfNodes(node.children, nodes, traversed))\r\n yield child;\r\n }\r\n}\r\n\r\n/** Describes a scene graph that composes any number of [[GltfNode]]s to produce a rendering of the [[GltfDocument]] asset.\r\n * An asset may define any number of scenes; the default scene is specified by [[Gltf.scene]].\r\n * @internal\r\n */\r\nexport interface GltfScene extends GltfChildOfRootProperty {\r\n /** The Ids of the nodes comprising the scene graph. */\r\n nodes?: GltfId[];\r\n}\r\n\r\n/** Provides metadata about a [[GltfDocument]] asset.\r\n * @internal\r\n */\r\nexport interface GltfAsset extends GltfProperty {\r\n /** A copyright message suitable for display to credit the content creator. */\r\n copyright?: string;\r\n /** The name of the tool that generated the asset. */\r\n generator?: string;\r\n /** The glTF version targeted by the asset, in the form \"major.minor\" where \"major\" and \"minor\" are integers. */\r\n version: string;\r\n /** The minimum glTF version required to properly load this asset, in the same form as [[version]].\r\n * This minimum version must be no greater than [[version]].\r\n */\r\n minVersion?: string;\r\n}\r\n\r\n/** Describes an image such as one used for a [[GltfTexture]]. The image may be referenced by a [[uri]] or a [[bufferView]].\r\n * @internal\r\n */\r\nexport interface GltfImage extends GltfChildOfRootProperty {\r\n /** URI from which the image data can be obtained, either as a base-64-encoded data URI or an external resource.\r\n * Mutually exclusive with [[bufferView]].\r\n */\r\n uri?: string;\r\n /** The image's media type. This property is required if [[bufferView]] is defined. */\r\n mimeType?: \"image/jpeg\" | \"image/png\";\r\n /** The Id of the [[GltfBufferViewProps]] containing the image data. Mutually exclusive with [[uri]]. */\r\n bufferView?: GltfId;\r\n extensions?: GltfExtensions & {\r\n /** The [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/main/extensions/1.0/Khronos/KHR_binary_glTF) allows an image to\r\n * be embedded in a binary chunk appended to the glTF asset's JSON, instead of being referenced by an external URI.\r\n * This is superseded in glTF 2.0 by support for the glb file format specification.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_binary_glTF?: {\r\n /** The Id of the [[GltfBufferViewProps]] that contains the binary image data. */\r\n bufferView?: GltfId;\r\n /** Required - @see [[GltfImage.mimeType]]. */\r\n mimeType?: string;\r\n };\r\n };\r\n}\r\n\r\n/** Describes a reference to a [[GltfTexture]]. @internal */\r\nexport interface GltfTextureInfo extends GltfProperty {\r\n /** The Id of the [[GltfTexture]]. */\r\n index: GltfId;\r\n /** The set index of the texture's TEXCOORD attribute used for texture coordinate mapping.\r\n * For example, if `texCoord` is `2`, an attribute named `TEXCOORD_2` must exist containing the texture coordinates.\r\n * Default: 0.\r\n */\r\n texCoord?: number;\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_textureInfo_constant_lod?: {\r\n repetitions?: number,\r\n offset?: [number, number],\r\n minClampDistance?: number,\r\n maxClampDistance?: number\r\n }\r\n };\r\n}\r\n\r\n/** Describes a texture and its sampler.\r\n * @internal\r\n */\r\nexport interface GltfTexture extends GltfChildOfRootProperty {\r\n /** The Id of the [[GltfSampler]] used by this texture.\r\n * If undefined, a sampler with repeat wrapping and auto filtering should be used by default.\r\n */\r\n sampler?: GltfId;\r\n /** The Id of the [[GltfImage]] used by this texture.\r\n * If undefined, an extension or other mechanism should supply an alternate image source - otherwise, the behavior is undefined.\r\n */\r\n source?: GltfId;\r\n}\r\n\r\n/** Describes the filtering and wrapping behavior to be applied to a [[GltfTexture]].\r\n * @note The implementation currently does not support MirroredRepeat and does not support different wrapping for U and V;\r\n * effectively, unless `wrapS` or `wrapT` is set to ClampToEdge, the sampler will use GltfWrapMode.Repeat.\r\n * @internal\r\n */\r\nexport interface GltfSampler extends GltfChildOfRootProperty {\r\n /** Magnification filter. */\r\n magFilter?: GltfMagFilter;\r\n /** Minification filter. */\r\n minFilter?: GltfMinFilter;\r\n /** S (U) wrapping mode. Default: Repeat. */\r\n wrapS?: GltfWrapMode;\r\n /** T (V) wrapping mode. Default: Repeat. */\r\n wrapT?: GltfWrapMode;\r\n}\r\n\r\n/** GL states that can be enabled by a [[GltfTechnique]]. Only those queried by this implementation are enumerated.\r\n * @internal\r\n */\r\nexport enum GltfTechniqueState {\r\n /** Enables alpha blending. */\r\n Blend = 3042,\r\n}\r\n\r\n/** For glTF 1.0 only, describes shader programs and shader state associated with a [[Gltf1Material]], used to render meshes associated with the material.\r\n * This implementation uses it strictly to identify techniques that require alpha blending.\r\n * @internal\r\n */\r\nexport interface GltfTechnique extends GltfChildOfRootProperty {\r\n /** GL render states to be applied by the technique. */\r\n states?: {\r\n /** An array of integers corresponding to boolean GL states that should be enabled using GL's `enable` function.\r\n * For example, the value [[GltfTechniqueState.Blend]] (3042) indicates that blending should be enabled.\r\n */\r\n enable?: GltfTechniqueState[];\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface Gltf1Material extends GltfChildOfRootProperty {\r\n diffuse?: string;\r\n emission?: number[];\r\n shininess?: number;\r\n specular?: number[];\r\n technique?: GltfId;\r\n values?: {\r\n texStep?: number[];\r\n color?: number[];\r\n tex?: number | string;\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfMaterialPbrMetallicRoughness extends GltfProperty {\r\n // Default [1,1,1,1]\r\n baseColorFactor?: number[];\r\n baseColorTexture?: GltfTextureInfo;\r\n // Default 1\r\n metallicFactor?: number;\r\n // Default 1\r\n roughnessFactor?: number;\r\n metallicRoughnessTexture?: GltfTextureInfo;\r\n}\r\n\r\n/** @internal */\r\nexport type GltfAlphaMode = \"OPAQUE\" | \"MASK\" | \"BLEND\";\r\n\r\n/** @internal */\r\nexport interface Gltf2Material extends GltfChildOfRootProperty {\r\n pbrMetallicRoughness?: GltfMaterialPbrMetallicRoughness;\r\n normalTexture?: GltfTextureInfo;\r\n occlusionTexture?: unknown;\r\n emissiveTexture?: GltfTextureInfo;\r\n emissiveFactor?: number[];\r\n // Default OPAQUE\r\n alphaMode?: GltfAlphaMode;\r\n // Default 0.5. Ignored unless alphaMode=MASK\r\n alphaCutoff?: number;\r\n doubleSided?: boolean;\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BENTLEY_materials_point_style?: { diameter: number };\r\n /** The [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_unlit) extension\r\n * indicates that the material should be displayed without lighting. The extension adds no additional properties; it is effectively a boolean flag.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_materials_unlit?: object;\r\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\r\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\r\n * Here, it is only used to extract uniform values.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_techniques_webgl?: {\r\n technique?: number;\r\n // An object containing uniform values. Each property name corresponds to a uniform in the material's technique and must conform to that uniform's type and count properties.\r\n // A handful of uniforms referenced in this implementation by name are defined below.\r\n values?: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_texStep?: number[];\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_color?: number[];\r\n // Diffuse texture.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_diffuse?: { index: number, texCoord: number };\r\n [k: string]: unknown;\r\n };\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport type GltfMaterial = Gltf1Material | Gltf2Material;\r\n\r\n/** @internal */\r\nexport function isGltf1Material(material: GltfMaterial): material is Gltf1Material {\r\n const mat1 = material as Gltf1Material;\r\n return undefined !== mat1.technique || undefined !== mat1.values;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfBuffer extends GltfChildOfRootProperty {\r\n uri?: string;\r\n byteLength?: number;\r\n extensions?: GltfExtensions & {\r\n // https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\r\n EXT_meshopt_compression?: { // eslint-disable-line @typescript-eslint/naming-convention\r\n fallback?: boolean;\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport type ExtMeshoptCompressionMode = \"ATTRIBUTES\" | \"TRIANGLES\" | \"INDICES\";\r\n\r\n/** @internal */\r\nexport type ExtMeshoptCompressionFilter = \"NONE\" | \"OCTAHEDRAL\" | \"QUATERNION\";\r\n\r\n/** https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\r\n * @internal\r\n*/\r\nexport interface GltfBufferViewMeshoptCompressionExtension {\r\n buffer: number;\r\n byteOffset?: number;\r\n byteLength: number;\r\n byteStride: number;\r\n count: number;\r\n mode: ExtMeshoptCompressionMode;\r\n filter?: ExtMeshoptCompressionFilter;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfBufferViewProps extends GltfChildOfRootProperty {\r\n buffer: GltfId;\r\n byteLength?: number;\r\n byteOffset?: number;\r\n byteStride?: number;\r\n target?: GltfBufferTarget;\r\n extensions?: GltfExtensions & {\r\n EXT_meshopt_compression?: GltfBufferViewMeshoptCompressionExtension; // eslint-disable-line @typescript-eslint/naming-convention\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfAccessor extends GltfChildOfRootProperty {\r\n bufferView?: GltfId;\r\n byteOffset?: number;\r\n componentType?: GltfDataType.SignedByte | GltfDataType.UnsignedByte | GltfDataType.SignedShort | GltfDataType.UnsignedShort | GltfDataType.UInt32 | GltfDataType.Float;\r\n normalized?: boolean;\r\n count: number;\r\n type: \"SCALAR\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\";\r\n max?: number[];\r\n min?: number[];\r\n sparse?: unknown; // ###TODO sparse accessors\r\n extensions?: GltfExtensions & {\r\n /** Quantized attributes for glTF 1.0. Superceded by KHR_mesh_quantization. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n WEB3D_quantized_attributes?: {\r\n decodedMin: number[];\r\n decodedMax: number[];\r\n /** Currently ignored. */\r\n decodeMatrix: number[];\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport namespace GltfStructuralMetadata {\r\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\r\n export type ClassPropertyType = \"SCALAR\" | \"STRING\" | \"BOOLEAN\" | \"ENUM\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\" | string;\r\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\r\n export type ClassPropertyComponentType = \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | \"FLOAT32\" | \"FLOAT64\" | string;\r\n\r\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\r\n export interface ClassProperty extends GltfProperty {\r\n type: ClassPropertyType;\r\n name?: string;\r\n description?: string;\r\n componentType?: ClassPropertyComponentType;\r\n enumType?: string;\r\n array?: boolean;\r\n count?: number;\r\n normalized?: boolean;\r\n offset?: number;\r\n scale?: number;\r\n min?: number;\r\n max?: number;\r\n required?: boolean;\r\n noData?: unknown;\r\n default?: unknown;\r\n semantic?: string;\r\n }\r\n\r\n export interface EnumValue extends GltfProperty {\r\n name: string;\r\n value: number; // an integer\r\n description?: string;\r\n }\r\n\r\n export interface Enum extends GltfProperty {\r\n values: EnumValue[];\r\n // Default: UINT16\r\n valueType?: \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n name?: string;\r\n description?: string;\r\n }\r\n\r\n export interface Class extends GltfProperty {\r\n name?: string;\r\n description?: string;\r\n properties?: {\r\n [propertyId: string]: ClassProperty | undefined;\r\n };\r\n }\r\n\r\n export interface Schema extends GltfProperty {\r\n id: string;\r\n name?: string;\r\n description?: string;\r\n version?: string;\r\n classes?: {\r\n [classId: string]: Class | undefined;\r\n };\r\n enums?: Enum[];\r\n }\r\n\r\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\r\n export interface PropertyTableProperty extends GltfProperty {\r\n values: GltfId;\r\n arrayOffsets?: GltfId;\r\n stringOffsets?: GltfId;\r\n arrayOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n stringOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n offset?: number;\r\n scale?: number;\r\n min?: number;\r\n max?: number;\r\n }\r\n\r\n export interface PropertyTable {\r\n class: string;\r\n count: number;\r\n properties?: {\r\n [propertyId: string]: PropertyTableProperty | undefined;\r\n };\r\n }\r\n\r\n export interface Extension extends GltfProperty {\r\n // Exactly one of schema or schemaUri must be present.\r\n schemaUri?: string;\r\n schema?: Schema;\r\n propertyTables?: PropertyTable[];\r\n propertyTextures?: unknown;\r\n propertyAttributes?: unknown;\r\n }\r\n}\r\n\r\n/** Describes the top-level structure of a glTF asset.\r\n * This interface, along with all of the related Gltf* types defined in this file, is primarily based upon the [official glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html).\r\n * However, it can also represent a [glTF 1.0](https://github.com/KhronosGroup/glTF/tree/main/specification/1.0#reference-node) asset.\r\n * Some types are combined. For example, the top-level dictionaries in glTF 1.0 are objects, while in glTF 2.0 they are arrays; the GltfDictionary interface supports accessing\r\n * items using either strings or numeric indexes represented by [[GltfId]].\r\n * For types that differ significantly between the two specs, Gltf1* and Gltf2* versions are defined (e.g., GltfMaterial is a union of Gltf1Material and Gltf2Material).\r\n * These interfaces also accommodate some deviations from both specs that are known to exist in the wild.\r\n * Most aspects of the specifications that are not implemented here are omitted (e.g., skinning, animations).\r\n * @internal\r\n */\r\nexport interface GltfDocument extends GltfProperty {\r\n /** Metadata about the glTF asset.\r\n * @note This property is required in glTF 2.0, but optional in 1.0.\r\n */\r\n asset?: GltfAsset;\r\n /** The Id of the default [[GltfScene]] in [[scenes]]. */\r\n scene?: GltfId;\r\n extensions?: GltfExtensions & {\r\n /** The [CESIUM_RTC extension](https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/CESIUM_RTC/README.md) defines a centroid\r\n * relative to which all coordinates in the asset are defined, to reduce floating-point precision errors for large coordinates.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CESIUM_RTC?: {\r\n center?: number[];\r\n };\r\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\r\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\r\n * Here, it is only used to extract uniform values.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_techniques_webgl?: {\r\n techniques?: Array<{\r\n uniforms?: {\r\n [key: string]: { type: GltfDataType, value?: any } | undefined;\r\n };\r\n }>;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_structural_metadata?: GltfStructuralMetadata.Extension;\r\n };\r\n /** Names of glTF extensions used in the asset. */\r\n extensionsUsed?: string[];\r\n /** Names of glTF extensions required to properly load the asset. */\r\n extensionsRequired?: string[];\r\n accessors?: GltfDictionary<GltfAccessor>;\r\n /** Not currently supported. */\r\n animations?: GltfDictionary<any>;\r\n buffers?: GltfDictionary<GltfBuffer>;\r\n bufferViews?: GltfDictionary<GltfBufferViewProps>;\r\n /** Not currently used. */\r\n cameras?: GltfDictionary<any>;\r\n images?: GltfDictionary<GltfImage>;\r\n materials?: GltfDictionary<GltfMaterial>;\r\n meshes?: GltfDictionary<GltfMesh>;\r\n nodes?: GltfDictionary<GltfNode>;\r\n samplers?: GltfDictionary<GltfSampler>;\r\n scenes?: GltfDictionary<GltfScene>;\r\n /** Not currently supported. */\r\n skins?: GltfDictionary<any>;\r\n textures?: GltfDictionary<GltfTexture>;\r\n /** For glTF 1.0 only, techniques associated with [[Gltf1Material]]s. */\r\n techniques?: GltfDictionary<GltfTechnique>;\r\n}\r\n"]}
1
+ {"version":3,"file":"GltfSchema.js","sourceRoot":"","sources":["../../../../src/common/gltf/GltfSchema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,iDAAS,CAAA;IACT,uDAAY,CAAA;IACZ,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,+BAA+B;IAC/B,iEAAiB,CAAA;IACjB,+BAA+B;IAC/B,6DAAe,CAAA;AACjB,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB;AAED;;GAEG;AACH,M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AC;AAwGD;;GAEG;AACH,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,8BAA8B;IAC9B,gEAAY,CAAA;AACd,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAsGD,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,QAAsB;IACpD,MAAM,IAAI,GAAG,QAAyB,CAAC;IACvC,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM,CAAC;AACnE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\n/** Enumerates the types of [[GltfMeshPrimitive]] topologies.\r\n * @internal\r\n */\r\nexport enum GltfMeshMode {\r\n Points = 0,\r\n Lines = 1,\r\n LineLoop = 2,\r\n LineStrip = 3,\r\n Triangles = 4,\r\n /** Not currently supported. */\r\n TriangleStrip = 5,\r\n /** Not currently supported. */\r\n TriangleFan = 6,\r\n}\r\n\r\n/** Enumerates the basic data types supported by accessors, material values, technique uniforms, etc.\r\n * @internal\r\n */\r\nexport enum GltfDataType {\r\n SignedByte = 0x1400,\r\n UnsignedByte = 0x1401,\r\n SignedShort = 5122,\r\n UnsignedShort = 5123,\r\n UInt32 = 5125,\r\n Float = 5126,\r\n Rgb = 6407,\r\n Rgba = 6408,\r\n IntVec2 = 0x8b53,\r\n IntVec3 = 0x8b54,\r\n FloatVec2 = 35664,\r\n FloatVec3 = 35665,\r\n FloatVec4 = 35666,\r\n FloatMat3 = 35675,\r\n FloatMat4 = 35676,\r\n Sampler2d = 35678,\r\n}\r\n\r\n/** @internal */\r\nexport enum GltfMagFilter {\r\n Nearest = 9728,\r\n Linear = 9729,\r\n}\r\n\r\n/** @internal */\r\nexport enum GltfMinFilter {\r\n Nearest = GltfMagFilter.Nearest,\r\n Linear = GltfMagFilter.Linear,\r\n NearestMipMapNearest = 9984,\r\n LinearMipMapNearest = 9985,\r\n NearestMipMapLinear = 9986,\r\n LinearMipMapLinear = 9987,\r\n}\r\n\r\n/** Describes how texture coordinates outside of the range [0..1] are handled.\r\n * @internal\r\n */\r\nexport enum GltfWrapMode {\r\n ClampToEdge = 33071,\r\n MirroredRepeat = 33648,\r\n Repeat = 10497,\r\n}\r\n\r\n/** Describes the intended target of a [[GltfBufferViewProps]].\r\n * @internal\r\n */\r\nexport enum GltfBufferTarget {\r\n ArrayBuffer = 34962,\r\n ElementArrayBuffer = 24963,\r\n}\r\n\r\n/** The type used to refer to an entry in a GltfDictionary in a glTF 1.0 asset. @internal */\r\nexport type Gltf1Id = string;\r\n/** The type used to refer to an entry in a GltfDictionary in a glTF 2.0 asset. @internal */\r\nexport type Gltf2Id = number;\r\n/** The type used to refer to an entry in a GltfDictionary. @internal */\r\nexport type GltfId = Gltf1Id | Gltf2Id;\r\n\r\n/** A collection of resources of some type defined at the top-level of a [[GltfDocument]].\r\n * In glTF 1.0, these are defined as objects; each resource is referenced and accessed by its string key.\r\n * In glTF 2.0, these are defined as arrays; each resource is referenced and accessed by its integer array index.\r\n * @internal\r\n */\r\nexport interface GltfDictionary<T extends GltfChildOfRootProperty> {\r\n [key: GltfId]: T | undefined;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfStringMap<T> {\r\n [key: string]: T | undefined;\r\n}\r\n\r\n/** Iterate the contents of a [[GltfDictionary]].\r\n * @internal\r\n */\r\nexport function * gltfDictionaryIterator<T extends GltfChildOfRootProperty>(dict: GltfDictionary<T>): Iterable<T> {\r\n if (Array.isArray(dict)) {\r\n for (const elem of dict)\r\n yield elem;\r\n } else {\r\n for (const key of Object.keys(dict)) {\r\n const value = dict[key];\r\n if (undefined !== value)\r\n yield value;\r\n }\r\n }\r\n}\r\n\r\n/** Optional extensions applied to a [[GltfProperty]] to enable behavior not defined in the core specification.\r\n * @internal\r\n */\r\nexport type GltfExtensions = GltfStringMap<unknown>;\r\n\r\n/** The base interface provided by most objects in a glTF asset, permitting additional data to be associated with the object.\r\n * @internal\r\n */\r\nexport interface GltfProperty {\r\n extensions?: GltfExtensions;\r\n extras?: any;\r\n}\r\n\r\n/** The base interface provided by top-level properties of a [[GltfDocument]].\r\n * @internal\r\n */\r\nexport interface GltfChildOfRootProperty extends GltfProperty {\r\n /** Optional name, strictly for human consumption. */\r\n name?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface DracoMeshCompression {\r\n bufferView: GltfId;\r\n // TEXCOORD_0, POSITION, etc\r\n attributes: GltfStringMap<number>;\r\n}\r\n\r\n/** @internal */\r\nexport interface MeshFeature extends GltfProperty {\r\n featureCount: number;\r\n nullFeatureId?: number;\r\n label?: string;\r\n propertyTable?: number;\r\n texture?: unknown;\r\n attribute?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface MeshFeatures {\r\n featureIds: MeshFeature[];\r\n}\r\n\r\n/** A unit of geometry belonging to a [[GltfMesh]]. @internal */\r\nexport interface GltfMeshPrimitive extends GltfProperty {\r\n /** Maps the name of each mesh attribute semantic to the Id of the [[GltfAccessor]] providing the attribute's data. */\r\n attributes: GltfStringMap<GltfId>;\r\n /** The Id of the [[GltfAccessor]] providing the vertex indices. */\r\n indices?: GltfId;\r\n /** The Id of the [[GltfMaterial]] to apply to the primitive when rendering. */\r\n material?: GltfId;\r\n /** The primitive topology type. */\r\n mode?: GltfMeshMode;\r\n /** Morph targets - currently unsupported. */\r\n targets?: GltfStringMap<GltfId>;\r\n extensions?: GltfExtensions & {\r\n /** The [CESIUM_primitive_outline](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline) extension\r\n * describes how to draw outline edges for a triangle mesh.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CESIUM_primitive_outline?: {\r\n /** The Id of the [[GltfBufferViewProps]] supplying the endpoints of each edge as indices into the triangle mesh's vertex array.\r\n * The number of indices must be even; each consecutive pair of indices describes one line segment. No connectivity between\r\n * line segments is implied.\r\n */\r\n indices?: GltfId;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_primitive_edge_visibility?: {\r\n visibility: GltfId;\r\n silhouetteNormals?: GltfId;\r\n material?: GltfId;\r\n lineStrings?: Array<{\r\n indices: GltfId;\r\n material?: GltfId;\r\n }>;\r\n };\r\n /** The [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md) extension\r\n * allows glTF to support geometry compressed with Draco geometry compression.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_draco_mesh_compression?: DracoMeshCompression;\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_features?: MeshFeatures;\r\n };\r\n}\r\n\r\n/** A collection of [[GltfMeshPrimitive]]s to be rendered. Each mesh is referenced by a node. Multiple nodes can refer to the same mesh.\r\n * The node's transform is applied when rendering the mesh.\r\n * @internal\r\n */\r\nexport interface GltfMesh extends GltfChildOfRootProperty {\r\n /** The collection of primitives to be rendered. */\r\n primitives?: GltfMeshPrimitive[];\r\n /** For morph targets - currently unsupported. */\r\n weights?: number[];\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_primitive_restart?: {\r\n primitiveGroups: Array<{\r\n primitives: number[];\r\n indices: number;\r\n }>;\r\n }\r\n };\r\n}\r\n\r\n/** Properties common to [[Gltf1Node]] and [[Gltf2Node]]. @internal */\r\nexport interface GltfNodeBaseProps {\r\n /** The Ids of the child nodes. @see [[GltfNode]]. */\r\n children?: GltfId[];\r\n /** Currently ignored. */\r\n camera?: GltfId;\r\n /** Currently ignored. */\r\n skin?: GltfId;\r\n /** A 4x4 column-major transformation matrix. Mutually exclusive with [[rotation]], [[scale]], and [[translation]]. */\r\n matrix?: number[];\r\n /** Unit quaternion as [x, y, z, w], where w is the scalar. */\r\n rotation?: [number, number, number, number];\r\n /** Non-uniform scale as [x, y, z]. */\r\n scale?: [number, number, number];\r\n /** Translation as [x, y, z]. */\r\n translation?: [number, number, number];\r\n}\r\n\r\n/** glTF 1.0 representation of a [[GltfNode]]. Unlike a [[Gltf2Node]], a Gltf1Node may refer to any number of [[GltfMesh]]es.\r\n * @internal\r\n */\r\nexport interface Gltf1Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\r\n /** The Ids of the [[GltfMesh]]es to be rendered by this node.\r\n * @note The spec defines this as an array of strings, but the original implementation of [[GltfReader]] was written to treat it as a string instead.\r\n * In case this was because of non-spec-compliant glTF that placed a string here instead of an array, either is permitted.\r\n */\r\n meshes?: GltfId[] | string;\r\n mesh?: never;\r\n /** Currently ignored. */\r\n jointName?: GltfId;\r\n /** Currently ignored. */\r\n skeletons?: GltfId[];\r\n}\r\n\r\n/** glTF 2.0 representation of a [[GltfNode]]. Unlike a [[Gltf1Node]], a Gltf2Node may refer to at most one [[GltfMesh]].\r\n * @internal\r\n */\r\nexport interface Gltf2Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\r\n /** The Id of the [[GltfMesh]] to be rendered by this node. */\r\n mesh?: GltfId;\r\n meshes?: never;\r\n /** Morph targets - currently ignored. */\r\n weights?: number[];\r\n extensions?: GltfExtensions & {\r\n /** The [EXT_mesh_gpu_instancing](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md) extension permits multiple\r\n * instances of the same mesh to be rendered with different translation, rotation, and/or scale.\r\n * All of the attribute accessors must have the same count (which indicates the number of instances to be drawn).\r\n * All attributes are optional (though omitting all of them would be silly).\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_mesh_gpu_instancing?: {\r\n attributes?: {\r\n /** VEC3; FLOAT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n TRANSLATION?: GltfId;\r\n /** VEC4 (quaternion); FLOAT, normalized BYTE, or normalized SHORT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n ROTATION?: GltfId;\r\n /** VEC3; FLOAT */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n SCALE?: GltfId;\r\n };\r\n };\r\n /** The [EXT_instance_features](https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features/README.md)\r\n * extension permits assigning identifiers to individual instances of a mesh, which can be used to look up per-instance data in a property table.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_instance_features?: {\r\n featureIds: {\r\n attribute?: number;\r\n featureCount: number;\r\n label?: string;\r\n nullFeatureId?: number;\r\n propertyTable: number;\r\n }[];\r\n };\r\n };\r\n}\r\n\r\n/** Describes a node in a [[GltfScene]]. Each node may be associated with zero, one (glTF 2.0), or any number of (glTF 1.0) [[GltfMesh]]es.\r\n * Each node may define a transform. Each node may have any number of child nodes. A child node's transform is multiplied by its parent node's transform.\r\n * Some nodes may be associated with other types of data like cameras, skins, lights, etc - these types of data are currently unsupported.\r\n * Rendering a node means rendering its meshes and the meshes of all of its descendants, with transforms applied.\r\n * @internal\r\n */\r\nexport type GltfNode = Gltf1Node | Gltf2Node;\r\n\r\n/** Get the Ids of the meshes associated with a node.\r\n * @internal\r\n */\r\nexport function getGltfNodeMeshIds(node: GltfNode): GltfId[] {\r\n if (undefined !== node.meshes)\r\n return typeof node.meshes === \"string\" ? [node.meshes] : node.meshes;\r\n else if (undefined !== node.mesh)\r\n return [node.mesh];\r\n\r\n return [];\r\n}\r\n\r\n/** @internal */\r\nexport function * traverseGltfNodes(ids: Iterable<GltfId>, nodes: GltfDictionary<GltfNode>, traversed: Set<GltfId>): Iterable<GltfNode> {\r\n for (const id of ids) {\r\n if (traversed.has(id))\r\n throw new Error(\"Cycle detected while traversing glTF nodes\");\r\n\r\n const node = nodes[id];\r\n if (!node)\r\n continue;\r\n\r\n traversed.add(id);\r\n yield node;\r\n if (node.children)\r\n for (const child of traverseGltfNodes(node.children, nodes, traversed))\r\n yield child;\r\n }\r\n}\r\n\r\n/** Describes a scene graph that composes any number of [[GltfNode]]s to produce a rendering of the [[GltfDocument]] asset.\r\n * An asset may define any number of scenes; the default scene is specified by [[Gltf.scene]].\r\n * @internal\r\n */\r\nexport interface GltfScene extends GltfChildOfRootProperty {\r\n /** The Ids of the nodes comprising the scene graph. */\r\n nodes?: GltfId[];\r\n}\r\n\r\n/** Provides metadata about a [[GltfDocument]] asset.\r\n * @internal\r\n */\r\nexport interface GltfAsset extends GltfProperty {\r\n /** A copyright message suitable for display to credit the content creator. */\r\n copyright?: string;\r\n /** The name of the tool that generated the asset. */\r\n generator?: string;\r\n /** The glTF version targeted by the asset, in the form \"major.minor\" where \"major\" and \"minor\" are integers. */\r\n version: string;\r\n /** The minimum glTF version required to properly load this asset, in the same form as [[version]].\r\n * This minimum version must be no greater than [[version]].\r\n */\r\n minVersion?: string;\r\n}\r\n\r\n/** Describes an image such as one used for a [[GltfTexture]]. The image may be referenced by a [[uri]] or a [[bufferView]].\r\n * @internal\r\n */\r\nexport interface GltfImage extends GltfChildOfRootProperty {\r\n /** URI from which the image data can be obtained, either as a base-64-encoded data URI or an external resource.\r\n * Mutually exclusive with [[bufferView]].\r\n */\r\n uri?: string;\r\n /** The image's media type. This property is required if [[bufferView]] is defined. */\r\n mimeType?: \"image/jpeg\" | \"image/png\";\r\n /** The Id of the [[GltfBufferViewProps]] containing the image data. Mutually exclusive with [[uri]]. */\r\n bufferView?: GltfId;\r\n extensions?: GltfExtensions & {\r\n /** The [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/main/extensions/1.0/Khronos/KHR_binary_glTF) allows an image to\r\n * be embedded in a binary chunk appended to the glTF asset's JSON, instead of being referenced by an external URI.\r\n * This is superseded in glTF 2.0 by support for the glb file format specification.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_binary_glTF?: {\r\n /** The Id of the [[GltfBufferViewProps]] that contains the binary image data. */\r\n bufferView?: GltfId;\r\n /** Required - @see [[GltfImage.mimeType]]. */\r\n mimeType?: string;\r\n };\r\n };\r\n}\r\n\r\n/** Describes a reference to a [[GltfTexture]]. @internal */\r\nexport interface GltfTextureInfo extends GltfProperty {\r\n /** The Id of the [[GltfTexture]]. */\r\n index: GltfId;\r\n /** The set index of the texture's TEXCOORD attribute used for texture coordinate mapping.\r\n * For example, if `texCoord` is `2`, an attribute named `TEXCOORD_2` must exist containing the texture coordinates.\r\n * Default: 0.\r\n */\r\n texCoord?: number;\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_textureInfo_constant_lod?: {\r\n repetitions?: number,\r\n offset?: [number, number],\r\n minClampDistance?: number,\r\n maxClampDistance?: number\r\n }\r\n };\r\n}\r\n\r\n/** Describes a texture and its sampler.\r\n * @internal\r\n */\r\nexport interface GltfTexture extends GltfChildOfRootProperty {\r\n /** The Id of the [[GltfSampler]] used by this texture.\r\n * If undefined, a sampler with repeat wrapping and auto filtering should be used by default.\r\n */\r\n sampler?: GltfId;\r\n /** The Id of the [[GltfImage]] used by this texture.\r\n * If undefined, an extension or other mechanism should supply an alternate image source - otherwise, the behavior is undefined.\r\n */\r\n source?: GltfId;\r\n}\r\n\r\n/** Describes the filtering and wrapping behavior to be applied to a [[GltfTexture]].\r\n * @note The implementation currently does not support MirroredRepeat and does not support different wrapping for U and V;\r\n * effectively, unless `wrapS` or `wrapT` is set to ClampToEdge, the sampler will use GltfWrapMode.Repeat.\r\n * @internal\r\n */\r\nexport interface GltfSampler extends GltfChildOfRootProperty {\r\n /** Magnification filter. */\r\n magFilter?: GltfMagFilter;\r\n /** Minification filter. */\r\n minFilter?: GltfMinFilter;\r\n /** S (U) wrapping mode. Default: Repeat. */\r\n wrapS?: GltfWrapMode;\r\n /** T (V) wrapping mode. Default: Repeat. */\r\n wrapT?: GltfWrapMode;\r\n}\r\n\r\n/** GL states that can be enabled by a [[GltfTechnique]]. Only those queried by this implementation are enumerated.\r\n * @internal\r\n */\r\nexport enum GltfTechniqueState {\r\n /** Enables alpha blending. */\r\n Blend = 3042,\r\n}\r\n\r\n/** For glTF 1.0 only, describes shader programs and shader state associated with a [[Gltf1Material]], used to render meshes associated with the material.\r\n * This implementation uses it strictly to identify techniques that require alpha blending.\r\n * @internal\r\n */\r\nexport interface GltfTechnique extends GltfChildOfRootProperty {\r\n /** GL render states to be applied by the technique. */\r\n states?: {\r\n /** An array of integers corresponding to boolean GL states that should be enabled using GL's `enable` function.\r\n * For example, the value [[GltfTechniqueState.Blend]] (3042) indicates that blending should be enabled.\r\n */\r\n enable?: GltfTechniqueState[];\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface Gltf1Material extends GltfChildOfRootProperty {\r\n diffuse?: string;\r\n emission?: number[];\r\n shininess?: number;\r\n specular?: number[];\r\n technique?: GltfId;\r\n values?: {\r\n texStep?: number[];\r\n color?: number[];\r\n tex?: number | string;\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfMaterialPbrMetallicRoughness extends GltfProperty {\r\n // Default [1,1,1,1]\r\n baseColorFactor?: number[];\r\n baseColorTexture?: GltfTextureInfo;\r\n // Default 1\r\n metallicFactor?: number;\r\n // Default 1\r\n roughnessFactor?: number;\r\n metallicRoughnessTexture?: GltfTextureInfo;\r\n}\r\n\r\n/** @internal */\r\nexport type GltfAlphaMode = \"OPAQUE\" | \"MASK\" | \"BLEND\";\r\n\r\n/** @internal */\r\nexport interface Gltf2Material extends GltfChildOfRootProperty {\r\n pbrMetallicRoughness?: GltfMaterialPbrMetallicRoughness;\r\n normalTexture?: GltfTextureInfo;\r\n occlusionTexture?: unknown;\r\n emissiveTexture?: GltfTextureInfo;\r\n emissiveFactor?: number[];\r\n // Default OPAQUE\r\n alphaMode?: GltfAlphaMode;\r\n // Default 0.5. Ignored unless alphaMode=MASK\r\n alphaCutoff?: number;\r\n doubleSided?: boolean;\r\n extensions?: GltfExtensions & {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BENTLEY_materials_point_style?: { diameter: number };\r\n /** The BENTLEY_materials_planar_fill extension allows customization of planar polygon fill behavior for CAD-style visualization.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n BENTLEY_materials_planar_fill?: {\r\n /** Controls fill visibility in wireframe mode. 0 = NONE (never drawn), 1 = ALWAYS (always drawn), 2 = TOGGLE (drawn when fill display is enabled). */\r\n wireframeFill?: number;\r\n /** If true, fill uses the view's background color, creating an invisible masking polygon. */\r\n backgroundFill?: boolean;\r\n /** If true, fill is drawn behind other coplanar geometry belonging to the same logical object. */\r\n behind?: boolean;\r\n };\r\n /** The [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_unlit) extension\r\n * indicates that the material should be displayed without lighting. The extension adds no additional properties; it is effectively a boolean flag.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_materials_unlit?: object;\r\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\r\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\r\n * Here, it is only used to extract uniform values.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_techniques_webgl?: {\r\n technique?: number;\r\n // An object containing uniform values. Each property name corresponds to a uniform in the material's technique and must conform to that uniform's type and count properties.\r\n // A handful of uniforms referenced in this implementation by name are defined below.\r\n values?: {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_texStep?: number[];\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_color?: number[];\r\n // Diffuse texture.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n u_diffuse?: { index: number, texCoord: number };\r\n [k: string]: unknown;\r\n };\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport type GltfMaterial = Gltf1Material | Gltf2Material;\r\n\r\n/** @internal */\r\nexport function isGltf1Material(material: GltfMaterial): material is Gltf1Material {\r\n const mat1 = material as Gltf1Material;\r\n return undefined !== mat1.technique || undefined !== mat1.values;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfBuffer extends GltfChildOfRootProperty {\r\n uri?: string;\r\n byteLength?: number;\r\n extensions?: GltfExtensions & {\r\n // https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\r\n EXT_meshopt_compression?: { // eslint-disable-line @typescript-eslint/naming-convention\r\n fallback?: boolean;\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport type ExtMeshoptCompressionMode = \"ATTRIBUTES\" | \"TRIANGLES\" | \"INDICES\";\r\n\r\n/** @internal */\r\nexport type ExtMeshoptCompressionFilter = \"NONE\" | \"OCTAHEDRAL\" | \"QUATERNION\";\r\n\r\n/** https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\r\n * @internal\r\n*/\r\nexport interface GltfBufferViewMeshoptCompressionExtension {\r\n buffer: number;\r\n byteOffset?: number;\r\n byteLength: number;\r\n byteStride: number;\r\n count: number;\r\n mode: ExtMeshoptCompressionMode;\r\n filter?: ExtMeshoptCompressionFilter;\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfBufferViewProps extends GltfChildOfRootProperty {\r\n buffer: GltfId;\r\n byteLength?: number;\r\n byteOffset?: number;\r\n byteStride?: number;\r\n target?: GltfBufferTarget;\r\n extensions?: GltfExtensions & {\r\n EXT_meshopt_compression?: GltfBufferViewMeshoptCompressionExtension; // eslint-disable-line @typescript-eslint/naming-convention\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport interface GltfAccessor extends GltfChildOfRootProperty {\r\n bufferView?: GltfId;\r\n byteOffset?: number;\r\n componentType?: GltfDataType.SignedByte | GltfDataType.UnsignedByte | GltfDataType.SignedShort | GltfDataType.UnsignedShort | GltfDataType.UInt32 | GltfDataType.Float;\r\n normalized?: boolean;\r\n count: number;\r\n type: \"SCALAR\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\";\r\n max?: number[];\r\n min?: number[];\r\n sparse?: unknown; // ###TODO sparse accessors\r\n extensions?: GltfExtensions & {\r\n /** Quantized attributes for glTF 1.0. Superceded by KHR_mesh_quantization. */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n WEB3D_quantized_attributes?: {\r\n decodedMin: number[];\r\n decodedMax: number[];\r\n /** Currently ignored. */\r\n decodeMatrix: number[];\r\n };\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport namespace GltfStructuralMetadata {\r\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\r\n export type ClassPropertyType = \"SCALAR\" | \"STRING\" | \"BOOLEAN\" | \"ENUM\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\" | string;\r\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\r\n export type ClassPropertyComponentType = \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | \"FLOAT32\" | \"FLOAT64\" | string;\r\n\r\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\r\n export interface ClassProperty extends GltfProperty {\r\n type: ClassPropertyType;\r\n name?: string;\r\n description?: string;\r\n componentType?: ClassPropertyComponentType;\r\n enumType?: string;\r\n array?: boolean;\r\n count?: number;\r\n normalized?: boolean;\r\n offset?: number;\r\n scale?: number;\r\n min?: number;\r\n max?: number;\r\n required?: boolean;\r\n noData?: unknown;\r\n default?: unknown;\r\n semantic?: string;\r\n }\r\n\r\n export interface EnumValue extends GltfProperty {\r\n name: string;\r\n value: number; // an integer\r\n description?: string;\r\n }\r\n\r\n export interface Enum extends GltfProperty {\r\n values: EnumValue[];\r\n // Default: UINT16\r\n valueType?: \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n name?: string;\r\n description?: string;\r\n }\r\n\r\n export interface Class extends GltfProperty {\r\n name?: string;\r\n description?: string;\r\n properties?: {\r\n [propertyId: string]: ClassProperty | undefined;\r\n };\r\n }\r\n\r\n export interface Schema extends GltfProperty {\r\n id: string;\r\n name?: string;\r\n description?: string;\r\n version?: string;\r\n classes?: {\r\n [classId: string]: Class | undefined;\r\n };\r\n enums?: Enum[];\r\n }\r\n\r\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\r\n export interface PropertyTableProperty extends GltfProperty {\r\n values: GltfId;\r\n arrayOffsets?: GltfId;\r\n stringOffsets?: GltfId;\r\n arrayOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n stringOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\r\n offset?: number;\r\n scale?: number;\r\n min?: number;\r\n max?: number;\r\n }\r\n\r\n export interface PropertyTable {\r\n class: string;\r\n count: number;\r\n properties?: {\r\n [propertyId: string]: PropertyTableProperty | undefined;\r\n };\r\n }\r\n\r\n export interface Extension extends GltfProperty {\r\n // Exactly one of schema or schemaUri must be present.\r\n schemaUri?: string;\r\n schema?: Schema;\r\n propertyTables?: PropertyTable[];\r\n propertyTextures?: unknown;\r\n propertyAttributes?: unknown;\r\n }\r\n}\r\n\r\n/** Describes the top-level structure of a glTF asset.\r\n * This interface, along with all of the related Gltf* types defined in this file, is primarily based upon the [official glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html).\r\n * However, it can also represent a [glTF 1.0](https://github.com/KhronosGroup/glTF/tree/main/specification/1.0#reference-node) asset.\r\n * Some types are combined. For example, the top-level dictionaries in glTF 1.0 are objects, while in glTF 2.0 they are arrays; the GltfDictionary interface supports accessing\r\n * items using either strings or numeric indexes represented by [[GltfId]].\r\n * For types that differ significantly between the two specs, Gltf1* and Gltf2* versions are defined (e.g., GltfMaterial is a union of Gltf1Material and Gltf2Material).\r\n * These interfaces also accommodate some deviations from both specs that are known to exist in the wild.\r\n * Most aspects of the specifications that are not implemented here are omitted (e.g., skinning, animations).\r\n * @internal\r\n */\r\nexport interface GltfDocument extends GltfProperty {\r\n /** Metadata about the glTF asset.\r\n * @note This property is required in glTF 2.0, but optional in 1.0.\r\n */\r\n asset?: GltfAsset;\r\n /** The Id of the default [[GltfScene]] in [[scenes]]. */\r\n scene?: GltfId;\r\n extensions?: GltfExtensions & {\r\n /** The [CESIUM_RTC extension](https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/CESIUM_RTC/README.md) defines a centroid\r\n * relative to which all coordinates in the asset are defined, to reduce floating-point precision errors for large coordinates.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CESIUM_RTC?: {\r\n center?: number[];\r\n };\r\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\r\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\r\n * Here, it is only used to extract uniform values.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n KHR_techniques_webgl?: {\r\n techniques?: Array<{\r\n uniforms?: {\r\n [key: string]: { type: GltfDataType, value?: any } | undefined;\r\n };\r\n }>;\r\n };\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n EXT_structural_metadata?: GltfStructuralMetadata.Extension;\r\n };\r\n /** Names of glTF extensions used in the asset. */\r\n extensionsUsed?: string[];\r\n /** Names of glTF extensions required to properly load the asset. */\r\n extensionsRequired?: string[];\r\n accessors?: GltfDictionary<GltfAccessor>;\r\n /** Not currently supported. */\r\n animations?: GltfDictionary<any>;\r\n buffers?: GltfDictionary<GltfBuffer>;\r\n bufferViews?: GltfDictionary<GltfBufferViewProps>;\r\n /** Not currently used. */\r\n cameras?: GltfDictionary<any>;\r\n images?: GltfDictionary<GltfImage>;\r\n materials?: GltfDictionary<GltfMaterial>;\r\n meshes?: GltfDictionary<GltfMesh>;\r\n nodes?: GltfDictionary<GltfNode>;\r\n samplers?: GltfDictionary<GltfSampler>;\r\n scenes?: GltfDictionary<GltfScene>;\r\n /** Not currently supported. */\r\n skins?: GltfDictionary<any>;\r\n textures?: GltfDictionary<GltfTexture>;\r\n /** For glTF 1.0 only, techniques associated with [[Gltf1Material]]s. */\r\n techniques?: GltfDictionary<GltfTechnique>;\r\n}\r\n"]}
@@ -326,6 +326,11 @@ export interface ReadGltfGraphicsArgs {
326
326
  hasChildren?: boolean;
327
327
  /** @internal */
328
328
  idMap?: BatchedTileIdMap;
329
+ /** If true, the glTF will be rendered using the viewport's active render mode.
330
+ * If false (the default), the glTF will always be rendered in smooth shade mode regardless of the viewport's render mode.
331
+ * @alpha
332
+ */
333
+ useViewportRenderMode?: boolean;
329
334
  }
330
335
  /** The output of [[readGltf]].
331
336
  * @public
@@ -364,7 +369,7 @@ export declare function readGltfGraphics(args: ReadGltfGraphicsArgs): Promise<Re
364
369
  export declare function readGltfTemplate(args: ReadGltfGraphicsArgs): Promise<GltfTemplate | undefined>;
365
370
  /** Produce a [[RenderGraphic]] from a [glTF](https://www.khronos.org/gltf/) asset suitable for use in [view decorations]($docs/learning/frontend/ViewDecorations).
366
371
  * @returns a graphic produced from the glTF asset's default scene, or `undefined` if a graphic could not be produced from the asset.
367
- * The returned graphic also includes the bounding boxes of the glTF model in world and local coordiantes.
372
+ * The returned graphic also includes the bounding boxes of the glTF model in world and local coordinates.
368
373
  * @note Support for the full [glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html) is currently a work in progress.
369
374
  * If a particular glTF asset fails to load and/or display properly, please
370
375
  * [submit an issue](https://github.com/iTwin/itwinjs-core/issues).
@@ -381,6 +386,7 @@ export declare class GltfGraphicsReader extends GltfReader {
381
386
  private readonly _contentRange?;
382
387
  private readonly _transform?;
383
388
  private readonly _isLeaf;
389
+ private readonly _useViewportRenderMode;
384
390
  readonly binaryData?: Uint8Array;
385
391
  meshes?: GltfMeshData;
386
392
  constructor(props: GltfReaderProps, args: ReadGltfGraphicsArgs & {
@@ -1 +1 @@
1
- {"version":3,"file":"GltfReader.d.ts","sourceRoot":"","sources":["../../../src/tile/GltfReader.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH,OAAO,EACsC,OAAO,EAAW,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EACnG,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAAE,SAAS,EAAqC,mBAAmB,EAAE,OAAO,EAAkC,YAAY,EACvG,gBAAgB,EAA8D,SAAS,EAAE,SAAS,EAC/D,aAAa,EAAE,cAAc,EAAmC,cAAc,EAAE,iBAAiB,EACxK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAuB,mBAAmB,EAAC,WAAW,EAAE,MAAM,YAAY,CAAC;AAGpG,OAAO,EAAE,aAAa,EAAE,MAAM,y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"}
@@ -964,7 +964,30 @@ export class GltfReader {
964
964
  width = pointStyle.diameter;
965
965
  }
966
966
  }
967
- return new DisplayParams(DisplayParams.Type.Mesh, color, color, width, LinePixels.Solid, FillFlags.None, renderMaterial, undefined, hasBakedLighting, textureMapping);
967
+ // Process BENTLEY_materials_planar_fill extension
968
+ let fillFlags = FillFlags.None;
969
+ if (!isGltf1Material(material)) {
970
+ const planarFill = material.extensions?.BENTLEY_materials_planar_fill;
971
+ if (planarFill) {
972
+ // Map wireframeFill: 0=NONE (no fill flags), 1=ALWAYS (Always flag), 2=TOGGLE (ByView flag)
973
+ const wireframeFill = planarFill.wireframeFill ?? 0;
974
+ if (wireframeFill === 1) {
975
+ fillFlags |= FillFlags.Always;
976
+ }
977
+ else if (wireframeFill === 2) {
978
+ fillFlags |= FillFlags.ByView;
979
+ }
980
+ // Map backgroundFill to Background flag
981
+ if (planarFill.backgroundFill === true) {
982
+ fillFlags |= FillFlags.Background;
983
+ }
984
+ // Map behind to Behind flag
985
+ if (planarFill.behind === true) {
986
+ fillFlags |= FillFlags.Behind;
987
+ }
988
+ }
989
+ }
990
+ return new DisplayParams(DisplayParams.Type.Mesh, color, color, width, LinePixels.Solid, fillFlags, renderMaterial, undefined, hasBakedLighting, textureMapping);
968
991
  }
969
992
  readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
970
993
  const meshes = [];
@@ -1980,7 +2003,7 @@ export async function readGltfTemplate(args) {
1980
2003
  }
1981
2004
  /** Produce a [[RenderGraphic]] from a [glTF](https://www.khronos.org/gltf/) asset suitable for use in [view decorations]($docs/learning/frontend/ViewDecorations).
1982
2005
  * @returns a graphic produced from the glTF asset's default scene, or `undefined` if a graphic could not be produced from the asset.
1983
- * The returned graphic also includes the bounding boxes of the glTF model in world and local coordiantes.
2006
+ * The returned graphic also includes the bounding boxes of the glTF model in world and local coordinates.
1984
2007
  * @note Support for the full [glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html) is currently a work in progress.
1985
2008
  * If a particular glTF asset fails to load and/or display properly, please
1986
2009
  * [submit an issue](https://github.com/iTwin/itwinjs-core/issues).
@@ -2008,6 +2031,7 @@ export class GltfGraphicsReader extends GltfReader {
2008
2031
  _contentRange;
2009
2032
  _transform;
2010
2033
  _isLeaf;
2034
+ _useViewportRenderMode;
2011
2035
  binaryData; // strictly for tests
2012
2036
  meshes; // strictly for tests
2013
2037
  constructor(props, args) {
@@ -2021,6 +2045,7 @@ export class GltfGraphicsReader extends GltfReader {
2021
2045
  this._contentRange = args.contentRange;
2022
2046
  this._transform = args.transform;
2023
2047
  this._isLeaf = true !== args.hasChildren;
2048
+ this._useViewportRenderMode = args.useViewportRenderMode ?? false;
2024
2049
  this.binaryData = props.binaryData;
2025
2050
  const pickableId = args.pickableOptions?.id;
2026
2051
  if (pickableId) {
@@ -2031,7 +2056,8 @@ export class GltfGraphicsReader extends GltfReader {
2031
2056
  get viewFlagOverrides() {
2032
2057
  return {
2033
2058
  whiteOnWhiteReversal: false,
2034
- renderMode: RenderMode.SmoothShade,
2059
+ // Don't override renderMode if using viewport's render mode - let the viewport control it.
2060
+ renderMode: this._useViewportRenderMode ? undefined : RenderMode.SmoothShade,
2035
2061
  };
2036
2062
  }
2037
2063
  get meshElementIdToFeatureIndex() {