goat3d

view src/goat3d_impl.h @ 14:188c697b3b49

- added a document describing the goat3d file format chunk hierarchy - started an alternative XML-based file format - added the openctm library
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 04:47:05 +0300
parents be15ba7c5483
children f1b4c27382ce
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 class Scene {
14 private:
15 std::string name;
16 Vector3 ambient;
18 std::vector<Material*> materials;
19 std::vector<Mesh*> meshes;
20 std::vector<Light*> lights;
21 std::vector<Camera*> cameras;
22 std::vector<Node*> nodes;
24 public:
25 Scene();
26 ~Scene();
28 void clear();
30 void set_name(const char *name);
31 const char *get_name() const;
33 void set_ambient(const Vector3 &amb);
34 const Vector3 &get_ambient() const;
36 void add_material(Material *mat);
37 Material *get_material(int idx) const;
38 Material *get_material(const char *name) const;
39 int get_material_count() const;
41 void add_mesh(Mesh *mesh);
42 Mesh *get_mesh(int idx) const;
43 Mesh *get_mesh(const char *name) const;
44 int get_mesh_count() const;
46 void add_light(Light *light);
47 Light *get_light(int idx) const;
48 Light *get_light(const char *name) const;
49 int get_light_count() const;
51 void add_camera(Camera *cam);
52 Camera *get_camera(int idx) const;
53 Camera *get_camera(const char *name) const;
54 int get_camera_count() const;
56 void add_node(Node *node);
57 Node *get_node(int idx) const;
58 Node *get_node(const char *name) const;
59 int get_node_count() const;
61 bool load(goat3d_io *io);
62 bool save(goat3d_io *io) const;
64 bool loadxml(goat3d_io *io);
65 bool savexml(goat3d_io *io) const;
66 };
68 void io_fprintf(goat3d_io *io, const char *fmt, ...);
69 void io_vfprintf(goat3d_io *io, const char *fmt, va_list ap);
71 #endif // GOAT3D_IMPL_H_