Skip to main content

DistanceJointDef

Struct DistanceJointDef 

Source
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: JointDef

Base joint definition

§length: f32

The rest length of this joint. Clamped to a stable minimum value.

§enable_spring: bool

Enable 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: f32

The lower spring force controls how much tension it can sustain

§upper_spring_force: f32

The upper spring force controls how much compression it an sustain

§hertz: f32

The spring linear stiffness Hertz, cycles per second

§damping_ratio: f32

The spring linear damping ratio, non-dimensional

§enable_limit: bool

Enable/disable the joint limit

§min_length: f32

Minimum length for limit. Clamped to a stable minimum value.

§max_length: f32

Maximum length for limit. Must be greater than or equal to the minimum length.

§enable_motor: bool

Enable/disable the joint motor

§max_motor_force: f32

The maximum motor force, usually in newtons

§motor_speed: f32

The desired motor speed, usually in meters per second

§internal_value: i32

Used internally to detect a valid definition. DO NOT SET.

Trait Implementations§

Source§

impl Clone for DistanceJointDef

Source§

fn clone(&self) -> DistanceJointDef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DistanceJointDef

Source§

impl Debug for DistanceJointDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DistanceJointDef

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for DistanceJointDef

Source§

fn eq(&self, other: &DistanceJointDef) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DistanceJointDef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.