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. | |
Public Member Functions | |
CollisionCollector ()=default | |
Default constructor. | |
template<class ResultTypeArg2 > | |
CollisionCollector (const CollisionCollector< ResultTypeArg2, TraitsType > &inRHS) | |
Constructor to initialize from another collector. | |
CollisionCollector (const CollisionCollector< ResultTypeArg, TraitsType > &inRHS)=default | |
virtual | ~CollisionCollector ()=default |
Destructor. | |
virtual void | Reset () |
If you want to reuse this collector, call Reset() | |
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. | |
const TransformedShape * | GetContext () const |
virtual void | SetUserData (uint64 inUserData) |
This function can be used to set some user data on the collision collector. | |
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. | |
void | UpdateEarlyOutFraction (float inFraction) |
Update the early out fraction (should be lower than before) | |
void | ResetEarlyOutFraction (float inFraction=TraitsType::InitialEarlyOutFraction) |
Reset the early out fraction to a specific value. | |
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. | |
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. | |
float | GetEarlyOutFraction () const |
Get the current early out value. | |
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. | |
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.
|
inlinevirtual |
This function can be used to set some user data on the collision collector.
|
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)