goat3d

view src/mesh.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 a5c5cec3cb88
children dad392c710df
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <vector>
5 #include "object.h"
6 #include "material.h"
8 namespace g3dimpl {
10 class Node;
12 struct Face {
13 int v[3];
14 };
16 struct Int4 {
17 int x, y, z, w;
19 Int4();
20 Int4(int x, int y, int z, int w);
21 };
23 class Mesh : public Object {
24 public:
25 Material *material;
27 std::vector<Vector3> vertices;
28 std::vector<Vector3> normals;
29 std::vector<Vector3> tangents;
30 std::vector<Vector2> texcoords;
31 std::vector<Vector4> skin_weights;
32 std::vector<Int4> skin_matrices;
33 std::vector<Vector4> colors;
34 std::vector<Face> faces;
36 std::vector<Node*> bones;
38 Mesh();
40 bool load(const char *fname);
41 bool save(const char *fname) const;
43 void set_material(Material *mat);
44 Material *get_material();
45 const Material *get_material() const;
46 };
48 } // namespace g3dimpl
50 #endif // MESH_H_