addressing commments

This commit is contained in:
jshipsey 2021-04-13 20:17:55 -04:00
parent a7f5b90f0e
commit 808634aa75
8 changed files with 80 additions and 198 deletions

View File

@ -6,19 +6,12 @@ use common::{
comp::item::{ToolKind, UniqueKind},
states::utils::StageSection,
};
use std::{f32::consts::PI, ops::Mul};
use std::f32::consts::PI;
pub struct StunnedAnimation;
impl Animation for StunnedAnimation {
type Dependency = (
Option<ToolKind>,
Option<ToolKind>,
Vec3<f32>,
f32,
f32,
Option<StageSection>,
);
type Dependency = (Option<ToolKind>, Vec3<f32>, f32, Option<StageSection>);
type Skeleton = BipedLargeSkeleton;
#[cfg(feature = "use-dyn-lib")]
@ -27,7 +20,7 @@ impl Animation for StunnedAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_stunned")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, global_time, acc_vel, stage_section): Self::Dependency,
(active_tool_kind, velocity, acc_vel, stage_section): Self::Dependency,
anim_time: f32,
_rate: &mut f32,
s_a: &SkeletonAttr,
@ -56,44 +49,6 @@ impl Animation for StunnedAnimation {
let slower = (anim_time * 1.0 + PI).sin();
let slow = (anim_time * 3.5 + PI).sin();
let tailmove = Vec2::new(
(global_time / 2.0 + anim_time / 2.0)
.floor()
.mul(7331.0)
.sin()
* 0.25,
(global_time / 2.0 + anim_time / 2.0)
.floor()
.mul(1337.0)
.sin()
* 0.125,
);
let look = Vec2::new(
(global_time / 2.0 + anim_time / 8.0)
.floor()
.mul(7331.0)
.sin()
* 0.5,
(global_time / 2.0 + anim_time / 8.0)
.floor()
.mul(1337.0)
.sin()
* 0.25,
);
let breathe = if s_a.beast {
// Controls for the beast breathing
let intensity = 0.04;
let lenght = 1.5;
let chop = 0.2;
let chop_freq = 60.0;
intensity * (lenght * anim_time).sin()
+ 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * lenght).cos()
} else {
0.0
};
let footvertl = (anim_time * 16.0 * lab).sin();
let footvertr = (anim_time * 16.0 * lab + PI).sin();
let handhoril = (anim_time * 16.0 * lab + PI * 1.4).sin();
@ -119,6 +74,11 @@ impl Animation for StunnedAnimation {
next.hand_l.orientation = Quaternion::rotation_x(0.0);
next.hand_r.orientation = Quaternion::rotation_x(0.0);
next.head.orientation =
Quaternion::rotation_x(movement1 * -0.2) * Quaternion::rotation_z(movement1 * -0.7);
next.upper_torso.orientation = Quaternion::rotation_x(movement1 * 0.5);
next.lower_torso.orientation = Quaternion::rotation_x(movement1 * -0.5);
if speed > 0.5 {
next.shoulder_l.position = Vec3::new(
-s_a.shoulder.0,
@ -137,37 +97,24 @@ impl Animation for StunnedAnimation {
Quaternion::rotation_x(0.6 * speednorm + (footrotl * -0.2) * speednorm);
} else {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
next.head.orientation = Quaternion::rotation_z(look.x * 0.6 + movement1 * 1.0)
* 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.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.orientation =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.orientation = 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(-0.1 + breathe * 2.0);
next.jaw.orientation = Quaternion::rotation_x(-0.1);
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);
next.tail.orientation = Quaternion::rotation_z(slow * 0.2);
next.shoulder_l.position =
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_l.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_x(0.3);
next.shoulder_l.orientation = Quaternion::rotation_x(0.3);
next.shoulder_r.position =
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_x(0.3);
next.shoulder_r.orientation = Quaternion::rotation_x(0.3);
}
match active_tool_kind {
Some(ToolKind::SwordSimple) => {
@ -182,9 +129,8 @@ impl Animation for StunnedAnimation {
next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.2);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.2)
* Quaternion::rotation_y(0.2)
* Quaternion::rotation_z(0.0);
next.control_r.orientation =
Quaternion::rotation_x(PI / 2.2) * Quaternion::rotation_y(0.2);
next.control.orientation =
Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(-0.1);
@ -201,9 +147,8 @@ impl Animation for StunnedAnimation {
next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.2);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.2)
* Quaternion::rotation_y(0.2)
* Quaternion::rotation_z(0.0);
next.control_r.orientation =
Quaternion::rotation_x(PI / 2.2) * Quaternion::rotation_y(0.2);
next.control.orientation = Quaternion::rotation_x(-0.2 + short * 0.2)
* Quaternion::rotation_y(1.0)
@ -221,9 +166,7 @@ impl Animation for StunnedAnimation {
next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2);
next.control.orientation =
Quaternion::rotation_x(-1.0 + short * 0.2) * Quaternion::rotation_y(-1.8);
@ -282,8 +225,8 @@ impl Animation for StunnedAnimation {
if speed < 0.5 {
next.head.position =
Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2) * 1.02;
next.head.orientation = Quaternion::rotation_z(look.x * 0.6)
* Quaternion::rotation_x(look.y * 0.6);
next.head.orientation =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * 0.5);
@ -294,7 +237,7 @@ impl Animation for StunnedAnimation {
next.jaw.orientation = Quaternion::rotation_x(-0.1);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation = Quaternion::rotation_z(slow * 0.2 + tailmove.x);
next.tail.orientation = Quaternion::rotation_z(slow * 0.2);
next.second.orientation = Quaternion::rotation_x(PI);

View File

@ -12,8 +12,6 @@ pub struct AlphaAnimation;
type AlphaAnimationDependency = (
(Option<Hands>, Option<Hands>),
f32,
f32,
Option<StageSection>,
Option<AbilityInfo>,
);
@ -28,7 +26,7 @@ impl Animation for AlphaAnimation {
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(hands, _velocity, _global_time, stage_section, ability_info): Self::Dependency,
(hands, stage_section, ability_info): Self::Dependency,
anim_time: f32,
rate: &mut f32,
s_a: &SkeletonAttr,
@ -39,9 +37,7 @@ impl Animation for AlphaAnimation {
let (move1, move2, move3, move2h) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time.powi(2), 0.0, anim_time.powf(0.25)),
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 1.0), /* hmm maybe don' */
// t complete the
// recovery?
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 1.0),
_ => (0.0, 0.0, 0.0, 0.0),
};
@ -58,11 +54,11 @@ impl Animation for AlphaAnimation {
next.main.orientation = Quaternion::rotation_x(0.0);
next.chest.orientation =
Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0 + move3 * 0.5);
Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0 + move3 * 0.2);
next.head.position = Vec3::new(0.0 + move2 * 2.0, s_a.head.0, s_a.head.1);
next.head.orientation =
Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8 + move3 * -0.5);
Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8 + move3 * -0.2);
},
Some(ToolKind::Axe) => {
@ -72,8 +68,7 @@ impl Animation for AlphaAnimation {
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
_ => (0.0, 0.0, 0.0),
};
next.head.position =
Vec3::new(0. + move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1);
next.head.position = Vec3::new(move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1);
next.chest.orientation =
Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6 + move3 * 0.4)
* Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0)
@ -127,7 +122,7 @@ impl Animation for AlphaAnimation {
);
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + move1 * -1.3)
* Quaternion::rotation_y(s_a.sc.4 + move1 * -0.7 + move2 * 1.2)
* Quaternion::rotation_z(s_a.sc.5 + move1 * -1.57);
* Quaternion::rotation_z(s_a.sc.5 + move1 * -1.57 + move3 * -1.57);
},
Some(ToolKind::Axe) => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);

