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, ITwoBody, ISpring
- Inheritance
-
objectConstraintComponent<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
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
Target distance between the body centers.
public float TargetDistance { get; set; }