mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
bow work
This commit is contained in:
parent
08db424169
commit
49986a0e09
@ -178,25 +178,27 @@ impl Animation for AttackAnimation {
|
|||||||
next.main.scale = Vec3::one();
|
next.main.scale = Vec3::one();
|
||||||
},
|
},
|
||||||
Some(ToolKind::Bow(_)) => {
|
Some(ToolKind::Bow(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0);
|
next.l_hand.offset = Vec3::new(1.0, -4.0, -1.0);
|
||||||
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
next.l_hand.ori = Quaternion::rotation_x(1.27)
|
||||||
* Quaternion::rotation_y(-0.3)
|
* Quaternion::rotation_y(-0.6)
|
||||||
* Quaternion::rotation_z(0.3);
|
* Quaternion::rotation_z(-0.3);
|
||||||
next.l_hand.scale = Vec3::one() * 1.01;
|
next.l_hand.scale = Vec3::one() * 1.05;
|
||||||
next.r_hand.offset = Vec3::new(1.0, 8.0, 2.5);
|
next.r_hand.offset = Vec3::new(3.0, -1.0, -6.0);
|
||||||
next.r_hand.ori = Quaternion::rotation_x(PI / 2.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_y(0.3)
|
||||||
* Quaternion::rotation_z(0.3);
|
* Quaternion::rotation_z(-0.6);
|
||||||
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);
|
|
||||||
next.main.scale = Vec3::one();
|
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(_)) => {
|
Some(ToolKind::Dagger(_)) => {
|
||||||
next.l_hand.offset =
|
next.l_hand.offset =
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
use super::{super::Animation, CharacterSkeleton, SkeletonAttr};
|
use super::{super::Animation, CharacterSkeleton, SkeletonAttr};
|
||||||
use common::comp::item::ToolKind;
|
use common::comp::item::ToolKind;
|
||||||
use std::f32::consts::PI;
|
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
pub struct Input {
|
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)))
|
/ (0.5 + 4.5 * ((anim_time as f32 * lab as f32 * 2.0).cos()).powf(2.0 as f32)))
|
||||||
.sqrt())
|
.sqrt())
|
||||||
* ((anim_time as f32 * lab as f32 * 2.0).cos());
|
* ((anim_time as f32 * lab as f32 * 2.0).cos());
|
||||||
|
|
||||||
let slow = (((5.0)
|
let slow = (((5.0)
|
||||||
/ (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 12.4).sin()).powf(2.0 as f32)))
|
/ (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 12.4).sin()).powf(2.0 as f32)))
|
||||||
.sqrt())
|
.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)))
|
/ (0.1 + 4.9 * ((anim_time as f32 * lab as f32 * 4.0).sin()).powf(2.0 as f32)))
|
||||||
.sqrt())
|
.sqrt())
|
||||||
* ((anim_time as f32 * lab as f32 * 4.0).sin());
|
* ((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(
|
next.head.offset = Vec3::new(
|
||||||
0.0 + skeleton_attr.neck_right,
|
0.0 + skeleton_attr.neck_right,
|
||||||
@ -184,25 +186,31 @@ impl Animation for ShootAnimation {
|
|||||||
next.main.scale = Vec3::one();
|
next.main.scale = Vec3::one();
|
||||||
},
|
},
|
||||||
Some(ToolKind::Bow(_)) => {
|
Some(ToolKind::Bow(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0);
|
next.l_hand.offset = Vec3::new(
|
||||||
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
1.0 - sloweralt * 2.0,
|
||||||
* Quaternion::rotation_y(-0.3)
|
-4.0 - sloweralt * 7.0,
|
||||||
* Quaternion::rotation_z(0.3);
|
-1.0 + sloweralt * 6.0,
|
||||||
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.main.ori = Quaternion::rotation_x(0.0)
|
next.l_hand.ori = Quaternion::rotation_x(1.20)
|
||||||
* Quaternion::rotation_y(0.4)
|
* Quaternion::rotation_y(-0.6 + sloweralt * 0.8)
|
||||||
* Quaternion::rotation_z(0.0);
|
* 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.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(_)) => {
|
Some(ToolKind::Dagger(_)) => {
|
||||||
next.l_hand.offset =
|
next.l_hand.offset =
|
||||||
|
@ -61,10 +61,10 @@ impl Animation for WieldAnimation {
|
|||||||
* Quaternion::rotation_z(-0.8);
|
* Quaternion::rotation_z(-0.8);
|
||||||
next.main.scale = Vec3::one();
|
next.main.scale = Vec3::one();
|
||||||
|
|
||||||
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
|
next.control.offset = Vec3::new(0.0, 0.0, -2.0);
|
||||||
next.control.ori = Quaternion::rotation_x(wave_ultra_slow_cos * 0.1)
|
next.control.ori = Quaternion::rotation_x(wave_ultra_slow_cos * 0.1 + 0.2)
|
||||||
* Quaternion::rotation_y(0.0)
|
* Quaternion::rotation_y(-0.3)
|
||||||
* Quaternion::rotation_z(wave_ultra_slow * 0.1);
|
* Quaternion::rotation_z(wave_ultra_slow * 0.1 - 0.5);
|
||||||
next.control.scale = Vec3::one();
|
next.control.scale = Vec3::one();
|
||||||
},
|
},
|
||||||
Some(ToolKind::Hammer(_)) => {
|
Some(ToolKind::Hammer(_)) => {
|
||||||
@ -125,33 +125,27 @@ impl Animation for WieldAnimation {
|
|||||||
next.main.scale = Vec3::one();
|
next.main.scale = Vec3::one();
|
||||||
},
|
},
|
||||||
Some(ToolKind::Bow(_)) => {
|
Some(ToolKind::Bow(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(
|
next.l_hand.offset = Vec3::new(1.0, -4.0, -1.0);
|
||||||
-1.0 - wave_ultra_slow_cos * 1.0,
|
next.l_hand.ori = Quaternion::rotation_x(1.20)
|
||||||
3.0 + wave_ultra_slow_cos * 0.5,
|
* Quaternion::rotation_y(-0.6)
|
||||||
5.0 + wave_ultra_slow * 1.0,
|
* Quaternion::rotation_z(-0.3);
|
||||||
);
|
next.l_hand.scale = Vec3::one() * 1.05;
|
||||||
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
next.r_hand.offset = Vec3::new(3.0, -1.0, -5.0);
|
||||||
* Quaternion::rotation_y(-0.3)
|
next.r_hand.ori = Quaternion::rotation_x(1.20)
|
||||||
* Quaternion::rotation_z(0.3);
|
* Quaternion::rotation_y(-0.6)
|
||||||
next.l_hand.scale = Vec3::one() * 1.01;
|
* Quaternion::rotation_z(-0.3);
|
||||||
next.r_hand.offset = Vec3::new(
|
next.r_hand.scale = Vec3::one() * 1.05;
|
||||||
1.0 + wave_ultra_slow_cos * 1.0,
|
next.main.offset = Vec3::new(3.0, 2.0, -13.0);
|
||||||
8.0 + wave_ultra_slow_cos * 0.5,
|
next.main.ori = Quaternion::rotation_x(-0.3)
|
||||||
2.5 + wave_ultra_slow * 1.0,
|
|
||||||
);
|
|
||||||
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
|
|
||||||
* Quaternion::rotation_y(0.3)
|
* Quaternion::rotation_y(0.3)
|
||||||
* Quaternion::rotation_z(0.3);
|
* Quaternion::rotation_z(-0.6);
|
||||||
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);
|
|
||||||
next.main.scale = Vec3::one();
|
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(_)) => {
|
Some(ToolKind::Dagger(_)) => {
|
||||||
next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0);
|
next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user