Thu, 09 Feb 2017 13:13:46 +0200
Moved more methods only used by canvas code from GLRenderer to Canvas. Thin border pen is now a static constant.
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
1072 | 3 | * Copyright (C) 2013 - 2017 Teemu Piippo |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
1025
4949da3fb4b3
Renamed ldObjectMath.cpp/.h to mathfunctions.cpp/.h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1024
diff
changeset
|
19 | #include "mathfunctions.h" |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #include "ldObject.h" |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | #include "miscallenous.h" |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
23 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
24 | MathFunctions::MathFunctions(QObject* parent) : |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
25 | HierarchyElement(parent) {} |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
26 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
27 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
28 | void MathFunctions::rotateVertex(Vertex& vertex, const Vertex& rotationPoint, const Matrix& transformationMatrix) const |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | { |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
30 | vertex -= rotationPoint; |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
31 | vertex.transform (transformationMatrix, Origin); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
32 | vertex += rotationPoint; |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | } |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
35 | |
1073
a0a0d581309b
Major overhaul of object→document relationship: added the Model class which models the object buffer. Each object is to be included in a model (an invariant that currently does not hold). A document is a subclass of a model. The LDObject is also now agnostic about selection, and the selection is now a set. A lot of things are probably broken now but it's a major step forward.
Teemu Piippo <teemu@hecknology.net>
parents:
1072
diff
changeset
|
36 | void MathFunctions::rotateObjects(int l, int m, int n, double angle, const QVector<LDObject*>& objects) const |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | { |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
38 | Vertex rotationPoint = getRotationPoint (objects); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
39 | double cosAngle = cos(angle); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
40 | double sinAngle = sin(angle); |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | // ref: http://en.wikipedia.org/wiki/Transformation_matrix#Rotation_2 |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
43 | Matrix transformationMatrix ( |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | { |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
45 | (l * l * (1 - cosAngle)) + cosAngle, |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
46 | (m * l * (1 - cosAngle)) - (n * sinAngle), |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
47 | (n * l * (1 - cosAngle)) + (m * sinAngle), |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
49 | (l * m * (1 - cosAngle)) + (n * sinAngle), |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
50 | (m * m * (1 - cosAngle)) + cosAngle, |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
51 | (n * m * (1 - cosAngle)) - (l * sinAngle), |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
53 | (l * n * (1 - cosAngle)) - (m * sinAngle), |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
54 | (m * n * (1 - cosAngle)) + (l * sinAngle), |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
55 | (n * n * (1 - cosAngle)) + cosAngle |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | }); |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | // Apply the above matrix to everything |
944 | 59 | for (LDObject* obj : objects) |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | { |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | if (obj->numVertices()) |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
62 | { |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | for (int i = 0; i < obj->numVertices(); ++i) |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | { |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | Vertex v = obj->vertex (i); |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
66 | rotateVertex(v, rotationPoint, transformationMatrix); |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | obj->setVertex (i, v); |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | } |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | } |
967 | 70 | else if (obj->hasMatrix()) |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
71 | { |
945
c310073e4f22
More sharedpointer removal
Teemu Piippo <crimsondusk64@gmail.com>
parents:
944
diff
changeset
|
72 | LDMatrixObject* mo = dynamic_cast<LDMatrixObject*> (obj); |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | // Transform the position |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
75 | Vertex v = mo->position(); |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
76 | rotateVertex(v, rotationPoint, transformationMatrix); |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
77 | mo->setPosition (v); |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | // Transform the matrix |
1045
f726f8f49c7e
Unabbreviate "transform" to "transformationMatrix"
Teemu Piippo <teemu@hecknology.net>
parents:
1035
diff
changeset
|
80 | mo->setTransformationMatrix(transformationMatrix * mo->transformationMatrix()); |
869
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | } |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
82 | } |
7184f3bae695
- circle tool is now able to rotate the partial circular primitives spawned
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | } |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
84 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
85 | |
1073
a0a0d581309b
Major overhaul of object→document relationship: added the Model class which models the object buffer. Each object is to be included in a model (an invariant that currently does not hold). A document is a subclass of a model. The LDObject is also now agnostic about selection, and the selection is now a set. A lot of things are probably broken now but it's a major step forward.
Teemu Piippo <teemu@hecknology.net>
parents:
1072
diff
changeset
|
86 | Vertex MathFunctions::getRotationPoint(const QVector<LDObject*>& objs) const |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
87 | { |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
88 | switch (RotationPoint (m_config->rotationPointType())) |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
89 | { |
1035
8a60250175ba
Further improved enum handling
Teemu Piippo <teemu@compsta2.com>
parents:
1025
diff
changeset
|
90 | case ObjectOrigin: |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
91 | { |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
92 | BoundingBox box; |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
93 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
94 | // Calculate center vertex |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
95 | for (LDObject* obj : objs) |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
96 | { |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
97 | if (obj->hasMatrix()) |
1079
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
98 | { |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
99 | box << static_cast<LDMatrixObject*> (obj)->position(); |
1079
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
100 | } |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
101 | else |
1079
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
102 | { |
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
103 | for (int i = 0; i < obj->numVertices(); ++i) |
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
104 | box << obj->vertex(i); |
67c6e5d32e68
More rework on model stuff, removals of LDSpawn calls. Most importantly, the LDraw code parsing function was moved to Model.
Teemu Piippo <teemu@hecknology.net>
parents:
1073
diff
changeset
|
105 | } |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
106 | } |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
107 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
108 | return box.center(); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
109 | } |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
110 | |
1035
8a60250175ba
Further improved enum handling
Teemu Piippo <teemu@compsta2.com>
parents:
1025
diff
changeset
|
111 | case WorldOrigin: |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
112 | return Vertex(); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
113 | |
1035
8a60250175ba
Further improved enum handling
Teemu Piippo <teemu@compsta2.com>
parents:
1025
diff
changeset
|
114 | case CustomPoint: |
1024
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
115 | return m_config->customRotationPoint(); |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
116 | } |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
117 | |
67ba0ee049eb
Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
118 | return Vertex(); |
1045
f726f8f49c7e
Unabbreviate "transform" to "transformationMatrix"
Teemu Piippo <teemu@hecknology.net>
parents:
1035
diff
changeset
|
119 | } |