View File

@ -44,11 +44,11 @@ impl Animation for BetaAnimation {
next.second.orientation = Quaternion::rotation_z(0.0);
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0);
let pullback = 1.0 - move3;
if let Some(ToolKind::Sword) = ability_info.and_then(|a| a.tool) {
next.chest.orientation = Quaternion::rotation_x(0.15)
* Quaternion::rotation_y((-0.1) * (1.0 - move3))
* Quaternion::rotation_z((0.4 + move1 * 1.5 + move2 * -2.5) * (1.0 - move3));
* Quaternion::rotation_y((-0.1) * pullback)
* Quaternion::rotation_z((0.4 + move1 * 1.5 + move2 * -2.5) * pullback);
next.head.orientation = Quaternion::rotation_z(-0.4 + move1 * -1.0 + move2 * 1.5);
}
match hands {
@ -62,18 +62,15 @@ impl Animation for BetaAnimation {
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
next.control.position = Vec3::new(
s_a.sc.0 + (-1.4 + move1 * -3.0 + move2 * -2.0) * (1.0 - move3),
s_a.sc.1 + (-1.4 + move1 * 3.0 + move2 * 3.0) * (1.0 - move3),
s_a.sc.2 + (-1.9 + move1 * 2.5 * (1.0 - move3)),
s_a.sc.0 + (-1.4 + move1 * -3.0 + move2 * -2.0) * pullback,
s_a.sc.1 + (-1.4 + move1 * 3.0 + move2 * 3.0) * pullback,
s_a.sc.2 + (-1.9 + move1 * 2.5 * pullback),
);
next.control.orientation =
Quaternion::rotation_x(s_a.sc.3 + (-1.7) * (1.0 - move3))
* Quaternion::rotation_y(
s_a.sc.4 + (0.4 + move1 * 1.5 + move2 * -2.5) * (1.0 - move3),
)
* Quaternion::rotation_z(
s_a.sc.5 + (1.67 + move2 * 1.57) * (1.0 - move3),
);
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + (-1.7) * pullback)
* Quaternion::rotation_y(
s_a.sc.4 + (0.4 + move1 * 1.5 + move2 * -2.5) * pullback,
)
* Quaternion::rotation_z(s_a.sc.5 + (1.67 + move2 * 1.57) * pullback);
},
_ => {},
},
@ -85,7 +82,7 @@ impl Animation for BetaAnimation {
Some(ToolKind::Sword) | Some(ToolKind::SwordSimple) => {
next.control_l.position = Vec3::new(-12.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(1.7)
* Quaternion::rotation_y(-3.7 + move1 * 0.5)
* Quaternion::rotation_y(-3.7 + move1 * -0.75 + move2 * 1.0)
* Quaternion::rotation_z(3.69);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
@ -101,7 +98,7 @@ impl Animation for BetaAnimation {
Some(ToolKind::Sword) | Some(ToolKind::SwordSimple) => {
next.control_r.position = Vec3::new(0.0 + move1 * -8.0, 13.0, 2.0);
next.control_r.orientation = Quaternion::rotation_x(1.7)
* Quaternion::rotation_y(-2.3 + move1 * -1.3)
* Quaternion::rotation_y(-2.3 + move1 * -2.3 + move2 * 1.0)
* Quaternion::rotation_z(3.69);
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(1.57)

View File

@ -83,8 +83,7 @@ impl Animation for LeapAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.torso.orientation =
Quaternion::rotation_x(move1 * 0.4 + move2 * 0.6 + move3 * -1.0)
* Quaternion::rotation_y(0.0)
Quaternion::rotation_x(move1 * 0.3 + move2 * 0.5 + move3 * -1.0)
* Quaternion::rotation_z(move1 * 0.4 + move2 * 0.4);
next.head.orientation = Quaternion::rotation_x(move2 * -0.6 + move3 * 0.8)
@ -149,9 +148,9 @@ impl Animation for LeapAnimation {
s_a.ac.1 + move3 * -10.0,
s_a.ac.2 + move3 * 4.0,
);
next.control.orientation = Quaternion::rotation_x(
s_a.ac.3) * Quaternion::rotation_y(s_a.ac.4+move2*-0.8+move3*-4.0)// + move1 * 0.5)
* Quaternion::rotation_z(s_a.ac.5+move2*-0.6+move3*-1.6); // - move1 * 0.2);
next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
* Quaternion::rotation_y(s_a.ac.4 + move2 * -0.8 + move3 * -4.0)
* Quaternion::rotation_z(s_a.ac.5 + move2 * -0.6 + move3 * -1.6);
},
_ => {},
},

View File

@ -136,14 +136,14 @@ impl Animation for SpinAnimation {
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
next.control.position = Vec3::new(
s_a.sc.0 + move1 * 2.0 + move2 * -7.0,
s_a.sc.1 + 8.0 + move1 * 0.6 + move2 * -15.0,
s_a.sc.2 + 1.0 + move1 * 0.6 + move2 * 1.5,
s_a.sc.0 + movement1base * 2.0 + movement2base * -7.0,
s_a.sc.1 + 8.0 + movement1base * 0.6 + movement2base * -15.0,
s_a.sc.2 + 1.0 + movement1base * 0.6 + movement2base * 1.5,
);
next.control.orientation =
Quaternion::rotation_x(-0.5 + s_a.sc.3 + move1 * -1.2)
* Quaternion::rotation_y(s_a.sc.4 - 0.6 + move1 * 0.0 + move2 * -0.2)
* Quaternion::rotation_z(s_a.sc.5 + 0.1 + move1 * 1.57);
Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1base * -1.2)
* Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement2base * -0.2)
* Quaternion::rotation_z(s_a.sc.5 - 1.57 + movement1base * PI);
},
Some(ToolKind::Axe) => {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
@ -176,22 +176,22 @@ impl Animation for SpinAnimation {
match hands {
(Some(Hands::One), _) => match ability_info.and_then(|a| a.tool) {
Some(ToolKind::Sword) | Some(ToolKind::SwordSimple) => {
next.control_l.position = Vec3::new(-7.0 + move2 * -5.0, 8.0, 2.0);
next.control_l.position = Vec3::new(-7.0 + movement2base * -5.0, 8.0, 2.0);
next.control_l.orientation = Quaternion::rotation_x(1.7)
* Quaternion::rotation_y(-2.7 + move1 * -1.0 + move2 * 2.0)
* Quaternion::rotation_z(1.5 + move1 * PI);
* Quaternion::rotation_y(-2.7 + movement1base * -1.0 + movement2base * 2.0)
* Quaternion::rotation_z(1.5 + movement1base * PI);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
},
Some(ToolKind::Axe) => {
next.control_l.position = Vec3::new(
-2.0 + move1 * -5.0,
18.0 + move1 * -10.0,
6.0 + move1 * -10.0,
-2.0 + movement1base * -5.0,
18.0 + movement1base * -10.0,
6.0 + movement1base * -10.0,
);
next.control_l.orientation = Quaternion::rotation_x(1.7 + move2 * 1.5)
next.control_l.orientation = Quaternion::rotation_x(1.7 + movement2base * 1.5)
* Quaternion::rotation_y(-3.7)
* Quaternion::rotation_z(1.5 + move2 * 1.57);
* Quaternion::rotation_z(1.5 + movement2base * 1.57);
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
next.hand_l.orientation = Quaternion::rotation_x(1.57)
},

View File

@ -111,18 +111,14 @@ impl Animation for WieldAnimation {
(0.3 - direction * 0.4) * (1.0 - tilt.abs()) + look_dir.z * 0.7,
);
next.chest.position = Vec3::new(
0.0 + short * strafe,
s_a.chest.0,
s_a.chest.1 + shortalt * -1.5,
);
next.chest.position =
Vec3::new(short * strafe, s_a.chest.0, s_a.chest.1 + shortalt * -1.5);
} else {
next.head.position = Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1 + u_slow * 0.1);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + u_slow * 0.1);
next.head.orientation = Quaternion::rotation_z(head_look.x + tilt * -0.75)
* Quaternion::rotation_x(head_look.y.abs() + look_dir.z * 0.7);
next.chest.position =
Vec3::new(0.0 + slowalt * 0.5, s_a.chest.0, s_a.chest.1 + u_slow * 0.5);
next.chest.position = Vec3::new(slowalt * 0.5, s_a.chest.0, s_a.chest.1 + u_slow * 0.5);
next.belt.orientation = Quaternion::rotation_z(0.15 + beltstatic * tilt * 0.1);
next.shorts.orientation = Quaternion::rotation_z(0.3 + beltstatic * tilt * 0.2);
@ -158,9 +154,6 @@ impl Animation for WieldAnimation {
match hands {
(Some(Hands::Two), _) => match active_tool_kind {
Some(ToolKind::Sword) | Some(ToolKind::SwordSimple) => {
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0);
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
next.hand_l.orientation =
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
@ -177,26 +170,12 @@ impl Animation for WieldAnimation {
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.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_l.orientation = Quaternion::rotation_x(0.0);
next.control_l.position = Vec3::new(-7.0, 0.0, 0.0);
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.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.hand_r.orientation = Quaternion::rotation_x(0.0);
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
},
@ -235,8 +214,6 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_z(s_a.ac.5);
},
Some(ToolKind::Hammer) | Some(ToolKind::HammerSimple) | Some(ToolKind::Pick) => {
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0);
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);
@ -267,8 +244,6 @@ impl Animation for WieldAnimation {
next.hand_r.orientation =
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
};
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_y(0.0);
next.control.position =
Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2 + direction * -5.0);
@ -280,25 +255,6 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_y(s_a.stc.4)
* Quaternion::rotation_z(s_a.stc.5 + u_slowalt * 0.1);
},
Some(ToolKind::Shield) => {
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);
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0 * PI);
next.control_l.position = Vec3::new(-7.0, 0.0, 0.0);
next.hand_r.position = Vec3::new(0.0, 0.0, 0.0);
next.hand_r.orientation = Quaternion::rotation_x(0.0);
next.second.position = Vec3::new(0.0, 0.0, 0.0);
next.second.orientation = Quaternion::rotation_x(0.0 * PI);
next.control_r.position = Vec3::new(7.0, 0.0, 0.0);
},
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0);

