All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnityInteriorMaterial.h
1 #pragma once
2 
3 #include "InteriorsMaterialBase.h"
4 #include "InteriorRenderable.h"
5 #include "UnityCallbacks.h"
6 #include <string>
7 
8 namespace Eegeo
9 {
10  namespace Unity
11  {
13  {
14  public:
15 
17  const void* unityMaterialHandle,
18  const IndoorMapCallbacks& indoorMapCallbacks,
19  const Rendering::TMaterialId materialId,
20  const std::string& name,
21  const Lighting::GlobalLighting& lighting,
23  bool useAlternativeAmbient,
24  bool isTranslucent,
25  bool isStencilMirror,
26  const v4& diffuseColor,
27  Resources::Interiors::InteriorsRenderableLayer::Type renderableLayer,
28  const Rendering::Shader& shader
29  )
31  materialId,
32  name,
33  lighting,
34  materialAssignmentObserver,
35  useAlternativeAmbient,
36  isTranslucent,
37  diffuseColor,
38  renderableLayer)
39  , m_unityMaterialHandle(unityMaterialHandle)
40  , m_shader(shader)
41  , m_isStencilMirror(isStencilMirror)
42  , m_indoorMapCallbacks(indoorMapCallbacks)
43  {
44  }
45 
47  {
48  m_indoorMapCallbacks.DeleteMaterial(m_unityMaterialHandle);
49  }
50 
51  const void* GetUnityMaterialHandle() const
52  {
53  return m_unityMaterialHandle;
54  }
55 
56  const Rendering::Shader& GetShader() const override
57  {
58  return m_shader;
59  }
60 
61  void OnAssignedToRenderable(Rendering::Renderables::InteriorRenderable& renderable) override
62  {
63  InteriorsMaterialBase::OnAssignedToRenderable(renderable);
64 
65  if (m_isStencilMirror)
66  {
67  renderable.SetStencilMirrorType(Resources::Interiors::StencilMirror_Mirror);
68  }
69  }
70 
71 
72  void SetStatePerRenderable(const Rendering::RenderableBase* renderableBase, Rendering::GLState& glState) const override
73  {
74 
75  }
76 
77  private:
78 
79  const void* m_unityMaterialHandle;
80  const Rendering::Shader& m_shader;
81  const bool m_isStencilMirror;
82  const IndoorMapCallbacks& m_indoorMapCallbacks;
83  };
84  }
85 }
86