goat3d
annotate src/mesh.h @ 26:1c601bf07b86
added the node API glue
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 28 Sep 2013 20:36:55 +0300 |
parents | f1b4c27382ce |
children | a5c5cec3cb88 |
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@8 | 8 class Node; |
nuclear@1 | 9 |
nuclear@8 | 10 struct Face { |
nuclear@8 | 11 int v[3]; |
nuclear@0 | 12 }; |
nuclear@0 | 13 |
nuclear@8 | 14 struct Int4 { |
nuclear@8 | 15 int x, y, z, w; |
nuclear@1 | 16 }; |
nuclear@1 | 17 |
nuclear@8 | 18 class Mesh : public Object { |
nuclear@8 | 19 public: |
nuclear@8 | 20 Material *material; |
nuclear@1 | 21 |
nuclear@8 | 22 std::vector<Vector3> vertices; |
nuclear@8 | 23 std::vector<Vector3> normals; |
nuclear@8 | 24 std::vector<Vector3> tangents; |
nuclear@15 | 25 std::vector<Vector2> texcoords; |
nuclear@8 | 26 std::vector<Vector4> skin_weights; |
nuclear@8 | 27 std::vector<Int4> skin_matrices; |
nuclear@8 | 28 std::vector<Vector4> colors; |
nuclear@8 | 29 std::vector<Face> faces; |
nuclear@1 | 30 |
nuclear@15 | 31 std::vector<Node*> bones; |
nuclear@15 | 32 |
nuclear@8 | 33 Mesh(); |
nuclear@1 | 34 |
nuclear@19 | 35 bool load(const char *fname); |
nuclear@19 | 36 bool save(const char *fname) const; |
nuclear@19 | 37 |
nuclear@15 | 38 void set_material(Material *mat); |
nuclear@15 | 39 Material *get_material(); |
nuclear@15 | 40 const Material *get_material() const; |
nuclear@1 | 41 }; |
nuclear@1 | 42 |
nuclear@0 | 43 #endif // MESH_H_ |