Struct ServoSettings
- Namespace
- BepuPhysics.Constraints
- Assembly
- BepuPhysics.dll
Describes how a quickly and strongly a servo constraint should move towards a position target.
public struct ServoSettings
- Inherited Members
Remarks
The constraint will attempt to reach a speed between BaseSpeed and MaximumSpeed using a force no greater than MaximumForce. The speed that the constraint will attempt to use before clamping is based on its spring settings.
Note that a 'position' target for the purposes of this type could also be an orientation target. For those constraints, speeds/forces are in terms of angular speed and torque.
Constructors
ServoSettings(float, float, float)
Creates a new servo settings instance with the specified properties.
public ServoSettings(float maximumSpeed, float baseSpeed, float maximumForce)
Parameters
maximumSpeed
floatSets the MaximumSpeed property.
baseSpeed
floatSets the BaseSpeed property.
maximumForce
floatSets the MaximumForce property.
Fields
BaseSpeed
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 BaseSpeed
Field Value
MaximumForce
The maximum force that the constraint can apply to move towards the target.
public float MaximumForce
Field 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.
MaximumSpeed
Maximum speed that the constraint can try to use to move towards the target.
public float MaximumSpeed
Field Value
Properties
Default
Gets settings representing a servo with unlimited force, speed, and no base speed. A servo with these settings will behave like a conventional position-level constraint.
public static ServoSettings Default { get; }
Property Value
Methods
Validate(in ServoSettings)
Checks servo settings to ensure valid values.
public static bool Validate(in ServoSettings settings)
Parameters
settings
ServoSettingsSettings to check.
Returns
- bool
True if the settings contain valid values, false otherwise.