Ray casting and intersection testing. More...
#include <raypicker.h>
Static Public Member Functions | |
| static bool | unproject (const QPoint &screenPos, const QRect &paneRect, const QMatrix4x4 &pvm, QVector3D &rayOrigin, QVector3D &rayDir) |
| static PickResult | pick (const QVector3D &rayOrigin, const QVector3D &rayDir, const SubView &subView, const QMap< QString, std::shared_ptr< BrainSurface > > &surfaces, const QMap< const QStandardItem *, std::shared_ptr< BrainSurface > > &itemSurfaceMap, const QMap< const QStandardItem *, std::shared_ptr< DipoleObject > > &itemDipoleMap) |
| static QString | buildLabel (const PickResult &result, const QMap< const QStandardItem *, std::shared_ptr< BrainSurface > > &itemSurfaceMap, const QMap< QString, std::shared_ptr< BrainSurface > > &surfaces) |
Ray casting and intersection testing.
Stateless ray-picking utility.
Given camera matrices, a screen position, and the scene contents, this class casts a ray and returns a PickResult describing the closest intersection. It has no state of its own — hover tracking is handled by the caller.
Definition at line 100 of file raypicker.h.
|
static |
Build a display label from a PickResult.
This examines the surface key, annotation data, and item type to produce a human-readable hover label.
| [in] | result | PickResult from pick(). |
| [in] | itemSurfaceMap | Map for reverse item → surface lookup. |
| [in] | surfaces | Surface map for key-based lookup. |
Definition at line 174 of file raypicker.cpp.
|
static |
Cast a ray against all surfaces in the scene.
| [in] | rayOrigin | World-space ray origin. |
| [in] | rayDir | World-space ray direction (normalised). |
| [in] | subView | Active SubView (for visibility / surface type filtering). |
| [in] | surfaces | Map of surface key → BrainSurface. |
| [in] | itemSurfaceMap | Map of tree item → BrainSurface (for reverse lookup). |
| [in] | itemDipoleMap | Map of tree item → DipoleObject. |
Definition at line 85 of file raypicker.cpp.
|
static |
Unproject a screen position to a world-space ray.
| [in] | screenPos | 2D cursor position (widget coords). |
| [in] | paneRect | Rectangle of the active viewport pane. |
| [in] | pvm | Combined projection × view × model matrix. |
| [out] | rayOrigin | Ray origin (world space). |
| [out] | rayDir | Ray direction (normalised, world space). |
Definition at line 52 of file raypicker.cpp.