@loaders.gl/gltf 4.0.0-alpha.23 → 4.0.0-alpha.25

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.
Files changed (123) hide show
  1. package/dist/dist.min.js +378 -241
  2. package/dist/es5/index.js +12 -0
  3. package/dist/es5/index.js.map +1 -1
  4. package/dist/es5/lib/api/gltf-extensions.js +1 -1
  5. package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
  6. package/dist/es5/lib/extensions/EXT_mesh_features.js +13 -25
  7. package/dist/es5/lib/extensions/EXT_mesh_features.js.map +1 -1
  8. package/dist/es5/lib/extensions/EXT_structural_metadata.js +152 -106
  9. package/dist/es5/lib/extensions/EXT_structural_metadata.js.map +1 -1
  10. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +64 -16
  11. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  12. package/dist/es5/lib/extensions/{data-processing.js → utils/3d-tiles-utils.js} +51 -24
  13. package/dist/es5/lib/extensions/utils/3d-tiles-utils.js.map +1 -0
  14. package/dist/es5/lib/gltf-utils/gltf-utils.js +29 -0
  15. package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -1
  16. package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
  17. package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
  18. package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js.map +1 -1
  19. package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -1
  20. package/dist/es5/lib/types/gltf-json-schema.js.map +1 -1
  21. package/dist/es5/lib/types/gltf-types.js.map +1 -1
  22. package/dist/es5/lib/utils/version.js +1 -1
  23. package/dist/esm/index.js +2 -0
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/lib/api/gltf-extensions.js +1 -1
  26. package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
  27. package/dist/esm/lib/extensions/EXT_mesh_features.js +13 -25
  28. package/dist/esm/lib/extensions/EXT_mesh_features.js.map +1 -1
  29. package/dist/esm/lib/extensions/EXT_structural_metadata.js +127 -89
  30. package/dist/esm/lib/extensions/EXT_structural_metadata.js.map +1 -1
  31. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +64 -17
  32. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  33. package/dist/esm/lib/extensions/{data-processing.js → utils/3d-tiles-utils.js} +50 -24
  34. package/dist/esm/lib/extensions/utils/3d-tiles-utils.js.map +1 -0
  35. package/dist/esm/lib/gltf-utils/gltf-utils.js +30 -0
  36. package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -1
  37. package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
  38. package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
  39. package/dist/esm/lib/types/gltf-ext-mesh-features-schema.js.map +1 -1
  40. package/dist/esm/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -1
  41. package/dist/esm/lib/types/gltf-json-schema.js.map +1 -1
  42. package/dist/esm/lib/types/gltf-types.js.map +1 -1
  43. package/dist/esm/lib/utils/version.js +1 -1
  44. package/dist/index.d.ts +6 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/lib/extensions/EXT_mesh_features.d.ts.map +1 -1
  47. package/dist/lib/extensions/EXT_structural_metadata.d.ts +12 -4
  48. package/dist/lib/extensions/EXT_structural_metadata.d.ts.map +1 -1
  49. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +9 -0
  50. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
  51. package/dist/lib/extensions/utils/3d-tiles-utils.d.ts +52 -0
  52. package/dist/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -0
  53. package/dist/lib/gltf-utils/gltf-utils.d.ts +2 -0
  54. package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
  55. package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts +421 -0
  56. package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts.map +1 -0
  57. package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts +4 -6
  58. package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts.map +1 -1
  59. package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts +48 -29
  60. package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts.map +1 -1
  61. package/dist/lib/types/gltf-json-schema.d.ts +1 -420
  62. package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
  63. package/dist/lib/types/gltf-types.d.ts +3 -0
  64. package/dist/lib/types/gltf-types.d.ts.map +1 -1
  65. package/package.json +6 -6
  66. package/src/index.ts +10 -5
  67. package/src/lib/api/gltf-extensions.ts +1 -1
  68. package/src/lib/extensions/EXT_mesh_features.ts +18 -44
  69. package/src/lib/extensions/EXT_structural_metadata.ts +364 -217
  70. package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +193 -30
  71. package/src/lib/extensions/{data-processing.ts → utils/3d-tiles-utils.ts} +128 -56
  72. package/src/lib/gltf-utils/gltf-utils.ts +38 -0
  73. package/src/lib/types/gltf-ext-feature-metadata-schema.ts +470 -0
  74. package/src/lib/types/gltf-ext-mesh-features-schema.ts +4 -6
  75. package/src/lib/types/gltf-ext-structural-metadata-schema.ts +52 -31
  76. package/src/lib/types/gltf-json-schema.ts +1 -468
  77. package/src/lib/types/gltf-types.ts +4 -0
  78. package/dist/bundle.js +0 -5
  79. package/dist/es5/lib/extensions/data-processing.js.map +0 -1
  80. package/dist/esm/lib/extensions/data-processing.js.map +0 -1
  81. package/dist/glb-loader.js +0 -34
  82. package/dist/glb-writer.js +0 -35
  83. package/dist/gltf-loader.js +0 -50
  84. package/dist/gltf-writer.js +0 -32
  85. package/dist/index.js +0 -34
  86. package/dist/lib/api/gltf-extensions.js +0 -88
  87. package/dist/lib/api/gltf-scenegraph.js +0 -580
  88. package/dist/lib/api/normalize-gltf-v1.js +0 -299
  89. package/dist/lib/api/post-process-gltf.js +0 -433
  90. package/dist/lib/encoders/encode-glb.js +0 -72
  91. package/dist/lib/encoders/encode-gltf.js +0 -32
  92. package/dist/lib/extensions/EXT_mesh_features.js +0 -89
  93. package/dist/lib/extensions/EXT_meshopt_compression.js +0 -41
  94. package/dist/lib/extensions/EXT_structural_metadata.js +0 -504
  95. package/dist/lib/extensions/EXT_texture_webp.js +0 -36
  96. package/dist/lib/extensions/KHR_binary_gltf.js +0 -39
  97. package/dist/lib/extensions/KHR_draco_mesh_compression.js +0 -137
  98. package/dist/lib/extensions/KHR_texture_basisu.js +0 -29
  99. package/dist/lib/extensions/KHR_texture_transform.js +0 -227
  100. package/dist/lib/extensions/data-processing.d.ts +0 -34
  101. package/dist/lib/extensions/data-processing.d.ts.map +0 -1
  102. package/dist/lib/extensions/data-processing.js +0 -212
  103. package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +0 -282
  104. package/dist/lib/extensions/deprecated/KHR_lights_punctual.js +0 -59
  105. package/dist/lib/extensions/deprecated/KHR_materials_unlit.js +0 -44
  106. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js +0 -79
  107. package/dist/lib/gltf-utils/get-typed-array.js +0 -41
  108. package/dist/lib/gltf-utils/gltf-attribute-utils.js +0 -73
  109. package/dist/lib/gltf-utils/gltf-constants.js +0 -43
  110. package/dist/lib/gltf-utils/gltf-utils.js +0 -90
  111. package/dist/lib/gltf-utils/resolve-url.js +0 -18
  112. package/dist/lib/parsers/parse-glb.js +0 -166
  113. package/dist/lib/parsers/parse-gltf.js +0 -185
  114. package/dist/lib/types/glb-types.js +0 -2
  115. package/dist/lib/types/gltf-ext-mesh-features-schema.js +0 -2
  116. package/dist/lib/types/gltf-ext-structural-metadata-schema.js +0 -2
  117. package/dist/lib/types/gltf-json-schema.js +0 -4
  118. package/dist/lib/types/gltf-postprocessed-schema.js +0 -4
  119. package/dist/lib/types/gltf-types.js +0 -3
  120. package/dist/lib/utils/assert.js +0 -12
  121. package/dist/lib/utils/version.js +0 -7
  122. package/dist/meshopt/meshopt-decoder.js +0 -118
  123. package/dist/webp/webp.js +0 -38