View File

@ -146,25 +146,23 @@ pub fn init() {
// Start reloader that watcher signals
// "Debounces" events since I can't find the option to do this in the latest
// `notify`
std::thread::Builder::new()
.name("voxygen_anim_watcher".to_owned())
.spawn(move || {
let mut modified_paths = std::collections::HashSet::new();
while let Ok(path) = reload_recv.recv() {
std::thread::Builder::new("voxygen_anim_watcher".to_owned()).spawn(move || {
let mut modified_paths = std::collections::HashSet::new();
while let Ok(path) = reload_recv.recv() {
modified_paths.insert(path);
// Wait for any additional modify events before reloading
while let Ok(path) = reload_recv.recv_timeout(Duration::from_millis(300)) {
modified_paths.insert(path);
// Wait for any additional modify events before reloading
while let Ok(path) = reload_recv.recv_timeout(Duration::from_millis(300)) {
modified_paths.insert(path);
}
info!(
?modified_paths,
"Hot reloading animations because files in `anim` modified."
);
hotreload();
}
});
info!(
?modified_paths,
"Hot reloading animations because files in `anim` modified."
);
hotreload();
}
});
// Let the watcher live forever
std::mem::forget(watcher);

View File

@ -898,8 +898,6 @@ impl FigureMgr {
&target_base,
(
hands,
rel_vel.magnitude(),
time,
Some(s.stage_section),
Some(s.static_data.ability_info),
),
@ -1054,7 +1052,7 @@ impl FigureMgr {
CharacterState::Boost(_) => {
anim::character::AlphaAnimation::update_skeleton(
&target_base,
(hands, rel_vel.magnitude(), time, None, None),
(hands, None, None),
state.state_time,
&mut state_animation_rate,
skeleton_attr,
@ -1341,8 +1339,6 @@ impl FigureMgr {
&target_base,
(
hands,
rel_vel.magnitude(),
time,
Some(s.stage_section),
Some(s.static_data.ability_info),
),
@ -3605,9 +3601,7 @@ impl FigureMgr {
&target_base,
(
active_tool_kind,
second_tool_kind,
rel_vel,
state.state_time,
state.acc_vel,
Some(s.stage_section),
),