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
TCallbacksType 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
simulationSimulationcollisionTaskRegistryCollisionTaskRegistrysweepTaskRegistrySweepTaskRegistrycallbacksTCallbacksinitialSetCapacityintminimumMappingSizeintminimumPendingSizeint
Fields
Callbacks
public TCallbacks Callbacks
Field Value
- TCallbacks
Methods
ExtractContactConstraintBodyCount(int)
public static int ExtractContactConstraintBodyCount(int contactConstraintTypeId)
Parameters
contactConstraintTypeIdint
Returns
HandleOverlap(int, CollidableReference, CollidableReference)
public void HandleOverlap(int workerIndex, CollidableReference a, CollidableReference b)
Parameters
workerIndexintaCollidableReferencebCollidableReference
OnDispose()
protected override void OnDispose()
OnPostflush(IThreadDispatcher)
protected override void OnPostflush(IThreadDispatcher threadDispatcher)
Parameters
threadDispatcherIThreadDispatcher
OnPreflush(IThreadDispatcher, bool)
protected override void OnPreflush(IThreadDispatcher threadDispatcher, bool deterministic)
Parameters
threadDispatcherIThreadDispatcherdeterministicbool
OnPrepare(IThreadDispatcher)
protected override void OnPrepare(IThreadDispatcher threadDispatcher)
Parameters
threadDispatcherIThreadDispatcher
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
workerIndexintpairCollidablePairmanifoldTypeAsConstraintTypeintnewConstraintCacheConstraintCachenewContactCountintdescriptionTDescriptionbodyHandlesTBodyHandles
Type Parameters
TBodyHandlesTDescriptionTContactImpulses
UpdateConstraintsForPair<TContactManifold>(int, CollidablePair, ref TContactManifold)
public void UpdateConstraintsForPair<TContactManifold>(int workerIndex, CollidablePair pair, ref TContactManifold manifold) where TContactManifold : unmanaged, IContactManifold<TContactManifold>
Parameters
workerIndexintpairCollidablePairmanifoldTContactManifold
Type Parameters
TContactManifold