summaryrefslogtreecommitdiffstats
path: root/Room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Room.cpp')
-rw-r--r--Room.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Room.cpp b/Room.cpp
index 1980026..7608e41 100644
--- a/Room.cpp
+++ b/Room.cpp
@@ -2,17 +2,6 @@
#include "LevelEdge.h"
-void Room::rotateAround(Vertex z, float a) {
- float s = sinf(a);
- float c = cosf(a);
-
- for(Polygon::iterator v = polygon.begin(); v != polygon.end(); v++) {
- *v -= z;
- v->setLocation(c*v->getX() - s*v->getY(), c*v->getY() + s*v->getX());
- *v += z;
- }
-}
-
const Room& Room::operator=(const Room &room) {
polygon.clear();
edges.clear();
@@ -61,3 +50,14 @@ std::vector<SharedPtr<LevelObject> > Room::getChildren() {
return children;
}
+
+void Room::rotate(Vertex m, float a) {
+ float s = sinf(a);
+ float c = cosf(a);
+
+ for(Polygon::iterator v = polygon.begin(); v != polygon.end(); v++) {
+ *v -= m;
+ v->setLocation(c*v->getX() - s*v->getY(), c*v->getY() + s*v->getX());
+ *v += m;
+ }
+}