@loaders.gl/gltf 4.0.0-alpha.6 → 4.0.0-alpha.8

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 (194) hide show
  1. package/dist/dist.min.js +1661 -1459
  2. package/dist/es5/glb-loader.js +2 -2
  3. package/dist/es5/glb-loader.js.map +1 -1
  4. package/dist/es5/glb-writer.js +3 -4
  5. package/dist/es5/glb-writer.js.map +1 -1
  6. package/dist/es5/gltf-loader.js +3 -3
  7. package/dist/es5/gltf-loader.js.map +1 -1
  8. package/dist/es5/index.js +9 -3
  9. package/dist/es5/index.js.map +1 -1
  10. package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
  11. package/dist/es5/lib/api/gltf-scenegraph.js +52 -32
  12. package/dist/es5/lib/api/gltf-scenegraph.js.map +1 -1
  13. package/dist/es5/lib/api/post-process-gltf.js +164 -116
  14. package/dist/es5/lib/api/post-process-gltf.js.map +1 -1
  15. package/dist/es5/lib/encoders/encode-glb.js +1 -1
  16. package/dist/es5/lib/encoders/encode-glb.js.map +1 -1
  17. package/dist/es5/lib/encoders/encode-gltf.js +2 -3
  18. package/dist/es5/lib/encoders/encode-gltf.js.map +1 -1
  19. package/dist/es5/lib/extensions/EXT_meshopt_compression.js +3 -5
  20. package/dist/es5/lib/extensions/EXT_meshopt_compression.js.map +1 -1
  21. package/dist/es5/lib/extensions/EXT_texture_webp.js +2 -3
  22. package/dist/es5/lib/extensions/EXT_texture_webp.js.map +1 -1
  23. package/dist/es5/lib/extensions/KHR_binary_gltf.js +2 -3
  24. package/dist/es5/lib/extensions/KHR_binary_gltf.js.map +1 -1
  25. package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js +6 -5
  26. package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
  27. package/dist/es5/lib/extensions/KHR_texture_basisu.js +3 -4
  28. package/dist/es5/lib/extensions/KHR_texture_basisu.js.map +1 -1
  29. package/dist/es5/lib/extensions/KHR_texture_transform.js +9 -8
  30. package/dist/es5/lib/extensions/KHR_texture_transform.js.map +1 -1
  31. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +195 -17
  32. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  33. package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js +3 -3
  34. package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -1
  35. package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js +3 -3
  36. package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -1
  37. package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js +2 -2
  38. package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -1
  39. package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js.map +1 -1
  40. package/dist/es5/lib/gltf-utils/gltf-utils.js +24 -0
  41. package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -1
  42. package/dist/es5/lib/parsers/parse-glb.js +10 -10
  43. package/dist/es5/lib/parsers/parse-glb.js.map +1 -1
  44. package/dist/es5/lib/parsers/parse-gltf.js +18 -25
  45. package/dist/es5/lib/parsers/parse-gltf.js.map +1 -1
  46. package/dist/es5/lib/types/gltf-json-schema.js.map +1 -1
  47. package/dist/es5/lib/types/gltf-postprocessed-schema.js.map +1 -1
  48. package/dist/es5/lib/types/gltf-types.js.map +1 -1
  49. package/dist/es5/lib/utils/version.js +1 -1
  50. package/dist/esm/glb-loader.js +1 -1
  51. package/dist/esm/glb-loader.js.map +1 -1
  52. package/dist/esm/glb-writer.js +1 -1
  53. package/dist/esm/glb-writer.js.map +1 -1
  54. package/dist/esm/gltf-loader.js +3 -3
  55. package/dist/esm/gltf-loader.js.map +1 -1
  56. package/dist/esm/index.js +2 -1
  57. package/dist/esm/index.js.map +1 -1
  58. package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
  59. package/dist/esm/lib/api/gltf-scenegraph.js +45 -31
  60. package/dist/esm/lib/api/gltf-scenegraph.js.map +1 -1
  61. package/dist/esm/lib/api/post-process-gltf.js +167 -112
  62. package/dist/esm/lib/api/post-process-gltf.js.map +1 -1
  63. package/dist/esm/lib/encoders/encode-glb.js +1 -1
  64. package/dist/esm/lib/encoders/encode-glb.js.map +1 -1
  65. package/dist/esm/lib/encoders/encode-gltf.js +1 -1
  66. package/dist/esm/lib/encoders/encode-gltf.js.map +1 -1
  67. package/dist/esm/lib/extensions/EXT_meshopt_compression.js +2 -3
  68. package/dist/esm/lib/extensions/EXT_meshopt_compression.js.map +1 -1
  69. package/dist/esm/lib/extensions/EXT_texture_webp.js +1 -1
  70. package/dist/esm/lib/extensions/EXT_texture_webp.js.map +1 -1
  71. package/dist/esm/lib/extensions/KHR_binary_gltf.js +1 -1
  72. package/dist/esm/lib/extensions/KHR_binary_gltf.js.map +1 -1
  73. package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js +5 -4
  74. package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js.map +1 -1
  75. package/dist/esm/lib/extensions/KHR_texture_basisu.js +2 -2
  76. package/dist/esm/lib/extensions/KHR_texture_basisu.js.map +1 -1
  77. package/dist/esm/lib/extensions/KHR_texture_transform.js +7 -6
  78. package/dist/esm/lib/extensions/KHR_texture_transform.js.map +1 -1
  79. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +161 -15
  80. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  81. package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js +1 -1
  82. package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -1
  83. package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js +1 -1
  84. package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -1
  85. package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js +1 -1
  86. package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -1
  87. package/dist/esm/lib/gltf-utils/gltf-attribute-utils.js.map +1 -1
  88. package/dist/esm/lib/gltf-utils/gltf-utils.js +20 -0
  89. package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -1
  90. package/dist/esm/lib/parsers/parse-glb.js +10 -10
  91. package/dist/esm/lib/parsers/parse-glb.js.map +1 -1
  92. package/dist/esm/lib/parsers/parse-gltf.js +7 -12
  93. package/dist/esm/lib/parsers/parse-gltf.js.map +1 -1
  94. package/dist/esm/lib/types/gltf-json-schema.js.map +1 -1
  95. package/dist/esm/lib/types/gltf-postprocessed-schema.js.map +1 -1
  96. package/dist/esm/lib/types/gltf-types.js.map +1 -1
  97. package/dist/esm/lib/utils/version.js +1 -1
  98. package/dist/glb-loader.d.ts +2 -2
  99. package/dist/glb-loader.js +2 -5
  100. package/dist/glb-writer.d.ts.map +1 -1
  101. package/dist/glb-writer.js +4 -6
  102. package/dist/gltf-loader.d.ts +5 -5
  103. package/dist/gltf-loader.d.ts.map +1 -1
  104. package/dist/gltf-loader.js +3 -3
  105. package/dist/index.d.ts +8 -5
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +12 -5
  108. package/dist/lib/api/gltf-extensions.d.ts +1 -1
  109. package/dist/lib/api/gltf-extensions.d.ts.map +1 -1
  110. package/dist/lib/api/gltf-extensions.js +1 -1
  111. package/dist/lib/api/gltf-scenegraph.d.ts +8 -5
  112. package/dist/lib/api/gltf-scenegraph.d.ts.map +1 -1
  113. package/dist/lib/api/gltf-scenegraph.js +47 -33
  114. package/dist/lib/api/post-process-gltf.d.ts +4 -1
  115. package/dist/lib/api/post-process-gltf.d.ts.map +1 -1
  116. package/dist/lib/api/post-process-gltf.js +186 -123
  117. package/dist/lib/encoders/encode-glb.d.ts +13 -1
  118. package/dist/lib/encoders/encode-glb.d.ts.map +1 -1
  119. package/dist/lib/encoders/encode-glb.js +15 -4
  120. package/dist/lib/encoders/encode-gltf.js +2 -5
  121. package/dist/lib/extensions/EXT_meshopt_compression.d.ts +1 -1
  122. package/dist/lib/extensions/EXT_meshopt_compression.d.ts.map +1 -1
  123. package/dist/lib/extensions/EXT_meshopt_compression.js +3 -7
  124. package/dist/lib/extensions/EXT_texture_webp.d.ts +1 -1
  125. package/dist/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
  126. package/dist/lib/extensions/EXT_texture_webp.js +2 -5
  127. package/dist/lib/extensions/KHR_binary_gltf.d.ts +1 -1
  128. package/dist/lib/extensions/KHR_binary_gltf.d.ts.map +1 -1
  129. package/dist/lib/extensions/KHR_binary_gltf.js +2 -5
  130. package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts +1 -1
  131. package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts.map +1 -1
  132. package/dist/lib/extensions/KHR_draco_mesh_compression.js +5 -8
  133. package/dist/lib/extensions/KHR_texture_basisu.d.ts +1 -1
  134. package/dist/lib/extensions/KHR_texture_basisu.d.ts.map +1 -1
  135. package/dist/lib/extensions/KHR_texture_basisu.js +3 -6
  136. package/dist/lib/extensions/KHR_texture_transform.d.ts.map +1 -1
  137. package/dist/lib/extensions/KHR_texture_transform.js +7 -10
  138. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +3 -2
  139. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
  140. package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +195 -23
  141. package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts +1 -1
  142. package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts.map +1 -1
  143. package/dist/lib/extensions/deprecated/KHR_lights_punctual.js +3 -6
  144. package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts +1 -1
  145. package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts.map +1 -1
  146. package/dist/lib/extensions/deprecated/KHR_materials_unlit.js +3 -6
  147. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts +1 -1
  148. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts.map +1 -1
  149. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js +2 -5
  150. package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts +1 -1
  151. package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts.map +1 -1
  152. package/dist/lib/gltf-utils/gltf-utils.d.ts +7 -0
  153. package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
  154. package/dist/lib/gltf-utils/gltf-utils.js +28 -1
  155. package/dist/lib/parsers/parse-glb.d.ts +15 -3
  156. package/dist/lib/parsers/parse-glb.d.ts.map +1 -1
  157. package/dist/lib/parsers/parse-glb.js +43 -18
  158. package/dist/lib/parsers/parse-gltf.d.ts +8 -4
  159. package/dist/lib/parsers/parse-gltf.d.ts.map +1 -1
  160. package/dist/lib/parsers/parse-gltf.js +17 -41
  161. package/dist/lib/types/gltf-json-schema.d.ts +153 -139
  162. package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
  163. package/dist/lib/types/gltf-postprocessed-schema.d.ts +174 -209
  164. package/dist/lib/types/gltf-postprocessed-schema.d.ts.map +1 -1
  165. package/dist/lib/types/gltf-postprocessed-schema.js +1 -1
  166. package/dist/lib/types/gltf-types.d.ts +18 -6
  167. package/dist/lib/types/gltf-types.d.ts.map +1 -1
  168. package/package.json +6 -6
  169. package/src/glb-loader.ts +3 -3
  170. package/src/glb-writer.ts +3 -1
  171. package/src/gltf-loader.ts +12 -8
  172. package/src/index.ts +32 -13
  173. package/src/lib/api/gltf-extensions.ts +1 -1
  174. package/src/lib/api/gltf-scenegraph.ts +60 -41
  175. package/src/lib/api/post-process-gltf.ts +275 -150
  176. package/src/lib/encoders/encode-glb.ts +15 -5
  177. package/src/lib/encoders/encode-gltf.ts +1 -1
  178. package/src/lib/extensions/EXT_meshopt_compression.ts +4 -6
  179. package/src/lib/extensions/EXT_texture_webp.ts +2 -2
  180. package/src/lib/extensions/KHR_binary_gltf.ts +2 -2
  181. package/src/lib/extensions/KHR_draco_mesh_compression.ts +7 -7
  182. package/src/lib/extensions/KHR_texture_basisu.ts +3 -3
  183. package/src/lib/extensions/KHR_texture_transform.ts +22 -19
  184. package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +264 -23
  185. package/src/lib/extensions/deprecated/KHR_lights_punctual.ts +2 -2
  186. package/src/lib/extensions/deprecated/KHR_materials_unlit.ts +2 -2
  187. package/src/lib/extensions/deprecated/KHR_techniques_webgl.ts +2 -2
  188. package/src/lib/gltf-utils/gltf-attribute-utils.ts +1 -1
  189. package/src/lib/gltf-utils/gltf-utils.ts +31 -0
  190. package/src/lib/parsers/parse-glb.ts +50 -24
  191. package/src/lib/parsers/parse-gltf.ts +26 -25
  192. package/src/lib/types/gltf-json-schema.ts +168 -138
  193. package/src/lib/types/gltf-postprocessed-schema.ts +289 -212
  194. package/src/lib/types/gltf-types.ts +35 -59
