Table of Contents

Interface IContactEventHandler

Namespace
Stride.BepuPhysics.Definitions.Contacts
Assembly
Stride.BepuPhysics.dll

Implements handlers for various collision events.

public interface IContactEventHandler

Properties

NoContactResponse

Whether the object this is attached to should let colliders pass through it

bool NoContactResponse { get; }

Property Value

bool

Methods

OnContactAdded<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, int, BepuSimulation)

Fires when a contact is added.

void OnContactAdded<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int contactIndex, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

contactIndex int

Index of the new contact in the contact manifold.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnContactRemoved<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, int, BepuSimulation)

Fires when a contact is removed.

void OnContactRemoved<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int removedFeatureId, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

removedFeatureId int

Feature id of the contact that was removed and is no longer present in the contact manifold.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnPairCreated<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, BepuSimulation)

Fires when a pair is observed for the first time.

void OnPairCreated<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnPairEnded(CollidableComponent, CollidableComponent, BepuSimulation)

Fires when a pair ends.

void OnPairEnded(CollidableComponent eventSource, CollidableComponent other, BepuSimulation bepuSimulation)

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

bepuSimulation BepuSimulation

The simulation where the contact occured.

OnPairUpdated<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, BepuSimulation)

Fires whenever a pair is updated. Will not fire for sleeping pairs.

void OnPairUpdated<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnStartedTouching<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, BepuSimulation)

Fires the first time a pair is observed to be touching. Touching means that there are contacts with nonnegative depths in the manifold.

void OnStartedTouching<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnStoppedTouching<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, BepuSimulation)

Fires when a pair stops touching. Touching means that there are contacts with nonnegative depths in the manifold.

void OnStoppedTouching<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.

OnTouching<TManifold>(CollidableComponent, CollidableComponent, ref TManifold, bool, int, BepuSimulation)

Fires whenever a pair is observed to be touching. Touching means that there are contacts with nonnegative depths in the manifold. Will not fire for sleeping pairs.

void OnTouching<TManifold>(CollidableComponent eventSource, CollidableComponent other, ref TManifold contactManifold, bool flippedManifold, int workerIndex, BepuSimulation bepuSimulation) where TManifold : unmanaged, IContactManifold<TManifold>

Parameters

eventSource CollidableComponent

Collidable that the event was attached to.

other CollidableComponent

Other collider eventSource collided with.

contactManifold TManifold

Set of remaining contacts in the collision.

flippedManifold bool

Whether the manifold's normals and offset is flipped from the source's point of view.

workerIndex int

Index of the worker thread that fired this event.

bepuSimulation BepuSimulation

The simulation where the contact occured.

Type Parameters

TManifold

Type of the contact manifold detected.