Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
InternalEdgeRemovingCollector Class Reference

#include <InternalEdgeRemovingCollector.h>

Inheritance diagram for InternalEdgeRemovingCollector:
CollisionCollector< ResultTypeArg, TraitsType >

Public Member Functions

 InternalEdgeRemovingCollector (CollideShapeCollector &inChainedCollector)
 Constructor, configures a collector to be called with all the results that do not hit internal edges. More...
 
virtual void Reset () override
 If you want to reuse this collector, call Reset() More...
 
virtual void OnBody (const Body &inBody) override
 
virtual void AddHit (const CollideShapeResult &inResult) override
 
void Flush ()
 After all hits have been added, call this function to process the delayed results. More...
 
- Public Member Functions inherited from CollisionCollector< ResultTypeArg, TraitsType >
 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 TransformedShapeGetContext () const
 
virtual void SetUserData (uint64 inUserData)
 This function can be used to set some user data on the collision collector. More...
 
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...
 

Static Public Member Functions

static void sCollideShapeVsShape (const Shape *inShape1, const Shape *inShape2, Vec3Arg inScale1, Vec3Arg inScale2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, const CollideShapeSettings &inCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter={ })
 Version of CollisionDispatch::sCollideShapeVsShape that removes internal edges. More...
 

Additional Inherited Members

- Public Types inherited from CollisionCollector< ResultTypeArg, TraitsType >
using ResultType = ResultTypeArg
 Declare ResultType so that derived classes can use it. More...
 

Detailed Description

Removes internal edges from collision results. Can be used to filter out 'ghost collisions'. Based on: Contact generation for meshes - Pierre Terdiman (https://www.codercorner.com/MeshContacts.pdf)

Constructor & Destructor Documentation

◆ InternalEdgeRemovingCollector()

InternalEdgeRemovingCollector::InternalEdgeRemovingCollector ( CollideShapeCollector inChainedCollector)
inlineexplicit

Constructor, configures a collector to be called with all the results that do not hit internal edges.

Member Function Documentation

◆ AddHit()

virtual void InternalEdgeRemovingCollector::AddHit ( const CollideShapeResult inResult)
inlineoverridevirtual

◆ Flush()

void InternalEdgeRemovingCollector::Flush ( )
inline

After all hits have been added, call this function to process the delayed results.

◆ OnBody()

virtual void InternalEdgeRemovingCollector::OnBody ( const Body inBody)
inlineoverridevirtual

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 from CollisionCollector< ResultTypeArg, TraitsType >.

◆ Reset()

virtual void InternalEdgeRemovingCollector::Reset ( )
inlineoverridevirtual

If you want to reuse this collector, call Reset()

Reimplemented from CollisionCollector< ResultTypeArg, TraitsType >.

◆ sCollideShapeVsShape()

static void InternalEdgeRemovingCollector::sCollideShapeVsShape ( const Shape inShape1,
const Shape inShape2,
Vec3Arg  inScale1,
Vec3Arg  inScale2,
Mat44Arg  inCenterOfMassTransform1,
Mat44Arg  inCenterOfMassTransform2,
const SubShapeIDCreator inSubShapeIDCreator1,
const SubShapeIDCreator inSubShapeIDCreator2,
const CollideShapeSettings inCollideShapeSettings,
CollideShapeCollector ioCollector,
const ShapeFilter inShapeFilter = { } 
)
inlinestatic

Version of CollisionDispatch::sCollideShapeVsShape that removes internal edges.


The documentation for this class was generated from the following file: