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
Convex
protected bool Convex
Field Value
Properties
ConstraintTypeId
public int ConstraintTypeId { get; protected set; }
Property Value
ContactCount
public int ContactCount { get; protected set; }
Property Value
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
intoverlapWorkers
OverlapWorker[]constraintsOfType
QuickList<NarrowPhase<TCallbacks>.SortConstraintTarget>simulation
SimulationpairCache
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
ConstraintHandleHandle of the contact constraint to extract.
solver
SolverSolver in which the constraint lives.
extractor
TExtractorExtractor 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
ConstraintLocationLocation of the constraint in the solver.
solver
SolverSolver in which the constraint lives.
extractor
TExtractorExtractor 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
ConstraintHandleHandle of the contact constraint to extract.
solver
SolverSolver in which the constraint lives.
extractor
TExtractorExtractor 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
ConstraintLocationLocation of the constraint in the solver.
solver
SolverSolver in which the constraint lives.
extractor
TExtractorExtractor 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
UntypedListnarrowPhaseConstraintTypeId
intsimulation
SimulationpairCache
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
UntypedListnarrowPhaseConstraintTypeId
intspeculativeBatchIndices
Buffer<Buffer<ushort>>simulation
SimulationpairCache
PairCache
Type Parameters
TCallbacks
GatherOldImpulses(ref ConstraintReference, float*)
public void GatherOldImpulses(ref ConstraintReference constraintReference, float* oldImpulses)
Parameters
constraintReference
ConstraintReferenceoldImpulses
float*
ScatterNewImpulses<TContactImpulses>(ref ConstraintReference, ref TContactImpulses)
public void ScatterNewImpulses<TContactImpulses>(ref ConstraintReference constraintReference, ref TContactImpulses contactImpulses)
Parameters
constraintReference
ConstraintReferencecontactImpulses
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
intworkerIndex
intpair
CollidablePairmanifoldPointer
TContactManifoldmaterial
PairMaterialPropertiesbodyHandles
TCallBodyHandles
Type Parameters
TContactManifold
TCallBodyHandles
TCallbacks