pub struct B2pulleyJointDef<D: UserDataType> {
    pub base: B2jointDef<D>,
    pub ground_anchor_a: B2vec2,
    pub ground_anchor_b: B2vec2,
    pub local_anchor_a: B2vec2,
    pub local_anchor_b: B2vec2,
    pub length_a: f32,
    pub length_b: f32,
    pub ratio: f32,
}
Expand description

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio.

Fields§

§base: B2jointDef<D>§ground_anchor_a: B2vec2

The first ground anchor in world coordinates. This point never moves.

§ground_anchor_b: B2vec2

The second ground anchor in world coordinates. This point never moves.

§local_anchor_a: B2vec2

The local anchor point relative to body_a’s origin.

§local_anchor_b: B2vec2

The local anchor point relative to body_b’s origin.

§length_a: f32

The a reference length for the segment attached to body_a.

§length_b: f32

The a reference length for the segment attached to body_b.

§ratio: f32

The pulley ratio, used to simulate a block-and-tackle.

Implementations§

source§

impl<D: UserDataType> B2pulleyJointDef<D>

source

pub fn initialize( &mut self, body_a: BodyPtr<D>, body_b: BodyPtr<D>, ground_anchor_a: B2vec2, ground_anchor_b: B2vec2, anchor_a: B2vec2, anchor_b: B2vec2, ratio: f32 )

initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.

Trait Implementations§

source§

impl<D: Clone + UserDataType> Clone for B2pulleyJointDef<D>

source§

fn clone(&self) -> B2pulleyJointDef<D>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<D: UserDataType> Default for B2pulleyJointDef<D>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<D> !RefUnwindSafe for B2pulleyJointDef<D>

§

impl<D> !Send for B2pulleyJointDef<D>

§

impl<D> !Sync for B2pulleyJointDef<D>

§

impl<D> Unpin for B2pulleyJointDef<D>where <D as UserDataType>::Joint: Unpin,

§

impl<D> !UnwindSafe for B2pulleyJointDef<D>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.