1 #include "rotatetool.h"
7 RotateTool::RotateTool(Designer &d, Input::Mouse &m, const set<Object *> &o):
9 origin(Geometry::atan2(ground_pointer.y-center.y, ground_pointer.x-center.x))
12 void RotateTool::axis_motion(unsigned axis, float value, float rel)
14 Manipulator::axis_motion(axis, value, rel);
16 Angle a = Geometry::atan2(ground_pointer.y-center.y, ground_pointer.x-center.x);
20 Transform trans = Transform::rotation(angle, Vector(0, 0, 1));
21 for(ObjectArray::iterator i=objects.begin(); i!=objects.end(); ++i)
23 i->object->set_position(center+trans.transform(i->original_position));
24 i->object->set_rotation(angle+i->original_rotation);