From ba9d61266c5f5d3d618e55bf6b85a2569c04c29f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 8 Feb 2009 16:50:54 +0000 Subject: materials system --- src/model/material.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/model/material.h') diff --git a/src/model/material.h b/src/model/material.h index 8081792..a2ba0d6 100644 --- a/src/model/material.h +++ b/src/model/material.h @@ -10,6 +10,8 @@ #include #include +#include "math/color.h" + namespace model { @@ -18,7 +20,7 @@ class Material { public: /// surface flags - enum SurfaceFlags { None=0, Primary=1, Secondary=2, Tertiary=3, Dark=4, Light=8, Engine=16}; + enum SurfaceFlags { None=0, Primary=1, Secondary=2, Tertiary=3, Bright=4, Engine=8, Environment=16}; /// type definition for the material registry typedef std::map Registry; @@ -26,7 +28,24 @@ public: Material(const std::string &name); ~Material(); - inline const std::string &name() { return material_name; } + inline const std::string &name() const { return material_name; } + + inline const math::Color &color() const { return material_color; } + + inline const unsigned int flags() const { return material_flags; } + + inline void set_flags(SurfaceFlags flags) + { + material_flags |= flags; + } + + inline void unset_flags(SurfaceFlags flags) + { + material_flags &= ~flags; + } + + + void set_color(const math::Color &color); /* ---- static ----------------------------------------------------- */ @@ -54,7 +73,9 @@ public: private: std::string material_name; - + math::Color material_color; + unsigned int material_flags; + /// the material registry static Registry material_registry; -- cgit v1.2.3