Filter class.
More...
#include <ShapeFilter.h>
|
BodyID | mBodyID2 |
| Set by the collision detection functions to the body ID of the body that we're colliding against before calling the ShouldCollide function. More...
|
|
◆ ~ShapeFilter()
virtual ShapeFilter::~ShapeFilter |
( |
| ) |
|
|
virtualdefault |
◆ ShouldCollide() [1/2]
virtual bool ShapeFilter::ShouldCollide |
( |
const Shape * |
inShape1, |
|
|
const SubShapeID & |
inSubShapeIDOfShape1, |
|
|
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 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
-
inShape1 | 1st shape that is colliding |
inSubShapeIDOfShape1 | The 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) |
inShape2 | 2nd shape that is colliding |
inSubShapeIDOfShape2 | The sub shape ID that will lead from the root shape to inShape2 (i.e. the shape of mBodyID2) |
Reimplemented in ReversedShapeFilter.
◆ ShouldCollide() [2/2]
virtual bool ShapeFilter::ShouldCollide |
( |
const Shape * |
inShape2, |
|
|
const SubShapeID & |
inSubShapeIDOfShape2 |
|
) |
| const |
|
inlinevirtual |
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
-
inShape2 | Shape we're colliding against |
inSubShapeIDOfShape2 | The sub shape ID that will lead from the root shape to inShape2 (i.e. the shape of mBodyID2) |
Reimplemented in ReversedShapeFilter.
◆ mBodyID2
Set by the collision detection functions to the body ID of the body that we're colliding against before calling the ShouldCollide function.
The documentation for this class was generated from the following file: