Jolt Physics
A multi core friendly Game Physics Engine
|
Virtual interface that allows collecting multiple collision results. More...
#include <CollisionCollector.h>
Public Types | |
using | ResultType = ResultTypeArg |
Declare ResultType so that derived classes can use it. More... | |
Public Member Functions | |
CollisionCollector ()=default | |
Default constructor. More... | |
template<class ResultTypeArg2 > | |
CollisionCollector (const CollisionCollector< ResultTypeArg2, TraitsType > &inRHS) | |
Constructor to initialize from another collector. More... | |
CollisionCollector (const CollisionCollector< ResultTypeArg, TraitsType > &inRHS)=default | |
virtual | ~CollisionCollector ()=default |
Destructor. More... | |
virtual void | Reset () |
If you want to reuse this collector, call Reset() More... | |
virtual void | OnBody (const Body &inBody) |
void | SetContext (const TransformedShape *inContext) |
Set by the collision detection functions to the current TransformedShape that we're colliding against before calling the AddHit function. More... | |
const TransformedShape * | GetContext () const |
virtual void | AddHit (const ResultType &inResult)=0 |
This function will be called for every hit found, it's up to the application to decide how to store the hit. More... | |
void | UpdateEarlyOutFraction (float inFraction) |
Update the early out fraction (should be lower than before) More... | |
void | ResetEarlyOutFraction (float inFraction=TraitsType::InitialEarlyOutFraction) |
Reset the early out fraction to a specific value. More... | |
void | ForceEarlyOut () |
Force the collision detection algorithm to terminate as soon as possible. Call this from the AddHit function when a satisfying hit is found. More... | |
bool | ShouldEarlyOut () const |
When true, the collector will no longer accept any additional hits and the collision detection routine should early out as soon as possible. More... | |
float | GetEarlyOutFraction () const |
Get the current early out value. More... | |
float | GetPositiveEarlyOutFraction () const |
Get the current early out value but make sure it's bigger than zero, this is used for shape casting as negative values are used for penetration. More... | |
Virtual interface that allows collecting multiple collision results.
using CollisionCollector< ResultTypeArg, TraitsType >::ResultType = ResultTypeArg |
Declare ResultType so that derived classes can use it.
|
default |
Default constructor.
|
inlineexplicit |
Constructor to initialize from another collector.
|
default |
|
virtualdefault |
Destructor.
|
pure virtual |
This function will be called for every hit found, it's up to the application to decide how to store the hit.
|
inline |
Force the collision detection algorithm to terminate as soon as possible. Call this from the AddHit function when a satisfying hit is found.
|
inline |
|
inline |
Get the current early out value.
|
inline |
Get the current early out value but make sure it's bigger than zero, this is used for shape casting as negative values are used for penetration.
|
inlinevirtual |
When running a query through the NarrowPhaseQuery class, this will be called for every body that is potentially colliding. It allows collecting additional information needed by the collision collector implementation from the body under lock protection before AddHit is called (e.g. the user data pointer or the velocity of the body).
Reimplemented in InternalEdgeRemovingCollector.
|
inlinevirtual |
If you want to reuse this collector, call Reset()
Reimplemented in InternalEdgeRemovingCollector.
|
inline |
Reset the early out fraction to a specific value.
|
inline |
Set by the collision detection functions to the current TransformedShape that we're colliding against before calling the AddHit function.
|
inline |
When true, the collector will no longer accept any additional hits and the collision detection routine should early out as soon as possible.
|
inline |
Update the early out fraction (should be lower than before)