mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fixed critter animation
This commit is contained in:
parent
047f6b8a01
commit
c7d9b5ae0f
@ -29,23 +29,11 @@ impl Animation for SpinAnimation {
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 10.32).sin());
|
||||
|
||||
let accel_med = 1.0 - (anim_time as f32 * 16.0 * lab as f32).cos();
|
||||
let accel_slow = 1.0 - (anim_time as f32 * 12.0 * lab as f32).cos();
|
||||
let accel_fast = 1.0 - (anim_time as f32 * 24.0 * lab as f32).cos();
|
||||
let decel = (anim_time as f32 * 16.0 * lab as f32).min(PI / 2.0).sin();
|
||||
|
||||
let spin = (anim_time as f32 * 2.8 * lab as f32).sin();
|
||||
let spinhalf = (anim_time as f32 * 1.4 * lab as f32).sin();
|
||||
|
||||
let slow = (((5.0)
|
||||
/ (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 12.4).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 12.4).sin());
|
||||
let slower = (((5.0)
|
||||
/ (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());
|
||||
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
|
@ -41,9 +41,9 @@ impl Animation for IdleAnimation {
|
||||
next.chest.offset = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.chest.0,
|
||||
skeleton_attr.chest.1 + wave * 1.0,
|
||||
skeleton_attr.chest.1 + wave * 0.3,
|
||||
) / 18.0;
|
||||
next.chest.ori = Quaternion::rotation_y(wave_slow * 0.2);
|
||||
next.chest.ori = Quaternion::rotation_y(wave_slow * 0.06);
|
||||
next.chest.scale = Vec3::one() / 18.0;
|
||||
|
||||
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1) / 18.0;
|
||||
@ -56,7 +56,7 @@ impl Animation for IdleAnimation {
|
||||
|
||||
next.tail.offset =
|
||||
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 1.0, skeleton_attr.tail.1) / 18.0;
|
||||
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.25);
|
||||
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.05);
|
||||
next.tail.scale = Vec3::one() / 18.0;
|
||||
|
||||
next
|
||||
|
@ -44,7 +44,7 @@ impl Animation for RunAnimation {
|
||||
|
||||
next.tail.offset =
|
||||
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 1.0, skeleton_attr.tail.1) / 18.0;
|
||||
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.25);
|
||||
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.08);
|
||||
next.tail.scale = Vec3::one() / 18.0;
|
||||
|
||||
next
|
||||
|
Loading…
Reference in New Issue
Block a user