Radium Engine  1.5.0
RotateGizmo.hpp
1 #pragma once
2 
3 #include <Core/Asset/Camera.hpp>
4 #include <Engine/Scene/CameraComponent.hpp>
5 #include <Gui/Viewer/Gizmo/Gizmo.hpp>
6 
7 namespace Ra {
8 namespace Gui {
9 
11 class RotateGizmo : public Gizmo
12 {
13  public:
14  // Draw a frame with : 3 RGB arrows
16  const Core::Transform& worldTo,
17  const Core::Transform& t,
18  Mode mode );
19 
20  void updateTransform( Gizmo::Mode mode,
21  const Core::Transform& worldTo,
22  const Core::Transform& t ) override;
23  void selectConstraint( int drawableIndex ) override;
24  bool isSelected() override { return m_selectedAxis != -1; }
25 
26  void setInitialState( const Core::Asset::Camera& cam, const Core::Vector2& initialXY ) override;
27  Core::Transform mouseMove( const Core::Asset::Camera& cam,
28  const Core::Vector2& nextXY,
29  bool stepped,
30  bool whole ) override;
31 
32  private:
33  Core::Vector2 m_initialPix;
34  int m_selectedAxis;
35  bool m_start;
36  bool m_stepped;
37  Scalar m_totalAngle;
38  Core::Matrix3 m_initialRot;
39 };
40 
41 } // namespace Gui
42 } // namespace Ra
Camera class storing the Camera frame and the projection properties The view direction is -z in camer...
Definition: Camera.hpp:16
A component is an element that can be updated by a system. It is also linked to some other components...
Definition: Component.hpp:31
A RotateGizmo manipulates the rotational part of a transformation.
Definition: RotateGizmo.hpp:12
void selectConstraint(int drawableIndex) override
Called when one of the drawables of the gizmo has been selected.
Definition: RotateGizmo.cpp:69
void setInitialState(const Core::Asset::Camera &cam, const Core::Vector2 &initialXY) override
bool isSelected() override
return the selection state of the gizmo: true if the gizmo is selected, false if not.
Definition: RotateGizmo.hpp:24
Core::Transform mouseMove(const Core::Asset::Camera &cam, const Core::Vector2 &nextXY, bool stepped, bool whole) override
Definition: RotateGizmo.cpp:88
void updateTransform(Gizmo::Mode mode, const Core::Transform &worldTo, const Core::Transform &t) override
Called every time the underlying transform may have changed.
Definition: RotateGizmo.cpp:48
Definition: Cage.cpp:3