Table of Contents

Class NarrowPhase<TCallbacks>

Namespace
BepuPhysics.CollisionDetection
Assembly
BepuPhysics.dll

Turns broad phase overlaps into contact manifolds and uses them to manage constraints in the solver.

public class NarrowPhase<TCallbacks> : NarrowPhase where TCallbacks : struct, INarrowPhaseCallbacks

Type Parameters

TCallbacks

Type of the callbacks to use.

Inheritance
NarrowPhase<TCallbacks>
Inherited Members

Constructors

NarrowPhase(Simulation, CollisionTaskRegistry, SweepTaskRegistry, TCallbacks, int, int, int)

public NarrowPhase(Simulation simulation, CollisionTaskRegistry collisionTaskRegistry, SweepTaskRegistry sweepTaskRegistry, TCallbacks callbacks, int initialSetCapacity, int minimumMappingSize = 2048, int minimumPendingSize = 128)

Parameters

simulation Simulation
collisionTaskRegistry CollisionTaskRegistry
sweepTaskRegistry SweepTaskRegistry
callbacks TCallbacks
initialSetCapacity int
minimumMappingSize int
minimumPendingSize int

Fields

Callbacks

public TCallbacks Callbacks

Field Value

TCallbacks

Methods

ExtractContactConstraintBodyCount(int)

public static int ExtractContactConstraintBodyCount(int contactConstraintTypeId)

Parameters

contactConstraintTypeId int

Returns

int

HandleOverlap(int, CollidableReference, CollidableReference)

public void HandleOverlap(int workerIndex, CollidableReference a, CollidableReference b)

Parameters

workerIndex int
a CollidableReference
b CollidableReference

OnDispose()

protected override void OnDispose()

OnPostflush(IThreadDispatcher)

protected override void OnPostflush(IThreadDispatcher threadDispatcher)

Parameters

threadDispatcher IThreadDispatcher

OnPreflush(IThreadDispatcher, bool)

protected override void OnPreflush(IThreadDispatcher threadDispatcher, bool deterministic)

Parameters

threadDispatcher IThreadDispatcher
deterministic bool

OnPrepare(IThreadDispatcher)

protected override void OnPrepare(IThreadDispatcher threadDispatcher)

Parameters

threadDispatcher IThreadDispatcher

UpdateConstraint<TBodyHandles, TDescription, TContactImpulses>(int, CollidablePair, int, ref ConstraintCache, int, ref TDescription, TBodyHandles)

public void UpdateConstraint<TBodyHandles, TDescription, TContactImpulses>(int workerIndex, CollidablePair pair, int manifoldTypeAsConstraintType, ref ConstraintCache newConstraintCache, int newContactCount, ref TDescription description, TBodyHandles bodyHandles) where TBodyHandles : unmanaged where TDescription : unmanaged, IConstraintDescription<TDescription> where TContactImpulses : unmanaged

Parameters

workerIndex int
pair CollidablePair
manifoldTypeAsConstraintType int
newConstraintCache ConstraintCache
newContactCount int
description TDescription
bodyHandles TBodyHandles

Type Parameters

TBodyHandles
TDescription
TContactImpulses

UpdateConstraintsForPair<TContactManifold>(int, CollidablePair, ref TContactManifold)

public void UpdateConstraintsForPair<TContactManifold>(int workerIndex, CollidablePair pair, ref TContactManifold manifold) where TContactManifold : unmanaged, IContactManifold<TContactManifold>

Parameters

workerIndex int
pair CollidablePair
manifold TContactManifold

Type Parameters

TContactManifold