Class BatchCompressor
- Namespace
- BepuPhysics
- Assembly
- BepuPhysics.dll
Handles the movement of constraints from higher indexed batches into lower indexed batches to avoid accumulating a bunch of unnecessary ConstraintBatches.
public class BatchCompressor
- Inheritance
-
BatchCompressor
- Inherited Members
Constructors
BatchCompressor(Solver, Bodies, float, float)
public BatchCompressor(Solver solver, Bodies bodies, float targetCandidateFraction = 0.005, float maximumCompressionFraction = 0.0005)
Parameters
Properties
Bodies
public Bodies Bodies { get; }
Property Value
MaximumCompressionFraction
Gets or sets the maximum number of constraint moves that can occur in a single execution of Compress as a fraction of the total number of constraints.
public float MaximumCompressionFraction { get; set; }
Property Value
Solver
public Solver Solver { get; }
Property Value
TargetCandidateFraction
Gets or sets the desired number of candidates to analyze as a fraction of the total number of constraints.
public float TargetCandidateFraction { get; set; }
Property Value
Methods
Compress(BufferPool, IThreadDispatcher, bool)
Incrementally finds and applies a set of compressions to apply to the constraints in the solver's batches. Constraints in higher index batches try to move to lower index batches whenever possible.
public void Compress(BufferPool pool, IThreadDispatcher threadDispatcher = null, bool deterministic = false)
Parameters
pool
BufferPoolthreadDispatcher
IThreadDispatcherdeterministic
bool