9 #include "RouteSimulationGlobeCameraControllerConfig.h"
10 #include "TerrainRayPicker.h"
11 #include "VectorMathDecl.h"
12 #include "GlobeCamera.h"
14 #include "IInterestPointProvider.h"
15 #include "CameraState.h"
28 enum RouteSimulationGlobeCameraControllerOrientationMode
31 LockedToAbsoluteHeading,
32 LockedToCurrentLinkDirection
44 float m_followDistanceMeters;
45 bool m_touchZoomEnabled;
47 float m_followHeadingDegrees;
48 RouteSimulationGlobeCameraControllerOrientationMode m_orientationMode;
49 float m_headingVelocity;
51 float m_deltaSecondsAccumulator;
52 float m_collisionDistance;
53 float m_collisionTimer;
70 bool IsActive()
const {
return m_pRouteSimulationSession != NULL; }
72 RouteSimulationGlobeCameraControllerOrientationMode GetOrientationMode()
const;
74 void SetTouchZoomEnabled(
bool enabled);
76 void SetTiltEnabled(
bool enabled);
78 void SetFollowDistance(
float followDistanceMetres);
80 void LockFollowHeadingDegrees(
float followHeadingDegrees);
82 void LockFollowHeadingToCurrentLinkDirection();
84 void SetOrientationMode(RouteSimulationGlobeCameraControllerOrientationMode mode);
86 void UnlockFollowHeading();
88 void Update(
float dt);
94 void StopFollowingSession();
96 void SetView(
double interestLatitudeDegrees,
97 double interestLongitudeDegrees,
99 float distanceToInterest);
101 void SetProjection(
float fovRadians,
102 float nearClipDistance,
103 float farClipDistance);
105 bool IsTouchZoomEnabled()
const {
return m_touchZoomEnabled; }
107 bool IsTiltEnabled()
const {
return m_tiltEnabled; }
109 float GetFollowDistanceMetres()
const {
return m_followDistanceMeters; }
111 float GetDistanceToInterest()
const;
113 dv3 GetEcefInterestPoint()
const;
119 void UpdateCameraInteractionSettings();
123 void UpdateBasisFromLinkDirection(
float deltaSeconds,
const dv3& desiredInterestPos,
Space::EcefTangentBasis& out_interestBasis);
125 bool TryIntersectCameraRayWithTerrain(
double& out_intersectionDist);
127 float ClampedFollowDistance(
float in)
const;
129 void ForceUnlockedOrientationIfGlobeMode();
131 void UpdateInterestBasis(
float deltaTime);