Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/model/fragment.h
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/model/fragment.h')
-rw-r--r--src/model/fragment.h105
1 files changed, 66 insertions, 39 deletions
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();