src/glcamera.cpp

Tue, 14 Feb 2017 08:33:44 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Tue, 14 Feb 2017 08:33:44 +0200
changeset 1134
daa9808d626e
parent 1130
17f92eb2a30c
child 1140
c5791a3aa1ba
permissions
-rw-r--r--

Moved more stuff to GLCamera

1129
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3 * Copyright (C) 2013 - 2017 Teemu Piippo
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 *
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 * (at your option) any later version.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 *
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 * GNU General Public License for more details.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 *
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 #include "glcamera.h"
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 #include "grid.h"
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 #include "miscallenous.h"
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 * Constructs a fixed camera from parameters.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 */
1130
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
26 GLCamera::GLCamera(QString name, FixedCameraParameters&& bag) :
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
27 m_name {name},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
28 m_glrotate {bag.glRotateX, bag.glRotateY, bag.glRotateZ},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
29 m_localX {bag.localX},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
30 m_localY {bag.localY},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
31 m_negatedX {bag.negatedX},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
32 m_negatedY {bag.negatedY},
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
33 m_negatedDepth {bag.negatedZ} {}
1129
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
34
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
35 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
36 * Constructs a free camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
37 */
1130
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
38 GLCamera::GLCamera(QString name, FreeToken) :
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
39 m_name {name},
1129
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
40 m_isFree {true} {}
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
41
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
42 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
43 * Returns OpenGL rotation information for this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
44 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
45 int GLCamera::glRotate(Axis axis) const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
46 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
47 return m_glrotate[axis];
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
48 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
49
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
50 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
51 * Returns whether or not the given axis is negated on this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
52 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
53 bool GLCamera::isAxisNegated(Axis axis) const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
54 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
55 switch (axis)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
56 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
57 case X:
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
58 return m_negatedX;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
59
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
60 case Y:
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
61 return m_negatedY;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
62
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
63 case Z:
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
64 return m_negatedDepth;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
65
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
66 default:
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
67 return false;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
68 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
69 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
70
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
71 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
72 * Returns the 3D axis that is on the X axis in this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
73 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
74 Axis GLCamera::axisX() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
75 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
76 return m_localX;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
77 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
78
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
79 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
80 * Returns the 3D axis that is on the Y axis in this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
81 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
82 Axis GLCamera::axisY() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
83 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
84 return m_localY;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
85 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
86
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
87 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
88 * Returns the 3D axis that is on the Z axis in this camera (inwards).
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
89 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
90 Axis GLCamera::axisZ() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
91 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
92 return static_cast<Axis>(3 - m_localX - m_localY);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
93 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
94
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
95 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
96 * This converts a 2D point on the screen to a 3D point in the model. If 'snap' is true, the 3D point will snap to the current grid.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
97 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
98 Vertex GLCamera::convert2dTo3d(const QPoint& position2d, Grid* grid) const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
99 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
100 if (m_isFree)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
101 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
102 return {0, 0, 0};
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
103 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
104 else
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
105 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
106 Vertex position3d;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
107 int signX = m_negatedX ? -1 : 1;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
108 int signY = m_negatedY ? -1 : 1;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
109
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
110 // Calculate cx and cy - these are the LDraw unit coords the cursor is at.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
111 double cx = -m_virtualSize.width() + (2 * position2d.x() * m_virtualSize.width() / m_size.width()) - m_panningX;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
112 double cy = m_virtualSize.height() - (2 * position2d.y() * m_virtualSize.height() / m_size.height()) - m_panningY;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
113
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
114 // If a grid was passed, snap coordinates to it.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
115 if (grid)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
116 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
117 cx = grid->snap(cx, Grid::Coordinate);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
118 cy = grid->snap(cy, Grid::Coordinate);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
119 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
120
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
121 roundToDecimals(cx, 4);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
122 roundToDecimals(cy, 4);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
123
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
124 // Create the vertex from the coordinates
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
125 position3d.setCoordinate(axisX(), cx * signX);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
126 position3d.setCoordinate(axisY(), cy * signY);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
127 position3d.setCoordinate(axisZ(), m_depth);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
128 return position3d;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
129 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
130 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
131
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
132 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
133 * Inverse operation for the above - convert a 3D position to a 2D screen position.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
134 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
135 QPoint GLCamera::convert3dTo2d(const Vertex& position3d) const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
136 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
137 if (m_isFree)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
138 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
139 return {0, 0};
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
140 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
141 else
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
142 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
143 int signX = m_negatedX ? -1 : 1;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
144 int signY = m_negatedY ? -1 : 1;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
145 int rx = (position3d[axisX()] * signX + m_virtualSize.width() + m_panningX) * m_size.width() / 2 / m_virtualSize.width();
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
146 int ry = (position3d[axisY()] * signY - m_virtualSize.height() + m_panningY) * m_size.height() / 2 / m_virtualSize.height();
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
147 return {rx, -ry};
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
148 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
149 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
150
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
151 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
152 * Resizes the camera when the renderer is resized.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
153 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
154 void GLCamera::rendererResized(int width, int height)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
155 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
156 m_size = {width, height};
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
157 m_virtualSize = {m_zoom, height * m_zoom / width};
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
158 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
159
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
160 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
161 * Returns the "virtual size" of the camera. Used to zoom in while keeping proportions.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
162 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
163 const QSizeF& GLCamera::virtualSize() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
164 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
165 return m_virtualSize;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
166 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
167
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
168 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
169 * Returns the "z depth" of the camera. Since the camera provides 2D editing, this value fills in the value for the
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
170 * third dimension for 3D vertices.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
171 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
172 double GLCamera::depth() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
173 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
174 return m_depth;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
175 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
176
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
177 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
178 * Returns the X-panning of this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
179 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
180 double GLCamera::panningX() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
181 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
182 return m_panningX;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
183 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
184
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
185 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
186 * Returns the Y-panning of this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
187 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
188 double GLCamera::panningY() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
189 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
190 return m_panningY;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
191 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
192
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
193 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
194 * Returns the zoom level of this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
195 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
196 double GLCamera::zoom() const
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
197 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
198 return m_zoom;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
199 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
200
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
201 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
202 * Explicitly sets the panning of this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
203 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
204 void GLCamera::setPanning(double x, double y)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
205 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
206 m_panningX = x;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
207 m_panningY = y;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
208 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
209
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
210 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
211 * Makes the camera pan by the provided mouse move input.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
212 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
213 void GLCamera::pan(int xMove, int yMove)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
214 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
215 m_panningX += 0.03f * xMove * zoom() / 7.5f;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
216 m_panningY -= 0.03f * yMove * zoom() / 7.5f;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
217 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
218
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
219 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
220 * Zooms the camera in one notch (e.g. by mousewheel).
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
221 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
222 void GLCamera::zoomNotch (bool inward)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
223 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
224 m_zoom *= inward ? 0.833f : 1.2f;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
225 m_zoom = qBound(0.01, zoom(), 10000.0);
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
226 rendererResized(m_size.width(), m_size.height());
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
227 }
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
228
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
229 /*
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
230 * Explicitly sets the zoom of this camera.
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
231 */
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
232 void GLCamera::setZoom(double zoom)
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
233 {
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
234 m_zoom = zoom;
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
235 rendererResized(m_size.width(), m_size.height());
2b20261dc511 Exported GLRenderer cameras into a new class, GLCamera.
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
236 }
1130
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
237
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
238 /*
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
239 * Returns the name of the camera
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
240 */
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
241 const QString& GLCamera::name() const
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
242 {
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
243 return m_name;
17f92eb2a30c Moved camera names to GLCamera, other adjustments
Teemu Piippo <teemu@hecknology.net>
parents: 1129
diff changeset
244 }
1134
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
245
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
246 /*
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
247 * Returns the camera's transformation matrix, scaled by the given scale value.
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
248 */
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
249 Matrix GLCamera::transformationMatrix(double scale) const
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
250 {
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
251 // Matrix templates. 2 is substituted with the scale value, 1 is inverted to -1 if needed.
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
252 static const Matrix templates[3] =
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
253 {
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
254 { 2, 0, 0, 0, 1, 0, 0, 0, 2 },
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
255 { 2, 0, 0, 0, 0, 2, 0, 1, 0 },
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
256 { 0, 1, 0, 2, 0, 0, 0, 0, 2 },
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
257 };
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
258
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
259 Matrix transform;
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
260
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
261 if (m_localX == X and m_localY == Z)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
262 transform = templates[0];
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
263 else if (m_localX == X and m_localY == Y)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
264 transform = templates[1];
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
265 if (m_localX == Y and m_localY == Z)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
266 transform = templates[2];
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
267
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
268 for (double& value : transform)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
269 {
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
270 if (value == 2)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
271 value = scale;
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
272 else if (value == 1 and (glRotate(X) + glRotate(Y) + glRotate(Z)) < 0)
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
273 value = -1;
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
274 }
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
275
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
276 return transform;
daa9808d626e Moved more stuff to GLCamera
Teemu Piippo <teemu@hecknology.net>
parents: 1130
diff changeset
277 }

mercurial