All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsCameraControllerFactory.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Interiors.h"
7 #include "GlobeCamera.h"
8 #include "Rendering.h"
9 #include "GlobeCameraControllerFactory.h"
10 #include "GlobeCameraControllerConfiguration.h"
11 #include "GlobeCameraTouchControllerConfiguration.h"
12 #include "InteriorsCameraConfiguration.h"
13 #include "ScreenProperties.h"
14 
15 namespace Eegeo
16 {
17  namespace Resources
18  {
19  namespace Interiors
20  {
22  {
23  public:
24  static inline Camera::GlobeCamera::GlobeCameraControllerConfiguration DefaultGlobeCameraControllerConfiguration();
25 
26  static inline Camera::GlobeCamera::GlobeCameraTouchControllerConfiguration DefaultGlobeCameraTouchControllerConfiguration();
27 
28 
29  InteriorsCameraControllerFactory(const InteriorsCameraConfiguration& interiorsCameraConfiguration,
30  const Camera::GlobeCamera::GlobeCameraControllerConfiguration& globeCameraControllerConfiguration,
31  const Camera::GlobeCamera::GlobeCameraTouchControllerConfiguration& globeCameraTouchControllerConfiguration,
32  Camera::GlobeCamera::GlobeCameraControllerFactory& globeCameraControllerFactory,
33  const Rendering::ScreenProperties& screenProperties,
34  InteriorInteractionModel& interiorInteractionModel,
35  const IImmutableInteriorViewModel& interiorViewModel,
36  const Rendering::EnvironmentFlatteningService& environmentFlatteningService,
37  bool deprecatedParam=false);
38 
39 
40  Camera::GlobeCamera::GlobeCameraTouchController* CreateTouchController() const;
41 
42  Camera::GlobeCamera::GlobeCameraController* CreateInteriorGlobeCameraController(const Camera::GlobeCamera::GlobeCameraTouchController& touchController) const;
43 
44  InteriorsCameraController* CreateInteriorsCameraController(Camera::GlobeCamera::GlobeCameraTouchController& touchController,
45  Camera::GlobeCamera::GlobeCameraController& globeCameraController) const;
46 
47  private:
48 
49  const InteriorsCameraConfiguration m_interiorsCameraConfiguration;
50  const Camera::GlobeCamera::GlobeCameraControllerConfiguration m_globeCameraControllerConfiguration;
51  const Camera::GlobeCamera::GlobeCameraTouchControllerConfiguration m_globeCameraTouchControllerConfiguration;
52  Camera::GlobeCamera::GlobeCameraControllerFactory& m_globeCameraControllerFactory;
53  const Rendering::ScreenProperties m_screenProperties;
54  InteriorInteractionModel& m_interiorInteractionModel;
55  const IImmutableInteriorViewModel& m_interiorViewModel;
56  const Rendering::EnvironmentFlatteningService& m_environmentFlatteningService;
57  };
58 
59 
60  inline Camera::GlobeCamera::GlobeCameraControllerConfiguration InteriorsCameraControllerFactory::DefaultGlobeCameraControllerConfiguration()
61  {
62  const bool useLowLodSettings = false;
64  config.terrainFollowingEnabled = false;
65  config.zoomAltitudeLow = 50.0f;
66  config.maxAltitude = 1700.f;
67  config.computeNearFarPlanes = false;
68  // near and far multipliers aproximated from cos( 65 ) so should allow for tilt + fov = 65
69  config.nearPlane = 0.4f * config.zoomAltitudeLow;
70  config.farPlane = 2.9f * config.maxAltitude;
71  return config;
72  }
73 
74  inline Camera::GlobeCamera::GlobeCameraTouchControllerConfiguration InteriorsCameraControllerFactory::DefaultGlobeCameraTouchControllerConfiguration()
75  {
77  }
78  }
79  }
80 }