nuclear@54: /* nuclear@54: goat3d - 3D scene, character, and animation file format library. nuclear@54: Copyright (C) 2013-2014 John Tsiombikas nuclear@54: nuclear@54: This program is free software: you can redistribute it and/or modify nuclear@54: it under the terms of the GNU Lesser General Public License as published by nuclear@54: the Free Software Foundation, either version 3 of the License, or nuclear@54: (at your option) any later version. nuclear@54: nuclear@54: This program is distributed in the hope that it will be useful, nuclear@54: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@54: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@54: GNU Lesser General Public License for more details. nuclear@54: nuclear@54: You should have received a copy of the GNU Lesser General Public License nuclear@54: along with this program. If not, see . nuclear@54: */ nuclear@0: #ifndef MESH_H_ nuclear@0: #define MESH_H_ nuclear@0: nuclear@1: #include nuclear@8: #include "object.h" nuclear@8: #include "material.h" nuclear@1: nuclear@47: namespace g3dimpl { nuclear@47: nuclear@8: class Node; nuclear@1: nuclear@8: struct Face { nuclear@8: int v[3]; nuclear@0: }; nuclear@0: nuclear@8: struct Int4 { nuclear@8: int x, y, z, w; nuclear@40: nuclear@40: Int4(); nuclear@40: Int4(int x, int y, int z, int w); nuclear@1: }; nuclear@1: nuclear@8: class Mesh : public Object { nuclear@8: public: nuclear@8: Material *material; nuclear@1: nuclear@8: std::vector vertices; nuclear@8: std::vector normals; nuclear@8: std::vector tangents; nuclear@15: std::vector texcoords; nuclear@8: std::vector skin_weights; nuclear@8: std::vector skin_matrices; nuclear@8: std::vector colors; nuclear@8: std::vector faces; nuclear@1: nuclear@15: std::vector bones; nuclear@15: nuclear@8: Mesh(); nuclear@1: nuclear@19: bool load(const char *fname); nuclear@19: bool save(const char *fname) const; nuclear@19: nuclear@15: void set_material(Material *mat); nuclear@15: Material *get_material(); nuclear@15: const Material *get_material() const; nuclear@1: }; nuclear@1: nuclear@47: } // namespace g3dimpl nuclear@47: nuclear@0: #endif // MESH_H_