diff --git a/voxygen/anim/src/arthropod/alpha.rs b/voxygen/anim/src/arthropod/alpha.rs index d4b4702533..c6ad0b2c25 100644 --- a/voxygen/anim/src/arthropod/alpha.rs +++ b/voxygen/anim/src/arthropod/alpha.rs @@ -25,7 +25,7 @@ impl Animation for AlphaAnimation { let (movement1base, movement2base, movement3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0), - Some(StageSection::Swing) => (1.0, anim_time.powi(4), 0.0), + Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0), Some(StageSection::Recover) => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; diff --git a/voxygen/anim/src/arthropod/idle.rs b/voxygen/anim/src/arthropod/idle.rs index 0c22c519ff..91d32b3208 100644 --- a/voxygen/anim/src/arthropod/idle.rs +++ b/voxygen/anim/src/arthropod/idle.rs @@ -39,23 +39,23 @@ impl Animation for IdleAnimation { next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); - //next.leg_fl.orientation = Quaternion::rotation_z(0.1); - //next.leg_fr.orientation = Quaternion::rotation_z(-0.1); + next.leg_fl.orientation = Quaternion::rotation_z(0.1); + next.leg_fr.orientation = Quaternion::rotation_z(-0.1); next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2); next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2); - //next.leg_fcl.orientation = Quaternion::rotation_z(-0.3); - //next.leg_fcr.orientation = Quaternion::rotation_z(0.3); + next.leg_fcl.orientation = Quaternion::rotation_z(-0.3); + next.leg_fcr.orientation = Quaternion::rotation_z(0.3); next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2); next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2); - //next.leg_bcl.orientation = Quaternion::rotation_z(0.0); - //next.leg_bcr.orientation = Quaternion::rotation_z(0.0); + next.leg_bcl.orientation = Quaternion::rotation_z(0.0); + next.leg_bcr.orientation = Quaternion::rotation_z(0.0); next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2); next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2); - //next.leg_bl.orientation = Quaternion::rotation_z(0.4); - //next.leg_br.orientation = Quaternion::rotation_z(-0.4); + next.leg_bl.orientation = Quaternion::rotation_z(0.4); + next.leg_br.orientation = Quaternion::rotation_z(-0.4); next } diff --git a/voxygen/anim/src/arthropod/run.rs b/voxygen/anim/src/arthropod/run.rs index 7830c8bea6..c8318a1e73 100644 --- a/voxygen/anim/src/arthropod/run.rs +++ b/voxygen/anim/src/arthropod/run.rs @@ -26,7 +26,7 @@ impl Animation for RunAnimation { //let speednorm = speed / 13.0; let speednorm = (speed / 13.0).powf(0.25); - let mixed_vel = acc_vel + anim_time * 6.0; //sets run frequency using speed, with anim_time setting a floor + let mixed_vel = (acc_vel + anim_time * 6.0) * 0.6; //sets run frequency using speed, with anim_time setting a floor let speedmult = 1.0; let lab: f32 = 0.6; //6 @@ -65,8 +65,13 @@ impl Animation for RunAnimation { next.chest.scale = Vec3::one() / s_a.scaler; next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.1) + * Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.1) + * Quaternion::rotation_z((mixed_vel + PI * 1.5).sin() * 0.1); next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); + next.chest.orientation = Quaternion::rotation_x((mixed_vel).sin().max(0.0) * 0.06) + * Quaternion::rotation_z((mixed_vel + PI / 2.0).sin() * 0.06); next.mandible_l.position = Vec3::new(-s_a.mandible.0, s_a.mandible.1, s_a.mandible.2); next.mandible_r.position = Vec3::new(s_a.mandible.0, s_a.mandible.1, s_a.mandible.2); @@ -79,15 +84,37 @@ impl Animation for RunAnimation { next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2); + next.leg_fl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin().max(0.0) * 0.7) + * Quaternion::rotation_z(0.1 + (mixed_vel - PI / 2.0).sin() * 0.4); + next.leg_fr.orientation = Quaternion::rotation_x((mixed_vel).sin().max(0.0) * 0.7) + * Quaternion::rotation_z(-0.1 - (mixed_vel + PI / 2.0).sin() * 0.4); next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2); next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2); + next.leg_fcl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7) + * Quaternion::rotation_z(-0.3 + (mixed_vel + PI / 2.0).sin() * 0.2); + next.leg_fcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7) + * Quaternion::rotation_z(0.3 - (mixed_vel + PI * 1.5).sin() * 0.2); next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2); next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2); + next.leg_bcl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel + PI).sin().max(0.0) * 0.7) + * Quaternion::rotation_z((mixed_vel + PI * 1.5).sin() * 0.3); + next.leg_bcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel + PI).sin().min(0.0) * 0.7) + * Quaternion::rotation_z(-(mixed_vel + PI / 2.0).sin() * 0.3); next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2); next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2); + next.leg_bl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7) + * Quaternion::rotation_z(0.4 + (mixed_vel + PI / 2.0).sin() * 0.2); + next.leg_br.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4) + * Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7) + * Quaternion::rotation_z(-0.4 - (mixed_vel + PI * 1.5).sin() * 0.2); next } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 08183c236c..a6d083040f 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -3536,7 +3536,7 @@ impl FigureMgr { StageSection::Buildup => { stage_time / stage.base_buildup_duration.as_secs_f32() }, - StageSection::Swing => { + StageSection::Action => { stage_time / stage.base_swing_duration.as_secs_f32() }, StageSection::Recover => {