33 static inline 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 = { })
38 if (inShapeFilter.ShouldCollide(inShape1, inSubShapeIDCreator1.GetID(), inShape2, inSubShapeIDCreator2.GetID()))
39 sCollideShape[(
int)inShape1->GetSubType()][(
int)inShape2->GetSubType()](inShape1, inShape2, inScale1, inScale2, inCenterOfMassTransform1, inCenterOfMassTransform2, inSubShapeIDCreator1, inSubShapeIDCreator2, inCollideShapeSettings, ioCollector, inShapeFilter);
55 JPH_IF_TRACK_NARROWPHASE_STATS(TrackNarrowPhaseStat track(NarrowPhaseStat::sCastShape[(
int)inShapeCastLocal.mShape->GetSubType()][(
int)inShape->GetSubType()]);)
58 if (inShapeFilter.ShouldCollide(inShapeCastLocal.mShape, inSubShapeIDCreator1.GetID(), inShape, inSubShapeIDCreator2.GetID()))
59 sCastShape[(int)inShapeCastLocal.mShape->GetSubType()][(int)inShape->GetSubType()](inShapeCastLocal, inShapeCastSettings, inShape, inScale, inShapeFilter, inCenterOfMassTransform2, inSubShapeIDCreator1, inSubShapeIDCreator2, ioCollector);
68 sCastShapeVsShapeLocalSpace(local_shape_cast, inShapeCastSettings, inShape, inScale, inShapeFilter, inCenterOfMassTransform2, inSubShapeIDCreator1, inSubShapeIDCreator2, ioCollector);
72 using CollideShape = void (*)(
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);
87 static void sReversedCollideShape(
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);
93 static CollideShape sCollideShape[NumSubShapeTypes][NumSubShapeTypes];
94 static CastShape sCastShape[NumSubShapeTypes][NumSubShapeTypes];
#define JPH_EXPORT
Definition: Core.h:236
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
#define JPH_IF_TRACK_NARROWPHASE_STATS(...)
Definition: NarrowPhaseStats.h:17
EShapeSubType
This enumerates all shape types, each shape can return its type through Shape::GetSubType.
Definition: Shape.h:77
Settings to be passed with a collision query.
Definition: CollideShape.h:94
Virtual interface that allows collecting multiple collision results.
Definition: CollisionCollector.h:45
Dispatch function, main function to handle collisions between shapes.
Definition: CollisionDispatch.h:19
static void sRegisterCollideShape(EShapeSubType inType1, EShapeSubType inType2, CollideShape inFunction)
Register a collide shape function in the collision table.
Definition: CollisionDispatch.h:81
static void sRegisterCastShape(EShapeSubType inType1, EShapeSubType inType2, CastShape inFunction)
Register a cast shape function in the collision table.
Definition: CollisionDispatch.h:84
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={ })
Definition: CollisionDispatch.h:33
static void sCastShapeVsShapeWorldSpace(const ShapeCast &inShapeCastWorld, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector)
Definition: CollisionDispatch.h:65
void(*)(const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector) CastShape
Function that casts a shape vs another shape (see sCastShapeVsShapeLocalSpace)
Definition: CollisionDispatch.h:75
void(*)(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) CollideShape
Function that collides 2 shapes (see sCollideShapeVsShape)
Definition: CollisionDispatch.h:72
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
JPH_INLINE Mat44 InversedRotationTranslation() const
Inverse 4x4 matrix when it only contains rotation and translation.
Definition: Mat44.inl:729
Settings to be passed with a shape cast.
Definition: ShapeCast.h:92
Filter class.
Definition: ShapeFilter.h:17
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition: Shape.h:186
EShapeSubType GetSubType() const
Definition: Shape.h:201
Definition: SubShapeID.h:108
Definition: ShapeCast.h:69
ShapeCastType PostTransformed(typename Mat::ArgType inTransform) const
Transform this shape cast using inTransform. Multiply transform on the left left hand side.
Definition: ShapeCast.h:42