axe, hammer proper wields

This commit is contained in:
jshipsey 2020-03-20 01:27:54 -04:00
parent 6094e4b017
commit 93bea033d9
4 changed files with 38 additions and 37 deletions

View File

@ -61,6 +61,7 @@ impl Animation for AttackAnimation {
* Quaternion::rotation_y(decel * 0.08);
next.shorts.scale = Vec3::one();
match active_tool_kind {
//TODO: Inventory
Some(ToolKind::Sword(_)) => {

View File

@ -120,6 +120,7 @@ pub struct SkeletonAttr {
neck_right: f32,
weapon_x: f32,
weapon_y: f32,
}
impl SkeletonAttr {
pub fn calculate_scale(body: &comp::humanoid::Body) -> f32 {
@ -151,6 +152,7 @@ impl Default for SkeletonAttr {
neck_right: 1.0,
weapon_x: 1.0,
weapon_y: 1.0,
}
}
}

View File

@ -86,7 +86,7 @@ impl Animation for StandAnimation {
next.main.offset = Vec3::new(
-7.0 + skeleton_attr.weapon_x,
-5.0 + skeleton_attr.weapon_y,
18.0,
15.0,
);
next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
next.main.scale = Vec3::one();

View File

@ -19,7 +19,7 @@ impl Animation for WieldAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin();
let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin();
let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
let wave = (anim_time as f32 * 1.0).sin();
@ -45,44 +45,42 @@ impl Animation for WieldAnimation {
next.control.scale = Vec3::one();
},
Some(ToolKind::Axe(_)) => {
next.l_hand.offset = Vec3::new(-6.5, -0.5, 6.0);
next.l_hand.ori = Quaternion::rotation_x(0.13) * Quaternion::rotation_z(-0.25);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(-3.0, 6.5, 6.0);
next.r_hand.ori = Quaternion::rotation_x(0.13)
* Quaternion::rotation_z(2.98)
* Quaternion::rotation_y(-0.50);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-5.0 + skeleton_attr.weapon_x,
8.5 + skeleton_attr.weapon_y,
-0.5,
);
next.main.ori = Quaternion::rotation_x(1.70)
* Quaternion::rotation_y(-0.25)
* Quaternion::rotation_z(0.0);
next.l_hand.offset = Vec3::new(-4.0, 3.0, 6.0);
next.l_hand.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_z(3.14 - 0.3) * Quaternion::rotation_y(-0.8);
next.l_hand.scale = Vec3::one() * 1.08;
next.r_hand.offset = Vec3::new(-2.5, 9.0, 4.0);
next.r_hand.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_z(3.14 - 0.3)* Quaternion::rotation_y(-0.8);
next.r_hand.scale = Vec3::one() * 1.06;
next.main.offset = Vec3::new(-6.0, 10.0, -1.0);
next.main.ori = Quaternion::rotation_x(1.27)
* Quaternion::rotation_y(-0.3)
* 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.scale = Vec3::one();
},
Some(ToolKind::Hammer(_)) => {
next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0);
next.l_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(7.0, 2.5, -1.25);
next.r_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
5.0 + skeleton_attr.weapon_x,
8.75 + skeleton_attr.weapon_y,
-2.0,
);
next.main.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(-1.27)
* Quaternion::rotation_z(wave * -0.25);
next.l_hand.offset = Vec3::new(-7.0, 4.6, 7.5);
next.l_hand.ori = Quaternion::rotation_x(0.3) * Quaternion::rotation_y(0.32);
next.l_hand.scale = Vec3::one() * 1.08;
next.r_hand.offset = Vec3::new(8.0, 5.75, 4.0);
next.r_hand.ori = Quaternion::rotation_x(0.3) * Quaternion::rotation_y(0.22);
next.r_hand.scale = Vec3::one() * 1.06;
next.main.offset = Vec3::new(6.0, 7.0, 0.0);
next.main.ori = Quaternion::rotation_x(0.3)
* Quaternion::rotation_y(-1.35)
* Quaternion::rotation_z(1.57);
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 * 0.15)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(wave_ultra_slow_cos * 0.08);
next.control.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) => {
next.l_hand.offset = Vec3::new(
@ -196,7 +194,7 @@ impl Animation for WieldAnimation {
_ => {},
}
next.torso.offset = Vec3::new(0.0, 0.0 + wave * -0.08, 0.1) * skeleton_attr.scaler;
next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;