dtCore::BatchIsector Class Reference

To search the whole Scene for the height of terrain at a given xyz:. More...

#include <batchisector.h>

List of all members.

Public Member Functions

 BatchIsector (Scene *scene=NULL)
 
Parameters:
scene The Delta3D scene to intersect.

void SetQueryRoot (DeltaDrawable *drawable)
 Sets a drawable as the root of the intersection tests.
void ClearQueryRoot ()
 Clears the currently assigned root drawable of the intersection tests.
DeltaDrawableGetQueryRoot ()
 
Returns:
the root of the scene to query. It will return if this is using the entire scene.

const DeltaDrawableGetQueryRoot () const
 
Returns:
the root of the scene to query. It will return if this is using the entire scene.

void SetScene (Scene *newScene)
 Sets the scene to use as the base for the scene query.
SceneGetScene ()
 
Returns:
the scene being queried.

const SceneGetScene () const
 
Returns:
the scene being queried.

SingleISectorEnableAndGetISector (int nID)
 Create an isector if not made already, else makes one.
const SingleISectorGetSingleISector (int nIndexID)
 Get an SingleISector for reference vars.
void StopUsingSingleISector (int nIndexID)
 removes a single isector from the list
void StopUsingAllISectors ()
 removes a single isector from the list
bool Update (const osg::Vec3 &cameraEyePoint, bool useHighestLvlOfDetail=true)
 Ray traces the scene.
void Reset ()
 Resets the intersection query.
DeltaDrawableMapNodePathToDrawable (osg::NodePath &geode)
 Finds the DeltaDrawable that contains the given geometry node.

Protected Member Functions

virtual ~BatchIsector ()
bool CheckBoundsOnArray (int index)

Classes

class  SingleISector


Detailed Description

To search the whole Scene for the height of terrain at a given xyz:.

      BatchIsector *isect = new BatchIsector( mScene );
      osg::Vec3 queryPoint( 500.0f, 500.0f, 1000.0f );
      isect->EnableAndGetISector(0).SetSectorAsLineSegment(const osg::Vec3& startPos, const osg::Vec3& endPos);
      isect->Update(queryPoint, true);
      osg::Vec3 hitPt;
      isect->GetSingleISector(0).GetHitPoint( hitPt );

Constructor & Destructor Documentation

dtCore::BatchIsector::BatchIsector ( dtCore::Scene scene = NULL  ) 

Parameters:
scene The Delta3D scene to intersect.

dtCore::BatchIsector::~BatchIsector (  )  [protected, virtual]


Member Function Documentation

bool dtCore::BatchIsector::CheckBoundsOnArray ( int  index  )  [protected]

void dtCore::BatchIsector::SetQueryRoot ( DeltaDrawable drawable  )  [inline]

Sets a drawable as the root of the intersection tests.

If this is specified, it will take precedence over the currently assigned Delta3D scene.

Parameters:
drawable The drawable to intersect.

void dtCore::BatchIsector::ClearQueryRoot (  )  [inline]

Clears the currently assigned root drawable of the intersection tests.

DeltaDrawable* dtCore::BatchIsector::GetQueryRoot (  )  [inline]

Returns:
the root of the scene to query. It will return if this is using the entire scene.

const DeltaDrawable* dtCore::BatchIsector::GetQueryRoot (  )  const [inline]

Returns:
the root of the scene to query. It will return if this is using the entire scene.

void dtCore::BatchIsector::SetScene ( Scene newScene  )  [inline]

Sets the scene to use as the base for the scene query.

Scene* dtCore::BatchIsector::GetScene (  )  [inline]

Returns:
the scene being queried.

const Scene* dtCore::BatchIsector::GetScene (  )  const [inline]

Returns:
the scene being queried.

BatchIsector::SingleISector & dtCore::BatchIsector::EnableAndGetISector ( int  nID  ) 

Create an isector if not made already, else makes one.

const BatchIsector::SingleISector & dtCore::BatchIsector::GetSingleISector ( int  nIndexID  ) 

Get an SingleISector for reference vars.

void dtCore::BatchIsector::StopUsingSingleISector ( int  nIndexID  ) 

removes a single isector from the list

void dtCore::BatchIsector::StopUsingAllISectors (  ) 

removes a single isector from the list

bool dtCore::BatchIsector::Update ( const osg::Vec3 &  cameraEyePoint,
bool  useHighestLvlOfDetail = true 
)

Ray traces the scene.

Returns:
True if any intersections were detected.
Note:
If the query root has been set, only the query root drawable and its children are candidates for intersection. If not, all drawables in the scene are possibilities.

void dtCore::BatchIsector::Reset (  ) 

Resets the intersection query.

Call this in between disjoint intersection executions.

dtCore::DeltaDrawable * dtCore::BatchIsector::MapNodePathToDrawable ( osg::NodePath &  geode  ) 

Finds the DeltaDrawable that contains the given geometry node.

Parameters:
geode The node to search for.
Returns:
A valid DeltaDrawable if one was found or 0 otherwise.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008