|
Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
|
Abstract interface for gizmo manipulation handles. More...
#include <IHandle.h>
Public Member Functions | |
| virtual | ~IHandle ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
| virtual void | onDrag (const Math::Ray &ray)=0 |
| Handles continuous dragging motion. | |
| virtual void | setDragState (glm::vec3 initHitPos)=0 |
| Initializes the drag operation state. | |
| virtual glm::vec3 | getAxisDir () const =0 |
| Gets the axis direction this handle operates along/around. | |
| virtual glm::mat4 | getModelMatrix () const =0 |
| Gets the model transformation matrix for rendering this handle. | |
Protected Member Functions | |
| IHandle ()=default | |
| Protected constructor to enforce interface-only usage. | |
Static Protected Member Functions | |
| static glm::mat4 | rotateFromYToAxis (Axis axis) |
| Computes rotation matrix to align mesh from +Y to target axis. | |
Abstract interface for gizmo manipulation handles.
IHandle defines the behavior contract for interactive manipulation tools (translation, rotation, scale handles) without dictating how they are rendered.
Key design decisions:
|
virtualdefault |
Virtual destructor for proper cleanup of derived classes.
|
protecteddefault |
Protected constructor to enforce interface-only usage.
|
pure virtual |
Gets the axis direction this handle operates along/around.
Implemented in RotateHandle, ScaleHandle, and TranslateHandle.
|
pure virtual |
Gets the model transformation matrix for rendering this handle.
The model matrix encodes:
Implemented in RotateHandle, ScaleHandle, and TranslateHandle.
|
pure virtual |
Handles continuous dragging motion.
Called every frame while the handle is being dragged. Implementations should:
| ray | The current mouse ray in world space. |
Implemented in RotateHandle, ScaleHandle, and TranslateHandle.
|
inlinestaticprotected |
Computes rotation matrix to align mesh from +Y to target axis.
Handle meshes are authored pointing along +Y. This helper rotates them to point along X, Y, or Z as needed.
| axis | The target axis to align to. |
Definition at line 127 of file IHandle.h.
|
pure virtual |
Initializes the drag operation state.
Called once when the user begins dragging this handle. Implementations should capture:
| initHitPos | The world-space position where the ray first hit the handle. |
Implemented in RotateHandle, ScaleHandle, and TranslateHandle.