Isis Developer 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. More...
 
 BulletAllHitsRayCallback (const btVector3 &observer, const btVector3 &lookdir, const bool cullBackfacers=true)
 Construct a callback with a ray start and ray end. More...
 
virtual ~BulletAllHitsRayCallback ()
 Destroy this callback. More...
 
bool isValid () const
 Checks if the callback is valid/has a valid intersection. More...
 
int size () const
 Returns the number of intersections found. More...
 
btVector3 observer () const
 Return the beginning of the ray. More...
 
btVector3 lookdir () const
 Return the end of the ray. More...
 
const BulletClosestRayCallbackhit (const int &index=0) const
 Return a callback for the intersection at a given index. More...
 

Protected Member Functions

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

Protected Attributes

QVector< BulletClosestRayCallbackm_rayHits
 List of ray hits. More...
 

Detailed Description

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

Author
2017-03-17 Kris Becker

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.

◆ 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.

◆ ~BulletAllHitsRayCallback()

Isis::BulletAllHitsRayCallback::~BulletAllHitsRayCallback ( )
virtual

Destroy this callback.

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

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

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()

◆ lookdir()

btVector3 Isis::BulletAllHitsRayCallback::lookdir ( ) const

Return the end of the ray.

Returns
btVector3 The end of the ray.

Referenced by addSingleResult().

◆ observer()

btVector3 Isis::BulletAllHitsRayCallback::observer ( ) const

Return the beginning of the ray.

Returns
btVector3 The beginning of the ray.

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.

References m_rayHits.

Referenced by hit().

Member Data Documentation

◆ m_rayHits

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

List of ray hits.

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


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