Struct SolveDescription
- Namespace
- BepuPhysics
- Assembly
- BepuPhysics.dll
Describes how the solver should schedule substeps and velocity iterations.
public struct SolveDescription
- Inherited Members
Constructors
SolveDescription(int, SubstepVelocityIterationScheduler, int, int)
Creates a solve description.
public SolveDescription(int substepCount, SubstepVelocityIterationScheduler velocityIterationScheduler, int fallbackVelocityIterationCount = 1, int fallbackBatchThreshold = 64)
Parameters
substepCount
intNumber of substeps in the solve.
velocityIterationScheduler
SubstepVelocityIterationSchedulerfallbackVelocityIterationCount
intNumber of velocity iterations per substep for any substep that is not given a positive number of velocity iterations by the scheduler.
fallbackBatchThreshold
intNumber of synchronzed constraint batches to use before using a fallback approach.
SolveDescription(int, int, int)
Creates a solve description.
public SolveDescription(int velocityIterationCount, int substepCount, int fallbackBatchThreshold = 64)
Parameters
velocityIterationCount
intNumber of velocity iterations per substep.
substepCount
intNumber of substeps in the solve.
fallbackBatchThreshold
intNumber of synchronzed constraint batches to use before using a fallback approach.
SolveDescription(ReadOnlySpan<int>, int, int)
Creates a solve description.
public SolveDescription(ReadOnlySpan<int> substepVelocityIterations, int fallbackVelocityIterationCount = 1, int fallbackBatchThreshold = 64)
Parameters
substepVelocityIterations
ReadOnlySpan<int>Number of velocity iterations to use in each substep. Number of substeps will be determined by the length of the span.
fallbackVelocityIterationCount
intNumber of velocity iterations per substep for any substep that is not given a positive number of velocity iterations by the scheduler.
fallbackBatchThreshold
intNumber of synchronzed constraint batches to use before using a fallback approach.
Fields
DefaultFallbackBatchThreshold
Default number of synchronized constraint batches to use before falling back to an alternative solving method.
public const int DefaultFallbackBatchThreshold = 64
Field Value
FallbackBatchThreshold
Number of synchronzed constraint batches to use before using a fallback approach.
public int FallbackBatchThreshold
Field Value
SubstepCount
Number of substeps to execute each time the solver runs.
public int SubstepCount
Field Value
VelocityIterationCount
Number of velocity iterations to use in the solver if there is no VelocityIterationScheduler or if it returns a non-positive value for a substep.
public int VelocityIterationCount
Field Value
VelocityIterationScheduler
Callback executed to determine how many velocity iterations should be used for a given substep. If null, or if it returns a non-positive value, the VelocityIterationCount will be used instead.
public SubstepVelocityIterationScheduler VelocityIterationScheduler
Field Value
Operators
implicit operator SolveDescription(Buffer<int>)
Creates a solve description with the given number of substeps and velocity iterations per substep and a fallback threshold of DefaultFallbackBatchThreshold.
public static implicit operator SolveDescription(Buffer<int> substepVelocityIterations)
Parameters
substepVelocityIterations
Buffer<int>Number of velocity iterations to use in each substep. Number of substeps will be determined by the length of the span.
Returns
implicit operator SolveDescription(int)
Creates a solve description with the given number of velocity iterations and a single substep, with a fallback threshold of DefaultFallbackBatchThreshold.
public static implicit operator SolveDescription(int velocityIterationCount)
Parameters
velocityIterationCount
intNumber of velocity iterations per substep.
Returns
implicit operator SolveDescription(int[])
Creates a solve description with the given number of substeps and velocity iterations per substep and a fallback threshold of DefaultFallbackBatchThreshold.
public static implicit operator SolveDescription(int[] substepVelocityIterations)
Parameters
substepVelocityIterations
int[]Number of velocity iterations to use in each substep. Number of substeps will be determined by the length of the span.
Returns
implicit operator SolveDescription(ReadOnlySpan<int>)
Creates a solve description with the given number of substeps and velocity iterations per substep and a fallback threshold of DefaultFallbackBatchThreshold.
public static implicit operator SolveDescription(ReadOnlySpan<int> substepVelocityIterations)
Parameters
substepVelocityIterations
ReadOnlySpan<int>Number of velocity iterations to use in each substep. Number of substeps will be determined by the length of the span.
Returns
implicit operator SolveDescription((int iterationsPerSubstep, int substepCount))
Creates a solve description with the given number of substeps and velocity iterations per substep and a fallback threshold of DefaultFallbackBatchThreshold.
public static implicit operator SolveDescription((int iterationsPerSubstep, int substepCount) schedule)
Parameters
schedule
(int iterationsPerSubstep, int substepCount)Number of substeps and iterations per solve.