Skip to main content

b2Joint

Struct b2Joint 

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

The base joint class. Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.

Implementations§

Source§

impl b2Joint

Source

pub fn GetType(self: &b2Joint) -> b2JointType

Get the type of the concrete joint.

Source

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

Get the next joint the world joint list.

Source

pub fn GetNext1(self: &b2Joint) -> *const b2Joint

Source

pub fn GetUserData<'a>( self: Pin<&'a mut b2Joint>, ) -> Pin<&'a mut b2JointUserData>

Get the user data pointer.

Source

pub fn IsEnabled(self: &b2Joint) -> bool

Short-cut function to determine if either body is enabled.

Source

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

Get the anchor point on bodyA in world coordinates.

Source

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

Get the anchor point on bodyB in world coordinates.

Source

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

Get the reaction force on bodyB at the joint anchor in Newtons.

Source

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

Get the reaction torque on bodyB in N*m.

Source

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

Dump this joint to the log file.

Source

pub fn ShiftOrigin(self: Pin<&mut b2Joint>, newOrigin: &b2Vec2)

Shift the origin for any points stored in world coordinates.

Source

pub unsafe fn Draw(self: &b2Joint, draw: *mut b2Draw)

Debug draw this joint

Source§

impl b2Joint

Source

pub fn GetBodyA(self: Pin<&mut Self>) -> *mut b2Body

Get the first body attached to this joint.

Source

pub fn GetBodyB(self: Pin<&mut Self>) -> *mut b2Body

Get the second body attached to this joint.

Source

pub fn GetCollideConnected(&self) -> bool

Get collide connected. Note: modifying the collide connect flag won’t work correctly because the flag is only checked when fixture AABBs begin to overlap.

Trait Implementations§

Source§

impl AsRef<b2Joint> for b2DistanceJoint

Source§

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

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

impl AsRef<b2Joint> for b2FrictionJoint

Source§

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

Converts this type into a shared reference of the (usually inferred) input type.
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 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 AsRef<b2Joint> for b2PrismaticJoint

Source§

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

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

impl AsRef<b2Joint> for b2PulleyJoint

Source§

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

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

impl AsRef<b2Joint> for b2RevoluteJoint

Source§

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

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

impl AsRef<b2Joint> for b2WeldJoint

Source§

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

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

impl AsRef<b2Joint> for b2WheelJoint

Source§

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

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

impl ExternType for b2Joint

Source§

type Kind = Opaque

Source§

type Id

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

impl MakeCppStorage for b2Joint

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2Joint

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

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

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.