Struct CenterDistanceConstraint
- Namespace
- BepuPhysics.Constraints
- Assembly
- BepuPhysics.dll
Constrains the center of two bodies to be separated by a goal distance.
public struct CenterDistanceConstraint : ITwoBodyConstraintDescription<CenterDistanceConstraint>, IConstraintDescription<CenterDistanceConstraint>
- Implements
- Inherited Members
Constructors
CenterDistanceConstraint(float, in SpringSettings)
public CenterDistanceConstraint(float targetDistance, in SpringSettings springSettings)
Parameters
targetDistancefloatspringSettingsSpringSettings
Fields
SpringSettings
Spring frequency and damping parameters.
public SpringSettings SpringSettings
Field Value
TargetDistance
Target distance between the body centers.
public float TargetDistance
Field Value
Properties
ConstraintTypeId
Gets the type id of the constraint that this is a description of.
public static int ConstraintTypeId { get; }
Property Value
TypeProcessorType
Gets the type of the type batch which contains described constraints.
public static Type TypeProcessorType { get; }
Property Value
Methods
ApplyDescription(ref TypeBatch, int, int)
Changes the batch-held memory at a given location to match the given description.
public readonly void ApplyDescription(ref TypeBatch batch, int bundleIndex, int innerIndex)
Parameters
batchTypeBatchBatch to modify.
bundleIndexintIndex of the target constraint's bundle.
innerIndexintIndex of the target constraint within its bundle.
BuildDescription(ref TypeBatch, int, int, out CenterDistanceConstraint)
Creates a description from the batch-held memory at a given location.
public static void BuildDescription(ref TypeBatch batch, int bundleIndex, int innerIndex, out CenterDistanceConstraint description)
Parameters
batchTypeBatchBatch to read.
bundleIndexintIndex of the source constraint's bundle.
innerIndexintIndex of the source constraint within its bundle.
descriptionCenterDistanceConstraintDescription of the constraint.
CreateTypeProcessor()
Creates a type processor for this constraint type.
public static TypeProcessor CreateTypeProcessor()