Developer Documentation
BSPImplT< BSPCore > Class Template Reference
Inheritance diagram for BSPImplT< BSPCore >:

Classes

struct  less_pair_second
 
struct  NearestNeighbor
 Store nearest neighbor information. More...
 
struct  NearestNeighborData
 Store nearest neighbor information. More...
 
struct  RayCollisionData
 Store ray collide information. More...
 

Public Types

typedef BSPCore::Traits Traits
 
typedef BSPCore::Handle Handle
 
typedef BSPCore::Point Point
 
typedef BSPCore::Scalar Scalar
 
typedef BSPCore::Node Node
 
typedef BSPCore::Handles Handles
 
typedef BSPCore::HandleIter HandleIter
 
typedef std::vector< std::pair< Handle, Scalar > > RayCollision
 Store nearest neighbor information.
 

Public Member Functions

 BSPImplT (const Traits &_traits, const Scalar &_infinity=std::numeric_limits< Scalar >::infinity())
 
NearestNeighbor nearest (const Point &_p) const
 Return handle of the nearest neighbor face.
 
RayCollision raycollision (const Point &_p, const Point &_r) const
 intersect mesh with ray More...
 
RayCollision directionalRaycollision (const Point &_p, const Point &_r) const
 intersect mesh with ray More...
 
RayCollision nearestRaycollision (const Point &_p, const Point &_r) const
 intersect mesh with ray More...
 

Private Member Functions

void _nearest (Node *_node, NearestNeighborData &_data) const
 
void _raycollision_non_directional (Node *_node, RayCollisionData &_data) const
 recursive part of raycollision() More...
 
void _raycollision_directional (Node *_node, RayCollisionData &_data) const
 recursive part of directionalRaycollision() More...
 
void _raycollision_nearest_directional (Node *_node, RayCollisionData &_data) const
 

Private Attributes

const Scalar infinity_
 

Detailed Description

template<class BSPCore>
class BSPImplT< BSPCore >

Definition at line 74 of file BSPImplT.hh.

Member Function Documentation

template<class BSPCore >
void BSPImplT< BSPCore >::_raycollision_directional ( Node *  _node,
RayCollisionData _data 
) const
private

recursive part of directionalRaycollision()

Parameters
_nodeThe current node in the tree
_dataData pointer, used to collect the collision information

Definition at line 227 of file BSPImplT.cc.

template<class BSPCore >
void BSPImplT< BSPCore >::_raycollision_non_directional ( Node *  _node,
RayCollisionData _data 
) const
private

recursive part of raycollision()

Parameters
_nodeThe current node in the tree
_dataData pointer, used to collect the collision information

Definition at line 189 of file BSPImplT.cc.

template<class BSPCore >
BSPImplT< BSPCore >::RayCollision BSPImplT< BSPCore >::directionalRaycollision ( const Point &  _p,
const Point &  _r 
) const

intersect mesh with ray

This function shots a ray through the mesh and collects all intersected triangles and the handle of the closest face ( directional, so the ray direction is taken into account!).

Only hits with a distance > 0.0 to the point p will be collected (_p will be skipped!)

Parameters
_pStart point of the ray
_rRay direction
Returns
Collision information

Definition at line 152 of file BSPImplT.cc.

template<class BSPCore >
BSPImplT< BSPCore >::RayCollision BSPImplT< BSPCore >::nearestRaycollision ( const Point &  _p,
const Point &  _r 
) const

intersect mesh with ray

This function shots a ray through the mesh and determines the first intersected triangle and the handle of the closest face ( directional, so the ray direction is taken into account!).

Only hits with a distance > 0.0 to the point p will be collected (_p will be skipped!). Note that for compatibility reasons the return type is still a vector of collisions.

Parameters
_pStart point of the ray
_rRay direction
Returns
Collision information

Definition at line 170 of file BSPImplT.cc.

template<class BSPCore >
BSPImplT< BSPCore >::RayCollision BSPImplT< BSPCore >::raycollision ( const Point &  _p,
const Point &  _r 
) const

intersect mesh with ray

This function shots a ray through the mesh and collects all intersected triangles and the handle of the closest face ( non-directional, so no matter of the ray direction, the closest face handle is returned in either direction)

Parameters
_pStart point of the ray
_rRay direction
Returns
Collision information

Definition at line 135 of file BSPImplT.cc.


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