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 Motors 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§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.