Table of Contents

Class OneBodyAngularServoConstraintComponent

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

Constrains a single body to a target orientation in space, controlling both rotation and tilt.

This constraint applies torque to make a body gradually align with a specific target orientation. It works like a spring system that pulls the body's orientation (rotation around any axis, including tilt) toward the specified target orientation.

Common uses include:

  • Stabilizing objects to maintain a specific orientation
  • Creating motorized joints that rotate/tilt objects to desired angles
  • Simulating gyroscopic or magnetic orientation control

The spring and servo settings control how quickly and forcefully the body moves toward the target orientation.

[DataContract]
[DefaultEntityComponentProcessor(typeof(ConstraintProcessor), ExecutionMode = ExecutionMode.Runtime)]
[ComponentCategory("Physics - Bepu Constraint")]
public sealed class OneBodyAngularServoConstraintComponent : OneBodyConstraintComponent<OneBodyAngularServo>, IIdentifiable, IServo, ISpring, IOneBody
Inheritance
object
ConstraintComponent<OneBodyAngularServo>
OneBodyConstraintComponent<OneBodyAngularServo>
OneBodyAngularServoConstraintComponent
Implements
Inherited Members

Constructors

OneBodyAngularServoConstraintComponent()

public OneBodyAngularServoConstraintComponent()

Properties

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

float

ServoMaximumForce

The maximum force that the constraint can apply to move towards the target.

public float ServoMaximumForce { get; set; }

Property Value

float

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

float

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

float

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

float

TargetOrientation

public Quaternion TargetOrientation { get; set; }

Property Value

Quaternion