diff --git a/voxygen/src/anim/src/character/glidewield.rs b/voxygen/src/anim/src/character/glidewield.rs index c9e5bc36b1..70052d6647 100644 --- a/voxygen/src/anim/src/character/glidewield.rs +++ b/voxygen/src/anim/src/character/glidewield.rs @@ -370,6 +370,7 @@ impl Animation for GlideWieldAnimation { ); next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); next.lantern.scale = Vec3::one() * 0.65; + next.hold.scale = Vec3::one() * 0.0; next.torso.position = Vec3::new(0.0, 0.0, 0.0) * skeleton_attr.scaler; next.torso.orientation = Quaternion::rotation_x(0.0); diff --git a/voxygen/src/anim/src/quadruped_low/alpha.rs b/voxygen/src/anim/src/quadruped_low/alpha.rs index 87eedd579b..49ecfe54c6 100644 --- a/voxygen/src/anim/src/quadruped_low/alpha.rs +++ b/voxygen/src/anim/src/quadruped_low/alpha.rs @@ -7,7 +7,7 @@ use std::f32::consts::PI; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = f64; + type Dependency = (f32, f64); type Skeleton = QuadrupedLowSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,7 +16,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_alpha")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + (velocity, _global_time): Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -66,39 +66,40 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_x(-0.12) * Quaternion::rotation_z(short * 0.3); next.tail_rear.scale = Vec3::one() * 0.98; + if velocity < 1.0 { + next.foot_fl.position = Vec3::new( + -skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ); + next.foot_fl.orientation = Quaternion::rotation_y(short * 0.12); + next.foot_fl.scale = Vec3::one(); - next.foot_fl.position = Vec3::new( - -skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1, - skeleton_attr.feet_f.2, - ); - next.foot_fl.orientation = Quaternion::rotation_y(short * 0.12); - next.foot_fl.scale = Vec3::one(); + next.foot_fr.position = Vec3::new( + skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ); + next.foot_fr.orientation = Quaternion::rotation_y(short * 0.12); + next.foot_fr.scale = Vec3::one(); - next.foot_fr.position = Vec3::new( - skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1, - skeleton_attr.feet_f.2, - ); - next.foot_fr.orientation = Quaternion::rotation_y(short * 0.12); - next.foot_fr.scale = Vec3::one(); - - next.foot_bl.position = Vec3::new( - -skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1, - skeleton_attr.feet_b.2, - ); - next.foot_bl.orientation = Quaternion::rotation_y(short * 0.12); - next.foot_bl.scale = Vec3::one(); - - next.foot_br.position = Vec3::new( - skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1, - skeleton_attr.feet_b.2, - ); - next.foot_br.orientation = Quaternion::rotation_y(short * 0.12); - next.foot_br.scale = Vec3::one(); + next.foot_bl.position = Vec3::new( + -skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ); + next.foot_bl.orientation = Quaternion::rotation_y(short * 0.12); + next.foot_bl.scale = Vec3::one(); + next.foot_br.position = Vec3::new( + skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ); + next.foot_br.orientation = Quaternion::rotation_y(short * 0.12); + next.foot_br.scale = Vec3::one(); + } else { + }; next } } diff --git a/voxygen/src/anim/src/quadruped_medium/alpha.rs b/voxygen/src/anim/src/quadruped_medium/alpha.rs index ae84f5f8ce..d323e9ecfe 100644 --- a/voxygen/src/anim/src/quadruped_medium/alpha.rs +++ b/voxygen/src/anim/src/quadruped_medium/alpha.rs @@ -7,7 +7,7 @@ use std::f32::consts::PI; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - type Dependency = f64; + type Dependency = (f32, f64); type Skeleton = QuadrupedMediumSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,7 +16,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_alpha")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, + (velocity, _global_time): Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -70,78 +70,80 @@ impl Animation for AlphaAnimation { next.ears.position = Vec3::new(0.0, skeleton_attr.ears.0, skeleton_attr.ears.1); next.ears.orientation = Quaternion::rotation_x(0.0); next.ears.scale = Vec3::one() * 1.02; + if velocity < 1.0 { + next.leg_fl.position = Vec3::new( + -skeleton_attr.leg_f.0, + skeleton_attr.leg_f.1, + skeleton_attr.leg_f.2, + ); - next.leg_fl.position = Vec3::new( - -skeleton_attr.leg_f.0, - skeleton_attr.leg_f.1, - skeleton_attr.leg_f.2, - ); + next.leg_fl.orientation = + Quaternion::rotation_x(short * -0.1) * Quaternion::rotation_y(short * 0.15); + next.leg_fl.scale = Vec3::one(); - next.leg_fl.orientation = - Quaternion::rotation_x(short * -0.1) * Quaternion::rotation_y(short * 0.15); - next.leg_fl.scale = Vec3::one(); + next.leg_fr.position = Vec3::new( + skeleton_attr.leg_f.0, + skeleton_attr.leg_f.1, + skeleton_attr.leg_f.2, + ); + next.leg_fr.orientation = + Quaternion::rotation_x(short * 0.3) * Quaternion::rotation_y(short * -0.2); + next.leg_fr.scale = Vec3::one(); - next.leg_fr.position = Vec3::new( - skeleton_attr.leg_f.0, - skeleton_attr.leg_f.1, - skeleton_attr.leg_f.2, - ); - next.leg_fr.orientation = - Quaternion::rotation_x(short * 0.3) * Quaternion::rotation_y(short * -0.2); - next.leg_fr.scale = Vec3::one(); + next.leg_bl.position = Vec3::new( + -skeleton_attr.leg_b.0, + skeleton_attr.leg_b.1, + skeleton_attr.leg_b.2 + 1.0, + ); + next.leg_bl.orientation = + Quaternion::rotation_x(-0.1 + short * -0.2) * Quaternion::rotation_y(short * 0.2); + next.leg_bl.scale = Vec3::one(); - next.leg_bl.position = Vec3::new( - -skeleton_attr.leg_b.0, - skeleton_attr.leg_b.1, - skeleton_attr.leg_b.2 + 1.0, - ); - next.leg_bl.orientation = - Quaternion::rotation_x(-0.1 + short * -0.2) * Quaternion::rotation_y(short * 0.2); - next.leg_bl.scale = Vec3::one(); + next.leg_br.position = Vec3::new( + skeleton_attr.leg_b.0, + skeleton_attr.leg_b.1, + skeleton_attr.leg_b.2 + 1.0, + ); + next.leg_br.orientation = Quaternion::rotation_x(-0.1 + short * -0.2) + * Quaternion::rotation_y(0.1 + short * 0.2); + next.leg_br.scale = Vec3::one(); - next.leg_br.position = Vec3::new( - skeleton_attr.leg_b.0, - skeleton_attr.leg_b.1, - skeleton_attr.leg_b.2 + 1.0, - ); - next.leg_br.orientation = - Quaternion::rotation_x(-0.1 + short * -0.2) * Quaternion::rotation_y(0.1 + short * 0.2); - next.leg_br.scale = Vec3::one(); + next.foot_fl.position = Vec3::new( + -skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2 + short * -0.2, + ); + next.foot_fl.orientation = Quaternion::rotation_x(short * -0.05); + next.foot_fl.scale = Vec3::one(); - next.foot_fl.position = Vec3::new( - -skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1, - skeleton_attr.feet_f.2 + short * -0.2, - ); - next.foot_fl.orientation = Quaternion::rotation_x(short * -0.05); - next.foot_fl.scale = Vec3::one(); + next.foot_fr.position = Vec3::new( + skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ); + next.foot_fr.orientation = + Quaternion::rotation_x(short * -0.4) * Quaternion::rotation_y(short * 0.15); + next.foot_fr.scale = Vec3::one(); - next.foot_fr.position = Vec3::new( - skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1, - skeleton_attr.feet_f.2, - ); - next.foot_fr.orientation = - Quaternion::rotation_x(short * -0.4) * Quaternion::rotation_y(short * 0.15); - next.foot_fr.scale = Vec3::one(); + next.foot_bl.position = Vec3::new( + -skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2 + short * -0.8, + ); + next.foot_bl.orientation = + Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15); + next.foot_bl.scale = Vec3::one(); - next.foot_bl.position = Vec3::new( - -skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1, - skeleton_attr.feet_b.2 + short * -0.8, - ); - next.foot_bl.orientation = - Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15); - next.foot_bl.scale = Vec3::one(); - - next.foot_br.position = Vec3::new( - skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1, - skeleton_attr.feet_b.2, - ); - next.foot_br.orientation = - Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15); - next.foot_br.scale = Vec3::one(); + next.foot_br.position = Vec3::new( + skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ); + next.foot_br.orientation = + Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15); + next.foot_br.scale = Vec3::one(); + } else { + }; next } } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 2fa6bd7e4a..b6a16f0f9e 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1244,7 +1244,7 @@ impl FigureMgr { CharacterState::BasicMelee(_) => { anim::quadruped_medium::AlphaAnimation::update_skeleton( &target_base, - time, + (vel.0.magnitude(), time), state.state_time, &mut state_animation_rate, skeleton_attr, @@ -1344,7 +1344,7 @@ impl FigureMgr { CharacterState::BasicMelee(_) => { anim::quadruped_low::AlphaAnimation::update_skeleton( &target_base, - time, + (vel.0.magnitude(), time), state.state_time, &mut state_animation_rate, skeleton_attr,