All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PackedTransitionMaterial.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IMaterial.h"
7 #include "IdTypes.h"
8 #include "Lighting.h"
9 #include "Rendering.h"
10 #include "PackedDiffuseTransitionShader.h"
11 #include "VectorMathDecl.h"
12 #include "TextureMinifyType.h"
13 #include <string>
14 
15 
16 namespace Eegeo
17 {
18  namespace Rendering
19  {
20  namespace Materials
21  {
23  {
24  public:
26  const TMaterialId materialId,
27  const std::string& name,
29  const Lighting::GlobalLighting& lighting,
30  const Lighting::GlobalFogging& fogging,
31  Rendering::TextureMinifyType textureMinifyType,
32  bool useAlternativeAmbient,
33  bool textureRepeat
34  );
35 
37  {
38  }
39 
40  bool IsUsingAlternativeAmbient() const { return m_useAlternativeAmbient; }
41  void UseAlternativeAmbient(bool useAlternativeAmbient) { m_useAlternativeAmbient = useAlternativeAmbient; }
42 
43  const TMaterialId GetId() const { return m_id; }
44  const Shader& GetShader() const { return m_shader; }
45  const std::string& GetName() const { return m_name; }
46 
47  void SetLerpParam(float t) { m_lerpParam = t; }
48  float GetLerpParam() const { return m_lerpParam; }
49 
50  void SetState(Rendering::GLState& glState) const;
51 
52  void SetStatePerRenderable(const Rendering::RenderableBase* renderableBase, Rendering::GLState& glState) const;
53 
54  protected:
55  void SetMVP(const m44& mvp) const
56  {
57  m_shader.SetMVP(mvp);
58  }
59 
60  void SetUVBounds(const Eegeo::v2& min, const Eegeo::v2& max) const
61  {
62  m_shader.SetUVBounds(min, max);
63  }
64 
65  void SetLerpParam(float t) const
66  {
67  m_shader.SetLerpParam(t);
68  }
69 
70  const TMaterialId m_id;
71  const std::string m_name;
73  const Lighting::GlobalLighting& m_lighting;
74  const Lighting::GlobalFogging& m_fogging;
75  float m_lerpParam;
76  Rendering::TextureMinifyType m_textureMinifyType;
77  bool m_textureRepeat;
78  bool m_useAlternativeAmbient;
79  };
80  }
81  }
82 }
83