Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/primitives.h')
-rw-r--r--src/model/primitives.h45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/model/primitives.h b/src/model/primitives.h
index 28da706..d11ac61 100644
--- a/src/model/primitives.h
+++ b/src/model/primitives.h
@@ -7,6 +7,8 @@
#ifndef __INCLUDED_MODEL_PRIMITIVES_H__
#define __INCLUDED_MODEL_PRIMITIVES_H__
+#include <list>
+
#include "math/vector3f.h"
#include "math/color.h"
#include "model/triangle.h"
@@ -15,28 +17,49 @@
namespace model
{
-/// a list of Triangle and Quad primitives that have to be rendered using the same material, to be parsed into fragments
+/// a list of Triangle and Quad primitives with the same material, to be parsed into fragments
class Primitives
{
public:
+ /// type definition for a list of triangles
+ typedef std::list<Triangle *> Triangles;
+
+ /// type definition for a list of quads
+ typedef std::list<Quad *> Quads;
+
Primitives(unsigned int material);
~Primitives();
-
+
/// the material to be used for these primitives
- inline unsigned int material() const { return primitives_material; }
-
+ inline unsigned int material() const
+ {
+ return primitives_material;
+ }
+
+ /// list of triangles
+ inline Triangles & triangles()
+ {
+ return primitives_triangles;
+ }
+
+ /// list of quads
+ inline Quads & quads()
+ {
+ return primitives_quads;
+ }
+
/// add a Triangle primitive
void add_triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
- math::Vector3f const &normal, math::Color const &color, bool detail);
-
+ math::Vector3f const &normal, math::Color const &color, bool detail);
+
/// add a Quad primitive
void add_quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
- math::Vector3f const &normal, math::Color const &color, bool detail);
-
+ math::Vector3f const &normal, math::Color const &color, bool detail);
+
private:
- std::list<Triangle *> primitives_triangles;
- std::list<Quad *> primitives_quads;
-
+ Triangles primitives_triangles;
+ Quads primitives_quads;
+
unsigned int primitives_material;
};