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

Filter class used during the simulation (PhysicsSystem::Update) to filter out collisions at shape level. More...

#include <SimShapeFilter.h>

Inheritance diagram for SimShapeFilter:
NonCopyable

Public Member Functions

virtual ~SimShapeFilter ()=default
 Destructor.
 
virtual bool ShouldCollide (const Body &inBody1, const Shape *inShape1, const SubShapeID &inSubShapeIDOfShape1, const Body &inBody2, const Shape *inShape2, const SubShapeID &inSubShapeIDOfShape2) const
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Detailed Description

Filter class used during the simulation (PhysicsSystem::Update) to filter out collisions at shape level.

Constructor & Destructor Documentation

◆ ~SimShapeFilter()

virtual SimShapeFilter::~SimShapeFilter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ShouldCollide()

virtual bool SimShapeFilter::ShouldCollide ( const Body inBody1,
const Shape inShape1,
const SubShapeID inSubShapeIDOfShape1,
const Body inBody2,
const Shape inShape2,
const SubShapeID inSubShapeIDOfShape2 
) const
inlinevirtual

Filter function to determine if two shapes should collide. Returns true if the filter passes. This overload is called during the simulation (PhysicsSystem::Update) and must be registered with PhysicsSystem::SetSimShapeFilter. It is called at each level of the shape hierarchy, so if you have a compound shape with a box, this function will be called twice. It will not be called on triangles that are part of another shape, i.e a mesh shape will not trigger a callback per triangle. Note that this function is called from multiple threads and must be thread safe. All properties are read only.

Parameters
inBody11st body that is colliding
inShape11st shape that is colliding
inSubShapeIDOfShape1The sub shape ID that will lead from inBody1.GetShape() to inShape1
inBody22nd body that is colliding
inShape22nd shape that is colliding
inSubShapeIDOfShape2The sub shape ID that will lead from inBody2.GetShape() to inShape2

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