goat3d

view src/goat3d_impl.h @ 29:3d669155709d

- switched the unix build to use the internal vmath/anim as well - fixed a memory corruption issue which was caused by including the system-wide installed version of the anim.h header file - started the ass2goat assimp->goat3d converter
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 29 Sep 2013 21:53:03 +0300
parents f1b4c27382ce
children a5c5cec3cb88
line source
1 #ifndef GOAT3D_IMPL_H_
2 #define GOAT3D_IMPL_H_
4 #include <string>
5 #include <vmath/vmath.h>
6 #include "goat3d.h"
7 #include "mesh.h"
8 #include "light.h"
9 #include "camera.h"
10 #include "material.h"
11 #include "node.h"
13 extern int goat_log_level;
15 #if __cplusplus >= 201103L
16 #define MOVE(x) std::move(x)
17 #else
18 #define MOVE(x) x
19 #endif
21 #define VECDATA(type, data, num) \
22 MOVE(std::vector<type>((type*)(data), (type*)(data) + (num)))
25 class Scene {
26 private:
27 std::string name;
28 Vector3 ambient;
30 std::vector<Material*> materials;
31 std::vector<Mesh*> meshes;
32 std::vector<Light*> lights;
33 std::vector<Camera*> cameras;
34 std::vector<Node*> nodes;
36 public:
37 Scene();
38 ~Scene();
40 void clear();
42 void set_name(const char *name);
43 const char *get_name() const;
45 void set_ambient(const Vector3 &amb);
46 const Vector3 &get_ambient() const;
48 void add_material(Material *mat);
49 Material *get_material(int idx) const;
50 Material *get_material(const char *name) const;
51 int get_material_count() const;
53 void add_mesh(Mesh *mesh);
54 Mesh *get_mesh(int idx) const;
55 Mesh *get_mesh(const char *name) const;
56 int get_mesh_count() const;
58 void add_light(Light *light);
59 Light *get_light(int idx) const;
60 Light *get_light(const char *name) const;
61 int get_light_count() const;
63 void add_camera(Camera *cam);
64 Camera *get_camera(int idx) const;
65 Camera *get_camera(const char *name) const;
66 int get_camera_count() const;
68 void add_node(Node *node);
69 Node *get_node(int idx) const;
70 Node *get_node(const char *name) const;
71 int get_node_count() const;
73 bool load(goat3d_io *io);
74 bool save(goat3d_io *io) const;
76 bool loadxml(goat3d_io *io);
77 bool savexml(goat3d_io *io) const;
78 };
80 void io_fprintf(goat3d_io *io, const char *fmt, ...);
81 void io_vfprintf(goat3d_io *io, const char *fmt, va_list ap);
83 #endif // GOAT3D_IMPL_H_