From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/model/fragment.h | 105 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 39 deletions(-) (limited to 'src/model/fragment.h') diff --git a/src/model/fragment.h b/src/model/fragment.h index 0a9ca6a..6d65f7a 100644 --- a/src/model/fragment.h +++ b/src/model/fragment.h @@ -23,7 +23,7 @@ class Fragment public: /// fragment primitive type: triangles or quads enum Type {Triangles, Quads}; - + /// create a new fragment Fragment(Type type, const Material *material); @@ -31,43 +31,38 @@ public: * @brief copy constructor */ Fragment(const Fragment &other); - + /// add a vertex to the fragment size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, bool detail); /// add a vertex to the fragment size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Vector2f const &texcoord, bool detail); - + /// the type of primitives this fragment consists of - inline Type type() const - { + inline Type type() const { return fragment_type; } - + /// VertexArray index of the start of the fragment - inline size_t index() const - { + inline size_t index() const { return fragment_index; } - + /// number of structural vertices in the fragment - inline size_t structural_size() const - { + inline size_t structural_size() const { return fragment_structural_size; } - + /// number of detail vertices in the fragment - inline size_t detail_size() const - { + inline size_t detail_size() const { return fragment_detail_size; } - + /// material flags - inline const Material * material() const - { + inline const Material * material() const { return fragment_material; } - + private: Type fragment_type; size_t fragment_index; @@ -92,38 +87,70 @@ public: ~FragmentGroup(); - inline const Type type() const { return group_type; } + inline const Type type() const { + return group_type; + } - inline const math::Vector3f &location() const { return group_location; } + inline const math::Vector3f &location() const { + return group_location; + } - inline const math::Axis & axis() const { return group_axis; } + inline const math::Axis & axis() const { + return group_axis; + } - inline const float speed() const { return group_speed; } + inline const float speed() const { + return group_speed; + } - inline const float scale() const { return group_scale; } - - inline const bool transform() const { return group_transform; } + inline const float scale() const { + return group_scale; + } - - inline void set_type(const Type type) { group_type = type; } + inline const bool transform() const { + return group_transform; + } - inline void set_location(const math::Vector3f &location) { group_location.assign(location); } - inline void set_axis(const math::Axis &axis) { group_axis.assign(axis); } + inline void set_type(const Type type) { + group_type = type; + } - inline void set_speed(const float speed) { group_speed = speed; } + inline void set_location(const math::Vector3f &location) { + group_location.assign(location); + } + + inline void set_axis(const math::Axis &axis) { + group_axis.assign(axis); + } + + inline void set_speed(const float speed) { + group_speed = speed; + } + + inline void set_scale(const float scale) { + group_scale = scale; + } - inline void set_scale(const float scale) { group_scale = scale; } + inline void set_transform(const bool transform) { + group_transform = transform; + } + + inline iterator begin() { + return group_fragments.begin(); + } - inline void set_transform(const bool transform) { group_transform = transform; } - - inline iterator begin() { return group_fragments.begin(); } + inline iterator end() { + return group_fragments.end(); + } - inline iterator end() { return group_fragments.end(); } - - inline const size_t size() const { return group_fragments.size(); } - - inline void add_fragment(Fragment *fragment) { group_fragments.push_back(fragment); } + inline const size_t size() const { + return group_fragments.size(); + } + + inline void add_fragment(Fragment *fragment) { + group_fragments.push_back(fragment); + } void clear(); -- cgit v1.2.3