Radium Engine  1.5.20
Loading...
Searching...
No Matches
ScaleGizmo.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
7namespace Ra {
8namespace Gui {
9
15// TODO: find how to apply it in global frame.
16class ScaleGizmo : public Gizmo
17{
18 public:
19 // Draw a frame with : 3 RGB cube-shaped arrows and 3 RGB squares
21 const Core::Transform& worldTo,
22 const Core::Transform& t,
23 Mode mode );
24
25 void updateTransform( Gizmo::Mode mode,
26 const Core::Transform& worldTo,
27 const Core::Transform& t ) override;
28 void selectConstraint( int drawableIndex ) override;
29 bool isSelected() override { return m_selectedAxis != -1 || m_selectedPlane != -1; }
30 void setInitialState( const Core::Asset::Camera& cam, const Core::Vector2& initialXY ) override;
31 Core::Transform mouseMove( const Core::Asset::Camera& cam,
32 const Core::Vector2& nextXY,
33 bool stepped,
34 bool whole ) override;
35
36 private:
37 Ra::Core::Vector3 m_prevScale;
38 Ra::Core::Vector3 m_startPos;
39 Ra::Core::Vector3 m_startPoint;
40 Core::Vector2 m_initialPix;
41 int m_selectedAxis;
42 int m_selectedPlane;
43 bool m_start { false };
44};
45
46} // namespace Gui
47} // 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
void selectConstraint(int drawableIndex) override
Called when one of the drawables of the gizmo has been selected.
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.
Core::Transform mouseMove(const Core::Asset::Camera &cam, const Core::Vector2 &nextXY, bool stepped, bool whole) override
void updateTransform(Gizmo::Mode mode, const Core::Transform &worldTo, const Core::Transform &t) override
Called every time the underlying transform may have changed.
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3