Interface ISweepHitHandler
- Namespace
- BepuPhysics
- Assembly
- BepuPhysics.dll
Defines a type capable of filtering sweep candidates and handling sweep results.
public interface ISweepHitHandler
Methods
AllowTest(CollidableReference)
Checks whether to run a detailed sweep test against a target collidable.
bool AllowTest(CollidableReference collidable)
Parameters
collidable
CollidableReferenceCollidable to check.
Returns
- bool
True if the sweep test should be attempted, false otherwise.
AllowTest(CollidableReference, int)
Checks whether to run a detailed sweep test against a target collidable's child.
bool AllowTest(CollidableReference collidable, int childIndex)
Parameters
collidable
CollidableReferenceCollidable to check.
childIndex
intIndex of the child in the collidable to check.
For compounds, this is the index of the child in the child array. For meshes, this is the triangle index. For convex shapes or other types that don't have multiple children, this is always zero.
Returns
- bool
True if the sweep test should be attempted, false otherwise.
OnHit(ref float, float, Vector3, Vector3, CollidableReference)
Called when a sweep test detects a hit with nonzero T value.
void OnHit(ref float maximumT, float t, Vector3 hitLocation, Vector3 hitNormal, CollidableReference collidable)
Parameters
maximumT
floatReference to maximumT passed to the traversal.
t
floatTime of impact for the sweep test.
hitLocation
Vector3Location of the first hit detected by the sweep.
hitNormal
Vector3Surface normal at the hit location.
collidable
CollidableReferenceCollidable hit by the traversal.
OnHitAtZeroT(ref float, CollidableReference)
Called when a sweep test detects a hit at T = 0, meaning that no location or normal can be computed.
void OnHitAtZeroT(ref float maximumT, CollidableReference collidable)
Parameters
maximumT
floatReference to maximumT passed to the traversal.
collidable
CollidableReferenceCollidable hit by the traversal.