13template <
class CollectorType>
23 CollectorType::Reset();
31 mHits.push_back(inResult);
43 return !
mHits.empty();
50template <
class CollectorType>
60 CollectorType::Reset();
68 float early_out = inResult.GetEarlyOutFraction();
69 if (!mHadHit || early_out <
mHit.GetEarlyOutFraction())
72 CollectorType::UpdateEarlyOutFraction(early_out);
93template <
class CollectorType>
103 CollectorType::Reset();
115 CollectorType::ForceEarlyOut();
131 bool mHadHit =
false;
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
void QuickSort(Iterator inBegin, Iterator inEnd, Compare inCompare)
Implementation of the quick sort algorithm. The STL version implementation is not consistent across p...
Definition: QuickSort.h:53
std::vector< T, STLAllocator< T > > Array
Definition: STLAllocator.h:81
Simple implementation that collects all hits and optionally sorts them on distance.
Definition: CollisionCollectorImpl.h:15
void Sort()
Order hits on closest first.
Definition: CollisionCollectorImpl.h:35
bool HadHit() const
Check if any hits were collected.
Definition: CollisionCollectorImpl.h:41
typename CollectorType::ResultType ResultType
Redeclare ResultType.
Definition: CollisionCollectorImpl.h:18
Array< ResultType > mHits
Definition: CollisionCollectorImpl.h:46
virtual void AddHit(const ResultType &inResult) override
Definition: CollisionCollectorImpl.h:29
virtual void Reset() override
Definition: CollisionCollectorImpl.h:21
Simple implementation that collects any hit.
Definition: CollisionCollectorImpl.h:95
virtual void Reset() override
Definition: CollisionCollectorImpl.h:101
virtual void AddHit(const ResultType &inResult) override
Definition: CollisionCollectorImpl.h:109
typename CollectorType::ResultType ResultType
Redeclare ResultType.
Definition: CollisionCollectorImpl.h:98
bool HadHit() const
Check if this collector has had a hit.
Definition: CollisionCollectorImpl.h:123
ResultType mHit
Definition: CollisionCollectorImpl.h:128
Simple implementation that collects the closest / deepest hit.
Definition: CollisionCollectorImpl.h:52
virtual void Reset() override
Definition: CollisionCollectorImpl.h:58
virtual void AddHit(const ResultType &inResult) override
Definition: CollisionCollectorImpl.h:66
ResultType mHit
Definition: CollisionCollectorImpl.h:86
bool HadHit() const
Check if this collector has had a hit.
Definition: CollisionCollectorImpl.h:81
typename CollectorType::ResultType ResultType
Redeclare ResultType.
Definition: CollisionCollectorImpl.h:55