goat3d

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