Camera state and matrix computation. More...
#include <cameracontroller.h>
Public Member Functions | |
| CameraController ()=default | |
| void | setSceneCenter (const QVector3D ¢er) |
| void | setSceneSize (float size) |
| QVector3D | sceneCenter () const |
| float | sceneSize () const |
| void | setRotation (const QQuaternion &q) |
| QQuaternion | rotation () const |
| void | setZoom (float z) |
| float | zoom () const |
| void | resetRotation () |
| CameraResult | computeSingleView (float aspectRatio) const |
| CameraResult | computeMultiView (const SubView &subView, float aspectRatio) const |
Static Public Member Functions | |
| static void | applyMouseRotation (const QPoint &delta, QQuaternion &rotation, float speed=0.5f) |
| static void | applyMousePan (const QPoint &delta, QVector2D &pan, float sceneSize) |
Camera state and matrix computation.
Encapsulates camera state and produces view/projection matrices.
This class is independent of any Qt widget — it takes scene geometry parameters and view configuration, and produces camera matrices. It also handles rotation, zoom, and pan from mouse delta values.
Definition at line 74 of file cameracontroller.h.
|
default |
Constructor.
|
static |
Apply pan from mouse drag delta (planar multi-view pane).
| [in] | delta | Mouse delta in pixels. |
| [in,out] | pan | Pan offset to update. |
| [in] | sceneSize | Current scene size for scaling. |
Definition at line 118 of file cameracontroller.cpp.
|
static |
Apply rotation from mouse drag delta (single-view or perspective pane).
| [in] | delta | Mouse delta in pixels. |
| [in,out] | rotation | Rotation quaternion to update. |
| [in] | speed | Rotation speed multiplier (default 0.5). |
Definition at line 98 of file cameracontroller.cpp.
| CameraResult DISP3DLIB::CameraController::computeMultiView | ( | const SubView & | subView, |
| float | aspectRatio ) const |
Compute camera matrices for a multi-view pane.
| [in] | subView | Per-view state (preset, zoom, pan, rotation). |
| [in] | aspectRatio | Width / height of the pane. |
Definition at line 78 of file cameracontroller.cpp.
| CameraResult DISP3DLIB::CameraController::computeSingleView | ( | float | aspectRatio | ) | const |
Compute camera matrices for a single-view viewport.
| [in] | aspectRatio | Width / height of the viewport. |
Definition at line 68 of file cameracontroller.cpp.
|
inline |
Reset single-view rotation to identity.
Definition at line 145 of file cameracontroller.h.
|
inline |
Definition at line 125 of file cameracontroller.h.
|
inline |
Definition at line 105 of file cameracontroller.h.
|
inline |
Definition at line 109 of file cameracontroller.h.
|
inline |
Set user rotation for single-view.
| [in] | q | Camera rotation quaternion. |
Definition at line 121 of file cameracontroller.h.
|
inline |
Set the scene center (centroid of visible objects).
| [in] | center | Scene centroid in world coordinates. |
Definition at line 90 of file cameracontroller.h.
|
inline |
Set the scene size (extent of visible objects).
| [in] | size | Scene extent in world units; values at or below 0.01 fall back to 0.3. |
Definition at line 100 of file cameracontroller.h.
|
inline |
Single-view zoom level.
| [in] | z | Zoom level; each unit moves the camera 5% of the scene size closer. |
Definition at line 135 of file cameracontroller.h.
|
inline |
Definition at line 139 of file cameracontroller.h.