Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
sv::SelectionQuery Class Reference

Use to select objects in the scene. More...

#include <selection_query.hpp>

Public Member Functions

 SelectionQuery (const Scene::Ptr &scene)
 
std::vector< QueryResultCastRay (const int64_t selection_mask, const QVector3D &start, const QVector3D &dir)
 Perform a ray cast selection query. More...
 

Static Public Member Functions

static bool Intersection (const AxisAlignedBox &box, const QVector3D &ray_start, const QVector3D &ray_dir, double *result)
 

Detailed Description

Use to select objects in the scene.

Bounding boxes

During a selection query, only the axis-aligned bounding boxes for a node are considered. This may result in false positives, and it is up to the user to perform more detailed selection test.

Selection mask

Each node in the scene is assigned a selection mask, which can be used by the user to determine what nodes are candidates for selection during a query. During a query, the query selection mask is bitwise-ANDed with each node's mask, and only nodes with a nonzero match are considered. You can use this to implement different selection categories.

By default, a node's selection mask is 0, which means that no nodes are selectable by default.

Member Function Documentation

std::vector<QueryResult> sv::SelectionQuery::CastRay ( const int64_t  selection_mask,
const QVector3D &  start,
const QVector3D &  dir 
)

Perform a ray cast selection query.

Parameters
selection_maskthe selection mask to use when considering nodes.
startthe ray starting point, in world coordinates.
dirthe ray direction, in world coordinates. Does not need to be normalized.
Returns
a vector of matching nodes, sorted in ascending order of distance along the ray (i.e., the closest matching nodes are first).

The documentation for this class was generated from the following file: