Skip to main content

b2MotorJoint

Struct b2MotorJoint 

Source
pub struct b2MotorJoint { /* private fields */ }
Expand description

A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.

Implementations§

Source§

impl b2MotorJoint

Source

pub fn SetMaxForce(self: Pin<&mut b2MotorJoint>, force: f32)

Set the maximum friction force in N.

Source

pub fn GetMaxForce(self: &b2MotorJoint) -> f32

Get the maximum friction force in N.

Source

pub fn SetMaxTorque(self: Pin<&mut b2MotorJoint>, torque: f32)

Set the maximum friction torque in N*m.

Source

pub fn GetMaxTorque(self: &b2MotorJoint) -> f32

Get the maximum friction torque in N*m.

Source

pub fn GetAnchorA(self: &b2MotorJoint) -> b2Vec2

Source

pub fn GetAnchorB(self: &b2MotorJoint) -> b2Vec2

Source

pub fn GetReactionForce(self: &b2MotorJoint, inv_dt: f32) -> b2Vec2

Source

pub fn GetReactionTorque(self: &b2MotorJoint, inv_dt: f32) -> f32

Source

pub fn Dump(self: Pin<&mut b2MotorJoint>)

Dump to b2Log

Source§

impl b2MotorJoint

Source

pub fn SetLinearOffset(self: Pin<&mut Self>, linearOffset: &b2Vec2)

Set/get the target linear offset, in frame A, in meters.

Source

pub fn GetLinearOffset<'a>(&'a self) -> &'a b2Vec2

Source

pub fn SetAngularOffset(self: Pin<&mut Self>, angularOffset: f32)

Set/get the target angular offset, in radians.

Source

pub fn GetAngularOffset(&self) -> f32

Source

pub fn SetCorrectionFactor(self: Pin<&mut Self>, factor: f32)

Set the position correction factor in the range [0,1].

Source

pub fn GetCorrectionFactor(&self) -> f32

Get the position correction factor in the range [0,1].

Trait Implementations§

Source§

impl AsRef<b2Joint> for b2MotorJoint

Source§

fn as_ref(self: &b2MotorJoint) -> &b2Joint

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl CopyNew for b2MotorJoint

Source§

unsafe fn copy_new( other: &b2MotorJoint, this: Pin<&mut MaybeUninit<b2MotorJoint>>, )

Synthesized copy constructor.

Source§

impl Drop for b2MotorJoint

Source§

fn drop(self: &mut b2MotorJoint)

Synthesized destructor.

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ExternType for b2MotorJoint

Source§

type Id = (b, _2, M, o, t, o, r, J, o, i, n, t)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for b2MotorJoint

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2MotorJoint

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2MotorJoint)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl SharedPtrTarget for b2MotorJoint

Source§

impl UniquePtrTarget for b2MotorJoint

Source§

impl WeakPtrTarget for b2MotorJoint

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> 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, 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.