@@ -88,7 +88,7 @@ namespace vsg
8888
8989 void set (const dmat4& matrix);
9090
91- dmat4 transform (const vsg:: dvec3& offset={}) const override ;
91+ dmat4 transform (const dvec3& offset={}) const override ;
9292
9393 void read (Input& input) override ;
9494 void write (Output& output) const override ;
@@ -99,8 +99,38 @@ namespace vsg
9999 };
100100 VSG_type_name (vsg::LookAt);
101101
102+ // / LookDirection is a ViewMatrix that uses a position and rotation to set the view matrix.
103+ class VSG_DECLSPEC LookDirection : public vsg::Inherit<ViewMatrix, LookDirection>
104+ {
105+ public:
106+
107+ LookDirection () :
108+ position (0.0 , 0.0 , 0.0 ),
109+ rotation ()
110+ {
111+ }
112+
113+ LookDirection (const LookDirection& view, const CopyOp& copyop = {}) :
114+ Inherit (view, copyop),
115+ position (view.position),
116+ rotation (view.rotation)
117+ {
118+ }
119+
120+ ref_ptr<Object> clone (const CopyOp& copyop = {}) const override { return LookDirection::create (*this , copyop); }
121+
122+ dvec3 position;
123+ dquat rotation;
124+
125+ void set (const dmat4& matrix);
126+
127+ dmat4 transform (const dvec3& offset={}) const override ;
128+ };
129+ VSG_type_name (vsg::LookDirection);
130+
131+
102132 // / RelativeViewMatrix is a ViewMatrix that decorates another ViewMatrix and pre-multiplies its transform matrix to give a relative view matrix.
103- class RelativeViewMatrix : public Inherit <ViewMatrix, RelativeViewMatrix>
133+ class VSG_DECLSPEC RelativeViewMatrix : public Inherit<ViewMatrix, RelativeViewMatrix>
104134 {
105135 public:
106136 RelativeViewMatrix (const dmat4& m, ref_ptr<ViewMatrix> vm) :
0 commit comments