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 79 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 137 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 117 of file cameracontroller.cpp.
| CameraResult 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 97 of file cameracontroller.cpp.
| CameraResult CameraController::computeSingleView | ( | float | aspectRatio | ) | const |
Compute camera matrices for a single-view viewport.
| [in] | aspectRatio | Width / height of the viewport. |
Definition at line 87 of file cameracontroller.cpp.
|
inline |
Reset single-view rotation to identity.
Definition at line 110 of file cameracontroller.h.
|
inline |
Definition at line 103 of file cameracontroller.h.
|
inline |
Definition at line 96 of file cameracontroller.h.
|
inline |
Definition at line 97 of file cameracontroller.h.
|
inline |
Set user rotation for single-view.
Definition at line 102 of file cameracontroller.h.
|
inline |
Set the scene center (centroid of visible objects).
Definition at line 91 of file cameracontroller.h.
|
inline |
Set the scene size (extent of visible objects).
Definition at line 94 of file cameracontroller.h.
|
inline |
Single-view zoom level.
Definition at line 106 of file cameracontroller.h.
|
inline |
Definition at line 107 of file cameracontroller.h.