pub struct Ragdoll {
pub bones: Vec<RagdollBone>,
pub joints: Vec<Joint>,
pub active: bool,
pub gravity: Vec2,
/* private fields */
}Fields§
§bones: Vec<RagdollBone>§joints: Vec<Joint>§active: bool§gravity: Vec2Implementations§
Source§impl Ragdoll
impl Ragdoll
pub fn new() -> Self
pub fn add_bone(&mut self, bone: RagdollBone) -> u32
pub fn add_joint(&mut self, joint: Joint)
pub fn activate(&mut self, impulse: Vec2, contact_bone: usize)
pub fn deactivate(&mut self)
pub fn update(&mut self, dt: f32)
pub fn bone_by_name(&self, name: &str) -> Option<&RagdollBone>
pub fn bone_by_name_mut(&mut self, name: &str) -> Option<&mut RagdollBone>
pub fn humanoid(position: Vec2) -> Self
pub fn center_of_mass(&self) -> Vec2
pub fn is_at_rest(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ragdoll
impl RefUnwindSafe for Ragdoll
impl Send for Ragdoll
impl Sync for Ragdoll
impl Unpin for Ragdoll
impl UnsafeUnpin for Ragdoll
impl UnwindSafe for Ragdoll
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.