28template <
class LeafCollector>
29void 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 = { })
34 LeafShape() =
default;
38 mCenterOfMassTransform(inCenterOfMassTransform),
41 mSubShapeIDCreator(inSubShapeIDCreator)
46 Mat44 mCenterOfMassTransform;
52 constexpr uint cMaxLocalLeafShapes = 32;
60 mHits.reserve(cMaxLocalLeafShapes);
76 MyCollector leaf_shapes1, leaf_shapes2;
81 for (
const LeafShape &leaf1 : leaf_shapes1.mHits)
82 for (
const LeafShape &leaf2 : leaf_shapes2.mHits)
83 if (leaf1.mBounds.Overlaps(leaf2.mBounds))
86 LeafCollector collector;
87 CollisionDispatch::sCollideShapeVsShape(leaf1.mShape, leaf2.mShape, leaf1.mScale, leaf2.mScale, leaf1.mCenterOfMassTransform, leaf2.mCenterOfMassTransform, leaf1.mSubShapeIDCreator, leaf2.mSubShapeIDCreator, inCollideShapeSettings, collector, inShapeFilter);
88 if (collector.HadHit())
89 ioCollector.
AddHit(collector.mHit);
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={ })
Definition CollideShapeVsShapePerLeaf.h:29
unsigned int uint
Definition Core.h:486
#define JPH_NAMESPACE_END
Definition Core.h:418
#define JPH_NAMESPACE_BEGIN
Definition Core.h:412
Axis aligned box.
Definition AABox.h:16
Settings to be passed with a collision query.
Definition CollideShape.h:94
Virtual interface that allows collecting multiple collision results.
Definition CollisionCollector.h:45
virtual void AddHit(const ResultType &inResult)=0
This function will be called for every hit found, it's up to the application to decide how to store t...
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
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 Quat GetQuaternion() const
Convert to quaternion.
Definition Mat44.inl:783
JPH_INLINE Mat44 ToMat44() const
In single precision mode just return the matrix itself.
Definition Mat44.h:225
JPH_INLINE Vec3 GetTranslation() const
Definition Mat44.h:152
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
virtual void CollectTransformedShapes(const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, const SubShapeIDCreator &inSubShapeIDCreator, TransformedShapeCollector &ioCollector, const ShapeFilter &inShapeFilter) const
Definition Shape.cpp:52
virtual AABox GetWorldSpaceBounds(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale) const
Definition Shape.h:222
Definition SubShapeID.h:108