2 #include <Gui/RaGui.hpp>
10 #include <Core/CoreMacros.hpp>
12 #include <Core/Utils/Log.hpp>
14 #include <Core/Asset/Camera.hpp>
15 #include <Engine/Scene/CameraComponent.hpp>
16 #include <Gui/Utils/KeyMappingManager.hpp>
51 virtual bool handleMousePressEvent( QMouseEvent* event,
52 const Qt::MouseButtons& buttons,
53 const Qt::KeyboardModifiers& modifiers,
56 virtual bool handleMouseReleaseEvent( QMouseEvent* event );
58 virtual bool handleMouseMoveEvent( QMouseEvent* event,
59 const Qt::MouseButtons& buttons,
60 const Qt::KeyboardModifiers& modifiers,
63 virtual bool handleWheelEvent( QWheelEvent* event,
64 const Qt::MouseButtons& buttons,
65 const Qt::KeyboardModifiers& modifiers,
69 virtual bool handleKeyPressEvent( QKeyEvent* event,
72 virtual bool handleKeyReleaseEvent( QKeyEvent* event,
83 virtual void updateCamera();
98 void setCameraSensitivity( Scalar sensitivity );
99 void setCameraFov( Scalar fov );
100 void setCameraFovInDegrees( Scalar fov );
101 void setCameraZNear( Scalar zNear );
102 void setCameraZFar( Scalar zFar );
106 void mapCameraBehaviourToAabb(
const Core::Aabb& aabb );
109 void unmapCameraBehaviourToAabb();
112 virtual void fitScene(
const Core::Aabb& aabb ) = 0;
126 std::pair<Scalar, Scalar> computeDeltaMouseMove(
const QMouseEvent* mouseEvent ) {
127 return { ( mouseEvent->pos().x() - m_lastMouseX ) / m_camera->getWidth(),
128 ( mouseEvent->pos().y() - m_lastMouseY ) / m_camera->getHeight() };
132 Scalar m_lastMouseX { 0_ra };
135 Scalar m_lastMouseY { 0_ra };
138 Scalar m_cameraSensitivity { 1_ra };
140 Scalar m_quickCameraModifier { 1_ra };
142 Scalar m_wheelSpeedModifier { 0.02_ra };
145 Scalar m_targetedAabbVolume { 0_ra };
146 bool m_mapCameraBahaviourToAabb {
false };
151 Core::Vector3 m_target { 0_ra, 0_ra, 0_ra };
Camera class storing the Camera frame and the projection properties The view direction is -z in camer...
The CameraManipulator class is the generic class for camera manipulators.
Core::Aabb m_targetedAabb
Camera behavior restriction AABB.
virtual void resetCamera()=0
Reset the Camera settings to default values.
virtual void setCameraTarget(const Core::Vector3 &target)=0
Set the Camera target to target.
Core::Asset::Camera * getCamera()
Pointer access to the camera.
const Core::Asset::Camera * getCamera() const
Pointer access to the camera.
virtual void fitScene(const Core::Aabb &aabb)=0
Setup the Camera according to the AABB of the scene to render.
virtual void setCameraPosition(const Core::Vector3 &position)=0
Set the Camera position to position.
bool hasLightAttached() const
Engine::Scene::Light * getLight()
pointer acces to the attached light if it exists, returns nullptr otherwise.
Ra::Core::Utils::Index KeyMappingAction
handle to an action
Ra::Core::Utils::Index Context
handle to a Context