Skip to main content

modelio/
types.rs

1use serde::Deserialize;
2
3#[derive(Debug, Clone, Copy, PartialEq, Deserialize)]
4/// Wraps the corresponding Model I/O bounding box counterpart.
5pub struct BoundingBox {
6    pub min: [f32; 3],
7    pub max: [f32; 3],
8}
9
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11#[repr(i32)]
12/// Mirrors the corresponding Model I/O geometry type enumeration.
13pub 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    /// Returns the raw constant used by the corresponding Model I/O counterpart.
25    pub const fn as_raw(self) -> i32 {
26        self as i32
27    }
28
29    #[must_use]
30    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
31    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)]
46/// Mirrors the corresponding Model I/O probe placement enumeration.
47pub enum ProbePlacement {
48    UniformGrid = 0,
49    IrradianceDistribution = 1,
50}
51
52impl ProbePlacement {
53    #[must_use]
54    /// Returns the raw constant used by the corresponding Model I/O counterpart.
55    pub const fn as_raw(self) -> i32 {
56        self as i32
57    }
58
59    #[must_use]
60    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
61    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)]
72/// Mirrors the corresponding Model I/O index bit depth enumeration.
73pub enum IndexBitDepth {
74    UInt8 = 8,
75    UInt16 = 16,
76    UInt32 = 32,
77}
78
79impl IndexBitDepth {
80    #[must_use]
81    /// Returns the raw constant used by the corresponding Model I/O counterpart.
82    pub const fn as_raw(self) -> u32 {
83        self as u32
84    }
85
86    #[must_use]
87    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
88    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)]
100/// Mirrors the corresponding Model I/O mesh buffer type enumeration.
101pub enum MeshBufferType {
102    Vertex = 1,
103    Index = 2,
104    Custom = 3,
105}
106
107impl MeshBufferType {
108    #[must_use]
109    /// Returns the raw constant used by the corresponding Model I/O counterpart.
110    pub const fn as_raw(self) -> u32 {
111        self as u32
112    }
113
114    #[must_use]
115    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
116    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)]
128/// Mirrors the corresponding Model I/O material semantic enumeration.
129pub 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    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
161    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)]
196/// Mirrors the corresponding Model I/O material property type enumeration.
197pub 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    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
214    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)]
234/// Mirrors the corresponding Model I/O material face enumeration.
235pub enum MaterialFace {
236    Front = 0,
237    Back = 1,
238    DoubleSided = 2,
239}
240
241impl MaterialFace {
242    #[must_use]
243    /// Returns the raw constant used by the corresponding Model I/O counterpart.
244    pub const fn as_raw(self) -> u32 {
245        self as u32
246    }
247
248    #[must_use]
249    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
250    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)]
262/// Mirrors the corresponding Model I/O material texture wrap mode enumeration.
263pub enum MaterialTextureWrapMode {
264    Clamp = 0,
265    Repeat = 1,
266    Mirror = 2,
267}
268
269impl MaterialTextureWrapMode {
270    #[must_use]
271    /// Returns the raw constant used by the corresponding Model I/O counterpart.
272    pub const fn as_raw(self) -> u32 {
273        self as u32
274    }
275
276    #[must_use]
277    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
278    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)]
290/// Mirrors the corresponding Model I/O material texture filter mode enumeration.
291pub enum MaterialTextureFilterMode {
292    Nearest = 0,
293    Linear = 1,
294}
295
296impl MaterialTextureFilterMode {
297    #[must_use]
298    /// Returns the raw constant used by the corresponding Model I/O counterpart.
299    pub const fn as_raw(self) -> u32 {
300        self as u32
301    }
302
303    #[must_use]
304    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
305    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)]
316/// Mirrors the corresponding Model I/O material mip map filter mode enumeration.
317pub enum MaterialMipMapFilterMode {
318    Nearest = 0,
319    Linear = 1,
320}
321
322impl MaterialMipMapFilterMode {
323    #[must_use]
324    /// Returns the raw constant used by the corresponding Model I/O counterpart.
325    pub const fn as_raw(self) -> u32 {
326        self as u32
327    }
328
329    #[must_use]
330    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
331    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)]
342/// Mirrors the corresponding Model I/O light type enumeration.
343pub 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    /// Returns the raw constant used by the corresponding Model I/O counterpart.
361    pub const fn as_raw(self) -> u32 {
362        self as u32
363    }
364
365    #[must_use]
366    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
367    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)]
388/// Mirrors the corresponding Model I/O camera projection enumeration.
389pub enum CameraProjection {
390    Perspective = 0,
391    Orthographic = 1,
392}
393
394impl CameraProjection {
395    #[must_use]
396    /// Returns the raw constant used by the corresponding Model I/O counterpart.
397    pub const fn as_raw(self) -> u32 {
398        self as u32
399    }
400
401    #[must_use]
402    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
403    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)]
414/// Mirrors the corresponding Model I/O data precision enumeration.
415pub enum DataPrecision {
416    Undefined = 0,
417    Float = 1,
418    Double = 2,
419}
420
421impl DataPrecision {
422    #[must_use]
423    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
424    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)]
436/// Mirrors the corresponding Model I/O animated value interpolation enumeration.
437pub enum AnimatedValueInterpolation {
438    Constant = 0,
439    Linear = 1,
440}
441
442impl AnimatedValueInterpolation {
443    #[must_use]
444    /// Returns the raw constant used by the corresponding Model I/O counterpart.
445    pub const fn as_raw(self) -> u32 {
446        self as u32
447    }
448
449    #[must_use]
450    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
451    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)]
462/// Mirrors the corresponding Model I/O transform op rotation order enumeration.
463pub 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    /// Returns the raw constant used by the corresponding Model I/O counterpart.
475    pub const fn as_raw(self) -> u64 {
476        self as u64
477    }
478
479    #[must_use]
480    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
481    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)]
496/// Mirrors the corresponding Model I/O object kind enumeration.
497pub 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    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
512    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)]
530/// Mirrors the corresponding Model I/O texture channel encoding enumeration.
531pub 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    /// Returns the raw constant used by the corresponding Model I/O counterpart.
544    pub const fn as_raw(self) -> i32 {
545        self as i32
546    }
547
548    #[must_use]
549    /// Builds this Rust value from the raw constant used by the corresponding Model I/O counterpart.
550    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)]
565/// Wraps the corresponding Model I/O mesh buffer info counterpart.
566pub struct MeshBufferInfo {
567    pub length: usize,
568    pub buffer_type: u32,
569}
570
571impl MeshBufferInfo {
572    #[must_use]
573    /// Calls the corresponding Model I/O method on the wrapped Model I/O mesh buffer info counterpart.
574    pub fn buffer_type_enum(&self) -> Option<MeshBufferType> {
575        MeshBufferType::from_raw(self.buffer_type)
576    }
577}
578
579#[derive(Debug, Clone, Deserialize)]
580/// Wraps the corresponding Model I/O vertex attribute info counterpart.
581pub struct VertexAttributeInfo {
582    pub stride: usize,
583    pub format: u32,
584    pub buffer_size: usize,
585}
586
587#[derive(Debug, Clone, Deserialize)]
588/// Wraps the corresponding Model I/O texture info counterpart.
589pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture info counterpart.
604    pub fn channel_encoding_enum(&self) -> Option<TextureChannelEncoding> {
605        TextureChannelEncoding::from_raw(self.channel_encoding)
606    }
607}
608
609#[derive(Debug, Clone, Deserialize)]
610/// Wraps the corresponding Model I/O material property info counterpart.
611pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O material property info counterpart.
630    pub fn semantic_enum(&self) -> Option<MaterialSemantic> {
631        MaterialSemantic::from_raw(self.semantic)
632    }
633
634    #[must_use]
635    /// Calls the corresponding Model I/O method on the wrapped Model I/O material property info counterpart.
636    pub fn property_type_enum(&self) -> Option<MaterialPropertyType> {
637        MaterialPropertyType::from_raw(self.property_type)
638    }
639}
640
641#[derive(Debug, Clone, Deserialize)]
642/// Wraps the corresponding Model I/O material info counterpart.
643pub struct MaterialInfo {
644    pub name: String,
645    pub count: usize,
646    pub material_face: u32,
647}
648
649impl MaterialInfo {
650    #[must_use]
651    /// Calls the corresponding Model I/O method on the wrapped Model I/O material info counterpart.
652    pub fn material_face_enum(&self) -> Option<MaterialFace> {
653        MaterialFace::from_raw(self.material_face)
654    }
655}
656
657#[derive(Debug, Clone, Deserialize)]
658/// Wraps the corresponding Model I/O texture filter info counterpart.
659pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
671    pub fn s_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
672        MaterialTextureWrapMode::from_raw(self.s_wrap_mode)
673    }
674
675    #[must_use]
676    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
677    pub fn t_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
678        MaterialTextureWrapMode::from_raw(self.t_wrap_mode)
679    }
680
681    #[must_use]
682    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
683    pub fn r_wrap_mode_enum(&self) -> Option<MaterialTextureWrapMode> {
684        MaterialTextureWrapMode::from_raw(self.r_wrap_mode)
685    }
686
687    #[must_use]
688    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
689    pub fn min_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
690        MaterialTextureFilterMode::from_raw(self.min_filter)
691    }
692
693    #[must_use]
694    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
695    pub fn mag_filter_enum(&self) -> Option<MaterialTextureFilterMode> {
696        MaterialTextureFilterMode::from_raw(self.mag_filter)
697    }
698
699    #[must_use]
700    /// Calls the corresponding Model I/O method on the wrapped Model I/O texture filter info counterpart.
701    pub fn mip_filter_enum(&self) -> Option<MaterialMipMapFilterMode> {
702        MaterialMipMapFilterMode::from_raw(self.mip_filter)
703    }
704}
705
706#[derive(Debug, Clone, Deserialize)]
707/// Wraps the corresponding Model I/O texture sampler info counterpart.
708pub 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)]
715/// Wraps the corresponding Model I/O asset info counterpart.
716pub 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)]
727/// Wraps the corresponding Model I/O object info counterpart.
728pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O object info counterpart.
743    pub fn kind_enum(&self) -> Option<ObjectKind> {
744        ObjectKind::from_raw(self.kind)
745    }
746}
747
748#[derive(Debug, Clone, Deserialize)]
749/// Wraps the corresponding Model I/O light info counterpart.
750pub struct LightInfo {
751    pub light_type: u32,
752    pub color_space: String,
753}
754
755impl LightInfo {
756    #[must_use]
757    /// Calls the corresponding Model I/O method on the wrapped Model I/O light info counterpart.
758    pub fn light_type_enum(&self) -> Option<LightType> {
759        LightType::from_raw(self.light_type)
760    }
761}
762
763#[derive(Debug, Clone, Deserialize)]
764/// Wraps the corresponding Model I/O physically plausible light info counterpart.
765pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O physically plausible light info counterpart.
779    pub fn light_type_enum(&self) -> Option<LightType> {
780        LightType::from_raw(self.light_type)
781    }
782}
783
784#[derive(Debug, Clone, Deserialize)]
785/// Wraps the corresponding Model I/O area light info counterpart.
786pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O area light info counterpart.
803    pub fn light_type_enum(&self) -> Option<LightType> {
804        LightType::from_raw(self.light_type)
805    }
806}
807
808#[derive(Debug, Clone, Deserialize)]
809/// Wraps the corresponding Model I/O photometric light info counterpart.
810pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O photometric light info counterpart.
827    pub fn light_type_enum(&self) -> Option<LightType> {
828        LightType::from_raw(self.light_type)
829    }
830}
831
832#[derive(Debug, Clone, Deserialize)]
833/// Wraps the corresponding Model I/O camera info counterpart.
834pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O camera info counterpart.
863    pub fn projection_enum(&self) -> Option<CameraProjection> {
864        CameraProjection::from_raw(self.projection)
865    }
866}
867
868#[derive(Debug, Clone, Deserialize)]
869/// Wraps the corresponding Model I/O stereoscopic camera info counterpart.
870pub 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)]
882/// Wraps the corresponding Model I/O voxel index extent counterpart.
883pub struct VoxelIndexExtent {
884    pub minimum_extent: [i32; 4],
885    pub maximum_extent: [i32; 4],
886}
887
888#[derive(Debug, Clone, Deserialize)]
889/// Wraps the corresponding Model I/O voxel array info counterpart.
890pub 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)]
900/// Wraps the corresponding Model I/O animated value info counterpart.
901pub 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    /// Calls the corresponding Model I/O method on the wrapped Model I/O animated value info counterpart.
915    pub fn precision_enum(&self) -> Option<DataPrecision> {
916        DataPrecision::from_raw(self.precision)
917    }
918
919    #[must_use]
920    /// Calls the corresponding Model I/O method on the wrapped Model I/O animated value info counterpart.
921    pub fn interpolation_enum(&self) -> Option<AnimatedValueInterpolation> {
922        AnimatedValueInterpolation::from_raw(self.interpolation)
923    }
924}
925
926#[derive(Debug, Clone, Deserialize)]
927/// Wraps the corresponding Model I/O packed joint animation info counterpart.
928pub 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)]
936/// Wraps the corresponding Model I/O animation bind component info counterpart.
937pub 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)]
945/// Wraps the corresponding Model I/O skeleton info counterpart.
946pub 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)]
956/// Wraps the corresponding Model I/O matrix4x4array info counterpart.
957pub struct Matrix4x4ArrayInfo {
958    pub element_count: usize,
959    pub precision: u32,
960}
961
962impl Matrix4x4ArrayInfo {
963    #[must_use]
964    /// Calls the corresponding Model I/O method on the wrapped Model I/O matrix4x4array info counterpart.
965    pub fn precision_enum(&self) -> Option<DataPrecision> {
966        DataPrecision::from_raw(self.precision)
967    }
968}
969
970#[derive(Debug, Clone, Deserialize)]
971/// Wraps the corresponding Model I/O vertex attribute descriptor info counterpart.
972pub 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)]
982/// Wraps the corresponding Model I/O vertex descriptor info counterpart.
983pub struct VertexDescriptorInfo {
984    pub attribute_count: usize,
985    pub attributes: Vec<VertexAttributeDescriptorInfo>,
986    pub layout_strides: Vec<usize>,
987}
988
989/// Groups helper APIs for the corresponding Model I/O vertex format symbols.
990pub mod vertex_format {
991    /// Exposes the corresponding Model I/O constant for invalid: u32.
992    pub const INVALID: u32 = 0;
993    /// Exposes the corresponding Model I/O constant for packed bit: u32.
994    pub const PACKED_BIT: u32 = 0x1000;
995
996    /// Exposes the corresponding Model I/O constant for uchar bits: u32.
997    pub const UCHAR_BITS: u32 = 0x10000;
998    /// Exposes the corresponding Model I/O constant for char bits: u32.
999    pub const CHAR_BITS: u32 = 0x20000;
1000    /// Exposes the corresponding Model I/O constant for uchar normalized bits: u32.
1001    pub const UCHAR_NORMALIZED_BITS: u32 = 0x30000;
1002    /// Exposes the corresponding Model I/O constant for char normalized bits: u32.
1003    pub const CHAR_NORMALIZED_BITS: u32 = 0x40000;
1004    /// Exposes the corresponding Model I/O constant for ushort bits: u32.
1005    pub const USHORT_BITS: u32 = 0x50000;
1006    /// Exposes the corresponding Model I/O constant for short bits: u32.
1007    pub const SHORT_BITS: u32 = 0x60000;
1008    /// Exposes the corresponding Model I/O constant for ushort normalized bits: u32.
1009    pub const USHORT_NORMALIZED_BITS: u32 = 0x70000;
1010    /// Exposes the corresponding Model I/O constant for short normalized bits: u32.
1011    pub const SHORT_NORMALIZED_BITS: u32 = 0x80000;
1012    /// Exposes the corresponding Model I/O constant for uint bits: u32.
1013    pub const UINT_BITS: u32 = 0x90000;
1014    /// Exposes the corresponding Model I/O constant for int bits: u32.
1015    pub const INT_BITS: u32 = 0xA0000;
1016    /// Exposes the corresponding Model I/O constant for half bits: u32.
1017    pub const HALF_BITS: u32 = 0xB0000;
1018    /// Exposes the corresponding Model I/O constant for float bits: u32.
1019    pub const FLOAT_BITS: u32 = 0xC0000;
1020
1021    /// Exposes the corresponding Model I/O constant for uchar: u32.
1022    pub const UCHAR: u32 = UCHAR_BITS | 1;
1023    /// Exposes the corresponding Model I/O constant for uchar2: u32.
1024    pub const UCHAR2: u32 = UCHAR_BITS | 2;
1025    /// Exposes the corresponding Model I/O constant for uchar3: u32.
1026    pub const UCHAR3: u32 = UCHAR_BITS | 3;
1027    /// Exposes the corresponding Model I/O constant for uchar4: u32.
1028    pub const UCHAR4: u32 = UCHAR_BITS | 4;
1029
1030    /// Exposes the corresponding Model I/O constant for char: u32.
1031    pub const CHAR: u32 = CHAR_BITS | 1;
1032    /// Exposes the corresponding Model I/O constant for char2: u32.
1033    pub const CHAR2: u32 = CHAR_BITS | 2;
1034    /// Exposes the corresponding Model I/O constant for char3: u32.
1035    pub const CHAR3: u32 = CHAR_BITS | 3;
1036    /// Exposes the corresponding Model I/O constant for char4: u32.
1037    pub const CHAR4: u32 = CHAR_BITS | 4;
1038
1039    /// Exposes the corresponding Model I/O constant for uchar normalized: u32.
1040    pub const UCHAR_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 1;
1041    /// Exposes the corresponding Model I/O constant for uchar2 normalized: u32.
1042    pub const UCHAR2_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 2;
1043    /// Exposes the corresponding Model I/O constant for uchar3 normalized: u32.
1044    pub const UCHAR3_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 3;
1045    /// Exposes the corresponding Model I/O constant for uchar4 normalized: u32.
1046    pub const UCHAR4_NORMALIZED: u32 = UCHAR_NORMALIZED_BITS | 4;
1047
1048    /// Exposes the corresponding Model I/O constant for char normalized: u32.
1049    pub const CHAR_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 1;
1050    /// Exposes the corresponding Model I/O constant for char2 normalized: u32.
1051    pub const CHAR2_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 2;
1052    /// Exposes the corresponding Model I/O constant for char3 normalized: u32.
1053    pub const CHAR3_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 3;
1054    /// Exposes the corresponding Model I/O constant for char4 normalized: u32.
1055    pub const CHAR4_NORMALIZED: u32 = CHAR_NORMALIZED_BITS | 4;
1056
1057    /// Exposes the corresponding Model I/O constant for ushort: u32.
1058    pub const USHORT: u32 = USHORT_BITS | 1;
1059    /// Exposes the corresponding Model I/O constant for ushort2: u32.
1060    pub const USHORT2: u32 = USHORT_BITS | 2;
1061    /// Exposes the corresponding Model I/O constant for ushort3: u32.
1062    pub const USHORT3: u32 = USHORT_BITS | 3;
1063    /// Exposes the corresponding Model I/O constant for ushort4: u32.
1064    pub const USHORT4: u32 = USHORT_BITS | 4;
1065
1066    /// Exposes the corresponding Model I/O constant for short: u32.
1067    pub const SHORT: u32 = SHORT_BITS | 1;
1068    /// Exposes the corresponding Model I/O constant for short2: u32.
1069    pub const SHORT2: u32 = SHORT_BITS | 2;
1070    /// Exposes the corresponding Model I/O constant for short3: u32.
1071    pub const SHORT3: u32 = SHORT_BITS | 3;
1072    /// Exposes the corresponding Model I/O constant for short4: u32.
1073    pub const SHORT4: u32 = SHORT_BITS | 4;
1074
1075    /// Exposes the corresponding Model I/O constant for ushort normalized: u32.
1076    pub const USHORT_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 1;
1077    /// Exposes the corresponding Model I/O constant for ushort2 normalized: u32.
1078    pub const USHORT2_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 2;
1079    /// Exposes the corresponding Model I/O constant for ushort3 normalized: u32.
1080    pub const USHORT3_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 3;
1081    /// Exposes the corresponding Model I/O constant for ushort4 normalized: u32.
1082    pub const USHORT4_NORMALIZED: u32 = USHORT_NORMALIZED_BITS | 4;
1083
1084    /// Exposes the corresponding Model I/O constant for short normalized: u32.
1085    pub const SHORT_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 1;
1086    /// Exposes the corresponding Model I/O constant for short2 normalized: u32.
1087    pub const SHORT2_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 2;
1088    /// Exposes the corresponding Model I/O constant for short3 normalized: u32.
1089    pub const SHORT3_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 3;
1090    /// Exposes the corresponding Model I/O constant for short4 normalized: u32.
1091    pub const SHORT4_NORMALIZED: u32 = SHORT_NORMALIZED_BITS | 4;
1092
1093    /// Exposes the corresponding Model I/O constant for uint: u32.
1094    pub const UINT: u32 = UINT_BITS | 1;
1095    /// Exposes the corresponding Model I/O constant for uint2: u32.
1096    pub const UINT2: u32 = UINT_BITS | 2;
1097    /// Exposes the corresponding Model I/O constant for uint3: u32.
1098    pub const UINT3: u32 = UINT_BITS | 3;
1099    /// Exposes the corresponding Model I/O constant for uint4: u32.
1100    pub const UINT4: u32 = UINT_BITS | 4;
1101
1102    /// Exposes the corresponding Model I/O constant for int: u32.
1103    pub const INT: u32 = INT_BITS | 1;
1104    /// Exposes the corresponding Model I/O constant for int2: u32.
1105    pub const INT2: u32 = INT_BITS | 2;
1106    /// Exposes the corresponding Model I/O constant for int3: u32.
1107    pub const INT3: u32 = INT_BITS | 3;
1108    /// Exposes the corresponding Model I/O constant for int4: u32.
1109    pub const INT4: u32 = INT_BITS | 4;
1110
1111    /// Exposes the corresponding Model I/O constant for half: u32.
1112    pub const HALF: u32 = HALF_BITS | 1;
1113    /// Exposes the corresponding Model I/O constant for half2: u32.
1114    pub const HALF2: u32 = HALF_BITS | 2;
1115    /// Exposes the corresponding Model I/O constant for half3: u32.
1116    pub const HALF3: u32 = HALF_BITS | 3;
1117    /// Exposes the corresponding Model I/O constant for half4: u32.
1118    pub const HALF4: u32 = HALF_BITS | 4;
1119
1120    /// Exposes the corresponding Model I/O constant for float: u32.
1121    pub const FLOAT: u32 = FLOAT_BITS | 1;
1122    /// Exposes the corresponding Model I/O constant for float2: u32.
1123    pub const FLOAT2: u32 = FLOAT_BITS | 2;
1124    /// Exposes the corresponding Model I/O constant for float3: u32.
1125    pub const FLOAT3: u32 = FLOAT_BITS | 3;
1126    /// Exposes the corresponding Model I/O constant for float4: u32.
1127    pub const FLOAT4: u32 = FLOAT_BITS | 4;
1128
1129    /// Exposes the corresponding Model I/O constant for int1010102 normalized: u32.
1130    pub const INT1010102_NORMALIZED: u32 = INT_BITS | PACKED_BIT | 4;
1131    /// Exposes the corresponding Model I/O constant for uint1010102 normalized: u32.
1132    pub const UINT1010102_NORMALIZED: u32 = UINT_BITS | PACKED_BIT | 4;
1133}