Struct ArticulatedRagdoll
pub struct ArticulatedRagdoll<const MAX_LIMBS: usize = 16> {
pub limbs: [RagdollLimbBinding; MAX_LIMBS],
pub limb_count: usize,
pub mode: RagdollMode,
pub physics_blend_weight: f32,
}Expand description
Zero-heap articulated ragdoll controller for up to MAX_LIMBS bones.
Fields§
§limbs: [RagdollLimbBinding; MAX_LIMBS]§limb_count: usize§mode: RagdollMode§physics_blend_weight: f32Blend weight in [0.0, 1.0] (0.0 = 100% animation, 1.0 = 100% dynamic physics).
Implementations§
§impl<const MAX_LIMBS: usize> ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> ArticulatedRagdoll<MAX_LIMBS>
pub const fn new() -> ArticulatedRagdoll<MAX_LIMBS>
pub const fn new() -> ArticulatedRagdoll<MAX_LIMBS>
Creates an empty ragdoll controller in AnimatedKinematic mode.
pub fn add_limb(&mut self, bone_index: u16, body_index: u32) -> bool
pub fn add_limb(&mut self, bone_index: u16, body_index: u32) -> bool
Registers a limb binding between bone_index and body_index.
pub fn set_mode(
&mut self,
new_mode: RagdollMode,
blend_weight: f32,
bodies: &mut [RigidBody3D],
)
pub fn set_mode( &mut self, new_mode: RagdollMode, blend_weight: f32, bodies: &mut [RigidBody3D], )
Transitions the ragdoll into new_mode and updates bound RigidBody3D::body_type flags.
pub fn sync_poses(
&self,
animated_motors: &[Motor],
bodies: &mut [RigidBody3D],
out_bone_motors: &mut [Motor],
dt: f32,
)
pub fn sync_poses( &self, animated_motors: &[Motor], bodies: &mut [RigidBody3D], out_bone_motors: &mut [Motor], dt: f32, )
Synchronizes animated_motors and bodies after an XPBD physics step, writing the final
blended world-space bone [Motor]s into out_bone_motors.
Trait Implementations§
§impl<const MAX_LIMBS: usize> Clone for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Clone for ArticulatedRagdoll<MAX_LIMBS>
§fn clone(&self) -> ArticulatedRagdoll<MAX_LIMBS>
fn clone(&self) -> ArticulatedRagdoll<MAX_LIMBS>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const MAX_LIMBS: usize> Copy for ArticulatedRagdoll<MAX_LIMBS>
§impl<const MAX_LIMBS: usize> Debug for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Debug for ArticulatedRagdoll<MAX_LIMBS>
§impl<const MAX_LIMBS: usize> Default for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Default for ArticulatedRagdoll<MAX_LIMBS>
§fn default() -> ArticulatedRagdoll<MAX_LIMBS>
fn default() -> ArticulatedRagdoll<MAX_LIMBS>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<const MAX_LIMBS: usize> Freeze for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> RefUnwindSafe for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Send for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Sync for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> Unpin for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> UnsafeUnpin for ArticulatedRagdoll<MAX_LIMBS>
impl<const MAX_LIMBS: usize> UnwindSafe for ArticulatedRagdoll<MAX_LIMBS>
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