Table of Contents

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

Bodies

CollisionTaskRegistry

public CollisionTaskRegistry CollisionTaskRegistry

Field Value

CollisionTaskRegistry

ConstraintRemover

public ConstraintRemover ConstraintRemover

Field Value

ConstraintRemover

PairCache

public PairCache PairCache

Field Value

PairCache

Pool

public BufferPool Pool

Field Value

BufferPool

Shapes

public Shapes Shapes

Field Value

Shapes

Simulation

public Simulation Simulation

Field Value

Simulation

Solver

public Solver Solver

Field Value

Solver

Statics

public Statics Statics

Field Value

Statics

SweepTaskRegistry

public SweepTaskRegistry SweepTaskRegistry

Field Value

SweepTaskRegistry

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 int

Id 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 IThreadDispatcher
deterministic 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 float
threadDispatcher 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 CollidableReference

First collidable reference to sort.

b CollidableReference

First collidable reference to sort.

aMobility CollidableMobility

Mobility extracted from collidable A.

bMobility CollidableMobility

Mobility extracted from collidable B.

sortedA CollidableReference
sortedB 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 ConstraintHandle

Constraint to try to extract data from.

extractor TExtractor

Extractor 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 ConstraintHandle

Constraint to try to extract data from.

extractor TExtractor

Extractor 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 int

Constraint type id to look up a constraint accessor for.

accessor ContactConstraintAccessor

Accessor for the given type id.

Returns

bool

True if the constraint type id refers to a registered accessor, false otherwise.