pub struct DistanceJointDef {Show 14 fields
pub base: JointDef,
pub length: f32,
pub enable_spring: bool,
pub lower_spring_force: f32,
pub upper_spring_force: f32,
pub hertz: f32,
pub damping_ratio: f32,
pub enable_limit: bool,
pub min_length: f32,
pub max_length: f32,
pub enable_motor: bool,
pub max_motor_force: f32,
pub motor_speed: f32,
pub internal_value: i32,
}Expand description
Distance joint definition. Connects a point on body A with a point on body B by a segment. Useful for ropes and springs. (b2DistanceJointDef)
Fields§
§base: JointDefBase joint definition
length: f32The rest length of this joint. Clamped to a stable minimum value.
enable_spring: boolEnable the distance constraint to behave like a spring. If false then the distance joint will be rigid, overriding the limit and motor.
lower_spring_force: f32The lower spring force controls how much tension it can sustain
upper_spring_force: f32The upper spring force controls how much compression it an sustain
hertz: f32The spring linear stiffness Hertz, cycles per second
damping_ratio: f32The spring linear damping ratio, non-dimensional
enable_limit: boolEnable/disable the joint limit
min_length: f32Minimum length for limit. Clamped to a stable minimum value.
max_length: f32Maximum length for limit. Must be greater than or equal to the minimum length.
enable_motor: boolEnable/disable the joint motor
max_motor_force: f32The maximum motor force, usually in newtons
motor_speed: f32The desired motor speed, usually in meters per second
internal_value: i32Used internally to detect a valid definition. DO NOT SET.
Trait Implementations§
Source§impl Clone for DistanceJointDef
impl Clone for DistanceJointDef
Source§fn clone(&self) -> DistanceJointDef
fn clone(&self) -> DistanceJointDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DistanceJointDef
Source§impl Debug for DistanceJointDef
impl Debug for DistanceJointDef
Source§impl Default for DistanceJointDef
impl Default for DistanceJointDef
Source§impl PartialEq for DistanceJointDef
impl PartialEq for DistanceJointDef
Source§fn eq(&self, other: &DistanceJointDef) -> bool
fn eq(&self, other: &DistanceJointDef) -> bool
self and other values to be equal, and is used by ==.