15 #include <vsg/core/Inherit.h>
16 #include <vsg/maths/transform.h>
25 virtual dmat4 transform()
const = 0;
27 virtual dmat4 inverse()
const
29 return vsg::inverse(transform());
40 center(0.0, 1.0, 0.0),
48 center(lookAt.center),
58 dvec3 look = normalize(center - eye);
59 dvec3 side = normalize(cross(look, up));
60 up = normalize(cross(side, look));
66 center = lookAt.center;
71 void transform(
const dmat4& matrix)
73 up = normalize(matrix * (eye + up) - matrix * eye);
74 center = matrix * center;
78 void set(
const dmat4& matrix)
80 up = normalize(matrix * (
dvec3(0.0, 0.0, 0.0) +
dvec3(0.0, 1.0, 0.0)) - matrix *
dvec3(0.0, 0.0, 0.0));
81 center = matrix *
dvec3(0.0, 0.0, -1.0);
82 eye = matrix *
dvec3(0.0, 0.0, 0.0);
85 dmat4 transform()
const override {
return lookAt(eye, center, up); }
87 void read(
Input& input)
override;
88 void write(
Output& output)
const override;
109 return matrix * viewMatrix->transform();
125 matrix(initial_matrix),
126 objectPath(path.begin(), path.end()) {}
130 objectPath(path.begin(), path.end()) {}
134 dmat4 inverse()
const override;
137 RefObjectPath objectPath;
LookAt is a ViewMatrix that implements the gluLookAt model for specifying the view matrix.
Definition: ViewMatrix.h:36
RelativeViewMatrix is a ViewMatrix that decorates another ViewMatrix and pre-multiplies its transform...
Definition: ViewMatrix.h:98
dmat4 transform() const override
returns matrix * viewMatrix->transform()
Definition: ViewMatrix.h:107
Definition: ViewMatrix.h:121
dmat4 transform() const override
returns matrix * computeTransfrom(objectPath)
ViewMatrix is a base class for specifying the Camera view matrix and its inverse.
Definition: ViewMatrix.h:23