src/glcamera.cpp

changeset 1130
17f92eb2a30c
parent 1129
2b20261dc511
child 1134
daa9808d626e
equal deleted inserted replaced
1129:2b20261dc511 1130:17f92eb2a30c
21 #include "miscallenous.h" 21 #include "miscallenous.h"
22 22
23 /* 23 /*
24 * Constructs a fixed camera from parameters. 24 * Constructs a fixed camera from parameters.
25 */ 25 */
26 GLCamera::GLCamera(int glRotateX, int glRotateY, int glRotateZ, Axis localX, Axis localY, bool negatedX, bool negatedY, bool negatedDepth) : 26 GLCamera::GLCamera(QString name, FixedCameraParameters&& bag) :
27 m_glrotate {glRotateX, glRotateY, glRotateZ}, 27 m_name {name},
28 m_localX {localX}, 28 m_glrotate {bag.glRotateX, bag.glRotateY, bag.glRotateZ},
29 m_localY {localY}, 29 m_localX {bag.localX},
30 m_negatedX {negatedX}, 30 m_localY {bag.localY},
31 m_negatedY {negatedY}, 31 m_negatedX {bag.negatedX},
32 m_negatedDepth {negatedDepth} {} 32 m_negatedY {bag.negatedY},
33 m_negatedDepth {bag.negatedZ} {}
33 34
34 /* 35 /*
35 * Constructs a free camera. 36 * Constructs a free camera.
36 */ 37 */
37 GLCamera::GLCamera(FreeToken) : 38 GLCamera::GLCamera(QString name, FreeToken) :
39 m_name {name},
38 m_isFree {true} {} 40 m_isFree {true} {}
39 41
40 /* 42 /*
41 * Returns OpenGL rotation information for this camera. 43 * Returns OpenGL rotation information for this camera.
42 */ 44 */
230 void GLCamera::setZoom(double zoom) 232 void GLCamera::setZoom(double zoom)
231 { 233 {
232 m_zoom = zoom; 234 m_zoom = zoom;
233 rendererResized(m_size.width(), m_size.height()); 235 rendererResized(m_size.width(), m_size.height());
234 } 236 }
237
238 /*
239 * Returns the name of the camera
240 */
241 const QString& GLCamera::name() const
242 {
243 return m_name;
244 }

mercurial