Jolt Physics
A multi core friendly Game Physics Engine
|
Dispatch function, main function to handle collisions between shapes. More...
#include <CollisionDispatch.h>
Public Types | |
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) |
Function that collides 2 shapes (see sCollideShapeVsShape) More... | |
using | CastShape = 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) |
Function that casts a shape vs another shape (see sCastShapeVsShapeLocalSpace) More... | |
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={ }) |
static void | sCastShapeVsShapeLocalSpace (const ShapeCast &inShapeCastLocal, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector) |
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) |
static void | sInit () |
Initialize all collision functions with a function that asserts and returns no collision. More... | |
static void | sRegisterCollideShape (EShapeSubType inType1, EShapeSubType inType2, CollideShape inFunction) |
Register a collide shape function in the collision table. More... | |
static void | sRegisterCastShape (EShapeSubType inType1, EShapeSubType inType2, CastShape inFunction) |
Register a cast shape function in the collision table. More... | |
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) |
An implementation of CollideShape that swaps inShape1 and inShape2 and swaps the result back, can be registered if the collision function only exists the other way around. More... | |
static void | sReversedCastShape (const ShapeCast &inShapeCast, const ShapeCastSettings &inShapeCastSettings, const Shape *inShape, Vec3Arg inScale, const ShapeFilter &inShapeFilter, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, CastShapeCollector &ioCollector) |
An implementation of CastShape that swaps inShape1 and inShape2 and swaps the result back, can be registered if the collision function only exists the other way around. More... | |
Dispatch function, main function to handle collisions between shapes.
using CollisionDispatch::CastShape = 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) |
Function that casts a shape vs another shape (see sCastShapeVsShapeLocalSpace)
using CollisionDispatch::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) |
Function that collides 2 shapes (see sCollideShapeVsShape)
|
inlinestatic |
Cast a shape against this shape, passes any hits found to ioCollector. Note: This version takes the shape cast in local space relative to the center of mass of inShape, take a look at sCastShapeVsShapeWorldSpace if you have a shape cast in world space.
inShapeCastLocal | The shape to cast against the other shape and its start and direction. |
inShapeCastSettings | Settings for performing the cast |
inShape | The shape to cast against. |
inScale | Local space scale for the shape to cast against. |
inShapeFilter | allows selectively disabling collisions between pairs of (sub) shapes. |
inCenterOfMassTransform2 | Is the center of mass transform of shape 2 (excluding scale), this is used to provide a transform to the shape cast result so that local hit result quantities can be transformed into world space. |
inSubShapeIDCreator1 | Class that tracks the current sub shape ID for the casting shape |
inSubShapeIDCreator2 | Class that tracks the current sub shape ID for the shape we're casting against |
ioCollector | The collector that receives the results. |
|
inlinestatic |
See: sCastShapeVsShapeLocalSpace. The only difference is that the shape cast (inShapeCastWorld) is provided in world space. Note: A shape cast contains the center of mass start of the shape, if you have the world transform of the shape you probably want to construct it using ShapeCast::sFromWorldTransform.
|
inlinestatic |
Collide 2 shapes and pass any collision on to ioCollector
inShape1 | The first shape |
inShape2 | The second shape |
inScale1 | Local space scale of shape 1 |
inScale2 | Local space scale of shape 2 |
inCenterOfMassTransform1 | Transform to transform center of mass of shape 1 into world space |
inCenterOfMassTransform2 | Transform to transform center of mass of shape 2 into world space |
inSubShapeIDCreator1 | Class that tracks the current sub shape ID for shape 1 |
inSubShapeIDCreator2 | Class that tracks the current sub shape ID for shape 2 |
inCollideShapeSettings | Options for the CollideShape test |
ioCollector | The collector that receives the results. |
inShapeFilter | allows selectively disabling collisions between pairs of (sub) shapes. |
|
static |
Initialize all collision functions with a function that asserts and returns no collision.
|
inlinestatic |
Register a cast shape function in the collision table.
|
inlinestatic |
Register a collide shape function in the collision table.
|
static |
An implementation of CastShape that swaps inShape1 and inShape2 and swaps the result back, can be registered if the collision function only exists the other way around.
|
static |
An implementation of CollideShape that swaps inShape1 and inShape2 and swaps the result back, can be registered if the collision function only exists the other way around.