From a6d5d87bbcb3f33e94258b74e6d2e6a05f21b74c Mon Sep 17 00:00:00 2001 From: Snowram Date: Wed, 4 Nov 2020 01:13:46 +0100 Subject: [PATCH] Fix animations regressions for biped_large --- .../voxel/weapon/hammer/2hhammer_ogre.vox | 4 +- voxygen/src/anim/src/biped_large/alpha.rs | 11 ++- voxygen/src/anim/src/biped_large/beam.rs | 24 ++--- voxygen/src/anim/src/biped_large/beta.rs | 2 +- voxygen/src/anim/src/biped_large/dash.rs | 6 +- voxygen/src/anim/src/biped_large/equip.rs | 16 +-- voxygen/src/anim/src/biped_large/leapmelee.rs | 97 ++++--------------- voxygen/src/anim/src/biped_large/mod.rs | 8 +- voxygen/src/anim/src/biped_large/shockwave.rs | 2 +- voxygen/src/anim/src/biped_large/spin.rs | 4 +- 10 files changed, 63 insertions(+), 111 deletions(-) diff --git a/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox b/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox index 52442d4456..9f072219d5 100644 --- a/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox +++ b/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a20ab14492f4dc1e0c83a2f456dd5af698a89948e31103048cf1487fbd75d07d -size 3200 +oid sha256:bca0915cf80efe1774603efff617ee618ddd9e7e8e5a0e3de275d863555bdb47 +size 3296 diff --git a/voxygen/src/anim/src/biped_large/alpha.rs b/voxygen/src/anim/src/biped_large/alpha.rs index 0dbdf44c74..0ba316bdb5 100644 --- a/voxygen/src/anim/src/biped_large/alpha.rs +++ b/voxygen/src/anim/src/biped_large/alpha.rs @@ -88,14 +88,15 @@ impl Animation for AlphaAnimation { ); }, Some(ToolKind::Hammer(_)) => { - next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0); + next.hand_l.position = Vec3::new(-12.0, 0.0, 10.0); next.hand_l.orientation = - Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0); - next.hand_r.position = Vec3::new(3.0, 0.0, 0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); + Quaternion::rotation_x(0.0) * Quaternion::rotation_z(-2.0); + next.hand_r.position = Vec3::new(3.0, 0.0, 10.0); + next.hand_r.orientation = + Quaternion::rotation_x(0.0) * Quaternion::rotation_z(-2.0); next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = - Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57); + Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(-1.87); next.head.orientation = Quaternion::rotation_z(slower * 0.03) * Quaternion::rotation_x(slowersmooth * 0.1) diff --git a/voxygen/src/anim/src/biped_large/beam.rs b/voxygen/src/anim/src/biped_large/beam.rs index faad5fd161..475368b107 100644 --- a/voxygen/src/anim/src/biped_large/beam.rs +++ b/voxygen/src/anim/src/biped_large/beam.rs @@ -39,12 +39,14 @@ impl Animation for BeamAnimation { _ => (0.0, 0.0, 0.0), }; - next.hand_l.position = Vec3::new(0.0, 0.0, -4.0); - next.hand_l.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); - next.hand_r.position = Vec3::new(0.0, 0.0, 2.0); - next.hand_r.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2); + next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2); + next.hand_l.orientation = + Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4); + next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2); + next.hand_r.orientation = + Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4); next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_y(0.0); + next.main.orientation = Quaternion::rotation_x(0.0); next.control.position = Vec3::new(-4.0, 7.0, 4.0); next.control.orientation = Quaternion::rotation_x(-0.3) @@ -54,9 +56,9 @@ impl Animation for BeamAnimation { match active_tool_kind { Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { next.control.position = Vec3::new( - s_a.stc.0 + (movement1 * 16.0) * (1.0 - movement3), + s_a.stc.0 + (movement1 * 26.0) * (1.0 - movement3), s_a.stc.1 + (movement1 + (movement2 * 8.0).sin() * 2.0) * (1.0 - movement3), - s_a.stc.2 + (movement1 * 10.0) * (1.0 - movement3), + s_a.stc.2 + (movement1 * 16.0) * (1.0 - movement3), ); next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + (movement1 * -1.2) * (1.0 - movement3)) @@ -77,7 +79,7 @@ impl Animation for BeamAnimation { + (movement2 * 8.0).sin() * -2.0 + (movement2 * 16.0).sin() * -1.5) * (1.0 - movement3), - -4.0 + (movement1 * 19.0 + (movement2 * 8.0 + PI / 2.0).sin() * 3.5) + 0.0 + (movement1 * 19.0 + (movement2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - movement3), ); next.hand_l.orientation = @@ -101,9 +103,9 @@ impl Animation for BeamAnimation { Vec3::new(s_a.foot.0, s_a.foot.1 + movement1 * 4.0, s_a.foot.2); next.foot_r.orientation = Quaternion::rotation_z(movement1 * 0.5); next.upper_torso.orientation = - Quaternion::rotation_x(movement1 * -0.2 + (movement2 * 8.0).sin() * 0.05) - * Quaternion::rotation_z(movement1 * 0.5); - next.lower_torso.orientation = Quaternion::rotation_x(movement1 * 0.2) + Quaternion::rotation_x(movement1 * -0.2 + (movement2 * 8.0).sin() * 0.01) + * Quaternion::rotation_z(movement1 * 0.1); + next.lower_torso.orientation = Quaternion::rotation_x(movement1 * 0.05) * Quaternion::rotation_z(movement1 * -0.2); } else { }; diff --git a/voxygen/src/anim/src/biped_large/beta.rs b/voxygen/src/anim/src/biped_large/beta.rs index bff3414b05..b8d4fa7ba9 100644 --- a/voxygen/src/anim/src/biped_large/beta.rs +++ b/voxygen/src/anim/src/biped_large/beta.rs @@ -50,7 +50,7 @@ impl Animation for BetaAnimation { next.control.position = Vec3::new( s_a.sc.0 + (-1.4 + movement1 * -3.0 + movement2 * -2.0) * (1.0 - movement3), s_a.sc.1 + (-1.4 + movement1 * 3.0 + movement2 * 3.0) * (1.0 - movement3), - s_a.sc.2 + (-1.9 + movement1 * 2.5 * (1.0 - movement3)), + s_a.sc.2 + (10.9 + movement1 * 2.5 * (1.0 - movement3)), ); next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + (-1.7) * (1.0 - movement3)) * Quaternion::rotation_y( diff --git a/voxygen/src/anim/src/biped_large/dash.rs b/voxygen/src/anim/src/biped_large/dash.rs index cc6d8231d6..0163991731 100644 --- a/voxygen/src/anim/src/biped_large/dash.rs +++ b/voxygen/src/anim/src/biped_large/dash.rs @@ -82,9 +82,9 @@ impl Animation for DashAnimation { s_a.upper_torso.1 + 2.0 + shortalt(movement2) * -2.5, ); next.upper_torso.orientation = - Quaternion::rotation_x(movement2.min(1.0) * -0.4 + movement3 * 0.4) - * Quaternion::rotation_y(movement2.min(1.0) * -0.2 + movement3 * 0.3) - * Quaternion::rotation_z(movement1 * 1.1 + movement3 * -2.2); + //Quaternion::rotation_x(movement2.min(1.0) * -0.4 + movement3 * 0.4) + //* Quaternion::rotation_y(movement2.min(1.0) * -0.2 + movement3 * 0.3) + Quaternion::rotation_z(movement1 * 1.1 + movement3 * -2.2); next.control.position = Vec3::new( -7.0 + movement1 * -5.0 + movement3 * -2.0, diff --git a/voxygen/src/anim/src/biped_large/equip.rs b/voxygen/src/anim/src/biped_large/equip.rs index 7aa7552573..10f029911f 100644 --- a/voxygen/src/anim/src/biped_large/equip.rs +++ b/voxygen/src/anim/src/biped_large/equip.rs @@ -34,20 +34,24 @@ impl Animation for EquipAnimation { match active_tool_kind { Some(ToolKind::Sword(_)) => { - next.hand_l.position = Vec3::new(-8.0, -5.0, 17.0); - next.hand_r.position = Vec3::new(-6.0, -4.5, 14.0); + next.hand_l.position = Vec3::new(-18.0, -8.0, -1.0); + next.hand_r.position = Vec3::new(-16.0, -7.5, -4.0); }, Some(ToolKind::Axe(_)) => { next.hand_l.position = Vec3::new(-7.0, -5.0, 17.0); next.hand_r.position = Vec3::new(-5.0, -4.5, 14.0); }, Some(ToolKind::Hammer(_)) => { - next.hand_l.position = Vec3::new(-5.0 - 10.0, -5.0, 3.0); - next.hand_r.position = Vec3::new(-3.0 - 10.0, -4.5, 0.0); + next.hand_l.position = Vec3::new(-15.0, -7.0, 3.0); + next.hand_r.position = Vec3::new(-13.0, -6.5, 0.0); }, Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { - next.hand_l.position = Vec3::new(-3.0, -5.0, 8.0); - next.hand_r.position = Vec3::new(-1.75, -4.5, 5.0); + next.hand_l.position = Vec3::new(4.0, -6.0, 0.0); + next.hand_r.position = Vec3::new(6.0, -6.0, 6.0); + next.hand_l.orientation = + Quaternion::rotation_y(2.2) * Quaternion::rotation_z(1.57); + next.hand_r.orientation = + Quaternion::rotation_y(2.2) * Quaternion::rotation_z(-1.57); }, Some(ToolKind::Bow(_)) => { next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0); diff --git a/voxygen/src/anim/src/biped_large/leapmelee.rs b/voxygen/src/anim/src/biped_large/leapmelee.rs index 642c124a66..0f2b5e99c1 100644 --- a/voxygen/src/anim/src/biped_large/leapmelee.rs +++ b/voxygen/src/anim/src/biped_large/leapmelee.rs @@ -3,7 +3,6 @@ use super::{ BipedLargeSkeleton, SkeletonAttr, }; use common::{comp::item::ToolKind, states::utils::StageSection}; -use std::f32::consts::PI; pub struct LeapAnimation; impl Animation for LeapAnimation { @@ -33,47 +32,46 @@ impl Animation for LeapAnimation { let (movement1, movement2, movement3, movement4) = match stage_section { Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0, 0.0), - Some(StageSection::Movement) => (1.0, anim_time as f32, 0.0, 0.0), - Some(StageSection::Swing) => (1.0, 1.0, anim_time as f32, 0.0), + Some(StageSection::Movement) => (1.0, (anim_time as f32).powf(0.25), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(0.25), 0.0), Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time as f32), _ => (0.0, 0.0, 0.0, 0.0), }; if let Some(ToolKind::Hammer(_)) = active_tool_kind { - next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0); - next.hand_l.scale = Vec3::one() * 1.04; - next.hand_r.position = Vec3::new(2.0, 0.0, 0.0); - next.hand_r.orientation = Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0); - next.hand_r.scale = Vec3::one() * 1.04; + next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2); + next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3); + next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2); + next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3); next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57); + next.main.orientation = Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.control.position = Vec3::new( - 6.0 + movement1 * -10.0, - 7.0 + movement2 * 5.0 + movement3 * 5.0, - 1.0 + movement2 * 5.0 + movement3 * -7.0, + s_a.hc.0 + movement2 * -10.0 + movement3 * 6.0, + s_a.hc.1 + movement2 * 5.0 + movement3 * 7.0, + s_a.hc.2 + movement2 * 5.0 + movement3 * -10.0, ); - next.control.orientation = Quaternion::rotation_x(0.3 + movement3 * -3.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(movement1 * 0.5 + movement2 * 0.5 + movement3 * 0.5); - next.upper_torso.orientation = Quaternion::rotation_x( - movement1 * 0.3 + movement2 * 0.3 + movement3 * -0.9 + movement4 * 0.3, - ) * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(movement1 * 0.5 + movement2 * 0.2 + movement3 * -0.7); + next.control.orientation = + Quaternion::rotation_x(s_a.hc.3 + movement2 * 1.57 + movement3 * -2.3) + * Quaternion::rotation_y(s_a.hc.4 + movement2 * 1.3) + * Quaternion::rotation_z(s_a.hc.5 + movement2 * -1.0 + movement3 * 0.5); + next.upper_torso.orientation = + Quaternion::rotation_x( + movement1 * 0.3 + movement2 * 0.3 + movement3 * -0.9 + movement4 * 0.3, + ) * Quaternion::rotation_z(movement1 * 0.5 + movement2 * 0.2 + movement3 * -0.7); next.head.orientation = Quaternion::rotation_x(movement3 * 0.2) * Quaternion::rotation_y(0.0 + movement2 * -0.1) * Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2 + movement3 * 0.6); - next.hand_l.position = Vec3::new(-12.0 + movement3 * 10.0, 0.0, 0.0); + //next.hand_l.position = Vec3::new(-12.0 + movement3 * 10.0, 0.0, 0.0); next.foot_l.position = Vec3::new( -s_a.foot.0, - s_a.foot.1 - 5.0 + movement3 * 13.0, - s_a.foot.2 + movement3 * -5.0, + s_a.foot.1 + movement3 * 13.0, + s_a.foot.2 + movement3 * -2.0, ); next.foot_l.orientation = Quaternion::rotation_x(-0.8 + movement3 * 1.7); @@ -83,59 +81,6 @@ impl Animation for LeapAnimation { s_a.foot.2 + 5.0 + movement3 * -5.0, ); next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7); - } else if let Some(ToolKind::Axe(_)) = active_tool_kind { - next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0); - next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0); - next.hand_r.position = Vec3::new(0.5, 0.0, -2.5); - next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); - next.main.position = Vec3::new(-0.0, -2.0, -1.0); - next.main.orientation = Quaternion::rotation_x(0.0); - - next.control.position = Vec3::new(-3.0, 11.0, 3.0); - next.control.orientation = Quaternion::rotation_x(1.8) - * Quaternion::rotation_y(-0.5) - * Quaternion::rotation_z(PI - 0.2); - - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - - next.control.position = Vec3::new( - -3.0 + movement1 * 3.0, - 11.0 + movement1 * 1.0 + movement3 * 3.0, - 3.0 + movement1 * 12.0 + movement3 * -15.0, - ); - next.control.orientation = Quaternion::rotation_x( - 1.8 + movement1 * -1.0 + movement2 * -0.5 + movement3 * -1.0, - ) * Quaternion::rotation_y(-0.5 + movement1 * 0.5) - * Quaternion::rotation_z(PI + 0.2 - movement1 * 0.2); - - next.torso.orientation = Quaternion::rotation_x( - -0.3 + movement2 * -1.8 * PI + movement3 * -0.2 * PI + movement4 * -0.1 * PI, - ) * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.head.orientation = - Quaternion::rotation_x(0.0 + movement1 * -0.4 + movement2 * 0.4 + movement3 * 0.2); - - next.foot_l.position = Vec3::new( - s_a.foot.0, - s_a.foot.1 + movement2 * 4.0 + movement3 * -8.0, - s_a.foot.2 - 8.0 + movement2 * 3.0 + movement3 * -3.0, - ); - - next.foot_r.position = Vec3::new( - s_a.foot.0, - s_a.foot.1 + movement2 * 4.0 + movement3 * -8.0, - s_a.foot.2 - 8.0 + movement2 * 3.0 + movement3 * -3.0, - ); - - next.foot_l.orientation = Quaternion::rotation_x(movement1 * 0.9 - movement3 * 1.8); - - next.foot_r.orientation = Quaternion::rotation_x(movement1 * 0.9 - movement3 * 1.8); - - next.lower_torso.orientation = - Quaternion::rotation_x(movement1 * 0.3 + movement2 * 0.1); - - next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 - 8.0); } next diff --git a/voxygen/src/anim/src/biped_large/mod.rs b/voxygen/src/anim/src/biped_large/mod.rs index 182bd668cf..b99da516b6 100644 --- a/voxygen/src/anim/src/biped_large/mod.rs +++ b/voxygen/src/anim/src/biped_large/mod.rs @@ -302,19 +302,19 @@ impl<'a> From<&'a Body> for SkeletonAttr { (_, _) => (-7.0, 7.0, -10.0, -0.1, 0.0, 0.0), }, hhl: match (body.species, body.body_type) { - (Ogre, Male) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0), + (Ogre, Male) => (-9.0, -10.0, 23.0, 1.57, -0.57, 0.0), (Cyclops, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0), (Troll, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0), (_, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0), }, hhr: match (body.species, body.body_type) { - (Ogre, Male) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0), + (Ogre, Male) => (-5.0, -13.0, 0.0, 1.57, -0.57, 0.0), (Cyclops, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0), (Troll, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0), (_, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0), }, hc: match (body.species, body.body_type) { - (Ogre, Male) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0), + (Ogre, Male) => (11.5, 9.0, -13.0, -0.57, -1.57, 1.0), (Cyclops, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0), (Troll, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0), (_, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0), @@ -330,7 +330,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (_, _) => (17.0, 7.5, 2.0, 1.57, 0.8, 0.0), }, stc: match (body.species, body.body_type) { - (Ogre, Female) => (-10.0, 1.0, -18.0, -0.3, 0.15, 0.0), + (Ogre, Female) => (-10.0, 7.0, -23.0, -0.3, 0.15, 0.0), (Occultsaurok, _) => (-10.0, 7.0, -22.0, -0.3, 0.15, 0.0), (_, _) => (-18.0, 1.0, -2.0, -0.3, 0.15, 0.0), }, diff --git a/voxygen/src/anim/src/biped_large/shockwave.rs b/voxygen/src/anim/src/biped_large/shockwave.rs index b22003a654..efbb9f5a2c 100644 --- a/voxygen/src/anim/src/biped_large/shockwave.rs +++ b/voxygen/src/anim/src/biped_large/shockwave.rs @@ -57,7 +57,7 @@ impl Animation for ShockwaveAnimation { next.control.position = Vec3::new( s_a.stc.0 + movement1 * 5.0 + movement3 * -5.0, - s_a.stc.1 + movement1 * 3.0 + movement3 * -3.0, + s_a.stc.1 + movement1 * 13.0 + movement3 * -3.0, s_a.stc.2 + movement1 * 10.0 + movement2 * -2.0 + movement3 * -8.0, ); next.control.orientation = Quaternion::rotation_x( diff --git a/voxygen/src/anim/src/biped_large/spin.rs b/voxygen/src/anim/src/biped_large/spin.rs index aa191272c3..c49eccaa8e 100644 --- a/voxygen/src/anim/src/biped_large/spin.rs +++ b/voxygen/src/anim/src/biped_large/spin.rs @@ -64,8 +64,8 @@ impl Animation for SpinAnimation { next.control.position = Vec3::new( s_a.sc.0 + movement1 * 2.0 + movement2 * -4.0 + movement3 * -7.0, - s_a.sc.1 + 8.0 + movement1 * 0.6 + movement3 * -10.0, - s_a.sc.2 + 1.0 + movement1 * 0.6 + movement2 * 1.5 + movement3 * -4.0, + s_a.sc.1 + 0.0 + movement1 * 0.6 + movement3 * -10.0, + s_a.sc.2 + 5.0 + movement1 * 0.6 + movement2 * 1.5 + movement3 * -4.0, ); next.control.orientation = Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1 * -1.2) * Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement1 * 1.0)