diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index ae5f30bbf2..4cef11f55b 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -554,7 +554,7 @@ "body": { "keyword": "biped_large", "names": [ - "Leroy Brown" + "Tobermory" ] }, "species": { diff --git a/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox b/assets/voxygen/voxel/weapon/hammer/2hhammer_ogre.vox index dcdd16c077..52442d4456 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:88fbeca98d929e2dd9cc4034412450a4a49d5d1ddf6df7dea9ad5152f83f0477 +oid sha256:a20ab14492f4dc1e0c83a2f456dd5af698a89948e31103048cf1487fbd75d07d size 3200 diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index 96e39d4bf5..9e847bce6d 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -531,17 +531,15 @@ impl Tool { }, ] } else if kind == "BeastClaws" { - vec![ - BasicMelee { - energy_cost: 0, - buildup_duration: Duration::from_millis(500), - recover_duration: Duration::from_millis(250), - knockback: 25.0, - base_healthchange: -200, - range: 5.0, - max_angle: 120.0, - }, - ] + vec![BasicMelee { + energy_cost: 0, + buildup_duration: Duration::from_millis(500), + recover_duration: Duration::from_millis(250), + knockback: 25.0, + base_healthchange: -200, + range: 5.0, + max_angle: 120.0, + }] } else { vec![BasicMelee { energy_cost: 0, diff --git a/common/src/loadout_builder.rs b/common/src/loadout_builder.rs index 2ccddf213a..3caaabd714 100644 --- a/common/src/loadout_builder.rs +++ b/common/src/loadout_builder.rs @@ -79,7 +79,11 @@ impl LoadoutBuilder { "common.items.npc_weapons.npcweapon.stone_golems_fist", )); }, - _ => {}, + golem::Species::Treant => { + main_tool = Some(Item::new_from_asset_expect( + "common.items.npc_weapons.npcweapon.stone_golems_fist", + )); + }, }, Body::BipedLarge(biped_large) => match (biped_large.species, biped_large.body_type) { (biped_large::Species::Occultsaurok, _) => { @@ -132,7 +136,6 @@ impl LoadoutBuilder { "common.items.npc_weapons.sword.dullahan_sword", )); }, - _ => {}, }, Body::Humanoid(_) => { if is_giant { diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 527a6be011..c0b71b7b5c 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -39,7 +39,7 @@ impl Body { Body::Dragon(_) => 250.0, Body::BirdSmall(_) => 75.0, Body::FishSmall(_) => 40.0, - Body::BipedLarge(_) => 160.0, + Body::BipedLarge(_) => 75.0, Body::Object(_) => 40.0, Body::Golem(_) => 60.0, Body::Theropod(_) => 135.0, diff --git a/voxygen/src/anim/src/biped_large/alpha.rs b/voxygen/src/anim/src/biped_large/alpha.rs index 6cc1aee5c2..31d57f051d 100644 --- a/voxygen/src/anim/src/biped_large/alpha.rs +++ b/voxygen/src/anim/src/biped_large/alpha.rs @@ -44,11 +44,7 @@ impl Animation for AlphaAnimation { .sqrt()) * ((anim_time as f32 * lab as f32 * 2.0 * velocity).sin()); let slowersmooth = (anim_time as f32 * lab as f32 * 4.0).sin(); - let accel_med = 1.0 - (anim_time as f32 * 16.0 * lab as f32).cos(); - let accel_slow = 1.0 - (anim_time as f32 * 12.0 * lab as f32).cos(); - let accel_fast = 1.0 - (anim_time as f32 * 24.0 * lab as f32).cos(); let decel = (anim_time as f32 * 16.0 * lab as f32).min(PI / 2.0).sin(); - let push = anim_time as f32 * lab as f32 * 4.0; let slow = (((5.0) / (0.4 + 4.6 * ((anim_time as f32 * lab as f32 * 9.0).sin()).powf(2.0 as f32))) .sqrt()) @@ -65,18 +61,14 @@ impl Animation for AlphaAnimation { / (0.05 + 0.95 * ((anim_time as f32 * lab as f32 * 10.0).sin()).powf(2.0 as f32))) .sqrt()) * ((anim_time as f32 * lab as f32 * 10.0).sin()); - let slower = (((1.0) - / (0.0001 + 0.999 * ((anim_time as f32 * lab as f32 * 4.0).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * lab as f32 * 4.0).sin()); let movement = anim_time as f32 * 1.0; let test = (anim_time as f32 * 1.75).sin(); let slower = (((1.0) - / (0.05 - + 0.95 - * ((anim_time as f32 * lab as f32 * 8.0 - 0.5 * PI).sin()).powf(2.0 as f32))) + / (0.05 + + 0.95 + * ((anim_time as f32 * lab as f32 * 8.0 - 0.5 * PI).sin()).powf(2.0 as f32))) .sqrt()) * ((anim_time as f32 * lab as f32 * 8.0 - 0.5 * PI).sin()) + 1.0; @@ -90,7 +82,7 @@ impl Animation for AlphaAnimation { .round()) / 10.0; - let switch = if random > 0.5 { 1.0 } else { -1.0 }; + let switch = if random > 0.5 { 1.0 } else { -1.0 }; if let Some(ToolKind::Sword(_)) = active_tool_kind { next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5); @@ -283,20 +275,29 @@ impl Animation for AlphaAnimation { next.torso.scale = Vec3::one() / 8.0 * 1.01; }, Some(ToolKind::Hammer(_)) => { - next.hand_l.position = Vec3::new(-15.0, 0.0, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(-0.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-PI / 2.0); - next.hand_l.scale = Vec3::one() * 1.08; - 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_z(-PI / 2.0); - next.hand_r.scale = Vec3::one() * 1.06; - next.main.position = Vec3::new(2.0, 0.0, -12.0); + next.hand_l.position = Vec3::new( + -skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, + ); + next.hand_l.orientation = + Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.position = Vec3::new( + skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, + ); + next.hand_r.orientation = + Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_r.scale = Vec3::one() * 1.02; + + next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(-1.57) - * Quaternion::rotation_z(1.57); + * Quaternion::rotation_z(1.0); + next.main.scale = Vec3::one() * 1.02; next.head.position = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); @@ -314,7 +315,7 @@ impl Animation for AlphaAnimation { next.upper_torso.orientation = Quaternion::rotation_z(slower * 0.18 + slowersmooth * 0.15) * Quaternion::rotation_x(0.0 + slower * 0.18 + slowersmooth * 0.15) - * Quaternion::rotation_y(slower * 0.18 + slowersmooth * 0.15); + * Quaternion::rotation_y(0.0); next.lower_torso.position = Vec3::new(0.0, 0.0, -5.0); next.lower_torso.orientation = @@ -366,10 +367,10 @@ impl Animation for AlphaAnimation { } next.control.scale = Vec3::one(); - next.control.position = Vec3::new(-8.0, 7.0, 1.0); - next.control.orientation = Quaternion::rotation_x(-1.5 + slower * 1.5) - * Quaternion::rotation_y(slowersmooth * 0.35 - 0.3) - * Quaternion::rotation_z(1.4 + slowersmooth * 0.2); + next.control.position = Vec3::new(-8.0, 7.0 + slower * 4.0, 1.0 + slower * -9.0); + next.control.orientation = Quaternion::rotation_x(-1.5 + slower * -1.2) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(1.5); next.control.scale = Vec3::one(); next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01; @@ -452,8 +453,10 @@ impl Animation for AlphaAnimation { }, Some(ToolKind::NpcWeapon(_)) => { if switch > 0.0 { - next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; - next.head.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0)) * Quaternion::rotation_x(-0.2); + next.head.position = + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; + next.head.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0)) + * Quaternion::rotation_x(-0.2); next.head.scale = Vec3::one() * 1.02; next.upper_torso.position = Vec3::new( @@ -461,8 +464,8 @@ impl Animation for AlphaAnimation { skeleton_attr.upper_torso.0, skeleton_attr.upper_torso.1, ); - next.upper_torso.orientation = - Quaternion::rotation_z((twist * 0.5).min(1.0)) * Quaternion::rotation_x(0.0); + next.upper_torso.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0)) + * Quaternion::rotation_x(0.0); next.upper_torso.scale = Vec3::one(); next.lower_torso.position = Vec3::new( @@ -470,8 +473,8 @@ impl Animation for AlphaAnimation { skeleton_attr.lower_torso.0, skeleton_attr.lower_torso.1, ); - next.lower_torso.orientation = - Quaternion::rotation_z((twist * -0.5).max(-1.0)) * Quaternion::rotation_x(0.0); + next.lower_torso.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0)) + * Quaternion::rotation_x(0.0); next.lower_torso.scale = Vec3::one(); next.hand_r.position = Vec3::new( @@ -483,17 +486,18 @@ impl Animation for AlphaAnimation { Quaternion::rotation_z(-1.5) * Quaternion::rotation_x(0.0); next.hand_r.scale = Vec3::one() * 1.02; - next.arm_control_r.position = Vec3::new(0.0, 0.0,-4.0); - next.arm_control_r.orientation = - Quaternion::rotation_x(1.0) + next.arm_control_r.position = Vec3::new(0.0, 0.0, -4.0); + next.arm_control_r.orientation = Quaternion::rotation_x(1.0) * Quaternion::rotation_y(slow * -1.35) * Quaternion::rotation_z(-0.0); next.arm_control_r.scale = Vec3::one() * 1.02; next.tail.orientation = Quaternion::rotation_z(twist * 0.5); } else { - next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; - next.head.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0)) * Quaternion::rotation_x(-0.2); + next.head.position = + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; + next.head.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0)) + * Quaternion::rotation_x(-0.2); next.head.scale = Vec3::one() * 1.02; next.upper_torso.position = Vec3::new( @@ -501,8 +505,8 @@ impl Animation for AlphaAnimation { skeleton_attr.upper_torso.0, skeleton_attr.upper_torso.1, ); - next.upper_torso.orientation = - Quaternion::rotation_z((twist * -0.5).max(-1.0)) * Quaternion::rotation_x(0.0); + next.upper_torso.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0)) + * Quaternion::rotation_x(0.0); next.upper_torso.scale = Vec3::one(); next.lower_torso.position = Vec3::new( @@ -510,13 +514,12 @@ impl Animation for AlphaAnimation { skeleton_attr.lower_torso.0, skeleton_attr.lower_torso.1, ); - next.lower_torso.orientation = - Quaternion::rotation_z((twist * 0.5).min(1.0)) * Quaternion::rotation_x(0.0); + next.lower_torso.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0)) + * Quaternion::rotation_x(0.0); next.lower_torso.scale = Vec3::one(); - next.arm_control_l.position = Vec3::new(0.0, 0.0,-4.0); - next.arm_control_l.orientation = - Quaternion::rotation_x(1.0) + next.arm_control_l.position = Vec3::new(0.0, 0.0, -4.0); + next.arm_control_l.orientation = Quaternion::rotation_x(1.0) * Quaternion::rotation_y(slow * 1.35) * Quaternion::rotation_z(0.0); next.arm_control_l.scale = Vec3::one() * 1.02; diff --git a/voxygen/src/anim/src/biped_large/charge.rs b/voxygen/src/anim/src/biped_large/charge.rs index b86973a075..7fe39c5879 100644 --- a/voxygen/src/anim/src/biped_large/charge.rs +++ b/voxygen/src/anim/src/biped_large/charge.rs @@ -2,7 +2,7 @@ use super::{ super::{vek::*, Animation}, BipedLargeSkeleton, SkeletonAttr, }; -use common::comp::item::{Hands, ToolKind}; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; pub struct ChargeAnimation; @@ -51,19 +51,6 @@ impl Animation for ChargeAnimation { * 0.125, ); - let look = Vec2::new( - ((global_time + anim_time) as f32 / 8.0) - .floor() - .mul(7331.0) - .sin() - * 0.5, - ((global_time + anim_time) as f32 / 8.0) - .floor() - .mul(1337.0) - .sin() - * 0.25, - ); - let foothoril = (((1.0) / (0.4 + (0.6) @@ -110,7 +97,6 @@ impl Animation for ChargeAnimation { * ((anim_time as f32 * lab as f32 * 20.0).cos()); let short = (anim_time as f32 * lab as f32 * 16.0).sin(); - let shortalt = (anim_time as f32 * lab as f32 * 16.0 + PI / 2.0).sin(); let stop = ((anim_time as f32).powf(0.3 as f32)).min(1.2); let stopa = ((anim_time as f32).powf(0.9 as f32)).min(5.0); @@ -374,7 +360,7 @@ impl Animation for ChargeAnimation { next.main.position = Vec3::new(8.0, 8.5, 13.2); next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(3.14) + * Quaternion::rotation_y(PI) * Quaternion::rotation_z(0.0); next.control.position = Vec3::new( diff --git a/voxygen/src/anim/src/biped_large/idle.rs b/voxygen/src/anim/src/biped_large/idle.rs index 7a019b1b3f..2c9504894b 100644 --- a/voxygen/src/anim/src/biped_large/idle.rs +++ b/voxygen/src/anim/src/biped_large/idle.rs @@ -183,7 +183,7 @@ impl Animation for IdleAnimation { next.foot_l.position = Vec3::new( -skeleton_attr.foot.0, skeleton_attr.foot.1, - skeleton_attr.foot.2, + skeleton_attr.foot.2 + torso * -0.6, ); next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.foot_l.scale = Vec3::one(); @@ -191,7 +191,7 @@ impl Animation for IdleAnimation { next.foot_r.position = Vec3::new( skeleton_attr.foot.0, skeleton_attr.foot.1, - skeleton_attr.foot.2, + skeleton_attr.foot.2 + torso * -0.6, ); next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.foot_r.scale = Vec3::one(); diff --git a/voxygen/src/anim/src/biped_large/mod.rs b/voxygen/src/anim/src/biped_large/mod.rs index 5c842ad719..3cb9d13222 100644 --- a/voxygen/src/anim/src/biped_large/mod.rs +++ b/voxygen/src/anim/src/biped_large/mod.rs @@ -245,8 +245,8 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Slysaurok, _) => (3.0, 0.5, -6.0), }, foot: match (body.species, body.body_type) { - (Ogre, Male) => (4.0, 2.5, -14.0), - (Ogre, Female) => (4.0, 0.5, -14.0), + (Ogre, Male) => (4.0, 1.0, -13.5), + (Ogre, Female) => (4.0, 0.5, -13.5), (Cyclops, _) => (4.0, 0.5, -17.0), (Wendigo, _) => (5.0, 2.5, -17.0), (Troll, _) => (6.0, 1.5, -13.0), @@ -256,10 +256,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Mightysaurok, _) => (3.5, 2.0, -12.0), (Slysaurok, _) => (3.5, 2.0, -12.0), }, - beast: match (body.species, body.body_type) { - (Werewolf, _) => (true), - _ => (false), - }, + beast: matches!((body.species, body.body_type), (Werewolf, _)), } } } diff --git a/voxygen/src/anim/src/biped_large/run.rs b/voxygen/src/anim/src/biped_large/run.rs index acc995f50a..c8b39780e7 100644 --- a/voxygen/src/anim/src/biped_large/run.rs +++ b/voxygen/src/anim/src/biped_large/run.rs @@ -23,6 +23,8 @@ impl Animation for RunAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); let speed = Vec2::::from(velocity).magnitude(); + let speedavg = Vec2::::from(avg_vel).magnitude(); + *rate = 1.0; let lab = 0.65; //.65 @@ -58,23 +60,6 @@ impl Animation for RunAnimation { .sqrt()) * ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin()); - let foothoril2 = (((1.0) - / (0.5 - + (0.6) - * ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.5).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.5).sin()); - let foothorir2 = (((1.0) - / (0.5 - + (0.6) - * ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.5).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.5).sin()); - - //let short = (anim_time as f32 * lab as f32 * 16.0).sin(); - - //let shortalt = (anim_time as f32 * lab as f32 * 16.0 + PI / 2.0).sin(); - let amplitude = (speed / 21.0).max(0.25); let amplitude2 = (speed * 1.4 / 21.0).powf(0.5).max(0.6); let amplitude3 = (speed / 21.0).powf(0.5).max(0.35); @@ -145,7 +130,7 @@ impl Animation for RunAnimation { if skeleton_attr.beast { next.head.position = Vec3::new(0.0, skeleton_attr.head.0, 3.0 + skeleton_attr.head.1); next.head.orientation = Quaternion::rotation_x( - look.y * 0.3 / ((canceler).max(0.5)) + amplitude * short * -0.18 + 0.6, + look.y * 0.3 + (speedavg * 0.05) + amplitude * short * -0.18, ) * Quaternion::rotation_z( look.x * 0.3 / ((canceler).max(0.5)) + tilt * -1.2, ) * Quaternion::rotation_y(tilt * 0.8); @@ -296,10 +281,10 @@ impl Animation for RunAnimation { next.torso.position = Vec3::new( 0.0, 0.0 + (short * 0.75).max(-2.0), - canceler * 2.0 + (short * 0.75).max(-2.0), + speedavg * 0.15 + (short * 0.75).max(-2.0), ) / 8.0; next.torso.orientation = - Quaternion::rotation_x(x_tilt + amplitude * short * 0.1 + canceler * -0.7); + Quaternion::rotation_x(x_tilt + amplitude * short * 0.1 + speedavg * -0.045); next.torso.scale = Vec3::one() / 8.0; next.hold.scale = Vec3::one() * 0.0; diff --git a/voxygen/src/anim/src/biped_large/shoot.rs b/voxygen/src/anim/src/biped_large/shoot.rs index d0e9e2e0ae..b1578bf451 100644 --- a/voxygen/src/anim/src/biped_large/shoot.rs +++ b/voxygen/src/anim/src/biped_large/shoot.rs @@ -2,7 +2,7 @@ use super::{ super::{vek::*, Animation}, BipedLargeSkeleton, SkeletonAttr, }; -use common::comp::item::{Hands, ToolKind}; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; pub struct ShootAnimation; @@ -17,7 +17,7 @@ impl Animation for ShootAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_shoot")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, velocity, global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, global_time): Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -373,7 +373,7 @@ impl Animation for ShootAnimation { next.main.position = Vec3::new(10.0, 12.5, 13.2); next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(3.14) + * Quaternion::rotation_y(PI) * Quaternion::rotation_z(0.0); next.control.position = Vec3::new(-7.0, 6.0, 6.0 - exp * 5.0); diff --git a/voxygen/src/anim/src/biped_large/wield.rs b/voxygen/src/anim/src/biped_large/wield.rs index 3010fb0e89..e9792a8c97 100644 --- a/voxygen/src/anim/src/biped_large/wield.rs +++ b/voxygen/src/anim/src/biped_large/wield.rs @@ -2,7 +2,7 @@ use super::{ super::{vek::*, Animation}, BipedLargeSkeleton, SkeletonAttr, }; -use common::comp::item::{Hands, ToolKind}; +use common::comp::item::ToolKind; use std::{f32::consts::PI, ops::Mul}; pub struct WieldAnimation; @@ -17,7 +17,7 @@ impl Animation for WieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")] fn update_skeleton_inner( skeleton: &Self::Skeleton, - (active_tool_kind, second_tool_kind, velocity, global_time): Self::Dependency, + (active_tool_kind, _second_tool_kind, velocity, global_time): Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -108,187 +108,32 @@ impl Animation for WieldAnimation { let shortalt = (anim_time as f32 * lab as f32 * 16.0 + PI / 2.0).sin(); - next.hand_l.position = Vec3::new( - -skeleton_attr.hand.0 - 7.0, - skeleton_attr.hand.1 - 7.0, - skeleton_attr.hand.2 + 10.0, - ); - next.hand_l.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); - next.hand_l.scale = Vec3::one() * 1.02; - - next.hand_r.position = Vec3::new( - skeleton_attr.hand.0 - 7.0, - skeleton_attr.hand.1 - 7.0, - skeleton_attr.hand.2 + 10.0, - ); - next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); - next.hand_r.scale = Vec3::one() * 1.02; - next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); - next.hand_r.scale = Vec3::one() * 1.02; - - next.control.position = Vec3::new(7.0, 9.0, -10.0); - next.control.orientation = Quaternion::rotation_x(test * 0.02) - * Quaternion::rotation_y(test * 0.02) - * Quaternion::rotation_z(test * 0.02); - next.control.scale = Vec3::one(); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.57) - * Quaternion::rotation_z(1.0); - next.main.scale = Vec3::one() * 1.02; - - if velocity > 0.5 { - next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; - next.head.orientation = - Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05); - next.head.scale = Vec3::one() * 1.02; - - next.upper_torso.position = Vec3::new( - 0.0, - skeleton_attr.upper_torso.0, - skeleton_attr.upper_torso.1 + shortalt * -1.5, - ); - next.upper_torso.orientation = Quaternion::rotation_z(short * 0.18); - next.upper_torso.scale = Vec3::one(); - - next.lower_torso.position = Vec3::new( - 0.0, - skeleton_attr.lower_torso.0, - skeleton_attr.lower_torso.1, - ); - next.lower_torso.orientation = - Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14); - next.lower_torso.scale = Vec3::one() * 1.02; - - next.jaw.position = Vec3::new( - 0.0, - skeleton_attr.jaw.0 - slower * 0.12, - skeleton_attr.jaw.1 + slow * 0.2, - ); - next.jaw.orientation = Quaternion::rotation_x(slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; - - next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); - next.tail.orientation = - Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0); - next.tail.scale = Vec3::one(); - - next.shoulder_l.position = Vec3::new( - -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1 + foothoril * -1.0, - skeleton_attr.shoulder.2, - ); - next.shoulder_l.orientation = Quaternion::rotation_x(0.5 + footrotl * -0.16) - * Quaternion::rotation_y(0.1) - * Quaternion::rotation_z(footrotl * 0.1); - next.shoulder_l.scale = Vec3::one(); - - next.shoulder_r.position = Vec3::new( - skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1 + foothorir * -1.0, - skeleton_attr.shoulder.2, - ); - next.shoulder_r.orientation = Quaternion::rotation_x(0.5 + footrotr * -0.16) - * Quaternion::rotation_y(-0.1) - * Quaternion::rotation_z(footrotr * -0.1); - next.shoulder_r.scale = Vec3::one(); - - next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25); - next.torso.scale = Vec3::one() / 8.0; + if skeleton_attr.beast { + next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); } else { - next.head.position = Vec3::new( - 0.0, - skeleton_attr.head.0, - skeleton_attr.head.1 + breathe * 0.2, - ) * 1.02; - next.head.orientation = - Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6); - next.head.scale = Vec3::one() * 1.02; - - next.upper_torso.position = Vec3::new( - 0.0, - skeleton_attr.upper_torso.0, - skeleton_attr.upper_torso.1 + breathe * 0.5, - ); - next.upper_torso.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.upper_torso.scale = Vec3::one(); - - next.lower_torso.position = Vec3::new( - 0.0, - skeleton_attr.lower_torso.0, - skeleton_attr.lower_torso.1 + breathe * 0.15, - ); - next.lower_torso.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.lower_torso.scale = Vec3::one() * 1.02; - next.jaw.position = Vec3::new( 0.0, skeleton_attr.jaw.0 - slower * 0.12, skeleton_attr.jaw.1 + slow * 0.2, ); - next.jaw.orientation = Quaternion::rotation_x(slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; - next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); - next.tail.orientation = - Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0); - next.tail.scale = Vec3::one(); - - next.shoulder_l.position = Vec3::new( - -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, + next.hand_l.position = Vec3::new( + -skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, ); - next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_l.scale = Vec3::one(); + next.hand_l.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_l.scale = Vec3::one() * 1.02; - next.shoulder_r.position = Vec3::new( - skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, + next.hand_r.position = Vec3::new( + skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, ); - next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_r.scale = Vec3::one(); - - next.leg_l.position = Vec3::new( - -skeleton_attr.leg.0, - skeleton_attr.leg.1, - skeleton_attr.leg.2 + breathe * 0.2, - ) * 1.02; - next.leg_l.orientation = Quaternion::rotation_z(0.0); - next.leg_l.scale = Vec3::one() * 1.02; - - next.leg_r.position = Vec3::new( - skeleton_attr.leg.0, - skeleton_attr.leg.1, - skeleton_attr.leg.2 + breathe * 0.2, - ) * 1.02; - next.leg_r.orientation = Quaternion::rotation_z(0.0); - next.leg_r.scale = Vec3::one() * 1.02; - - next.foot_l.position = Vec3::new( - -skeleton_attr.foot.0, - skeleton_attr.foot.1, - skeleton_attr.foot.2, - ); - next.foot_l.orientation = Quaternion::rotation_z(0.0); - next.foot_l.scale = Vec3::one(); - - next.foot_r.position = Vec3::new( - skeleton_attr.foot.0, - skeleton_attr.foot.1, - skeleton_attr.foot.2, - ); - next.foot_r.orientation = Quaternion::rotation_z(0.0); - next.foot_r.scale = Vec3::one(); - - next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; - next.torso.orientation = Quaternion::rotation_z(test * 0.0); - next.torso.scale = Vec3::one() / 8.0; + next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_r.scale = Vec3::one() * 1.02; + next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_r.scale = Vec3::one() * 1.02; next.control.position = Vec3::new(7.0, 9.0, -10.0); next.control.orientation = Quaternion::rotation_x(test * 0.02) @@ -296,374 +141,15 @@ impl Animation for WieldAnimation { * Quaternion::rotation_z(test * 0.02); next.control.scale = Vec3::one(); - next.hold.scale = Vec3::one() * 0.0; - } - match active_tool_kind { - Some(ToolKind::Sword(_)) => { - next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5); - next.hand_l.orientation = - Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); - next.hand_l.scale = Vec3::one() * 1.02; - next.hand_r.position = Vec3::new(3.75, -1.5, -0.5); - next.hand_r.orientation = - Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); - next.hand_r.scale = Vec3::one() * 1.02; - next.main.position = Vec3::new(1.0, 6.0, 1.0); - next.main.orientation = Quaternion::rotation_x(-0.1); + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(-1.57) + * Quaternion::rotation_z(1.0); + next.main.scale = Vec3::one() * 1.02; - next.control.position = Vec3::new(-7.0, 7.0, -10.0); - next.control.orientation = Quaternion::rotation_x(u_slow * 0.15) - * Quaternion::rotation_z(u_slowalt * 0.08); - next.control.scale = Vec3::one(); - }, - Some(ToolKind::Dagger(_)) => { - // hands should be larger when holding a dagger grip, - // also reduce flicker with overlapping polygons - let hand_scale = 1.12; - - next.control.position = Vec3::new(0.0, 0.0, 0.0); - - next.hand_l.position = Vec3::new(0.0, 0.0, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(0.0 * PI) - * Quaternion::rotation_y(0.0 * PI) - * Quaternion::rotation_z(0.0 * PI); - next.hand_l.scale = Vec3::one() * hand_scale; - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0 * PI) - * Quaternion::rotation_y(0.0 * PI) - * Quaternion::rotation_z(0.0 * PI); - - next.hand_r.position = Vec3::new(0.0, 0.0, 0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0 * PI) - * Quaternion::rotation_y(0.0 * PI) - * Quaternion::rotation_z(0.0 * PI); - next.hand_r.scale = Vec3::one() * hand_scale; - - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_x(0.0 * PI) - * Quaternion::rotation_y(0.0 * PI) - * Quaternion::rotation_z(0.0 * PI); - next.second.scale = Vec3::one(); - }, - Some(ToolKind::Axe(_)) => { - if velocity < 0.5 { - next.head.position = Vec3::new( - 0.0, - -3.5 + skeleton_attr.head.0, - skeleton_attr.head.1 + u_slow * 0.1, - ); - next.head.orientation = Quaternion::rotation_z(head_look.x) - * Quaternion::rotation_x(0.35 + head_look.y.abs()); - next.head.scale = Vec3::one() * 1.01; - next.upper_torso.orientation = Quaternion::rotation_x(-0.35) - * Quaternion::rotation_y(u_slowalt * 0.04) - * Quaternion::rotation_z(0.15); - next.lower_torso.position = Vec3::new( - 0.0, - 1.0 + skeleton_attr.lower_torso.0, - skeleton_attr.lower_torso.1, - ); - next.lower_torso.orientation = - Quaternion::rotation_x(0.15) * Quaternion::rotation_z(0.25); - next.control.orientation = Quaternion::rotation_x(1.8) - * Quaternion::rotation_y(-0.5) - * Quaternion::rotation_z(PI - 0.2); - next.control.scale = Vec3::one(); - } else { - next.control.orientation = Quaternion::rotation_x(2.1) - * Quaternion::rotation_y(-0.4) - * Quaternion::rotation_z(PI - 0.2); - next.control.scale = Vec3::one(); - } - next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0); - next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_z(0.0) - * Quaternion::rotation_y(0.0); - next.hand_l.scale = Vec3::one() * 1.08; - next.hand_r.position = Vec3::new(0.5, 0.0, -2.5); - next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_z(0.0) - * Quaternion::rotation_y(0.0); - next.hand_r.scale = Vec3::one() * 1.06; - next.main.position = Vec3::new(-0.0, -2.0, -1.0); - next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - - next.control.position = Vec3::new(-3.0, 11.0, 3.0); - }, - Some(ToolKind::Bow(_)) => { - next.hand_l.position = Vec3::new(3.0, 2.5, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(1.20) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.hand_l.scale = Vec3::one() * 1.05; - next.hand_r.position = Vec3::new(5.9, 5.5, -5.0); - next.hand_r.orientation = Quaternion::rotation_x(1.20) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.hand_r.scale = Vec3::one() * 1.05; - next.main.position = Vec3::new(8.0, 8.0, -13.0); - next.main.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.3) - * Quaternion::rotation_z(-0.6); - - next.hold.position = Vec3::new(1.2, -1.0, -14.2); - next.hold.orientation = Quaternion::rotation_x(-1.7) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.1); - next.hold.scale = Vec3::one() * 1.0; - - next.control.position = Vec3::new(-7.0, 3.0, -8.0); - next.control.orientation = - Quaternion::rotation_x(u_slow * 0.2) * Quaternion::rotation_z(u_slowalt * 0.1); - next.control.scale = Vec3::one(); - }, - Some(ToolKind::Hammer(_)) => { - next.hand_l.position = Vec3::new( - -skeleton_attr.hand.0 - 7.0, - skeleton_attr.hand.1 - 7.0, - skeleton_attr.hand.2 + 10.0, - ); - next.hand_l.orientation = - Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); - next.hand_l.scale = Vec3::one() * 1.02; - - next.hand_r.position = Vec3::new( - skeleton_attr.hand.0 - 7.0, - skeleton_attr.hand.1 - 7.0, - skeleton_attr.hand.2 + 10.0, - ); - next.hand_r.orientation = - Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); - next.hand_r.scale = Vec3::one() * 1.02; - - next.control.position = Vec3::new(7.0, 9.0, -10.0); - next.control.orientation = Quaternion::rotation_x(test * 0.02) - * Quaternion::rotation_y(test * 0.02) - * Quaternion::rotation_z(test * 0.02); - next.control.scale = Vec3::one(); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.57) - * Quaternion::rotation_z(1.0); - next.main.scale = Vec3::one() * 1.02; - }, - Some(ToolKind::Staff(_)) => { - next.hand_l.position = Vec3::new(11.0, 5.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); - next.hand_l.scale = Vec3::one() * 1.05; - next.hand_r.position = Vec3::new(17.0, 7.5, 2.0); - next.hand_r.orientation = - Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.8); - next.hand_r.scale = Vec3::one() * 1.05; - - next.shoulder_l.position = Vec3::new( - -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_l.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_l.scale = Vec3::one(); - - next.shoulder_r.position = Vec3::new( - skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_r.orientation = - Quaternion::rotation_z(0.4) * Quaternion::rotation_x(1.0); - next.shoulder_r.scale = Vec3::one(); - - next.main.position = Vec3::new(10.0, 12.5, 13.2); - next.main.orientation = Quaternion::rotation_y(3.14); - - next.control.position = Vec3::new(-18.0, 1.0, -2.0); - next.control.orientation = Quaternion::rotation_x(-0.3 + u_slow * 0.1) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(u_slowalt * 0.08); - next.control.scale = Vec3::one(); - }, - Some(ToolKind::NpcWeapon(_)) => { - /*next.shoulder_l.position = Vec3::new( - -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); - next.shoulder_l.scale = Vec3::one() + breathe; - - next.shoulder_r.position = Vec3::new( - skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); - next.shoulder_r.scale = Vec3::one() + breathe; - - next.hand_l.position = Vec3::new( - -skeleton_attr.hand.0, - skeleton_attr.hand.1, - skeleton_attr.hand.2 + torso * 0.6, - ); - next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_l.scale = Vec3::one() * 1.02; - - next.hand_r.position = Vec3::new( - skeleton_attr.hand.0, - skeleton_attr.hand.1, - skeleton_attr.hand.2 + torso * 0.6, - ); - next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_r.scale = Vec3::one() * 1.02; - - next.control.position = Vec3::new(0.0, 0.0, 0.0); - next.control.orientation = Quaternion::rotation_z(0.0); - next.control.scale = Vec3::one();*/ - if velocity < 0.5 { - next.head.position = Vec3::new( - 0.0, - skeleton_attr.head.0, - skeleton_attr.head.1 + torso * 0.2, - ) * 1.02; - next.head.orientation = - Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6 + breathe); - next.head.scale = Vec3::one() * 1.02 + breathe * 0.4; - - next.upper_torso.position = Vec3::new( - 0.0, - skeleton_attr.upper_torso.0, - skeleton_attr.upper_torso.1 + torso * 0.5, - ); - next.upper_torso.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-breathe); - next.upper_torso.scale = Vec3::one() - breathe * 0.4; - - next.lower_torso.position = Vec3::new( - 0.0, - skeleton_attr.lower_torso.0, - skeleton_attr.lower_torso.1 + torso * 0.15, - ); - next.lower_torso.orientation = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); - next.lower_torso.scale = Vec3::one() * 1.02 + breathe * 0.4; - - if skeleton_attr.beast { - next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); - } else { - next.jaw.position = Vec3::new( - 0.0, - skeleton_attr.jaw.0 - slower * 0.12, - skeleton_attr.jaw.1 + slow * 0.2, - ); - } - next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0); - next.jaw.scale = Vec3::one() * 0.98; - - next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); - next.tail.orientation = - Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0); - next.tail.scale = Vec3::one(); - - next.control.position = Vec3::new(0.0, 0.0, 0.0); - next.control.orientation = Quaternion::rotation_z(0.0); - next.control.scale = Vec3::one(); - - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = - Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); - next.second.scale = Vec3::one() * 0.0; - - next.main.position = Vec3::new(-5.0, -7.0, 7.0); - next.main.orientation = - Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() * 1.02; - - next.shoulder_l.position = Vec3::new( - -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); - next.shoulder_l.scale = Vec3::one() + breathe; - - next.shoulder_r.position = Vec3::new( - skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1, - skeleton_attr.shoulder.2, - ); - next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); - next.shoulder_r.scale = Vec3::one() + breathe; - - next.hand_l.position = Vec3::new( - -skeleton_attr.hand.0, - skeleton_attr.hand.1, - skeleton_attr.hand.2 + torso * 0.6, - ); - next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_l.scale = Vec3::one() * 1.02; - - next.hand_r.position = Vec3::new( - skeleton_attr.hand.0, - skeleton_attr.hand.1, - skeleton_attr.hand.2 + torso * 0.6, - ); - next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_r.scale = Vec3::one() * 1.02; - - next.arm_control_l.scale = Vec3::one() * 1.0; - next.arm_control_r.scale = Vec3::one() * 1.0; - - next.leg_control_l.scale = Vec3::one() * 1.0; - - next.leg_l.position = Vec3::new( - -skeleton_attr.leg.0, - skeleton_attr.leg.1, - skeleton_attr.leg.2 + torso * 0.2, - ); - next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_l.scale = Vec3::one(); - - next.leg_r.position = Vec3::new( - skeleton_attr.leg.0, - skeleton_attr.leg.1, - skeleton_attr.leg.2 + torso * 0.2, - ); - next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_r.scale = Vec3::one(); - - next.foot_l.position = Vec3::new( - -skeleton_attr.foot.0, - skeleton_attr.foot.1, - skeleton_attr.foot.2, - ); - next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_l.scale = Vec3::one(); - - next.foot_r.position = Vec3::new( - skeleton_attr.foot.0, - skeleton_attr.foot.1, - skeleton_attr.foot.2, - ); - next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_r.scale = Vec3::one(); - - next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 8.0; - - next.leg_control_l.scale = Vec3::one() * 1.0; - next.leg_control_r.scale = Vec3::one() * 1.0; - next.arm_control_l.scale = Vec3::one() * 1.0; - next.arm_control_r.scale = Vec3::one() * 1.0; - - next.hold.scale = Vec3::one() * 0.0; - } else { - next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; + if velocity > 0.5 { + next.head.position = + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; next.head.orientation = Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05); next.head.scale = Vec3::one() * 1.02; @@ -685,120 +171,652 @@ impl Animation for WieldAnimation { Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14); next.lower_torso.scale = Vec3::one() * 1.02; - next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); - next.jaw.orientation = Quaternion::rotation_x(0.0); - next.jaw.scale = Vec3::one() * 1.02; + next.jaw.orientation = Quaternion::rotation_x(slow * 0.05); + next.jaw.scale = Vec3::one() * 0.98; next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); - next.tail.orientation = Quaternion::rotation_x(shortalt * 0.3); + next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) + * Quaternion::rotation_x(0.0); next.tail.scale = Vec3::one(); - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_x(PI) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.second.scale = Vec3::one() * 0.0; - - next.control.position = Vec3::new(0.0, 0.0, 0.0); - next.control.orientation = Quaternion::rotation_z(0.0); - next.control.scale = Vec3::one(); - - next.main.position = Vec3::new(-5.0, -7.0, 7.0); - next.main.orientation = Quaternion::rotation_x(PI) - * Quaternion::rotation_y(0.6) - * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one() * 1.02; - next.shoulder_l.position = Vec3::new( -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1 + foothoril * -3.0, + skeleton_attr.shoulder.1 + foothoril * -1.0, skeleton_attr.shoulder.2, ); - next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36) + next.shoulder_l.orientation = Quaternion::rotation_x(0.5 + footrotl * -0.16) * Quaternion::rotation_y(0.1) - * Quaternion::rotation_z(footrotl * 0.3); + * Quaternion::rotation_z(footrotl * 0.1); next.shoulder_l.scale = Vec3::one(); next.shoulder_r.position = Vec3::new( skeleton_attr.shoulder.0, - skeleton_attr.shoulder.1 + foothorir * -3.0, + skeleton_attr.shoulder.1 + foothorir * -1.0, skeleton_attr.shoulder.2, ); - next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36) + next.shoulder_r.orientation = Quaternion::rotation_x(0.5 + footrotr * -0.16) * Quaternion::rotation_y(-0.1) - * Quaternion::rotation_z(footrotr * -0.3); + * Quaternion::rotation_z(footrotr * -0.1); next.shoulder_r.scale = Vec3::one(); - next.hand_l.position = Vec3::new( - -1.0 + -skeleton_attr.hand.0, - skeleton_attr.hand.1 + foothoril * -4.0, - skeleton_attr.hand.2 + foothoril * 1.0, - ); - next.hand_l.orientation = Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3)) - * Quaternion::rotation_y(handhoril * -0.1); - next.hand_l.scale = Vec3::one() * 1.02; + next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; + next.torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25); + next.torso.scale = Vec3::one() / 8.0; + } else { + next.head.position = Vec3::new( + 0.0, + skeleton_attr.head.0, + skeleton_attr.head.1 + breathe * 0.2, + ) * 1.02; + next.head.orientation = + Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6); + next.head.scale = Vec3::one() * 1.02; - next.hand_r.position = Vec3::new( - 1.0 + skeleton_attr.hand.0, - skeleton_attr.hand.1 + foothorir * -4.0, - skeleton_attr.hand.2 + foothorir * 1.0, + next.upper_torso.position = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + breathe * 0.5, ); - next.hand_r.orientation = Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3)) - * Quaternion::rotation_y(handhorir * 0.1); - next.hand_r.scale = Vec3::one() * 1.02; + next.upper_torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.upper_torso.scale = Vec3::one(); + + next.lower_torso.position = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1 + breathe * 0.15, + ); + next.lower_torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.lower_torso.scale = Vec3::one() * 1.02; + + next.jaw.position = Vec3::new( + 0.0, + skeleton_attr.jaw.0 - slower * 0.12, + skeleton_attr.jaw.1 + slow * 0.2, + ); + next.jaw.orientation = Quaternion::rotation_x(slow * 0.05); + next.jaw.scale = Vec3::one() * 0.98; + + next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); + next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) + * Quaternion::rotation_x(0.0); + next.tail.scale = Vec3::one(); + + next.shoulder_l.position = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.position = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_r.scale = Vec3::one(); next.leg_l.position = Vec3::new( -skeleton_attr.leg.0, skeleton_attr.leg.1, - skeleton_attr.leg.2, - ) * 0.98; - next.leg_l.orientation = - Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothoril * 0.3); - next.leg_l.scale = Vec3::one() * 0.98; + skeleton_attr.leg.2 + breathe * 0.2, + ) * 1.02; + next.leg_l.orientation = Quaternion::rotation_z(0.0); + next.leg_l.scale = Vec3::one() * 1.02; next.leg_r.position = Vec3::new( skeleton_attr.leg.0, skeleton_attr.leg.1, - skeleton_attr.leg.2, - ) * 0.98; - - next.leg_r.orientation = - Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothorir * 0.3); - next.leg_r.scale = Vec3::one() * 0.98; + skeleton_attr.leg.2 + breathe * 0.2, + ) * 1.02; + next.leg_r.orientation = Quaternion::rotation_z(0.0); + next.leg_r.scale = Vec3::one() * 1.02; next.foot_l.position = Vec3::new( -skeleton_attr.foot.0, - skeleton_attr.foot.1 + foothoril * 8.5, - skeleton_attr.foot.2 + ((footvertl * 6.5).max(0.0)), + skeleton_attr.foot.1, + skeleton_attr.foot.2, ); - next.foot_l.orientation = - Quaternion::rotation_x(-0.5 + footrotl * 0.85) * Quaternion::rotation_y(0.0); + next.foot_l.orientation = Quaternion::rotation_z(0.0); next.foot_l.scale = Vec3::one(); next.foot_r.position = Vec3::new( skeleton_attr.foot.0, - skeleton_attr.foot.1 + foothorir * 8.5, - skeleton_attr.foot.2 + ((footvertr * 6.5).max(0.0)), + skeleton_attr.foot.1, + skeleton_attr.foot.2, ); - next.foot_r.orientation = - Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0); + next.foot_r.orientation = Quaternion::rotation_z(0.0); next.foot_r.scale = Vec3::one(); next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25); + next.torso.orientation = Quaternion::rotation_z(test * 0.0); next.torso.scale = Vec3::one() / 8.0; - next.leg_control_l.scale = Vec3::one() * 1.0; - next.leg_control_r.scale = Vec3::one() * 1.0; - next.arm_control_l.scale = Vec3::one() * 1.0; - next.arm_control_r.scale = Vec3::one() * 1.0; + next.control.position = Vec3::new(7.0, 9.0, -10.0); + next.control.orientation = Quaternion::rotation_x(test * 0.02) + * Quaternion::rotation_y(test * 0.02) + * Quaternion::rotation_z(test * 0.02); + next.control.scale = Vec3::one(); next.hold.scale = Vec3::one() * 0.0; } - }, - _ => {}, - } + match active_tool_kind { + Some(ToolKind::Sword(_)) => { + next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5); + next.hand_l.orientation = + Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); + next.hand_l.scale = Vec3::one() * 1.02; + next.hand_r.position = Vec3::new(3.75, -1.5, -0.5); + next.hand_r.orientation = + Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); + next.hand_r.scale = Vec3::one() * 1.02; + next.main.position = Vec3::new(1.0, 6.0, 1.0); + next.main.orientation = Quaternion::rotation_x(-0.1); + next.control.position = Vec3::new(-7.0, 7.0, -10.0); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.15) + * Quaternion::rotation_z(u_slowalt * 0.08); + next.control.scale = Vec3::one(); + }, + Some(ToolKind::Dagger(_)) => { + // hands should be larger when holding a dagger grip, + // also reduce flicker with overlapping polygons + let hand_scale = 1.12; + + next.control.position = Vec3::new(0.0, 0.0, 0.0); + + next.hand_l.position = Vec3::new(0.0, 0.0, 0.0); + next.hand_l.orientation = Quaternion::rotation_x(0.0 * PI) + * Quaternion::rotation_y(0.0 * PI) + * Quaternion::rotation_z(0.0 * PI); + next.hand_l.scale = Vec3::one() * hand_scale; + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0 * PI) + * Quaternion::rotation_y(0.0 * PI) + * Quaternion::rotation_z(0.0 * PI); + + next.hand_r.position = Vec3::new(0.0, 0.0, 0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0 * PI) + * Quaternion::rotation_y(0.0 * PI) + * Quaternion::rotation_z(0.0 * PI); + next.hand_r.scale = Vec3::one() * hand_scale; + + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_x(0.0 * PI) + * Quaternion::rotation_y(0.0 * PI) + * Quaternion::rotation_z(0.0 * PI); + next.second.scale = Vec3::one(); + }, + Some(ToolKind::Axe(_)) => { + if velocity < 0.5 { + next.head.position = Vec3::new( + 0.0, + -3.5 + skeleton_attr.head.0, + skeleton_attr.head.1 + u_slow * 0.1, + ); + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x(0.35 + head_look.y.abs()); + next.head.scale = Vec3::one() * 1.01; + next.upper_torso.orientation = Quaternion::rotation_x(-0.35) + * Quaternion::rotation_y(u_slowalt * 0.04) + * Quaternion::rotation_z(0.15); + next.lower_torso.position = Vec3::new( + 0.0, + 1.0 + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1, + ); + next.lower_torso.orientation = + Quaternion::rotation_x(0.15) * Quaternion::rotation_z(0.25); + next.control.orientation = Quaternion::rotation_x(1.8) + * Quaternion::rotation_y(-0.5) + * Quaternion::rotation_z(PI - 0.2); + next.control.scale = Vec3::one(); + } else { + next.control.orientation = Quaternion::rotation_x(2.1) + * Quaternion::rotation_y(-0.4) + * Quaternion::rotation_z(PI - 0.2); + next.control.scale = Vec3::one(); + } + next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0); + next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_z(0.0) + * Quaternion::rotation_y(0.0); + next.hand_l.scale = Vec3::one() * 1.08; + next.hand_r.position = Vec3::new(0.5, 0.0, -2.5); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_z(0.0) + * Quaternion::rotation_y(0.0); + next.hand_r.scale = Vec3::one() * 1.06; + next.main.position = Vec3::new(-0.0, -2.0, -1.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + + next.control.position = Vec3::new(-3.0, 11.0, 3.0); + }, + Some(ToolKind::Bow(_)) => { + next.hand_l.position = Vec3::new(3.0, 2.5, 0.0); + next.hand_l.orientation = Quaternion::rotation_x(1.20) + * Quaternion::rotation_y(-0.6) + * Quaternion::rotation_z(-0.3); + next.hand_l.scale = Vec3::one() * 1.05; + next.hand_r.position = Vec3::new(5.9, 5.5, -5.0); + next.hand_r.orientation = Quaternion::rotation_x(1.20) + * Quaternion::rotation_y(-0.6) + * Quaternion::rotation_z(-0.3); + next.hand_r.scale = Vec3::one() * 1.05; + next.main.position = Vec3::new(8.0, 8.0, -13.0); + next.main.orientation = Quaternion::rotation_x(-0.3) + * Quaternion::rotation_y(0.3) + * Quaternion::rotation_z(-0.6); + + next.hold.position = Vec3::new(1.2, -1.0, -14.2); + next.hold.orientation = Quaternion::rotation_x(-1.7) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(-0.1); + next.hold.scale = Vec3::one() * 1.0; + + next.control.position = Vec3::new(-7.0, 3.0, -8.0); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.2) + * Quaternion::rotation_z(u_slowalt * 0.1); + next.control.scale = Vec3::one(); + }, + Some(ToolKind::Hammer(_)) => { + next.hand_l.position = Vec3::new( + -skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, + ); + next.hand_l.orientation = + Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.position = Vec3::new( + skeleton_attr.hand.0 - 7.0, + skeleton_attr.hand.1 - 7.0, + skeleton_attr.hand.2 + 10.0, + ); + next.hand_r.orientation = + Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57); + next.hand_r.scale = Vec3::one() * 1.02; + + next.control.position = Vec3::new(0.0, 0.0, 0.0); + next.control.orientation = Quaternion::rotation_x(test * 0.02) + * Quaternion::rotation_y(test * 0.02) + * Quaternion::rotation_z(test * 0.02); + next.control.scale = Vec3::one(); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(1.57) + * Quaternion::rotation_z(1.0); + next.main.scale = Vec3::one() * 1.02; + }, + Some(ToolKind::Staff(_)) => { + next.hand_l.position = Vec3::new(11.0, 5.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); + next.hand_l.scale = Vec3::one() * 1.05; + next.hand_r.position = Vec3::new(17.0, 7.5, 2.0); + next.hand_r.orientation = + Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.8); + next.hand_r.scale = Vec3::one() * 1.05; + + next.shoulder_l.position = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.position = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.orientation = + Quaternion::rotation_z(0.4) * Quaternion::rotation_x(1.0); + next.shoulder_r.scale = Vec3::one(); + + next.main.position = Vec3::new(10.0, 12.5, 13.2); + next.main.orientation = Quaternion::rotation_y(PI); + + next.control.position = Vec3::new(-18.0, 1.0, -2.0); + next.control.orientation = Quaternion::rotation_x(-0.3 + u_slow * 0.1) + * Quaternion::rotation_y(0.15) + * Quaternion::rotation_z(u_slowalt * 0.08); + next.control.scale = Vec3::one(); + }, + Some(ToolKind::NpcWeapon(_)) => { + /*next.shoulder_l.position = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); + next.shoulder_l.scale = Vec3::one() + breathe; + + next.shoulder_r.position = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); + next.shoulder_r.scale = Vec3::one() + breathe; + + next.hand_l.position = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.position = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_r.scale = Vec3::one() * 1.02; + + next.control.position = Vec3::new(0.0, 0.0, 0.0); + next.control.orientation = Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one();*/ + if velocity < 0.5 { + next.head.position = Vec3::new( + 0.0, + skeleton_attr.head.0, + skeleton_attr.head.1 + torso * 0.2, + ) * 1.02; + next.head.orientation = Quaternion::rotation_z(look.x * 0.6) + * Quaternion::rotation_x(look.y * 0.6 + breathe); + next.head.scale = Vec3::one() * 1.02 + breathe * 0.4; + + next.upper_torso.position = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + torso * 0.5, + ); + next.upper_torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-breathe); + next.upper_torso.scale = Vec3::one() - breathe * 0.4; + + next.lower_torso.position = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1 + torso * 0.15, + ); + next.lower_torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); + next.lower_torso.scale = Vec3::one() * 1.02 + breathe * 0.4; + + next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0); + next.jaw.scale = Vec3::one() * 0.98; + + next.tail.position = + Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); + next.tail.orientation = + Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) + * Quaternion::rotation_x(0.0); + next.tail.scale = Vec3::one(); + + next.control.position = Vec3::new(0.0, 0.0, 0.0); + next.control.orientation = Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one(); + + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_x(PI) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + next.second.scale = Vec3::one() * 0.0; + + next.main.position = Vec3::new(-5.0, -7.0, 7.0); + next.main.orientation = Quaternion::rotation_x(PI) + * Quaternion::rotation_y(0.6) + * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one() * 1.02; + + next.shoulder_l.position = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); + next.shoulder_l.scale = Vec3::one() + breathe; + + next.shoulder_r.position = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe); + next.shoulder_r.scale = Vec3::one() + breathe; + + next.hand_l.position = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.position = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_r.scale = Vec3::one() * 1.02; + + next.arm_control_l.scale = Vec3::one() * 1.0; + next.arm_control_r.scale = Vec3::one() * 1.0; + + next.leg_control_l.scale = Vec3::one() * 1.0; + + next.leg_l.position = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + torso * 0.2, + ); + next.leg_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_l.scale = Vec3::one(); + + next.leg_r.position = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + torso * 0.2, + ); + next.leg_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_r.scale = Vec3::one(); + + next.foot_l.position = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); + next.foot_l.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_l.scale = Vec3::one(); + + next.foot_r.position = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); + next.foot_r.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_r.scale = Vec3::one(); + + next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; + next.torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one() / 8.0; + + next.leg_control_l.scale = Vec3::one() * 1.0; + next.leg_control_r.scale = Vec3::one() * 1.0; + next.arm_control_l.scale = Vec3::one() * 1.0; + next.arm_control_r.scale = Vec3::one() * 1.0; + + next.hold.scale = Vec3::one() * 0.0; + } else { + next.head.position = + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; + next.head.orientation = + Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05); + next.head.scale = Vec3::one() * 1.02; + + next.upper_torso.position = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + shortalt * -1.5, + ); + next.upper_torso.orientation = Quaternion::rotation_z(short * 0.18); + next.upper_torso.scale = Vec3::one(); + + next.lower_torso.position = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1, + ); + next.lower_torso.orientation = + Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14); + next.lower_torso.scale = Vec3::one() * 1.02; + + next.jaw.position = + Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); + next.jaw.orientation = Quaternion::rotation_x(0.0); + next.jaw.scale = Vec3::one() * 1.02; + + next.tail.position = + Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1); + next.tail.orientation = Quaternion::rotation_x(shortalt * 0.3); + next.tail.scale = Vec3::one(); + + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_x(PI) + * Quaternion::rotation_y(0.0) + * Quaternion::rotation_z(0.0); + next.second.scale = Vec3::one() * 0.0; + + next.control.position = Vec3::new(0.0, 0.0, 0.0); + next.control.orientation = Quaternion::rotation_z(0.0); + next.control.scale = Vec3::one(); + + next.main.position = Vec3::new(-5.0, -7.0, 7.0); + next.main.orientation = Quaternion::rotation_x(PI) + * Quaternion::rotation_y(0.6) + * Quaternion::rotation_z(1.57); + next.main.scale = Vec3::one() * 1.02; + + next.shoulder_l.position = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1 + foothoril * -3.0, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36) + * Quaternion::rotation_y(0.1) + * Quaternion::rotation_z(footrotl * 0.3); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.position = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1 + foothorir * -3.0, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36) + * Quaternion::rotation_y(-0.1) + * Quaternion::rotation_z(footrotr * -0.3); + next.shoulder_r.scale = Vec3::one(); + + next.hand_l.position = Vec3::new( + -1.0 + -skeleton_attr.hand.0, + skeleton_attr.hand.1 + foothoril * -4.0, + skeleton_attr.hand.2 + foothoril * 1.0, + ); + next.hand_l.orientation = + Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3)) + * Quaternion::rotation_y(handhoril * -0.1); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.position = Vec3::new( + 1.0 + skeleton_attr.hand.0, + skeleton_attr.hand.1 + foothorir * -4.0, + skeleton_attr.hand.2 + foothorir * 1.0, + ); + next.hand_r.orientation = + Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3)) + * Quaternion::rotation_y(handhorir * 0.1); + next.hand_r.scale = Vec3::one() * 1.02; + + next.leg_l.position = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 0.98; + next.leg_l.orientation = Quaternion::rotation_z(short * 0.18) + * Quaternion::rotation_x(foothoril * 0.3); + next.leg_l.scale = Vec3::one() * 0.98; + + next.leg_r.position = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 0.98; + + next.leg_r.orientation = Quaternion::rotation_z(short * 0.18) + * Quaternion::rotation_x(foothorir * 0.3); + next.leg_r.scale = Vec3::one() * 0.98; + + next.foot_l.position = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1 + foothoril * 8.5, + skeleton_attr.foot.2 + ((footvertl * 6.5).max(0.0)), + ); + next.foot_l.orientation = Quaternion::rotation_x(-0.5 + footrotl * 0.85) + * Quaternion::rotation_y(0.0); + next.foot_l.scale = Vec3::one(); + + next.foot_r.position = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1 + foothorir * 8.5, + skeleton_attr.foot.2 + ((footvertr * 6.5).max(0.0)), + ); + next.foot_r.orientation = Quaternion::rotation_x(-0.5 + footrotr * 0.85) + * Quaternion::rotation_y(0.0); + next.foot_r.scale = Vec3::one(); + + next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0; + next.torso.orientation = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25); + next.torso.scale = Vec3::one() / 8.0; + + next.leg_control_l.scale = Vec3::one() * 1.0; + next.leg_control_r.scale = Vec3::one() * 1.0; + next.arm_control_l.scale = Vec3::one() * 1.0; + next.arm_control_r.scale = Vec3::one() * 1.0; + + next.hold.scale = Vec3::one() * 0.0; + } + }, + _ => {}, + } + }; next } } diff --git a/voxygen/src/anim/src/character/wield.rs b/voxygen/src/anim/src/character/wield.rs index 68cbb04d45..d92e124a5e 100644 --- a/voxygen/src/anim/src/character/wield.rs +++ b/voxygen/src/anim/src/character/wield.rs @@ -128,7 +128,7 @@ impl Animation for WieldAnimation { next.hand_r.orientation = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); next.hand_r.scale = Vec3::one() * 1.05; - next.main.position = Vec3::new(0.0, 0.0, -3.0); + next.main.position = Vec3::new(0.0, 0.0, 2.0); next.main.orientation = Quaternion::rotation_x(-0.1); next.control.position = Vec3::new(-7.0, 7.0, 2.0); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 150e7496df..f1b454dbb7 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -2211,8 +2211,8 @@ impl FigureMgr { let target_base = match ( physics.on_ground, - vel.0.magnitude_squared() > MOVING_THRESHOLD_SQR, // Moving - physics.in_fluid.is_some(), // In water + vel.0.magnitude_squared() > 0.15, // Moving + physics.in_fluid.is_some(), // In water ) { // Standing (true, false, false) => anim::biped_large::IdleAnimation::update_skeleton(