pub struct Joint {Show 17 fields
pub id: u32,
pub kind: JointType,
pub body_a: u32,
pub body_b: Option<u32>,
pub anchor: JointAnchor,
pub limits: JointLimits,
pub stiffness: f32,
pub damping: f32,
pub rest_length: f32,
pub frequency: f32,
pub collide_connected: bool,
pub break_force: f32,
pub broken: bool,
pub gear_ratio: f32,
pub pulley_ratio: f32,
pub pulley_anchor_a: Vec2,
pub pulley_anchor_b: Vec2,
}Fields§
§id: u32§kind: JointType§body_a: u32§body_b: Option<u32>§anchor: JointAnchor§limits: JointLimits§stiffness: f32§damping: f32§rest_length: f32§frequency: f32§collide_connected: bool§break_force: f32§broken: bool§gear_ratio: f32§pulley_ratio: f32§pulley_anchor_a: Vec2§pulley_anchor_b: Vec2Implementations§
Source§impl Joint
impl Joint
pub fn distance( id: u32, body_a: u32, body_b: u32, local_a: Vec2, local_b: Vec2, length: f32, ) -> Self
pub fn spring( id: u32, body_a: u32, body_b: u32, local_a: Vec2, local_b: Vec2, rest_len: f32, stiffness: f32, damping: f32, ) -> Self
pub fn revolute(id: u32, body_a: u32, body_b: u32, anchor: Vec2) -> Self
pub fn fixed(id: u32, body_a: u32, body_b: u32) -> Self
pub fn with_limits(self, min: f32, max: f32) -> Self
pub fn with_motor(self, speed: f32, max_force: f32) -> Self
pub fn with_break_force(self, force: f32) -> Self
pub fn collide_connected(self) -> Self
pub fn is_active(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Joint
impl RefUnwindSafe for Joint
impl Send for Joint
impl Sync for Joint
impl Unpin for Joint
impl UnsafeUnpin for Joint
impl UnwindSafe for Joint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.