1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/// Khronos GLB binary container magic (`"glTF"` little-endian `0x46546C67`).
pub const GLB_MAGIC: u32 = 0x4654_6C67;
/// Supported Khronos GLB binary specification version (`2`).
pub const GLB_VERSION_2: u32 = 2;
/// Khronos GLB JSON chunk type tag (`"JSON"` little-endian `0x4E4F534A`).
pub const GLB_CHUNK_JSON: u32 = 0x4E4F_534A;
/// Khronos GLB binary buffer chunk type tag (`"BIN\0"` little-endian `0x004E4942`).
pub const GLB_CHUNK_BIN: u32 = 0x004E_4942;
/// glTF 2.0 component type constant for signed 8-bit integer (`BYTE`).
pub const GLTF_COMP_I8: u32 = 5120;
/// glTF 2.0 component type constant for unsigned 8-bit integer (`UNSIGNED_BYTE`).
pub const GLTF_COMP_U8: u32 = 5121;
/// glTF 2.0 component type constant for signed 16-bit integer (`SHORT`).
pub const GLTF_COMP_I16: u32 = 5122;
/// glTF 2.0 component type constant for unsigned 16-bit integer (`UNSIGNED_SHORT`).
pub const GLTF_COMP_U16: u32 = 5123;
/// glTF 2.0 component type constant for unsigned 32-bit integer (`UNSIGNED_INT`).
pub const GLTF_COMP_U32: u32 = 5125;
/// glTF 2.0 component type constant for 32-bit IEEE float (`FLOAT`).
pub const GLTF_COMP_F32: u32 = 5126;
/// glTF 2.0 primitive mode for triangle list.
pub const GLTF_MODE_TRIANGLES: u32 = 4;
/// glTF 2.0 primitive mode for triangle strip.
pub const GLTF_MODE_TRIANGLE_STRIP: u32 = 5;
/// glTF 2.0 primitive mode for triangle fan.
pub const GLTF_MODE_TRIANGLE_FAN: u32 = 6;
/// Default imported scene name when glTF omits scene and generator labels.
pub const GLTF_DEFAULT_SCENE_NAME: &str = "gltf_scene";
/// Prefix matching RFC 2397 inline data URIs.
pub const GLTF_DATA_URI_PREFIX: &str = "data:";
/// Delimiter marking base64 payload inside a data URI.
pub const GLTF_BASE64_MARKER: &str = ";base64,";
/// glTF extension name for `KHR_texture_transform`.
pub const GLTF_EXT_TEX_TRANSFORM: &str = "KHR_texture_transform";
/// glTF extension name for `KHR_materials_emissive_strength`.
pub const GLTF_EXT_EMISSIVE_STRENGTH: &str = "KHR_materials_emissive_strength";
/// glTF extension name for `KHR_materials_ior`.
pub const GLTF_EXT_IOR: &str = "KHR_materials_ior";
/// glTF extension name for `KHR_materials_specular`.
pub const GLTF_EXT_SPECULAR: &str = "KHR_materials_specular";
/// glTF extension name for `KHR_materials_clearcoat`.
pub const GLTF_EXT_CLEARCOAT: &str = "KHR_materials_clearcoat";
/// glTF extension name for `KHR_materials_transmission`.
pub const GLTF_EXT_TRANSMISSION: &str = "KHR_materials_transmission";
/// glTF extension name for `KHR_materials_volume`.
pub const GLTF_EXT_VOLUME: &str = "KHR_materials_volume";
/// glTF extension name for `KHR_materials_sheen`.
pub const GLTF_EXT_SHEEN: &str = "KHR_materials_sheen";
/// glTF extension name for `KHR_materials_unlit`.
pub const GLTF_EXT_UNLIT: &str = "KHR_materials_unlit";
/// glTF extension name for `KHR_lights_punctual`.
pub const GLTF_EXT_LIGHTS_PUNCTUAL: &str = "KHR_lights_punctual";
/// glTF JSON key for `asset`.
pub const KEY_ASSET: &str = "asset";
/// glTF JSON key for `generator`.
pub const KEY_GENERATOR: &str = "generator";
/// glTF JSON key for `name`.
pub const KEY_NAME: &str = "name";
/// glTF JSON key for `buffers`.
pub const KEY_BUFFERS: &str = "buffers";
/// glTF JSON key for `bufferViews`.
pub const KEY_BUFFER_VIEWS: &str = "bufferViews";
/// glTF JSON key for `buffer`.
pub const KEY_BUFFER: &str = "buffer";
/// glTF JSON key for `bufferView`.
pub const KEY_BUFFER_VIEW: &str = "bufferView";
/// glTF JSON key for `byteOffset`.
pub const KEY_BYTE_OFFSET: &str = "byteOffset";
/// glTF JSON key for `byteLength`.
pub const KEY_BYTE_LENGTH: &str = "byteLength";
/// glTF JSON key for `byteStride`.
pub const KEY_BYTE_STRIDE: &str = "byteStride";
/// glTF JSON key for `accessors`.
pub const KEY_ACCESSORS: &str = "accessors";
/// glTF JSON key for `componentType`.
pub const KEY_COMPONENT_TYPE: &str = "componentType";
/// glTF JSON key for `normalized`.
pub const KEY_NORMALIZED: &str = "normalized";
/// glTF JSON key for `count`.
pub const KEY_COUNT: &str = "count";
/// glTF JSON key for `type`.
pub const KEY_TYPE: &str = "type";
/// glTF JSON key for `sparse`.
pub const KEY_SPARSE: &str = "sparse";
/// glTF JSON key for `indices`.
pub const KEY_INDICES: &str = "indices";
/// glTF JSON key for `values`.
pub const KEY_VALUES: &str = "values";
/// glTF JSON key for `images`.
pub const KEY_IMAGES: &str = "images";
/// glTF JSON key for `samplers`.
pub const KEY_SAMPLERS: &str = "samplers";
/// glTF JSON key for `textures`.
pub const KEY_TEXTURES: &str = "textures";
/// glTF JSON key for `source`.
pub const KEY_SOURCE: &str = "source";
/// glTF JSON key for `sampler`.
pub const KEY_SAMPLER: &str = "sampler";
/// glTF JSON key for `magFilter`.
pub const KEY_MAG_FILTER: &str = "magFilter";
/// glTF JSON key for `minFilter`.
pub const KEY_MIN_FILTER: &str = "minFilter";
/// glTF JSON key for `wrapS`.
pub const KEY_WRAP_S: &str = "wrapS";
/// glTF JSON key for `wrapT`.
pub const KEY_WRAP_T: &str = "wrapT";
/// glTF JSON key for `materials`.
pub const KEY_MATERIALS: &str = "materials";
/// glTF JSON key for `pbrMetallicRoughness`.
pub const KEY_PBR_MR: &str = "pbrMetallicRoughness";
/// glTF JSON key for `baseColorFactor`.
pub const KEY_BASE_COLOR_FACTOR: &str = "baseColorFactor";
/// glTF JSON key for `baseColorTexture`.
pub const KEY_BASE_COLOR_TEX: &str = "baseColorTexture";
/// glTF JSON key for `metallicFactor`.
pub const KEY_METALLIC_FACTOR: &str = "metallicFactor";
/// glTF JSON key for `roughnessFactor`.
pub const KEY_ROUGHNESS_FACTOR: &str = "roughnessFactor";
/// glTF JSON key for `metallicRoughnessTexture`.
pub const KEY_MR_TEX: &str = "metallicRoughnessTexture";
/// glTF JSON key for `normalTexture`.
pub const KEY_NORMAL_TEX: &str = "normalTexture";
/// glTF JSON key for `occlusionTexture`.
pub const KEY_OCCLUSION_TEX: &str = "occlusionTexture";
/// glTF JSON key for `emissiveFactor`.
pub const KEY_EMISSIVE_FACTOR: &str = "emissiveFactor";
/// glTF JSON key for `emissiveTexture`.
pub const KEY_EMISSIVE_TEX: &str = "emissiveTexture";
/// glTF JSON key for `alphaMode`.
pub const KEY_ALPHA_MODE: &str = "alphaMode";
/// glTF JSON key for `alphaCutoff`.
pub const KEY_ALPHA_CUTOFF: &str = "alphaCutoff";
/// glTF JSON key for `doubleSided`.
pub const KEY_DOUBLE_SIDED: &str = "doubleSided";
/// glTF JSON key for `extensions`.
pub const KEY_EXTENSIONS: &str = "extensions";
/// glTF JSON key for `extras`.
pub const KEY_EXTRAS: &str = "extras";
/// glTF JSON key for `index`.
pub const KEY_INDEX: &str = "index";
/// glTF JSON key for `texCoord`.
pub const KEY_TEX_COORD: &str = "texCoord";
/// glTF JSON key for `scale`.
pub const KEY_SCALE: &str = "scale";
/// glTF JSON key for `strength`.
pub const KEY_STRENGTH: &str = "strength";
/// glTF JSON key for `offset`.
pub const KEY_OFFSET: &str = "offset";
/// glTF JSON key for `rotation`.
pub const KEY_ROTATION: &str = "rotation";
/// glTF JSON key for `emissiveStrength`.
pub const KEY_EMISSIVE_STRENGTH: &str = "emissiveStrength";
/// glTF JSON key for `specularFactor`.
pub const KEY_SPECULAR_FACTOR: &str = "specularFactor";
/// glTF JSON key for `specularColorFactor`.
pub const KEY_SPECULAR_COLOR_FACTOR: &str = "specularColorFactor";
/// glTF JSON key for `specularTexture`.
pub const KEY_SPECULAR_TEX: &str = "specularTexture";
/// glTF JSON key for `specularColorTexture`.
pub const KEY_SPECULAR_COLOR_TEX: &str = "specularColorTexture";
/// glTF JSON key for `clearcoatFactor`.
pub const KEY_CLEARCOAT_FACTOR: &str = "clearcoatFactor";
/// glTF JSON key for `clearcoatRoughnessFactor`.
pub const KEY_CLEARCOAT_ROUGHNESS: &str = "clearcoatRoughnessFactor";
/// glTF JSON key for `clearcoatTexture`.
pub const KEY_CLEARCOAT_TEX: &str = "clearcoatTexture";
/// glTF JSON key for `clearcoatRoughnessTexture`.
pub const KEY_CLEARCOAT_ROUGH_TEX: &str = "clearcoatRoughnessTexture";
/// glTF JSON key for `clearcoatNormalTexture`.
pub const KEY_CLEARCOAT_NORM_TEX: &str = "clearcoatNormalTexture";
/// glTF JSON key for `transmissionFactor`.
pub const KEY_TRANSMISSION_FACTOR: &str = "transmissionFactor";
/// glTF JSON key for `transmissionTexture`.
pub const KEY_TRANSMISSION_TEX: &str = "transmissionTexture";
/// glTF JSON key for `thicknessFactor`.
pub const KEY_THICKNESS_FACTOR: &str = "thicknessFactor";
/// glTF JSON key for `attenuationDistance`.
pub const KEY_ATTENUATION_DIST: &str = "attenuationDistance";
/// glTF JSON key for `attenuationColor`.
pub const KEY_ATTENUATION_COLOR: &str = "attenuationColor";
/// glTF JSON key for `sheenColorFactor`.
pub const KEY_SHEEN_COLOR: &str = "sheenColorFactor";
/// glTF JSON key for `sheenRoughnessFactor`.
pub const KEY_SHEEN_ROUGHNESS: &str = "sheenRoughnessFactor";
/// glTF JSON key for `sheenColorTexture`.
pub const KEY_SHEEN_COLOR_TEX: &str = "sheenColorTexture";
/// glTF JSON key for `sheenRoughnessTexture`.
pub const KEY_SHEEN_ROUGH_TEX: &str = "sheenRoughnessTexture";
/// glTF JSON key for `meshes`.
pub const KEY_MESHES: &str = "meshes";
/// glTF JSON key for `primitives`.
pub const KEY_PRIMITIVES: &str = "primitives";
/// glTF JSON key for `attributes`.
pub const KEY_ATTRIBUTES: &str = "attributes";
/// glTF JSON key for `material`.
pub const KEY_MATERIAL: &str = "material";
/// glTF JSON key for `mode`.
pub const KEY_MODE: &str = "mode";
/// glTF JSON key for `targets`.
pub const KEY_TARGETS: &str = "targets";
/// glTF JSON key for `targetNames`.
pub const KEY_TARGET_NAMES: &str = "targetNames";
/// glTF JSON key for `POSITION`.
pub const ATTR_POSITION: &str = "POSITION";
/// glTF JSON key for `NORMAL`.
pub const ATTR_NORMAL: &str = "NORMAL";
/// glTF JSON key for `TANGENT`.
pub const ATTR_TANGENT: &str = "TANGENT";
/// glTF JSON key for `TEXCOORD_0`.
pub const ATTR_TEXCOORD_0: &str = "TEXCOORD_0";
/// glTF JSON key for `TEXCOORD_1`.
pub const ATTR_TEXCOORD_1: &str = "TEXCOORD_1";
/// glTF JSON key for `COLOR_0`.
pub const ATTR_COLOR_0: &str = "COLOR_0";
/// glTF JSON key for `JOINTS_0`.
pub const ATTR_JOINTS_0: &str = "JOINTS_0";
/// glTF JSON key for `JOINTS_1`.
pub const ATTR_JOINTS_1: &str = "JOINTS_1";
/// glTF JSON key for `WEIGHTS_0`.
pub const ATTR_WEIGHTS_0: &str = "WEIGHTS_0";
/// glTF JSON key for `WEIGHTS_1`.
pub const ATTR_WEIGHTS_1: &str = "WEIGHTS_1";
/// glTF JSON key for `skins`.
pub const KEY_SKINS: &str = "skins";
/// glTF JSON key for `joints`.
pub const KEY_JOINTS: &str = "joints";
/// glTF JSON key for `skeleton`.
pub const KEY_SKELETON: &str = "skeleton";
/// glTF JSON key for `inverseBindMatrices`.
pub const KEY_INV_BIND_MATRICES: &str = "inverseBindMatrices";
/// glTF JSON key for `animations`.
pub const KEY_ANIMATIONS: &str = "animations";
/// glTF JSON key for `channels`.
pub const KEY_CHANNELS: &str = "channels";
/// glTF JSON key for `target`.
pub const KEY_TARGET: &str = "target";
/// glTF JSON key for `node`.
pub const KEY_NODE: &str = "node";
/// glTF JSON key for `path`.
pub const KEY_PATH: &str = "path";
/// glTF JSON key for `input`.
pub const KEY_INPUT: &str = "input";
/// glTF JSON key for `output`.
pub const KEY_OUTPUT: &str = "output";
/// glTF JSON key for `interpolation`.
pub const KEY_INTERPOLATION: &str = "interpolation";
/// glTF JSON key for `cameras`.
pub const KEY_CAMERAS: &str = "cameras";
/// glTF JSON key for `perspective`.
pub const KEY_PERSPECTIVE: &str = "perspective";
/// glTF JSON key for `orthographic`.
pub const KEY_ORTHOGRAPHIC: &str = "orthographic";
/// glTF JSON key for `yfov`.
pub const KEY_YFOV: &str = "yfov";
/// glTF JSON key for `aspectRatio`.
pub const KEY_ASPECT_RATIO: &str = "aspectRatio";
/// glTF JSON key for `znear`.
pub const KEY_ZNEAR: &str = "znear";
/// glTF JSON key for `zfar`.
pub const KEY_ZFAR: &str = "zfar";
/// glTF JSON key for `xmag`.
pub const KEY_XMAG: &str = "xmag";
/// glTF JSON key for `ymag`.
pub const KEY_YMAG: &str = "ymag";
/// glTF JSON key for `lights`.
pub const KEY_LIGHTS: &str = "lights";
/// glTF JSON key for `light`.
pub const KEY_LIGHT: &str = "light";
/// glTF JSON key for `color`.
pub const KEY_COLOR: &str = "color";
/// glTF JSON key for `intensity`.
pub const KEY_INTENSITY: &str = "intensity";
/// glTF JSON key for `range`.
pub const KEY_RANGE: &str = "range";
/// glTF JSON key for `spot`.
pub const KEY_SPOT: &str = "spot";
/// glTF JSON key for `innerConeAngle`.
pub const KEY_INNER_CONE: &str = "innerConeAngle";
/// glTF JSON key for `outerConeAngle`.
pub const KEY_OUTER_CONE: &str = "outerConeAngle";
/// glTF JSON key for `nodes`.
pub const KEY_NODES: &str = "nodes";
/// glTF JSON key for `children`.
pub const KEY_CHILDREN: &str = "children";
/// glTF JSON key for `matrix`.
pub const KEY_MATRIX: &str = "matrix";
/// glTF JSON key for `translation`.
pub const KEY_TRANSLATION: &str = "translation";
/// glTF JSON key for `mesh`.
pub const KEY_MESH: &str = "mesh";
/// glTF JSON key for `skin`.
pub const KEY_SKIN: &str = "skin";
/// glTF JSON key for `camera`.
pub const KEY_CAMERA: &str = "camera";
/// glTF JSON key for `weights`.
pub const KEY_WEIGHTS: &str = "weights";
/// glTF JSON key for `scenes`.
pub const KEY_SCENES: &str = "scenes";
/// glTF JSON key for `scene`.
pub const KEY_SCENE: &str = "scene";
/// glTF JSON key for `positions` (legacy inline fallback).
pub const KEY_LEGACY_POSITIONS: &str = "positions";
/// Blender custom extras sub-object key (`extras.euv`).
pub const KEY_EUV_COLLECTIONS: &str = "collections";
/// Blender custom extras collider key.
pub const KEY_EUV_COLLIDER: &str = "collider";
/// Blender custom extras buoyancy density key.
pub const KEY_EUV_BUOYANCY: &str = "buoyancy_density";
/// Blender custom extras trigger key.
pub const KEY_EUV_TRIGGER: &str = "is_trigger";
/// Blender custom extras shadow casting key.
pub const KEY_EUV_CAST_SHADOWS: &str = "cast_shadows";
/// Alpha mode string `MASK`.
pub const ALPHA_MODE_MASK: &str = "MASK";
/// Alpha mode string `BLEND`.
pub const ALPHA_MODE_BLEND: &str = "BLEND";
/// Interpolation string `STEP`.
pub const INTERP_STEP: &str = "STEP";
/// Interpolation string `CUBICSPLINE`.
pub const INTERP_CUBICSPLINE: &str = "CUBICSPLINE";
/// Light kind string `directional`.
pub const LIGHT_TYPE_DIRECTIONAL: &str = "directional";
/// Light kind string `point`.
pub const LIGHT_TYPE_POINT: &str = "point";
/// Light kind string `spot`.
pub const LIGHT_TYPE_SPOT: &str = "spot";
/// Light kind string `area`.
pub const LIGHT_TYPE_AREA: &str = "area";
/// Accessor type string `SCALAR`.
pub const ACC_TYPE_SCALAR: &str = "SCALAR";
/// Accessor type string `VEC2`.
pub const ACC_TYPE_VEC2: &str = "VEC2";
/// Accessor type string `VEC3`.
pub const ACC_TYPE_VEC3: &str = "VEC3";
/// Accessor type string `VEC4`.
pub const ACC_TYPE_VEC4: &str = "VEC4";
/// Accessor type string `MAT2`.
pub const ACC_TYPE_MAT2: &str = "MAT2";
/// Accessor type string `MAT3`.
pub const ACC_TYPE_MAT3: &str = "MAT3";
/// Accessor type string `MAT4`.
pub const ACC_TYPE_MAT4: &str = "MAT4";
/// Collider tag string `sphere`.
pub const COLLIDER_SPHERE: &str = "sphere";
/// Collider tag string `convex`.
pub const COLLIDER_CONVEX: &str = "convex";
/// Collider tag string `convex_hull`.
pub const COLLIDER_CONVEX_HULL: &str = "convex_hull";
/// Collider tag string `mesh`.
pub const COLLIDER_MESH: &str = "mesh";
/// Error string for malformed GLB binary headers or chunks.
pub const ERR_GLB_INVALID: &str = "invalid glb v2 binary container";
/// Error string for malformed glTF JSON syntax.
pub const ERR_GLTF_PARSE: &str = "invalid gltf 2.0 json document";
/// Error string for missing external URI buffer or image.
pub const ERR_GLTF_URI_RESOLVE: &str = "failed to resolve gltf external uri";
/// Error string for path traversal attempt in relative glTF URI.
pub const ERR_GLTF_URI_TRAVERSAL: &str = "rejected unsafe relative gltf uri path";
/// Error string for out-of-bounds buffer view or accessor slice.
pub const ERR_GLTF_ACCESSOR_BOUNDS: &str = "gltf accessor or bufferView out of bounds";