Table of Contents

Class CenterDistanceConstraintComponent

Namespace
Stride.BepuPhysics.Constraints
Assembly
Stride.BepuPhysics.dll

Constrains the center of two bodies to be separated by a target distance. This constraint ensures that the distance between the center points of two bodies attempts to match a specific target value. Unlike DistanceServoConstraintComponent, this constraint operates directly on the body centers rather than on specific points on the bodies.

[DataContract]
[DefaultEntityComponentProcessor(typeof(ConstraintProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentCategory("Physics - Bepu Constraint")]
public sealed class CenterDistanceConstraintComponent : TwoBodyConstraintComponent<CenterDistanceConstraint>, IIdentifiable
Inheritance
ConstraintComponent<CenterDistanceConstraint>
TwoBodyConstraintComponent<CenterDistanceConstraint>
CenterDistanceConstraintComponent
Implements
Inherited Members

Remarks

This is a specialized variant of DistanceServoConstraintComponent that works with body centers. Use this when you need to constrain the distance between bodies without specifying exact attachment points. For a version that allows a range of distances rather than a single target value, see CenterDistanceLimitConstraintComponent.

Constructors

CenterDistanceConstraintComponent()

public CenterDistanceConstraintComponent()

Properties

SpringDampingRatio

public float SpringDampingRatio { get; set; }

Property Value

float

SpringFrequency

public float SpringFrequency { get; set; }

Property Value

float

TargetDistance

Target distance between the body centers.

public float TargetDistance { get; set; }

Property Value

float