From 15a2fbc5551d59c3bac965452b37dd1f6bc6f170 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 13 Jun 2021 02:35:32 +0200 Subject: [PATCH] 3 attack anims done --- common/src/comp/body.rs | 1 + voxygen/anim/src/biped_large/alpha.rs | 57 +++++++++++++++++++ voxygen/anim/src/biped_large/beam.rs | 63 +++++++++++++++++++++ voxygen/anim/src/biped_large/shoot.rs | 81 +++++++++++++++++++++++++++ voxygen/anim/src/biped_large/wield.rs | 28 +++++++++ 5 files changed, 230 insertions(+) diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index df1500f996..6c999c3635 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -305,6 +305,7 @@ impl Body { biped_large::Species::Occultsaurok => Vec3::new(4.0, 3.0, 3.4), biped_large::Species::Slysaurok => Vec3::new(4.0, 3.0, 3.4), biped_large::Species::Werewolf => Vec3::new(4.0, 3.0, 3.5), + biped_large::Species::Harvester => Vec3::new(4.6, 3.0, 5.4), _ => Vec3::new(4.6, 3.0, 6.0), }, diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index 583f64aa63..0d3e7c61aa 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -327,6 +327,63 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0) * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8); }, + "Harvester" => { + next.head.orientation = + Quaternion::rotation_x(move1 * -0.25 + move2 * 0.25) + * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.4); + + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1 + move2 * -0.5); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.15); + + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.2 + move2 * -0.2) + * Quaternion::rotation_z(move1 * -1.0 + move2 * 1.0); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_x(-0.4 + move1 * 1.0 + move2 * -1.0) + * Quaternion::rotation_y(move1 * -0.2); + next.shoulder_r.orientation = + Quaternion::rotation_y(0.4 + move1 * -0.8 + move2 * 0.8) + * Quaternion::rotation_x(0.4 + move1 * -0.4 + move2 * 0.8); + + if speed == 0.0 { + next.leg_l.orientation = + Quaternion::rotation_x(move1 * 0.4 + move2 * -0.4); + + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1, + s_a.foot.2 + move1 * 2.0 + move2 * -2.0, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); + } + + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = Vec3::new( + -7.0 + move1 * 26.0 - move2 * 32.0, + 0.0 + s_a.grip.0 / 1.0 - move1 * 4.0, + -s_a.grip.0 / 0.8, + ); + + next.control_l.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.0) + * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0 + move1 * 1.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = Quaternion::rotation_x(-1.4 + move1 * -0.4) + * Quaternion::rotation_y(-2.8 + move1 * 3.0 + move2 * -3.0) + * Quaternion::rotation_z(move1 * -1.5); + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_large/beam.rs b/voxygen/anim/src/biped_large/beam.rs index 62f8e01481..91185538ed 100644 --- a/voxygen/anim/src/biped_large/beam.rs +++ b/voxygen/anim/src/biped_large/beam.rs @@ -215,6 +215,69 @@ impl Animation for BeamAnimation { move1 * -0.8 + move2 * 1.1 + move2shake * 0.02, ); }, + "Harvester" => { + next.head.orientation = Quaternion::rotation_x( + move1 * 0.5 + move2 * -0.4 + move2shake * -0.02, + ); + + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = + Quaternion::rotation_x(move2 * -0.5 + move2shake * -0.1); + + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0 + move1 * -3.0 + move2 * 3.0, + s_a.upper_torso.1 + move1 * -0.4, + ); + next.upper_torso.orientation = Quaternion::rotation_x( + move1 * 0.8 + move2 * -1.1 + move2shake * -0.02, + ); + next.lower_torso.position = + Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1); + next.lower_torso.orientation = Quaternion::rotation_x( + move1 * -0.8 + move2 * 1.1 + move2shake * 0.02, + ); + + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = + Vec3::new(-6.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0); + + next.control.orientation = + Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); + + next.weapon_l.position = + Vec3::new(move1 * 8.0, move1 * 1.0, move1 * 6.0); + next.weapon_l.orientation = Quaternion::rotation_x(move1 * 0.5) + * Quaternion::rotation_y(move1 * -0.8); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = + Quaternion::rotation_y(-0.4 + move1 * 0.8) + * Quaternion::rotation_x(-0.4 + move1 * -0.2); + next.shoulder_r.orientation = + Quaternion::rotation_y(0.4 + move1 * -0.8) + * Quaternion::rotation_x(0.4 + move1 * -0.8); + + next.hand_r.position = Vec3::new( + -s_a.grip.1 + move1 * -5.0, + 0.0 + move1 * 6.0, + s_a.grip.0 + move1 * 13.0, + ); + next.hand_r.orientation = Quaternion::rotation_x(move1 * -3.0) + * Quaternion::rotation_y(move1 * 1.5) + * Quaternion::rotation_z(move1 * -1.5); + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_large/shoot.rs b/voxygen/anim/src/biped_large/shoot.rs index 206d2ad2bd..c5fba1b268 100644 --- a/voxygen/anim/src/biped_large/shoot.rs +++ b/voxygen/anim/src/biped_large/shoot.rs @@ -262,6 +262,87 @@ impl Animation for ShootAnimation { next.arm_control_r.position = Vec3::new(0.0, move1 * 10.0 + move2 * -10.0, 0.0); }, + "Harvester" => { + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = + Vec3::new(-7.0, 0.0 + s_a.grip.0 / 1.0, -s_a.grip.0 / 0.8); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = + Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); + + next.head.orientation = Quaternion::rotation_x(move1 * 0.2); + next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(move2 * -0.3); + + let twist = move1 * 0.8 + move3 * -0.8; + next.upper_torso.position = Vec3::new( + 0.0, + s_a.upper_torso.0, + s_a.upper_torso.1 + move1 * 1.0 + move2 * -1.0, + ); + next.upper_torso.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -1.1) + * Quaternion::rotation_z( + twist * -0.2 + move1 * -0.1 + move2 * 0.3, + ); + + next.lower_torso.orientation = + Quaternion::rotation_x(move1 * -0.8 + move2 * 1.1) + * Quaternion::rotation_z(-twist + move1 * 0.4); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = Quaternion::rotation_x(-0.4); + + next.shoulder_r.position = Vec3::new( + s_a.shoulder.0 + move2 * -2.0, + s_a.shoulder.1, + s_a.shoulder.2, + ); + next.shoulder_r.orientation = Quaternion::rotation_y(move1 * -PI / 2.0) + * Quaternion::rotation_x(move2 * 2.0) + * Quaternion::rotation_z(move1 * -PI / 2.0); + + next.hand_r.position = Vec3::new( + -s_a.grip.1 + move1 * -2.0 + move2 * 8.0, + 0.0 + move1 * 6.0, + s_a.grip.0 + move1 * 18.0 + move2 * -19.0, + ); + next.hand_r.orientation = + Quaternion::rotation_x(move1 * -3.0 + move2 * 3.0) + * Quaternion::rotation_y(move1 * 0.5 + move2 * -1.5) + * Quaternion::rotation_z(move1 * -1.5); + + if speed == 0.0 { + next.leg_l.orientation = + Quaternion::rotation_x(move1 * 0.8 + move2 * -0.8); + + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1, + s_a.foot.2 + move1 * 4.0 + move2 * -4.0, + ); + next.foot_l.orientation = + Quaternion::rotation_x(move1 * -0.6 + move2 * 0.6); + } + }, _ => {}, } } diff --git a/voxygen/anim/src/biped_large/wield.rs b/voxygen/anim/src/biped_large/wield.rs index 9035c2d468..c3d985fd71 100644 --- a/voxygen/anim/src/biped_large/wield.rs +++ b/voxygen/anim/src/biped_large/wield.rs @@ -470,6 +470,34 @@ impl Animation for WieldAnimation { next.shoulder_r.orientation = Quaternion::rotation_x(-0.3); }, + "Harvester" => { + next.control_l.position = Vec3::new(1.0, 2.0, 8.0); + next.control_r.position = Vec3::new(1.0, 1.0, -2.0); + + next.control.position = Vec3::new( + -7.0, + 0.0 + s_a.grip.0 / 1.0, + -s_a.grip.0 / 0.8 + short * -1.5, + ); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2) + * Quaternion::rotation_y(-1.0) + * Quaternion::rotation_z(0.0); + + next.control.orientation = + Quaternion::rotation_x(-1.4) * Quaternion::rotation_y(-2.8); + + next.shoulder_l.position = Vec3::new( + -s_a.shoulder.0, + s_a.shoulder.1, + s_a.shoulder.2 - foothorir * 1.0, + ); + next.shoulder_l.orientation = Quaternion::rotation_x(-0.4); + next.shoulder_r.orientation = + Quaternion::rotation_y(0.4) * Quaternion::rotation_x(0.4); + }, _ => {}, } }