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, IServo, ISpring, IWithTwoLocalOffset, ITwoBody
- Inheritance
-
objectConstraintComponent<DistanceServo>TwoBodyConstraintComponent<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
Offset from the center of body A to its attachment in A's local space.
public Vector3 LocalOffsetA { get; set; }
Property Value
LocalOffsetB
Offset from the center of body B to its attachment in B's local space.
public Vector3 LocalOffsetB { get; set; }
Property Value
ServoBaseSpeed
Minimum speed that the constraint will try to use to move towards the target. If the speed implied by the spring configuration is higher than this, the servo will attempt to use the higher speed. Will be clamped by the MaximumSpeed.
public float ServoBaseSpeed { get; set; }
Property Value
ServoMaximumForce
The maximum force that the constraint can apply to move towards the target.
public float ServoMaximumForce { get; set; }
Property Value
Remarks
This value is specified in terms of force: a change in momentum over time. It is approximated as a maximum impulse (an instantaneous change in momentum) on a per-substep basis. In other words, for a given velocity iteration, the constraint's impulse can be no larger than MaximumForce * dt where dt is the substep duration.
ServoMaximumSpeed
Maximum speed that the constraint can try to use to move towards the target.
public float ServoMaximumSpeed { get; set; }
Property Value
SpringDampingRatio
The ratio of the spring's actual damping to its critical damping. 0 is undamped, 1 is critically damped, and higher values are overdamped. Higher damping ratios reduce oscillations and make the connection less elastic.
public float SpringDampingRatio { get; set; }
Property Value
SpringFrequency
The target number of undamped oscillations per unit of time. Higher frequency values create stiffer connections, while lower values allow more elasticity in the joint.
public float SpringFrequency { get; set; }
Property Value
TargetDistance
Distance that the constraint will try to reach between the attachment points.
public float TargetDistance { get; set; }