Table of Contents

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 CollidableReference

Collidable 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 CollidableReference

Collidable to check.

childIndex int

Index 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 float

Reference to maximumT passed to the traversal.

t float

Time of impact for the sweep test.

hitLocation Vector3

Location of the first hit detected by the sweep.

hitNormal Vector3

Surface normal at the hit location.

collidable CollidableReference

Collidable 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 float

Reference to maximumT passed to the traversal.

collidable CollidableReference

Collidable hit by the traversal.