Isis 3 Programmer Reference
Isis::BulletAllHitsRayCallback Class Reference

Bullet ray tracing callback to return all intersections along a ray's path. More...

#include <BulletAllHitsRayCallback.h>

Inheritance diagram for Isis::BulletAllHitsRayCallback:
Inheritance graph
Collaboration diagram for Isis::BulletAllHitsRayCallback:
Collaboration graph

Public Member Functions

 BulletAllHitsRayCallback ()
 Default constructor.
 
 BulletAllHitsRayCallback (const btVector3 &observer, const btVector3 &lookdir, const bool cullBackfacers=true)
 Construct a callback with a ray start and ray end.
 
virtual ~BulletAllHitsRayCallback ()
 Destroy this callback.
 
bool isValid () const
 Checks if the callback is valid/has a valid intersection.
 
int size () const
 Returns the number of intersections found.
 
btVector3 observer () const
 Return the beginning of the ray.
 
btVector3 lookdir () const
 Return the end of the ray.
 
const BulletClosestRayCallbackhit (const int &index=0) const
 Return a callback for the intersection at a given index.
 

Protected Member Functions

virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace)
 Add a local intersection result to this callback during ray casting.
 

Protected Attributes

QVector< BulletClosestRayCallbackm_rayHits
 List of ray hits.
 

Detailed Description

Bullet ray tracing callback to return all intersections along a ray's path.

Author
2017-03-17 Kris Becker
History
2017-03-17 Kris Becker Original Version

Definition at line 30 of file BulletAllHitsRayCallback.h.

Constructor & Destructor Documentation

◆ BulletAllHitsRayCallback() [1/2]

Isis::BulletAllHitsRayCallback::BulletAllHitsRayCallback ( )

Default constructor.

The ray beginning and end default to the origin. The intersections vector defaults to empty.

Definition at line 29 of file BulletAllHitsRayCallback.cpp.

◆ BulletAllHitsRayCallback() [2/2]

Isis::BulletAllHitsRayCallback::BulletAllHitsRayCallback ( const btVector3 & observer,
const btVector3 & lookdir,
const bool cullBackfacers = true )

Construct a callback with a ray start and ray end.

Parameters
observerThe beginning of the ray.
lookdirThe end of the ray.
cullBackfacersIf back facing intersections should be culled.

Definition at line 44 of file BulletAllHitsRayCallback.cpp.

◆ ~BulletAllHitsRayCallback()

Isis::BulletAllHitsRayCallback::~BulletAllHitsRayCallback ( )
virtual

Destroy this callback.

Definition at line 60 of file BulletAllHitsRayCallback.cpp.

Member Function Documentation

◆ addSingleResult()

btScalar Isis::BulletAllHitsRayCallback::addSingleResult ( btCollisionWorld::LocalRayResult & rayResult,
bool normalInWorldSpace )
protectedvirtual

Add a local intersection result to this callback during ray casting.

Note
This method is called automatically by btCollisionWorld::rayTest.
Parameters
rayResultThe local intersection result for the ray cast.
normalInWorldSpaceIf the normal stored in the local result is in local coordinates or world coordinates.
Returns
btScalar The hit fraction, fractional distance along the ray, of the intersections

Definition at line 131 of file BulletAllHitsRayCallback.cpp.

References lookdir(), m_rayHits, and observer().

◆ hit()

const BulletClosestRayCallback & Isis::BulletAllHitsRayCallback::hit ( const int & index = 0) const

Return a callback for the intersection at a given index.

Parameters
indexThe index of the intersection.
Returns
BulletClosestRayCallback The callback for the intersection

Definition at line 112 of file BulletAllHitsRayCallback.cpp.

References m_rayHits, and size().

Referenced by Isis::BulletShapeModel::localRadius().

◆ isValid()

bool Isis::BulletAllHitsRayCallback::isValid ( ) const

Checks if the callback is valid/has a valid intersection.

Returns
bool If there is a valid intersection.
See also
ClosestRayResultCallback::hasHit()

Definition at line 70 of file BulletAllHitsRayCallback.cpp.

◆ lookdir()

btVector3 Isis::BulletAllHitsRayCallback::lookdir ( ) const

Return the end of the ray.

Returns
btVector3 The end of the ray.

Definition at line 100 of file BulletAllHitsRayCallback.cpp.

Referenced by addSingleResult().

◆ observer()

btVector3 Isis::BulletAllHitsRayCallback::observer ( ) const

Return the beginning of the ray.

Returns
btVector3 The beginning of the ray.

Definition at line 90 of file BulletAllHitsRayCallback.cpp.

Referenced by addSingleResult().

◆ size()

int Isis::BulletAllHitsRayCallback::size ( ) const

Returns the number of intersections found.

Returns
int The number of stored intersections in this callback.

Definition at line 80 of file BulletAllHitsRayCallback.cpp.

References m_rayHits.

Referenced by hit().

Member Data Documentation

◆ m_rayHits

QVector<BulletClosestRayCallback> Isis::BulletAllHitsRayCallback::m_rayHits
protected

List of ray hits.

Definition at line 46 of file BulletAllHitsRayCallback.h.

Referenced by addSingleResult(), hit(), and size().


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