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

Helper class to reverse the order of the shapes in the ShouldCollide function. More...

#include <ShapeFilter.h>

Inheritance diagram for ReversedShapeFilter:
ShapeFilter NonCopyable

Public Member Functions

 ReversedShapeFilter (const ShapeFilter &inFilter)
 Constructor.
 
virtual bool ShouldCollide (const Shape *inShape2, const SubShapeID &inSubShapeIDOfShape2) const override
 
virtual bool ShouldCollide (const Shape *inShape1, const SubShapeID &inSubShapeIDOfShape1, const Shape *inShape2, const SubShapeID &inSubShapeIDOfShape2) const override
 
- Public Member Functions inherited from ShapeFilter
virtual ~ShapeFilter ()=default
 Destructor.
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Additional Inherited Members

- Public Attributes inherited from ShapeFilter
BodyID mBodyID2
 

Detailed Description

Helper class to reverse the order of the shapes in the ShouldCollide function.

Constructor & Destructor Documentation

◆ ReversedShapeFilter()

ReversedShapeFilter::ReversedShapeFilter ( const ShapeFilter inFilter)
inlineexplicit

Constructor.

Member Function Documentation

◆ ShouldCollide() [1/2]

virtual bool ReversedShapeFilter::ShouldCollide ( const Shape inShape1,
const SubShapeID inSubShapeIDOfShape1,
const Shape inShape2,
const SubShapeID inSubShapeIDOfShape2 
) const
inlineoverridevirtual

Filter function to determine if two shapes should collide. Returns true if the filter passes. This overload is called when querying a shape vs a shape (e.g. collide object / cast object). 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. You can filter out individual triangles in the CollisionCollector::AddHit function by their sub shape ID.

Parameters
inShape11st shape that is colliding
inSubShapeIDOfShape1The sub shape ID that will lead from the root shape to inShape1 (i.e. the shape that is used to collide or cast against shape 2)
inShape22nd shape that is colliding
inSubShapeIDOfShape2The sub shape ID that will lead from the root shape to inShape2 (i.e. the shape of mBodyID2)

Reimplemented from ShapeFilter.

◆ ShouldCollide() [2/2]

virtual bool ReversedShapeFilter::ShouldCollide ( const Shape inShape2,
const SubShapeID inSubShapeIDOfShape2 
) const
inlineoverridevirtual

Filter function to determine if we should collide with a shape. Returns true if the filter passes. This overload is called when the query doesn't have a source shape (e.g. ray cast / collide point)

Parameters
inShape2Shape we're colliding against
inSubShapeIDOfShape2The sub shape ID that will lead from the root shape to inShape2 (i.e. the shape of mBodyID2)

Reimplemented from ShapeFilter.


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