From 93bea033d9778934b417232b2ba97e9e63ce5223 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Fri, 20 Mar 2020 01:27:54 -0400 Subject: [PATCH] axe, hammer proper wields --- voxygen/src/anim/character/attack.rs | 1 + voxygen/src/anim/character/mod.rs | 2 + voxygen/src/anim/character/stand.rs | 2 +- voxygen/src/anim/character/wield.rs | 70 ++++++++++++++-------------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index dea9736ebe..dd853fda44 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -61,6 +61,7 @@ impl Animation for AttackAnimation { * Quaternion::rotation_y(decel * 0.08); next.shorts.scale = Vec3::one(); + match active_tool_kind { //TODO: Inventory Some(ToolKind::Sword(_)) => { diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 0fe9e9ac1a..c4560db4cb 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -120,6 +120,7 @@ pub struct SkeletonAttr { neck_right: f32, weapon_x: f32, weapon_y: f32, + } impl SkeletonAttr { pub fn calculate_scale(body: &comp::humanoid::Body) -> f32 { @@ -151,6 +152,7 @@ impl Default for SkeletonAttr { neck_right: 1.0, weapon_x: 1.0, weapon_y: 1.0, + } } } diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index c66afb21b4..ab2d67fea7 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -86,7 +86,7 @@ impl Animation for StandAnimation { next.main.offset = Vec3::new( -7.0 + skeleton_attr.weapon_x, -5.0 + skeleton_attr.weapon_y, - 18.0, + 15.0, ); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 05cfaafdc6..f52587ae84 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -19,7 +19,7 @@ impl Animation for WieldAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin(); + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); let wave = (anim_time as f32 * 1.0).sin(); @@ -45,44 +45,42 @@ impl Animation for WieldAnimation { next.control.scale = Vec3::one(); }, Some(ToolKind::Axe(_)) => { - next.l_hand.offset = Vec3::new(-6.5, -0.5, 6.0); - next.l_hand.ori = Quaternion::rotation_x(0.13) * Quaternion::rotation_z(-0.25); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-3.0, 6.5, 6.0); - next.r_hand.ori = Quaternion::rotation_x(0.13) - * Quaternion::rotation_z(2.98) - * Quaternion::rotation_y(-0.50); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -5.0 + skeleton_attr.weapon_x, - 8.5 + skeleton_attr.weapon_y, - -0.5, - ); - next.main.ori = Quaternion::rotation_x(1.70) - * Quaternion::rotation_y(-0.25) - * Quaternion::rotation_z(0.0); + next.l_hand.offset = Vec3::new(-4.0, 3.0, 6.0); + next.l_hand.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_z(3.14 - 0.3) * Quaternion::rotation_y(-0.8); + next.l_hand.scale = Vec3::one() * 1.08; + next.r_hand.offset = Vec3::new(-2.5, 9.0, 4.0); + next.r_hand.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_z(3.14 - 0.3)* Quaternion::rotation_y(-0.8); + next.r_hand.scale = Vec3::one() * 1.06; + next.main.offset = Vec3::new(-6.0, 10.0, -1.0); + next.main.ori = Quaternion::rotation_x(1.27) + * Quaternion::rotation_y(-0.3) + * Quaternion::rotation_z(-0.8); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x( wave_ultra_slow_cos * 0.1) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z( wave_ultra_slow * 0.1); + next.control.scale = Vec3::one(); }, Some(ToolKind::Hammer(_)) => { - next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); - next.l_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(7.0, 2.5, -1.25); - next.r_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + skeleton_attr.weapon_y, - -2.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(-1.27) - * Quaternion::rotation_z(wave * -0.25); + next.l_hand.offset = Vec3::new(-7.0, 4.6, 7.5); + next.l_hand.ori = Quaternion::rotation_x(0.3) * Quaternion::rotation_y(0.32); + next.l_hand.scale = Vec3::one() * 1.08; + next.r_hand.offset = Vec3::new(8.0, 5.75, 4.0); + next.r_hand.ori = Quaternion::rotation_x(0.3) * Quaternion::rotation_y(0.22); + next.r_hand.scale = Vec3::one() * 1.06; + next.main.offset = Vec3::new(6.0, 7.0, 0.0); + next.main.ori = Quaternion::rotation_x(0.3) + * Quaternion::rotation_y(-1.35) + * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); + + next.control.offset = Vec3::new(0.0, 0.0, 0.0); + next.control.ori = Quaternion::rotation_x(wave_ultra_slow * 0.15) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(wave_ultra_slow_cos * 0.08); + next.control.scale = Vec3::one(); }, Some(ToolKind::Staff(_)) => { next.l_hand.offset = Vec3::new( @@ -196,7 +194,7 @@ impl Animation for WieldAnimation { _ => {}, } - next.torso.offset = Vec3::new(0.0, 0.0 + wave * -0.08, 0.1) * skeleton_attr.scaler; + next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;