Go to the source code of this file.
|
template<class LeafCollector > |
JPH_NAMESPACE_BEGIN void | CollideShapeVsShapePerLeaf (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={ }) |
|
◆ CollideShapeVsShapePerLeaf()
template<class LeafCollector >
JPH_NAMESPACE_BEGIN void CollideShapeVsShapePerLeaf |
( |
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 = { } ) |
Collide 2 shapes and returns at most 1 hit per leaf shape pairs that overlapping. This can be used when not all contacts between the shapes are needed. E.g. when testing a compound with 2 MeshShapes A and B against a compound with 2 SphereShapes C and D, then at most you'll get 4 collisions: AC, AD, BC, BD. The default CollisionDispatch::sCollideShapeVsShape function would return all intersecting triangles in A against C, all in B against C etc.
- Parameters
-
inShape1 | The first shape |
inShape2 | The second shape |
inScale1 | Local space scale of shape 1 (scales relative to its center of mass) |
inScale2 | Local space scale of shape 2 (scales relative to its center of mass) |
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. |
- Template Parameters
-
LeafCollector | The type of the collector that will be used to collect hits between leaf pairs. Must be either AnyHitCollisionCollector<CollideShapeCollector> to get any hit (cheapest) or ClosestHitCollisionCollector<CollideShapeCollector> to get the deepest hit (more expensive). |