@loaders.gl/gltf 4.0.0-alpha.9 → 4.0.0-beta.1
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 +3777 -3105
- package/dist/es5/glb-loader.js +1 -3
- package/dist/es5/glb-loader.js.map +1 -1
- package/dist/es5/index.js +33 -0
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/api/gltf-extensions.js +3 -1
- package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
- package/dist/es5/lib/extensions/EXT_mesh_features.js +99 -0
- package/dist/es5/lib/extensions/EXT_mesh_features.js.map +1 -0
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js +2 -2
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js.map +1 -1
- package/dist/es5/lib/extensions/EXT_structural_metadata.js +375 -0
- package/dist/es5/lib/extensions/EXT_structural_metadata.js.map +1 -0
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js +6 -7
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/dist/es5/lib/extensions/KHR_texture_transform.js +2 -1
- package/dist/es5/lib/extensions/KHR_texture_transform.js.map +1 -1
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +162 -183
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/es5/lib/extensions/utils/3d-tiles-utils.js +254 -0
- package/dist/es5/lib/extensions/utils/3d-tiles-utils.js.map +1 -0
- package/dist/es5/lib/gltf-utils/gltf-utils.js +29 -0
- package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -1
- package/dist/es5/lib/parsers/parse-gltf.js +7 -4
- package/dist/es5/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
- package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
- package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js +2 -0
- package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js.map +1 -0
- package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js +2 -0
- package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -0
- package/dist/es5/lib/types/gltf-json-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/es5/lib/utils/version.js.map +1 -1
- package/dist/esm/glb-loader.js +0 -1
- package/dist/esm/glb-loader.js.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/api/gltf-extensions.js +3 -1
- package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
- package/dist/esm/lib/extensions/EXT_mesh_features.js +43 -0
- package/dist/esm/lib/extensions/EXT_mesh_features.js.map +1 -0
- package/dist/esm/lib/extensions/EXT_meshopt_compression.js +2 -2
- package/dist/esm/lib/extensions/EXT_meshopt_compression.js.map +1 -1
- package/dist/esm/lib/extensions/EXT_structural_metadata.js +302 -0
- package/dist/esm/lib/extensions/EXT_structural_metadata.js.map +1 -0
- package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js +2 -5
- package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/dist/esm/lib/extensions/KHR_texture_transform.js +2 -1
- package/dist/esm/lib/extensions/KHR_texture_transform.js.map +1 -1
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +156 -167
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
- package/dist/esm/lib/extensions/utils/3d-tiles-utils.js +215 -0
- package/dist/esm/lib/extensions/utils/3d-tiles-utils.js.map +1 -0
- package/dist/esm/lib/gltf-utils/gltf-utils.js +30 -0
- package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -1
- package/dist/esm/lib/parsers/parse-gltf.js +6 -6
- package/dist/esm/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
- package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
- package/dist/esm/lib/types/gltf-ext-mesh-features-schema.js +2 -0
- package/dist/esm/lib/types/gltf-ext-mesh-features-schema.js.map +1 -0
- package/dist/esm/lib/types/gltf-ext-structural-metadata-schema.js +2 -0
- package/dist/esm/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -0
- package/dist/esm/lib/types/gltf-json-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/esm/lib/utils/version.js.map +1 -1
- package/dist/glb-loader.d.ts +3 -1
- package/dist/glb-loader.d.ts.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/api/gltf-extensions.d.ts.map +1 -1
- package/dist/lib/extensions/EXT_mesh_features.d.ts +7 -0
- package/dist/lib/extensions/EXT_mesh_features.d.ts.map +1 -0
- package/dist/lib/extensions/EXT_structural_metadata.d.ts +16 -0
- package/dist/lib/extensions/EXT_structural_metadata.d.ts.map +1 -0
- 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/deprecated/EXT_feature_metadata.d.ts +9 -0
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
- package/dist/lib/extensions/utils/3d-tiles-utils.d.ts +82 -0
- package/dist/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -0
- package/dist/lib/gltf-utils/gltf-utils.d.ts +2 -0
- package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
- package/dist/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts +421 -0
- package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts.map +1 -0
- package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts +43 -0
- package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts.map +1 -0
- package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts +329 -0
- package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts.map +1 -0
- package/dist/lib/types/gltf-json-schema.d.ts +12 -404
- package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-types.d.ts +4 -1
- 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/index.ts +37 -6
- package/src/lib/api/gltf-extensions.ts +6 -2
- package/src/lib/extensions/EXT_mesh_features.ts +91 -0
- package/src/lib/extensions/EXT_meshopt_compression.ts +1 -1
- package/src/lib/extensions/EXT_structural_metadata.ts +750 -0
- package/src/lib/extensions/KHR_draco_mesh_compression.ts +7 -7
- package/src/lib/extensions/KHR_texture_transform.ts +1 -1
- package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +407 -281
- package/src/lib/extensions/utils/3d-tiles-utils.ts +430 -0
- package/src/lib/gltf-utils/gltf-utils.ts +38 -0
- package/src/lib/parsers/parse-gltf.ts +14 -6
- package/src/lib/types/gltf-ext-feature-metadata-schema.ts +470 -0
- package/src/lib/types/gltf-ext-mesh-features-schema.ts +46 -0
- package/src/lib/types/gltf-ext-structural-metadata-schema.ts +378 -0
- package/src/lib/types/gltf-json-schema.ts +26 -465
- package/src/lib/types/gltf-types.ts +5 -3
- package/dist/bundle.js +0 -5
- package/dist/glb-loader.js +0 -36
- package/dist/glb-writer.js +0 -35
- package/dist/gltf-loader.js +0 -50
- package/dist/gltf-writer.js +0 -32
- package/dist/index.js +0 -28
- package/dist/lib/api/gltf-extensions.js +0 -83
- package/dist/lib/api/gltf-scenegraph.js +0 -580
- package/dist/lib/api/normalize-gltf-v1.js +0 -299
- package/dist/lib/api/post-process-gltf.js +0 -433
- package/dist/lib/encoders/encode-glb.js +0 -72
- package/dist/lib/encoders/encode-gltf.js +0 -32
- package/dist/lib/extensions/EXT_meshopt_compression.js +0 -41
- package/dist/lib/extensions/EXT_texture_webp.js +0 -36
- package/dist/lib/extensions/KHR_binary_gltf.js +0 -39
- package/dist/lib/extensions/KHR_draco_mesh_compression.js +0 -138
- package/dist/lib/extensions/KHR_texture_basisu.js +0 -29
- package/dist/lib/extensions/KHR_texture_transform.js +0 -227
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +0 -290
- package/dist/lib/extensions/deprecated/KHR_lights_punctual.js +0 -59
- package/dist/lib/extensions/deprecated/KHR_materials_unlit.js +0 -44
- package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js +0 -79
- package/dist/lib/gltf-utils/get-typed-array.js +0 -41
- package/dist/lib/gltf-utils/gltf-attribute-utils.js +0 -73
- package/dist/lib/gltf-utils/gltf-constants.js +0 -43
- package/dist/lib/gltf-utils/gltf-utils.js +0 -90
- package/dist/lib/gltf-utils/resolve-url.js +0 -18
- package/dist/lib/parsers/parse-glb.js +0 -166
- package/dist/lib/parsers/parse-gltf.js +0 -179
- package/dist/lib/types/glb-types.js +0 -2
- package/dist/lib/types/gltf-json-schema.js +0 -4
- package/dist/lib/types/gltf-postprocessed-schema.js +0 -4
- package/dist/lib/types/gltf-types.js +0 -3
- package/dist/lib/utils/assert.js +0 -12
- package/dist/lib/utils/version.js +0 -7
- package/dist/meshopt/meshopt-decoder.js +0 -118
- package/dist/webp/webp.js +0 -38
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { GLTFTextureInfoMetadata } from './gltf-json-schema';
|
|
2
|
+
/**
|
|
3
|
+
* glTF extension that provides structural metadata about vertices, texels, and features in a glTF asset.
|
|
4
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json
|
|
5
|
+
*/
|
|
6
|
+
export type GLTF_EXT_structural_metadata_GLTF = {
|
|
7
|
+
/** An object defining classes and enums. */
|
|
8
|
+
schema?: GLTF_EXT_structural_metadata_Schema;
|
|
9
|
+
/** A uri to an external schema file. */
|
|
10
|
+
schemaUri?: string;
|
|
11
|
+
/** An array of property table definitions, which may be referenced by index. */
|
|
12
|
+
propertyTables?: GLTF_EXT_structural_metadata_PropertyTable[];
|
|
13
|
+
/** An array of property texture definitions, which may be referenced by index. */
|
|
14
|
+
propertyTextures?: GLTF_EXT_structural_metadata_PropertyTexture[];
|
|
15
|
+
/** "An array of property attribute definitions, which may be referenced by index. */
|
|
16
|
+
propertyAttributes?: GLTF_EXT_structural_metadata_PropertyAttribute[];
|
|
17
|
+
/** This is not part of the spec. GLTFLoader loads names of attributes crated into this property */
|
|
18
|
+
dataAttributeNames?: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An object defining classes and enums.
|
|
22
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json
|
|
23
|
+
*/
|
|
24
|
+
export type GLTF_EXT_structural_metadata_Schema = {
|
|
25
|
+
/** Unique identifier for the schema. Schema IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. */
|
|
26
|
+
id: string;
|
|
27
|
+
/** The name of the schema. */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** The description of the schema. */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Application-specific version of the schema. */
|
|
32
|
+
version?: string;
|
|
33
|
+
/** A dictionary, where each key is a class ID and each value is an object defining the class. */
|
|
34
|
+
classes?: {
|
|
35
|
+
[key: string]: GLTF_EXT_structural_metadata_Class;
|
|
36
|
+
};
|
|
37
|
+
/** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */
|
|
38
|
+
enums?: {
|
|
39
|
+
[key: string]: GLTF_EXT_structural_metadata_Enum;
|
|
40
|
+
};
|
|
41
|
+
extensions?: Record<string, unknown>;
|
|
42
|
+
extras?: unknown;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* An object defining the values of an enum.
|
|
46
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.schema.json
|
|
47
|
+
*/
|
|
48
|
+
export type GLTF_EXT_structural_metadata_Enum = {
|
|
49
|
+
/** The name of the enum, e.g. for display purposes. */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** The description of the enum. */
|
|
52
|
+
description?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The type of the integer enum value.
|
|
55
|
+
* Default value is 'UINT16'
|
|
56
|
+
*/
|
|
57
|
+
valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64';
|
|
58
|
+
/** An array of enum values. Duplicate names or duplicate integer values are not allowed. */
|
|
59
|
+
values: GLTF_EXT_structural_metadata_EnumValue[];
|
|
60
|
+
extensions?: Record<string, unknown>;
|
|
61
|
+
extras?: unknown;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* An enum value.
|
|
65
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json
|
|
66
|
+
*/
|
|
67
|
+
export type GLTF_EXT_structural_metadata_EnumValue = {
|
|
68
|
+
/** The name of the enum value. */
|
|
69
|
+
name: string;
|
|
70
|
+
/** The description of the enum value. */
|
|
71
|
+
description?: string;
|
|
72
|
+
/** The integer enum value. */
|
|
73
|
+
value: number;
|
|
74
|
+
extensions?: Record<string, unknown>;
|
|
75
|
+
extras?: unknown;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* A class containing a set of properties.
|
|
79
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json
|
|
80
|
+
*/
|
|
81
|
+
export type GLTF_EXT_structural_metadata_Class = {
|
|
82
|
+
/** The name of the class, e.g. for display purposes. */
|
|
83
|
+
name?: string;
|
|
84
|
+
/** The description of the class. */
|
|
85
|
+
description?: string;
|
|
86
|
+
/**
|
|
87
|
+
* A dictionary, where each key is a property ID and each value is an object defining the property.
|
|
88
|
+
* Property IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.
|
|
89
|
+
*/
|
|
90
|
+
properties: {
|
|
91
|
+
[key: string]: GLTF_EXT_structural_metadata_ClassProperty;
|
|
92
|
+
};
|
|
93
|
+
extensions?: Record<string, unknown>;
|
|
94
|
+
extras?: unknown;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* A class property.
|
|
98
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json
|
|
99
|
+
*/
|
|
100
|
+
export type GLTF_EXT_structural_metadata_ClassProperty = {
|
|
101
|
+
/** The name of the property, e.g. for display purposes. */
|
|
102
|
+
name?: string;
|
|
103
|
+
/** The description of the property. */
|
|
104
|
+
description?: string;
|
|
105
|
+
/** The element type. */
|
|
106
|
+
type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | 'BOOLEAN' | 'STRING' | 'ENUM' | string;
|
|
107
|
+
/** The datatype of the element's components. Only applicable to `SCALAR`, `VECN`, and `MATN` types. */
|
|
108
|
+
componentType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64' | 'FLOAT32' | 'FLOAT64' | string;
|
|
109
|
+
/** Enum ID as declared in the `enums` dictionary. Required when `type` is `ENUM`. */
|
|
110
|
+
enumType?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Whether the property is an array.
|
|
113
|
+
* When `count` is defined the property is a fixed-length array. Otherwise the property is a variable-length array.
|
|
114
|
+
*/
|
|
115
|
+
array?: boolean;
|
|
116
|
+
/** The number of array elements. May only be defined when `array` is true. */
|
|
117
|
+
count?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Specifies whether integer values are normalized.
|
|
120
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types with integer component types.
|
|
121
|
+
* For unsigned integer component types, values are normalized between `[0.0, 1.0]`.
|
|
122
|
+
* For signed integer component types, values are normalized between `[-1.0, 1.0]`.
|
|
123
|
+
* For all other component types, this property must be false.
|
|
124
|
+
*/
|
|
125
|
+
normalized?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* An offset to apply to property values.
|
|
128
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.
|
|
129
|
+
*/
|
|
130
|
+
offset?: number | number[];
|
|
131
|
+
/**
|
|
132
|
+
* A scale to apply to property values.
|
|
133
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.
|
|
134
|
+
*/
|
|
135
|
+
scale?: number | number[];
|
|
136
|
+
/**
|
|
137
|
+
* Maximum allowed value for the property.
|
|
138
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types.
|
|
139
|
+
* This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
|
|
140
|
+
*/
|
|
141
|
+
max?: number | number[];
|
|
142
|
+
/**
|
|
143
|
+
* Minimum allowed value for the property.
|
|
144
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types.
|
|
145
|
+
* This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
|
|
146
|
+
*/
|
|
147
|
+
min?: number | number[];
|
|
148
|
+
default?: boolean | number | string | number[];
|
|
149
|
+
/**
|
|
150
|
+
* If required, the property must be present in every entity conforming to the class.
|
|
151
|
+
* If not required, individual entities may include `noData` values, or the entire property may be omitted.
|
|
152
|
+
* As a result, `noData` has no effect on a required property.
|
|
153
|
+
* Client implementations may use required properties to make performance optimizations.
|
|
154
|
+
* Default value is false.
|
|
155
|
+
*/
|
|
156
|
+
required?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* A `noData` value represents missing data — also known as a sentinel value — wherever it appears.
|
|
159
|
+
* `BOOLEAN` properties may not specify `noData` values.
|
|
160
|
+
* This is given as the plain property value, without the transforms from the `normalized`, `offset`, and `scale` properties.
|
|
161
|
+
* Must not be defined if `required` is true.
|
|
162
|
+
*/
|
|
163
|
+
noData?: number | string | number[] | string[];
|
|
164
|
+
/**
|
|
165
|
+
* An identifier that describes how this property should be interpreted.
|
|
166
|
+
* The semantic cannot be used by other properties in the class.
|
|
167
|
+
*/
|
|
168
|
+
semantic?: string;
|
|
169
|
+
extensions?: Record<string, unknown>;
|
|
170
|
+
extras?: unknown;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Properties conforming to a class, organized as property values stored in binary columnar arrays.
|
|
174
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json
|
|
175
|
+
*/
|
|
176
|
+
export type GLTF_EXT_structural_metadata_PropertyTable = {
|
|
177
|
+
/** The name of the property table, e.g. for display purposes. */
|
|
178
|
+
name?: string;
|
|
179
|
+
/** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */
|
|
180
|
+
class: string;
|
|
181
|
+
/** The number of elements in each property array. */
|
|
182
|
+
count: number;
|
|
183
|
+
/**
|
|
184
|
+
* A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary
|
|
185
|
+
* and each value is an object describing where property values are stored.
|
|
186
|
+
* Required properties must be included in this dictionary.
|
|
187
|
+
*/
|
|
188
|
+
properties?: {
|
|
189
|
+
[key: string]: GLTF_EXT_structural_metadata_PropertyTable_Property;
|
|
190
|
+
};
|
|
191
|
+
extensions?: Record<string, unknown>;
|
|
192
|
+
extras?: unknown;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* An array of binary property values.
|
|
196
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json
|
|
197
|
+
*/
|
|
198
|
+
export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
|
|
199
|
+
/**
|
|
200
|
+
* The index of the buffer view containing property values.
|
|
201
|
+
* The data type of property values is determined by the property definition:
|
|
202
|
+
* When `type` is `BOOLEAN` values are packed into a bitstream.
|
|
203
|
+
* When `type` is `STRING` values are stored as byte sequences and decoded as UTF-8 strings.
|
|
204
|
+
* When `type` is `SCALAR`, `VECN`, or `MATN` the values are stored as the provided `componentType`
|
|
205
|
+
* and the buffer view `byteOffset` must be aligned to a multiple of the `componentType` size.
|
|
206
|
+
* When `type` is `ENUM` values are stored as the enum's `valueType`
|
|
207
|
+
* and the buffer view `byteOffset` must be aligned to a multiple of the `valueType` size.
|
|
208
|
+
* Each enum value in the array must match one of the allowed values in the enum definition.
|
|
209
|
+
* `arrayOffsets` is required for variable-length arrays and `stringOffsets` is required for strings (for variable-length arrays of strings, both are required).
|
|
210
|
+
*/
|
|
211
|
+
values: number;
|
|
212
|
+
/**
|
|
213
|
+
* The index of the buffer view containing offsets for variable-length arrays.
|
|
214
|
+
* The number of offsets is equal to the property table `count` plus one.
|
|
215
|
+
* The offsets represent the start positions of each array, with the last offset representing the position after the last array.
|
|
216
|
+
* The array length is computed using the difference between the subsequent offset and the current offset.
|
|
217
|
+
* If `type` is `STRING` the offsets index into the string offsets array (stored in `stringOffsets`), otherwise they index into the property array (stored in `values`).
|
|
218
|
+
* The data type of these offsets is determined by `arrayOffsetType`.
|
|
219
|
+
* The buffer view `byteOffset` must be aligned to a multiple of the `arrayOffsetType` size.
|
|
220
|
+
*/
|
|
221
|
+
arrayOffsets?: number;
|
|
222
|
+
/**
|
|
223
|
+
* The index of the buffer view containing offsets for strings.
|
|
224
|
+
* The number of offsets is equal to the number of string elements plus one.
|
|
225
|
+
* The offsets represent the byte offsets of each string in the property array (stored in `values`), with the last offset representing the byte offset after the last string.
|
|
226
|
+
* The string byte length is computed using the difference between the subsequent offset and the current offset.
|
|
227
|
+
* The data type of these offsets is determined by `stringOffsetType`.
|
|
228
|
+
* The buffer view `byteOffset` must be aligned to a multiple of the `stringOffsetType` size.
|
|
229
|
+
*/
|
|
230
|
+
stringOffsets?: number;
|
|
231
|
+
/**
|
|
232
|
+
* The type of values in `arrayOffsets`.
|
|
233
|
+
* Default value is 'UINT32'
|
|
234
|
+
*/
|
|
235
|
+
arrayOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
|
|
236
|
+
/**
|
|
237
|
+
* The type of values in `stringOffsets`.
|
|
238
|
+
* Default value is 'UINT32'
|
|
239
|
+
*/
|
|
240
|
+
stringOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
|
|
241
|
+
/**
|
|
242
|
+
* An offset to apply to property values.
|
|
243
|
+
* Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.
|
|
244
|
+
* Overrides the class property's `offset` if both are defined.
|
|
245
|
+
*/
|
|
246
|
+
offset?: number | number[];
|
|
247
|
+
/**
|
|
248
|
+
* A scale to apply to property values.
|
|
249
|
+
* Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.
|
|
250
|
+
* Overrides the class property's `scale` if both are defined.
|
|
251
|
+
*/
|
|
252
|
+
scale?: number | number[];
|
|
253
|
+
/**
|
|
254
|
+
* Maximum value present in the property values.
|
|
255
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types.
|
|
256
|
+
* This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
|
|
257
|
+
*/
|
|
258
|
+
max?: number | number[];
|
|
259
|
+
/**
|
|
260
|
+
* Minimum value present in the property values.
|
|
261
|
+
* Only applicable to `SCALAR`, `VECN`, and `MATN` types.
|
|
262
|
+
* This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
|
|
263
|
+
*/
|
|
264
|
+
min?: number | number[];
|
|
265
|
+
extensions?: Record<string, unknown>;
|
|
266
|
+
extras?: unknown;
|
|
267
|
+
/** This is not part of the spec. GLTFLoader loads feature tables data into this property */
|
|
268
|
+
data?: unknown;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Properties conforming to a class, organized as property values stored in textures.
|
|
272
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json
|
|
273
|
+
*/
|
|
274
|
+
export type GLTF_EXT_structural_metadata_PropertyTexture = {
|
|
275
|
+
/** The name of the property texture, e.g. for display purposes. */
|
|
276
|
+
name?: string;
|
|
277
|
+
/** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */
|
|
278
|
+
class: string;
|
|
279
|
+
/**
|
|
280
|
+
* A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary
|
|
281
|
+
* and each value is an object describing where property values are stored.
|
|
282
|
+
* Required properties must be included in this dictionary.
|
|
283
|
+
*
|
|
284
|
+
* https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata
|
|
285
|
+
* Each property that is defined in the propertyTexture object extends the glTF textureInfo object.
|
|
286
|
+
* The texCoord specifies a texture coordinate set in the referring primitive.
|
|
287
|
+
* The index is the index of the glTF texture object that stores the actual data. Additionally,
|
|
288
|
+
* each property specifies an array of channels, which are the indices of the texture channels providing data for the respective property.
|
|
289
|
+
* Channels of an RGBA texture are numbered 0..3 respectively.
|
|
290
|
+
*/
|
|
291
|
+
properties?: {
|
|
292
|
+
[key: string]: GLTFTextureInfoMetadata;
|
|
293
|
+
};
|
|
294
|
+
extensions?: Record<string, unknown>;
|
|
295
|
+
extras?: unknown;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Properties conforming to a class, organized as property values stored in attributes.
|
|
299
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json
|
|
300
|
+
*/
|
|
301
|
+
export type GLTF_EXT_structural_metadata_PropertyAttribute = {
|
|
302
|
+
/** The name of the property attribute, e.g. for display purposes. */
|
|
303
|
+
name?: string;
|
|
304
|
+
/** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */
|
|
305
|
+
class: string;
|
|
306
|
+
/**
|
|
307
|
+
* "A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary
|
|
308
|
+
* and each value is an object describing where property values are stored.
|
|
309
|
+
* Required properties must be included in this dictionary.
|
|
310
|
+
*/
|
|
311
|
+
properties?: {
|
|
312
|
+
[key: string]: unknown;
|
|
313
|
+
};
|
|
314
|
+
extensions?: Record<string, unknown>;
|
|
315
|
+
extras?: unknown;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Structural metadata about a glTF primitive.
|
|
319
|
+
* @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json
|
|
320
|
+
*/
|
|
321
|
+
export type GLTF_EXT_structural_metadata_Primitive = {
|
|
322
|
+
/** An array of indexes of property textures in the root `EXT_structural_metadata` object. */
|
|
323
|
+
propertyTextures?: number[];
|
|
324
|
+
/** An array of indexes of property attributes in the root `EXT_structural_metadata` object. */
|
|
325
|
+
propertyAttributes?: number[];
|
|
326
|
+
extensions?: Record<string, unknown>;
|
|
327
|
+
extras?: unknown;
|
|
328
|
+
};
|
|
329
|
+
//# sourceMappingURL=gltf-ext-structural-metadata-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gltf-ext-structural-metadata-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/types/gltf-ext-structural-metadata-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,oBAAoB,CAAC;AAI3D;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9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