@@ -3,9 +3,10 @@ import {GLTFTextureInfoMetadata} from './gltf-json-schema';
3
3
  /* eslint-disable camelcase */
4
4
 
5
5
  /**
6
+ * glTF extension that provides structural metadata about vertices, texels, and features in a glTF asset.
6
7
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json
7
8
  */
8
- export type GLTF_EXT_structural_metadata = {
9
+ export type GLTF_EXT_structural_metadata_GLTF = {
9
10
  /** An object defining classes and enums. */
10
11
  schema?: GLTF_EXT_structural_metadata_Schema;
11
12
  /** A uri to an external schema file. */
@@ -16,11 +17,12 @@ export type GLTF_EXT_structural_metadata = {
16
17
  propertyTextures?: GLTF_EXT_structural_metadata_PropertyTexture[];
17
18
  /** "An array of property attribute definitions, which may be referenced by index. */
18
19
  propertyAttributes?: GLTF_EXT_structural_metadata_PropertyAttribute[];
19
- /** For internal usage */
20
+ /** This is not part of the spec. GLTFLoader loads names of attributes crated into this property */
20
21
  dataAttributeNames?: string[];
21
22
  };
22
23
 
23
24
  /**
25
+ * An object defining classes and enums.
24
26
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json
25
27
  */
26
28
  export type GLTF_EXT_structural_metadata_Schema = {
@@ -40,8 +42,8 @@ export type GLTF_EXT_structural_metadata_Schema = {
40
42
  enums?: {
41
43
  [key: string]: GLTF_EXT_structural_metadata_Enum;
42
44
  };
43
- extensions?: Record<string, any>;
44
- extras?: any;
45
+ extensions?: Record<string, unknown>;
46
+ extras?: unknown;
45
47
  };
46
48
 
47
49
  /**
@@ -53,15 +55,19 @@ export type GLTF_EXT_structural_metadata_Enum = {
53
55
  name?: string;
54
56
  /** The description of the enum. */
55
57
  description?: string;
56
- /** The type of the integer enum value. */
57
- valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: "UINT16"
58
+ /**
59
+ * The type of the integer enum value.
60
+ * Default value is 'UINT16'
61
+ */
62
+ valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64';
58
63
  /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */
59
64
  values: GLTF_EXT_structural_metadata_EnumValue[];
60
- extensions?: Record<string, any>;
61
- extras?: any;
65
+ extensions?: Record<string, unknown>;
66
+ extras?: unknown;
62
67
  };
63
68
 
64
69
  /**
70
+ * An enum value.
65
71
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json
66
72
  */
67
73
  export type GLTF_EXT_structural_metadata_EnumValue = {
@@ -71,11 +77,12 @@ export type GLTF_EXT_structural_metadata_EnumValue = {
71
77
  description?: string;
72
78
  /** The integer enum value. */
73
79
  value: number;
74
- extensions?: Record<string, any>;
75
- extras?: any;
80
+ extensions?: Record<string, unknown>;
81
+ extras?: unknown;
76
82
  };
77
83
 
78
84
  /**
85
+ * A class containing a set of properties.
79
86
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json
80
87
  */
81
88
  export type GLTF_EXT_structural_metadata_Class = {
@@ -90,11 +97,12 @@ export type GLTF_EXT_structural_metadata_Class = {
90
97
  properties: {
91
98
  [key: string]: GLTF_EXT_structural_metadata_ClassProperty;
92
99
  };
93
- extensions?: Record<string, any>;
94
- extras?: any;
100
+ extensions?: Record<string, unknown>;
101
+ extras?: unknown;
95
102
  };
96
103
 
97
104
  /**
105
+ * A class property.
98
106
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json
99
107
  */
100
108
  export type GLTF_EXT_structural_metadata_ClassProperty = {
@@ -115,7 +123,8 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
115
123
  | 'MAT4'
116
124
  | 'BOOLEAN'
117
125
  | 'STRING'
118
- | 'ENUM';
126
+ | 'ENUM'
127
+ | string;
119
128
 
120
129
  /** The datatype of the element's components. Only applicable to `SCALAR`, `VECN`, and `MATN` types. */
121
130
  componentType?:
@@ -128,7 +137,8 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
128
137
  | 'INT64'
129
138
  | 'UINT64'
130
139
  | 'FLOAT32'
131
- | 'FLOAT64';
140
+ | 'FLOAT64'
141
+ | string;
132
142
 
133
143
  /** Enum ID as declared in the `enums` dictionary. Required when `type` is `ENUM`. */
134
144
  enumType?: string;
@@ -183,8 +193,9 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
183
193
  * If not required, individual entities may include `noData` values, or the entire property may be omitted.
184
194
  * As a result, `noData` has no effect on a required property.
185
195
  * Client implementations may use required properties to make performance optimizations.
196
+ * Default value is false.
186
197
  */
187
- required?: boolean; // default false;
198
+ required?: boolean;
188
199
 
189
200
  /**
190
201
  * A `noData` value represents missing data — also known as a sentinel value — wherever it appears.
@@ -199,10 +210,14 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
199
210
  * The semantic cannot be used by other properties in the class.
200
211
  */
201
212
  semantic?: string;
202
- extensions?: Record<string, any>;
203
- extras?: any;
213
+ extensions?: Record<string, unknown>;
214
+ extras?: unknown;
204
215
  };
205
216
 
217
+ /**
218
+ * Properties conforming to a class, organized as property values stored in binary columnar arrays.
219
+ * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json
220
+ */
206
221
  export type GLTF_EXT_structural_metadata_PropertyTable = {
207
222
  /** The name of the property table, e.g. for display purposes. */
208
223
  name?: string;
@@ -218,11 +233,12 @@ export type GLTF_EXT_structural_metadata_PropertyTable = {
218
233
  properties?: {
219
234
  [key: string]: GLTF_EXT_structural_metadata_PropertyTable_Property;
220
235
  };
221
- extensions?: Record<string, any>;
222
- extras?: any;
236
+ extensions?: Record<string, unknown>;
237
+ extras?: unknown;
223
238
  };
224
239
 
225
240
  /**
241
+ * An array of binary property values.
226
242
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json
227
243
  */
228
244
  export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
@@ -260,13 +276,15 @@ export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
260
276
  stringOffsets?: number;
261
277
  /**
262
278
  * The type of values in `arrayOffsets`.
279
+ * Default value is 'UINT32'
263
280
  */
264
- arrayOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64';
281
+ arrayOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
265
282
 
266
283
  /**
267
284
  * The type of values in `stringOffsets`.
285
+ * Default value is 'UINT32'
268
286
  */
269
- stringOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64';
287
+ stringOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
270
288
  /**
271
289
  * An offset to apply to property values.
272
290
  * Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.
@@ -291,13 +309,14 @@ export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
291
309
  * This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
292
310
  */
293
311
  min?: number | number[];
294
- extensions?: Record<string, any>;
295
- extras?: any;
296
- /** For internal usage */
312
+ extensions?: Record<string, unknown>;
313
+ extras?: unknown;
314
+ /** This is not part of the spec. GLTFLoader loads feature tables data into this property */
297
315
  data?: unknown;
298
316
  };
299
317
 
300
318
  /**
319
+ * Properties conforming to a class, organized as property values stored in textures.
301
320
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json
302
321
  */
303
322
  export type GLTF_EXT_structural_metadata_PropertyTexture = {
@@ -320,11 +339,12 @@ export type GLTF_EXT_structural_metadata_PropertyTexture = {
320
339
  properties?: {
321
340
  [key: string]: GLTFTextureInfoMetadata;
322
341
  };
323
- extensions?: Record<string, any>;
324
- extras?: any;
342
+ extensions?: Record<string, unknown>;
343
+ extras?: unknown;
325
344
  };
326
345
 
327
346
  /**
347
+ * Properties conforming to a class, organized as property values stored in attributes.
328
348
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json
329
349
  */
330
350
  export type GLTF_EXT_structural_metadata_PropertyAttribute = {
@@ -338,13 +358,14 @@ export type GLTF_EXT_structural_metadata_PropertyAttribute = {
338
358
  * Required properties must be included in this dictionary.
339
359
  */
340
360
  properties?: {
341
- [key: string]: any;
361
+ [key: string]: unknown;
342
362
  };
343
- extensions?: Record<string, any>;
344
- extras?: any;
363
+ extensions?: Record<string, unknown>;
364
+ extras?: unknown;
345
365
  };
346
366
 
347
367
  /**
368
+ * Structural metadata about a glTF primitive.
348
369
  * @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
349
370
  */
350
371
  export type GLTF_EXT_structural_metadata_Primitive = {
@@ -352,6 +373,6 @@ export type GLTF_EXT_structural_metadata_Primitive = {
352
373
  propertyTextures?: number[];
353
374
  /** An array of indexes of property attributes in the root `EXT_structural_metadata` object. */
354
375
  propertyAttributes?: number[];
355
- extensions?: Record<string, any>;
356
- extras?: any;
376
+ extensions?: Record<string, unknown>;
377
+ extras?: unknown;
357
378
  };