#include <isector.h>

Public Member Functions | |
| Isector (Scene *scene=NULL) | |
| Constructs a new intersection query. | |
| Isector (const osg::Vec3 &start, const osg::Vec3 &dir, Scene *scene=NULL) | |
| Constructs a new intersection query using a ray constructed with the specified parameters. | |
| Isector (Scene *scene, const osg::Vec3 &start, const osg::Vec3 &end) | |
| Constructs a new intersection query using a line segment with the specified parameters. | |
| void | SetGeometry (DeltaDrawable *drawable) |
| Sets a drawable as the root of the intersection tests. | |
| void | ClearQueryRoot () |
| Clears the currently assigned root drawable of the intersection tests. | |
| DeltaDrawable * | GetQueryRoot () |
| |
| const DeltaDrawable * | GetQueryRoot () const |
| |
| void | SetScene (Scene *newScene) |
| Sets the scene to use as the base for the scene query. | |
| Scene * | GetScene () |
| |
| const Scene * | GetScene () const |
| |
| void | SetEyePoint (const osg::Vec3 &newEyePoint) |
| Sets the eyepoint. | |
| const osg::Vec3 | GetEyePoint () const |
| Gets the starting position of the intersection ray. | |
| void | SetUseEyePoint (bool newValue) |
| Sets if this Isector should consider the eye point for LOD calculations when doing the intersection or if it should ignore it and always use the highest LOD when intersecting.S. | |
| bool | GetUseEyePoint () const |
| |
| void | SetStartPosition (const osg::Vec3 &start) |
| Sets the starting position of the intersection ray. | |
| const osg::Vec3 & | GetStartPosition () const |
| Gets the starting position of the intersection ray. | |
| void | SetEndPosition (const osg::Vec3 &endXYZ) |
| void | SetDirection (const osg::Vec3 &dir) |
| Sets the direction of the intersection ray. | |
| const osg::Vec3 & | GetDirection () const |
| Gets the direction of the intersection ray. | |
| void | SetLength (float distance) |
| Set the length of the isector. | |
| float | GetLength () const |
| Get the length of the isector. | |
| void | GetHitPoint (osg::Vec3 &xyz, int pointNum=0) const |
| |
| void | GetHitPointNormal (osg::Vec3 &normal, int pointNum=0) const |
| |
| int | GetNumberOfHits () const |
| Get the number of intersected items. | |
| bool | Update () |
| Ray traces the scene. | |
| void | Reset () |
| Resets the intersection query. | |
| DeltaDrawable * | GetClosestDeltaDrawable () |
| Gets the DeltaDrawable that is closest to the query's starting point along the intersection ray. | |
| const DeltaDrawable * | GetClosestDeltaDrawable () const |
| Gets the DeltaDrawable that is closest to the query's starting point along the intersection ray. | |
| const osg::LineSegment * | GetLineSegment () const |
| Gets the line segment used for this intersection query. | |
| osgUtil::IntersectVisitor & | GetIntersectVisitor () |
| Gives access to the underlying intersect visitor. | |
| DeltaDrawable * | MapNodePathToDrawable (osg::NodePath &geode) |
| Finds the DeltaDrawable that contains the given geometry node. | |
| const osgUtil::IntersectVisitor::HitList & | GetHitList () const |
| Get the Hitlist member. | |
| osgUtil::IntersectVisitor::HitList & | GetHitList () |
| Get the Hitlist member. | |
Protected Member Functions | |
| virtual | ~Isector () |
Supply the starting position, the direction vector, the length of the Isector, and the geometry to intersect with.
If no geometry is specified with SetGeometry(), the whole Scene is searched.
After calling Update(), the results of the intersection may be queried with GetHitPoint().
Isector *isect = new Isector( mScene ); osg::Vec3 queryPoint( 500.0f, 500.0f, 1000.0f ); isect->SetStartPosition( queryPoint ); osg::Vec3 direction( 0.0f, 0.0f, -1.0f ); isect->SetDirection( direction ); isect->Update(); osg::Vec3 hitPt; isect->GetHitPoint( hitPt );
| dtCore::Isector::Isector | ( | dtCore::Scene * | scene = NULL |
) |
Constructs a new intersection query.
| scene | A Delta3D scene to intersect. If this is 0, a root drawable must be set. |
| dtCore::Isector::Isector | ( | const osg::Vec3 & | start, | |
| const osg::Vec3 & | dir, | |||
| dtCore::Scene * | scene = NULL | |||
| ) |
Constructs a new intersection query using a ray constructed with the specified parameters.
| start | The start of the ray. | |
| dir | The direction the ray is traveling. | |
| scene | The Delta3D scene to intersect. |
| dtCore::Isector::Isector | ( | dtCore::Scene * | scene, | |
| const osg::Vec3 & | start, | |||
| const osg::Vec3 & | end | |||
| ) |
Constructs a new intersection query using a line segment with the specified parameters.
| scene | The Delta3D scene to intersect. | |
| start | The start of the line segment. | |
| end | The end point of the line segment. |
| dtCore::Isector::~Isector | ( | ) | [protected, virtual] |
| void dtCore::Isector::SetGeometry | ( | 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.
| drawable | The drawable to intersect. |
| void dtCore::Isector::ClearQueryRoot | ( | ) | [inline] |
Clears the currently assigned root drawable of the intersection tests.
| DeltaDrawable* dtCore::Isector::GetQueryRoot | ( | ) | [inline] |
It will return if this is using the entire scene.
| const DeltaDrawable* dtCore::Isector::GetQueryRoot | ( | ) | const [inline] |
It will return if this is using the entire scene.
| void dtCore::Isector::SetScene | ( | dtCore::Scene * | newScene | ) |
Sets the scene to use as the base for the scene query.
| Scene* dtCore::Isector::GetScene | ( | ) | [inline] |
| const Scene* dtCore::Isector::GetScene | ( | ) | const [inline] |
| void dtCore::Isector::SetEyePoint | ( | const osg::Vec3 & | newEyePoint | ) | [inline] |
Sets the eyepoint.
This is used for LOD calculations when doing intersections.
| the | eye point |
| const osg::Vec3 dtCore::Isector::GetEyePoint | ( | ) | const [inline] |
Gets the starting position of the intersection ray.
| void dtCore::Isector::SetUseEyePoint | ( | bool | newValue | ) |
Sets if this Isector should consider the eye point for LOD calculations when doing the intersection or if it should ignore it and always use the highest LOD when intersecting.S.
| bool dtCore::Isector::GetUseEyePoint | ( | ) | const |
| void dtCore::Isector::SetStartPosition | ( | const osg::Vec3 & | start | ) | [inline] |
Sets the starting position of the intersection ray.
| start | The start position. |
| const osg::Vec3& dtCore::Isector::GetStartPosition | ( | ) | const [inline] |
Gets the starting position of the intersection ray.
| void dtCore::Isector::SetEndPosition | ( | const osg::Vec3 & | endXYZ | ) | [inline] |
| void dtCore::Isector::SetDirection | ( | const osg::Vec3 & | dir | ) | [inline] |
Sets the direction of the intersection ray.
| dir | The direction vector. This is normalized before being assigned. |
| const osg::Vec3& dtCore::Isector::GetDirection | ( | ) | const [inline] |
Gets the direction of the intersection ray.
| void dtCore::Isector::SetLength | ( | float | distance | ) | [inline] |
Set the length of the isector.
| float dtCore::Isector::GetLength | ( | ) | const [inline] |
Get the length of the isector.
| void dtCore::Isector::GetHitPoint | ( | osg::Vec3 & | xyz, | |
| int | pointNum = 0 | |||
| ) | const |
Get the intersected point since the last call to Update().
| xyz | : The xyz position to be filled out [in/out] | |
| pointNum,: | Which intersection point to return [0..GetNumberOfHits()] |
| void dtCore::Isector::GetHitPointNormal | ( | osg::Vec3 & | normal, | |
| int | pointNum = 0 | |||
| ) | const |
Get the normal at the intersected point.
| int dtCore::Isector::GetNumberOfHits | ( | ) | const |
Get the number of intersected items.
Get the number of items that were intersected by this Isector.
Note: Isector::Update() must be called prior to calling this method.
| bool dtCore::Isector::Update | ( | ) |
Ray traces the scene.
| void dtCore::Isector::Reset | ( | ) |
Resets the intersection query.
Call this in between disjoint intersection executions.
| DeltaDrawable* dtCore::Isector::GetClosestDeltaDrawable | ( | ) | [inline] |
Gets the DeltaDrawable that is closest to the query's starting point along the intersection ray.
| const DeltaDrawable* dtCore::Isector::GetClosestDeltaDrawable | ( | ) | const [inline] |
Gets the DeltaDrawable that is closest to the query's starting point along the intersection ray.
| const osg::LineSegment* dtCore::Isector::GetLineSegment | ( | ) | const [inline] |
Gets the line segment used for this intersection query.
| osgUtil::IntersectVisitor& dtCore::Isector::GetIntersectVisitor | ( | ) | [inline] |
Gives access to the underlying intersect visitor.
This is useful when a more detailed description of the intersection tests are required.
| dtCore::DeltaDrawable * dtCore::Isector::MapNodePathToDrawable | ( | osg::NodePath & | geode | ) |
Finds the DeltaDrawable that contains the given geometry node.
| geode | The node to search for. |
| const osgUtil::IntersectVisitor::HitList& dtCore::Isector::GetHitList | ( | ) | const [inline] |
Get the Hitlist member.
Do not assume this list is sorted based on distance from the starting point.
| osgUtil::IntersectVisitor::HitList& dtCore::Isector::GetHitList | ( | ) | [inline] |
Get the Hitlist member.
Do not assume this list is sorted based on distance from the starting point.