1use std::os::raw::{c_uint, c_void};
2
3use anim::*;
4use camera::*;
5use light::*;
6use material::*;
7use mesh::*;
8use metadata::*;
9use texture::*;
10use types::*;
11
12#[repr(C)]
13pub struct AiNode {
14 pub name: AiString,
15 pub transformation: AiMatrix4x4,
16 pub parent: *mut AiNode,
17 pub num_children: c_uint,
18 pub children: *mut *mut AiNode,
19 pub num_meshes: c_uint,
20 pub meshes: *mut c_uint,
21 pub metadata: *mut AiMetadata,
22}
23
24bitflags! {
25 #[repr(C)]
26 pub struct AiSceneFlags : c_uint {
27 const AI_SCENE_FLAGS_INCOMPLETE = 0x1;
28 const AI_SCENE_FLAGS_VALIDATED = 0x2;
29 const AI_SCENE_FLAGS_VALIDATION_WARNING = 0x4;
30 const AI_SCENE_FLAGS_NON_VERBOSE_FORMAT = 0x8;
31 const AI_SCENE_FLAGS_TERRAIN = 0x10;
32 const AI_SCENE_FLAGS_ALLOW_SHARED = 0x20;
33 }
34}
35
36#[repr(C)]
37pub struct AiScene {
38 pub flags: AiSceneFlags,
39 pub root_node: *mut AiNode,
40 pub num_meshes: c_uint,
41 pub meshes: *mut *mut AiMesh,
42 pub num_materials: c_uint,
43 pub materials: *mut *mut AiMaterial,
44 pub num_animations: c_uint,
45 pub animations: *mut *mut AiAnimation,
46 pub num_textures: c_uint,
47 pub textures: *mut *mut AiTexture,
48 pub num_lights: c_uint,
49 pub lights: *mut *mut AiLight,
50 pub num_cameras: c_uint,
51 pub cameras: *mut *mut AiCamera,
52 private: *const c_void,
53}
54
55impl AiScene {
56 pub fn has_meshes(&self) -> bool {
57 !self.meshes.is_null() && self.num_meshes > 0
58 }
59 pub fn has_materials(&self) -> bool {
60 !self.materials.is_null() && self.num_materials > 0
61 }
62 pub fn has_lights(&self) -> bool {
63 !self.lights.is_null() && self.num_lights > 0
64 }
65 pub fn has_textures(&self) -> bool {
66 !self.textures.is_null() && self.num_textures > 0
67 }
68 pub fn has_cameras(&self) -> bool {
69 !self.cameras.is_null() && self.num_cameras > 0
70 }
71 pub fn has_animations(&self) -> bool {
72 !self.animations.is_null() && self.num_animations > 0
73 }
74}