Bullet ray tracing callback to return all intersections along a ray's path.
More...
#include <BulletAllHitsRayCallback.h>
|
virtual btScalar | addSingleResult (btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace) |
| Add a local intersection result to this callback during ray casting.
|
|
Bullet ray tracing callback to return all intersections along a ray's path.
- Author
- 2017-03-17 Kris Becker
◆ 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
-
observer | The beginning of the ray. |
lookdir | The end of the ray. |
cullBackfacers | If back facing intersections should be culled. |
◆ ~BulletAllHitsRayCallback()
Isis::BulletAllHitsRayCallback::~BulletAllHitsRayCallback |
( |
| ) |
|
|
virtual |
◆ 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
-
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. |
- Returns
- btScalar The hit fraction, fractional distance along the ray, of the intersections
References lookdir(), m_rayHits, and observer().
◆ hit()
◆ 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().
◆ m_rayHits
The documentation for this class was generated from the following files: