15#include <vsg/app/EllipsoidModel.h>
16#include <vsg/app/ViewMatrix.h>
17#include <vsg/io/Logger.h>
26 virtual dmat4 transform()
const = 0;
28 virtual dmat4 inverse()
const
30 return vsg::inverse(transform());
59 dmat4 transform()
const override {
return perspective(radians(fieldOfViewY), aspectRatio, nearDistance, farDistance); }
76 void write(
Output& output)
const override;
104 dmat4 transform()
const override {
return orthographic(left, right, bottom, top, nearDistance, farDistance); }
123 void write(
Output& output)
const override;
132 projectionMatrix(
pm),
140 return matrix * projectionMatrix->transform();
149 ref_ptr<ProjectionMatrix> projectionMatrix;
173 horizonMountainHeight(
hmh)
177 dmat4 transform()
const override
181 vsg::dvec3 lv = vsg::normalize(lookAt->center - lookAt->eye);
182 double R = ellipsoidModel->radiusEquator();
183 double H = ellipsoidModel->convertECEFToLatLongAltitude(
v).z;
186 double alpha = (
D >
R) ? std::acos(
R /
D) : 0.0;
196 double farDistance = std::cos(
theta +
alpha - vsg::PI * 0.5) *
l;
197 double nearDistance = farDistance * nearFarRatio;
200 return perspective(radians(fieldOfViewY), aspectRatio, nearDistance, farDistance);
213 double fieldOfViewY = 60.0;
214 double aspectRatio = 1.0;
215 double nearFarRatio = 0.0001;
216 double horizonMountainHeight = 1000.0;
220 void write(
Output& output)
const override;
Definition ProjectionMatrix.h:157
Orthographic is a ProjectionMatrix that implements the glOrtho model for setting the projection matri...
Definition ProjectionMatrix.h:82
Perspective is a ProjectionMatrix that implements the gluPerspective model for setting the projection...
Definition ProjectionMatrix.h:41
ProjectionMatrix is a base class for specifying the Camera projection matrix and its inverse.
Definition ProjectionMatrix.h:24
RelativeProjection is a ProjectionMatrix that decorates another ProjectionMatrix and pre-multiplies i...
Definition ProjectionMatrix.h:129
dmat4 transform() const override
returns matrix * projectionMatrix->transform()
Definition ProjectionMatrix.h:138
std container adapter for allocating with MEMORY_AFFINITY_NODES
Definition Allocator.h:138