diff options
Diffstat (limited to 'src/model/material.h')
-rw-r--r-- | src/model/material.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/model/material.h b/src/model/material.h index 2c66aae..6c332e2 100644 --- a/src/model/material.h +++ b/src/model/material.h @@ -23,8 +23,11 @@ public: /// function pointer type for local functions typedef void(* LoaderFuncPtr)(Material *); + /// color types + enum ColorType {ColorMaterial = 0, ColorPrimary = 1, ColorSecondary = 2, ColorTertiary = 3, ColorEngine = 4 }; + /// surface flags - enum SurfaceFlags { None = 0, Primary = 1, Secondary = 2, Tertiary = 3, Bright = 4, Engine = 8, Environment = 16, Texture = 32, Ignore = 64, Clip = 128, Origin = 256, Decal = 512 }; + enum SurfaceFlags { FlagNone = 0, FlagBright = 1,FlagEnvironment = 2, FlagTexture = 4, FlagIgnore = 8, FlagClip = 16, FlagOrigin = 32, FlagDecal = 64 }; /// type definition for the material registry typedef std::map<std::string, Material *> Registry; @@ -52,6 +55,10 @@ public: inline const unsigned int flags() const { return material_flags; } + + inline const ColorType colortype() const { + return material_colortype; + } inline const std::string &texture() const { return material_texture; @@ -80,7 +87,7 @@ public: * @see flags() * */ inline bool ignore_is_set() const { - return (flag_is_set(Ignore)); + return (flag_is_set(FlagIgnore)); } /** @@ -88,13 +95,15 @@ public: * @see flags() * */ inline bool origin_is_set() const { - return (flag_is_set(Origin)); + return (flag_is_set(FlagOrigin)); } /* ---- mutators ------------------------------------------- */ void set_color(const math::Color &color); + void set_specular(const math::Color &specular); + /** * @brief set the material texture name */ @@ -114,6 +123,12 @@ public: * @brief set the material texture size */ void set_size(const math::Vector2f &size); + + /** + * @brief set the color type + * */ + void set_colortype(ColorType colortype); + inline void set_flags(SurfaceFlags flags) { material_flags |= flags; @@ -164,6 +179,7 @@ private: math::Color material_color; math::Color material_specular; unsigned int material_flags; + ColorType material_colortype; std::string material_texture; size_t material_texture_id; |