1use serde::Deserialize;
2
3#[derive(Debug, Clone, Copy, PartialEq, Deserialize)]
4pub struct BoundingBox {
6 pub min: [f32; 3],
7 pub max: [f32; 3],
8}
9
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11#[repr(i32)]
12pub enum GeometryType {
14 Points = 0,
15 Lines = 1,
16 Triangles = 2,
17 TriangleStrips = 3,
18 Quads = 4,
19 VariableTopology = 5,
20}
21
22impl GeometryType {
23 #[must_use]
24 pub const fn as_raw(self) -> i32 {
26 self as i32
27 }
28
29 #[must_use]
30 pub const fn from_raw(raw: i32) -> Option<Self> {
32 match raw {
33 0 => Some(Self::Points),
34 1 => Some(Self::Lines),
35 2 => Some(Self::Triangles),
36 3 => Some(Self::TriangleStrips),
37 4 => Some(Self::Quads),
38 5 => Some(Self::VariableTopology),
39 _ => None,
40 }
41 }
42}
43
44#[derive(Debug, Clone, Copy, PartialEq, Eq)]
45#[repr(i32)]
46pub enum ProbePlacement {
48 UniformGrid = 0,
49 IrradianceDistribution = 1,
50}
51
52impl ProbePlacement {
53 #[must_use]
54 pub const fn as_raw(self) -> i32 {
56 self as i32
57 }
58
59 #[must_use]
60 pub const fn from_raw(raw: i32) -> Option<Self> {
62 match raw {
63 0 => Some(Self::UniformGrid),
64 1 => Some(Self::IrradianceDistribution),
65 _ => None,
66 }
67 }
68}
69
70#[derive(Debug, Clone, Copy, PartialEq, Eq)]
71#[repr(u32)]
72pub enum IndexBitDepth {
74 UInt8 = 8,
75 UInt16 = 16,
76 UInt32 = 32,
77}
78
79impl IndexBitDepth {
80 #[must_use]
81 pub const fn as_raw(self) -> u32 {
83 self as u32
84 }
85
86 #[must_use]
87 pub const fn from_raw(raw: u32) -> Option<Self> {
89 match raw {
90 8 => Some(Self::UInt8),
91 16 => Some(Self::UInt16),
92 32 => Some(Self::UInt32),
93 _ => None,
94 }
95 }
96}
97
98#[derive(Debug, Clone, Copy, PartialEq, Eq)]
99#[repr(u32)]
100pub enum MeshBufferType {
102 Vertex = 1,
103 Index = 2,
104 Custom = 3,
105}
106
107impl MeshBufferType {
108 #[must_use]
109 pub const fn as_raw(self) -> u32 {
111 self as u32
112 }
113
114 #[must_use]
115 pub const fn from_raw(raw: u32) -> Option<Self> {
117 match raw {
118 1 => Some(Self::Vertex),
119 2 => Some(Self::Index),
120 3 => Some(Self::Custom),
121 _ => None,
122 }
123 }
124}
125
126#[derive(Debug, Clone, Copy, PartialEq, Eq)]
127#[repr(u32)]
128pub enum MaterialSemantic {
130 BaseColor = 0,
131 Subsurface = 1,
132 Metallic = 2,
133 Specular = 3,
134 SpecularExponent = 4,
135 SpecularTint = 5,
136 Roughness = 6,
137 Anisotropic = 7,
138 AnisotropicRotation = 8,
139 Sheen = 9,
140 SheenTint = 10,
141 Clearcoat = 11,
142 ClearcoatGloss = 12,
143 Emission = 13,
144 Bump = 14,
145 Opacity = 15,
146 InterfaceIndexOfRefraction = 16,
147 MaterialIndexOfRefraction = 17,
148 ObjectSpaceNormal = 18,
149 TangentSpaceNormal = 19,
150 Displacement = 20,
151 DisplacementScale = 21,
152 AmbientOcclusion = 22,
153 AmbientOcclusionScale = 23,
154 None = 0x8000,
155 UserDefined = 0x8001,
156}
157
158impl MaterialSemantic {
159 #[must_use]
160 pub const fn from_raw(raw: u32) -> Option<Self> {
162 match raw {
163 0 => Some(Self::BaseColor),
164 1 => Some(Self::Subsurface),
165 2 => Some(Self::Metallic),
166 3 => Some(Self::Specular),
167 4 => Some(Self::SpecularExponent),
168 5 => Some(Self::SpecularTint),
169 6 => Some(Self::Roughness),
170 7 => Some(Self::Anisotropic),
171 8 => Some(Self::AnisotropicRotation),
172 9 => Some(Self::Sheen),
173 10 => Some(Self::SheenTint),
174 11 => Some(Self::Clearcoat),
175 12 => Some(Self::ClearcoatGloss),
176 13 => Some(Self::Emission),
177 14 => Some(Self::Bump),
178 15 => Some(Self::Opacity),
179 16 => Some(Self::InterfaceIndexOfRefraction),
180 17 => Some(Self::MaterialIndexOfRefraction),
181 18 => Some(Self::ObjectSpaceNormal),
182 19 => Some(Self::TangentSpaceNormal),
183 20 => Some(Self::Displacement),
184 21 => Some(Self::DisplacementScale),
185 22 => Some(Self::AmbientOcclusion),
186 23 => Some(Self::AmbientOcclusionScale),
187 0x8000 => Some(Self::None),
188 0x8001 => Some(Self::UserDefined),
189 _ => None,
190 }
191 }
192}
193
194#[derive(Debug, Clone, Copy, PartialEq, Eq)]
195#[repr(u32)]
196pub enum MaterialPropertyType {
198 None = 0,
199 String = 1,
200 Url = 2,
201 Texture = 3,
202 Color = 4,
203 Float = 5,
204 Float2 = 6,
205 Float3 = 7,
206 Float4 = 8,
207 Matrix44 = 9,
208 Buffer = 10,
209}
210
211impl MaterialPropertyType {
212 #[must_use]
213 pub const fn from_raw(raw: u32) -> Option<Self> {
215 match raw {
216 0 => Some(Self::None),
217 1 => Some(Self::String),
218 2 => Some(Self::Url),
219 3 => Some(Self::Texture),
220 4 => Some(Self::Color),
221 5 => Some(Self::Float),
222 6 => Some(Self::Float2),
223 7 => Some(Self::Float3),
224 8 => Some(Self::Float4),
225 9 => Some(Self::Matrix44),
226 10 => Some(Self::Buffer),
227 _ => None,
228 }
229 }
230}
231
232#[derive(Debug, Clone, Copy, PartialEq, Eq)]
233#[repr(u32)]
234pub enum MaterialFace {
236 Front = 0,
237 Back = 1,
238 DoubleSided = 2,
239}
240
241impl MaterialFace {
242 #[must_use]
243 pub const fn as_raw(self) -> u32 {
245 self as u32
246 }
247
248 #[must_use]
249 pub const fn from_raw(raw: u32) -> Option<Self> {
251 match raw {
252 0 => Some(Self::Front),
253 1 => Some(Self::Back),
254 2 => Some(Self::DoubleSided),
255 _ => None,
256 }
257 }
258}
259
260#[derive(Debug, Clone, Copy, PartialEq, Eq)]
261#[repr(u32)]
262pub enum MaterialTextureWrapMode {
264 Clamp = 0,
265 Repeat = 1,
266 Mirror = 2,
267}
268
269impl MaterialTextureWrapMode {
270 #[must_use]
271 pub const fn as_raw(self) -> u32 {
273 self as u32
274 }
275
276 #[must_use]
277 pub const fn from_raw(raw: u32) -> Option<Self> {
279 match raw {
280 0 => Some(Self::Clamp),
281 1 => Some(Self::Repeat),
282 2 => Some(Self::Mirror),
283 _ => None,
284 }
285 }
286}
287
288#[derive(Debug, Clone, Copy, PartialEq, Eq)]
289#[repr(u32)]
290pub enum MaterialTextureFilterMode {
292 Nearest = 0,
293 Linear = 1,
294}
295
296impl MaterialTextureFilterMode {
297 #[must_use]
298 pub const fn as_raw(self) -> u32 {
300 self as u32
301 }
302
303 #[must_use]
304 pub const fn from_raw(raw: u32) -> Option<Self> {
306 match raw {
307 0 => Some(Self::Nearest),
308 1 => Some(Self::Linear),
309 _ => None,
310 }
311 }
312}
313
314#[derive(Debug, Clone, Copy, PartialEq, Eq)]
315#[repr(u32)]
316pub enum MaterialMipMapFilterMode {
318 Nearest = 0,
319 Linear = 1,
320}
321
322impl MaterialMipMapFilterMode {
323 #[must_use]
324 pub const fn as_raw(self) -> u32 {
326 self as u32
327 }
328
329 #[must_use]
330 pub const fn from_raw(raw: u32) -> Option<Self> {
332 match raw {
333 0 => Some(Self::Nearest),
334 1 => Some(Self::Linear),
335 _ => None,
336 }
337 }
338}
339
340#[derive(Debug, Clone, Copy, PartialEq, Eq)]
341#[repr(u32)]
342pub enum LightType {
344 Unknown = 0,
345 Ambient = 1,
346 Directional = 2,
347 Spot = 3,
348 Point = 4,
349 Linear = 5,
350 DiscArea = 6,
351 RectangularArea = 7,
352 SuperElliptical = 8,
353 Photometric = 9,
354 Probe = 10,
355 Environment = 11,
356}
357
358impl LightType {
359 #[must_use]
360 pub const fn as_raw(self) -> u32 {
362 self as u32
363 }
364
365 #[must_use]
366 pub const fn from_raw(raw: u32) -> Option<Self> {
368 match raw {
369 0 => Some(Self::Unknown),
370 1 => Some(Self::Ambient),
371 2 => Some(Self::Directional),
372 3 => Some(Self::Spot),
373 4 => Some(Self::Point),
374 5 => Some(Self::Linear),
375 6 => Some(Self::DiscArea),
376 7 => Some(Self::RectangularArea),
377 8 => Some(Self::SuperElliptical),
378 9 => Some(Self::Photometric),
379 10 => Some(Self::Probe),
380 11 => Some(Self::Environment),
381 _ => None,
382 }
383 }
384}
385
386#[derive(Debug, Clone, Copy, PartialEq, Eq)]
387#[repr(u32)]
388pub enum CameraProjection {
390 Perspective = 0,
391 Orthographic = 1,
392}
393
394impl CameraProjection {
395 #[must_use]
396 pub const fn as_raw(self) -> u32 {
398 self as u32
399 }
400
401 #[must_use]
402 pub const fn from_raw(raw: u32) -> Option<Self> {
404 match raw {
405 0 => Some(Self::Perspective),
406 1 => Some(Self::Orthographic),
407 _ => None,
408 }
409 }
410}
411
412#[derive(Debug, Clone, Copy, PartialEq, Eq)]
413#[repr(u32)]
414pub enum DataPrecision {
416 Undefined = 0,
417 Float = 1,
418 Double = 2,
419}
420
421impl DataPrecision {
422 #[must_use]
423 pub const fn from_raw(raw: u32) -> Option<Self> {
425 match raw {
426 0 => Some(Self::Undefined),
427 1 => Some(Self::Float),
428 2 => Some(Self::Double),
429 _ => None,
430 }
431 }
432}
433
434#[derive(Debug, Clone, Copy, PartialEq, Eq)]
435#[repr(u32)]
436pub enum AnimatedValueInterpolation {
438 Constant = 0,
439 Linear = 1,
440}
441
442impl AnimatedValueInterpolation {
443 #[must_use]
444 pub const fn as_raw(self) -> u32 {
446 self as u32
447 }
448
449 #[must_use]
450 pub const fn from_raw(raw: u32) -> Option<Self> {
452 match raw {
453 0 => Some(Self::Constant),
454 1 => Some(Self::Linear),
455 _ => None,
456 }
457 }
458}
459
460#[derive(Debug, Clone, Copy, PartialEq, Eq)]
461#[repr(u64)]
462pub enum TransformOpRotationOrder {
464 Xyz = 1,
465 Xzy = 2,
466 Yxz = 3,
467 Yzx = 4,
468 Zxy = 5,
469 Zyx = 6,
470}
471
472impl TransformOpRotationOrder {
473 #[must_use]
474 pub const fn as_raw(self) -> u64 {
476 self as u64
477 }
478
479 #[must_use]
480 pub const fn from_raw(raw: u64) -> Option<Self> {
482 match raw {
483 1 => Some(Self::Xyz),
484 2 => Some(Self::Xzy),
485 3 => Some(Self::Yxz),
486 4 => Some(Self::Yzx),
487 5 => Some(Self::Zxy),
488 6 => Some(Self::Zyx),
489 _ => None,
490 }
491 }
492}
493
494#[derive(Debug, Clone, Copy, PartialEq, Eq)]
495#[repr(i32)]
496pub enum ObjectKind {
498 Unknown = 0,
499 Object = 1,
500 Mesh = 2,
501 Light = 3,
502 PhysicallyPlausibleLight = 4,
503 Camera = 5,
504 VoxelArray = 6,
505 Skeleton = 7,
506 PackedJointAnimation = 8,
507}
508
509impl ObjectKind {
510 #[must_use]
511 pub const fn from_raw(raw: i32) -> Option<Self> {
513 match raw {
514 0 => Some(Self::Unknown),
515 1 => Some(Self::Object),
516 2 => Some(Self::Mesh),
517 3 => Some(Self::Light),
518 4 => Some(Self::PhysicallyPlausibleLight),
519 5 => Some(Self::Camera),
520 6 => Some(Self::VoxelArray),
521 7 => Some(Self::Skeleton),
522 8 => Some(Self::PackedJointAnimation),
523 _ => None,
524 }
525 }
526}
527
528#[derive(Debug, Clone, Copy, PartialEq, Eq)]
529#[repr(i32)]
530pub enum TextureChannelEncoding {
532 UInt8 = 1,
533 UInt16 = 2,
534 UInt24 = 3,
535 UInt32 = 4,
536 Float16 = 0x102,
537 Float16Sr = 0x302,
538 Float32 = 0x104,
539}
540
541impl TextureChannelEncoding {
542 #[must_use]
543 pub const fn as_raw(self) -> i32 {
545 self as i32
546 }
547
548 #[must_use]
549 pub const fn from_raw(raw: i32) -> Option<Self> {
551 match raw {
552 1 => Some(Self::UInt8),
553 2 => Some(Self::UInt16),
554 3 => Some(Self::UInt24),
555 4 => Some(Self::UInt32),
556 0x102 => Some(Self::Float16),
557 0x302 => Some(Self::Float16Sr),
558 0x104 => Some(Self::Float32),
559 _ => None,
560 }
561 }
562}
563
564#[derive(Debug, Clone, Deserialize)]
565pub struct MeshBufferInfo {
567 pub length: usize,
568 pub buffer_type: u32,
569}
570
571impl MeshBufferInfo {
572 #[must_use]
573 pub fn buffer_type_enum(&self) -> Option<MeshBufferType> {
575 MeshBufferType::from_raw(self.buffer_type)
576 }
577}
578
579#[derive(Debug, Clone, Deserialize)]
580pub struct VertexAttributeInfo {
582 pub stride: usize,
583 pub format: u32,
584 pub buffer_size: usize,
585}
586
587#[derive(Debug, Clone, Deserialize)]
588pub struct TextureInfo {
590 pub name: Option<String>,
591 pub dimensions: [i32; 2],
592 pub row_stride: isize,
593 pub channel_count: usize,
594 pub mip_level_count: usize,
595 pub channel_encoding: i32,
596 pub is_cube: bool,
597 pub has_alpha_values: bool,
598 pub url: Option<String>,
599}
600
601impl TextureInfo {
602 #[must_use]
603 pub fn channel_encoding_enum(&self) -> Option<TextureChannelEncoding> {
605 TextureChannelEncoding::from_raw(self.channel_encoding)
606 }
607}
608
609#[derive(Debug, Clone, Deserialize)]
610pub struct MaterialPropertyInfo {
612 pub name: String,
613 pub semantic: u32,
614 pub property_type: u32,
615 pub string_value: Option<String>,
616 pub url_value: Option<String>,
617 pub float_value: Option<f32>,
618 pub float2_value: Option<[f32; 2]>,
619 pub float3_value: Option<[f32; 3]>,
620 pub float4_value: Option<[f32; 4]>,
621 pub matrix4x4: Option<[f32; 16]>,
622 pub color: Option<[f32; 4]>,
623 pub luminance: Option<f32>,
624 pub texture: Option<TextureInfo>,
625}
626
627impl MaterialPropertyInfo {
628 #[must_use]
629 pub fn semantic_enum(&self) -> Option<MaterialSemantic> {
631 MaterialSemantic::from_raw(self.semantic)
632 }
633
634 #[must_use]
635 pub fn property_type_enum(&self) -> Option<MaterialPropertyType> {
637 MaterialPropertyType::from_raw(self.property_type)
638 }
639}
640
641#[derive(Debug, Clone, Deserialize)]
642pub struct MaterialInfo {
644 pub name: String,
645 pub count: usize,
646 pub material_face: u32,
647}
648
649impl MaterialInfo {
650 #[must_use]
651 pub fn material_face_enum(&self) -> Option<MaterialFace> {
653 MaterialFace::from_raw(self.material_face)
654 }
655}
656
657#[derive(Debug, Clone, Deserialize)]
658pub struct TextureFilterInfo {
660 pub s_wrap_mode: u32,
661 pub t_wrap_mode: u32,
662 pub r_wrap_mode: u32,
663 pub min_filter: u32,
664 pub mag_filter: u32,
665 pub mip_filter: u32,
666}
667
668impl TextureFilterInfo {
669 #[must_use]
670 pub fn s_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
672 MaterialTextureWrapMode::from_raw(self.s_wrap_mode)
673 }
674
675 #[must_use]
676 pub fn t_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
678 MaterialTextureWrapMode::from_raw(self.t_wrap_mode)
679 }
680
681 #[must_use]
682 pub fn r_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
684 MaterialTextureWrapMode::from_raw(self.r_wrap_mode)
685 }
686
687 #[must_use]
688 pub fn min_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
690 MaterialTextureFilterMode::from_raw(self.min_filter)
691 }
692
693 #[must_use]
694 pub fn mag_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
696 MaterialTextureFilterMode::from_raw(self.mag_filter)
697 }
698
699 #[must_use]
700 pub fn mip_filter_enum(&self) -> Option<MaterialMipMapFilterMode> {
702 MaterialMipMapFilterMode::from_raw(self.mip_filter)
703 }
704}
705
706#[derive(Debug, Clone, Deserialize)]
707pub struct TextureSamplerInfo {
709 pub has_texture: bool,
710 pub has_hardware_filter: bool,
711 pub has_transform: bool,
712}
713
714#[derive(Debug, Clone, Deserialize)]
715pub struct AssetInfo {
717 pub count: usize,
718 pub frame_interval: f64,
719 pub start_time: f64,
720 pub end_time: f64,
721 pub bounding_box: BoundingBox,
722 pub up_axis: [f32; 3],
723 pub url: Option<String>,
724}
725
726#[derive(Debug, Clone, Deserialize)]
727pub struct ObjectInfo {
729 pub kind: i32,
730 pub name: String,
731 pub path: String,
732 pub hidden: bool,
733 pub component_count: usize,
734 pub child_count: usize,
735 pub has_parent: bool,
736 pub has_instance: bool,
737 pub bounding_box: BoundingBox,
738}
739
740impl ObjectInfo {
741 #[must_use]
742 pub fn kind_enum(&self) -> Option<ObjectKind> {
744 ObjectKind::from_raw(self.kind)
745 }
746}
747
748#[derive(Debug, Clone, Deserialize)]
749pub struct LightInfo {
751 pub light_type: u32,
752 pub color_space: String,
753}
754
755impl LightInfo {
756 #[must_use]
757 pub fn light_type_enum(&self) -> Option<LightType> {
759 LightType::from_raw(self.light_type)
760 }
761}
762
763#[derive(Debug, Clone, Deserialize)]
764pub struct PhysicallyPlausibleLightInfo {
766 pub light_type: u32,
767 pub color_space: String,
768 pub color: Option<[f32; 4]>,
769 pub lumens: f32,
770 pub inner_cone_angle: f32,
771 pub outer_cone_angle: f32,
772 pub attenuation_start_distance: f32,
773 pub attenuation_end_distance: f32,
774}
775
776impl PhysicallyPlausibleLightInfo {
777 #[must_use]
778 pub fn light_type_enum(&self) -> Option<LightType> {
780 LightType::from_raw(self.light_type)
781 }
782}
783
784#[derive(Debug, Clone, Deserialize)]
785pub struct AreaLightInfo {
787 pub light_type: u32,
788 pub color_space: String,
789 pub color: Option<[f32; 4]>,
790 pub lumens: f32,
791 pub inner_cone_angle: f32,
792 pub outer_cone_angle: f32,
793 pub attenuation_start_distance: f32,
794 pub attenuation_end_distance: f32,
795 pub area_radius: f32,
796 pub super_elliptic_power: [f32; 2],
797 pub aspect: f32,
798}
799
800impl AreaLightInfo {
801 #[must_use]
802 pub fn light_type_enum(&self) -> Option<LightType> {
804 LightType::from_raw(self.light_type)
805 }
806}
807
808#[derive(Debug, Clone, Deserialize)]
809pub struct PhotometricLightInfo {
811 pub light_type: u32,
812 pub color_space: String,
813 pub color: Option<[f32; 4]>,
814 pub lumens: f32,
815 pub inner_cone_angle: f32,
816 pub outer_cone_angle: f32,
817 pub attenuation_start_distance: f32,
818 pub attenuation_end_distance: f32,
819 pub spherical_harmonics_level: usize,
820 pub spherical_harmonics_coefficients_length: usize,
821 pub has_light_cube_map: bool,
822}
823
824impl PhotometricLightInfo {
825 #[must_use]
826 pub fn light_type_enum(&self) -> Option<LightType> {
828 LightType::from_raw(self.light_type)
829 }
830}
831
832#[derive(Debug, Clone, Deserialize)]
833pub struct CameraInfo {
835 pub projection: u32,
836 pub projection_matrix: [f32; 16],
837 pub near_visibility_distance: f32,
838 pub far_visibility_distance: f32,
839 pub world_to_meters_conversion_scale: f32,
840 pub barrel_distortion: f32,
841 pub fisheye_distortion: f32,
842 pub optical_vignetting: f32,
843 pub chromatic_aberration: f32,
844 pub focal_length: f32,
845 pub focus_distance: f32,
846 pub field_of_view: f32,
847 pub f_stop: f32,
848 pub aperture_blade_count: usize,
849 pub maximum_circle_of_confusion: f32,
850 pub shutter_open_interval: f64,
851 pub sensor_vertical_aperture: f32,
852 pub sensor_aspect: f32,
853 pub sensor_enlargement: [f32; 2],
854 pub sensor_shift: [f32; 2],
855 pub flash: [f32; 3],
856 pub exposure_compression: [f32; 2],
857 pub exposure: [f32; 3],
858}
859
860impl CameraInfo {
861 #[must_use]
862 pub fn projection_enum(&self) -> Option<CameraProjection> {
864 CameraProjection::from_raw(self.projection)
865 }
866}
867
868#[derive(Debug, Clone, Deserialize)]
869pub struct StereoscopicCameraInfo {
871 pub inter_pupillary_distance: f32,
872 pub left_vergence: f32,
873 pub right_vergence: f32,
874 pub overlap: f32,
875 pub left_view_matrix: [f32; 16],
876 pub right_view_matrix: [f32; 16],
877 pub left_projection_matrix: [f32; 16],
878 pub right_projection_matrix: [f32; 16],
879}
880
881#[derive(Debug, Clone, Deserialize)]
882pub struct VoxelIndexExtent {
884 pub minimum_extent: [i32; 4],
885 pub maximum_extent: [i32; 4],
886}
887
888#[derive(Debug, Clone, Deserialize)]
889pub struct VoxelArrayInfo {
891 pub count: usize,
892 pub bounding_box: BoundingBox,
893 pub voxel_index_extent: VoxelIndexExtent,
894 pub is_valid_signed_shell_field: bool,
895 pub shell_field_interior_thickness: f32,
896 pub shell_field_exterior_thickness: f32,
897}
898
899#[derive(Debug, Clone, Deserialize)]
900pub struct AnimatedValueInfo {
902 pub is_animated: bool,
903 pub precision: u32,
904 pub time_sample_count: usize,
905 pub minimum_time: f64,
906 pub maximum_time: f64,
907 pub interpolation: u32,
908 pub key_times: Vec<f64>,
909 pub element_count: Option<usize>,
910}
911
912impl AnimatedValueInfo {
913 #[must_use]
914 pub fn precision_enum(&self) -> Option<DataPrecision> {
916 DataPrecision::from_raw(self.precision)
917 }
918
919 #[must_use]
920 pub fn interpolation_enum(&self) -> Option<AnimatedValueInterpolation> {
922 AnimatedValueInterpolation::from_raw(self.interpolation)
923 }
924}
925
926#[derive(Debug, Clone, Deserialize)]
927pub struct PackedJointAnimationInfo {
929 pub name: String,
930 pub path: String,
931 pub joint_paths: Vec<String>,
932 pub joint_count: usize,
933}
934
935#[derive(Debug, Clone, Deserialize)]
936pub struct AnimationBindComponentInfo {
938 pub has_skeleton: bool,
939 pub has_joint_animation: bool,
940 pub joint_paths: Option<Vec<String>>,
941 pub geometry_bind_transform: [f32; 16],
942}
943
944#[derive(Debug, Clone, Deserialize)]
945pub struct SkeletonInfo {
947 pub name: String,
948 pub path: String,
949 pub joint_paths: Vec<String>,
950 pub joint_count: usize,
951 pub joint_bind_transform_count: usize,
952 pub joint_rest_transform_count: usize,
953}
954
955#[derive(Debug, Clone, Deserialize)]
956pub struct Matrix4x4ArrayInfo {
958 pub element_count: usize,
959 pub precision: u32,
960}
961
962impl Matrix4x4ArrayInfo {
963 #[must_use]
964 pub fn precision_enum(&self) -> Option<DataPrecision> {
966 DataPrecision::from_raw(self.precision)
967 }
968}
969
970#[derive(Debug, Clone, Deserialize)]
971pub struct VertexAttributeDescriptorInfo {
973 pub name: String,
974 pub format: u32,
975 pub offset: usize,
976 pub buffer_index: usize,
977 pub time: f64,
978 pub initialization_value: [f32; 4],
979}
980
981#[derive(Debug, Clone, Deserialize)]
982pub struct VertexDescriptorInfo {
984 pub attribute_count: usize,
985 pub attributes: Vec<VertexAttributeDescriptorInfo>,
986 pub layout_strides: Vec<usize>,
987}
988
989pub mod vertex_format {
991 pub const INVALID: u32 = 0;
993 pub const PACKED_BIT: u32 = 0x1000;
995
996 pub const UCHAR_BITS: u32 = 0x10000;
998 pub const CHAR_BITS: u32 = 0x20000;
1000 pub const UCHAR_NORMALIZED_BITS: u32 = 0x30000;
1002 pub const CHAR_NORMALIZED_BITS: u32 = 0x40000;
1004 pub const USHORT_BITS: u32 = 0x50000;
1006 pub const SHORT_BITS: u32 = 0x60000;
1008 pub const USHORT_NORMALIZED_BITS: u32 = 0x70000;
1010 pub const SHORT_NORMALIZED_BITS: u32 = 0x80000;
1012 pub const UINT_BITS: u32 = 0x90000;
1014 pub const INT_BITS: u32 = 0xA0000;
1016 pub const HALF_BITS: u32 = 0xB0000;
1018 pub const FLOAT_BITS: u32 = 0xC0000;
1020
1021 pub const UCHAR: u32 = UCHAR_BITS | 1;
1023 pub const UCHAR2: u32 = UCHAR_BITS | 2;
1025 pub const UCHAR3: u32 = UCHAR_BITS | 3;
1027 pub const UCHAR4: u32 = UCHAR_BITS | 4;
1029
1030 pub const CHAR: u32 = CHAR_BITS | 1;
1032 pub const CHAR2: u32 = CHAR_BITS | 2;
1034 pub const CHAR3: u32 = CHAR_BITS | 3;
1036 pub const CHAR4: u32 = CHAR_BITS | 4;
1038
1039 pub const UCHAR_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 1;
1041 pub const UCHAR2_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 2;
1043 pub const UCHAR3_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 3;
1045 pub const UCHAR4_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 4;
1047
1048 pub const CHAR_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 1;
1050 pub const CHAR2_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 2;
1052 pub const CHAR3_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 3;
1054 pub const CHAR4_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 4;
1056
1057 pub const USHORT: u32 = USHORT_BITS | 1;
1059 pub const USHORT2: u32 = USHORT_BITS | 2;
1061 pub const USHORT3: u32 = USHORT_BITS | 3;
1063 pub const USHORT4: u32 = USHORT_BITS | 4;
1065
1066 pub const SHORT: u32 = SHORT_BITS | 1;
1068 pub const SHORT2: u32 = SHORT_BITS | 2;
1070 pub const SHORT3: u32 = SHORT_BITS | 3;
1072 pub const SHORT4: u32 = SHORT_BITS | 4;
1074
1075 pub const USHORT_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 1;
1077 pub const USHORT2_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 2;
1079 pub const USHORT3_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 3;
1081 pub const USHORT4_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 4;
1083
1084 pub const SHORT_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 1;
1086 pub const SHORT2_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 2;
1088 pub const SHORT3_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 3;
1090 pub const SHORT4_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 4;
1092
1093 pub const UINT: u32 = UINT_BITS | 1;
1095 pub const UINT2: u32 = UINT_BITS | 2;
1097 pub const UINT3: u32 = UINT_BITS | 3;
1099 pub const UINT4: u32 = UINT_BITS | 4;
1101
1102 pub const INT: u32 = INT_BITS | 1;
1104 pub const INT2: u32 = INT_BITS | 2;
1106 pub const INT3: u32 = INT_BITS | 3;
1108 pub const INT4: u32 = INT_BITS | 4;
1110
1111 pub const HALF: u32 = HALF_BITS | 1;
1113 pub const HALF2: u32 = HALF_BITS | 2;
1115 pub const HALF3: u32 = HALF_BITS | 3;
1117 pub const HALF4: u32 = HALF_BITS | 4;
1119
1120 pub const FLOAT: u32 = FLOAT_BITS | 1;
1122 pub const FLOAT2: u32 = FLOAT_BITS | 2;
1124 pub const FLOAT3: u32 = FLOAT_BITS | 3;
1126 pub const FLOAT4: u32 = FLOAT_BITS | 4;
1128
1129 pub const INT1010102_NORMALIZED: u32 = INT_BITS | PACKED_BIT | 4;
1131 pub const UINT1010102_NORMALIZED: u32 = UINT_BITS | PACKED_BIT | 4;
1133}