10#include <QScopedPointer>
15#include "BulletAllHitsRayCallback.h"
17#include "IException.h"
18#include "SurfacePoint.h"
20#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
30 btCollisionWorld::AllHitsRayResultCallback(btVector3(0,0,0), btVector3(0,0,0)),
32 m_flags = (btTriangleRaycastCallback::kF_KeepUnflippedNormal |
33 btTriangleRaycastCallback::kF_UseGjkConvexCastRaytest);
45 const btVector3 &lookdir,
46 const bool cullBackfacers) :
47 btCollisionWorld::AllHitsRayResultCallback(observer, lookdir),
49 m_flags = (btTriangleRaycastCallback::kF_KeepUnflippedNormal |
50 btTriangleRaycastCallback::kF_UseGjkConvexCastRaytest);
51 if ( cullBackfacers ) {
52 m_flags |= btTriangleRaycastCallback::kF_FilterBackfaces;
91 return ( AllHitsRayResultCallback::m_rayFromWorld );
101 return ( AllHitsRayResultCallback::m_rayToWorld );
113 btAssert( index >= 0 );
114 btAssert( index <
size() );
132 btCollisionWorld::AllHitsRayResultCallback::addSingleResult(rayResult, normalInWorldSpace);
134 return (rayResult.m_hitFraction);
const BulletClosestRayCallback & hit(const int &index=0) const
Return a callback for the intersection at a given index.
QVector< BulletClosestRayCallback > m_rayHits
List of ray hits.
btVector3 observer() const
Return the beginning of the ray.
virtual ~BulletAllHitsRayCallback()
Destroy this callback.
virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult &rayResult, bool normalInWorldSpace)
Add a local intersection result to this callback during ray casting.
bool isValid() const
Checks if the callback is valid/has a valid intersection.
BulletAllHitsRayCallback()
Default constructor.
int size() const
Returns the number of intersections found.
btVector3 lookdir() const
Return the end of the ray.
Bullet ray tracing callback for closest hit on target surface.
This is free and unencumbered software released into the public domain.