1#include <Gui/Viewer/CameraManipulator.hpp>
3#include <Core/Math/Math.hpp>
4#include <Engine/Scene/CameraManager.hpp>
5#include <Engine/Scene/Light.hpp>
7#include <Core/Asset/Camera.hpp>
8#include <Gui/Viewer/Viewer.hpp>
12using namespace Core::Utils;
16 m_cameraSensitivity( other.m_cameraSensitivity ),
17 m_quickCameraModifier( other.m_quickCameraModifier ),
18 m_wheelSpeedModifier( other.m_wheelSpeedModifier ),
19 m_targetedAabbVolume( other.m_targetedAabbVolume ),
20 m_mapCameraBahaviourToAabb( other.m_mapCameraBahaviourToAabb ),
21 m_target( other.m_target ),
22 m_camera( other.m_camera ),
23 m_light( other.m_light ) {}
28 Engine::RadiumEngine::getInstance()->getSystem(
"DefaultCameraManager" ) );
29 m_camera = cameraManager->getActiveCamera();
34void CameraManipulator::setCameraSensitivity( Scalar sensitivity ) {
38void CameraManipulator::setCameraFov( Scalar fov ) {
42void CameraManipulator::setCameraFovInDegrees( Scalar fov ) {
46void CameraManipulator::setCameraZNear( Scalar zNear ) {
50void CameraManipulator::setCameraZFar( Scalar zFar ) {
76 const Qt::MouseButtons&,
77 const Qt::KeyboardModifiers&,
87 const Qt::MouseButtons&,
88 const Qt::KeyboardModifiers&,
94 const Qt::MouseButtons&,
95 const Qt::KeyboardModifiers&,
void setZNear(Scalar zNear)
Set the Z Near plane distance to zNear.
void setZFar(Scalar zFar)
Set the Z Far plane distance to zFar.
Core::Vector3 getDirection() const
Return the direction the camera is looking at.
virtual void setDirection(const Eigen::Matrix< Scalar, 3, 1 > &)
The CameraManipulator class is the generic class for camera manipulators.
Core::Aabb m_targetedAabb
Camera behavior restriction AABB.
virtual void updateCamera()
virtual bool handleMousePressEvent(QMouseEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key)
virtual bool handleKeyReleaseEvent(QKeyEvent *event, const KeyMappingManager::KeyMappingAction &action)
bool m_mapCameraBahaviourToAabb
whether the camera is restrained or not
Core::Asset::Camera * m_camera
The Camera.
virtual ~CameraManipulator()
Scalar m_targetedAabbVolume
Volume of the m_targetedAabb.
virtual KeyMappingManager::Context mappingContext()
virtual bool handleWheelEvent(QWheelEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key)
virtual bool handleMouseReleaseEvent(QMouseEvent *event)
void mapCameraBehaviourToAabb(const Core::Aabb &aabb)
Set the AABB to restrain the camera behavior against.
virtual bool handleMouseMoveEvent(QMouseEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key)
virtual bool handleKeyPressEvent(QKeyEvent *event, const KeyMappingManager::KeyMappingAction &action)
void unmapCameraBehaviourToAabb()
Free the camera from AABB restriction.
Engine::Scene::Light * m_light
The light attached to the Camera.
CameraManipulator()
Initializes a manipulator for a given viewport size.
Scalar m_cameraSensitivity
the Camera sensitivity to manipulation.
void attachLight(Engine::Scene::Light *light)
Ra::Core::Utils::Index KeyMappingAction
handle to an action
Ra::Core::Utils::Index Context
handle to a Context
hepler function to manage enum as underlying types in VariableSet