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
threadDispatcher
IThreadDispatcher
IsContactConstraintType(int)
Gets whether a constraint type id maps to a contact constraint.
public static bool IsContactConstraintType(int constraintTypeId)
Parameters
constraintTypeId
intId 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
threadDispatcher
IThreadDispatcher
OnPreflush(IThreadDispatcher, bool)
protected abstract void OnPreflush(IThreadDispatcher threadDispatcher, bool deterministic)
Parameters
threadDispatcher
IThreadDispatcherdeterministic
bool
OnPrepare(IThreadDispatcher)
protected abstract void OnPrepare(IThreadDispatcher threadDispatcher)
Parameters
threadDispatcher
IThreadDispatcher
Prepare(float, IThreadDispatcher)
public void Prepare(float dt, IThreadDispatcher threadDispatcher = null)
Parameters
dt
floatthreadDispatcher
IThreadDispatcher
RegisterContactConstraintAccessor(ContactConstraintAccessor)
public void RegisterContactConstraintAccessor(ContactConstraintAccessor contactConstraintAccessor)
Parameters
contactConstraintAccessor
ContactConstraintAccessor
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
a
CollidableReferenceFirst collidable reference to sort.
b
CollidableReferenceFirst collidable reference to sort.
aMobility
CollidableMobilityMobility extracted from collidable A.
bMobility
CollidableMobilityMobility extracted from collidable B.
sortedA
CollidableReferencesortedB
CollidableReference
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
constraintHandle
ConstraintHandleConstraint to try to extract data from.
extractor
TExtractorExtractor used to collect contact data from the solver.
Returns
- bool
True if the constraint was a contact type, false otherwise.
Type Parameters
TExtractor
Type 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
constraintHandle
ConstraintHandleConstraint to try to extract data from.
extractor
TExtractorExtractor used to collect contact data from the solver.
Returns
- bool
True if the constraint was a contact type, false otherwise.
Type Parameters
TExtractor
Type 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
constraintTypeId
intConstraint type id to look up a constraint accessor for.
accessor
ContactConstraintAccessorAccessor for the given type id.
Returns
- bool
True if the constraint type id refers to a registered accessor, false otherwise.