8 #include "VectorMathDecl.h"
14 namespace CameraHelpers
26 const dv3& interestPointEcef,
27 const v3& interestBasisFoward,
29 float distanceCameraToInterest,
30 dv3& out_cameraLocation,
31 v3& out_cameraDirection,
56 void GetScreenPickRay(
const RenderCamera& renderCamera,
float screenPixelX,
float screenPixelY, dv3& out_rayDirection);
90 void GetAltitudeInterpolatedNearFar(
float absoluteCameraAltitude,
float approxTerrainAltitude,
float approxTerrainAltitudeDelta,
const double scalingFunctionAltitudeThreshold,
float& out_nearDistance,
float& out_farDistance);
113 Geometry::Ray ScreenPointToRay(
const v2& screenPoint,
const v2& screenDimensions,
const m44& inverseViewProjectionMatrix,
const dv3& viewOriginEcef);
115 dv3 ScreenPointToRayDirection(
const v2& screenPoint,
const v2& screenDimensions,
const m44& inverseViewProjectionMatrix);
117 v3 ClipCoordToScreenPoint(
const v4& clipCoord,
const v2& screenDimensions);
119 bool TryScreenProject(
120 const dv3& pointEcef,
121 const dv3& cameraOriginEcef,
122 const m44& viewProjectionMatrix,
123 const v2& screenDimensions,
124 v3& out_screenPoint);
126 v3 ScreenProjectWithDefaultHomogeneousW(
127 const dv3& pointEcef,
128 const dv3& cameraOriginEcef,
129 const m44& viewProjectionMatrix,
130 const v2& screenDimensions,
131 const float defaultHomogeneousW = 0.1f);
133 float VerticalFieldOfViewFromProjection(
const m44& projectionMatrix);
135 float NearClipDistanceFromProjection(
const m44& projectionMatrix);
137 float FarClipDistanceFromProjection(
const m44& projectionMatrix);
139 CameraState BuildCameraStateFromRenderCamera(
const RenderCamera& camera,
const dv3& cameraInterestPointEcef);