Table of Contents

Class DistanceServoConstraintComponent

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

Constrains points on two bodies to be separated by a target distance using servo settings. This constraint attempts to maintain a specific distance between two points on two bodies by applying forces to reach the target distance. It uses servo settings to control the speed and force applied to achieve the target distance.

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

Remarks

Unlike CenterDistanceConstraintComponent, this constraint allows you to specify exact attachment points on each body using LocalOffsetA and LocalOffsetB properties. If you need to constrain only the centers of bodies, use CenterDistanceConstraintComponent instead. For a version that allows a range of distances rather than a single target value, see DistanceLimitConstraintComponent.

Constructors

DistanceServoConstraintComponent()

public DistanceServoConstraintComponent()

Properties

LocalOffsetA

Local offset from the center of body A to its attachment point.

public Vector3 LocalOffsetA { get; set; }

Property Value

Vector3

LocalOffsetB

Local offset from the center of body B to its attachment point.

public Vector3 LocalOffsetB { get; set; }

Property Value

Vector3

ServoBaseSpeed

public float ServoBaseSpeed { get; set; }

Property Value

float

ServoMaximumForce

public float ServoMaximumForce { get; set; }

Property Value

float

ServoMaximumSpeed

public float ServoMaximumSpeed { get; set; }

Property Value

float

SpringDampingRatio

public float SpringDampingRatio { get; set; }

Property Value

float

SpringFrequency

public float SpringFrequency { get; set; }

Property Value

float

TargetDistance

Distance that the constraint will try to reach between the attachment points.

public float TargetDistance { get; set; }

Property Value

float