diff options
Diffstat (limited to 'Room.cpp')
-rw-r--r-- | Room.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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; + } +} |