1 #include "rotatetool.h"
7 RotateTool::RotateTool(Designer &d, Input::Keyboard &k, Input::Mouse &m, const set<Object *> &o):
8 Manipulator(d, k, m, o),
9 origin(Geometry::atan2(ground_pointer.y-center.y, ground_pointer.x-center.x))
12 void RotateTool::pointer_motion()
14 Angle a = Geometry::atan2(ground_pointer.y-center.y, ground_pointer.x-center.x);
18 Transform trans = Transform::rotation(angle, Vector(0, 0, 1));
19 for(ObjectArray::iterator i=objects.begin(); i!=objects.end(); ++i)
21 i->object->set_position(center+trans.transform(i->original_position));
22 i->object->set_rotation(angle+i->original_rotation);