restored previous animations with new bone setup

Former-commit-id: b6bb91e1b8a940caff11f7a78f613806695ce911
This commit is contained in:
jshipsey 2019-05-22 21:48:13 -04:00
parent ceb207a1bf
commit d8cc5bbcf0
6 changed files with 45 additions and 36 deletions

View File

@ -86,7 +86,7 @@ impl<'a> System<'a> for Sys {
if control.move_dir.magnitude() > 0.01 { if control.move_dir.magnitude() > 0.01 {
Animation::Run Animation::Run
} else { } else {
Animation::Attack Animation::Idle
} }
} else if gliding { } else if gliding {
Animation::Gliding Animation::Gliding

View File

@ -69,7 +69,7 @@ impl Animation for AttackAnimation {
9.0, 9.0,
) / 11.0; ) / 11.0;
next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.5); next.l_hand.ori = Quaternion::rotation_x(0.0 + wave * 2.0 )* Quaternion::rotation_z(wave * 2.0);
next.l_hand.scale = Vec3::one() / 11.0; next.l_hand.scale = Vec3::one() / 11.0;
next.r_hand.offset = Vec3::new( next.r_hand.offset = Vec3::new(
@ -88,25 +88,25 @@ impl Animation for AttackAnimation {
next.r_foot.ori = Quaternion::identity(); next.r_foot.ori = Quaternion::identity();
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
next.weapon.offset = Vec3::new(-12.0, -2.0, 11.0); next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0);
next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.ori = Quaternion::rotation_y(2.5);
next.weapon.scale = Vec3::one(); next.weapon.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one(); next.l_shoulder.scale = Vec3::one() * 1.04;
next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5); next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5);
next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one(); next.r_shoulder.scale = Vec3::one() * 1.04;
next.draw.offset = Vec3::new(13.5, 0.0, 0.0); next.draw.offset = Vec3::new(13.5, 0.0, 0.0);
next.draw.ori = Quaternion::rotation_y(0.0); next.draw.ori = Quaternion::rotation_y(0.0);
next.draw.scale = Vec3::one() * 0.0; next.draw.scale = Vec3::one() * 0.0;
next.left_equip.offset = Vec3::new(-8.0, 4.0, 10.0) / 13.0; next.left_equip.offset = Vec3::new(-8.0, 4.0, 9.0) / 11.0;
next.left_equip.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.5) * Quaternion::rotation_z(1.57); next.left_equip.ori = Quaternion::rotation_x(0.0 + wave * 2.0)* Quaternion::rotation_z(1.57 + wave * 2.0);
next.left_equip.scale = Vec3::one() / 11.0; next.left_equip.scale = Vec3::one() / 11.0;

View File

@ -91,22 +91,25 @@ impl Animation for GlidingAnimation {
); );
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
next.weapon.offset = Vec3::new(-5.0, -5.0, 12.0); next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0);
next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.ori = Quaternion::rotation_y(2.5);
next.weapon.scale = Vec3::one(); next.weapon.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one(); next.l_shoulder.scale = Vec3::one() * 1.04;
next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5); next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5);
next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one(); next.r_shoulder.scale = Vec3::one() * 1.04;
next.draw.offset = Vec3::new(5.5, -9.0 + wave_very_slow * 0.10, 18.0); next.draw.offset = Vec3::new(5.5, -9.0 + wave_very_slow * 0.10, 18.0);
next.draw.ori = Quaternion::rotation_x(0.95 - wave_very_slow * 0.15) * Quaternion::rotation_y(wave_very_slow_cos * 0.04); next.draw.ori = Quaternion::rotation_x(0.95 - wave_very_slow * 0.15) * Quaternion::rotation_y(wave_very_slow_cos * 0.04);
next.draw.scale = Vec3::one(); next.draw.scale = Vec3::one();
next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0;
next.left_equip.ori = Quaternion::rotation_x(0.0);;
next.left_equip.scale = Vec3::one() *0.0;
next.torso.offset = Vec3::new(-0.5, -0.2, 0.0); next.torso.offset = Vec3::new(-0.5, -0.2, 0.0);
next.torso.ori = Quaternion::rotation_x(-0.8 + wave_very_slow * 0.10); next.torso.ori = Quaternion::rotation_x(-0.8 + wave_very_slow * 0.10);

View File

