b2GearJoint

Struct b2GearJoint 

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

A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length. @warning You have to manually destroy the gear joint if joint1 or joint2 is destroyed.

Implementations§

Source§

impl b2GearJoint

Source

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

Source

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

Source

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

Source

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

Source

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

Dump joint to dmLog

Source§

impl b2GearJoint

Source

pub fn GetJoint1(self: Pin<&mut Self>) -> *mut b2Joint

Get the first joint.

Source

pub fn GetJoint2(self: Pin<&mut Self>) -> *mut b2Joint

Get the second joint.

Source

pub fn SetRatio(self: Pin<&mut Self>, ratio: f32)

Set/Get the gear ratio.

Source

pub fn GetRatio(&self) -> f32

Trait Implementations§

Source§

impl AsRef<b2Joint> for b2GearJoint

Source§

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

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

impl CopyNew for b2GearJoint

Source§

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

Synthesized copy constructor.

Source§

impl Drop for b2GearJoint

Source§

fn drop(self: &mut b2GearJoint)

Synthesized destructor.

Source§

impl ExternType for b2GearJoint

Source§

type Id = (b, _2, G, e, a, 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 b2GearJoint

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2GearJoint

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 b2GearJoint)

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

impl SharedPtrTarget for b2GearJoint

Source§

impl UniquePtrTarget for b2GearJoint

Source§

impl WeakPtrTarget for b2GearJoint

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.