diff options
Diffstat (limited to 'src/model/fragment.h')
-rw-r--r-- | src/model/fragment.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/src/model/fragment.h b/src/model/fragment.h index ba4eaf9..0df1b79 100644 --- a/src/model/fragment.h +++ b/src/model/fragment.h @@ -19,28 +19,46 @@ class Fragment public: /// fragment primitive type: triangles or quads enum Type {Triangles, Quads}; - + /// create a new fragment - Fragment (Type type, unsigned int material); - + Fragment(Type type, unsigned int material); + /// add a vertex to the fragment size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Color const & color, bool detail); - + + /// the type of primitives this fragment consists of + inline Type type() const + { + return fragment_type; + } + /// VertexArray index of the start of the fragment - inline size_t start() const { return fragment_start; } - + inline size_t index() const + { + return fragment_index; + } + /// number of structural vertices in the fragment - inline size_t structural_size() const { return fragment_structural_size; } - + inline size_t structural_size() const + { + return fragment_structural_size; + } + /// number of detail vertices in the fragment - inline size_t detail_size() const { return fragment_detail_size; } - + inline size_t detail_size() const + { + return fragment_detail_size; + } + /// material flags - inline unsigned int material() { return fragment_material; } - + inline unsigned int material() + { + return fragment_material; + } + private: Type fragment_type; - size_t fragment_start; + size_t fragment_index; size_t fragment_structural_size; size_t fragment_detail_size; unsigned int fragment_material; |