Isis 3 Programmer Reference
|
Bullet ray tracing callback to return all intersections along a ray's path. More...
#include <BulletAllHitsRayCallback.h>
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 BulletClosestRayCallback & | hit (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< BulletClosestRayCallback > | m_rayHits |
List of ray hits. | |
Bullet ray tracing callback to return all intersections along a ray's path.
Definition at line 30 of file BulletAllHitsRayCallback.h.
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.
Isis::BulletAllHitsRayCallback::BulletAllHitsRayCallback | ( | const btVector3 & | observer, |
const btVector3 & | lookdir, | ||
const bool | cullBackfacers = true ) |
Construct a callback with a ray start and ray end.
observer | The beginning of the ray. |
lookdir | The end of the ray. |
cullBackfacers | If back facing intersections should be culled. |
Definition at line 44 of file BulletAllHitsRayCallback.cpp.
|
virtual |
Destroy this callback.
Definition at line 60 of file BulletAllHitsRayCallback.cpp.
|
protectedvirtual |
Add a local intersection result to this callback during ray casting.
rayResult | The local intersection result for the ray cast. |
normalInWorldSpace | If the normal stored in the local result is in local coordinates or world coordinates. |
Definition at line 131 of file BulletAllHitsRayCallback.cpp.
References lookdir(), m_rayHits, and observer().
const BulletClosestRayCallback & Isis::BulletAllHitsRayCallback::hit | ( | const int & | index = 0 | ) | const |
Return a callback for the intersection at a given index.
index | The index of the intersection. |
Definition at line 112 of file BulletAllHitsRayCallback.cpp.
References m_rayHits, and size().
Referenced by Isis::BulletShapeModel::localRadius().
bool Isis::BulletAllHitsRayCallback::isValid | ( | ) | const |
Checks if the callback is valid/has a valid intersection.
Definition at line 70 of file BulletAllHitsRayCallback.cpp.
btVector3 Isis::BulletAllHitsRayCallback::lookdir | ( | ) | const |
Return the end of the ray.
Definition at line 100 of file BulletAllHitsRayCallback.cpp.
Referenced by addSingleResult().
btVector3 Isis::BulletAllHitsRayCallback::observer | ( | ) | const |
Return the beginning of the ray.
Definition at line 90 of file BulletAllHitsRayCallback.cpp.
Referenced by addSingleResult().
int Isis::BulletAllHitsRayCallback::size | ( | ) | const |
Returns the number of intersections found.
Definition at line 80 of file BulletAllHitsRayCallback.cpp.
References m_rayHits.
Referenced by hit().
|
protected |
List of ray hits.
Definition at line 46 of file BulletAllHitsRayCallback.h.
Referenced by addSingleResult(), hit(), and size().