Class representing a KDTree ray caster.
More...
#include <KDTreeRaycaster.h>
|
| KDTreeRaycaster (std::shared_ptr< KDTreeNode > root) |
| KDTree ray caster constructor. More...
|
|
std::map< double, Primitive * > | searchAll (glm::dvec3 _rayOrigin, glm::dvec3 _rayDir, double tmin, double tmax, bool groundOnly) |
| Search all intersections for specified ray. More...
|
|
RaySceneIntersection * | search (glm::dvec3 _rayOrigin, glm::dvec3 _rayDir, double tmin, double tmax, bool groundOnly) |
| Search first intersection for specified ray. More...
|
|
void | searchAll_recursive (KDTreeNode *node, double tmin, double tmax) |
| Recursive search function to assist searchAll function. More...
|
|
Primitive * | search_recursive (KDTreeNode *node, double tmin, double tmax) |
| Recursive search function to assist search function. More...
|
|
|
double | epsilon = 0.0001 |
| Decimal precision for the ray caster.
|
|
bool | groundOnly = false |
| Flag to specify if only ground points must be considered (true) or not (false)
|
|
glm::dvec3 | rayDir |
| Ray 3D director vector.
|
|
glm::dvec3 | rayOrigin |
| Ray origin 3D coordinates.
|
|
std::vector< double > | rayDirArray |
| Vector containing components of ray director vector. It is filled at the start of a search operation. More...
|
|
std::vector< double > | rayOriginArray |
| Vector containing components of ray origin. It is filled at the start of a search operation. More...
|
|
std::shared_ptr< KDTreeNode > | root |
| Shared pointer to the root node of the KDTree.
|
|
double | closestHitDistance = std::numeric_limits<double>::max() |
| Distance of closest hit. It is numeric_limits<double>::max() by default.
|
|
std::map< double, Primitive * > | collectedPoints |
| Map of primitives identified by its distance with respect to ray origin. Only primitives which intersect with the ray are considered (i.e. those which distance with respect to ray origin is greater than 0)
|
|
Class representing a KDTree ray caster.
◆ KDTreeRaycaster()
KDTreeRaycaster::KDTreeRaycaster |
( |
std::shared_ptr< KDTreeNode > |
root | ) |
|
|
inline |
KDTree ray caster constructor.
- Parameters
-
root | Root node of the KDTree |
◆ search()
RaySceneIntersection * KDTreeRaycaster::search |
( |
glm::dvec3 |
_rayOrigin, |
|
|
glm::dvec3 |
_rayDir, |
|
|
double |
tmin, |
|
|
double |
tmax, |
|
|
bool |
groundOnly |
|
) |
| |
Search first intersection for specified ray.
- Parameters
-
_rayOrigin | Ray origin 3D coordinates |
_rayDir | Ray 3D director vector |
tmin | Minimum time to intersection. It is used to prevent considering intersections (capturing points) before this time during the recursive search process |
tmax | Maximum time to intersection. It is used to prevent considering intersections (capturing points) after this time during the recursive search process |
groundOnly | Flag to specify if only ground primitives must be considered (true) or not (false) |
- Returns
- Return first found intersection
- See also
- KDTreeRaycaster::search_recursive
◆ search_recursive()
Recursive search function to assist search function.
- Parameters
-
node | KDTree node to be recursively explored |
tmin | Minimum time to intersection. It is used to prevent considering intersections (capturing points) before this time during the recursive search process |
tmax | Maximum time to intersection. It is used to prevent considering intersections (capturing points) after this time during the recursive search process |
- Returns
- Return first found intersection
- See also
- KDTreeRaycaster::search
◆ searchAll()
map< double, Primitive * > KDTreeRaycaster::searchAll |
( |
glm::dvec3 |
_rayOrigin, |
|
|
glm::dvec3 |
_rayDir, |
|
|
double |
tmin, |
|
|
double |
tmax, |
|
|
bool |
groundOnly |
|
) |
| |
Search all intersections for specified ray.
- Parameters
-
_rayOrigin | Ray origin 3D coordinates |
_rayDir | Ray 3D director vector |
tmin | Minimum time to intersection. It is used to prevent considering intersections (capturing points) before this time during the recursive search process |
tmax | Maximum time to intersection. It is used to prevent considering intersections (capturing points) after this time during the recursive search process |
groundOnly | Flag to specify if only ground primitives must be considered (true) or not (false) |
- Returns
- Return map of collected primitives, each identified by its distance with respect to ray origin
- See also
- KDTreeRaycaster::searchAll_recursive
◆ searchAll_recursive()
void KDTreeRaycaster::searchAll_recursive |
( |
KDTreeNode * |
node, |
|
|
double |
tmin, |
|
|
double |
tmax |
|
) |
| |
Recursive search function to assist searchAll function.
- Parameters
-
node | KDTree node to be recursively explored |
tmin | Minimum time to intersection. It is used to prevent considering intersections (capturing points) before this time during the recursive search process |
tmax | Maximum time to intersection. It is used to prevent considering intersections (capturing points) after this time during the recursive search process |
- See also
- KDTreeRaycaster::searchAll
◆ rayDirArray
std::vector<double> KDTreeRaycaster::rayDirArray |
◆ rayOriginArray
std::vector<double> KDTreeRaycaster::rayOriginArray |
The documentation for this class was generated from the following files: