3 #ifndef RENDERER_CAMERA_H
4 #define RENDERER_CAMERA_H
68 inline double const&
Zoom()
const;
71 inline void MoveRight(
double const distance );
72 inline void MoveUp(
double const distance );
75 inline void MoveLeft(
double const distance );
76 inline void MoveDown(
double const distance );
80 inline void TurnDown(
double const angle );
81 inline void TurnLeft(
double const angle );
84 inline void TurnUp(
double const angle );
85 inline void TurnRight(
double const angle );
87 inline void ZoomOut(
double const amount );
88 inline void ZoomIn(
double const amount );
89 inline void ZoomTo(
double const zoom = 1 );
122 m_position( position ),
125 assert( m_zoom > 0 );
162 m_position += m_xx * distance;
168 m_position += m_yy * distance;
174 m_position += m_zz * distance;
200 double const cosine = std::cos( angle );
201 double const sine = std::sin( angle );
203 m_xx = xx * cosine + yy * sine;
204 m_yy = yy * cosine - xx * sine;
212 double const cosine = std::cos( angle );
213 double const sine = std::sin( angle );
215 m_yy = yy * cosine + zz * sine;
216 m_zz = zz * cosine - yy * sine;
224 double const cosine = std::cos( angle );
225 double const sine = std::sin( angle );
227 m_zz = zz * cosine + xx * sine;
228 m_xx = xx * cosine - zz * sine;
252 m_zoom = std::exp( std::log( m_zoom ) + amount );
279 m_yy -=
Dot( m_yy, m_zz ) * m_zz;
282 m_xx -=
Dot( m_xx, m_zz ) * m_zz;
283 m_xx -=
Dot( m_xx, m_yy ) * m_yy;
295 #endif // RENDERER_CAMERA_H