resolve minor anim hiccup

This commit is contained in:
jshipsey 2020-09-20 17:57:26 -04:00 committed by Sam
parent 1fbcf2be80
commit 0796337a8c
2 changed files with 18 additions and 18 deletions

View File

@ -55,7 +55,7 @@ impl Animation for BetaAnimation {
let recover = (anim_time as f32 * 8.0).sin();
let movement = anim_time as f32 * 1.0;
let test = (anim_time as f32 * 2.5).sin();
let stab = (anim_time as f32 * 2.5).sin();
if let Some(ToolKind::Sword(_)) = active_tool_kind {
next.l_hand.position = Vec3::new(-0.75, -1.0, 2.5);
@ -77,8 +77,8 @@ impl Animation for BetaAnimation {
//println!("{:.3} recover", anim_time);
next.control.position = Vec3::new(
-8.0 + movement * -5.0,
4.0 - recover * 0.8 + movement * 2.0,
6.0 - recover * 0.4,
1.0 - recover * 0.8 + movement * 2.0,
2.0 - recover * 0.4,
);
next.control.orientation = Quaternion::rotation_x(-1.57)
* Quaternion::rotation_y(0.0 + movement * 1.5)
@ -91,14 +91,14 @@ impl Animation for BetaAnimation {
StageSection::Swing => {
//println!("{:.3} swing", anim_time);
next.control.position =
Vec3::new(-8.0 + test * 30.0, 6.0 + movement * 2.0, 6.0);
Vec3::new(-8.0 + stab * 30.0, 6.0 + movement * 2.0, 6.0);
next.control.orientation = Quaternion::rotation_x(-1.57)
* Quaternion::rotation_y(1.5 + test * 0.5)
* Quaternion::rotation_z(1.0 + test * 1.0);
* Quaternion::rotation_y(1.5 + stab * 0.5)
* Quaternion::rotation_z(1.0 + stab * 1.0);
next.chest.orientation = Quaternion::rotation_y(-0.1)
* Quaternion::rotation_z(1.9 + test * -0.5);
* Quaternion::rotation_z(1.9 + stab * -0.5);
next.head.orientation = Quaternion::rotation_y(0.1)
* Quaternion::rotation_z(-1.2 + test * -0.5);
* Quaternion::rotation_z(-1.2 + stab * -0.5);
},
StageSection::Recover => {
next.control.position = Vec3::new(10.0 + movement * -5.0, 8.0, 6.0);

View File

@ -52,8 +52,8 @@ impl Animation for SpinAnimation {
let recover = (anim_time as f32 * 8.0).sin();
let movement = anim_time as f32 * 1.0;
let test = (anim_time as f32 * 8.0).sin();
let test2 = (anim_time as f32 * 1.0).sin();
let stab = (anim_time as f32 * 8.0).sin();
let rotate = (anim_time as f32 * 1.0).sin();
next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
@ -91,20 +91,20 @@ impl Animation for SpinAnimation {
//println!("{:.3} swing", anim_time);
next.control.position = Vec3::new(
7.0 + movement * -8.0,
11.0 + test * 3.0,
2.0 + test * 3.5 + movement * 3.0,
11.0 + stab * 3.0,
2.0 + stab * 3.5 + movement * 3.0,
);
next.control.orientation =
Quaternion::rotation_x(-1.57 + movement * -0.6 + test * -0.25)
Quaternion::rotation_x(-1.57 + movement * -0.6 + stab * -0.25)
* Quaternion::rotation_y(2.8 + movement * -2.0)
* Quaternion::rotation_z(1.0 + movement * 1.0);
next.head.orientation = Quaternion::rotation_z(-test * 0.8);
next.chest.orientation = Quaternion::rotation_x(test * 0.15)
next.head.orientation = Quaternion::rotation_z(-stab * 0.8);
next.chest.orientation = Quaternion::rotation_x(stab * 0.15)
* Quaternion::rotation_y(movement * 0.3)
* Quaternion::rotation_z(movement * 1.5);
next.belt.orientation = Quaternion::rotation_z(test2 * 0.5);
next.shorts.orientation = Quaternion::rotation_z(test2 * 1.5);
next.torso.orientation = Quaternion::rotation_z(test2 * 7.2);
next.belt.orientation = Quaternion::rotation_z(rotate * 0.5);
next.shorts.orientation = Quaternion::rotation_z(rotate * 1.5);
next.torso.orientation = Quaternion::rotation_z(rotate * 7.2);
},
StageSection::Recover => {
//println!("{:.3} recover", anim_time);