@loaders.gl/gltf 4.0.0-alpha.6 → 4.0.0-alpha.7
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 +1415 -1339
- package/dist/es5/glb-loader.js +2 -2
- package/dist/es5/glb-loader.js.map +1 -1
- package/dist/es5/glb-writer.js +3 -4
- package/dist/es5/glb-writer.js.map +1 -1
- package/dist/es5/gltf-loader.js +3 -3
- package/dist/es5/gltf-loader.js.map +1 -1
- package/dist/es5/index.js +9 -3
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
- package/dist/es5/lib/api/gltf-scenegraph.js +47 -30
- package/dist/es5/lib/api/gltf-scenegraph.js.map +1 -1
- package/dist/es5/lib/api/post-process-gltf.js +164 -116
- package/dist/es5/lib/api/post-process-gltf.js.map +1 -1
- package/dist/es5/lib/encoders/encode-glb.js +1 -1
- package/dist/es5/lib/encoders/encode-glb.js.map +1 -1
- package/dist/es5/lib/encoders/encode-gltf.js +2 -3
- package/dist/es5/lib/encoders/encode-gltf.js.map +1 -1
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js +3 -5
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js.map +1 -1
- package/dist/es5/lib/extensions/EXT_texture_webp.js +2 -3
- package/dist/es5/lib/extensions/EXT_texture_webp.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_binary_gltf.js +2 -3
- package/dist/es5/lib/extensions/KHR_binary_gltf.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js +6 -5
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_texture_basisu.js +3 -4
- package/dist/es5/lib/extensions/KHR_texture_basisu.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_texture_transform.js +9 -8
- package/dist/es5/lib/extensions/KHR_texture_transform.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +2 -2
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js +3 -3
- package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js +3 -3
- package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js +2 -2
- package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -1
- package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js.map +1 -1
- package/dist/es5/lib/gltf-utils/gltf-utils.js +24 -0
- package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -1
- package/dist/es5/lib/parsers/parse-glb.js +10 -10
- package/dist/es5/lib/parsers/parse-glb.js.map +1 -1
- package/dist/es5/lib/parsers/parse-gltf.js +6 -10
- 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/types/gltf-postprocessed-schema.js.map +1 -1
- package/dist/es5/lib/types/gltf-types.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/esm/glb-loader.js +1 -1
- package/dist/esm/glb-loader.js.map +1 -1
- package/dist/esm/glb-writer.js +1 -1
- package/dist/esm/glb-writer.js.map +1 -1
- package/dist/esm/gltf-loader.js +3 -3
- package/dist/esm/gltf-loader.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
- package/dist/esm/lib/api/gltf-scenegraph.js +40 -29
- package/dist/esm/lib/api/gltf-scenegraph.js.map +1 -1
- package/dist/esm/lib/api/post-process-gltf.js +167 -112
- package/dist/esm/lib/api/post-process-gltf.js.map +1 -1
- package/dist/esm/lib/encoders/encode-glb.js +1 -1
- package/dist/esm/lib/encoders/encode-glb.js.map +1 -1
- package/dist/esm/lib/encoders/encode-gltf.js +1 -1
- package/dist/esm/lib/encoders/encode-gltf.js.map +1 -1
- package/dist/esm/lib/extensions/EXT_meshopt_compression.js +2 -3
- package/dist/esm/lib/extensions/EXT_meshopt_compression.js.map +1 -1
- package/dist/esm/lib/extensions/EXT_texture_webp.js +1 -1
- package/dist/esm/lib/extensions/EXT_texture_webp.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_binary_gltf.js +1 -1
- package/dist/esm/lib/extensions/KHR_binary_gltf.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js +5 -4
- package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_texture_basisu.js +2 -2
- package/dist/esm/lib/extensions/KHR_texture_basisu.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_texture_transform.js +7 -6
- package/dist/esm/lib/extensions/KHR_texture_transform.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +1 -1
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js +1 -1
- package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -1
- package/dist/esm/lib/gltf-utils/gltf-attribute-utils.js.map +1 -1
- package/dist/esm/lib/gltf-utils/gltf-utils.js +20 -0
- package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -1
- package/dist/esm/lib/parsers/parse-glb.js +10 -10
- package/dist/esm/lib/parsers/parse-glb.js.map +1 -1
- package/dist/esm/lib/parsers/parse-gltf.js +5 -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/types/gltf-postprocessed-schema.js.map +1 -1
- package/dist/esm/lib/types/gltf-types.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/glb-loader.d.ts +2 -2
- package/dist/glb-loader.js +2 -5
- package/dist/glb-writer.d.ts.map +1 -1
- package/dist/glb-writer.js +4 -6
- package/dist/gltf-loader.d.ts +5 -5
- package/dist/gltf-loader.d.ts.map +1 -1
- package/dist/gltf-loader.js +3 -3
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/lib/api/gltf-extensions.d.ts +1 -1
- package/dist/lib/api/gltf-extensions.d.ts.map +1 -1
- package/dist/lib/api/gltf-scenegraph.d.ts +6 -4
- package/dist/lib/api/gltf-scenegraph.d.ts.map +1 -1
- package/dist/lib/api/gltf-scenegraph.js +43 -30
- package/dist/lib/api/post-process-gltf.d.ts +4 -1
- package/dist/lib/api/post-process-gltf.d.ts.map +1 -1
- package/dist/lib/api/post-process-gltf.js +186 -123
- package/dist/lib/encoders/encode-glb.d.ts +13 -1
- package/dist/lib/encoders/encode-glb.d.ts.map +1 -1
- package/dist/lib/encoders/encode-glb.js +15 -4
- package/dist/lib/encoders/encode-gltf.js +2 -5
- package/dist/lib/extensions/EXT_meshopt_compression.d.ts +1 -1
- package/dist/lib/extensions/EXT_meshopt_compression.d.ts.map +1 -1
- package/dist/lib/extensions/EXT_meshopt_compression.js +3 -7
- package/dist/lib/extensions/EXT_texture_webp.d.ts +1 -1
- package/dist/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
- package/dist/lib/extensions/EXT_texture_webp.js +2 -5
- package/dist/lib/extensions/KHR_binary_gltf.d.ts +1 -1
- package/dist/lib/extensions/KHR_binary_gltf.d.ts.map +1 -1
- package/dist/lib/extensions/KHR_binary_gltf.js +2 -5
- package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts +1 -1
- package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts.map +1 -1
- package/dist/lib/extensions/KHR_draco_mesh_compression.js +5 -8
- package/dist/lib/extensions/KHR_texture_basisu.d.ts +1 -1
- package/dist/lib/extensions/KHR_texture_basisu.d.ts.map +1 -1
- package/dist/lib/extensions/KHR_texture_basisu.js +3 -6
- package/dist/lib/extensions/KHR_texture_transform.d.ts.map +1 -1
- package/dist/lib/extensions/KHR_texture_transform.js +7 -10
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +1 -1
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +2 -5
- package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts +1 -1
- package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts.map +1 -1
- package/dist/lib/extensions/deprecated/KHR_lights_punctual.js +3 -6
- package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts +1 -1
- package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts.map +1 -1
- package/dist/lib/extensions/deprecated/KHR_materials_unlit.js +3 -6
- package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts +1 -1
- package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts.map +1 -1
- package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js +2 -5
- package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts +1 -1
- package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts.map +1 -1
- package/dist/lib/gltf-utils/gltf-utils.d.ts +7 -0
- package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
- package/dist/lib/gltf-utils/gltf-utils.js +28 -1
- package/dist/lib/parsers/parse-glb.d.ts +15 -3
- package/dist/lib/parsers/parse-glb.d.ts.map +1 -1
- package/dist/lib/parsers/parse-glb.js +43 -18
- package/dist/lib/parsers/parse-gltf.d.ts +8 -4
- package/dist/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-gltf.js +13 -34
- package/dist/lib/types/gltf-json-schema.d.ts +151 -138
- package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-postprocessed-schema.d.ts +174 -209
- package/dist/lib/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-postprocessed-schema.js +1 -1
- package/dist/lib/types/gltf-types.d.ts +18 -6
- package/dist/lib/types/gltf-types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/glb-loader.ts +3 -3
- package/src/glb-writer.ts +3 -1
- package/src/gltf-loader.ts +12 -8
- package/src/index.ts +32 -13
- package/src/lib/api/gltf-extensions.ts +1 -1
- package/src/lib/api/gltf-scenegraph.ts +55 -37
- package/src/lib/api/post-process-gltf.ts +275 -150
- package/src/lib/encoders/encode-glb.ts +15 -5
- package/src/lib/encoders/encode-gltf.ts +1 -1
- package/src/lib/extensions/EXT_meshopt_compression.ts +4 -6
- package/src/lib/extensions/EXT_texture_webp.ts +2 -2
- package/src/lib/extensions/KHR_binary_gltf.ts +2 -2
- package/src/lib/extensions/KHR_draco_mesh_compression.ts +7 -7
- package/src/lib/extensions/KHR_texture_basisu.ts +3 -3
- package/src/lib/extensions/KHR_texture_transform.ts +22 -19
- package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +2 -2
- package/src/lib/extensions/deprecated/KHR_lights_punctual.ts +2 -2
- package/src/lib/extensions/deprecated/KHR_materials_unlit.ts +2 -2
- package/src/lib/extensions/deprecated/KHR_techniques_webgl.ts +2 -2
- package/src/lib/gltf-utils/gltf-attribute-utils.ts +1 -1
- package/src/lib/gltf-utils/gltf-utils.ts +31 -0
- package/src/lib/parsers/parse-glb.ts +50 -24
- package/src/lib/parsers/parse-gltf.ts +22 -16
- package/src/lib/types/gltf-json-schema.ts +165 -138
- package/src/lib/types/gltf-postprocessed-schema.ts +289 -212
- package/src/lib/types/gltf-types.ts +35 -59
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-postprocessed-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-postprocessed-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\n// tslint:disable:quotemark\n// tslint:disable:max-line-length\n\nexport type GlTfId = number;\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport interface AccessorSparseIndices {\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?: any;\n extras?: any;\n [k: string]: any;\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 interface AccessorSparseValues {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Sparse storage of attributes that deviate from their initialization value.\n */\nexport interface AccessorSparse {\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: AccessorSparseIndices;\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: AccessorSparseValues;\n extensions?: any;\n extras?: any;\n [k: string]: any;\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 interface Accessor {\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?: AccessorSparse;\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * The index of the node and TRS property that an animation channel targets.\n */\nexport interface AnimationChannelTarget {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Targets an animation's sampler at a node's property.\n */\nexport interface AnimationChannel {\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: AnimationChannelTarget;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\nexport interface AnimationSampler {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * A keyframe animation.\n */\nexport interface Animation {\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: AnimationChannel[];\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: AnimationSampler[];\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Metadata about the glTF asset.\n */\nexport interface Asset {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport interface Buffer {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * A view into a buffer generally representing a subset of the buffer.\n */\nexport interface BufferView {\n id: string;\n /**\n * The index of the buffer.\n */\n buffer: ArrayBuffer;\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\nexport interface CameraOrthographic {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\nexport interface CameraPerspective {\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?: any;\n extras?: any;\n [k: string]: any;\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 interface Camera {\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: CameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: CameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\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 interface Image {\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?: BufferView;\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Reference to a texture.\n */\nexport interface TextureInfo {\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?: any;\n extras?: any;\n [k: string]: any;\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 interface MaterialPbrMetallicRoughness {\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: TextureInfo;\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?: TextureInfo;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\nexport interface MaterialNormalTextureInfo {\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?: any;\n extras?: any;\n [k: string]: any;\n}\nexport interface MaterialOcclusionTextureInfo {\n index?: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * The material appearance of a primitive.\n */\nexport interface Material {\n name?: any;\n extensions?: 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?: MaterialPbrMetallicRoughness;\n /**\n * The normal map texture.\n */\n normalTexture?: MaterialNormalTextureInfo;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: MaterialOcclusionTextureInfo;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: TextureInfo;\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 * Geometry to be rendered with the given material.\n */\nexport interface MeshPrimitive {\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]: Accessor;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: Accessor;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: Material;\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?: any;\n extras?: any;\n [k: string]: any;\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 */\nexport interface Mesh {\n /**\n * An array of primitives, each defining geometry to be rendered with a material.\n */\n primitives: MeshPrimitive[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\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 interface Node {\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?: Node[];\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?: Mesh;\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Texture sampler properties for filtering and wrapping modes.\n */\nexport interface Sampler {\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?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * The root nodes of a scene.\n */\nexport interface Scene {\n /**\n * The indices of each root node.\n */\n nodes?: Node[];\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * Joints and matrices defining a skin.\n */\nexport interface Skin {\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 /**\n * Indices of skeleton nodes, used as joints in this skin.\n */\n joints: GlTfId[];\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * A texture and its sampler.\n */\nexport interface Texture {\n /**\n * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.\n */\n sampler?: GlTfId;\n /**\n * The index of the image used by this texture.\n */\n source?: Image;\n name?: any;\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n/**\n * The root object for a glTF asset.\n */\nexport interface 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?: Accessor[];\n /**\n * An array of keyframe animations.\n */\n animations?: Animation[];\n /**\n * Metadata about the glTF asset.\n */\n asset: Asset;\n /**\n * An array of buffers.\n */\n buffers?: Buffer[];\n /**\n * An array of bufferViews.\n */\n bufferViews?: BufferView[];\n /**\n * An array of cameras.\n */\n cameras?: Camera[];\n /**\n * An array of images.\n */\n images?: Image[];\n /**\n * An array of materials.\n */\n materials?: Material[];\n /**\n * An array of meshes.\n */\n meshes?: Mesh[];\n /**\n * An array of nodes.\n */\n nodes?: Node[];\n /**\n * An array of samplers.\n */\n samplers?: Sampler[];\n /**\n * The index of the default scene.\n */\n scene?: Scene;\n /**\n * An array of scenes.\n */\n scenes?: Scene[];\n /**\n * An array of skins.\n */\n skins?: Skin[];\n /**\n * An array of textures.\n */\n textures?: Texture[];\n extensions?: any;\n extras?: any;\n [k: string]: any;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"gltf-postprocessed-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-postprocessed-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-type` = on 2018-02-24\n\nimport type {TypedArray} from '@loaders.gl/loader-utils';\n\nexport type GlTfId = number;\n\n// GLTF attributes (possibly overridden)\n\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport type AccessorSparseIndices = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: 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 AccessorSparseValues = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: 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 AccessorSparse = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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: AccessorSparseIndices;\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: AccessorSparseValues;\n extensions?: 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 GLTFAccessorPostprocessed = {\n id: string;\n components: number;\n bytesPerComponent: number;\n bytesPerElement: number;\n value: TypedArray;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the bufferView.\n */\n bufferView?: GLTFBufferViewPostprocessed;\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?: AccessorSparse;\n name?: any;\n extensions?: 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 AnimationChannelTarget = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: 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 AnimationChannel = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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: AnimationChannelTarget;\n extensions?: 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 AnimationSampler = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A keyframe animation.\n */\nexport type GLTFAnimationPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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 channels: AnimationChannel[];\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 samplers: AnimationSampler[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Metadata about the glTF asset.\n */\nexport type Asset = {\n // GLTF attributes (possibly overridden)\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?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport type GLTFBufferPostprocessed = {\n id?: string;\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n // GLTF attributes (possibly overridden)\n /** The length of the buffer in bytes. */\n byteLength: number;\n\n /** The uri of the buffer. */\n uri?: string;\n name?: any;\n extensions?: 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 GLTFBufferViewPostprocessed = {\n id: string;\n data: Uint8Array;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the buffer.\n */\n buffer: GLTFBufferPostprocessed;\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?: 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 CameraOrthographic = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: 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 CameraPerspective = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: 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 GLTFCameraPostprocessed = {\n // GLTF attributes (possibly overridden)\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: CameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: CameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * GLTFImagePostprocessed data used to create a texture.\n * GLTFImagePostprocessed can be referenced by URI or `bufferView` index.\n * `mimeType` is required in the latter case.\n * @todo GLTF image postprocessing\n */\nexport type GLTFImagePostprocessed = {\n id: string;\n // TODO - extend\n image: {\n data: Uint8Array;\n compressed?: boolean;\n height?: number;\n width?: number;\n components?: number;\n mimeType?: string;\n };\n\n compressed?: boolean;\n\n // GLTF attributes (possibly overridden)\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?: GLTFBufferViewPostprocessed;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Reference to a texture.\n */\nexport type GLTFTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\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?: 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 MaterialPbrMetallicRoughnessPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: GLTFTextureInfoPostprocessed;\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?: GLTFTextureInfoPostprocessed;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\nexport type MaterialNormalTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\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?: any;\n extras?: any;\n // [k: string]: any;\n};\n\nexport type MaterialOcclusionTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\n index?: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The material appearance of a primitive.\n */\nexport type GLTFMaterialPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n name?: any;\n extensions?: 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?: MaterialPbrMetallicRoughnessPostprocessed;\n /**\n * The normal map texture.\n */\n normalTexture?: MaterialNormalTextureInfoPostprocessed;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: MaterialOcclusionTextureInfoPostprocessed;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: GLTFTextureInfoPostprocessed;\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 GLTFMeshPrimitivePostprocessed = {\n // GLTF attributes (possibly overridden)\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]: GLTFAccessorPostprocessed;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: GLTFAccessorPostprocessed;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: GLTFMaterialPostprocessed;\n /**\n * The type of primitives to render.\n */\n mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;\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 targets?: {\n [k: string]: GlTfId;\n }[];\n extensions?: 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 */\nexport type GLTFMeshPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** An array of primitives, each defining geometry to be rendered with a material. */\n primitives: GLTFMeshPrimitivePostprocessed[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: 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 GLTFNodePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the camera referenced by this node.\n */\n camera?: GLTFCameraPostprocessed;\n /**\n * The indices of this node's children.\n */\n children?: GLTFNodePostprocessed[];\n /**\n * The index of the skin referenced by this node.\n */\n skin?: GLTFSkinPostprocessed;\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?: GLTFMeshPostprocessed;\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?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * GLTFTexturePostprocessed sampler properties for filtering and wrapping modes.\n */\nexport type GLTFSamplerPostprocessed = {\n id: string;\n /** WebGL parameters */\n parameters: Record<string, number>;\n\n // GLTF attributes (possibly overridden)\n /** Magnification filter. */\n magFilter?: 9728 | 9729 | number;\n /** Minification filter. */\n minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;\n /** s wrapping mode. */\n wrapS?: 33071 | 33648 | 10497 | number;\n /** t wrapping mode. */\n wrapT?: 33071 | 33648 | 10497 | number;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root nodes of a scene.\n */\nexport type GLTFScenePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** The indices of each root node. */\n nodes?: GLTFNodePostprocessed[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Joints and matrices defining a skin.\n */\nexport type GLTFSkinPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\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?: GLTFAccessorPostprocessed;\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 /**\n * Indices of skeleton nodes, used as joints in this skin.\n */\n joints: GlTfId[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A texture and its sampler.\n */\nexport type GLTFTexturePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.\n */\n sampler?: GLTFSamplerPostprocessed;\n /**\n * The index of the image used by this texture.\n */\n source?: GLTFImagePostprocessed;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root object for a glTF asset.\n */\nexport type GLTFPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** Names of glTF extensions used somewhere in this asset. */\n extensionsUsed: string[];\n /** Names of glTF extensions required to properly load this asset. */\n extensionsRequired: string[];\n /** An array of accessors. */\n accessors: GLTFAccessorPostprocessed[];\n /** An array of keyframe animations. */\n animations: GLTFAnimationPostprocessed[];\n /** Metadata about the glTF asset. */\n asset: Asset;\n /** An array of buffers. */\n buffers: GLTFBufferPostprocessed[];\n /** An array of bufferViews. */\n bufferViews: GLTFBufferViewPostprocessed[];\n /** An array of cameras. */\n cameras: GLTFCameraPostprocessed[];\n /** An array of images. */\n images: GLTFImagePostprocessed[];\n /** An array of materials. */\n materials: GLTFMaterialPostprocessed[];\n /** An array of meshes. */\n meshes: GLTFMeshPostprocessed[];\n /** An array of nodes. */\n nodes: GLTFNodePostprocessed[];\n /** An array of samplers. */\n samplers: GLTFSamplerPostprocessed[];\n /** The index of the default scene. */\n scene?: GLTFScenePostprocessed;\n /** An array of scenes. */\n scenes: GLTFScenePostprocessed[];\n /** An array of skins. */\n skins: GLTFSkinPostprocessed[];\n /** An array of textures. */\n textures: GLTFTexturePostprocessed[];\n extensions?: Record<string, Record<string, any>>;\n extras?: any;\n // [k: string]: any;\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-types.js","names":[],"sources":["../../../../src/lib/types/gltf-types.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\
|
|
1
|
+
{"version":3,"file":"gltf-types.js","names":[],"sources":["../../../../src/lib/types/gltf-types.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {GLTF} from './gltf-json-schema';\n\n/** GLTFLoader removes processed extensions from `extensionsUsed` and `extensionsUsed`\n * `processedExtensions` is used to track those extensions\n */\nexport type GLTFWithBuffers = {\n json: GLTF;\n binary?: ArrayBuffer;\n buffers: GLTFExternalBuffer[];\n images?: GLTFExternalImage[];\n};\n\ntype GLTFExternalBuffer = {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n};\n\ntype GLTFExternalImage =\n | ImageType\n | {\n compressed: true;\n mipmaps: false;\n width: number;\n height: number;\n data: Uint8Array;\n };\n\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n // GLTFCamera,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n GLTF_EXT_feature_metadata,\n GLTF_EXT_mesh_features\n} from './gltf-json-schema';\n\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFImagePostprocessed,\n GLTFNodePostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFTexturePostprocessed\n} from './gltf-postprocessed-schema';\n"],"mappings":""}
|
|
@@ -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.7" !== 'undefined' ? "4.0.0-alpha.7" : 'latest';
|
|
8
8
|
exports.VERSION = VERSION;
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
package/dist/esm/glb-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-loader.js","names":["VERSION","parseGLBSync","GLBLoader","name","id","module","version","extensions","mimeTypes","binary","parse","parseSync","options","glb","strict","arrayBuffer","byteOffset","_TypecheckGLBLoader"],"sources":["../../src/glb-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {GLB} from './lib/types/glb-types';\nimport type {
|
|
1
|
+
{"version":3,"file":"glb-loader.js","names":["VERSION","parseGLBSync","GLBLoader","name","id","module","version","extensions","mimeTypes","binary","parse","parseSync","options","glb","strict","arrayBuffer","byteOffset","_TypecheckGLBLoader"],"sources":["../../src/glb-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {GLB} from './lib/types/glb-types';\nimport type {ParseGLBOptions} from './lib/parsers/parse-glb';\nimport {VERSION} from './lib/utils/version';\nimport {parseGLBSync} from './lib/parsers/parse-glb';\n\nexport type GLBLoaderOptions = LoaderOptions & {\n glb?: ParseGLBOptions;\n byteOffset?: number;\n};\n\n/**\n * GLB Loader -\n * GLB is the binary container format for GLTF\n */\nexport const GLBLoader: LoaderWithParser<GLB, never, GLBLoaderOptions> = {\n name: 'GLB',\n id: 'glb',\n module: 'gltf',\n version: VERSION,\n extensions: ['glb'],\n mimeTypes: ['model/gltf-binary'],\n binary: true,\n parse,\n parseSync,\n options: {\n glb: {\n strict: false // Enables deprecated XVIZ support (illegal CHUNK formats)\n }\n }\n};\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: GLBLoaderOptions): Promise<GLB> {\n return parseSync(arrayBuffer, options);\n}\n\nfunction parseSync(arrayBuffer: ArrayBuffer, options?: GLBLoaderOptions): GLB {\n const {byteOffset = 0} = options || {};\n const glb: GLB = {} as GLB;\n parseGLBSync(glb, arrayBuffer, byteOffset, options?.glb);\n return glb;\n}\n\n// TYPE TESTS - TODO find a better way than exporting junk\nexport const _TypecheckGLBLoader: LoaderWithParser = GLBLoader;\n"],"mappings":"AAGA,SAAQA,OAAO,QAAO,qBAAqB;AAC3C,SAAQC,YAAY,QAAO,yBAAyB;AAWpD,OAAO,MAAMC,SAAyD,GAAG;EACvEC,IAAI,EAAE,KAAK;EACXC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,mBAAmB,CAAC;EAChCC,MAAM,EAAE,IAAI;EACZC,KAAK;EACLC,SAAS;EACTC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,MAAM,EAAE;IACV;EACF;AACF,CAAC;AAED,eAAeJ,KAAKA,CAACK,WAAwB,EAAEH,OAA0B,EAAgB;EACvF,OAAOD,SAAS,CAACI,WAAW,EAAEH,OAAO,CAAC;AACxC;AAEA,SAASD,SAASA,CAACI,WAAwB,EAAEH,OAA0B,EAAO;EAC5E,MAAM;IAACI,UAAU,GAAG;EAAC,CAAC,GAAGJ,OAAO,IAAI,CAAC,CAAC;EACtC,MAAMC,GAAQ,GAAG,CAAC,CAAQ;EAC1BZ,YAAY,CAACY,GAAG,EAAEE,WAAW,EAAEC,UAAU,EAAEJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EACxD,OAAOA,GAAG;AACZ;AAGA,OAAO,MAAMI,mBAAqC,GAAGf,SAAS"}
|
package/dist/esm/glb-writer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-writer.js","names":["encodeGLBSync","VERSION","GLBWriter","name","id","module","version","extensions","mimeTypes","binary","encodeSync","options","glb","byteOffset","byteLength","arrayBuffer","ArrayBuffer","dataView","DataView","_TypecheckGLBLoader"],"sources":["../../src/glb-writer.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"glb-writer.js","names":["encodeGLBSync","VERSION","GLBWriter","name","id","module","version","extensions","mimeTypes","binary","encodeSync","options","glb","byteOffset","byteLength","arrayBuffer","ArrayBuffer","dataView","DataView","_TypecheckGLBLoader"],"sources":["../../src/glb-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Writer, WriterOptions} from '@loaders.gl/loader-utils';\nimport type {GLB} from './lib/types/glb-types';\nimport type {GLBEncodeOptions} from './lib/encoders/encode-glb';\nimport {encodeGLBSync} from './lib/encoders/encode-glb';\nimport {VERSION} from './lib/utils/version';\n\nexport type GLBWriterOptions = WriterOptions & {\n glb?: GLBEncodeOptions;\n};\n\n/**\n * GLB exporter\n * GLB is the binary container format for GLTF\n */\nexport const GLBWriter: Writer<GLB, never, GLBWriterOptions> = {\n name: 'GLB',\n id: 'glb',\n module: 'gltf',\n version: VERSION,\n\n extensions: ['glb'],\n mimeTypes: ['model/gltf-binary'],\n binary: true,\n\n encodeSync,\n\n options: {\n glb: {}\n }\n};\n\nfunction encodeSync(glb, options) {\n const {byteOffset = 0} = options;\n\n // Calculate length and allocate buffer\n const byteLength = encodeGLBSync(glb, null, byteOffset, options);\n const arrayBuffer = new ArrayBuffer(byteLength);\n\n // Encode into buffer\n const dataView = new DataView(arrayBuffer);\n encodeGLBSync(glb, dataView, byteOffset, options);\n\n return arrayBuffer;\n}\n\n// TYPE TESTS - TODO find a better way than exporting junk\nexport const _TypecheckGLBLoader: Writer = GLBWriter;\n"],"mappings":"AAKA,SAAQA,aAAa,QAAO,2BAA2B;AACvD,SAAQC,OAAO,QAAO,qBAAqB;AAU3C,OAAO,MAAMC,SAA+C,GAAG;EAC7DC,IAAI,EAAE,KAAK;EACXC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEL,OAAO;EAEhBM,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,SAAS,EAAE,CAAC,mBAAmB,CAAC;EAChCC,MAAM,EAAE,IAAI;EAEZC,UAAU;EAEVC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;EACR;AACF,CAAC;AAED,SAASF,UAAUA,CAACE,GAAG,EAAED,OAAO,EAAE;EAChC,MAAM;IAACE,UAAU,GAAG;EAAC,CAAC,GAAGF,OAAO;EAGhC,MAAMG,UAAU,GAAGd,aAAa,CAACY,GAAG,EAAE,IAAI,EAAEC,UAAU,EAAEF,OAAO,CAAC;EAChE,MAAMI,WAAW,GAAG,IAAIC,WAAW,CAACF,UAAU,CAAC;EAG/C,MAAMG,QAAQ,GAAG,IAAIC,QAAQ,CAACH,WAAW,CAAC;EAC1Cf,aAAa,CAACY,GAAG,EAAEK,QAAQ,EAAEJ,UAAU,EAAEF,OAAO,CAAC;EAEjD,OAAOI,WAAW;AACpB;AAGA,OAAO,MAAMI,mBAA2B,GAAGjB,SAAS"}
|
package/dist/esm/gltf-loader.js
CHANGED
|
@@ -16,8 +16,7 @@ export const GLTFLoader = {
|
|
|
16
16
|
normalize: true,
|
|
17
17
|
loadBuffers: true,
|
|
18
18
|
loadImages: true,
|
|
19
|
-
decompressMeshes: true
|
|
20
|
-
postProcess: true
|
|
19
|
+
decompressMeshes: true
|
|
21
20
|
},
|
|
22
21
|
log: console
|
|
23
22
|
},
|
|
@@ -27,7 +26,8 @@ export const GLTFLoader = {
|
|
|
27
26
|
decompress: 'gltf.decompressMeshes',
|
|
28
27
|
postProcess: 'gltf.postProcess',
|
|
29
28
|
gltf: {
|
|
30
|
-
decompress: 'gltf.decompressMeshes'
|
|
29
|
+
decompress: 'gltf.decompressMeshes',
|
|
30
|
+
postProcess: 'removed in v4'
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-loader.js","names":["VERSION","parseGLTF","GLTFLoader","name","id","module","version","extensions","mimeTypes","text","binary","tests","parse","options","gltf","normalize","loadBuffers","loadImages","decompressMeshes","
|
|
1
|
+
{"version":3,"file":"gltf-loader.js","names":["VERSION","parseGLTF","GLTFLoader","name","id","module","version","extensions","mimeTypes","text","binary","tests","parse","options","gltf","normalize","loadBuffers","loadImages","decompressMeshes","log","console","deprecatedOptions","fetchImages","createImages","decompress","postProcess","arrayBuffer","arguments","length","undefined","context","byteOffset"],"sources":["../../src/gltf-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {DracoLoaderOptions} from '@loaders.gl/draco';\nimport {VERSION} from './lib/utils/version';\nimport type {ImageLoaderOptions} from '@loaders.gl/images';\nimport type {TextureLoaderOptions} from '@loaders.gl/textures';\nimport type {ParseGLTFOptions} from './lib/parsers/parse-gltf';\nimport type {GLTFWithBuffers} from './lib/types/gltf-types';\nimport type {GLBLoaderOptions} from './glb-loader';\nimport {parseGLTF} from './lib/parsers/parse-gltf';\n\n/**\n * GLTF loader options\n */\nexport type GLTFLoaderOptions = LoaderOptions &\n ImageLoaderOptions &\n TextureLoaderOptions &\n GLBLoaderOptions &\n DracoLoaderOptions & {\n gltf?: ParseGLTFOptions;\n };\n\n/**\n * GLTF loader\n */\nexport const GLTFLoader: LoaderWithParser<GLTFWithBuffers, never, GLBLoaderOptions> = {\n name: 'glTF',\n id: 'gltf',\n module: 'gltf',\n version: VERSION,\n extensions: ['gltf', 'glb'],\n mimeTypes: ['model/gltf+json', 'model/gltf-binary'],\n\n text: true,\n binary: true,\n tests: ['glTF'],\n parse,\n\n options: {\n gltf: {\n normalize: true, // Normalize glTF v1 to glTF v2 format (not yet stable)\n loadBuffers: true, // Fetch any linked .BIN buffers, decode base64\n loadImages: true, // Create image objects\n decompressMeshes: true // Decompress Draco encoded meshes\n },\n\n // common?\n log: console // eslint-disable-line\n },\n deprecatedOptions: {\n fetchImages: 'gltf.loadImages',\n createImages: 'gltf.loadImages',\n decompress: 'gltf.decompressMeshes',\n postProcess: 'gltf.postProcess',\n gltf: {\n decompress: 'gltf.decompressMeshes',\n postProcess: 'removed in v4'\n }\n }\n};\n\nexport async function parse(\n arrayBuffer,\n options: GLTFLoaderOptions = {},\n context\n): Promise<GLTFWithBuffers> {\n // Apps can call the parse method directly, we so apply default options here\n options = {...GLTFLoader.options, ...options};\n // @ts-ignore\n options.gltf = {...GLTFLoader.options.gltf, ...options.gltf};\n\n const {byteOffset = 0} = options;\n const gltf = {};\n return await parseGLTF(gltf as GLTFWithBuffers, arrayBuffer, byteOffset, options, context);\n}\n"],"mappings":"AAEA,SAAQA,OAAO,QAAO,qBAAqB;AAM3C,SAAQC,SAAS,QAAO,0BAA0B;AAgBlD,OAAO,MAAMC,UAAsE,GAAG;EACpFC,IAAI,EAAE,MAAM;EACZC,EAAE,EAAE,MAAM;EACVC,MAAM,EAAE,MAAM;EACdC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;EAC3BC,SAAS,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;EAEnDC,IAAI,EAAE,IAAI;EACVC,MAAM,EAAE,IAAI;EACZC,KAAK,EAAE,CAAC,MAAM,CAAC;EACfC,KAAK;EAELC,OAAO,EAAE;IACPC,IAAI,EAAE;MACJC,SAAS,EAAE,IAAI;MACfC,WAAW,EAAE,IAAI;MACjBC,UAAU,EAAE,IAAI;MAChBC,gBAAgB,EAAE;IACpB,CAAC;IAGDC,GAAG,EAAEC;EACP,CAAC;EACDC,iBAAiB,EAAE;IACjBC,WAAW,EAAE,iBAAiB;IAC9BC,YAAY,EAAE,iBAAiB;IAC/BC,UAAU,EAAE,uBAAuB;IACnCC,WAAW,EAAE,kBAAkB;IAC/BX,IAAI,EAAE;MACJU,UAAU,EAAE,uBAAuB;MACnCC,WAAW,EAAE;IACf;EACF;AACF,CAAC;AAED,OAAO,eAAeb,KAAKA,CACzBc,WAAW,EAGe;EAAA,IAF1Bb,OAA0B,GAAAc,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAAA,IAC/BG,OAAO,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAGPhB,OAAO,GAAG;IAAC,GAAGX,UAAU,CAACW,OAAO;IAAE,GAAGA;EAAO,CAAC;EAE7CA,OAAO,CAACC,IAAI,GAAG;IAAC,GAAGZ,UAAU,CAACW,OAAO,CAACC,IAAI;IAAE,GAAGD,OAAO,CAACC;EAAI,CAAC;EAE5D,MAAM;IAACiB,UAAU,GAAG;EAAC,CAAC,GAAGlB,OAAO;EAChC,MAAMC,IAAI,GAAG,CAAC,CAAC;EACf,OAAO,MAAMb,SAAS,CAACa,IAAI,EAAqBY,WAAW,EAAEK,UAAU,EAAElB,OAAO,EAAEiB,OAAO,CAAC;AAC5F"}
|
package/dist/esm/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { GLTFLoader } from './gltf-loader';
|
|
|
2
2
|
export { GLTFWriter } from './gltf-writer';
|
|
3
3
|
export { GLBLoader } from './glb-loader';
|
|
4
4
|
export { GLBWriter } from './glb-writer';
|
|
5
|
-
export {
|
|
5
|
+
export { GLTFScenegraph } from './lib/api/gltf-scenegraph';
|
|
6
6
|
export { postProcessGLTF } from './lib/api/post-process-gltf';
|
|
7
|
+
export { getMemoryUsageGLTF as _getMemoryUsageGLTF } from './lib/gltf-utils/gltf-utils';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["GLTFLoader","GLTFWriter","GLBLoader","GLBWriter","
|
|
1
|
+
{"version":3,"file":"index.js","names":["GLTFLoader","GLTFWriter","GLBLoader","GLBWriter","GLTFScenegraph","postProcessGLTF","getMemoryUsageGLTF","_getMemoryUsageGLTF"],"sources":["../../src/index.ts"],"sourcesContent":["/* eslint-disable camelcase, indent */\nexport type {GLB} from './lib/types/glb-types';\n\n// Raw GLTF Types (i.e. not post-processed)\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTFObject,\n // The following extensions are handled by the GLTFLoader and removed from the parsed glTF (disable via options.gltf.excludeExtensions)\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp,\n GLTF_EXT_feature_metadata,\n GLTF_EXT_feature_metadata_primitive,\n GLTF_EXT_feature_metadata_attribute,\n GLTF_EXT_mesh_features\n} from './lib/types/gltf-json-schema';\n\n// Postprocessed types (modified GLTF types)\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFNodePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFImagePostprocessed,\n GLTFTexturePostprocessed\n} from './lib/types/gltf-postprocessed-schema';\n\nexport type {GLTFWithBuffers} from './lib/types/gltf-types';\n\n// glTF loader/writer definition objects\nexport {GLTFLoader} from './gltf-loader';\nexport {GLTFWriter} from './gltf-writer';\n\n// GLB Loader & Writer (for custom formats that want to leverage the GLB binary \"envelope\")\nexport {GLBLoader} from './glb-loader';\nexport {GLBWriter} from './glb-writer';\n\n// glTF Data Access Helper Class\nexport {GLTFScenegraph} from './lib/api/gltf-scenegraph';\nexport {postProcessGLTF} from './lib/api/post-process-gltf';\nexport {getMemoryUsageGLTF as _getMemoryUsageGLTF} from './lib/gltf-utils/gltf-utils';\n\n/** @deprecated */\n// export type {GLTFMesh as Mesh} from './lib/types/gltf-json-schema';\n/** @deprecated */\n// export type {GLTFNodePostprocessed as Node} from './lib/types/gltf-postprocessed-schema';\n/** @deprecated */\n// export type {GLTFAccessorPostprocessed as Accessor} from './lib/types/gltf-postprocessed-schema';\n// /** @deprecated */\n// export type {GLTFImagePostprocessed as Image} from './lib/types/gltf-postprocessed-schema';\n"],"mappings":"AA8CA,SAAQA,UAAU,QAAO,eAAe;AACxC,SAAQC,UAAU,QAAO,eAAe;AAGxC,SAAQC,SAAS,QAAO,cAAc;AACtC,SAAQC,SAAS,QAAO,cAAc;AAGtC,SAAQC,cAAc,QAAO,2BAA2B;AACxD,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,kBAAkB,IAAIC,mBAAmB,QAAO,6BAA6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-extensions.js","names":["EXT_meshopt_compression","EXT_texture_webp","KHR_texture_basisu","KHR_draco_mesh_compression","KHR_texture_transform","KHR_lights_punctual","KHR_materials_unlit","KHR_techniques_webgl","EXT_feature_metadata","EXTENSIONS","preprocessExtensions","gltf","options","arguments","length","undefined","context","extensions","filter","extension","useExtension","name","_extension$preprocess","preprocess","call","decodeExtensions","_extension$decode","decode","extensionName","_options$gltf","excludes","excludeExtensions","exclude"],"sources":["../../../../src/lib/api/gltf-extensions.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport {GLTF} from '../types/gltf-
|
|
1
|
+
{"version":3,"file":"gltf-extensions.js","names":["EXT_meshopt_compression","EXT_texture_webp","KHR_texture_basisu","KHR_draco_mesh_compression","KHR_texture_transform","KHR_lights_punctual","KHR_materials_unlit","KHR_techniques_webgl","EXT_feature_metadata","EXTENSIONS","preprocessExtensions","gltf","options","arguments","length","undefined","context","extensions","filter","extension","useExtension","name","_extension$preprocess","preprocess","call","decodeExtensions","_extension$decode","decode","extensionName","_options$gltf","excludes","excludeExtensions","exclude"],"sources":["../../../../src/lib/api/gltf-extensions.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport {GLTF} from '../types/gltf-json-schema';\nimport type {GLTFLoaderOptions} from '../../gltf-loader';\n\n// GLTF 1.0 extensions (decode only)\n// import * as KHR_binary_gltf from './KHR_draco_mesh_compression';\n\n// GLTF 2.0 Khronos extensions (decode/encode)\nimport * as EXT_meshopt_compression from '../extensions/EXT_meshopt_compression';\nimport * as EXT_texture_webp from '../extensions/EXT_texture_webp';\nimport * as KHR_texture_basisu from '../extensions/KHR_texture_basisu';\nimport * as KHR_draco_mesh_compression from '../extensions/KHR_draco_mesh_compression';\nimport * as KHR_texture_transform from '../extensions/KHR_texture_transform';\n\n// Deprecated. These should be handled by rendering library (e.g. luma.gl), not the loader.\nimport * as KHR_lights_punctual from '../extensions/deprecated/KHR_lights_punctual';\nimport * as KHR_materials_unlit from '../extensions/deprecated/KHR_materials_unlit';\nimport * as KHR_techniques_webgl from '../extensions/deprecated/KHR_techniques_webgl';\nimport * as EXT_feature_metadata from '../extensions/deprecated/EXT_feature_metadata';\n\n// Vendor extensions\n\ntype GLTFExtensionPlugin = {\n name: string;\n preprocess?: (gltfData: {json: GLTF}, options: GLTFLoaderOptions, context) => void;\n decode?: (\n gltfData: {\n json: GLTF;\n buffers: {arrayBuffer: ArrayBuffer; byteOffset: number; byteLength: number}[];\n },\n options: GLTFLoaderOptions,\n context\n ) => Promise<void>;\n encode?: (gltfData: {json: GLTF}, options: GLTFLoaderOptions) => void;\n};\n\n/**\n * List of extensions processed by the GLTFLoader\n * Note that may extensions can only be handled on the rendering stage and are left out here\n * These are just extensions that can be handled fully or partially during loading.\n */\nexport const EXTENSIONS: GLTFExtensionPlugin[] = [\n // 1.0\n // KHR_binary_gltf is handled separately - must be processed before other parsing starts\n // KHR_binary_gltf,\n\n // 2.0\n EXT_meshopt_compression,\n EXT_texture_webp,\n // Basisu should come after webp, we want basisu to be preferred if both are provided\n KHR_texture_basisu,\n KHR_draco_mesh_compression,\n KHR_lights_punctual,\n KHR_materials_unlit,\n KHR_techniques_webgl,\n KHR_texture_transform,\n EXT_feature_metadata\n];\n\n/** Call before any resource loading starts */\nexport function preprocessExtensions(gltf, options: GLTFLoaderOptions = {}, context?) {\n const extensions = EXTENSIONS.filter((extension) => useExtension(extension.name, options));\n for (const extension of extensions) {\n extension.preprocess?.(gltf, options, context);\n }\n}\n\n/** Call after resource loading */\nexport async function decodeExtensions(gltf, options: GLTFLoaderOptions = {}, context?) {\n const extensions = EXTENSIONS.filter((extension) => useExtension(extension.name, options));\n for (const extension of extensions) {\n // Note: We decode async extensions sequentially, this might not be necessary\n // Currently we only have Draco, but when we add Basis we may revisit\n await extension.decode?.(gltf, options, context);\n }\n}\n\nfunction useExtension(extensionName: string, options: GLTFLoaderOptions) {\n const excludes = options?.gltf?.excludeExtensions || {};\n const exclude = extensionName in excludes && !excludes[extensionName];\n return !exclude;\n}\n"],"mappings":"AAQA,OAAO,KAAKA,uBAAuB,MAAM,uCAAuC;AAChF,OAAO,KAAKC,gBAAgB,MAAM,gCAAgC;AAClE,OAAO,KAAKC,kBAAkB,MAAM,kCAAkC;AACtE,OAAO,KAAKC,0BAA0B,MAAM,0CAA0C;AACtF,OAAO,KAAKC,qBAAqB,MAAM,qCAAqC;AAG5E,OAAO,KAAKC,mBAAmB,MAAM,8CAA8C;AACnF,OAAO,KAAKC,mBAAmB,MAAM,8CAA8C;AACnF,OAAO,KAAKC,oBAAoB,MAAM,+CAA+C;AACrF,OAAO,KAAKC,oBAAoB,MAAM,+CAA+C;AAuBrF,OAAO,MAAMC,UAAiC,GAAG,CAM/CT,uBAAuB,EACvBC,gBAAgB,EAEhBC,kBAAkB,EAClBC,0BAA0B,EAC1BE,mBAAmB,EACnBC,mBAAmB,EACnBC,oBAAoB,EACpBH,qBAAqB,EACrBI,oBAAoB,CACrB;AAGD,OAAO,SAASE,oBAAoBA,CAACC,IAAI,EAA6C;EAAA,IAA3C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APjB,OAAO,CAAED,IAAI,cAAAkB,aAAA,uBAAbA,aAAA,CAAeE,iBAAiB,KAAI,CAAC,CAAC;EACvD,MAAMC,OAAO,GAAGJ,aAAa,IAAIE,QAAQ,IAAI,CAACA,QAAQ,CAACF,aAAa,CAAC;EACrE,OAAO,CAACI,OAAO;AACjB"}
|
|
@@ -3,23 +3,26 @@ import { getBinaryImageMetadata } from '@loaders.gl/images';
|
|
|
3
3
|
import { padToNBytes, copyToArray } from '@loaders.gl/loader-utils';
|
|
4
4
|
import { assert } from '../utils/assert';
|
|
5
5
|
import { getAccessorArrayTypeAndLength, getAccessorTypeFromSize, getComponentTypeFromArray } from '../gltf-utils/gltf-utils';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
function makeDefaultGLTFJson() {
|
|
7
|
+
return {
|
|
8
|
+
asset: {
|
|
9
|
+
version: '2.0',
|
|
10
|
+
generator: 'loaders.gl'
|
|
11
|
+
},
|
|
12
|
+
buffers: [],
|
|
13
|
+
extensions: {},
|
|
14
|
+
extensionsRequired: [],
|
|
15
|
+
extensionsUsed: []
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export class GLTFScenegraph {
|
|
14
19
|
constructor(gltf) {
|
|
15
20
|
_defineProperty(this, "gltf", void 0);
|
|
16
21
|
_defineProperty(this, "sourceBuffers", void 0);
|
|
17
22
|
_defineProperty(this, "byteLength", void 0);
|
|
18
|
-
this.gltf =
|
|
19
|
-
json:
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
buffers: []
|
|
23
|
+
this.gltf = {
|
|
24
|
+
json: (gltf === null || gltf === void 0 ? void 0 : gltf.json) || makeDefaultGLTFJson(),
|
|
25
|
+
buffers: (gltf === null || gltf === void 0 ? void 0 : gltf.buffers) || []
|
|
23
26
|
};
|
|
24
27
|
this.sourceBuffers = [];
|
|
25
28
|
this.byteLength = 0;
|
|
@@ -39,10 +42,15 @@ export default class GLTFScenegraph {
|
|
|
39
42
|
const extras = this.json.extras || {};
|
|
40
43
|
return extras[key];
|
|
41
44
|
}
|
|
45
|
+
hasExtension(extensionName) {
|
|
46
|
+
const isUsedExtension = this.getUsedExtensions().find(name => name === extensionName);
|
|
47
|
+
const isRequiredExtension = this.getRequiredExtensions().find(name => name === extensionName);
|
|
48
|
+
return typeof isUsedExtension === 'string' || typeof isRequiredExtension === 'string';
|
|
49
|
+
}
|
|
42
50
|
getExtension(extensionName) {
|
|
43
51
|
const isExtension = this.getUsedExtensions().find(name => name === extensionName);
|
|
44
52
|
const extensions = this.json.extensions || {};
|
|
45
|
-
return isExtension ? extensions[extensionName]
|
|
53
|
+
return isExtension ? extensions[extensionName] : null;
|
|
46
54
|
}
|
|
47
55
|
getRequiredExtension(extensionName) {
|
|
48
56
|
const isRequired = this.getRequiredExtensions().find(name => name === extensionName);
|
|
@@ -152,10 +160,15 @@ export default class GLTFScenegraph {
|
|
|
152
160
|
extensions[extensionName] = data;
|
|
153
161
|
}
|
|
154
162
|
removeObjectExtension(object, extensionName) {
|
|
155
|
-
const extensions = object.extensions || {};
|
|
156
|
-
|
|
163
|
+
const extensions = (object === null || object === void 0 ? void 0 : object.extensions) || {};
|
|
164
|
+
if (extensions[extensionName]) {
|
|
165
|
+
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
166
|
+
const extensionsRemoved = this.json.extensionsRemoved;
|
|
167
|
+
if (!extensionsRemoved.includes(extensionName)) {
|
|
168
|
+
extensionsRemoved.push(extensionName);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
157
171
|
delete extensions[extensionName];
|
|
158
|
-
return extension;
|
|
159
172
|
}
|
|
160
173
|
addExtension(extensionName) {
|
|
161
174
|
let extensionData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -186,8 +199,16 @@ export default class GLTFScenegraph {
|
|
|
186
199
|
}
|
|
187
200
|
}
|
|
188
201
|
removeExtension(extensionName) {
|
|
189
|
-
|
|
190
|
-
|
|
202
|
+
var _this$json$extensions;
|
|
203
|
+
if ((_this$json$extensions = this.json.extensions) !== null && _this$json$extensions !== void 0 && _this$json$extensions[extensionName]) {
|
|
204
|
+
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
205
|
+
const extensionsRemoved = this.json.extensionsRemoved;
|
|
206
|
+
if (!extensionsRemoved.includes(extensionName)) {
|
|
207
|
+
extensionsRemoved.push(extensionName);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (this.json.extensions) {
|
|
211
|
+
delete this.json.extensions[extensionName];
|
|
191
212
|
}
|
|
192
213
|
if (this.json.extensionsRequired) {
|
|
193
214
|
this._removeStringFromArray(this.json.extensionsRequired, extensionName);
|
|
@@ -195,16 +216,6 @@ export default class GLTFScenegraph {
|
|
|
195
216
|
if (this.json.extensionsUsed) {
|
|
196
217
|
this._removeStringFromArray(this.json.extensionsUsed, extensionName);
|
|
197
218
|
}
|
|
198
|
-
if (this.json.extensions) {
|
|
199
|
-
delete this.json.extensions[extensionName];
|
|
200
|
-
}
|
|
201
|
-
if (!Array.isArray(this.json.extensionsRemoved)) {
|
|
202
|
-
this.json.extensionsRemoved = [];
|
|
203
|
-
}
|
|
204
|
-
const extensionsRemoved = this.json.extensionsRemoved;
|
|
205
|
-
if (!extensionsRemoved.includes(extensionName)) {
|
|
206
|
-
extensionsRemoved.push(extensionName);
|
|
207
|
-
}
|
|
208
219
|
}
|
|
209
220
|
setDefaultScene(sceneIndex) {
|
|
210
221
|
this.json.scene = sceneIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-scenegraph.js","names":["getBinaryImageMetadata","padToNBytes","copyToArray","assert","getAccessorArrayTypeAndLength","getAccessorTypeFromSize","getComponentTypeFromArray","DEFAULT_GLTF_JSON","asset","version","generator","buffers","GLTFScenegraph","constructor","gltf","_defineProperty","json","sourceBuffers","byteLength","getApplicationData","key","data","getExtraData","extras","getExtension","extensionName","isExtension","getUsedExtensions","find","name","extensions","getRequiredExtension","isRequired","getRequiredExtensions","extensionsRequired","extensionsUsed","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","extension","addExtension","extensionData","arguments","undefined","addRequiredExtension","registerRequiredExtension","ext","push","removeExtension","_removeStringFromArray","Array","isArray","includes","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":["import 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 GLTFWithBuffers\n} from '../types/gltf-types';\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\nconst DEFAULT_GLTF_JSON: GLTF = {\n asset: {\n version: '2.0',\n generator: 'loaders.gl'\n },\n buffers: []\n};\n\ntype Extension = {[key: string]: any};\n/**\n * Class for structured access to GLTF data\n */\nexport default class GLTFScenegraph {\n // internal\n gltf: GLTFWithBuffers;\n sourceBuffers: any[];\n byteLength: number;\n\n constructor(gltf?: {json: GLTF; buffers?: any[]}) {\n // @ts-ignore\n this.gltf = gltf || {\n json: {...DEFAULT_GLTF_JSON},\n 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 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] || true : 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: object, extensionName: string, data: object): void {\n // @ts-ignore\n const extensions = object.extensions || {};\n extensions[extensionName] = data;\n // TODO - add to usedExtensions...\n }\n\n removeObjectExtension(object: object, extensionName: string): object {\n // @ts-ignore\n const extensions = object.extensions || {};\n const extension = extensions[extensionName];\n delete extensions[extensionName];\n return extension;\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 as Record<string, unknown>)[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.getExtension(extensionName)) {\n return;\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 if (this.json.extensions) {\n delete this.json.extensions[extensionName];\n }\n if (!Array.isArray(this.json.extensionsRemoved)) {\n this.json.extensionsRemoved = [];\n }\n const extensionsRemoved = this.json.extensionsRemoved as string[];\n if (!extensionsRemoved.includes(extensionName)) {\n extensionsRemoved.push(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":";AAgBA,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;AAEjC,MAAMC,iBAAuB,GAAG;EAC9BC,KAAK,EAAE;IACLC,OAAO,EAAE,KAAK;IACdC,SAAS,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;AACX,CAAC;AAMD,eAAe,MAAMC,cAAc,CAAC;EAMlCC,WAAWA,CAACC,IAAoC,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEhD,IAAI,CAACD,IAAI,GAAGA,IAAI,IAAI;MAClBE,IAAI,EAAE;QAAC,GAAGT;MAAiB,CAAC;MAC5BI,OAAO,EAAE;IACX,CAAC;IACD,IAAI,CAACM,aAAa,GAAG,EAAE;IACvB,IAAI,CAACC,UAAU,GAAG,CAAC;IAGnB,IAAI,IAAI,CAACJ,IAAI,CAACH,OAAO,IAAI,IAAI,CAACG,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,EAAE;MAC7C,IAAI,CAACO,UAAU,GAAG,IAAI,CAACJ,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAACO,UAAU;MACjD,IAAI,CAACD,aAAa,GAAG,CAAC,IAAI,CAACH,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7C;EACF;EAIA,IAAIK,IAAIA,CAAA,EAAS;IACf,OAAO,IAAI,CAACF,IAAI,CAACE,IAAI;EACvB;EAEAG,kBAAkBA,CAACC,GAAW,EAAW;IAEvC,MAAMC,IAAI,GAAG,IAAI,CAACL,IAAI,CAACI,GAAG,CAAC;IAC3B,OAAOC,IAAI;EACb;EAEAC,YAAYA,CA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A,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,EAC9BvH,MAAM,CAAClB,KAAK,GAAGyI,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,EAC9BvH,MAAM,CAAClB,KAAK,GAAGyI,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","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,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