@ -23,13 +23,9 @@ impl Animation for IdleAnimation {
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let wave = (anim_time as f32 * 12.0).sin();
let wave_cos = (anim_time as f32 * 12.0).cos();
let wave_slow = (anim_time as f32 * 6.0 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 6.0 + PI).cos();
let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin();
let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos(); let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos();
let wave_dip = (wave_slow.abs() - 0.5).abs();
let head_look = Vec2::new( let head_look = Vec2::new(
((global_time + anim_time) as f32 / 8.0) ((global_time + anim_time) as f32 / 8.0)
@ -60,18 +56,18 @@ impl Animation for IdleAnimation {
next.shorts.scale = Vec3::one(); next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new( next.l_hand.offset = Vec3::new(
-6.0, -7.5,
-2.0 + wave_ultra_slow_cos * 0.15, -2.0 + wave_ultra_slow_cos * 0.15,
11.5 + wave_ultra_slow * 0.5, 8.0 + wave_ultra_slow * 0.5,
) / 11.; ) / 11.;
next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06);
next.l_hand.scale = Vec3::one() / 11.; next.l_hand.scale = Vec3::one() / 11.;
next.r_hand.offset = Vec3::new( next.r_hand.offset = Vec3::new(
9.0, 7.5,
-2.0 + wave_ultra_slow_cos * 0.15, -2.0 + wave_ultra_slow_cos * 0.15,
11.5 + wave_ultra_slow * 0.5, 8.0 + wave_ultra_slow * 0.5,
) / 11.; ) / 11.;
next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06);
next.r_hand.scale = Vec3::one() / 11.; next.r_hand.scale = Vec3::one() / 11.;
@ -84,22 +80,26 @@ impl Animation for IdleAnimation {
next.r_foot.ori = Quaternion::identity(); next.r_foot.ori = Quaternion::identity();
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
next.weapon.offset = Vec3::new(-5.0, -5.0, 12.0); next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0);
next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.ori = Quaternion::rotation_y(2.5);
next.weapon.scale = Vec3::one(); next.weapon.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); next.l_shoulder.offset = Vec3::new(-10.0, -3.2, 2.5);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one(); next.l_shoulder.scale = Vec3::one() * 1.04;
next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5); next.r_shoulder.offset = Vec3::new(0.0, -3.2, 2.5);
next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one(); next.r_shoulder.scale = Vec3::one() * 1.04;
next.draw.offset = Vec3::new(13.5, 0.0, 0.0); next.draw.offset = Vec3::new(13.5, 0.0, 0.0);
next.draw.ori = Quaternion::rotation_y(0.0); next.draw.ori = Quaternion::rotation_y(0.0);
next.draw.scale = Vec3::one() * 0.0; next.draw.scale = Vec3::one() * 0.0;
next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0;
next.left_equip.ori = Quaternion::rotation_x(0.0);;
next.left_equip.scale = Vec3::one() *0.0;
next.torso.offset = Vec3::new(-0.5, -0.2, 0.1); next.torso.offset = Vec3::new(-0.5, -0.2, 0.1);
next.torso.ori = Quaternion::rotation_x(0.0); next.torso.ori = Quaternion::rotation_x(0.0);

View File

@ -47,11 +47,11 @@ impl Animation for JumpAnimation {
next.shorts.ori = Quaternion::rotation_z(0.0); next.shorts.ori = Quaternion::rotation_z(0.0);
next.shorts.scale = Vec3::one(); next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new(-8.0, 0.0 + wave_stop * 3.2, 7.0 + wave_stop * 3.2 -wave * 0.3) / 11.0; next.l_hand.offset = Vec3::new(-8.0, 0.0 + wave_stop * 3.8, 7.0 + wave_stop * 3.2 -wave * 0.4) / 11.0;
next.l_hand.ori = Quaternion::rotation_x(wave_stop_alt * 0.6); next.l_hand.ori = Quaternion::rotation_x(wave_stop_alt * 0.6);
next.l_hand.scale = Vec3::one() / 11.0; next.l_hand.scale = Vec3::one() / 11.0;
next.r_hand.offset = Vec3::new(8.0, 0.0 + wave_stop * -3.2, 7.0 + wave_stop * 3.2 - wave * 0.3) / 11.0; next.r_hand.offset = Vec3::new(8.0, 0.0 + wave_stop * -3.8, 7.0 + wave_stop * 3.2 - wave * 0.4) / 11.0;
next.r_hand.ori = Quaternion::rotation_x(-wave_stop_alt * 0.6); next.r_hand.ori = Quaternion::rotation_x(-wave_stop_alt * 0.6);
next.r_hand.scale = Vec3::one() / 11.0; next.r_hand.scale = Vec3::one() / 11.0;
@ -63,23 +63,25 @@ impl Animation for JumpAnimation {
next.r_foot.ori = Quaternion::rotation_x(wave_stop * 1.2 + wave_slow * 0.2); next.r_foot.ori = Quaternion::rotation_x(wave_stop * 1.2 + wave_slow * 0.2);
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
next.weapon.offset = Vec3::new(-5.0, -5.0, 12.0); next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0);
next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.ori = Quaternion::rotation_y(2.5);
next.weapon.scale = Vec3::one(); next.weapon.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one(); next.l_shoulder.scale = Vec3::one() * 1.04;
next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5); next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5);
next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one(); next.r_shoulder.scale = Vec3::one() * 1.04;
next.draw.offset = Vec3::new(13.5, 0.0, 0.0); next.draw.offset = Vec3::new(13.5, 0.0, 0.0);
next.draw.ori = Quaternion::rotation_y(0.0); next.draw.ori = Quaternion::rotation_y(0.0);
next.draw.scale = Vec3::one() * 0.0; next.draw.scale = Vec3::one() * 0.0;
next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0;
next.left_equip.ori = Quaternion::rotation_x(0.0);;
next.left_equip.scale = Vec3::one() *0.0;
next.torso.offset = Vec3::new(-0.5, -0.2, 0.0); next.torso.offset = Vec3::new(-0.5, -0.2, 0.0);
next.torso.ori = Quaternion::rotation_x(-0.2); next.torso.ori = Quaternion::rotation_x(-0.2);

