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
SimulationcollisionTaskRegistry
CollisionTaskRegistrysweepTaskRegistry
SweepTaskRegistrycallbacks
TCallbacksinitialSetCapacity
intminimumMappingSize
intminimumPendingSize
int
Fields
Callbacks
public TCallbacks Callbacks
Field Value
- TCallbacks
Methods
ExtractContactConstraintBodyCount(int)
public static int ExtractContactConstraintBodyCount(int contactConstraintTypeId)
Parameters
contactConstraintTypeId
int
Returns
HandleOverlap(int, CollidableReference, CollidableReference)
public void HandleOverlap(int workerIndex, CollidableReference a, CollidableReference b)
Parameters
workerIndex
inta
CollidableReferenceb
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
IThreadDispatcherdeterministic
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
intpair
CollidablePairmanifoldTypeAsConstraintType
intnewConstraintCache
ConstraintCachenewContactCount
intdescription
TDescriptionbodyHandles
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
intpair
CollidablePairmanifold
TContactManifold
Type Parameters
TContactManifold