cleanup 4

This commit is contained in:
jshipsey 2020-10-25 15:28:38 -04:00 committed by Robin Gilh
parent 14ec1b9f5f
commit f009492319
39 changed files with 159 additions and 830 deletions

View File

@ -273,7 +273,7 @@
color: None
),
Axe("BloodsteelAxe0"): (
vox_spec: ("weapon.axe.2haxe_bloodsteel-0", (-1.5, -5.0, -6.0)),
vox_spec: ("weapon.axe.2haxe_bloodsteel-0", (-1.5, -7.0, -4.0)),
color: None
),
Axe("BloodsteelAxe1"): (
@ -445,47 +445,47 @@
),
// Bows
Bow("ShortBow0"): (
vox_spec: ("weapon.bow.shortbow_starter", (-1.0, -6.0, 3.0)),
vox_spec: ("weapon.bow.shortbow_starter", (-0.5, -3.0, -8.5)),
color: None
),
Bow("WoodShortbow0"): (
vox_spec: ("weapon.bow.shortbow_wood-0", (-1.0, -6.0, 2.5)),
vox_spec: ("weapon.bow.shortbow_wood-0", (-0.5, -3.0, -9.5)),
color: None
),
Bow("WoodShortbow1"): (
vox_spec: ("weapon.bow.shortbow_wood-1", (-1.0, -6.5, 2.5)),
vox_spec: ("weapon.bow.shortbow_wood-1", (-0.5, -3.5, -9.5)),
color: None
),
Bow("LeafyShortbow0"): (
vox_spec: ("weapon.bow.shortbow_leafy-0", (-1.0, -8.0, 3.5)),
vox_spec: ("weapon.bow.shortbow_leafy-0", (-0.5, -4.5, -9.0)),
color: None
),
Bow("WoodLongbow0"): (
vox_spec: ("weapon.bow.longbow_wood-0", (-1.0, -6.0, -0.5)),
vox_spec: ("weapon.bow.longbow_wood-0", (-0.5, -3.5, -12.5)),
color: None
),
Bow("WoodLongbow1"): (
vox_spec: ("weapon.bow.longbow_wood-1", (-1.0, -6.0, 0.0)),
vox_spec: ("weapon.bow.longbow_wood-1", (-1.5, -3.5, -12.5)),
color: None
),
Bow("LeafyLongbow0"): (
vox_spec: ("weapon.bow.longbow_leafy-0", (-1.0, -8.0, -0.5)),
vox_spec: ("weapon.bow.longbow_leafy-0", (-1.5, -4.5, -12.5)),
color: None
),
Bow("HornLongbow0"): (
vox_spec: ("weapon.bow.longbow_horn-0", (-2.0, -6.0, -6.5)),
vox_spec: ("weapon.bow.longbow_horn-0", (-1.5, -4.5, -17.5)),
color: None
),
Bow("IronLongbow0"): (
vox_spec: ("weapon.bow.longbow_iron-0", (-2.0, -6.0, -5.5)),
vox_spec: ("weapon.bow.longbow_iron-0", (-1.5, -4.0, -16.0)),
color: None
),
Bow("RareLongbow"): (
vox_spec: ("weapon.bow.longbow_rare", (-2.0, -6.0, -2.5)),
vox_spec: ("weapon.bow.longbow_rare", (-1.5, -5.0, -13.5)),
color: None
),
Bow("NatureOreLongbow"): (
vox_spec: ("weapon.bow.longbow_ore_nature-0", (-2.0, -4.0, -4.5)),
vox_spec: ("weapon.bow.longbow_ore_nature-0", (-1.5, -4.0, -15.0)),
color: None
),
// Farming Equipment

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct AlphaAnimation;
@ -27,7 +24,7 @@ impl Animation for AlphaAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _velocity, global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _velocity, global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -188,13 +185,6 @@ impl Animation for AlphaAnimation {
},
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct BeamAnimation;
@ -27,7 +24,7 @@ impl Animation for BeamAnimation {
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -44,10 +41,8 @@ impl Animation for BeamAnimation {
next.hand_l.position = Vec3::new(0.0, 0.0, -4.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.position = Vec3::new(0.0, 0.0, 2.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.hand_r.scale = Vec3::one() * 1.04;
next.main.position = Vec3::new(0.0, 8.0, 13.2);
next.main.orientation = Quaternion::rotation_y(PI);
@ -115,14 +110,6 @@ impl Animation for BeamAnimation {
},
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct DashAnimation;
@ -126,14 +123,6 @@ impl Animation for DashAnimation {
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -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;
pub struct EquipAnimation;
@ -18,23 +18,18 @@ impl Animation for EquipAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
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,
_s_a: &SkeletonAttr,
) -> Self::Skeleton {
*rate = 1.0;
let mut next = (*skeleton).clone();
let lab = 1.0;
let equip_slow = 1.0 + (anim_time as f32 * 12.0 + PI).cos();
let equip_slowa = 1.0 + (anim_time as f32 * 12.0 + PI / 4.0).cos();
next.hand_l.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-2.3)
* Quaternion::rotation_z(-1.57);
next.hand_r.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-2.3)
* Quaternion::rotation_z(1.57);
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(-1.57);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
match active_tool_kind {
@ -60,15 +55,6 @@ impl Animation for EquipAnimation {
},
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -57,21 +57,25 @@ impl Animation for IdleAnimation {
0.0
};
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2) * 1.02;
next.jaw.scale = Vec3::one() * 1.02;
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.scale = Vec3::one() * 1.1;
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.scale = Vec3::one() * 1.04;
next.hold.scale = Vec3::one() * 0.0;
next.torso.scale = Vec3::one() / 8.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2);
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, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
next.upper_torso.orientation = Quaternion::rotation_x(-breathe);
next.upper_torso.scale = Vec3::one() - breathe * 0.4;
next.lower_torso.position =
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
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.lower_torso.orientation = Quaternion::rotation_x(breathe);
if s_a.beast {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
@ -79,7 +83,6 @@ impl Animation for IdleAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
}
next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0);
next.jaw.scale = Vec3::one() * 1.02;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation =
@ -91,32 +94,23 @@ impl Animation for IdleAnimation {
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation = Quaternion::rotation_x(breathe);
next.shoulder_l.scale = Vec3::one() + breathe;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(breathe);
next.shoulder_r.scale = Vec3::one() + breathe;
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
next.hand_r.scale = Vec3::one() * 1.04;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
next.leg_l.scale = Vec3::one() * 1.02;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
next.leg_r.scale = Vec3::one() * 1.02;
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.scale = Vec3::one() / 8.0;
next.hold.scale = Vec3::one() * 0.0;
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct LeapAnimation;
@ -26,7 +23,7 @@ impl Animation for LeapAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -88,15 +85,9 @@ impl Animation for LeapAnimation {
next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7);
} else if let Some(ToolKind::Axe(_)) = active_tool_kind {
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.04;
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
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.04;
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
next.main.position = Vec3::new(-0.0, -2.0, -1.0);
next.main.orientation = Quaternion::rotation_x(0.0);
@ -119,8 +110,7 @@ impl Animation for LeapAnimation {
next.torso.orientation = Quaternion::rotation_x(
-0.3 + movement2 * -1.8 * PI + movement3 * -0.2 * PI + movement4 * -0.1 * PI,
) * Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
);
next.head.orientation =
Quaternion::rotation_x(0.0 + movement1 * -0.4 + movement2 * 0.4 + movement3 * 0.2);
@ -148,14 +138,6 @@ impl Animation for LeapAnimation {
next.torso.position = Vec3::new(0.0, 0.0, 0.0 + 8.0);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -3,6 +3,7 @@ pub mod beam;
pub mod beta;
pub mod charge;
pub mod dash;
pub mod equip;
pub mod idle;
pub mod jump;
pub mod leapmelee;
@ -12,14 +13,14 @@ pub mod shoot;
pub mod spin;
pub mod spinmelee;
pub mod wield;
pub mod equip;
// Reexports
pub use self::{
alpha::AlphaAnimation, beam::BeamAnimation, beta::BetaAnimation, charge::ChargeAnimation,
dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapAnimation,
run::RunAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, spin::SpinAnimation,
spinmelee::SpinMeleeAnimation, wield::WieldAnimation, equip::EquipAnimation,
dash::DashAnimation, equip::EquipAnimation, idle::IdleAnimation, jump::JumpAnimation,
leapmelee::LeapAnimation, run::RunAnimation, shockwave::ShockwaveAnimation,
shoot::ShootAnimation, spin::SpinAnimation, spinmelee::SpinMeleeAnimation,
wield::WieldAnimation,
};
use super::{make_bone, vek::*, FigureBoneData, Skeleton};

View File

@ -127,6 +127,12 @@ impl Animation for RunAnimation {
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude());
next.jaw.scale = Vec3::one() * 1.02;
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.scale = Vec3::one() * 1.1;
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.scale = Vec3::one() * 1.04;
next.hold.scale = Vec3::one() * 0.0;
next.torso.scale = Vec3::one() / 8.0;
if s_a.beast {
@ -139,7 +145,6 @@ impl Animation for RunAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.jaw.orientation = Quaternion::rotation_x(0.0);
next.jaw.scale = Vec3::one() * 1.02;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation =
@ -183,10 +188,8 @@ impl Animation for RunAnimation {
* Quaternion::rotation_y(tilt * 1.5);
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.scale = Vec3::one() * 1.1;
next.hand_l.position = Vec3::new(
-s_a.hand.0,
@ -196,7 +199,6 @@ impl Animation for RunAnimation {
next.hand_l.orientation =
Quaternion::rotation_x(amplitude2 * foot1b * 0.9 + canceler * 0.9)
* Quaternion::rotation_y(tilt * -1.0);
next.hand_l.scale = Vec3::one() * 0.96;
next.hand_r.position = Vec3::new(
s_a.hand.0,
@ -206,7 +208,6 @@ impl Animation for RunAnimation {
next.hand_r.orientation =
Quaternion::rotation_x(amplitude2 * foot2b * 0.9 + canceler * 0.7)
* Quaternion::rotation_y(tilt * -1.0);
next.hand_r.scale = Vec3::one() * 0.96;
next.leg_control_l.position = Vec3::new(
0.0,
@ -217,7 +218,6 @@ impl Animation for RunAnimation {
Quaternion::rotation_x(canceler * -0.4 + amplitude3 * foot3b * 0.4 + 0.5)
* Quaternion::rotation_y(tilt * 1.5)
* Quaternion::rotation_z(tilt * -1.5);
next.leg_control_l.scale = Vec3::one() * 1.02;
next.leg_control_r.position = Vec3::new(
0.0,
@ -228,8 +228,6 @@ impl Animation for RunAnimation {
Quaternion::rotation_x(canceler * -0.4 + amplitude3 * foot4b * 0.4 + 0.5)
* Quaternion::rotation_y(tilt * 1.5)
* Quaternion::rotation_z(tilt * -1.5);
next.leg_control_r.scale = Vec3::one() * 1.02;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
@ -241,7 +239,6 @@ impl Animation for RunAnimation {
);
next.foot_l.orientation = Quaternion::rotation_x(amplitude2 * foot3b * 0.45 + 0.5)
* Quaternion::rotation_y(tilt * -1.0);
next.foot_l.scale = Vec3::one() * 0.96;
next.foot_r.position = Vec3::new(
s_a.foot.0,
@ -250,7 +247,6 @@ impl Animation for RunAnimation {
);
next.foot_r.orientation = Quaternion::rotation_x(amplitude2 * foot4b * 0.45 + 0.5)
* Quaternion::rotation_y(tilt * -1.0);
next.foot_r.scale = Vec3::one() * 0.96;
next.torso.position = Vec3::new(
0.0,
@ -259,13 +255,10 @@ impl Animation for RunAnimation {
) / 8.0;
next.torso.orientation =
Quaternion::rotation_x(x_tilt + amplitude * short * 0.1 + speedavg * -0.045);
next.hold.scale = Vec3::one() * 0.0;
} else {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.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, s_a.upper_torso.0, s_a.upper_torso.1 + shortalt * -1.5);
@ -277,7 +270,6 @@ impl Animation for RunAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.jaw.orientation = Quaternion::rotation_x(0.0);
next.jaw.scale = Vec3::one() * 1.02;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation = Quaternion::rotation_x(shortalt * 0.3);
@ -286,10 +278,6 @@ impl Animation for RunAnimation {
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.main.position = Vec3::new(-5.0, -7.0, 7.0);
next.main.orientation = Quaternion::rotation_x(PI)
@ -321,7 +309,6 @@ impl Animation for RunAnimation {
);
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.04;
next.hand_r.position = Vec3::new(
1.0 + s_a.hand.0,
@ -330,18 +317,15 @@ impl Animation for RunAnimation {
);
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.04;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.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(s_a.leg.0, s_a.leg.1, s_a.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(
-s_a.foot.0,
@ -360,9 +344,7 @@ impl Animation for RunAnimation {
Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0);
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.hold.scale = Vec3::one() * 0.0;
next.torso.orientation = Quaternion::rotation_x(-0.25);
}
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct ShockwaveAnimation;
@ -27,7 +24,7 @@ impl Animation for ShockwaveAnimation {
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
(_active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -104,14 +101,6 @@ impl Animation for ShockwaveAnimation {
next.foot_r.orientation = Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
* Quaternion::rotation_z(movement1 * 0.4 + movement2 * -0.4);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -92,13 +92,10 @@ impl Animation for ShootAnimation {
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();
next.hold.scale = Vec3::one() * 0.0;
if velocity < 0.5 {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.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, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5);
@ -109,11 +106,9 @@ impl Animation for ShootAnimation {
Vec3::new(0.0, s_a.lower_torso.0, s_a.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, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
next.jaw.scale = Vec3::one() * 1.02;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation =
@ -128,11 +123,9 @@ impl Animation for ShootAnimation {
next.leg_l.position =
Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.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(s_a.leg.0, s_a.leg.1, s_a.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(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_z(0.0);
@ -142,7 +135,6 @@ impl Animation for ShootAnimation {
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.control.position = Vec3::new(7.0, 9.0, -10.0);
next.control.orientation = Quaternion::rotation_x(test * 0.02)
@ -152,7 +144,6 @@ impl Animation for ShootAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.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, s_a.upper_torso.0, s_a.upper_torso.1 + shortalt * -1.5);
@ -161,13 +152,10 @@ impl Animation for ShootAnimation {
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.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, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
next.jaw.scale = Vec3::one() * 1.02;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation =
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0);
@ -191,34 +179,26 @@ impl Animation for ShootAnimation {
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_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.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(s_a.leg.0, s_a.leg.1, s_a.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(
-s_a.foot.0,
4.0 + s_a.foot.1 + foothoril * 8.5,
s_a.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.orientation = Quaternion::rotation_x(-0.5 + footrotl * 0.85);
next.foot_r.position = Vec3::new(
s_a.foot.0,
4.0 + s_a.foot.1 + foothorir * 8.5,
s_a.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.orientation = Quaternion::rotation_x(-0.5 + footrotr * 0.85);
}
match active_tool_kind {
Some(ToolKind::Bow(_)) => {
@ -227,13 +207,11 @@ impl Animation for ShootAnimation {
next.hand_l.orientation = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6 + exp * 0.8)
* Quaternion::rotation_z(-0.3 + exp * 0.9);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.position = Vec3::new(4.9, 3.0, -4.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.04;
next.shoulder_l.position = Vec3::new(
-s_a.shoulder.0,
@ -262,20 +240,16 @@ impl Animation for ShootAnimation {
* Quaternion::rotation_z(-0.6);
next.control.position = Vec3::new(6.0, 6.0, 8.0);
next.control.orientation = Quaternion::rotation_x(exp * 0.4)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.control.orientation = Quaternion::rotation_x(exp * 0.4);
},
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.04;
next.hand_r.position = Vec3::new(12.0, 5.5, 2.0);
next.hand_r.orientation =
Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.hand_r.scale = Vec3::one() * 1.04;
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
@ -292,14 +266,11 @@ impl Animation for ShootAnimation {
next.jaw.orientation = Quaternion::rotation_x(-0.2);
next.main.position = Vec3::new(10.0, 12.5, 13.2);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(PI)
* Quaternion::rotation_z(0.0);
next.main.orientation = Quaternion::rotation_y(PI);
next.control.position = Vec3::new(-7.0, 6.0, 6.0 - exp * 5.0);
next.control.orientation = Quaternion::rotation_x(exp * 1.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(exp * 1.5);
next.control.orientation =
Quaternion::rotation_x(exp * 1.3) * Quaternion::rotation_z(exp * 1.5);
},
_ => {},
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct SpinAnimation;
@ -25,7 +22,7 @@ impl Animation for SpinAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_spin")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -62,10 +59,8 @@ impl Animation for SpinAnimation {
if let Some(ToolKind::Sword(_)) = active_tool_kind {
next.hand_l.position = Vec3::new(-4.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.04;
next.hand_r.position = Vec3::new(0.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.04;
next.main.position = Vec3::new(0.0, 5.0, -6.0);
next.main.orientation = Quaternion::rotation_x(-0.1)
* Quaternion::rotation_y(0.0)
@ -110,14 +105,10 @@ impl Animation for SpinAnimation {
{
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
next.hand_l.orientation = Quaternion::rotation_x(1.27);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
next.hand_r.orientation = Quaternion::rotation_x(1.27);
next.hand_r.scale = Vec3::one() * 1.04;
next.main.position = Vec3::new(0.0, 6.0, -1.0);
next.main.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.main.orientation = Quaternion::rotation_x(-0.3);
next.control.position = Vec3::new(-4.5 + spinhalf * 4.0, 11.0, 8.0);
next.control.orientation = Quaternion::rotation_x(-1.7)
@ -129,15 +120,10 @@ impl Animation for SpinAnimation {
* Quaternion::rotation_y(spin * -0.2);
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
next.upper_torso.orientation = Quaternion::rotation_z(spin * 0.1)
* Quaternion::rotation_x(0.0 + spin * 0.1)
* Quaternion::rotation_x(spin * 0.1)
* Quaternion::rotation_y(decel * -0.2);
next.lower_torso.position = Vec3::new(0.0, 0.0, -5.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
next.torso.orientation = Quaternion::rotation_z((spin * 7.0).max(0.3))
* Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.0);
next.torso.scale = Vec3::one() / 11.0 * 1.01;
next.torso.orientation = Quaternion::rotation_z((spin * 7.0).max(0.3));
next.foot_l.position = Vec3::new(-s_a.foot.0, foot * 1.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(foot * -1.2);
@ -145,22 +131,10 @@ impl Animation for SpinAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, foot * -1.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(foot * 1.2);
next.shoulder_l.position = Vec3::new(-5.0, 0.0, 4.7);
next.shoulder_l.orientation = Quaternion::rotation_x(0.0);
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.position = Vec3::new(5.0, 0.0, 4.7);
next.shoulder_r.orientation = Quaternion::rotation_x(0.0);
next.shoulder_r.scale = Vec3::one() * 1.1;
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
BipedLargeSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct SpinMeleeAnimation;
@ -27,7 +24,7 @@ impl Animation for SpinMeleeAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -117,7 +114,6 @@ impl Animation for SpinMeleeAnimation {
0.0,
) * 1.01;
next.torso.orientation = Quaternion::rotation_z(spin * -16.0);
next.torso.scale = Vec3::one() / 11.0 * 1.01;
if velocity.z.abs() > 0.1 {
next.foot_l.position = Vec3::new(-s_a.foot.0, 8.0, s_a.foot.2 + 2.0);
next.foot_l.orientation = Quaternion::rotation_x(1.0);
@ -141,15 +137,6 @@ impl Animation for SpinMeleeAnimation {
},
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -122,12 +122,6 @@ impl Animation for WieldAnimation {
next.hand_r.position = Vec3::new(s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.scale = Vec3::one() * 1.04;
next.jaw.scale = Vec3::one() * 1.02;
next.torso.scale = Vec3::one() / 8.0;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.control.position = Vec3::new(7.0, 9.0, -10.0);
next.control.orientation = Quaternion::rotation_x(test * 0.02)
@ -180,11 +174,13 @@ impl Animation for WieldAnimation {
next.head.orientation =
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
next.upper_torso.orientation =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
next.lower_torso.position =
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
next.lower_torso.orientation =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one() * 1.02;
@ -248,17 +244,13 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_z(u_slowalt * 0.1);
},
Some(ToolKind::Hammer(_)) => {
next.hand_l.position =
Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
next.hand_l.orientation =
Quaternion::rotation_x(s_a.hhl.3)
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
* Quaternion::rotation_y(s_a.hhl.4)
* Quaternion::rotation_z(s_a.hhl.5);
next.hand_r.position =
Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
next.hand_r.orientation =
Quaternion::rotation_x(s_a.hhr.3)
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
* Quaternion::rotation_y(s_a.hhr.4)
* Quaternion::rotation_z(s_a.hhr.5);
@ -276,7 +268,7 @@ impl Animation for WieldAnimation {
Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
next.hand_r.orientation =
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
next.shoulder_r.position =
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct AlphaAnimation;
@ -27,7 +24,7 @@ impl Animation for AlphaAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -60,15 +57,13 @@ impl Animation for AlphaAnimation {
/ (0.05 + 0.95 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.0).sin());
let staff = (((1.0)
/ (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());
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0);
match active_tool_kind {
Some(ToolKind::Sword(_)) => {
next.main.position = Vec3::new(0.0, 0.0, 0.0);
@ -112,78 +107,53 @@ impl Animation for AlphaAnimation {
next.head.orientation = Quaternion::rotation_z(0.1 + axe * 0.2)
* Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.2);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, 0.0, 7.0);
next.chest.orientation = Quaternion::rotation_z(0.2 + axe * 0.2);
next.belt.position = Vec3::new(0.0, 0.0, -2.0);
next.belt.orientation = Quaternion::rotation_z(0.2 + axe * -0.1);
next.shorts.position = Vec3::new(0.0, 0.0, -5.0);
next.shorts.orientation = Quaternion::rotation_z(0.2 + axe * -0.2);
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.04;
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
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.04;
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
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.main.orientation = Quaternion::rotation_x(0.0);
next.control.position = Vec3::new(2.0 + axe * -7.0, 11.0, 3.0);
next.control.orientation = Quaternion::rotation_x(1.6)
* Quaternion::rotation_y(-2.0 + axe * 0.5)
* Quaternion::rotation_z(PI * 0.4);
next.lantern.orientation =
Quaternion::rotation_x(0.4) * Quaternion::rotation_y(0.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.lantern.orientation = Quaternion::rotation_x(0.4);
},
Some(ToolKind::Hammer(_)) => {
next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0);
next.hand_l.orientation =
Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
next.hand_l.scale = Vec3::one() * 1.04;
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);
next.hand_r.scale = Vec3::one() * 1.04;
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);
next.main.orientation =
Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z(slower * 0.03)
* Quaternion::rotation_x(slowersmooth * 0.1)
* Quaternion::rotation_y(slower * 0.05 + slowersmooth * 0.06)
* Quaternion::rotation_z((slowersmooth * -0.4).max(0.0));
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, 0.0, 7.0);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.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);
next.belt.position = Vec3::new(0.0, 0.0, -2.0);
next.belt.orientation =
Quaternion::rotation_z(slower * -0.1 + slowersmooth * -0.075)
* Quaternion::rotation_x(0.0 + slower * -0.1)
* Quaternion::rotation_y(slower * -0.1);
next.shorts.position = Vec3::new(0.0, 0.0, -5.0);
next.shorts.orientation =
Quaternion::rotation_z(slower * -0.1 + slowersmooth * -0.075)
* Quaternion::rotation_x(0.0 + slower * -0.1)
@ -192,10 +162,6 @@ impl Animation for AlphaAnimation {
next.lantern.orientation = Quaternion::rotation_x(slower * -0.7 + 0.4)
* Quaternion::rotation_y(slower * 0.4);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
if velocity > 0.5 {
next.foot_l.position = Vec3::new(-s_a.foot.0, foot * -6.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(foot * -0.4)
@ -204,10 +170,7 @@ impl Animation for AlphaAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, foot * 6.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(foot * 0.4)
* Quaternion::rotation_z((slower * 0.3).max(0.0));
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.15);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.torso.orientation = Quaternion::rotation_x(-0.15);
} else {
next.foot_l.position =
Vec3::new(-s_a.foot.0, -2.5, s_a.foot.2 + (slower * 2.5).max(0.0));
@ -217,75 +180,21 @@ impl Animation for AlphaAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, 3.5 - slower * 2.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(slower * 0.1)
* Quaternion::rotation_z((slower * 0.5).max(0.0));
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
}
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.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
},
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.head.orientation =
Quaternion::rotation_x(staff * 0.2) * Quaternion::rotation_z(staff * 0.2);
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.04;
next.hand_r.position = Vec3::new(12.0, 5.5, 2.0);
next.hand_r.orientation =
Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
next.hand_r.scale = Vec3::one() * 1.04;
next.main.position = Vec3::new(12.0, 8.5, 13.2);
next.main.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(3.14)
* Quaternion::rotation_z(0.0);
next.chest.orientation = Quaternion::rotation_z(staff * 0.3);
next.belt.orientation = Quaternion::rotation_z(staff * 0.2);
next.shorts.orientation = Quaternion::rotation_z(staff * 0.4);
next.control.position = Vec3::new(-20.0, 5.0 + staff * 3.0, 1.0);
next.control.orientation = Quaternion::rotation_x(staff * 1.2)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
},
Some(ToolKind::Debug(_)) => {
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
next.hand_l.orientation = Quaternion::rotation_x(1.27)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_l.orientation = Quaternion::rotation_x(1.27);
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
next.main.orientation = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(PI)
* Quaternion::rotation_y(0.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.main.orientation = Quaternion::rotation_x(PI);
},
_ => {},
}
next.lantern.scale = Vec3::one() * 0.65;
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.scale = Vec3::one() * 1.1;
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct BeamAnimation;
@ -27,7 +24,7 @@ impl Animation for BeamAnimation {
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -117,13 +114,6 @@ impl Animation for BeamAnimation {
},
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
pub struct BetaAnimation;
@ -25,7 +22,7 @@ impl Animation for BetaAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_beta")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -76,14 +73,6 @@ impl Animation for BetaAnimation {
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,8 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::ops::Mul;
use common::comp::item::ToolKind;
pub struct BlockAnimation;
@ -17,34 +16,15 @@ impl Animation for BlockAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_block")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, global_time): Self::Dependency,
anim_time: f64,
(active_tool_kind, _second_tool_kind, _global_time): Self::Dependency,
_anim_time: f64,
_rate: &mut f32,
s_a: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let _head_look = Vec2::new(
((global_time + anim_time) as f32 / 1.5)
.floor()
.mul(7331.0)
.sin()
* 0.3,
((global_time + anim_time) as f32 / 1.5)
.floor()
.mul(1337.0)
.sin()
* 0.15,
);
next.head.position = Vec3::new(0.0, -1.0 + s_a.head.0, s_a.head.1 + 19.5);
next.head.orientation = Quaternion::rotation_x(-0.25);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.belt.position = Vec3::new(0.0, s_a.belt.0, s_a.belt.1);
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
match active_tool_kind {
Some(ToolKind::Shield(_)) => {
@ -60,23 +40,8 @@ impl Animation for BlockAnimation {
_ => {},
}
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;
next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2);
next.lantern.scale = Vec3::one() * 0.65;
next.hold.scale = Vec3::one() * 0.0;
next.torso.position = Vec3::new(0.0, -0.2, 0.1) * s_a.scaler;
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,8 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::f32::consts::PI;
use common::comp::item::ToolKind;
pub struct ChargeAnimation;
@ -26,7 +25,7 @@ impl Animation for ChargeAnimation {
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency,
(active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -53,12 +52,6 @@ impl Animation for ChargeAnimation {
/ (3.5 + 1.5 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.0).sin());
let quicka = (((5.0)
/ (3.5
+ 1.5
* ((anim_time as f32 * lab as f32 * 8.0 + PI / 2.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.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);
@ -169,14 +162,6 @@ impl Animation for ChargeAnimation {
Quaternion::rotation_x(stop * 0.1) * Quaternion::rotation_z(stop * 0.1);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct ChargeswingAnimation;
@ -26,7 +23,7 @@ impl Animation for ChargeswingAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -155,14 +152,6 @@ impl Animation for ChargeswingAnimation {
}
}
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct ClimbAnimation;
@ -23,7 +23,7 @@ impl Animation for ClimbAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_climb")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _orientation, global_time): Self::Dependency,
(_active_tool_kind, _second_tool_kind, velocity, _orientation, global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -164,20 +164,9 @@ impl Animation for ClimbAnimation {
next.foot_r.orientation =
Quaternion::rotation_x(0.2 + smooth * 0.15 * (1.0 - stagnant));
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;
next.torso.position = Vec3::new(0.0, -0.2, 0.4) * s_a.scaler;
};
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct DanceAnimation;
@ -17,7 +17,7 @@ impl Animation for DanceAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_dance")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, global_time): Self::Dependency,
(_active_tool_kind, _second_tool_kind, global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -59,7 +59,6 @@ impl Animation for DanceAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z(short * -0.6)
* Quaternion::rotation_x(0.2 + head_look.y.max(0.0) + shorte.abs() * -0.2);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + shortealt * 1.5);
next.chest.orientation = Quaternion::rotation_z(short * 0.35)
@ -72,7 +71,6 @@ impl Animation for DanceAnimation {
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
next.back.orientation =
Quaternion::rotation_x(-0.25 + shorte * 0.1 + noisea * 0.1 + noiseb * 0.1);
next.back.scale = Vec3::one() * 1.02;
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
next.shorts.orientation = Quaternion::rotation_z(foot * 0.35);
@ -111,70 +109,15 @@ impl Animation for DanceAnimation {
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation = Quaternion::rotation_x(shorte * 0.15);
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(shorte * -0.15);
next.shoulder_r.scale = Vec3::one() * 1.1;
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;
match active_tool_kind {
Some(ToolKind::Dagger(_)) => {
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
next.main.orientation =
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
Some(ToolKind::Shield(_)) => {
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
next.main.orientation =
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
}
match second_tool_kind {
Some(ToolKind::Dagger(_)) => {
next.second.position = Vec3::new(4.0, -6.0, 7.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
},
Some(ToolKind::Shield(_)) => {
next.second.position = Vec3::new(0.0, -4.0, 3.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
}
next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2);
next.lantern.orientation =
Quaternion::rotation_x(shorte * 0.7 + 0.4) * Quaternion::rotation_y(shorte * 0.4);
next.lantern.scale = Vec3::one() * 0.65;
next.hold.scale = Vec3::one() * 0.0;
next.torso.position = Vec3::new(0.0, -0.3, 0.0) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(short * -0.2);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.control.position = Vec3::new(0.0, 0.0, 0.0);
next.control.orientation = Quaternion::rotation_x(0.0);
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct Input {
@ -139,16 +136,6 @@ impl Animation for DashAnimation {
next.lantern.orientation = Quaternion::rotation_x(slow(anim_time as f32) * -0.7 + 0.4)
* Quaternion::rotation_y(slow(anim_time as f32) * 0.4);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::f32::consts::PI;
pub struct EquipAnimation;
@ -18,23 +18,17 @@ impl Animation for EquipAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
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,
_s_a: &SkeletonAttr,
) -> Self::Skeleton {
*rate = 1.0;
let mut next = (*skeleton).clone();
let lab = 1.0;
let equip_slow = 1.0 + (anim_time as f32 * 12.0 + PI).cos();
let equip_slowa = 1.0 + (anim_time as f32 * 12.0 + PI / 4.0).cos();
next.hand_l.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-2.3)
* Quaternion::rotation_z(-1.57);
next.hand_r.orientation = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-2.3)
* Quaternion::rotation_z(1.57);
next.hand_l.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.hand_r.orientation = Quaternion::rotation_y(-2.3) * Quaternion::rotation_z(1.57);
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
match active_tool_kind {
@ -61,14 +55,6 @@ impl Animation for EquipAnimation {
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,8 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use std::f32::consts::PI;
use common::comp::item::ToolKind;
pub struct GlideWieldAnimation;
@ -27,8 +26,8 @@ impl Animation for GlideWieldAnimation {
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _orientation, _last_ori, _global_time): Self::Dependency,
anim_time: f64,
(_active_tool_kind, _second_tool_kind, velocity, _orientation, _last_ori, _global_time): Self::Dependency,
_anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
) -> Self::Skeleton {
@ -36,57 +35,21 @@ impl Animation for GlideWieldAnimation {
let speed = Vec2::<f32>::from(velocity).magnitude();
*rate = 1.0;
let lab = 1.0;
let shorte = (((5.0)
/ (4.0 + 1.0 * ((anim_time as f32 * lab as f32 * 16.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 16.0).sin());
next.hand_l.position = Vec3::new(-2.0 - s_a.hand.0, s_a.hand.1, s_a.hand.2 + 15.0);
next.hand_l.orientation = Quaternion::rotation_x(3.35);
next.hand_r.position = Vec3::new(2.0 + s_a.hand.0, s_a.hand.1, s_a.hand.2 + 15.0);
next.hand_r.orientation = Quaternion::rotation_x(3.35);
next.glider.scale = Vec3::one() * 1.0;
if speed > 0.5 {
next.glider.orientation = Quaternion::rotation_x(0.8);
next.glider.position = Vec3::new(0.0, -10.0, 15.0);
next.glider.scale = Vec3::one() * 1.0;
match second_tool_kind {
Some(ToolKind::Dagger(_)) => {
next.second.position = Vec3::new(4.0, -6.0, 7.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
},
Some(ToolKind::Shield(_)) => {
next.second.position = Vec3::new(0.0, -4.0, 3.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
}
next.lantern.orientation =
Quaternion::rotation_x(shorte * 0.7 + 0.4) * Quaternion::rotation_y(shorte * 0.4);
} else {
next.glider.orientation = Quaternion::rotation_x(0.35);
next.glider.position = Vec3::new(0.0, -9.0, 17.0);
next.glider.scale = Vec3::one() * 1.0;
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct GlidingAnimation;
@ -27,7 +27,7 @@ impl Animation for GlidingAnimation {
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency,
(_active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency,
anim_time: f64,
_rate: &mut f32,
s_a: &SkeletonAttr,
@ -118,14 +118,6 @@ impl Animation for GlidingAnimation {
next.torso.orientation = Quaternion::rotation_x(-0.06 * speed.max(12.0) + slow * 0.04)
* Quaternion::rotation_y(tilt * tiltcancel * 32.0);
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -54,11 +54,14 @@ impl Animation for JumpAnimation {
} else {
0.0
} * 1.3;
next.head.scale = Vec3::one() * s_a.head_scale;
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.scale = Vec3::one() * 1.1;
next.back.scale = Vec3::one() * 1.02;
next.head.position = Vec3::new(0.0, -1.0 + s_a.head.0, -1.0 + s_a.head.1);
next.head.orientation =
Quaternion::rotation_x(0.25 + slow * 0.04) * Quaternion::rotation_z(tilt * -2.5);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + 1.0);
next.chest.orientation = Quaternion::rotation_z(tilt * -2.0);
@ -68,7 +71,6 @@ impl Animation for JumpAnimation {
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
next.back.orientation = Quaternion::rotation_z(0.0);
next.back.scale = Vec3::one() * 1.02;
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
next.shorts.orientation = Quaternion::rotation_z(tilt * 3.0);
@ -116,11 +118,9 @@ impl Animation for JumpAnimation {
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation = Quaternion::rotation_x(0.4 * switch);
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(-0.4 * switch);
next.shoulder_r.scale = Vec3::one() * 1.1;
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;
@ -140,6 +140,10 @@ impl Animation for JumpAnimation {
next.main.position = Vec3::new(2.0, -5.0, -1.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57);
},
Some(ToolKind::Bow(_)) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
@ -157,10 +161,7 @@ impl Animation for JumpAnimation {
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
Some(ToolKind::Bow(_)) => {
next.main.position = Vec3::new(0.0, -5.0, 6.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct LeapAnimation;
@ -26,7 +23,7 @@ impl Animation for LeapAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -88,17 +85,11 @@ impl Animation for LeapAnimation {
next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7);
} else if let Some(ToolKind::Axe(_)) = active_tool_kind {
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.orientation = Quaternion::rotation_x(PI / 2.0);
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.orientation = Quaternion::rotation_x(PI / 2.0);
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.main.orientation = Quaternion::rotation_x(0.0);
next.control.position = Vec3::new(-3.0, 11.0, 3.0);
next.control.orientation = Quaternion::rotation_x(1.8)
@ -145,17 +136,8 @@ impl Animation for LeapAnimation {
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.3 + movement2 * 0.1);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - 8.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.0 + 8.0) * s_a.scaler / 11.0;
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
pub struct RepeaterAnimation;
impl Animation for RepeaterAnimation {
@ -25,7 +22,7 @@ impl Animation for RepeaterAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -114,14 +111,6 @@ impl Animation for RepeaterAnimation {
* Quaternion::rotation_z(-0.3);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
pub struct RollAnimation;
@ -23,7 +23,7 @@ impl Animation for RollAnimation {
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, orientation, last_ori, _global_time): Self::Dependency,
(_active_tool_kind, _second_tool_kind, orientation, last_ori, _global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -48,7 +48,6 @@ impl Animation for RollAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0 + 3.0, s_a.head.1 - 1.0);
next.head.orientation = Quaternion::rotation_x(-0.75);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0, -9.5 + s_a.chest.1);
next.chest.orientation = Quaternion::rotation_x(-0.2);
@ -74,21 +73,9 @@ impl Animation for RollAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + 5.5, s_a.foot.2 - 5.0);
next.foot_r.orientation = Quaternion::rotation_x(0.9);
next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1);
next.lantern.scale = Vec3::one() * 0.65;
next.torso.position = Vec3::new(0.0, 0.0, 8.0) / 11.0 * s_a.scaler;
next.torso.orientation =
Quaternion::rotation_x(spin * -10.0) * Quaternion::rotation_z(tilt * -10.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct Input {
@ -30,7 +27,7 @@ impl Animation for ShockwaveAnimation {
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
(_active_tool_kind, _second_tool_kind, _global_time, velocity, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -55,9 +52,7 @@ impl Animation for ShockwaveAnimation {
next.main.orientation = Quaternion::rotation_y(PI);
next.control.position = Vec3::new(-4.0, 7.0, 4.0);
next.control.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.15)
* Quaternion::rotation_z(0.0);
next.control.orientation = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.15);
let twist = movement1 * 0.8;
@ -107,14 +102,6 @@ impl Animation for ShockwaveAnimation {
next.foot_r.orientation = Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3)
* Quaternion::rotation_z(movement1 * 0.4 + movement2 * -0.4);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
pub struct ShootAnimation;
@ -17,7 +17,7 @@ impl Animation for ShootAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
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,
s_a: &SkeletonAttr,
@ -42,7 +42,6 @@ impl Animation for ShootAnimation {
next.head.orientation = Quaternion::rotation_z(exp * -0.4)
* Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(exp * 0.1);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0 - exp * 1.5, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_z(0.4 + exp * 1.0)
@ -121,23 +120,12 @@ impl Animation for ShootAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, 3.5 - exp * 2.0, s_a.foot.2);
next.foot_r.orientation =
Quaternion::rotation_x(exp * 0.1) * Quaternion::rotation_z(exp * 0.5);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.orientation = Quaternion::rotation_z(0.0);
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
}
next.back.orientation = Quaternion::rotation_x(-0.3);
next.lantern.orientation =
Quaternion::rotation_x(exp * -0.7 + 0.4) * Quaternion::rotation_y(exp * 0.4);
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct SitAnimation;
@ -17,7 +17,7 @@ impl Animation for SitAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_sit")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, global_time): Self::Dependency,
(_active_tool_kind, _second_tool_kind, global_time): Self::Dependency,
anim_time: f64,
_rate: &mut f32,
s_a: &SkeletonAttr,
@ -27,7 +27,6 @@ impl Animation for SitAnimation {
let slow = (anim_time as f32 * 1.0).sin();
let slowa = (anim_time as f32 * 1.0 + PI / 2.0).sin();
let stop = (anim_time as f32 * 3.0).min(PI / 2.0).sin();
let slow_abs = ((anim_time as f32 * 0.3).sin()) + 1.0;
let head_look = Vec2::new(
((global_time + anim_time) as f32 / 18.0)
@ -44,7 +43,6 @@ impl Animation for SitAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * 0.1 + stop * -0.8);
next.head.orientation = Quaternion::rotation_z(head_look.x + slow * 0.2 - slow * 0.1)
* Quaternion::rotation_x((slowa * -0.1 + slow * 0.1 + head_look.y).abs());
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(
0.0,
@ -52,11 +50,9 @@ impl Animation for SitAnimation {
s_a.chest.1 + slow * 0.1 + stop * -0.8,
);
next.chest.orientation = Quaternion::rotation_x(stop * 0.15);
next.chest.scale = Vec3::one() + slow_abs * 0.05;
next.belt.position = Vec3::new(0.0, s_a.belt.0 + stop * 1.2, s_a.belt.1);
next.belt.orientation = Quaternion::rotation_x(stop * 0.3);
next.belt.scale = (Vec3::one() + slow_abs * 0.05) * 1.02;
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
@ -69,7 +65,6 @@ impl Animation for SitAnimation {
s_a.hand.2 + slow * 0.7 + stop * -2.0,
);
next.hand_l.orientation = Quaternion::rotation_x(slowa * -0.1 + slow * 0.1);
next.hand_l.scale = Vec3::one() + slow_abs * -0.05;
next.hand_r.position = Vec3::new(
s_a.hand.0,
@ -77,7 +72,6 @@ impl Animation for SitAnimation {
s_a.hand.2 + slow * 0.7 + stop * -2.0,
);
next.hand_r.orientation = Quaternion::rotation_x(slow * -0.1 + slowa * 0.1);
next.hand_r.scale = Vec3::one() + slow_abs * -0.05;
next.foot_l.position = Vec3::new(-s_a.foot.0, 4.0 + s_a.foot.1, 3.0 + s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(slow * 0.1 + stop * 1.2 + slow * 0.1);
@ -87,57 +81,12 @@ impl Animation for SitAnimation {
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation = Quaternion::rotation_x(0.0);
next.shoulder_l.scale = (Vec3::one() + slow_abs * -0.05) * 1.15;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(0.0);
next.shoulder_r.scale = (Vec3::one() + slow_abs * -0.05) * 1.15;
match active_tool_kind {
Some(ToolKind::Dagger(_)) => {
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
next.main.orientation =
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
Some(ToolKind::Shield(_)) => {
next.main.position = Vec3::new(-0.0, -5.0, 3.0);
next.main.orientation =
Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
},
_ => {
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
}
match second_tool_kind {
Some(ToolKind::Dagger(_)) => {
next.second.position = Vec3::new(4.0, -6.0, 7.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI);
},
Some(ToolKind::Shield(_)) => {
next.second.position = Vec3::new(0.0, -4.0, 3.0);
next.second.orientation =
Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI);
},
_ => {
next.second.position = Vec3::new(-7.0, -5.0, 15.0);
next.second.orientation =
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
},
}
next.torso.position = Vec3::new(0.0, -0.2, stop * -0.16) * s_a.scaler;
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -114,9 +114,6 @@ impl Animation for SneakAnimation {
* Quaternion::rotation_y(tilt * 0.5)
* Quaternion::rotation_x(0.2);
next.glider.orientation = Quaternion::rotation_x(0.0);
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.back.orientation =
Quaternion::rotation_x(-0.25 + short * 0.1 + noisea * 0.1 + noiseb * 0.1);
@ -170,9 +167,6 @@ impl Animation for SneakAnimation {
next.hand_r.position = Vec3::new(-1.0 + s_a.hand.0, s_a.hand.1, s_a.hand.2);
next.hand_r.orientation = Quaternion::rotation_x(0.4);
next.glider.orientation = Quaternion::rotation_x(0.35);
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
next.shorts.orientation = Quaternion::rotation_z(0.6 + head_look.x * -0.2);
@ -180,13 +174,6 @@ impl Animation for SneakAnimation {
next.foot_l.orientation = Quaternion::rotation_x(-0.5);
next.foot_r.position = Vec3::new(s_a.foot.0, 4.0 + s_a.foot.1, s_a.foot.2);
next.shoulder_l.scale = (Vec3::one() + breathe * -0.05) * 1.15;
next.shoulder_r.scale = (Vec3::one() + breathe * -0.05) * 1.15;
next.main.position = Vec3::new(-7.0, -5.0, 15.0);
next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
}
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct Input {
@ -28,7 +25,7 @@ impl Animation for SpinAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_spin")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -141,13 +138,6 @@ impl Animation for SpinAnimation {
next.lantern.orientation =
Quaternion::rotation_x(spin * -0.7 + 0.4) * Quaternion::rotation_y(spin * 0.4);
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}

View File

@ -2,10 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::{
comp::item::{Hands, ToolKind},
states::utils::StageSection,
};
use common::{comp::item::ToolKind, states::utils::StageSection};
use std::f32::consts::PI;
pub struct SpinMeleeAnimation;
@ -27,7 +24,7 @@ impl Animation for SpinMeleeAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
(active_tool_kind, _second_tool_kind, velocity, _global_time, stage_section): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -91,26 +88,19 @@ impl Animation for SpinMeleeAnimation {
},
Some(ToolKind::Axe(_)) => {
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(PI);
next.hand_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(PI);
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.orientation = Quaternion::rotation_x(PI / 2.0);
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.main.orientation = Quaternion::rotation_x(0.0);
next.control.position = Vec3::new(0.0, 16.0, 3.0);
next.control.orientation = Quaternion::rotation_x(-1.4)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(1.4);
next.control.orientation =
Quaternion::rotation_x(-1.4) * Quaternion::rotation_z(1.4);
next.head.orientation = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(-0.15)
* Quaternion::rotation_y(0.08);
next.head.orientation =
Quaternion::rotation_x(-0.15) * Quaternion::rotation_y(0.08);
next.chest.position = Vec3::new(0.0, s_a.chest.0 - 3.0, s_a.chest.1 - 2.0);
next.chest.orientation = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(-0.1)
@ -141,8 +131,7 @@ impl Animation for SpinMeleeAnimation {
next.foot_r.orientation = Quaternion::rotation_x(1.0);
} else if speed < 0.5 {
next.foot_l.position = Vec3::new(-s_a.foot.0, 2.0 + quick * -6.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(0.5 + slowersmooth * 0.2)
* Quaternion::rotation_z(0.0);
next.foot_l.orientation = Quaternion::rotation_x(0.5 + slowersmooth * 0.2);
next.foot_r.position = Vec3::new(s_a.foot.0, 4.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(0.5 - slowersmooth * 0.2)
@ -158,18 +147,6 @@ impl Animation for SpinMeleeAnimation {
_ => {},
}
next.lantern.orientation = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.7)
* Quaternion::rotation_y(-0.8);
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -25,7 +25,6 @@ impl Animation for StandAnimation {
let mut next = (*skeleton).clone();
let slow = (anim_time as f32 * 1.0).sin();
let breathe = ((anim_time as f32 * 0.5).sin()).abs();
let impact = (avg_vel.z).max(-15.0);
let head_look = Vec2::new(
((global_time + anim_time) as f32 / 12.0)
@ -39,17 +38,18 @@ impl Animation for StandAnimation {
.sin()
* 0.15,
);
next.head.scale = Vec3::one() * s_a.head_scale + breathe * -0.05;
next.chest.scale = Vec3::one() * 1.01 + breathe * 0.03;
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.scale = Vec3::one() * 1.01;
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.scale = Vec3::one() * 1.04;
next.back.scale = Vec3::one() * 1.02;
next.belt.scale = Vec3::one() + breathe * -0.03;
next.hold.scale = Vec3::one() * 0.0;
next.lantern.scale = Vec3::one() * 0.65;
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
next.shoulder_l.scale = Vec3::one() * 1.1;
next.shoulder_r.scale = Vec3::one() * 1.1;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * 0.3 + breathe * -0.05);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * 0.3);
next.head.orientation = Quaternion::rotation_z(head_look.x)
* Quaternion::rotation_x(impact * -0.02 + head_look.y.abs());
@ -66,7 +66,6 @@ impl Animation for StandAnimation {
next.shorts.position = Vec3::new(0.0, s_a.shorts.0 + impact * -0.2, s_a.shorts.1);
next.shorts.orientation =
Quaternion::rotation_z(head_look.x * -0.2) * Quaternion::rotation_x(impact * -0.04);
next.shorts.scale = Vec3::one() + breathe * -0.03;
next.hand_l.position = Vec3::new(
-s_a.hand.0,
@ -90,10 +89,8 @@ impl Animation for StandAnimation {
next.foot_r.orientation = Quaternion::rotation_x(impact * -0.02);
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.scale = (Vec3::one() + breathe * -0.05) * 1.15;
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.scale = (Vec3::one() + breathe * -0.05) * 1.15;
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
next.glider.scale = Vec3::one() * 0.0;

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct SwimWieldAnimation;
@ -18,7 +18,7 @@ impl Animation for SwimWieldAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
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,
s_a: &SkeletonAttr,
@ -333,14 +333,6 @@ impl Animation for SwimWieldAnimation {
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::{Hands, ToolKind};
use common::comp::item::ToolKind;
use std::{f32::consts::PI, ops::Mul};
pub struct WieldAnimation;
@ -18,7 +18,7 @@ impl Animation for WieldAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
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,
s_a: &SkeletonAttr,
@ -268,14 +268,6 @@ impl Animation for WieldAnimation {
_ => {},
}
next.second.scale = match (
active_tool_kind.map(|tk| tk.hands()),
second_tool_kind.map(|tk| tk.hands()),
) {
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
(_, _) => Vec3::zero(),
};
next
}
}