goat3d

view src/mesh.h @ 40:a5c5cec3cb88

- added mesh attribute and face append functions - added Int4 constructor - continued the blender exporter - fixed a bug in clean_filename which made it produce unterminated strings - renamed clean_filename to goat3d_clean_filename and made it extern - added call to goat3d_clean_filename in the mesh XML export code to cleanup ctm filenames
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 13 Oct 2013 10:14:19 +0300
parents b35427826b60
children 498ca7ac7047
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 #include <vector>
5 #include "object.h"
6 #include "material.h"
8 class Node;
10 struct Face {
11 int v[3];
12 };
14 struct Int4 {
15 int x, y, z, w;
17 Int4();
18 Int4(int x, int y, int z, int w);
19 };
21 class Mesh : public Object {
22 public:
23 Material *material;
25 std::vector<Vector3> vertices;
26 std::vector<Vector3> normals;
27 std::vector<Vector3> tangents;
28 std::vector<Vector2> texcoords;
29 std::vector<Vector4> skin_weights;
30 std::vector<Int4> skin_matrices;
31 std::vector<Vector4> colors;
32 std::vector<Face> faces;
34 std::vector<Node*> bones;
36 Mesh();
38 bool load(const char *fname);
39 bool save(const char *fname) const;
41 void set_material(Material *mat);
42 Material *get_material();
43 const Material *get_material() const;
44 };
46 #endif // MESH_H_