Navigation
API > API/Runtime > API/Runtime/Chaos
Description
Sweep SweptParticle against OtherParticle. The provided filter policy can be used to reject shape pairs. The collector policy chooses which sweep results(s) to keep.
This function does not reset the HitCollector.
| Name | Chaos::Private::SimSweepParticlePair |
| Type | function |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/SimSweep.h |
| Include Path | #include "Chaos/Collision/SimSweep.h" |
namespace Chaos
{
namespace Private
{
template<typename TShapeFilter, typename THitCollector>
void Chaos::Private::SimSweepParticlePair
(
const FGeometryParticleHandle * SweptParticle,
const FGeometryParticleHandle * OtherParticle,
const FVec3 & StartPos,
const FRotation3 & Rot,
const FVec3 & Dir,
const FReal Length,
TShapeFilter & ShapeFilter,
THitCollector & HitCollector
)
}
}
Parameters
| Name | Remarks |
|---|---|
| TShapeFilter | A custom filter functor with the signature bool(const FPerShapeData SweptShape, const FImplicitObject SweptImplicit, const FPerShapeData OtherShape, const FImplicitObject OtherImplicit) used to accept/reject shapes pairs. It should return true if the pair should be considered for a sweep check. |
| THitCollector | A hit collector functor with signature bool(const FVec3& Dir, const FReal Length, const FSimSweepParticleHit& InHit). It should return true to continue checking further objects, or false to stop any further sweeping. |
| SweptParticle | The particle to be swept |
| OtherParticle | The particle to be swept against |
| StartPos | The start position of the particle to be swept |
| Rot | The rotation to use for the sweep |
| Dir | The direction of the sweep (must be normalized) |
| Length | The sweep length |
| ShapeFilter | The filter to use to accept/reject shape pairs within the particle pairs |
| HitCollector | Hits are passed to the collector one at a time in a random order (i.e., they are not sorted by TOI) |
See Also
-
FSimSweepShapeFilterNarrowPhase which provides the standard narrowphase filter used in collision detection.
-
FSimSweepCollectorFirstHit which keeps the hit with the lowest time of impact and the most opposing normal if there is a tie.