Table of Contents

Struct SimulationAllocationSizes

Namespace
BepuPhysics
Assembly
BepuPhysics.dll

The common set of allocation sizes for a simulation.

public struct SimulationAllocationSizes
Inherited Members

Constructors

SimulationAllocationSizes(int, int, int, int, int, int, int)

Constructs a description of simulation allocations.

public SimulationAllocationSizes(int bodies, int statics, int islands, int shapesPerType, int constraints, int constraintsPerTypeBatch, int constraintCountPerBodyEstimate)

Parameters

bodies int

The number of bodies to allocate space for.

statics int

The number of statics to allocate space for.

islands int

The number of inactive islands to allocate space for.

shapesPerType int

Minimum number of shapes to allocate space for in each shape type batch. Unused if a Shapes instance was directly provided to the Simulation constructor.

constraints int

The number of constraints to allocate bookkeeping space for. This does not affect actual type batch allocation sizes, only the solver-level constraint handle storage.

constraintsPerTypeBatch int

The minimum number of constraints to allocate space for in each individual type batch. New type batches will be given enough memory for this number of constraints, and any compaction will not reduce the allocations below it. The number of constraints can vary greatly across types- there are usually far more contacts than ragdoll constraints. Per type estimates can be assigned within the Solver.TypeBatchAllocation if necessary. This value acts as a lower bound for all types.

constraintCountPerBodyEstimate int

The minimum number of constraints to allocate space for in each body's constraint list. New bodies will be given enough memory for this number of constraints, and any compaction will not reduce the allocations below it.

Fields

Bodies

The number of bodies to allocate space for.

public int Bodies

Field Value

int

ConstraintCountPerBodyEstimate

The minimum number of constraints to allocate space for in each body's constraint list. New bodies will be given enough memory for this number of constraints, and any compaction will not reduce the allocations below it.

public int ConstraintCountPerBodyEstimate

Field Value

int

Constraints

The number of constraints to allocate bookkeeping space for. This does not affect actual type batch allocation sizes, only the solver-level constraint handle storage.

public int Constraints

Field Value

int

ConstraintsPerTypeBatch

The minimum number of constraints to allocate space for in each individual type batch. New type batches will be given enough memory for this number of constraints, and any compaction will not reduce the allocations below it. The number of constraints can vary greatly across types- there are usually far more contacts than ragdoll constraints. Per type estimates can be assigned within the Solver.TypeBatchAllocation if necessary. This value acts as a lower bound for all types.

public int ConstraintsPerTypeBatch

Field Value

int

Islands

The number of inactive islands to allocate space for.

public int Islands

Field Value

int

ShapesPerType

Minimum number of shapes to allocate space for in each shape type batch.

public int ShapesPerType

Field Value

int

Remarks

Unused if a Shapes instance was directly provided to the Simulation constructor.

Statics

The number of statics to allocate space for.

public int Statics

Field Value

int