From 6ba8af54341e976752efe6e1d2b257a6848c9aec Mon Sep 17 00:00:00 2001 From: jshipsey Date: Mon, 21 Feb 2022 01:23:10 -0500 Subject: [PATCH] anim additions --- voxygen/anim/src/character/alpha.rs | 32 ++++++++++------------- voxygen/anim/src/character/beta.rs | 7 +++++ voxygen/anim/src/character/chargeswing.rs | 8 +++++- voxygen/anim/src/character/dash.rs | 7 +++++ voxygen/anim/src/character/leapmelee.rs | 7 +++++ voxygen/anim/src/character/shockwave.rs | 8 +++++- voxygen/anim/src/character/spin.rs | 8 +++++- voxygen/anim/src/character/spinmelee.rs | 8 ++++++ voxygen/src/scene/figure/mod.rs | 4 ++- 9 files changed, 67 insertions(+), 22 deletions(-) diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index 97e137fde4..e8bfcfa1b7 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -46,40 +46,36 @@ impl Animation for AlphaAnimation { next.second.orientation = Quaternion::rotation_z(0.0); next.torso.position = Vec3::new(0.0, 0.0, 1.1); next.torso.orientation = Quaternion::rotation_z(0.0); - + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } match ability_info.and_then(|a| a.tool) { Some(ToolKind::Sword | ToolKind::Dagger) => { - if matches!( - stage_section, - Some(StageSection::Action | StageSection::Recover) - ) { - next.main_weapon_trail = true; - } next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_x(0.0); - next.chest.orientation = - Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0 + move3 * 0.2); + next.chest.orientation = Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0); next.head.position = Vec3::new(0.0 + move2 * 2.0, s_a.head.0, s_a.head.1); - next.head.orientation = - Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8 + move3 * -0.2); + next.head.orientation = Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8); }, Some(ToolKind::Axe) => { - let (move1, move2, move3) = match stage_section { + let (move1, move2, _move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time, 0.0), Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), _ => (0.0, 0.0, 0.0), }; next.head.position = Vec3::new(move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1); - next.chest.orientation = - Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6 + move3 * 0.4) - * Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0) - * Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5 + move3 * 1.5); - next.head.orientation = - Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5 + move3 * -1.0); + next.chest.orientation = Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6) + * Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0) + * Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5); + next.head.orientation = Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5); }, Some(ToolKind::Hammer) | Some(ToolKind::Pick) => { diff --git a/voxygen/anim/src/character/beta.rs b/voxygen/anim/src/character/beta.rs index e22a9e1de3..7b07365779 100644 --- a/voxygen/anim/src/character/beta.rs +++ b/voxygen/anim/src/character/beta.rs @@ -41,6 +41,13 @@ impl Animation for BetaAnimation { Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), _ => (0.0, 0.0, 0.0), }; + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } next.second.position = Vec3::new(0.0, 0.0, 0.0); next.second.orientation = Quaternion::rotation_z(0.0); next.main.position = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/anim/src/character/chargeswing.rs b/voxygen/anim/src/character/chargeswing.rs index 3cb36eefe2..03040ca7c3 100644 --- a/voxygen/anim/src/character/chargeswing.rs +++ b/voxygen/anim/src/character/chargeswing.rs @@ -54,7 +54,13 @@ impl Animation for ChargeswingAnimation { Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 0.0, 1.0), _ => (0.0, 0.0, 0.0, 0.0, 0.0), }; - + if matches!( + stage_section, + Some(StageSection::Charge | StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } let pullback = 1.0 - movement3; let move1 = move1base * pullback; let move2 = move2base * pullback; diff --git a/voxygen/anim/src/character/dash.rs b/voxygen/anim/src/character/dash.rs index a217f3fbb6..0183bec84c 100644 --- a/voxygen/anim/src/character/dash.rs +++ b/voxygen/anim/src/character/dash.rs @@ -42,6 +42,13 @@ impl Animation for DashAnimation { Some(StageSection::Recover) => (1.1, 1.0, 1.0, anim_time.powi(4)), _ => (0.0, 0.0, 0.0, 0.0), }; + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } let pullback = 1.0 - move4; let move1 = movement1 * pullback; let move2 = movement2 * pullback; diff --git a/voxygen/anim/src/character/leapmelee.rs b/voxygen/anim/src/character/leapmelee.rs index 1c65b230b2..76312b3822 100644 --- a/voxygen/anim/src/character/leapmelee.rs +++ b/voxygen/anim/src/character/leapmelee.rs @@ -42,6 +42,13 @@ impl Animation for LeapAnimation { Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time.powf(0.75)), _ => (0.0, 0.0, 0.0, 0.0), }; + if matches!( + stage_section, + Some(StageSection::Movement | StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } let pullback = 1.0 - move4; let move1 = movement1 * pullback; let move2 = movement2 * pullback; diff --git a/voxygen/anim/src/character/shockwave.rs b/voxygen/anim/src/character/shockwave.rs index 6c7ef2dd9c..4fc1722217 100644 --- a/voxygen/anim/src/character/shockwave.rs +++ b/voxygen/anim/src/character/shockwave.rs @@ -42,7 +42,13 @@ impl Animation for ShockwaveAnimation { Some(StageSection::Recover) => (1.0, 1.0, anim_time), _ => (0.0, 0.0, 0.0), }; - + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2); diff --git a/voxygen/anim/src/character/spin.rs b/voxygen/anim/src/character/spin.rs index 8aa3357bbf..c09713397b 100644 --- a/voxygen/anim/src/character/spin.rs +++ b/voxygen/anim/src/character/spin.rs @@ -49,7 +49,13 @@ impl Animation for SpinAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_x(0.0); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } match ability_info.and_then(|a| a.tool) { Some(ToolKind::Sword) => { next.head.position = Vec3::new( diff --git a/voxygen/anim/src/character/spinmelee.rs b/voxygen/anim/src/character/spinmelee.rs index f994546c4a..7d3cc13047 100644 --- a/voxygen/anim/src/character/spinmelee.rs +++ b/voxygen/anim/src/character/spinmelee.rs @@ -39,10 +39,18 @@ impl Animation for SpinMeleeAnimation { Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(2.0)), _ => (0.0, 0.0, 0.0), }; + let pullback = 1.0 - movement3; let move1 = movement1 * pullback; let move2 = movement2 * pullback; let mut next = (*skeleton).clone(); + if matches!( + stage_section, + Some(StageSection::Action | StageSection::Recover) + ) { + next.main_weapon_trail = true; + next.off_weapon_trail = true; + } next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.second.position = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index f74244bf93..cd4eee2d5f 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -815,7 +815,7 @@ impl FigureMgr { .unwrap_or_else(|| vek::Rgba::broadcast(1.0)) // Highlight targeted collectible entities * if item.is_some() && scene_data.target_entity.map_or(false, |e| e == entity) { - vek::Rgba::new(5.0, 5.0, 5.0, 1.0) + vek::Rgba::new(1.5, 1.5, 1.5, 1.0) } else { vek::Rgba::one() }; @@ -6456,6 +6456,8 @@ impl FigureState { // TODO: Make sure these are good positions, only did tweaking on sword Some(ToolKind::Axe) => (10.0, 19.25), Some(ToolKind::Hammer) => (10.0, 19.25), + Some(ToolKind::Staff) => (10.0, 19.25), + Some(ToolKind::Sceptre) => (10.0, 19.25), _ => (0.0, 0.0), }; (