Radium Engine
1.5.0
|
The CameraManipulator class is the generic class for camera manipulators. More...
#include <Gui/Viewer/CameraManipulator.hpp>
Public Slots | |
void | mapCameraBehaviourToAabb (const Core::Aabb &aabb) |
Set the AABB to restrain the camera behavior against. | |
void | unmapCameraBehaviourToAabb () |
Free the camera from AABB restriction. | |
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 . | |
virtual void | setCameraTarget (const Core::Vector3 &target)=0 |
Set the Camera target to target . | |
virtual void | resetCamera ()=0 |
Reset the Camera settings to default values. | |
Camera properties setters | |
void | setCameraSensitivity (Scalar sensitivity) |
void | setCameraFov (Scalar fov) |
void | setCameraFovInDegrees (Scalar fov) |
void | setCameraZNear (Scalar zNear) |
void | setCameraZFar (Scalar zFar) |
Public Member Functions | |
CameraManipulator () | |
Initializes a manipulator for a given viewport size. | |
CameraManipulator (const CameraManipulator &other) | |
virtual | ~CameraManipulator () |
virtual KeyMappingManager::Context | mappingContext () |
virtual bool | handleMousePressEvent (QMouseEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key) |
virtual bool | handleMouseReleaseEvent (QMouseEvent *event) |
virtual bool | handleMouseMoveEvent (QMouseEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key) |
virtual bool | handleWheelEvent (QWheelEvent *event, const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &modifiers, int key) |
virtual bool | handleKeyPressEvent (QKeyEvent *event, const KeyMappingManager::KeyMappingAction &action) |
virtual bool | handleKeyReleaseEvent (QKeyEvent *event, const KeyMappingManager::KeyMappingAction &action) |
const Core::Asset::Camera * | getCamera () const |
Pointer access to the camera. | |
Core::Asset::Camera * | getCamera () |
Pointer access to the camera. | |
virtual void | updateCamera () |
void | attachLight (Engine::Scene::Light *light) |
bool | hasLightAttached () const |
Engine::Scene::Light * | getLight () |
pointer acces to the attached light if it exists, returns nullptr otherwise. | |
Protected Member Functions | |
std::pair< Scalar, Scalar > | computeDeltaMouseMove (const QMouseEvent *mouseEvent) |
Protected Attributes | |
Scalar | m_lastMouseX { 0_ra } |
x-position of the mouse on the screen at the manipulation start. | |
Scalar | m_lastMouseY { 0_ra } |
y-position of the mouse on the screen at the manipulation start. | |
Scalar | m_cameraSensitivity { 1_ra } |
the Camera sensitivity to manipulation. | |
Scalar | m_quickCameraModifier { 1_ra } |
Additional factor for camera sensitivity. | |
Scalar | m_wheelSpeedModifier { 0.02_ra } |
Speed modifier on mouse wheel events. | |
Core::Aabb | m_targetedAabb |
Camera behavior restriction AABB. | |
Scalar | m_targetedAabbVolume { 0_ra } |
Volume of the m_targetedAabb. | |
bool | m_mapCameraBahaviourToAabb { false } |
whether the camera is restrained or not | |
Core::Vector3 | m_target { 0_ra, 0_ra, 0_ra } |
Core::Asset::Camera * | m_camera { nullptr } |
The Camera. | |
Engine::Scene::Light * | m_light { nullptr } |
The light attached to the Camera. | |
The CameraManipulator class is the generic class for camera manipulators.
Definition at line 29 of file CameraManipulator.hpp.
|
explicit |
Initializes a manipulator keeping properties from an already existing one. This allows to switch from one manipulator to another while keeping the same visual experience.
Definition at line 14 of file CameraManipulator.cpp.
|
virtual |
Destructor. As a Manipulator does not have ownership over the associated Camera, do not release the associated Camera.
Definition at line 32 of file CameraManipulator.cpp.
void Ra::Gui::CameraManipulator::attachLight | ( | Engine::Scene::Light * | light | ) |
Set the Light attached to the camera.
Definition at line 66 of file CameraManipulator.cpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 100 of file CameraManipulator.cpp.
|
virtual |
Definition at line 105 of file CameraManipulator.cpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 86 of file CameraManipulator.cpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 75 of file CameraManipulator.cpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 82 of file CameraManipulator.cpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 93 of file CameraManipulator.cpp.
|
inline |
Definition at line 90 of file CameraManipulator.hpp.
|
virtual |
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 71 of file CameraManipulator.cpp.
|
virtual |
Reset manipulator internal data according to current active camera from manager. Call each time the active camera is changed to have coherent data.
Reimplemented in Ra::Gui::TrackballCameraManipulator, and Ra::Gui::FlightCameraManipulator.
Definition at line 54 of file CameraManipulator.cpp.
|
protected |
Target point of the camera (usefull for most of the manipulator metaphor) Be aware that m_target must always be on the line of sight of the camera so that it could be used as a "focus" point by a manipulator.
Definition at line 151 of file CameraManipulator.hpp.