@@ -1,8 +1,10 @@
1
+ import type { TypedArray } from '@loaders.gl/loader-utils';
1
2
  export type GlTfId = number;
2
3
  /**
3
4
  * Indices of those attributes that deviate from their initialization value.
4
5
  */
5
- export interface AccessorSparseIndices {
6
+ export type AccessorSparseIndices = {
7
+ id: string;
6
8
  /**
7
9
  * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
8
10
  */
@@ -17,12 +19,12 @@ export interface AccessorSparseIndices {
17
19
  componentType: 5121 | 5123 | 5125 | number;
18
20
  extensions?: any;
19
21
  extras?: any;
20
- [k: string]: any;
21
- }
22
+ };
22
23
  /**
23
24
  * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.
24
25
  */
25
- export interface AccessorSparseValues {
26
+ export type AccessorSparseValues = {
27
+ id: string;
26
28
  /**
27
29
  * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
28
30
  */
@@ -33,12 +35,12 @@ export interface AccessorSparseValues {
33
35
  byteOffset?: number;
34
36
  extensions?: any;
35
37
  extras?: any;
36
- [k: string]: any;
37
- }
38
+ };
38
39
  /**
39
40
  * Sparse storage of attributes that deviate from their initialization value.
40
41
  */
41
- export interface AccessorSparse {
42
+ export type AccessorSparse = {
43
+ id: string;
42
44
  /**
43
45
  * Number of entries stored in the sparse array.
44
46
  */
@@ -53,16 +55,20 @@ export interface AccessorSparse {
53
55
  values: AccessorSparseValues;
54
56
  extensions?: any;
55
57
  extras?: any;
56
- [k: string]: any;
57
- }
58
+ };
58
59
  /**
59
60
  * 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.
60
61
  */
61
- export interface Accessor {
62
+ export type GLTFAccessorPostprocessed = {
63
+ id: string;
64
+ components: number;
65
+ bytesPerComponent: number;
66
+ bytesPerElement: number;
67
+ value: TypedArray;
62
68
  /**
63
69
  * The index of the bufferView.
64
70
  */
65
- bufferView?: GlTfId;
71
+ bufferView?: GLTFBufferViewPostprocessed;
66
72
  /**
67
73
  * The offset relative to the start of the bufferView in bytes.
68
74
  */
@@ -98,12 +104,12 @@ export interface Accessor {
98
104
  name?: any;
99
105
  extensions?: any;
100
106
  extras?: any;
101
- [k: string]: any;
102
- }
107
+ };
103
108
  /**
104
109
  * The index of the node and TRS property that an animation channel targets.
105
110
  */
106
- export interface AnimationChannelTarget {
111
+ export type AnimationChannelTarget = {
112
+ id: string;
107
113
  /**
108
114
  * The index of the node to target.
109
115
  */
@@ -114,12 +120,12 @@ export interface AnimationChannelTarget {
114
120
  path: 'translation' | 'rotation' | 'scale' | 'weights' | string;
115
121
  extensions?: any;
116
122
  extras?: any;
117
- [k: string]: any;
118
- }
123
+ };
119
124
  /**
120
125
  * Targets an animation's sampler at a node's property.
121
126
  */
122
- export interface AnimationChannel {
127
+ export type AnimationChannel = {
128
+ id: string;
123
129
  /**
124
130
  * The index of a sampler in this animation used to compute the value for the target.
125
131
  */
@@ -130,12 +136,12 @@ export interface AnimationChannel {
130
136
  target: AnimationChannelTarget;
131
137
  extensions?: any;
132
138
  extras?: any;
133
- [k: string]: any;
134
- }
139
+ };
135
140
  /**
136
141
  * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
137
142
  */
138
- export interface AnimationSampler {
143
+ export type AnimationSampler = {
144
+ id: string;
139
145
  /**
140
146
  * The index of an accessor containing keyframe input values, e.g., time.
141
147
  */
@@ -150,29 +156,24 @@ export interface AnimationSampler {
150
156
  output: GlTfId;
151
157
  extensions?: any;
152
158
  extras?: any;
153
- [k: string]: any;
154
- }
159
+ };
155
160
  /**
156
161
  * A keyframe animation.
157
162
  */
158
- export interface Animation {
159
- /**
160
- * 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.
161
- */
163
+ export type GLTFAnimationPostprocessed = {
164
+ id: string;
165
+ /** 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. */
162
166
  channels: AnimationChannel[];
163
- /**
164
- * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
165
- */
167
+ /** An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target). */
166
168
  samplers: AnimationSampler[];
167
169
  name?: any;
168
170
  extensions?: any;
169
171
  extras?: any;
170
- [k: string]: any;
171
- }
172
+ };
172
173
  /**
173
174
  * Metadata about the glTF asset.
174
175
  */
175
- export interface Asset {
176
+ export type Asset = {
176
177
  /**
177
178
  * A copyright message suitable for display to credit the content creator.
178
179
  */
@@ -191,34 +192,32 @@ export interface Asset {
191
192
  minVersion?: string;
192
193
  extensions?: any;
193
194
  extras?: any;
194
- [k: string]: any;
195
- }
195
+ };
196
196
  /**
197
197
  * A buffer points to binary geometry, animation, or skins.
198
198
  */
199
- export interface Buffer {
200
- /**
201
- * The uri of the buffer.
202
- */
203
- uri?: string;
204
- /**
205
- * The length of the buffer in bytes.
206
- */
199
+ export type GLTFBufferPostprocessed = {
200
+ id?: string;
201
+ arrayBuffer: ArrayBuffer;
202
+ byteOffset: number;
203
+ /** The length of the buffer in bytes. */
207
204
  byteLength: number;
205
+ /** The uri of the buffer. */
206
+ uri?: string;
208
207
  name?: any;
209
208
  extensions?: any;
210
209
  extras?: any;
211
- [k: string]: any;
212
- }
210
+ };
213
211
  /**
214
212
  * A view into a buffer generally representing a subset of the buffer.
215
213
  */
216
- export interface BufferView {
214
+ export type GLTFBufferViewPostprocessed = {
217
215
  id: string;
216
+ data: Uint8Array;
218
217
  /**
219
218
  * The index of the buffer.
220
219
  */
221
- buffer: ArrayBuffer;
220
+ buffer: GLTFBufferPostprocessed;
222
221
  /**
223
222
  * The offset into the buffer in bytes.
224
223
  */
@@ -238,12 +237,12 @@ export interface BufferView {
238
237
  name?: any;
239
238
  extensions?: any;
240
239
  extras?: any;
241
- [k: string]: any;
242
- }
240
+ };
243
241
  /**
244
242
  * An orthographic camera containing properties to create an orthographic projection matrix.
245
243
  */
246
- export interface CameraOrthographic {
244
+ export type CameraOrthographic = {
245
+ id: string;
247
246
  /**
248
247
  * The floating-point horizontal magnification of the view. Must not be zero.
249
248
  */
@@ -262,12 +261,12 @@ export interface CameraOrthographic {
262
261
  znear: number;
263
262
  extensions?: any;
264
263
  extras?: any;
265
- [k: string]: any;
266
- }
264
+ };
267
265
  /**
268
266
  * A perspective camera containing properties to create a perspective projection matrix.
269
267
  */
270
- export interface CameraPerspective {
268
+ export type CameraPerspective = {
269
+ id: string;
271
270
  /**
272
271
  * The floating-point aspect ratio of the field of view.
273
272
  */
@@ -286,12 +285,11 @@ export interface CameraPerspective {
286
285
  znear: number;
287
286
  extensions?: any;
288
287
  extras?: any;
289
- [k: string]: any;
290
- }
288
+ };
291
289
  /**
292
290
  * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.
293
291
  */
294
- export interface Camera {
292
+ export type GLTFCameraPostprocessed = {
295
293
  /**
296
294
  * An orthographic camera containing properties to create an orthographic projection matrix.
297
295
  */
@@ -307,12 +305,24 @@ export interface Camera {
307
305
  name?: any;
308
306
  extensions?: any;
309
307
  extras?: any;
310
- [k: string]: any;
311
- }
308
+ };
312
309
  /**
313
- * Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.
310
+ * GLTFImagePostprocessed data used to create a texture.
311
+ * GLTFImagePostprocessed can be referenced by URI or `bufferView` index.
312
+ * `mimeType` is required in the latter case.
313
+ * @todo GLTF image postprocessing
314
314
  */
315
- export interface Image {
315
+ export type GLTFImagePostprocessed = {
316
+ id: string;
317
+ image: {
318
+ data: Uint8Array;
319
+ compressed?: boolean;
320
+ height?: number;
321
+ width?: number;
322
+ components?: number;
323
+ mimeType?: string;
324
+ };
325
+ compressed?: boolean;
316
326
  /**
317
327
  * The uri of the image.
318
328
  */
@@ -324,16 +334,17 @@ export interface Image {
324
334
  /**
325
335
  * The index of the bufferView that contains the image. Use this instead of the image's uri property.
326
336
  */
327
- bufferView?: BufferView;
337
+ bufferView?: GLTFBufferViewPostprocessed;
328
338
  name?: any;
329
339
  extensions?: any;
330
340
  extras?: any;
331
- [k: string]: any;
332
- }
341
+ };
333
342
  /**
334
343
  * Reference to a texture.
335
344
  */
336
- export interface TextureInfo {
345
+ export type GLTFTextureInfoPostprocessed = {
346
+ id: string;
347
+ texture: GLTFTexturePostprocessed;
337
348
  /**
338
349
  * The index of the texture.
339
350
  */
@@ -344,12 +355,12 @@ export interface TextureInfo {
344
355
  texCoord?: number;
345
356
  extensions?: any;
346
357
  extras?: any;
347
- [k: string]: any;
348
- }
358
+ };
349
359
  /**
350
360
  * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.
351
361
  */
352
- export interface MaterialPbrMetallicRoughness {
362
+ export type MaterialPbrMetallicRoughnessPostprocessed = {
363
+ id: string;
353
364
  /**
354
365
  * The material's base color factor.
355
366
  */
@@ -357,7 +368,7 @@ export interface MaterialPbrMetallicRoughness {
357
368
  /**
358
369
  * The base color texture.
359
370
  */
360
- baseColorTexture?: TextureInfo;
371
+ baseColorTexture?: GLTFTextureInfoPostprocessed;
361
372
  /**
362
373
  * The metalness of the material.
363
374
  */
@@ -369,12 +380,13 @@ export interface MaterialPbrMetallicRoughness {
369
380
  /**
370
381
  * The metallic-roughness texture.
371
382
  */
372
- metallicRoughnessTexture?: TextureInfo;
383
+ metallicRoughnessTexture?: GLTFTextureInfoPostprocessed;
373
384
  extensions?: any;
374
385
  extras?: any;
375
- [k: string]: any;
376
- }
377
- export interface MaterialNormalTextureInfo {
386
+ };
387
+ export type MaterialNormalTextureInfoPostprocessed = {
388
+ id: string;
389
+ texture: GLTFTexturePostprocessed;
378
390
  index?: any;
379
391
  texCoord?: any;
380
392
  /**
@@ -383,9 +395,10 @@ export interface MaterialNormalTextureInfo {
383
395
  scale?: number;
384
396
  extensions?: any;
385
397
  extras?: any;
386
- [k: string]: any;
387
- }
388
- export interface MaterialOcclusionTextureInfo {
398
+ };
399
+ export type MaterialOcclusionTextureInfoPostprocessed = {
400
+ id: string;
401
+ texture: GLTFTexturePostprocessed;
389
402
  index?: any;
390
403
  texCoord?: any;
391
404
  /**
@@ -394,31 +407,31 @@ export interface MaterialOcclusionTextureInfo {
394
407
  strength?: number;
395
408
  extensions?: any;
396
409
  extras?: any;
397
- [k: string]: any;
398
- }
410
+ };
399
411
  /**
400
412
  * The material appearance of a primitive.
401
413
  */
402
- export interface Material {
414
+ export type GLTFMaterialPostprocessed = {
415
+ id: string;
403
416
  name?: any;
404
417
  extensions?: any;
405
418
  extras?: any;
406
419
  /**
407
420
  * 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.
408
421
  */
409
- pbrMetallicRoughness?: MaterialPbrMetallicRoughness;
422
+ pbrMetallicRoughness?: MaterialPbrMetallicRoughnessPostprocessed;
410
423
  /**
411
424
  * The normal map texture.
412
425
  */
413
- normalTexture?: MaterialNormalTextureInfo;
426
+ normalTexture?: MaterialNormalTextureInfoPostprocessed;
414
427
  /**
415
428
  * The occlusion map texture.
416
429
  */
417
- occlusionTexture?: MaterialOcclusionTextureInfo;
430
+ occlusionTexture?: MaterialOcclusionTextureInfoPostprocessed;
418
431
  /**
419
432
  * The emissive map texture.
420
433
  */
421
- emissiveTexture?: TextureInfo;
434
+ emissiveTexture?: GLTFTextureInfoPostprocessed;
422
435
  /**
423
436
  * The emissive color of the material.
424
437
  */
@@ -435,48 +448,43 @@ export interface Material {
435
448
  * Specifies whether the material is double sided.
436
449
  */
437
450
  doubleSided?: boolean;
438
- [k: string]: any;
439
- }
451
+ };
440
452
  /**
441
453
  * Geometry to be rendered with the given material.
442
454
  */
443
- export interface MeshPrimitive {
455
+ export type GLTFMeshPrimitivePostprocessed = {
444
456
  /**
445
457
  * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.
446
458
  */
447
459
  attributes: {
448
- [k: string]: Accessor;
460
+ [k: string]: GLTFAccessorPostprocessed;
449
461
  };
450
462
  /**
451
463
  * The index of the accessor that contains the indices.
452
464
  */
453
- indices?: Accessor;
465
+ indices?: GLTFAccessorPostprocessed;
454
466
  /**
455
467
  * The index of the material to apply to this primitive when rendering.
456
468
  */
457
- material?: Material;
469
+ material?: GLTFMaterialPostprocessed;
458
470
  /**
459
471
  * The type of primitives to render.
460
472
  */
461
473
  mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;
462
- /**
463
- * 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.
464
- */
474
+ /** 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. */
465
475
  targets?: {
466
476
  [k: string]: GlTfId;
467
477
  }[];
468
478
  extensions?: any;
469
479
  extras?: any;
470
- [k: string]: any;
471
- }
480
+ };
472
481
  /**
473
482
  * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.
474
483
  */
475
- export interface Mesh {
476
- /**
477
- * An array of primitives, each defining geometry to be rendered with a material.
478
- */
479
- primitives: MeshPrimitive[];
484
+ export type GLTFMeshPostprocessed = {
485
+ id: string;
486
+ /** An array of primitives, each defining geometry to be rendered with a material. */
487
+ primitives: GLTFMeshPrimitivePostprocessed[];
480
488
  /**
481
489
  * Array of weights to be applied to the Morph Targets.
482
490
  */
@@ -484,24 +492,24 @@ export interface Mesh {
484
492
  name?: any;
485
493
  extensions?: any;
486
494
  extras?: any;
487
- [k: string]: any;
488
- }
495
+ };
489
496
  /**
490
497
  * 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.
491
498
  */
492
- export interface Node {
499
+ export type GLTFNodePostprocessed = {
500
+ id: string;
493
501
  /**
494
502
  * The index of the camera referenced by this node.
495
503
  */
496
- camera?: GlTfId;
504
+ camera?: GLTFCameraPostprocessed;
497
505
  /**
498
506
  * The indices of this node's children.
499
507
  */
500
- children?: Node[];
508
+ children?: GLTFNodePostprocessed[];
501
509
  /**
502
510
  * The index of the skin referenced by this node.
503
511
  */
504
- skin?: GlTfId;
512
+ skin?: GLTFSkinPostprocessed;
505
513
  /**
506
514
  * A floating-point 4x4 transformation matrix stored in column-major order.
507
515
  */
@@ -509,7 +517,7 @@ export interface Node {
509
517
  /**
510
518
  * The index of the mesh in this node.
511
519
  */
512
- mesh?: Mesh;
520
+ mesh?: GLTFMeshPostprocessed;
513
521
  /**
514
522
  * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
515
523
  */
@@ -529,54 +537,46 @@ export interface Node {
529
537
  name?: any;
530
538
  extensions?: any;
531
539
  extras?: any;
532
- [k: string]: any;
533
- }
540
+ };
534
541
  /**
535
- * Texture sampler properties for filtering and wrapping modes.
542
+ * GLTFTexturePostprocessed sampler properties for filtering and wrapping modes.
536
543
  */
537
- export interface Sampler {
538
- /**
539
- * Magnification filter.
540
- */
544
+ export type GLTFSamplerPostprocessed = {
545
+ id: string;
546
+ /** WebGL parameters */
547
+ parameters: Record<string, number>;
548
+ /** Magnification filter. */
541
549
  magFilter?: 9728 | 9729 | number;
542
- /**
543
- * Minification filter.
544
- */
550
+ /** Minification filter. */
545
551
  minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;
546
- /**
547
- * s wrapping mode.
548
- */
552
+ /** s wrapping mode. */
549
553
  wrapS?: 33071 | 33648 | 10497 | number;
550
- /**
551
- * t wrapping mode.
552
- */
554
+ /** t wrapping mode. */
553
555
  wrapT?: 33071 | 33648 | 10497 | number;
554
556
  name?: any;
555
557
  extensions?: any;
556
558
  extras?: any;
557
- [k: string]: any;
558
- }
559
+ };
559
560
  /**
560
561
  * The root nodes of a scene.
561
562
  */
562
- export interface Scene {
563
- /**
564
- * The indices of each root node.
565
- */
566
- nodes?: Node[];
563
+ export type GLTFScenePostprocessed = {
564
+ id: string;
565
+ /** The indices of each root node. */
566
+ nodes?: GLTFNodePostprocessed[];
567
567
  name?: any;
568
568
  extensions?: any;
569
569
  extras?: any;
570
- [k: string]: any;
571
- }
570
+ };
572
571
  /**
573
572
  * Joints and matrices defining a skin.
574
573
  */
575
- export interface Skin {
574
+ export type GLTFSkinPostprocessed = {
575
+ id: string;
576
576
  /**
577
577
  * 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.
578
578
  */
579
- inverseBindMatrices?: GlTfId;
579
+ inverseBindMatrices?: GLTFAccessorPostprocessed;
580
580
  /**
581
581
  * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.
582
582
  */
@@ -588,99 +588,64 @@ export interface Skin {
588
588
  name?: any;
589
589
  extensions?: any;
590
590
  extras?: any;
591
- [k: string]: any;
592
- }
591
+ };
593
592
  /**
594
593
  * A texture and its sampler.
595
594
  */
596
- export interface Texture {
595
+ export type GLTFTexturePostprocessed = {
596
+ id: string;
597
597
  /**
598
598
  * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.
599
599
  */
600
- sampler?: GlTfId;
600
+ sampler?: GLTFSamplerPostprocessed;
601
601
  /**
602
602
  * The index of the image used by this texture.
603
603
  */
604
- source?: Image;
604
+ source?: GLTFImagePostprocessed;
605
605
  name?: any;
606
606
  extensions?: any;
607
607
  extras?: any;
608
- [k: string]: any;
609
- }
608
+ };
610
609
  /**
611
610
  * The root object for a glTF asset.
612
611
  */
613
- export interface GLTF {
614
- /**
615
- * Names of glTF extensions used somewhere in this asset.
616
- */
617
- extensionsUsed?: string[];
618
- /**
619
- * Names of glTF extensions required to properly load this asset.
620
- */
621
- extensionsRequired?: string[];
622
- /**
623
- * An array of accessors.
624
- */
625
- accessors?: Accessor[];
626
- /**
627
- * An array of keyframe animations.
628
- */
629
- animations?: Animation[];
630
- /**
631
- * Metadata about the glTF asset.
632
- */
612
+ export type GLTFPostprocessed = {
613
+ id: string;
614
+ /** Names of glTF extensions used somewhere in this asset. */
615
+ extensionsUsed: string[];
616
+ /** Names of glTF extensions required to properly load this asset. */
617
+ extensionsRequired: string[];
618
+ /** An array of accessors. */
619
+ accessors: GLTFAccessorPostprocessed[];
620
+ /** An array of keyframe animations. */
621
+ animations: GLTFAnimationPostprocessed[];
622
+ /** Metadata about the glTF asset. */
633
623
  asset: Asset;
634
- /**
635
- * An array of buffers.
636
- */
637
- buffers?: Buffer[];
638
- /**
639
- * An array of bufferViews.
640
- */
641
- bufferViews?: BufferView[];
642
- /**
643
- * An array of cameras.
644
- */
645
- cameras?: Camera[];
646
- /**
647
- * An array of images.
648
- */
649
- images?: Image[];
650
- /**
651
- * An array of materials.
652
- */
653
- materials?: Material[];
654
- /**
655
- * An array of meshes.
656
- */
657
- meshes?: Mesh[];
658
- /**
659
- * An array of nodes.
660
- */
661
- nodes?: Node[];
662
- /**
663
- * An array of samplers.
664
- */
665
- samplers?: Sampler[];
666
- /**
667
- * The index of the default scene.
668
- */
669
- scene?: Scene;
670
- /**
671
- * An array of scenes.
672
- */
673
- scenes?: Scene[];
674
- /**
675
- * An array of skins.
676
- */
677
- skins?: Skin[];
678
- /**
679
- * An array of textures.
680
- */
681
- textures?: Texture[];
682
- extensions?: any;
624
+ /** An array of buffers. */
625
+ buffers: GLTFBufferPostprocessed[];
626
+ /** An array of bufferViews. */
627
+ bufferViews: GLTFBufferViewPostprocessed[];
628
+ /** An array of cameras. */
629
+ cameras: GLTFCameraPostprocessed[];
630
+ /** An array of images. */
631
+ images: GLTFImagePostprocessed[];
632
+ /** An array of materials. */
633
+ materials: GLTFMaterialPostprocessed[];
634
+ /** An array of meshes. */
635
+ meshes: GLTFMeshPostprocessed[];
636
+ /** An array of nodes. */
637
+ nodes: GLTFNodePostprocessed[];
638
+ /** An array of samplers. */
639
+ samplers: GLTFSamplerPostprocessed[];
640
+ /** The index of the default scene. */
641
+ scene?: GLTFScenePostprocessed;
642
+ /** An array of scenes. */
643
+ scenes: GLTFScenePostprocessed[];
644
+ /** An array of skins. */
645
+ skins: GLTFSkinPostprocessed[];
646
+ /** An array of textures. */
647
+ textures: GLTFTexturePostprocessed[];
648
+ extensions?: Record<string, Record<string, any>>;
683
649
  extras?: any;
684
- [k: string]: any;
685
- }
650
+ };
686
651
  //# sourceMappingURL=gltf-postprocessed-schema.d.ts.map