pub struct RagdollEditor {
pub bones: HashMap<String, RagdollBone>,
pub joints: Vec<RagdollJoint>,
pub blend_mode: RagdollBlendMode,
pub animation_blend: f32,
pub blend_time: f32,
pub current_blend_timer: f32,
pub active: bool,
pub total_mass: f32,
pub com_world: Vec3,
pub next_body_id: u64,
}Fields§
§bones: HashMap<String, RagdollBone>§joints: Vec<RagdollJoint>§blend_mode: RagdollBlendMode§animation_blend: f32§blend_time: f32§current_blend_timer: f32§active: bool§total_mass: f32§com_world: Vec3§next_body_id: u64Implementations§
Source§impl RagdollEditor
impl RagdollEditor
pub fn new() -> Self
pub fn build_humanoid_skeleton(&mut self)
pub fn compute_total_mass(&mut self)
Sourcepub fn compute_blended_transforms(
&self,
physics_poses: &HashMap<String, (Vec3, Quat)>,
animation_poses: &HashMap<String, (Vec3, Quat)>,
) -> HashMap<String, (Vec3, Quat)>
pub fn compute_blended_transforms( &self, physics_poses: &HashMap<String, (Vec3, Quat)>, animation_poses: &HashMap<String, (Vec3, Quat)>, ) -> HashMap<String, (Vec3, Quat)>
Blend bone transforms between ragdoll physics and animation Returns blended world transform for each bone
Sourcepub fn muscle_torque(
&self,
joint: &RagdollJoint,
bone_name: &str,
current_angle: f32,
target_angle: f32,
) -> f32
pub fn muscle_torque( &self, joint: &RagdollJoint, bone_name: &str, current_angle: f32, target_angle: f32, ) -> f32
Compute muscle spring torque for a joint given current angle
pub fn set_blend_mode(&mut self, mode: RagdollBlendMode, blend_time: f32)
pub fn update_blend(&mut self, dt: f32)
Trait Implementations§
Source§impl Clone for RagdollEditor
impl Clone for RagdollEditor
Auto Trait Implementations§
impl Freeze for RagdollEditor
impl RefUnwindSafe for RagdollEditor
impl Send for RagdollEditor
impl Sync for RagdollEditor
impl Unpin for RagdollEditor
impl UnsafeUnpin for RagdollEditor
impl UnwindSafe for RagdollEditor
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
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,
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.