Loading [MathJax]/extensions/TeX/AMSsymbols.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
BlinnPhongMaterialData.hpp
1 #pragma once
2 
3 #include <Core/Asset/MaterialData.hpp>
4 #include <Core/Utils/Color.hpp>
5 #include <Core/Utils/Log.hpp>
6 
7 namespace Ra {
8 namespace Core {
9 namespace Asset {
10 
11 // RADIUM SUPPORTED MATERIALS
12 class RA_CORE_API BlinnPhongMaterialData : public MaterialData
13 {
14  public:
15  explicit BlinnPhongMaterialData( const std::string& name = "" );
16 
18  inline void displayInfo() const final;
19 
21  inline bool hasDiffuse() const;
22 
23  inline bool hasSpecular() const;
24 
25  inline bool hasShininess() const;
26 
27  inline bool hasOpacity() const;
28 
29  inline bool hasDiffuseTexture() const;
30 
31  inline bool hasSpecularTexture() const;
32 
33  inline bool hasShininessTexture() const;
34 
35  inline bool hasNormalTexture() const;
36 
37  inline bool hasOpacityTexture() const;
38 
40  Core::Utils::Color m_diffuse;
41  Core::Utils::Color m_specular;
42  Scalar m_shininess;
43  Scalar m_opacity;
44  std::string m_texDiffuse;
45  std::string m_texSpecular;
46  std::string m_texShininess;
47  std::string m_texNormal;
48  std::string m_texOpacity;
49  bool m_hasDiffuse;
50  bool m_hasSpecular;
51  bool m_hasShininess;
52  bool m_hasOpacity;
53  bool m_hasTexDiffuse;
54  bool m_hasTexSpecular;
55  bool m_hasTexShininess;
56  bool m_hasTexNormal;
57  bool m_hasTexOpacity;
58 };
59 
63 inline bool BlinnPhongMaterialData::hasDiffuse() const {
64  return m_hasDiffuse;
65 }
66 
67 inline bool BlinnPhongMaterialData::hasSpecular() const {
68  return m_hasSpecular;
69 }
70 
71 inline bool BlinnPhongMaterialData::hasShininess() const {
72  return m_hasShininess;
73 }
74 
75 inline bool BlinnPhongMaterialData::hasOpacity() const {
76  return m_hasOpacity;
77 }
78 
79 inline bool BlinnPhongMaterialData::hasDiffuseTexture() const {
80  return m_hasTexDiffuse;
81 }
82 
83 inline bool BlinnPhongMaterialData::hasSpecularTexture() const {
84  return m_hasTexSpecular;
85 }
86 
87 inline bool BlinnPhongMaterialData::hasShininessTexture() const {
88  return m_hasTexShininess;
89 }
90 
91 inline bool BlinnPhongMaterialData::hasNormalTexture() const {
92  return m_hasTexNormal;
93 }
94 
95 inline bool BlinnPhongMaterialData::hasOpacityTexture() const {
96  return m_hasTexOpacity;
97 }
98 
100 inline void BlinnPhongMaterialData::displayInfo() const {
101  using namespace Core::Utils; // log
102  auto print = []( bool ok, const std::string& name, const auto& value ) {
103  if ( ok ) { LOG( logINFO ) << name << value; }
104  else { LOG( logINFO ) << name << "NO"; }
105  };
106 
107  LOG( logINFO ) << "======== MATERIAL INFO ========";
108  print( hasDiffuse(), " Kd : ", m_diffuse.transpose() );
109  print( hasSpecular(), " Ks : ", m_specular.transpose() );
110  print( hasShininess(), " Ns : ", m_shininess );
111  print( hasOpacity(), " Opacity : ", m_opacity );
112  print( hasDiffuseTexture(), " Kd Texture : ", m_texDiffuse );
113  print( hasSpecularTexture(), " Ks Texture : ", m_texSpecular );
114  print( hasShininessTexture(), " Ns Texture : ", m_texShininess );
115  print( hasNormalTexture(), " Normal Texture : ", m_texNormal );
116  print( hasOpacityTexture(), " Alpha Texture : ", m_texOpacity );
117 }
118 
119 } // namespace Asset
120 } // namespace Core
121 } // namespace Ra
Definition: Cage.cpp:3