View File

@ -46,11 +46,11 @@ impl Animation for RunAnimation {
next.shorts.scale = Vec3::one(); next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new(-8.0, 3.0 + wave_cos * 5.0, 9.0 - wave * 2.0) / 11.0; next.l_hand.offset = Vec3::new(-8.0, 3.0 + wave_cos * 5.0, 9.0 - wave * 2.0) / 11.0;
next.l_hand.ori = Quaternion::rotation_x(wave_cos * 0.9); next.l_hand.ori = Quaternion::rotation_x(wave_cos * 1.1);
next.l_hand.scale = Vec3::one() / 11.0; next.l_hand.scale = Vec3::one() / 11.0;
next.r_hand.offset = Vec3::new(8.0, 3.0 - wave_cos * 5.0, 9.0 + wave * 2.0) / 11.0; next.r_hand.offset = Vec3::new(8.0, 3.0 - wave_cos * 5.0, 9.0 + wave * 2.0) / 11.0;
next.r_hand.ori = Quaternion::rotation_x(wave_cos * -0.9); next.r_hand.ori = Quaternion::rotation_x(wave_cos * -1.1);
next.r_hand.scale = Vec3::one() / 11.0; next.r_hand.scale = Vec3::one() / 11.0;
next.l_foot.offset = Vec3::new(-3.4, 0.0 + wave * 1.0, 6.0); next.l_foot.offset = Vec3::new(-3.4, 0.0 + wave * 1.0, 6.0);
@ -61,22 +61,26 @@ impl Animation for RunAnimation {
next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave * 1.5); next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave * 1.5);
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
next.weapon.offset = Vec3::new(-5.0, -5.0, 12.0); next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0);
next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.ori = Quaternion::rotation_y(2.5);
next.weapon.scale = Vec3::one(); next.weapon.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one(); next.l_shoulder.scale = Vec3::one() * 1.04;
next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5); next.r_shoulder.offset = Vec3::new(0.0, -3.0, 2.5);
next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one(); next.r_shoulder.scale = Vec3::one() * 1.04;
next.torso.offset = Vec3::new(-0.5, -0.2, 0.4); next.torso.offset = Vec3::new(-0.5, -0.2, 0.4);
next.torso.ori = Quaternion::rotation_x(-velocity * 0.05 - wave_cos * 0.1); next.torso.ori = Quaternion::rotation_x(-velocity * 0.05 - wave_cos * 0.1);
next.torso.scale = Vec3::one() / 11.0; next.torso.scale = Vec3::one() / 11.0;
next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0;
next.left_equip.ori = Quaternion::rotation_x(0.0);;
next.left_equip.scale = Vec3::one() * 0.0;
next.draw.offset = Vec3::new(13.5, 0.0, 0.0); next.draw.offset = Vec3::new(13.5, 0.0, 0.0);
next.draw.ori = Quaternion::rotation_y(0.0); next.draw.ori = Quaternion::rotation_y(0.0);
next.draw.scale = Vec3::one() * 0.0; next.draw.scale = Vec3::one() * 0.0;