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>
51 const Core::Transform& worldTo,
52 const Core::Transform& t,
62 updateTransform( Mode mode,
const Core::Transform& worldTo,
const Core::Transform& t ) = 0;
73 const Core::Vector2& initialXY ) = 0;
78 const Core::Vector2& nextXY,
80 bool whole =
false ) = 0;
85 const Core::Vector3& origin,
86 const Core::Vector3& axis,
87 const Core::Vector2& pix,
88 Core::Vector3& pointOut,
93 const Core::Vector3& origin,
94 const Core::Vector3& axis,
95 const Core::Vector2& pix,
96 Core::Vector3& pointOut,
159 bool m_selected {
false };
Camera class storing the Camera frame and the projection properties The view direction is -z in camer...
Shader program parameter provider.
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.
const std::vector< Engine::Rendering::RenderObject * > & ros() const
read access to the gizmo render objects id
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.
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.
hepler function to manage enum as underlying types in VariableSet