1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef R2_TOOL_SELECT_ROTATE_H
18 #define R2_TOOL_SELECT_ROTATE_H
20 #include "tool_maintained_action.h"
26 * Tool to select an element in the scene
27 * If the left button is maintained down, then the selected element is moved
29 class CToolSelectRotate
: public CToolMaintainedAction
32 NLMISC_DECLARE_CLASS(R2::CToolSelectRotate
);
36 virtual const char *getToolUIName() const { return "selectRotate"; }
37 virtual bool isCreationTool() const { return false; }
38 virtual bool isActionPossibleOn(const CInstance
&instance
) const;
40 // from CToolMaintainedAction
41 virtual bool onMouseLeftButtonDown();
42 virtual void beginAction(CInstance
&instance
);
43 virtual void cancelAction(CInstance
&instance
);
44 virtual void commitAction(CInstance
&instance
);
45 virtual void updateAction(CInstance
&instance
);
46 virtual const char *getCursorForPossibleAction() const { return "r2ed_tool_can_rotate.tga"; }
51 void setRotateInProgress(bool rotateInProgress
, CInstance
&instance
);
52 // get orientation of an entity (in radians)
53 static float getEntityAngle(CEntityCL
&entity
);
54 // set orientation of an entity (in radians)
55 static void setEntityAngle(CEntityCL
&entity
, CInstance
&instance
, float angle
);