Intersector Class Reference

#include <Intersector.h>

List of all members.

Public Member Functions

 Intersector ()
virtual ~Intersector ()
virtual void init (int mask, float maxDist=MAXFLOAT)
PointEnvadoptIntersection (void)
const PointEnvinspectIntersection (void) const
float getActDistance (void) const
int getMask (void) const
virtual int processCandidate (SceneGraphObject *pObject, const Vector3 &origin, const Vector3 &direction)

Protected Attributes

PointEnv_pEnv
PointEnv_pNewEnv
float _distance
ESGbitmask _wantedMask


Detailed Description

Intersector processes scene graph primitives and finds the closest point of intersection with ray (see PointEnv)

Definition at line 16 of file Intersector.h.


Constructor & Destructor Documentation

Intersector  )  [inline]
 

Constructor

Definition at line 28 of file Intersector.h.

virtual ~Intersector  )  [inline, virtual]
 

Desctructor

Definition at line 33 of file Intersector.h.


Member Function Documentation

PointEnv * adoptIntersection void   ) 
 

Returns the closest point of intersection, the point is removed from this Intersctor object

Returns:
the closest point of intersection or NULL

Definition at line 16 of file Intersector.cc.

References Intersector::_pEnv.

Referenced by Surface::rayIntersection(), and RayIntExplorer::result().

float getActDistance void   )  const [inline]
 

Returns:
distance of actual closest point of inntersection or 0

Definition at line 63 of file Intersector.h.

Referenced by RayIntExplorer::_explore(), and Surface::rayIntersection().

int getMask void   )  const [inline]
 

Returns:
the actual bitmask

Definition at line 68 of file Intersector.h.

void init int  mask,
float  maxDist = MAXFLOAT
[virtual]
 

Initializes the search of the closest point of intersection

Parameters:
mask PointEnv bitmask determining what is computed during the ray intersection calculation
maxDist farer points of intersection are ignored

Definition at line 6 of file Intersector.cc.

References Intersector::_distance, Intersector::_pEnv, Intersector::_wantedMask, and ENV_WANT_DISTANCE.

Referenced by Surface::rayIntersection(), and OSGAdapter::rayIntersection().

const PointEnv* inspectIntersection void   )  const [inline]
 

Returns reference to the closest point of intersection, the point remains under the control of this Intersctor object!

Returns:
_reference_ to the closest point of intersection or NULL

Definition at line 58 of file Intersector.h.

int processCandidate SceneGraphObject pObject,
const Vector3 origin,
const Vector3 direction
[virtual]
 

Finds point of ray intersection with given primitive object and checks whether the point is not closer than already found closest point.

Parameters:
pObject rested scen graph primitive
origin ray origin
direction ray direction
Returns:
1 it the primitive has the closest point of intersection, 0 otherwise

Definition at line 24 of file Intersector.cc.

References Intersector::_distance, Intersector::_pEnv, Intersector::_pNewEnv, Intersector::_wantedMask, PointEnv::distance, ENV_HAVE_ASOC_PRIMITIVE, ENV_HAVE_DISTANCE, ENV_WANT_ASOC_PRIMITIVE, SceneGraphObject::geometry(), PointEnv::mask, PointEnv::pVisitableObj, and Geometry::rayIntersection().

Referenced by Surface::rayIntersection().


Member Data Documentation

float _distance [protected]
 

Definition at line 20 of file Intersector.h.

Referenced by Intersector::init(), and Intersector::processCandidate().

PointEnv* _pEnv [protected]
 

Definition at line 18 of file Intersector.h.

Referenced by Intersector::adoptIntersection(), Intersector::init(), and Intersector::processCandidate().

PointEnv* _pNewEnv [protected]
 

Definition at line 19 of file Intersector.h.

Referenced by Intersector::processCandidate().

ESGbitmask _wantedMask [protected]
 

Definition at line 21 of file Intersector.h.

Referenced by Intersector::init(), and Intersector::processCandidate().


The documentation for this class was generated from the following files:
Generated on Wed Jun 28 12:24:34 2006 for esg by  doxygen 1.4.6