COGS
Computer Graphics Structures library
MaterialModel.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef COGS_MATERIAL_MODEL_H
7 #define COGS_MATERIAL_MODEL_H
8 #include <array>
9 
10 #include <COGS/Color.h>
11 #include <COGS/API.h>
12 
13 namespace cogs
14 {
15 
16  enum class MaterialTextures : uint8_t
17  {
18  diffuse,
19  normal,
20  displace,
21  _count
22  };
23 
24  enum class MaterialColors : uint8_t
25  {
26  ambient,
27  diffuse,
28  specular,
29  _count
30  };
31 
32  struct COGS_API Material
33  {
34  Material();
35  Material(const cogs::Color4b &color, uint32_t shininess);
36  cogs::Color4b GetColor(const MaterialColors &type);
37  // sets all available colors to a defined value
38  void SetAllColors(const cogs::Color4b &new_color);
39  std::array<cogs::Color4b, size_t(MaterialColors::_count)> color;
40  uint32_t shininess = 60;
41  };
42 
43  class COGS_API MaterialModel
44  {
45  public:
46  cogs::Color4b GetMaterialColor(const MaterialColors &c_type) const;
47  void SetMaterialColor(const MaterialColors &c_type, const cogs::Color4b &new_color);
48  void SetMaterialColors(const cogs::Color4b &new_color);
49 
50  uint32_t GetMaterialShininess() const;
51  void SetMaterialShininess(const uint32_t value);
52 
53  std::string GetTextureFile(const MaterialTextures &t_type) const;
54  void SetTextureFile(const MaterialTextures &t_type, const std::string &texture);
55 
56  private:
57  Material material_;
58  std::array<std::string, size_t(MaterialTextures::_count)> textures_;
59  };
60 
61 }
62 #endif /* !COGS_MATERIAL_MODEL_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
Holds four color channels in uint8 format in range 0-255.
Definition: Color.h:39