From 66e8f4c4bc77ebbb28bed664ad5802976df27938 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Mon, 30 Sep 2019 14:16:27 -0400 Subject: [PATCH] added bow wielding animations --- voxygen/src/anim/character/cidle.rs | 32 +++++++++++++----------- voxygen/src/anim/character/crun.rs | 38 +++++++++++++++++++---------- voxygen/src/anim/character/wield.rs | 26 +++++++++++--------- 3 files changed, 58 insertions(+), 38 deletions(-) diff --git a/voxygen/src/anim/character/cidle.rs b/voxygen/src/anim/character/cidle.rs index f06292e8a8..d830c2396d 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -62,7 +62,7 @@ impl Animation for CidleAnimation { next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); - match Tool::Hammer { + match Tool::Bow { //TODO: Inventory Tool::Sword => { next.l_hand.offset = Vec3::new( @@ -187,27 +187,31 @@ impl Animation for CidleAnimation { } Tool::Bow => { next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, + -4.0 + wave_ultra_slow_cos * 1.0, + 5.0 + wave_ultra_slow_cos * 0.5, 0.0 + wave_ultra_slow * 1.0, ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); + next.l_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.9) + * Quaternion::rotation_z(0.85); next.l_hand.scale = Vec3::one() * 1.01; next.r_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.0 + wave_ultra_slow_cos * 0.5, - -2.0 + wave_ultra_slow * 1.0, + 2.0 + wave_ultra_slow_cos * 1.0, + 8.0 + wave_ultra_slow_cos * 0.5, + -3.5 + wave_ultra_slow * 1.0, ); - next.r_hand.ori = Quaternion::rotation_x(-0.3); + next.r_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85); next.r_hand.scale = Vec3::one() * 1.01; next.weapon.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, + 9.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, + 10.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + -3.0 + wave_ultra_slow * 1.0, ); - next.weapon.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + next.weapon.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85); next.weapon.scale = Vec3::one(); } Tool::Daggers => { diff --git a/voxygen/src/anim/character/crun.rs b/voxygen/src/anim/character/crun.rs index 7f33c43187..2eeaaac20e 100644 --- a/voxygen/src/anim/character/crun.rs +++ b/voxygen/src/anim/character/crun.rs @@ -41,7 +41,7 @@ impl Animation for WieldAnimation { * 0.1, ); - match Tool::Hammer { + match Tool::Bow { //TODO: Inventory Tool::Sword => { next.l_hand.offset = Vec3::new(-6.0, 3.75, 0.25); @@ -133,20 +133,32 @@ impl Animation for WieldAnimation { next.weapon.scale = Vec3::one(); } Tool::Bow => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.weapon.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, + next.l_hand.offset = Vec3::new( + -4.0, + 5.0, 0.0, ); - next.weapon.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + next.l_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.9) + * Quaternion::rotation_z(0.85); + next.l_hand.scale = Vec3::one() * 1.01; + next.r_hand.offset = Vec3::new( + 2.0, + 8.0, + -3.5, + ); + next.r_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85); + next.r_hand.scale = Vec3::one() * 1.01; + next.weapon.offset = Vec3::new( + 9.0 + skeleton_attr.weapon_x, + 10.0 + skeleton_attr.weapon_y, + -3.0, + ); + next.weapon.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85+3.14); next.weapon.scale = Vec3::one(); } Tool::Daggers => { diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index ab1d1e2118..dece8f89bc 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -22,7 +22,7 @@ impl Animation for WieldAnimation { let wave = (anim_time as f32 * 12.0).sin(); - match Tool::Hammer { + match Tool::Bow { //TODO: Inventory Tool::Sword => { next.l_hand.offset = Vec3::new(-6.0, 3.75, 0.25); @@ -114,20 +114,24 @@ impl Animation for WieldAnimation { next.weapon.scale = Vec3::one(); } Tool::Bow => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); + next.l_hand.offset = Vec3::new(-4.0, 5.0, 0.0); + next.l_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.9) + * Quaternion::rotation_z(0.85); next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); + next.r_hand.offset = Vec3::new(2.0, 8.0, -3.5); + next.r_hand.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85); next.r_hand.scale = Vec3::one() * 1.01; next.weapon.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, + 9.0 + skeleton_attr.weapon_x, + 10.0 + skeleton_attr.weapon_y, + -3.0, ); - next.weapon.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + next.weapon.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.7) + * Quaternion::rotation_z(0.85); next.weapon.scale = Vec3::one(); } Tool::Daggers => {