6 #include <Core/Utils/Color.hpp>
7 #include <Core/Utils/Index.hpp>
9 #include <Core/Asset/Camera.hpp>
10 #include <Engine/Data/RenderParameters.hpp>
11 #include <Engine/RadiumEngine.hpp>
12 #include <Engine/Rendering/RenderObject.hpp>
13 #include <Engine/Scene/CameraComponent.hpp>
27 class RenderTechnique;
50 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
52 const Core::Transform& worldTo,
53 const Core::Transform& t,
63 updateTransform( Mode mode,
const Core::Transform& worldTo,
const Core::Transform& t ) = 0;
74 const Core::Vector2& initialXY ) = 0;
79 const Core::Vector2& nextXY,
81 bool whole =
false ) = 0;
86 const Core::Vector3& origin,
87 const Core::Vector3& axis,
88 const Core::Vector2& pix,
89 Core::Vector3& pointOut,
90 std::vector<Scalar>& hits );
94 const Core::Vector3& origin,
95 const Core::Vector3& axis,
96 const Core::Vector2& pix,
97 Core::Vector3& pointOut,
98 std::vector<Scalar>& hits );
101 inline const std::vector<Engine::Rendering::RenderObject*>&
ros()
const {
return m_ros; }
112 static std::shared_ptr<Engine::Rendering::RenderTechnique>
makeRenderTechnique(
int color );
118 static std::array<std::shared_ptr<Ra::Engine::Data::PlainMaterial>, 3>
s_material;
140 std::shared_ptr<Ra::Engine::Data::PlainMaterial>& material,
156 std::shared_ptr<Ra::Engine::Data::PlainMaterial> m_associatedMaterial;
160 bool m_selected {
false };
167 std::vector<Engine::Rendering::RenderObject*> m_ros;
Camera class storing the Camera frame and the projection properties The view direction is -z in camer...
A component is an element that can be updated by a system. It is also linked to some other components...
void setState()
Set the state of the controler to true.
void toggleState()
Swap the state of the controler.
void clearState()
Set the state of the controler to false.
void updateGL() override
Inherited.
static std::array< std::shared_ptr< Ra::Engine::Data::PlainMaterial >, 3 > s_material
Mode m_mode
local or global.
virtual void updateTransform(Mode mode, const Core::Transform &worldTo, const Core::Transform &t)=0
Called every time the underlying transform may have changed.
static bool findPointOnAxis(const Core::Asset::Camera &cam, const Core::Vector3 &origin, const Core::Vector3 &axis, const Core::Vector2 &pix, Core::Vector3 &pointOut, std::vector< Scalar > &hits)
Find a mouse-designed point on a 3D axis.
Core::Transform m_worldTo
World to local space where the transform lives.
static bool findPointOnPlane(const Core::Asset::Camera &cam, const Core::Vector3 &origin, const Core::Vector3 &axis, const Core::Vector2 &pix, Core::Vector3 &pointOut, std::vector< Scalar > &hits)
Find a mouse-designed point on a 3D plane.
static std::shared_ptr< Engine::Rendering::RenderTechnique > makeRenderTechnique(int color)
virtual void selectConstraint(int drawableIndex)=0
Called when one of the drawables of the gizmo has been selected.
const std::vector< Engine::Rendering::RenderObject * > & ros() const
read access to the gizmo render objects id
Core::Transform m_transform
Transform to be edited.
void addRenderObject(Engine::Rendering::RenderObject *ro)
add a render object to display the Gizmo
virtual void setInitialState(const Core::Asset::Camera &cam, const Core::Vector2 &initialXY)=0
virtual bool isSelected()=0
return the selection state of the gizmo: true if the gizmo is selected, false if not.
Gizmo::UiSelectionControler * getControler(int ro)
Returns the controler (ShaderParametersProvider) associated to the given gizmo component.
virtual Core::Transform mouseMove(const Core::Asset::Camera &cam, const Core::Vector2 &nextXY, bool stepped=false, bool whole=false)=0
Engine::Scene::Component * m_comp
Engine Ui component.