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.
 
virtual void Reset () override
 If you want to reuse this collector, call Reset()
 
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.
 
- Public Member Functions inherited from CollisionCollector< ResultTypeArg, TraitsType >
 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.
 
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 TransformedShapeGetContext () 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.
 

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.
 

Additional Inherited Members

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

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: