Class NarrowPhase
- Namespace
- BepuPhysics.CollisionDetection
- Assembly
- BepuPhysics.dll
public abstract class NarrowPhase
- Inheritance
-
NarrowPhase
- Derived
- Inherited Members
Constructors
NarrowPhase()
protected NarrowPhase()
Fields
Bodies
public Bodies Bodies
Field Value
CollisionTaskRegistry
public CollisionTaskRegistry CollisionTaskRegistry
Field Value
ConstraintRemover
public ConstraintRemover ConstraintRemover
Field Value
PairCache
public PairCache PairCache
Field Value
Pool
public BufferPool Pool
Field Value
- BufferPool
Shapes
public Shapes Shapes
Field Value
Simulation
public Simulation Simulation
Field Value
Solver
public Solver Solver
Field Value
Statics
public Statics Statics
Field Value
SweepTaskRegistry
public SweepTaskRegistry SweepTaskRegistry
Field Value
Methods
Clear()
public void Clear()
Dispose()
public void Dispose()
Flush(IThreadDispatcher)
public void Flush(IThreadDispatcher threadDispatcher = null)
Parameters
threadDispatcherIThreadDispatcher
IsContactConstraintType(int)
Gets whether a constraint type id maps to a contact constraint.
public static bool IsContactConstraintType(int constraintTypeId)
Parameters
constraintTypeIdintId of the constraint to check.
Returns
- bool
True if the type id refers to a contact constraint. False otherwise.
OnDispose()
protected abstract void OnDispose()
OnPostflush(IThreadDispatcher)
protected abstract void OnPostflush(IThreadDispatcher threadDispatcher)
Parameters
threadDispatcherIThreadDispatcher
OnPreflush(IThreadDispatcher, bool)
protected abstract void OnPreflush(IThreadDispatcher threadDispatcher, bool deterministic)
Parameters
threadDispatcherIThreadDispatcherdeterministicbool
OnPrepare(IThreadDispatcher)
protected abstract void OnPrepare(IThreadDispatcher threadDispatcher)
Parameters
threadDispatcherIThreadDispatcher
Prepare(float, IThreadDispatcher)
public void Prepare(float dt, IThreadDispatcher threadDispatcher = null)
Parameters
dtfloatthreadDispatcherIThreadDispatcher
RegisterContactConstraintAccessor(ContactConstraintAccessor)
public void RegisterContactConstraintAccessor(ContactConstraintAccessor contactConstraintAccessor)
Parameters
contactConstraintAccessorContactConstraintAccessor
SortCollidableReferencesForPair(CollidableReference, CollidableReference, out CollidableMobility, out CollidableMobility, out CollidableReference, out CollidableReference)
Sorts references to guarantee that two collidables in the same pair will always be in the same order.
public static void SortCollidableReferencesForPair(CollidableReference a, CollidableReference b, out CollidableMobility aMobility, out CollidableMobility bMobility, out CollidableReference sortedA, out CollidableReference sortedB)
Parameters
aCollidableReferenceFirst collidable reference to sort.
bCollidableReferenceFirst collidable reference to sort.
aMobilityCollidableMobilityMobility extracted from collidable A.
bMobilityCollidableMobilityMobility extracted from collidable B.
sortedACollidableReferencesortedBCollidableReference
TryExtractSolverContactData<TExtractor>(ConstraintHandle, ref TExtractor)
Tries to extract contact prestep, impulse, and body reference data from the given handle. If it's not a contact constraint, returns false.
public bool TryExtractSolverContactData<TExtractor>(ConstraintHandle constraintHandle, ref TExtractor extractor) where TExtractor : struct, ISolverContactDataExtractor
Parameters
constraintHandleConstraintHandleConstraint to try to extract data from.
extractorTExtractorExtractor used to collect contact data from the solver.
Returns
- bool
True if the constraint was a contact type, false otherwise.
Type Parameters
TExtractorType of the extractor used to collect contact data from the solver.
TryExtractSolverContactPrestepAndImpulses<TExtractor>(ConstraintHandle, ref TExtractor)
Tries to extract prestep and impulse contact data from the given handle. If it's not a contact constraint, returns false.
public bool TryExtractSolverContactPrestepAndImpulses<TExtractor>(ConstraintHandle constraintHandle, ref TExtractor extractor) where TExtractor : struct, ISolverContactPrestepAndImpulsesExtractor
Parameters
constraintHandleConstraintHandleConstraint to try to extract data from.
extractorTExtractorExtractor used to collect contact data from the solver.
Returns
- bool
True if the constraint was a contact type, false otherwise.
Type Parameters
TExtractorType of the extractor used to collect contact data from the solver.
TryGetContactConstraintAccessor(int, out ContactConstraintAccessor)
Looks up the contact constraint accessor for the given constraint type id if it exists.
public bool TryGetContactConstraintAccessor(int constraintTypeId, out ContactConstraintAccessor accessor)
Parameters
constraintTypeIdintConstraint type id to look up a constraint accessor for.
accessorContactConstraintAccessorAccessor for the given type id.
Returns
- bool
True if the constraint type id refers to a registered accessor, false otherwise.