summaryrefslogtreecommitdiffstats
path: root/Room.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2008-02-15 20:10:04 +0100
committerneoraider <devnull@localhost>2008-02-15 20:10:04 +0100
commit0ea1d388651217697d49029820b02b4f002f1ac0 (patch)
tree67f826d2b91f406606cdb1da04d7f25db96ef4ed /Room.cpp
parent80b4f14530426d21c7ea26b7976a728f5b36c294 (diff)
downloadzoomedit-0ea1d388651217697d49029820b02b4f002f1ac0.tar
zoomedit-0ea1d388651217697d49029820b02b4f002f1ac0.zip
zoomedit: Made rotation tool much nicer ;-)
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;
+ }
+}