goat3d
annotate src/goat3d_impl.h @ 60:0c3576325480
moving the exporter along slowly
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 30 Mar 2014 08:53:33 +0300 |
parents | fa5c52ea9d59 |
children | 99715321ad6d |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef GOAT3D_IMPL_H_ |
nuclear@0 | 2 #define GOAT3D_IMPL_H_ |
nuclear@0 | 3 |
nuclear@0 | 4 #include <string> |
nuclear@1 | 5 #include <vmath/vmath.h> |
nuclear@0 | 6 #include "goat3d.h" |
nuclear@0 | 7 #include "mesh.h" |
nuclear@0 | 8 #include "light.h" |
nuclear@0 | 9 #include "camera.h" |
nuclear@0 | 10 #include "material.h" |
nuclear@12 | 11 #include "node.h" |
nuclear@0 | 12 |
nuclear@47 | 13 namespace g3dimpl { |
nuclear@47 | 14 |
nuclear@15 | 15 extern int goat_log_level; |
nuclear@15 | 16 |
nuclear@19 | 17 #if __cplusplus >= 201103L |
nuclear@19 | 18 #define MOVE(x) std::move(x) |
nuclear@19 | 19 #else |
nuclear@19 | 20 #define MOVE(x) x |
nuclear@19 | 21 #endif |
nuclear@19 | 22 |
nuclear@19 | 23 #define VECDATA(type, data, num) \ |
nuclear@19 | 24 MOVE(std::vector<type>((type*)(data), (type*)(data) + (num))) |
nuclear@19 | 25 |
nuclear@51 | 26 std::string clean_filename(const char *str); |
nuclear@40 | 27 |
nuclear@19 | 28 |
nuclear@0 | 29 class Scene { |
nuclear@0 | 30 private: |
nuclear@0 | 31 std::string name; |
nuclear@0 | 32 Vector3 ambient; |
nuclear@0 | 33 |
nuclear@0 | 34 std::vector<Material*> materials; |
nuclear@0 | 35 std::vector<Mesh*> meshes; |
nuclear@0 | 36 std::vector<Light*> lights; |
nuclear@0 | 37 std::vector<Camera*> cameras; |
nuclear@12 | 38 std::vector<Node*> nodes; |
nuclear@0 | 39 |
nuclear@0 | 40 public: |
nuclear@0 | 41 Scene(); |
nuclear@0 | 42 ~Scene(); |
nuclear@0 | 43 |
nuclear@0 | 44 void clear(); |
nuclear@0 | 45 |
nuclear@0 | 46 void set_name(const char *name); |
nuclear@0 | 47 const char *get_name() const; |
nuclear@0 | 48 |
nuclear@0 | 49 void set_ambient(const Vector3 &amb); |
nuclear@0 | 50 const Vector3 &get_ambient() const; |
nuclear@0 | 51 |
nuclear@0 | 52 void add_material(Material *mat); |
nuclear@0 | 53 Material *get_material(int idx) const; |
nuclear@0 | 54 Material *get_material(const char *name) const; |
nuclear@9 | 55 int get_material_count() const; |
nuclear@0 | 56 |
nuclear@0 | 57 void add_mesh(Mesh *mesh); |
nuclear@0 | 58 Mesh *get_mesh(int idx) const; |
nuclear@0 | 59 Mesh *get_mesh(const char *name) const; |
nuclear@9 | 60 int get_mesh_count() const; |
nuclear@0 | 61 |
nuclear@0 | 62 void add_light(Light *light); |
nuclear@0 | 63 Light *get_light(int idx) const; |
nuclear@0 | 64 Light *get_light(const char *name) const; |
nuclear@9 | 65 int get_light_count() const; |
nuclear@0 | 66 |
nuclear@0 | 67 void add_camera(Camera *cam); |
nuclear@0 | 68 Camera *get_camera(int idx) const; |
nuclear@0 | 69 Camera *get_camera(const char *name) const; |
nuclear@9 | 70 int get_camera_count() const; |
nuclear@0 | 71 |
nuclear@0 | 72 void add_node(Node *node); |
nuclear@0 | 73 Node *get_node(int idx) const; |
nuclear@0 | 74 Node *get_node(const char *name) const; |
nuclear@9 | 75 int get_node_count() const; |
nuclear@0 | 76 |
nuclear@0 | 77 bool load(goat3d_io *io); |
nuclear@0 | 78 bool save(goat3d_io *io) const; |
nuclear@14 | 79 |
nuclear@14 | 80 bool loadxml(goat3d_io *io); |
nuclear@14 | 81 bool savexml(goat3d_io *io) const; |
nuclear@47 | 82 |
nuclear@47 | 83 bool load_anim(goat3d_io *io); |
nuclear@55 | 84 bool save_anim(goat3d_io *io) const; |
nuclear@47 | 85 |
nuclear@47 | 86 bool load_anim_xml(goat3d_io *io); |
nuclear@55 | 87 bool save_anim_xml(goat3d_io *io) const; |
nuclear@0 | 88 }; |
nuclear@0 | 89 |
nuclear@14 | 90 void io_fprintf(goat3d_io *io, const char *fmt, ...); |
nuclear@14 | 91 void io_vfprintf(goat3d_io *io, const char *fmt, va_list ap); |
nuclear@0 | 92 |
nuclear@47 | 93 } // namespace g3dimpl |
nuclear@47 | 94 |
nuclear@0 | 95 #endif // GOAT3D_IMPL_H_ |