Table of Contents

Class ContactConstraintAccessor

Namespace
BepuPhysics.CollisionDetection
Assembly
BepuPhysics.dll

Provides indirection for reading from and updating constraints in the narrow phase.

public abstract class ContactConstraintAccessor
Inheritance
ContactConstraintAccessor
Derived
Inherited Members

Remarks

This, like many other similar constructions in the engine, could conceptually be replaced by static function pointers and a few supplementary data fields. We probably will do exactly that at some point.

Fields

AccumulatedImpulseBundleStrideInBytes

protected int AccumulatedImpulseBundleStrideInBytes

Field Value

int

Convex

protected bool Convex

Field Value

bool

Properties

ConstraintTypeId

public int ConstraintTypeId { get; protected set; }

Property Value

int

ContactCount

public int ContactCount { get; protected set; }

Property Value

int

Methods

DeterministicallyAdd<TCallbacks>(int, OverlapWorker[], ref QuickList<SortConstraintTarget>, Simulation, PairCache)

public abstract void DeterministicallyAdd<TCallbacks>(int typeIndex, NarrowPhase<TCallbacks>.OverlapWorker[] overlapWorkers, ref QuickList<NarrowPhase<TCallbacks>.SortConstraintTarget> constraintsOfType, Simulation simulation, PairCache pairCache) where TCallbacks : struct, INarrowPhaseCallbacks

Parameters

typeIndex int
overlapWorkers OverlapWorker[]
constraintsOfType QuickList<NarrowPhase<TCallbacks>.SortConstraintTarget>
simulation Simulation
pairCache PairCache

Type Parameters

TCallbacks

ExtractContactData<TExtractor>(ConstraintHandle, Solver, ref TExtractor)

Extracts references to data from a contact constraint of the accessor's type.

public void ExtractContactData<TExtractor>(ConstraintHandle constraintHandle, Solver solver, ref TExtractor extractor) where TExtractor : struct, ISolverContactDataExtractor

Parameters

constraintHandle ConstraintHandle

Handle of the contact constraint to extract.

solver Solver

Solver in which the constraint lives.

extractor TExtractor

Extractor to handle the extracted references.

Type Parameters

TExtractor

Type of the extractor to handle the extracted references.

ExtractContactData<TExtractor>(in ConstraintLocation, Solver, ref TExtractor)

Extracts references to data from a contact constraint of the accessor's type.

public abstract void ExtractContactData<TExtractor>(in ConstraintLocation constraintLocation, Solver solver, ref TExtractor extractor) where TExtractor : struct, ISolverContactDataExtractor

Parameters

constraintLocation ConstraintLocation

Location of the constraint in the solver.

solver Solver

Solver in which the constraint lives.

extractor TExtractor

Extractor to handle the extracted references.

Type Parameters

TExtractor

Type of the extractor to handle the extracted references.

ExtractContactPrestepAndImpulses<TExtractor>(ConstraintHandle, Solver, ref TExtractor)

Extracts references to data from a contact constraint of the accessor's type.

public void ExtractContactPrestepAndImpulses<TExtractor>(ConstraintHandle constraintHandle, Solver solver, ref TExtractor extractor) where TExtractor : struct, ISolverContactPrestepAndImpulsesExtractor

Parameters

constraintHandle ConstraintHandle

Handle of the contact constraint to extract.

solver Solver

Solver in which the constraint lives.

extractor TExtractor

Extractor to handle the extracted references.

Type Parameters

TExtractor

Type of the extractor to handle the extracted references.

ExtractContactPrestepAndImpulses<TExtractor>(in ConstraintLocation, Solver, ref TExtractor)

Extracts references to data from a contact constraint of the accessor's type.

public abstract void ExtractContactPrestepAndImpulses<TExtractor>(in ConstraintLocation constraintLocation, Solver solver, ref TExtractor extractor) where TExtractor : struct, ISolverContactPrestepAndImpulsesExtractor

Parameters

constraintLocation ConstraintLocation

Location of the constraint in the solver.

solver Solver

Solver in which the constraint lives.

extractor TExtractor

Extractor to handle the extracted references.

Type Parameters

TExtractor

Type of the extractor to handle the extracted references.

FlushSequentially<TCallbacks>(ref UntypedList, int, Simulation, PairCache)

public abstract void FlushSequentially<TCallbacks>(ref UntypedList list, int narrowPhaseConstraintTypeId, Simulation simulation, PairCache pairCache) where TCallbacks : struct, INarrowPhaseCallbacks

Parameters

list UntypedList
narrowPhaseConstraintTypeId int
simulation Simulation
pairCache PairCache

Type Parameters

TCallbacks

FlushWithSpeculativeBatches<TCallbacks>(ref UntypedList, int, ref Buffer<Buffer<ushort>>, Simulation, PairCache)

public abstract void FlushWithSpeculativeBatches<TCallbacks>(ref UntypedList list, int narrowPhaseConstraintTypeId, ref Buffer<Buffer<ushort>> speculativeBatchIndices, Simulation simulation, PairCache pairCache) where TCallbacks : struct, INarrowPhaseCallbacks

Parameters

list UntypedList
narrowPhaseConstraintTypeId int
speculativeBatchIndices Buffer<Buffer<ushort>>
simulation Simulation
pairCache PairCache

Type Parameters

TCallbacks

GatherOldImpulses(ref ConstraintReference, float*)

public void GatherOldImpulses(ref ConstraintReference constraintReference, float* oldImpulses)

Parameters

constraintReference ConstraintReference
oldImpulses float*

ScatterNewImpulses<TContactImpulses>(ref ConstraintReference, ref TContactImpulses)

public void ScatterNewImpulses<TContactImpulses>(ref ConstraintReference constraintReference, ref TContactImpulses contactImpulses)

Parameters

constraintReference ConstraintReference
contactImpulses TContactImpulses

Type Parameters

TContactImpulses

UpdateConstraintForManifold<TContactManifold, TCallBodyHandles, TCallbacks>(NarrowPhase<TCallbacks>, int, int, ref CollidablePair, ref TContactManifold, ref PairMaterialProperties, TCallBodyHandles)

public abstract void UpdateConstraintForManifold<TContactManifold, TCallBodyHandles, TCallbacks>(NarrowPhase<TCallbacks> narrowPhase, int manifoldTypeAsConstraintType, int workerIndex, ref CollidablePair pair, ref TContactManifold manifoldPointer, ref PairMaterialProperties material, TCallBodyHandles bodyHandles) where TCallbacks : struct, INarrowPhaseCallbacks

Parameters

narrowPhase NarrowPhase<TCallbacks>
manifoldTypeAsConstraintType int
workerIndex int
pair CollidablePair
manifoldPointer TContactManifold
material PairMaterialProperties
bodyHandles TCallBodyHandles

Type Parameters

TContactManifold
TCallBodyHandles
TCallbacks