This commit is contained in:
jshipsey 2020-03-21 03:40:14 -04:00
parent 08db424169
commit 49986a0e09
3 changed files with 69 additions and 65 deletions

View File

@ -178,25 +178,27 @@ impl Animation for AttackAnimation {
next.main.scale = Vec3::one();
},
Some(ToolKind::Bow(_)) => {
next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0);
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(1.0, 8.0, 2.5);
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
next.l_hand.offset = Vec3::new(1.0, -4.0, -1.0);
next.l_hand.ori = Quaternion::rotation_x(1.27)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.offset = Vec3::new(3.0, -1.0, -6.0);
next.r_hand.ori = Quaternion::rotation_x(1.27)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.main.offset = Vec3::new(3.0, 2.0, -13.0);
next.main.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-4.0 + skeleton_attr.weapon_x,
15.0 + skeleton_attr.weapon_y,
-4.0,
);
next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.0);
* Quaternion::rotation_z(-0.6);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(-7.0, 6.0, 6.0);
next.control.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.control.scale = Vec3::one();
},
Some(ToolKind::Dagger(_)) => {
next.l_hand.offset =

View File

@ -1,6 +1,5 @@
use super::{super::Animation, CharacterSkeleton, SkeletonAttr};
use common::comp::item::ToolKind;
use std::f32::consts::PI;
use vek::*;
pub struct Input {
@ -32,7 +31,6 @@ impl Animation for ShootAnimation {
/ (0.5 + 4.5 * ((anim_time as f32 * lab as f32 * 2.0).cos()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 2.0).cos());
let slow = (((5.0)
/ (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 12.4).sin()).powf(2.0 as f32)))
.sqrt())
@ -41,6 +39,10 @@ impl Animation for ShootAnimation {
/ (0.1 + 4.9 * ((anim_time as f32 * lab as f32 * 4.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 4.0).sin());
let sloweralt = (((5.0)
/ (0.1 + 4.9 * ((anim_time as f32 * lab as f32 * 4.0).cos()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 4.0).cos());
next.head.offset = Vec3::new(
0.0 + skeleton_attr.neck_right,
@ -184,25 +186,31 @@ impl Animation for ShootAnimation {
next.main.scale = Vec3::one();
},
Some(ToolKind::Bow(_)) => {
next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0);
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(1.0, 8.0, 2.5);
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-4.0 + skeleton_attr.weapon_x,
15.0 + skeleton_attr.weapon_y,
-4.0,
next.l_hand.offset = Vec3::new(
1.0 - sloweralt * 2.0,
-4.0 - sloweralt * 7.0,
-1.0 + sloweralt * 6.0,
);
next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.0);
next.l_hand.ori = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6 + sloweralt * 0.8)
* Quaternion::rotation_z(-0.3 + sloweralt * 0.9);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.offset = Vec3::new(3.0, -1.0, -5.0);
next.r_hand.ori = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.main.offset = Vec3::new(3.0, 2.0, -13.0);
next.main.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(-0.6);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(-7.0, 6.0, 6.0);
next.control.ori = Quaternion::rotation_x((sloweralt * 0.4).max(0.4))
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.control.scale = Vec3::one();
},
Some(ToolKind::Dagger(_)) => {
next.l_hand.offset =

View File

@ -61,10 +61,10 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_z(-0.8);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
next.control.ori = Quaternion::rotation_x(wave_ultra_slow_cos * 0.1)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(wave_ultra_slow * 0.1);
next.control.offset = Vec3::new(0.0, 0.0, -2.0);
next.control.ori = Quaternion::rotation_x(wave_ultra_slow_cos * 0.1 + 0.2)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(wave_ultra_slow * 0.1 - 0.5);
next.control.scale = Vec3::one();
},
Some(ToolKind::Hammer(_)) => {
@ -125,33 +125,27 @@ impl Animation for WieldAnimation {
next.main.scale = Vec3::one();
},
Some(ToolKind::Bow(_)) => {
next.l_hand.offset = Vec3::new(
-1.0 - wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5,
5.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(
1.0 + wave_ultra_slow_cos * 1.0,
8.0 + wave_ultra_slow_cos * 0.5,
2.5 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
next.l_hand.offset = Vec3::new(1.0, -4.0, -1.0);
next.l_hand.ori = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.l_hand.scale = Vec3::one() * 1.05;
next.r_hand.offset = Vec3::new(3.0, -1.0, -5.0);
next.r_hand.ori = Quaternion::rotation_x(1.20)
* Quaternion::rotation_y(-0.6)
* Quaternion::rotation_z(-0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.main.offset = Vec3::new(3.0, 2.0, -13.0);
next.main.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-4.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
15.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
-4.0 + wave_ultra_slow * 1.0,
);
next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.0);
* Quaternion::rotation_z(-0.6);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(-7.0, 6.0, 6.0);
next.control.ori = Quaternion::rotation_x(wave_ultra_slow * 0.2)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(wave_ultra_slow_cos * 0.1);
next.control.scale = Vec3::one();
},
Some(ToolKind::Dagger(_)) => {
next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0);