All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BlueSphereController.h
1 // Copyright eeGeo Ltd (2012-2015), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "BlueSphere.h"
7 #include "ICallback.h"
8 #include "Rendering.h"
9 #include "Interiors.h"
10 #include "VectorMath.h"
11 #include "Camera.h"
12 
13 
14 namespace Eegeo
15 {
16  namespace BlueSphere
17  {
19  {
20  public:
21 
23  Eegeo::Rendering::RenderableFilters& renderableFilters,
24  IBlueSphereResourceLoadCompletedEvent& resourceLoadCompletedEvent,
25  const BlueSphereViewResources& blueSphereViewResources,
26  BlueSphereModel& model,
27  BlueSphereView& view,
28  BlueSphereAnchorView& anchorView,
30  const Eegeo::Rendering::ScreenProperties& screenProperties
31  );
32 
33  virtual ~BlueSphereController();
34 
35  void Update(float dt, const Eegeo::Camera::RenderCamera& renderCamera);
36 
37  private:
38  Eegeo::Rendering::RenderableFilters& m_renderableFilters;
39  IBlueSphereResourceLoadCompletedEvent& m_resourceLoadCompletedEvent;
40  const BlueSphereViewResources& m_blueSphereViewResources;
41  BlueSphereModel& m_model;
42  BlueSphereView& m_view;
43  BlueSphereAnchorView& m_anchorView;
44  bool m_viewsBound;
45 
47 
48  float m_pViewTransitionParam;
49  int m_currentFloorIndex;
50 
51  float m_screenPixelScale;
52  float m_screenOversampleScale;
53 
56 
57 
58 
59  void BindViews();
60  void UnbindViews();
61 
62  void OnResourceLoadComplete(const BlueSphereResourceLoadCompletedMessage& message);
63  void OnFloorSelected();
64 
65 
66  void RefreshIndoorStateForViews();
67 
68  void UpdateTransition(bool isVisible, float dt);
69 
70  void CreateModelViewProjectionMatrix(Eegeo::m44& out_modelViewProjection,
71  const Eegeo::dv3& location,
72  const float heading,
73  const Eegeo::v3& cameraRelativeLocation,
74  const Eegeo::v3& scale,
75  const Eegeo::Camera::RenderCamera& renderCamera,
76  bool flipUpDirection);
77  const bool IsBlueSphereVisible(const Eegeo::dv3& currentLocationEcef);
78  };
79  }
80 }