mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cleanup 2
This commit is contained in:
parent
e5734c1829
commit
f79181c01f
@ -27,7 +27,7 @@ impl Animation for AlphaAnimation {
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, second_tool_kind, velocity, global_time, stage_section): Self::Dependency,
|
||||
(active_tool_kind, second_tool_kind, _velocity, global_time, stage_section): Self::Dependency,
|
||||
anim_time: f64,
|
||||
rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
@ -44,30 +44,11 @@ impl Animation for AlphaAnimation {
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
let foot = (((1.0)
|
||||
/ (0.2
|
||||
+ 0.8
|
||||
* ((anim_time as f32 * lab as f32 * 2.0 * velocity).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 2.0 * velocity).sin());
|
||||
let slowersmooth = (anim_time as f32 * lab as f32 * 4.0).sin();
|
||||
let decel = (anim_time as f32 * 16.0 * lab as f32).min(PI / 2.0).sin();
|
||||
let slow = (((5.0)
|
||||
/ (0.4 + 4.6 * ((anim_time as f32 * lab as f32 * 9.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 9.0).sin());
|
||||
let quick = (((5.0)
|
||||
/ (0.4 + 4.6 * ((anim_time as f32 * lab as f32 * 18.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 18.0).sin());
|
||||
let axe = (((1.0)
|
||||
/ (0.05 + 0.95 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 8.0).sin());
|
||||
let staff = (((1.0)
|
||||
/ (0.05 + 0.95 * ((anim_time as f32 * lab as f32 * 10.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 10.0).sin());
|
||||
|
||||
let slower = (((1.0)
|
||||
/ (0.05
|
||||
@ -88,20 +69,20 @@ impl Animation for AlphaAnimation {
|
||||
|
||||
let switch = if random > 0.5 { 1.0 } else { -1.0 };
|
||||
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.scale = Vec3::one() * 1.04;
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-4.75, -1.0, 2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.position = Vec3::new(0.75, -1.5, -0.5);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3);
|
||||
next.hand_r.scale = Vec3::one() * 1.05;
|
||||
next.main.position = Vec3::new(0.0, 5.0, -6.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
@ -118,136 +99,35 @@ impl Animation for AlphaAnimation {
|
||||
movement1 * 1.5 + (movement2 * 1.75).sin() * -3.0 + movement3 * 0.5,
|
||||
);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0 + 0.0, s_a.head.1);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(
|
||||
movement1 * -0.9 + (movement2 * 1.75).sin() * 2.5 + movement3 * -0.5,
|
||||
);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(slow * -0.25)
|
||||
* Quaternion::rotation_x(0.0 + slow * 0.15)
|
||||
* Quaternion::rotation_y(slow * -0.15);
|
||||
next.head.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(slow * 0.4)
|
||||
* Quaternion::rotation_x(0.0 + slow * -0.2)
|
||||
* Quaternion::rotation_y(slow * 0.2);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation = next.upper_torso.orientation * -0.45;
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.12;
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.hand_r.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.12;
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
s_a.foot.1 + slow * -3.0 + quick * 3.0 - 4.0,
|
||||
s_a.foot.2 + s_a.foot.2,
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(slow * 0.6)
|
||||
* Quaternion::rotation_y((slow * -0.2).max(0.0));
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1 + slow * 3.0 + quick * -3.0 + 5.0,
|
||||
s_a.foot.2 + s_a.foot.2,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(slow * -0.6)
|
||||
* Quaternion::rotation_y((slow * 0.2).min(0.0));
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
next.head.position = Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(0.1 + axe * 0.2)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.2);
|
||||
next.head.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.2 + axe * 0.2);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(0.2 + axe * -0.2);
|
||||
|
||||
next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.08;
|
||||
next.hand_r.position = Vec3::new(0.5, 0.0, -2.5);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.06;
|
||||
next.main.position = Vec3::new(-0.0, -2.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
next.control.position = Vec3::new(2.0 + axe * -7.0, 11.0, 3.0);
|
||||
next.control.orientation = Quaternion::rotation_x(1.6)
|
||||
* Quaternion::rotation_y(-2.0 + axe * 0.5)
|
||||
* Quaternion::rotation_z(PI * 0.4);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position =
|
||||
Vec3::new(s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-1.57)
|
||||
* Quaternion::rotation_z(1.0);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
next.main.orientation = Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.0);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(slower * 0.03)
|
||||
* Quaternion::rotation_x(-0.3 + slowersmooth * 0.1)
|
||||
* Quaternion::rotation_y(slower * 0.05 + slowersmooth * 0.06)
|
||||
* Quaternion::rotation_z((slowersmooth * -0.4).max(0.0));
|
||||
next.head.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(slower * 0.18 + slowersmooth * 0.15)
|
||||
* Quaternion::rotation_x(0.0 + slower * 0.18 + slowersmooth * 0.15)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
* Quaternion::rotation_x(slower * 0.05 + slowersmooth * 0.05);
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
@ -255,189 +135,59 @@ impl Animation for AlphaAnimation {
|
||||
* Quaternion::rotation_x(0.0 + slower * -0.1)
|
||||
* Quaternion::rotation_y(slower * -0.1);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
|
||||
if velocity > 0.5 {
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, foot * -6.0, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(foot * -0.4)
|
||||
* Quaternion::rotation_z((slower * 0.3).max(0.0));
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, foot * 6.0, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(foot * 0.4)
|
||||
* Quaternion::rotation_z((slower * 0.3).max(0.0));
|
||||
next.foot_r.scale = Vec3::one();
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.) * 1.01;
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.15);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
} else {
|
||||
next.foot_l.position =
|
||||
Vec3::new(-s_a.foot.0, -2.5, s_a.foot.2 + (slower * 2.5).max(0.0));
|
||||
next.foot_l.orientation = Quaternion::rotation_x(slower * -0.2 - 0.2)
|
||||
* Quaternion::rotation_z((slower * 1.0).max(0.0));
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, 3.5 - slower * 2.0, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(slower * 0.1)
|
||||
* Quaternion::rotation_z((slower * 0.5).max(0.0));
|
||||
next.foot_r.scale = Vec3::one();
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
}
|
||||
|
||||
next.control.scale = Vec3::one();
|
||||
next.control.position = Vec3::new(-8.0, 7.0 + slower * 4.0, 1.0 + slower * -9.0);
|
||||
next.control.orientation = Quaternion::rotation_x(-1.5 + slower * -1.2)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(1.5);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
},
|
||||
Some(ToolKind::Staff(_)) => {
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_x(staff * 0.2) * Quaternion::rotation_z(staff * 0.2);
|
||||
next.hand_l.position = Vec3::new(11.0, 5.0, -4.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.position = Vec3::new(12.0, 5.5, 2.0);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.main.position = Vec3::new(12.0, 8.5, 13.2);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(3.14)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(staff * 0.3);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(staff * 0.4);
|
||||
|
||||
next.control.position = Vec3::new(-20.0, 5.0 + staff * 3.0, 1.0);
|
||||
next.control.orientation = Quaternion::rotation_x(staff * 1.2)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
},
|
||||
Some(ToolKind::Shield(_)) => {
|
||||
next.head.position = Vec3::new(0.0, 0.0 + s_a.head.0 + decel * 0.8, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(decel * 0.25)
|
||||
* Quaternion::rotation_x(0.0 + decel * 0.1)
|
||||
* Quaternion::rotation_y(decel * -0.1);
|
||||
next.head.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, 0.0, 7.0);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(decel * -0.2)
|
||||
* Quaternion::rotation_x(0.0 + decel * -0.2)
|
||||
* Quaternion::rotation_y(decel * 0.2);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * 1.01;
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_z(0.0);
|
||||
|
||||
next.hand_r.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.01;
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation = Quaternion::rotation_x(0.0);
|
||||
},
|
||||
Some(ToolKind::Debug(_)) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.01;
|
||||
next.main.position = Vec3::new(-5.0, 5.0, 23.0);
|
||||
next.main.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(PI)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.main.scale = Vec3::one();
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * 1.01;
|
||||
next.torso.orientation = Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0 * 1.01;
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(-1.5 + slower * -1.2) * Quaternion::rotation_z(1.5);
|
||||
},
|
||||
Some(ToolKind::NpcWeapon(_)) => {
|
||||
if switch > 0.0 {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0))
|
||||
* Quaternion::rotation_x(-0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0))
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
next.upper_torso.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0));
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0))
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
next.lower_torso.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0));
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(-1.5) * Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.orientation = Quaternion::rotation_z(-1.5);
|
||||
|
||||
next.arm_control_r.position = Vec3::new(0.0, 0.0, -4.0);
|
||||
next.arm_control_r.orientation = Quaternion::rotation_x(1.0)
|
||||
* Quaternion::rotation_y(slow * -1.35)
|
||||
* Quaternion::rotation_z(-0.0);
|
||||
next.arm_control_r.scale = Vec3::one() * 1.02;
|
||||
next.arm_control_r.orientation =
|
||||
Quaternion::rotation_x(1.0) * Quaternion::rotation_y(slow * -1.35);
|
||||
|
||||
next.tail.orientation = Quaternion::rotation_z(twist * 0.5);
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0))
|
||||
* Quaternion::rotation_x(-0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z((twist * -0.5).max(-1.0))
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z((twist * 0.5).min(1.0))
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
|
||||
next.arm_control_l.position = Vec3::new(0.0, 0.0, -4.0);
|
||||
next.arm_control_l.orientation = Quaternion::rotation_x(1.0)
|
||||
* Quaternion::rotation_y(slow * 1.35)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.arm_control_l.scale = Vec3::one() * 1.02;
|
||||
next.arm_control_l.orientation =
|
||||
Quaternion::rotation_x(1.0) * Quaternion::rotation_y(slow * 1.35);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_z(1.5) * Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_l.orientation = Quaternion::rotation_z(1.5);
|
||||
|
||||
next.tail.orientation = Quaternion::rotation_z(twist * -0.5);
|
||||
};
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.second.scale = match (
|
||||
active_tool_kind.map(|tk| tk.hands()),
|
||||
second_tool_kind.map(|tk| tk.hands()),
|
||||
|
@ -44,22 +44,17 @@ impl Animation for BeamAnimation {
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, -4.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.05;
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2);
|
||||
next.hand_r.scale = Vec3::one() * 1.05;
|
||||
next.hand_r.scale = Vec3::one() * 1.04;
|
||||
next.main.position = Vec3::new(0.0, 8.0, 13.2);
|
||||
next.main.orientation = Quaternion::rotation_y(PI);
|
||||
|
||||
next.control.position = Vec3::new(-4.0, 7.0, 4.0);
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3)
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.15);
|
||||
|
||||
//println!("{:?}", anim_time);
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
next.control.position = Vec3::new(
|
||||
-4.0 + movement1 * 16.0 + movement3 * -16.0,
|
||||
|
@ -23,21 +23,8 @@ impl Animation for WieldAnimation {
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
let head_look = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 3.0)
|
||||
.floor()
|
||||
.mul(7331.0)
|
||||
.sin()
|
||||
* 0.2,
|
||||
((global_time + anim_time) as f32 / 3.0)
|
||||
.floor()
|
||||
.mul(1337.0)
|
||||
.sin()
|
||||
* 0.1,
|
||||
);
|
||||
|
||||
let lab = 0.55;
|
||||
let breathe = 0.0;
|
||||
let test = (anim_time as f32 + 36.0 * PI).sin();
|
||||
let torso = (anim_time as f32 * lab as f32 + 1.5 * PI).sin();
|
||||
|
||||
@ -116,49 +103,45 @@ impl Animation for WieldAnimation {
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.scale = Vec3::one() * 1.04;
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
next.leg_l.scale = Vec3::one() * 0.98;
|
||||
next.leg_r.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.control.position = Vec3::new(7.0, 9.0, -10.0);
|
||||
next.control.orientation = Quaternion::rotation_x(test * 0.02)
|
||||
* Quaternion::rotation_y(test * 0.02)
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-1.57)
|
||||
* Quaternion::rotation_z(1.0);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
|
||||
if velocity > 0.5 {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + shortalt * -1.5);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(short * 0.18);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-s_a.shoulder.0,
|
||||
@ -168,7 +151,6 @@ impl Animation for WieldAnimation {
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(0.5 + footrotl * -0.16)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * 0.1);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
s_a.shoulder.0,
|
||||
@ -178,26 +160,20 @@ impl Animation for WieldAnimation {
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(0.5 + footrotr * -0.16)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * -0.1);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.2) * 1.02;
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5);
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + breathe * 0.15);
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
@ -205,155 +181,48 @@ impl Animation for WieldAnimation {
|
||||
next.jaw.position =
|
||||
Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position =
|
||||
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.leg_l.position =
|
||||
Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position =
|
||||
Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.2) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation = Quaternion::rotation_z(test * 0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.control.position = Vec3::new(7.0, 9.0, -10.0);
|
||||
next.control.orientation = Quaternion::rotation_x(test * 0.02)
|
||||
* Quaternion::rotation_y(test * 0.02)
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-4.75, -1.0, 2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.position = Vec3::new(3.75, -1.5, -0.5);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.main.position = Vec3::new(3.0, 6.0, -5.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1);
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 7.0, -10.0);
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
next.control.scale = Vec3::one();
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
// hands should be larger when holding a dagger grip,
|
||||
// also reduce flicker with overlapping polygons
|
||||
let hand_scale = 1.12;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0 * PI)
|
||||
* Quaternion::rotation_y(0.0 * PI)
|
||||
* Quaternion::rotation_z(0.0 * PI);
|
||||
next.hand_l.scale = Vec3::one() * hand_scale;
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0 * PI)
|
||||
* Quaternion::rotation_y(0.0 * PI)
|
||||
* Quaternion::rotation_z(0.0 * PI);
|
||||
|
||||
next.hand_r.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0 * PI)
|
||||
* Quaternion::rotation_y(0.0 * PI)
|
||||
* Quaternion::rotation_z(0.0 * PI);
|
||||
next.hand_r.scale = Vec3::one() * hand_scale;
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation = Quaternion::rotation_x(0.0 * PI)
|
||||
* Quaternion::rotation_y(0.0 * PI)
|
||||
* Quaternion::rotation_z(0.0 * PI);
|
||||
next.second.scale = Vec3::one();
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
if velocity < 0.5 {
|
||||
next.head.position =
|
||||
Vec3::new(0.0, -3.5 + s_a.head.0, s_a.head.1 + u_slow * 0.1);
|
||||
next.head.orientation = Quaternion::rotation_z(head_look.x)
|
||||
* Quaternion::rotation_x(0.35 + head_look.y.abs());
|
||||
next.head.scale = Vec3::one() * 1.01;
|
||||
next.upper_torso.orientation = Quaternion::rotation_x(-0.35)
|
||||
* Quaternion::rotation_y(u_slowalt * 0.04)
|
||||
* Quaternion::rotation_z(0.15);
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, 1.0 + s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_x(0.15) * Quaternion::rotation_z(0.25);
|
||||
next.control.orientation = Quaternion::rotation_x(1.8)
|
||||
* Quaternion::rotation_y(-0.5)
|
||||
* Quaternion::rotation_z(PI - 0.2);
|
||||
next.control.scale = Vec3::one();
|
||||
} else {
|
||||
next.control.orientation = Quaternion::rotation_x(2.1)
|
||||
* Quaternion::rotation_y(-0.4)
|
||||
* Quaternion::rotation_z(PI - 0.2);
|
||||
next.control.scale = Vec3::one();
|
||||
}
|
||||
next.hand_l.position = Vec3::new(-0.5, 0.0, 4.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.08;
|
||||
next.hand_r.position = Vec3::new(0.5, 0.0, -2.5);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.06;
|
||||
next.main.position = Vec3::new(-0.0, -2.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
next.control.position = Vec3::new(-3.0, 11.0, 3.0);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
next.hand_l.position = Vec3::new(3.0, 2.5, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
* Quaternion::rotation_z(-0.3);
|
||||
next.hand_l.scale = Vec3::one() * 1.05;
|
||||
next.hand_r.position = Vec3::new(5.9, 5.5, -5.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
* Quaternion::rotation_z(-0.3);
|
||||
next.hand_r.scale = Vec3::one() * 1.05;
|
||||
next.main.position = Vec3::new(8.0, 8.0, -13.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.3)
|
||||
* Quaternion::rotation_y(0.3)
|
||||
@ -363,62 +232,46 @@ impl Animation for WieldAnimation {
|
||||
next.hold.orientation = Quaternion::rotation_x(-1.7)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(-0.1);
|
||||
next.hold.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 3.0, -8.0);
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.2)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.1);
|
||||
next.control.scale = Vec3::one();
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position =
|
||||
Vec3::new(s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.control.position = Vec3::new(7.0, 9.0, -10.0);
|
||||
next.control.orientation = Quaternion::rotation_x(test * 0.02)
|
||||
* Quaternion::rotation_y(test * 0.02)
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-1.57)
|
||||
* Quaternion::rotation_z(1.0);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
},
|
||||
Some(ToolKind::Staff(_)) => {
|
||||
next.hand_l.position = Vec3::new(11.0, 5.0, -4.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.05;
|
||||
next.hand_r.position = Vec3::new(17.0, 7.5, 2.0);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.8);
|
||||
next.hand_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position =
|
||||
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.4) * Quaternion::rotation_x(1.0);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.main.position = Vec3::new(10.0, 12.5, 13.2);
|
||||
next.main.orientation = Quaternion::rotation_y(PI);
|
||||
@ -427,142 +280,63 @@ impl Animation for WieldAnimation {
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3 + u_slow * 0.1)
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
next.control.scale = Vec3::one();
|
||||
},
|
||||
Some(ToolKind::NpcWeapon(_)) => {
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.shoulder_l.scale = Vec3::one() + breathe;
|
||||
|
||||
next.shoulder_r.position =
|
||||
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.shoulder_r.scale = Vec3::one() + breathe;
|
||||
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position =
|
||||
Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
if velocity < 0.5 {
|
||||
next.head.position =
|
||||
Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(look.x * 0.6)
|
||||
* Quaternion::rotation_x(look.y * 0.6 + breathe);
|
||||
next.head.scale = Vec3::one() * 1.02 + breathe * 0.4;
|
||||
* Quaternion::rotation_x(look.y * 0.6);
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * 0.5);
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-breathe);
|
||||
next.upper_torso.scale = Vec3::one() - breathe * 0.4;
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.15);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02 + breathe * 0.4;
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.1);
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
next.tail.orientation = Quaternion::rotation_z(slow * 0.2 + tailmove.x);
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation = Quaternion::rotation_x(PI)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.second.scale = Vec3::one() * 0.0;
|
||||
next.second.orientation = Quaternion::rotation_x(PI);
|
||||
|
||||
next.main.position = Vec3::new(-5.0, -7.0, 7.0);
|
||||
next.main.orientation = Quaternion::rotation_x(PI)
|
||||
* Quaternion::rotation_y(0.6)
|
||||
* Quaternion::rotation_z(1.57);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.shoulder_l.scale = Vec3::one() + breathe;
|
||||
|
||||
next.shoulder_r.position =
|
||||
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.shoulder_r.scale = Vec3::one() + breathe;
|
||||
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position =
|
||||
Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + torso * 0.6);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.arm_control_l.scale = Vec3::one() * 1.0;
|
||||
next.arm_control_r.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.leg_control_l.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.leg_l.position =
|
||||
Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
|
||||
next.leg_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_l.scale = Vec3::one();
|
||||
|
||||
next.leg_r.position =
|
||||
Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
|
||||
next.leg_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one();
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
next.foot_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.leg_control_l.scale = Vec3::one() * 1.0;
|
||||
next.leg_control_r.scale = Vec3::one() * 1.0;
|
||||
next.arm_control_l.scale = Vec3::one() * 1.0;
|
||||
next.arm_control_r.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
@ -612,7 +386,6 @@ impl Animation for WieldAnimation {
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * 0.3);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
s_a.shoulder.0,
|
||||
@ -622,7 +395,6 @@ impl Animation for WieldAnimation {
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * -0.3);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-1.0 + -s_a.hand.0,
|
||||
@ -632,7 +404,6 @@ impl Animation for WieldAnimation {
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
|
||||
* Quaternion::rotation_y(handhoril * -0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
1.0 + s_a.hand.0,
|
||||
@ -647,43 +418,26 @@ impl Animation for WieldAnimation {
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(short * 0.18)
|
||||
* Quaternion::rotation_x(foothoril * 0.3);
|
||||
next.leg_l.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 0.98;
|
||||
|
||||
next.leg_r.orientation = Quaternion::rotation_z(short * 0.18)
|
||||
* Quaternion::rotation_x(foothorir * 0.3);
|
||||
next.leg_r.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
s_a.foot.1 + foothoril * 8.5,
|
||||
s_a.foot.2 + ((footvertl * 6.5).max(0.0)),
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(-0.5 + footrotl * 0.85)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
next.foot_l.orientation = Quaternion::rotation_x(-0.5 + footrotl * 0.85);
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1 + foothorir * 8.5,
|
||||
s_a.foot.2 + ((footvertr * 6.5).max(0.0)),
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.5 + footrotr * 0.85)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.5 + footrotr * 0.85);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.leg_control_l.scale = Vec3::one() * 1.0;
|
||||
next.leg_control_r.scale = Vec3::one() * 1.0;
|
||||
next.arm_control_l.scale = Vec3::one() * 1.0;
|
||||
next.arm_control_r.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
next.torso.orientation = Quaternion::rotation_x(-0.25);
|
||||
}
|
||||
},
|
||||
_ => {},
|
||||
|
@ -45,7 +45,6 @@ impl Animation for FeedAnimation {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0 + 1.0, -2.0 + s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(duck_head_look.x)
|
||||
* Quaternion::rotation_x(-0.3 / s_a.feed + wave_slow_cos * 0.03 + wave * 0.1);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(
|
||||
0.0,
|
||||
@ -54,27 +53,19 @@ impl Animation for FeedAnimation {
|
||||
) / 11.0;
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_x(-0.5 * s_a.feed) * Quaternion::rotation_y(wave_slow * 0.03);
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_x(wave_slow_cos * 0.03);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.wing_l.position = Vec3::new(-s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_l.orientation = Quaternion::rotation_y(0.4 - wave_slow * 0.1);
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_r.orientation = Quaternion::rotation_y(-0.4 + wave_slow * 0.1);
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_l.orientation = Quaternion::rotation_y(0.0);
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,12 @@ impl Animation for FlyAnimation {
|
||||
let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin();
|
||||
let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin();
|
||||
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0 + 0.5, s_a.head.1 + center * 0.5 - 1.0);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03);
|
||||
@ -41,27 +47,21 @@ impl Animation for FlyAnimation {
|
||||
center * 0.6 + s_a.chest.1,
|
||||
) / 11.0;
|
||||
next.torso.orientation = Quaternion::rotation_y(center * 0.05);
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1 + centeroffset * 0.6);
|
||||
next.tail.orientation = Quaternion::rotation_x(center * 0.03);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.wing_l.position = Vec3::new(-s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_l.orientation = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0));
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_r.orientation = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0));
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_l.orientation = Quaternion::rotation_x(-1.3 + footl * 0.06);
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_r.orientation = Quaternion::rotation_x(-1.3 + footr * 0.06);
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -40,34 +40,29 @@ impl Animation for IdleAnimation {
|
||||
* 0.25,
|
||||
);
|
||||
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(duck_head_look.x)
|
||||
* Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, s_a.chest.0, wave_slow * 0.3 + s_a.chest.1) / 11.0;
|
||||
next.torso.orientation = Quaternion::rotation_y(wave_slow * 0.03);
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_x(wave_slow_cos * 0.03);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.wing_l.position = Vec3::new(-s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_r.orientation = Quaternion::rotation_y(0.0);
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_l.orientation = Quaternion::rotation_y(0.0);
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
|
||||
next.leg_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -30,10 +30,15 @@ impl Animation for RunAnimation {
|
||||
let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin();
|
||||
let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin();
|
||||
|
||||
next.torso.scale = Vec3::one() / 11.0;
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + center * 0.5);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(
|
||||
0.0,
|
||||
@ -45,23 +50,18 @@ impl Animation for RunAnimation {
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1 + centeroffset * 0.6);
|
||||
next.tail.orientation = Quaternion::rotation_x(center * 0.03);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.wing_l.position = Vec3::new(-s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_l.orientation = Quaternion::rotation_y((footl * 0.35).max(0.0));
|
||||
next.wing_l.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
|
||||
next.wing_r.orientation = Quaternion::rotation_y((footr * 0.35).min(0.0));
|
||||
next.wing_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 + footl * 1.0, s_a.foot.2) / 11.0;
|
||||
next.leg_l.orientation = Quaternion::rotation_x(footl * 0.5);
|
||||
next.leg_l.scale = Vec3::one() / 11.0;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + footr * 1.0, s_a.foot.2) / 11.0;
|
||||
next.leg_r.orientation = Quaternion::rotation_x(footr * 0.5);
|
||||
next.leg_r.scale = Vec3::one() / 11.0;
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,12 @@ impl Animation for FlyAnimation {
|
||||
let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin();
|
||||
let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin();
|
||||
|
||||
next.head_upper.scale = Vec3::one() * 1.05;
|
||||
next.head_lower.scale = Vec3::one() * 1.05;
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position = Vec3::new(
|
||||
0.0,
|
||||
s_a.head_upper.0,
|
||||
@ -45,7 +51,6 @@ impl Animation for FlyAnimation {
|
||||
);
|
||||
next.head_upper.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10);
|
||||
next.head_upper.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.head_lower.position = Vec3::new(
|
||||
0.0,
|
||||
@ -54,7 +59,6 @@ impl Animation for FlyAnimation {
|
||||
);
|
||||
next.head_lower.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10);
|
||||
next.head_lower.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.jaw.position = Vec3::new(
|
||||
0.0,
|
||||
@ -62,17 +66,14 @@ impl Animation for FlyAnimation {
|
||||
s_a.jaw.1 + wave_slow * 0.2,
|
||||
);
|
||||
next.jaw.orientation = Quaternion::rotation_x(wave_slow * 0.03);
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.tail_front.position =
|
||||
Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1 + centeroffset * 0.6);
|
||||
next.tail_front.orientation = Quaternion::rotation_x(center * 0.03);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position =
|
||||
Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1 + centeroffset * 0.6);
|
||||
next.tail_rear.orientation = Quaternion::rotation_x(center * 0.03);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1);
|
||||
next.chest_front.orientation = Quaternion::rotation_y(center * 0.05);
|
||||
@ -80,39 +81,30 @@ impl Animation for FlyAnimation {
|
||||
|
||||
next.chest_rear.position = Vec3::new(0.0, s_a.chest_rear.0, s_a.chest_rear.1);
|
||||
next.chest_rear.orientation = Quaternion::rotation_y(center * 0.05);
|
||||
next.chest_rear.scale = Vec3::one();
|
||||
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(-1.3 + footl * 0.06);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(-1.3 + footr * 0.06);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(-1.3 + footl * 0.06);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(-1.3 + footr * 0.06);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_l.orientation = Quaternion::rotation_y(0.4 + wingl * 0.6);
|
||||
next.wing_in_l.scale = Vec3::one();
|
||||
|
||||
next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_r.orientation = Quaternion::rotation_y(-0.4 + wingr * 0.6);
|
||||
next.wing_in_r.scale = Vec3::one();
|
||||
|
||||
next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_l.orientation = Quaternion::rotation_y((0.35 + wingl * 0.6).max(0.2));
|
||||
next.wing_out_l.scale = Vec3::one();
|
||||
|
||||
next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_r.orientation = Quaternion::rotation_y((-0.35 + wingr * 0.6).min(-0.2));
|
||||
next.wing_out_r.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -40,71 +40,58 @@ impl Animation for IdleAnimation {
|
||||
* 0.25,
|
||||
);
|
||||
|
||||
next.head_upper.scale = Vec3::one() * 1.05;
|
||||
next.head_lower.scale = Vec3::one() * 1.05;
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position =
|
||||
Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1 + ultra_slow * 0.20);
|
||||
next.head_upper.orientation = Quaternion::rotation_z(0.8 * dragon_look.x)
|
||||
* Quaternion::rotation_x(0.8 * dragon_look.y);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
|
||||
next.head_lower.position =
|
||||
Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1 + ultra_slow * 0.20);
|
||||
next.head_lower.orientation = Quaternion::rotation_z(0.8 * dragon_look.x)
|
||||
* Quaternion::rotation_x(-0.2 + 0.8 * dragon_look.y);
|
||||
next.head_lower.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.04);
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1);
|
||||
next.chest_front.orientation = Quaternion::rotation_y(0.0);
|
||||
next.chest_front.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.chest_rear.position = Vec3::new(0.0, s_a.chest_rear.0, s_a.chest_rear.1);
|
||||
next.chest_rear.orientation = Quaternion::rotation_y(0.0);
|
||||
next.chest_rear.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation =
|
||||
Quaternion::rotation_z(slowalt * 0.10) * Quaternion::rotation_x(0.1);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1);
|
||||
next.tail_rear.orientation =
|
||||
Quaternion::rotation_z(slowalt * 0.12) * Quaternion::rotation_x(0.05);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_l.orientation = Quaternion::rotation_y(0.8 + slow * 0.02);
|
||||
next.wing_in_l.scale = Vec3::one();
|
||||
|
||||
next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_r.orientation = Quaternion::rotation_y(-0.8 - slow * 0.02);
|
||||
next.wing_in_r.scale = Vec3::one();
|
||||
|
||||
next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_l.orientation = Quaternion::rotation_y(-2.0 + slow * 0.02);
|
||||
next.wing_out_l.scale = Vec3::one();
|
||||
|
||||
next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_r.orientation = Quaternion::rotation_y(2.0 - slow * 0.02);
|
||||
next.wing_out_r.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -70,17 +70,20 @@ impl Animation for RunAnimation {
|
||||
let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin();
|
||||
let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin();
|
||||
|
||||
next.head_lower.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position = Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1);
|
||||
next.head_upper.orientation = Quaternion::rotation_x(short * -0.03 - 0.1)
|
||||
* Quaternion::rotation_z(tilt * -1.2)
|
||||
* Quaternion::rotation_y(tilt * 0.8);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
|
||||
next.head_lower.position = Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1);
|
||||
next.head_lower.orientation = Quaternion::rotation_z(tilt * -0.8)
|
||||
* Quaternion::rotation_x(short * -0.05)
|
||||
* Quaternion::rotation_y(tilt * 0.3);
|
||||
next.head_lower.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(
|
||||
0.0,
|
||||
@ -88,19 +91,16 @@ impl Animation for RunAnimation {
|
||||
s_a.jaw.1 + wave_slow * 0.2,
|
||||
);
|
||||
next.jaw.orientation = Quaternion::rotation_x(wave_slow * 0.03);
|
||||
next.jaw.scale = Vec3::one() * 1.05;
|
||||
|
||||
next.tail_front.position =
|
||||
Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1 + centeroffset * 0.6);
|
||||
next.tail_front.orientation =
|
||||
Quaternion::rotation_x(center * 0.03) * Quaternion::rotation_z(tilt * 1.5);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position =
|
||||
Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1 + centeroffset * 0.6);
|
||||
next.tail_rear.orientation =
|
||||
Quaternion::rotation_x(center * 0.03) * Quaternion::rotation_z(tilt * 1.5);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest_front.position = Vec3::new(
|
||||
0.0,
|
||||
@ -110,14 +110,12 @@ impl Animation for RunAnimation {
|
||||
next.chest_front.orientation = Quaternion::rotation_x(short * 0.13 + x_tilt)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.chest_front.scale = Vec3::one();
|
||||
|
||||
next.chest_rear.position =
|
||||
Vec3::new(0.0, s_a.chest_rear.0, s_a.chest_rear.1 + shortalt * 0.2);
|
||||
next.chest_rear.orientation = Quaternion::rotation_x(short * 0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(tilt * 1.8);
|
||||
next.chest_rear.scale = Vec3::one();
|
||||
|
||||
next.foot_fl.position = Vec3::new(
|
||||
-s_a.feet_f.0,
|
||||
@ -125,7 +123,6 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_f.2 + vertlf * 5.0 * s_a.height - 0.5,
|
||||
);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(horilf * 0.6);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(
|
||||
s_a.feet_f.0,
|
||||
@ -133,7 +130,6 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_f.2 + vertrfoffset * 5.0 * s_a.height - 0.5,
|
||||
);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(horirb * 0.6);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(
|
||||
-s_a.feet_b.0,
|
||||
@ -141,7 +137,6 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_b.2 + vertlboffset * 5.0 * s_a.height - 0.5,
|
||||
);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(horilf * 0.55);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(
|
||||
s_a.feet_b.0,
|
||||
@ -149,23 +144,18 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_b.2 + vertrb * 5.0 * s_a.height - 0.5,
|
||||
);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(horirb * 0.55);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_l.orientation = Quaternion::rotation_y(0.8 + tilt * 1.0);
|
||||
next.wing_in_l.scale = Vec3::one();
|
||||
|
||||
next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2);
|
||||
next.wing_in_r.orientation = Quaternion::rotation_y(-0.8 + tilt * 1.0);
|
||||
next.wing_in_r.scale = Vec3::one();
|
||||
|
||||
next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_l.orientation = Quaternion::rotation_y(-2.0 + tilt * 1.0);
|
||||
next.wing_out_l.scale = Vec3::one();
|
||||
|
||||
next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2);
|
||||
next.wing_out_r.orientation = Quaternion::rotation_y(2.0 + tilt * 1.0);
|
||||
next.wing_out_r.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -44,107 +44,53 @@ impl Animation for AlphaAnimation {
|
||||
/ 10.0;
|
||||
|
||||
let switch = if random > 0.5 { 1.0 } else { -1.0 };
|
||||
|
||||
if switch > 0.0 {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_x(-0.2);
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1) / 8.0;
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(twist * 1.1) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(twist * 1.1);
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(twist * -1.1) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(slower * 0.4);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(slower * 0.4);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(slower * 0.35);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.orientation = Quaternion::rotation_x(slower * 0.35);
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1) / 8.0;
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(twist * -1.1) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(twist * -1.1);
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(twist * 1.1) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(twist * 1.1);
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(slower * 0.4);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(slower * 0.4);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(slower * 0.35);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_l.orientation = Quaternion::rotation_x(slower * 0.35);
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
};
|
||||
/*
|
||||
next.leg_l.position = Vec3::new(
|
||||
-s_a.leg.0,
|
||||
s_a.leg.1,
|
||||
s_a.leg.2,
|
||||
) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(
|
||||
s_a.leg.0,
|
||||
s_a.leg.1,
|
||||
s_a.leg.2,
|
||||
) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2,
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
*/
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one();
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -39,62 +39,56 @@ impl Animation for IdleAnimation {
|
||||
.sin()
|
||||
* 0.25,
|
||||
);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.2) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position =
|
||||
Vec3::new(0.0, s_a.jaw.0 - breathe * 0.12, s_a.jaw.1 + breathe * 0.2) * 1.02;
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 0.1);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5) / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + breathe * -0.2);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + breathe * 0.6);
|
||||
next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.2);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + breathe * 0.6);
|
||||
next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.2);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * -0.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * -0.2) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one();
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -22,49 +22,33 @@ impl Animation for JumpAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1) / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1) / 8.0;
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 8.0;
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_l.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 8.0;
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_r.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one();
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -69,18 +69,23 @@ impl Animation for RunAnimation {
|
||||
} else {
|
||||
0.0
|
||||
} * 1.3;
|
||||
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(short * -0.3) * Quaternion::rotation_x(-0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1) * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + short * 1.0) / 8.0;
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(tilt * -4.0 + short * 0.40) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(tilt * -4.0 + short * 0.40);
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(tilt * 4.0 + shortalt * 0.2);
|
||||
@ -90,38 +95,32 @@ impl Animation for RunAnimation {
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(footrotl * 0.07)
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_x(footrotl * -0.25);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(footrotr * -0.07)
|
||||
* Quaternion::rotation_y(-0.15)
|
||||
* Quaternion::rotation_x(footrotr * -0.25);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.3 + footrotl * -0.06)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(-0.35 + footrotl * -0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.3 + footrotr * -0.06)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(0.35 + footrotr * 0.1);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_x(footrotl * 0.3)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * -0.2);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) * 1.02;
|
||||
|
||||
next.leg_r.orientation = Quaternion::rotation_x(footrotr * 0.3)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * 0.2);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
@ -130,7 +129,6 @@ impl Animation for RunAnimation {
|
||||
);
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_x(footrotl * 0.2) * Quaternion::rotation_y(-0.08);
|
||||
next.foot_l.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
@ -140,11 +138,9 @@ impl Animation for RunAnimation {
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(footrotr * 0.2)
|
||||
* Quaternion::rotation_y(0.08);
|
||||
next.foot_r.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
|
||||
next.torso.scale = Vec3::one();
|
||||
next.torso.orientation = Quaternion::rotation_x(-0.2);
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ impl Animation for ShockwaveAnimation {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z((-twist * 2.0).max(-PI)) * Quaternion::rotation_x(0.0);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
@ -47,40 +46,32 @@ impl Animation for ShockwaveAnimation {
|
||||
) / 8.0;
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z((twist * 2.0).min(PI)) * Quaternion::rotation_x(0.0);
|
||||
next.upper_torso.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + slower * 1.0);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z((-twist * 2.0).max(-PI)) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-s_a.shoulder.0 - 2.0,
|
||||
s_a.shoulder.1,
|
||||
s_a.shoulder.2 - slower * 1.0,
|
||||
);
|
||||
next.shoulder_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(0.6 + slower * -0.3);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
next.shoulder_l.orientation = Quaternion::rotation_y(0.6 + slower * -0.3);
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
s_a.shoulder.0 + 2.0,
|
||||
s_a.shoulder.1,
|
||||
s_a.shoulder.2 - slower * 1.0,
|
||||
);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
next.shoulder_r.orientation = Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-s_a.hand.0 - 1.0,
|
||||
s_a.hand.1,
|
||||
s_a.hand.2 - slower * 0.5 + breathe * -1.0,
|
||||
);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_l.orientation = Quaternion::rotation_y(-0.6 + slower * 0.3);
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
s_a.hand.0 + 1.0,
|
||||
@ -89,36 +80,23 @@ impl Animation for ShockwaveAnimation {
|
||||
);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_y(0.6 + slower * -0.3);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
if velocity < 0.5 {
|
||||
next.leg_l.position =
|
||||
Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + slower * -0.5) * 1.02;
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + slower * -0.5) * 1.02;
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2 + slower * 2.5 + breathe * -1.0,
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1,
|
||||
s_a.foot.2 + slower * 2.5 + breathe * -1.0,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one();
|
||||
} else {
|
||||
}
|
||||
next
|
||||
|
@ -31,51 +31,41 @@ impl Animation for AlphaAnimation {
|
||||
/ (0.001 + 0.9999 * ((anim_time as f32 * 7.0 + PI * 0.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * 7.0 + PI * 0.0).sin());
|
||||
|
||||
next.head_upper.position = Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1);
|
||||
next.head_upper.orientation =
|
||||
Quaternion::rotation_z(short * 0.3) * Quaternion::rotation_x(0.0);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
next.head_upper.orientation = Quaternion::rotation_z(short * 0.3);
|
||||
|
||||
next.head_lower.position = Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1);
|
||||
next.head_lower.orientation =
|
||||
Quaternion::rotation_z(short * 0.2) * Quaternion::rotation_y(short * -0.4);
|
||||
next.head_lower.scale = Vec3::one();
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.2 + quick * 0.3);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
|
||||
next.chest.orientation = Quaternion::rotation_y(short * -0.07);
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation = Quaternion::rotation_x(0.15)
|
||||
* Quaternion::rotation_y(short * 0.2)
|
||||
* Quaternion::rotation_z(short * 0.3);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1);
|
||||
next.tail_rear.orientation = Quaternion::rotation_y(short * 0.5)
|
||||
* Quaternion::rotation_x(-0.12)
|
||||
* Quaternion::rotation_z(short * 0.3);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
if velocity < 1.0 {
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_y(short * 0.12);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_y(short * 0.12);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_y(short * 0.12);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_y(short * 0.12);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
} else {
|
||||
};
|
||||
next
|
||||
|
@ -39,52 +39,46 @@ impl Animation for IdleAnimation {
|
||||
.sin()
|
||||
* 0.1,
|
||||
);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position =
|
||||
Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1 + slower * 0.20);
|
||||
next.head_upper.orientation = Quaternion::rotation_z(0.8 * dragon_look.x)
|
||||
* Quaternion::rotation_x(0.8 * dragon_look.y);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
|
||||
next.head_lower.position =
|
||||
Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1 + slower * 0.20);
|
||||
next.head_lower.orientation = Quaternion::rotation_z(0.8 * dragon_look.x)
|
||||
* Quaternion::rotation_x(0.8 * dragon_look.y);
|
||||
next.head_lower.scale = Vec3::one();
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.04);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
|
||||
next.chest.orientation = Quaternion::rotation_y(slow * 0.03);
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation =
|
||||
Quaternion::rotation_x(0.15) * Quaternion::rotation_z(slowalt * 0.12);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1);
|
||||
next.tail_rear.orientation =
|
||||
Quaternion::rotation_z(slowalt * 0.12) * Quaternion::rotation_x(-0.12);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_y(slow * -0.05);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_y(slow * -0.05);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_y(slow * -0.05);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_y(slow * -0.05);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -22,45 +22,37 @@ impl Animation for JumpAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position = Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1);
|
||||
next.head_upper.orientation = Quaternion::rotation_z(0.4) * Quaternion::rotation_x(0.0);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
|
||||
next.head_lower.position = Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1);
|
||||
next.head_lower.orientation = Quaternion::rotation_z(0.2);
|
||||
next.head_lower.scale = Vec3::one();
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.3);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
|
||||
next.chest.orientation = Quaternion::rotation_y(0.0);
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation = Quaternion::rotation_x(0.15) * Quaternion::rotation_z(-0.2);
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1);
|
||||
next.tail_rear.orientation = Quaternion::rotation_z(-0.4) * Quaternion::rotation_x(-0.12);
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_z(0.3);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_z(0.3);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_y(0.0);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_y(0.0);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -85,21 +85,23 @@ impl Animation for RunAnimation {
|
||||
} else {
|
||||
0.0
|
||||
} * 1.3;
|
||||
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.tail_front.scale = Vec3::one() * 0.98;
|
||||
next.tail_rear.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head_upper.position = Vec3::new(0.0, s_a.head_upper.0, s_a.head_upper.1);
|
||||
next.head_upper.orientation = Quaternion::rotation_x(-s_a.lean.0 + x_tilt * -1.0)
|
||||
* Quaternion::rotation_y(tilt * 0.3)
|
||||
* Quaternion::rotation_z(short * -0.06 + tilt * -1.5);
|
||||
next.head_upper.scale = Vec3::one();
|
||||
|
||||
next.head_lower.position = Vec3::new(0.0, s_a.head_lower.0, s_a.head_lower.1);
|
||||
next.head_lower.orientation = Quaternion::rotation_y(tilt * 1.0)
|
||||
* Quaternion::rotation_z(short * -0.15 + tilt * -0.8)
|
||||
* Quaternion::rotation_x(x_tilt * 0.4);
|
||||
next.head_lower.scale = Vec3::one();
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.tail_front.position = Vec3::new(
|
||||
0.0,
|
||||
@ -110,20 +112,17 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_z(shortalt * 0.18 * s_a.lean.1 + tilt * 1.8)
|
||||
* Quaternion::rotation_y(shortalt * 0.1)
|
||||
* Quaternion::rotation_x(0.06 - s_a.lean.0 * 1.2 + x_tilt * 0.2);
|
||||
next.tail_front.scale = Vec3::one();
|
||||
|
||||
next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1 + shortalt * 0.6);
|
||||
next.tail_rear.orientation =
|
||||
Quaternion::rotation_z(shortalt * 0.25 * s_a.lean.1 + tilt * 1.6)
|
||||
* Quaternion::rotation_y(shortalt * 0.1)
|
||||
* Quaternion::rotation_x(-0.04 + x_tilt * 0.5);
|
||||
next.tail_rear.scale = Vec3::one();
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
|
||||
next.chest.orientation = Quaternion::rotation_z(short * 0.13 + tilt * -1.9)
|
||||
* Quaternion::rotation_y(short * 0.12 + tilt * 0.7)
|
||||
* Quaternion::rotation_x(x_tilt + s_a.lean.0);
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.foot_fl.position = Vec3::new(
|
||||
-s_a.feet_f.0,
|
||||
@ -134,7 +133,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(-0.2 + footvertl * -0.45 * s_a.lean.1 - s_a.lean.0)
|
||||
* Quaternion::rotation_y(tilt * -1.0)
|
||||
* Quaternion::rotation_z(foothoril * 0.4 * s_a.lean.1 + tilt * -2.0);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(
|
||||
s_a.feet_f.0,
|
||||
@ -145,7 +143,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(-0.2 + footvertr * -0.45 * s_a.lean.1 - s_a.lean.0)
|
||||
* Quaternion::rotation_y(tilt * -1.0)
|
||||
* Quaternion::rotation_z(foothorir * -0.4 * s_a.lean.1 + tilt * -2.0);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(
|
||||
-s_a.feet_b.0,
|
||||
@ -155,7 +152,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(-0.2 + footvertlb * -0.5 - s_a.lean.0)
|
||||
* Quaternion::rotation_y(tilt * -1.0)
|
||||
* Quaternion::rotation_z(foothorilb * 0.4 + tilt * -2.0);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(
|
||||
s_a.feet_b.0,
|
||||
@ -165,7 +161,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_br.orientation = Quaternion::rotation_x(-0.2 + footvertrb * -0.5 - s_a.lean.0)
|
||||
* Quaternion::rotation_y(tilt * -1.0)
|
||||
* Quaternion::rotation_z(foothorirb * -0.4 + tilt * -2.0);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -35,19 +35,13 @@ impl Animation for AlphaAnimation {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_y(short * -0.2) * Quaternion::rotation_x(0.1 + short * 0.2);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
|
||||
next.neck.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.3 + quick * 0.4);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.torso_front.position = Vec3::new(
|
||||
0.0,
|
||||
@ -56,59 +50,45 @@ impl Animation for AlphaAnimation {
|
||||
) * s_a.scaler
|
||||
/ 11.0;
|
||||
next.torso_front.orientation = Quaternion::rotation_y(short * -0.1);
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.torso_back.position = Vec3::new(0.0, s_a.torso_back.0, s_a.torso_back.1);
|
||||
next.torso_back.orientation = Quaternion::rotation_y(short * -0.1)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.torso_back.scale = Vec3::one();
|
||||
next.torso_back.orientation = Quaternion::rotation_y(short * -0.1);
|
||||
|
||||
next.ears.position = Vec3::new(0.0, s_a.ears.0, s_a.ears.1);
|
||||
next.ears.orientation = Quaternion::rotation_x(0.0);
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
if velocity < 1.0 {
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
|
||||
next.leg_fl.orientation =
|
||||
Quaternion::rotation_x(short * -0.1) * Quaternion::rotation_y(short * 0.15);
|
||||
next.leg_fl.scale = Vec3::one();
|
||||
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.orientation =
|
||||
Quaternion::rotation_x(short * 0.3) * Quaternion::rotation_y(short * -0.2);
|
||||
next.leg_fr.scale = Vec3::one();
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + 1.0);
|
||||
next.leg_bl.orientation =
|
||||
Quaternion::rotation_x(-0.1 + short * -0.2) * Quaternion::rotation_y(short * 0.2);
|
||||
next.leg_bl.scale = Vec3::one();
|
||||
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + 1.0);
|
||||
next.leg_br.orientation = Quaternion::rotation_x(-0.1 + short * -0.2)
|
||||
* Quaternion::rotation_y(0.1 + short * 0.2);
|
||||
next.leg_br.scale = Vec3::one();
|
||||
|
||||
next.foot_fl.position =
|
||||
Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + short * -0.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(short * -0.05);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation =
|
||||
Quaternion::rotation_x(short * -0.4) * Quaternion::rotation_y(short * 0.15);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position =
|
||||
Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + short * -0.8);
|
||||
next.foot_bl.orientation =
|
||||
Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation =
|
||||
Quaternion::rotation_x(-0.2 + short * 0.2) * Quaternion::rotation_y(short * 0.15);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
} else {
|
||||
};
|
||||
next
|
||||
|
@ -42,18 +42,12 @@ impl Animation for FeedAnimation {
|
||||
.sin()
|
||||
* 0.25,
|
||||
);
|
||||
let tailmove = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(7331.0)
|
||||
.sin()
|
||||
* 0.25,
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(1337.0)
|
||||
.sin()
|
||||
* 0.125,
|
||||
);
|
||||
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.torso_back.scale = Vec3::one() * 0.99;
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
if s_a.feed.0 {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slower * 0.2);
|
||||
@ -61,7 +55,6 @@ impl Animation for FeedAnimation {
|
||||
* Quaternion::rotation_x(
|
||||
fast * 0.05 + faster * 0.08 + 0.8 * s_a.feed.1 * transition,
|
||||
);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(
|
||||
0.0,
|
||||
@ -69,47 +62,34 @@ impl Animation for FeedAnimation {
|
||||
s_a.neck.1 + slower * 0.1 - 4.0 * transition,
|
||||
);
|
||||
next.neck.orientation = Quaternion::rotation_x(-2.5 * s_a.feed.1 * transition);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
|
||||
next.jaw.orientation = Quaternion::rotation_x((fast * 0.18 + faster * 0.26).min(0.0));
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slower * 0.2);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(0.3 * look.x) * Quaternion::rotation_x(0.3 * look.y);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1 + slower * 0.1);
|
||||
next.neck.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position =
|
||||
Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2 + 0.5);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05 - 0.08);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
}
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + look.x);
|
||||
|
||||
next.torso_front.position =
|
||||
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1 + slower * 0.3) * s_a.scaler / 11.0;
|
||||
next.torso_front.orientation = Quaternion::rotation_y(slow * 0.02);
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.torso_back.position =
|
||||
Vec3::new(0.0, s_a.torso_back.0, s_a.torso_back.1 + slower * 0.2);
|
||||
next.torso_back.orientation = Quaternion::rotation_y(-slow * 0.005)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.torso_back.scale = Vec3::one() * 0.99;
|
||||
next.torso_back.orientation = Quaternion::rotation_y(-slow * 0.005);
|
||||
|
||||
next.ears.position = Vec3::new(0.0, s_a.ears.0, s_a.ears.1);
|
||||
next.ears.orientation = Quaternion::rotation_x(0.0 + slower * 0.03);
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-s_a.leg_f.0,
|
||||
@ -117,7 +97,6 @@ impl Animation for FeedAnimation {
|
||||
s_a.leg_f.2 + slow * -0.15 + slower * -0.15,
|
||||
);
|
||||
next.leg_fl.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
s_a.leg_f.0,
|
||||
@ -125,33 +104,22 @@ impl Animation for FeedAnimation {
|
||||
s_a.leg_f.2 + slow * 0.15 + slower * -0.15,
|
||||
);
|
||||
next.leg_fr.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + slower * -0.3);
|
||||
next.leg_bl.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + slower * -0.3);
|
||||
next.leg_br.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_fl.position =
|
||||
Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slower * -0.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fl.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slower * -0.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fr.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_bl.position =
|
||||
Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slower * -0.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_bl.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slower * -0.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_br.scale = Vec3::one() * 0.94;
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -51,14 +51,23 @@ impl Animation for IdleAnimation {
|
||||
* 0.125,
|
||||
);
|
||||
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
next.foot_fl.scale = Vec3::one() * 0.96;
|
||||
next.foot_fr.scale = Vec3::one() * 0.96;
|
||||
next.foot_bl.scale = Vec3::one() * 0.96;
|
||||
next.foot_br.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slower * 0.2);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(0.3 * look.x) * Quaternion::rotation_x(0.3 * look.y);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1 + slower * 0.1);
|
||||
next.neck.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05 - 0.08);
|
||||
@ -72,18 +81,13 @@ impl Animation for IdleAnimation {
|
||||
next.torso_front.position =
|
||||
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1 + slower * 0.3) * s_a.scaler / 11.0;
|
||||
next.torso_front.orientation = Quaternion::rotation_y(slow * 0.02);
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.torso_back.position =
|
||||
Vec3::new(0.0, s_a.torso_back.0, s_a.torso_back.1 + slower * 0.2);
|
||||
next.torso_back.orientation = Quaternion::rotation_y(-slow * 0.005)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.torso_back.scale = Vec3::one() * 0.99;
|
||||
next.torso_back.orientation = Quaternion::rotation_y(-slow * 0.005);
|
||||
|
||||
next.ears.position = Vec3::new(0.0, s_a.ears.0, s_a.ears.1);
|
||||
next.ears.orientation = Quaternion::rotation_x(0.0 + slower * 0.03);
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-s_a.leg_f.0,
|
||||
@ -99,33 +103,23 @@ impl Animation for IdleAnimation {
|
||||
s_a.leg_f.2 + slow * 0.15 + slower * -0.15,
|
||||
);
|
||||
next.leg_fr.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + slower * -0.3);
|
||||
next.leg_bl.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2 + slower * -0.3);
|
||||
next.leg_br.orientation = Quaternion::rotation_y(slow * -0.02);
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_fl.position =
|
||||
Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slower * -0.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fl.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slower * -0.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_fr.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_bl.position =
|
||||
Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slower * -0.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_bl.scale = Vec3::one() * 0.94;
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slower * -0.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_br.scale = Vec3::one() * 0.94;
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -22,68 +22,60 @@ impl Animation for JumpAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
next.foot_fl.scale = Vec3::one() * 0.96;
|
||||
next.foot_fr.scale = Vec3::one() * 0.96;
|
||||
next.foot_bl.scale = Vec3::one() * 0.96;
|
||||
next.foot_br.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(0.4) * Quaternion::rotation_x(0.3);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
|
||||
next.neck.orientation = Quaternion::rotation_z(0.2) * Quaternion::rotation_x(0.3);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.4);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.3);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.torso_front.position =
|
||||
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1) * s_a.scaler / 11.0;
|
||||
next.torso_front.orientation = Quaternion::rotation_y(0.0);
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.torso_back.position = Vec3::new(0.0, s_a.torso_back.0, s_a.torso_back.1);
|
||||
next.torso_back.orientation = Quaternion::rotation_z(-0.3)
|
||||
* Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
next.torso_back.scale = Vec3::one();
|
||||
next.torso_back.orientation = Quaternion::rotation_z(-0.3);
|
||||
|
||||
next.ears.position = Vec3::new(0.0, s_a.ears.0, s_a.ears.1);
|
||||
next.ears.orientation = Quaternion::rotation_x(0.6);
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(-0.4);
|
||||
next.leg_fl.scale = Vec3::one();
|
||||
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(0.4);
|
||||
next.leg_fr.scale = Vec3::one();
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_bl.orientation = Quaternion::rotation_y(0.0);
|
||||
next.leg_bl.scale = Vec3::one();
|
||||
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_br.orientation = Quaternion::rotation_y(0.0);
|
||||
next.leg_br.scale = Vec3::one();
|
||||
|
||||
next.foot_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fl.orientation = Quaternion::rotation_x(-0.3);
|
||||
next.foot_fl.scale = Vec3::one();
|
||||
|
||||
next.foot_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.foot_fr.orientation = Quaternion::rotation_x(0.2);
|
||||
next.foot_fr.scale = Vec3::one();
|
||||
|
||||
next.foot_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_bl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_bl.scale = Vec3::one();
|
||||
|
||||
next.foot_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.foot_br.orientation = Quaternion::rotation_x(0.0);
|
||||
next.foot_br.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -98,6 +98,20 @@ impl Animation for RunAnimation {
|
||||
} * 1.3;
|
||||
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude());
|
||||
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
next.foot_fl.scale = Vec3::one() * 0.96;
|
||||
next.foot_fr.scale = Vec3::one() * 0.96;
|
||||
next.foot_bl.scale = Vec3::one() * 0.96;
|
||||
next.foot_br.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
//Gallop
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x(
|
||||
@ -105,22 +119,18 @@ impl Animation for RunAnimation {
|
||||
) * Quaternion::rotation_z(
|
||||
look.x * 0.3 / ((canceler).max(0.5)) + tilt * -1.2,
|
||||
) * Quaternion::rotation_y(tilt * 0.8);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
|
||||
next.neck.orientation = Quaternion::rotation_z(tilt * -0.8)
|
||||
* Quaternion::rotation_x(amplitude * short * -0.05)
|
||||
* Quaternion::rotation_y(tilt * 0.3);
|
||||
next.neck.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_x(amplitude * shortalt * 0.3) * Quaternion::rotation_z(tilt * 1.5);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.torso_front.position = Vec3::new(
|
||||
0.0,
|
||||
@ -136,7 +146,6 @@ impl Animation for RunAnimation {
|
||||
+ x_tilt * (canceler * 6.0).min(1.0),
|
||||
) * Quaternion::rotation_y(tilt * 0.8)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.torso_back.position = Vec3::new(
|
||||
0.0,
|
||||
@ -146,11 +155,9 @@ impl Animation for RunAnimation {
|
||||
next.torso_back.orientation = Quaternion::rotation_x(amplitude * short * -0.1)
|
||||
* Quaternion::rotation_z(tilt * 1.8)
|
||||
* Quaternion::rotation_y(tilt * 0.6);
|
||||
next.torso_back.scale = Vec3::one();
|
||||
|
||||
next.ears.position = Vec3::new(0.0, s_a.ears.0, s_a.ears.1);
|
||||
next.ears.orientation = Quaternion::rotation_x(amplitude * shortalt * 0.2 + 0.2);
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-s_a.leg_f.0,
|
||||
@ -161,7 +168,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot1a * 0.85)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
s_a.leg_f.0,
|
||||
@ -172,7 +178,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot2a * 0.85)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-s_a.leg_b.0,
|
||||
@ -183,7 +188,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(canceler * -0.2 + amplitude3 * foot3b * -0.55)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_br.position = Vec3::new(
|
||||
s_a.leg_b.0,
|
||||
@ -194,7 +198,6 @@ impl Animation for RunAnimation {
|
||||
Quaternion::rotation_x(canceler * -0.2 + amplitude3 * foot4b * -0.55)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_fl.position = Vec3::new(
|
||||
-s_a.feet_f.0,
|
||||
@ -204,7 +207,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_fl.orientation =
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot1b * -0.7)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
next.foot_fl.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.foot_fr.position = Vec3::new(
|
||||
s_a.feet_f.0,
|
||||
@ -214,7 +216,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_fr.orientation =
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot2b * -0.7)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
next.foot_fr.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.foot_bl.position = Vec3::new(
|
||||
-s_a.feet_b.0,
|
||||
@ -224,7 +225,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_bl.orientation =
|
||||
Quaternion::rotation_x(amplitude2 * foot3b * -0.7 - 0.2 * canceler)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
next.foot_bl.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.foot_br.position = Vec3::new(
|
||||
s_a.feet_b.0,
|
||||
@ -234,7 +234,6 @@ impl Animation for RunAnimation {
|
||||
next.foot_br.orientation =
|
||||
Quaternion::rotation_x(amplitude2 * foot4b * -0.7 - 0.2 * canceler)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
next.foot_br.scale = Vec3::one() * 0.96;
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ impl Animation for FeedAnimation {
|
||||
global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
@ -40,64 +40,34 @@ impl Animation for FeedAnimation {
|
||||
.sin()
|
||||
* 0.5,
|
||||
);
|
||||
next.chest.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.head.0 + 1.5,
|
||||
skeleton_attr.head.1 + slow * 0.2,
|
||||
);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0 + 1.5, s_a.head.1 + slow * 0.2);
|
||||
next.head.orientation = Quaternion::rotation_z(head_look.y)
|
||||
* Quaternion::rotation_x(slow * 0.05 + quick * 0.08 - 0.4 * skeleton_attr.feed);
|
||||
next.head.scale = Vec3::one();
|
||||
* Quaternion::rotation_x(slow * 0.05 + quick * 0.08 - 0.4 * s_a.feed);
|
||||
|
||||
next.chest.position = Vec3::new(slow * 0.02, skeleton_attr.chest.0, skeleton_attr.chest.1)
|
||||
/ 11.0
|
||||
* skeleton_attr.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(-0.35 * skeleton_attr.feed)
|
||||
* Quaternion::rotation_y(head_look.y * 0.1);
|
||||
next.chest.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
next.chest.position = Vec3::new(slow * 0.02, s_a.chest.0, s_a.chest.1) / 11.0 * s_a.scaler;
|
||||
next.chest.orientation =
|
||||
Quaternion::rotation_x(-0.35 * s_a.feed) * Quaternion::rotation_y(head_look.y * 0.1);
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2 + 0.5,
|
||||
);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(slow * 0.01 + 0.25 * skeleton_attr.feed)
|
||||
next.leg_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + 0.5);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(slow * 0.01 + 0.25 * s_a.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
next.leg_fl.scale = Vec3::one();
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2 + 0.5,
|
||||
);
|
||||
next.leg_fr.orientation =
|
||||
Quaternion::rotation_x(slow_alt * 0.01 + 0.25 * skeleton_attr.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
next.leg_fr.scale = Vec3::one();
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1 + 1.0,
|
||||
skeleton_attr.feet_b.2 - 1.0,
|
||||
);
|
||||
next.leg_bl.orientation =
|
||||
Quaternion::rotation_x(slow_alt * 0.01 + 0.15 * skeleton_attr.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
next.leg_bl.scale = Vec3::one();
|
||||
|
||||
next.leg_br.position = Vec3::new(
|
||||
skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1 + 1.0,
|
||||
skeleton_attr.feet_b.2 - 1.0,
|
||||
);
|
||||
next.leg_br.orientation = Quaternion::rotation_x(slow * 0.01 + 0.15 * skeleton_attr.feed)
|
||||
next.leg_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + 0.5);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(slow_alt * 0.01 + 0.25 * s_a.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
next.leg_br.scale = Vec3::one();
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.leg_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1 + 1.0, s_a.feet_b.2 - 1.0);
|
||||
next.leg_bl.orientation = Quaternion::rotation_x(slow_alt * 0.01 + 0.15 * s_a.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
|
||||
next.leg_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1 + 1.0, s_a.feet_b.2 - 1.0);
|
||||
next.leg_br.orientation = Quaternion::rotation_x(slow * 0.01 + 0.15 * s_a.feed)
|
||||
* Quaternion::rotation_y(slow * -0.02 - head_look.y * 0.1);
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(slow * 0.3 + head_look.y * 0.3);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ impl Animation for IdleAnimation {
|
||||
global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
@ -40,57 +40,32 @@ impl Animation for IdleAnimation {
|
||||
* 0.25,
|
||||
);
|
||||
|
||||
next.head.position =
|
||||
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 0.2);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * 0.2);
|
||||
next.head.orientation = Quaternion::rotation_z(head_look.x)
|
||||
* Quaternion::rotation_x(head_look.y + slow_alt * 0.03);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.chest.position = Vec3::new(slow * 0.05, skeleton_attr.chest.0, skeleton_attr.chest.1)
|
||||
/ 11.0
|
||||
* skeleton_attr.scaler;
|
||||
next.chest.position = Vec3::new(slow * 0.05, s_a.chest.0, s_a.chest.1) / 11.0 * s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_y(slow * 0.05);
|
||||
next.chest.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
next.chest.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2 + slow * -0.2,
|
||||
);
|
||||
next.leg_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slow * -0.2);
|
||||
next.leg_fl.orientation =
|
||||
Quaternion::rotation_x(slow * 0.03) * Quaternion::rotation_y(slow * -0.05);
|
||||
next.leg_fl.scale = Vec3::one();
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2 + slow * 0.2,
|
||||
);
|
||||
next.leg_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slow * 0.2);
|
||||
next.leg_fr.orientation =
|
||||
Quaternion::rotation_x(slow_alt * 0.03) * Quaternion::rotation_y(slow * -0.05);
|
||||
next.leg_fr.scale = Vec3::one();
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1,
|
||||
skeleton_attr.feet_b.2 + slow * -0.2,
|
||||
);
|
||||
next.leg_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slow * -0.2);
|
||||
next.leg_bl.orientation =
|
||||
Quaternion::rotation_x(slow_alt * 0.03) * Quaternion::rotation_y(slow * -0.05);
|
||||
next.leg_bl.scale = Vec3::one();
|
||||
|
||||
next.leg_br.position = Vec3::new(
|
||||
skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1,
|
||||
skeleton_attr.feet_b.2 + slow * 0.2,
|
||||
);
|
||||
next.leg_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2 + slow * 0.2);
|
||||
next.leg_br.orientation =
|
||||
Quaternion::rotation_x(slow * 0.03) * Quaternion::rotation_y(slow * -0.05);
|
||||
next.leg_br.scale = Vec3::one();
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(slow * 0.4);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -18,55 +18,31 @@ impl Animation for JumpAnimation {
|
||||
(_velocity, _global_time): Self::Dependency,
|
||||
_anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(-0.8) * Quaternion::rotation_x(0.5);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.chest.position = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1)
|
||||
* skeleton_attr.scaler
|
||||
/ 11.0;
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
|
||||
next.chest.orientation = Quaternion::rotation_y(0.0);
|
||||
next.chest.scale = Vec3::one() * skeleton_attr.scaler / 11.0;
|
||||
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2,
|
||||
);
|
||||
next.leg_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_fl.scale = Vec3::one();
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1,
|
||||
skeleton_attr.feet_f.2,
|
||||
);
|
||||
next.leg_fr.position = Vec3::new(s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_fr.scale = Vec3::one();
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1,
|
||||
skeleton_attr.feet_b.2,
|
||||
);
|
||||
next.leg_bl.position = Vec3::new(-s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.leg_bl.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_bl.scale = Vec3::one();
|
||||
|
||||
next.leg_br.position = Vec3::new(
|
||||
skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1,
|
||||
skeleton_attr.feet_b.2,
|
||||
);
|
||||
next.leg_br.position = Vec3::new(s_a.feet_b.0, s_a.feet_b.1, s_a.feet_b.2);
|
||||
next.leg_br.orientation = Quaternion::rotation_x(0.0);
|
||||
next.leg_br.scale = Vec3::one();
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_x(-0.3);
|
||||
next.tail.scale = Vec3::one();
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,13 @@ impl Animation for RunAnimation {
|
||||
(_velocity, orientation, last_ori, _global_time, avg_vel): Self::Dependency,
|
||||
anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let lab = 0.6; //6
|
||||
|
||||
let speedmult = skeleton_attr.tempo;
|
||||
let speedmult = s_a.tempo;
|
||||
let short = (anim_time as f32 * 20.0 * lab as f32 * speedmult + PI * 1.0).sin();
|
||||
let shortalt = (anim_time as f32 * 20.0 * lab as f32 * speedmult + PI * 0.5).sin();
|
||||
|
||||
@ -50,75 +50,67 @@ impl Animation for RunAnimation {
|
||||
} * 1.3;
|
||||
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude());
|
||||
|
||||
next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x(x_tilt * -0.5 + short * -0.2)
|
||||
* Quaternion::rotation_y(tilt * 0.8)
|
||||
* Quaternion::rotation_z(tilt * -1.2);
|
||||
next.head.scale = Vec3::one();
|
||||
|
||||
next.chest.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.chest.0,
|
||||
skeleton_attr.chest.1
|
||||
+ 2.0 * skeleton_attr.spring
|
||||
+ shortalt * 3.0 * skeleton_attr.spring,
|
||||
s_a.chest.0,
|
||||
s_a.chest.1 + 2.0 * s_a.spring + shortalt * 3.0 * s_a.spring,
|
||||
) / 11.0
|
||||
* skeleton_attr.scaler;
|
||||
next.chest.orientation =
|
||||
Quaternion::rotation_x(short * 0.2 * skeleton_attr.spring + x_tilt)
|
||||
* Quaternion::rotation_y(tilt * 0.8)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.chest.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
* s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(short * 0.2 * s_a.spring + x_tilt)
|
||||
* Quaternion::rotation_y(tilt * 0.8)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.chest.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.leg_fl.position = Vec3::new(
|
||||
-skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1 + footverttf * 3.0 * skeleton_attr.minimize,
|
||||
skeleton_attr.feet_f.2 + ((footvertf * -1.5).max(-1.0)),
|
||||
-s_a.feet_f.0,
|
||||
s_a.feet_f.1 + footverttf * 3.0 * s_a.minimize,
|
||||
s_a.feet_f.2 + ((footvertf * -1.5).max(-1.0)),
|
||||
);
|
||||
next.leg_fl.orientation =
|
||||
Quaternion::rotation_x(0.2 + skeleton_attr.maximize * footverttf * 0.65)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fl.scale = Vec3::one() * 1.02;
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(0.2 + s_a.maximize * footverttf * 0.65)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
skeleton_attr.feet_f.0,
|
||||
skeleton_attr.feet_f.1 + footvertt * 3.0 * skeleton_attr.minimize,
|
||||
skeleton_attr.feet_f.2 + ((footvert * -1.5).max(-1.0)),
|
||||
s_a.feet_f.0,
|
||||
s_a.feet_f.1 + footvertt * 3.0 * s_a.minimize,
|
||||
s_a.feet_f.2 + ((footvert * -1.5).max(-1.0)),
|
||||
);
|
||||
next.leg_fr.orientation =
|
||||
Quaternion::rotation_x(0.2 + skeleton_attr.maximize * footvertt * 0.65)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fr.scale = Vec3::one() * 1.02;
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(0.2 + s_a.maximize * footvertt * 0.65)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1 + footvertt * -1.4,
|
||||
skeleton_attr.feet_b.2 + ((footvert * 1.5).max(-1.0)),
|
||||
-s_a.feet_b.0,
|
||||
s_a.feet_b.1 + footvertt * -1.4,
|
||||
s_a.feet_b.2 + ((footvert * 1.5).max(-1.0)),
|
||||
);
|
||||
next.leg_bl.orientation =
|
||||
Quaternion::rotation_x(-0.25 + skeleton_attr.maximize * footvertt * -0.8)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.leg_bl.scale = Vec3::one() * 1.02;
|
||||
next.leg_bl.orientation = Quaternion::rotation_x(-0.25 + s_a.maximize * footvertt * -0.8)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
|
||||
next.leg_br.position = Vec3::new(
|
||||
skeleton_attr.feet_b.0,
|
||||
skeleton_attr.feet_b.1 + footverttf * -1.4,
|
||||
skeleton_attr.feet_b.2 + ((footvertf * 1.5).max(-1.0)),
|
||||
s_a.feet_b.0,
|
||||
s_a.feet_b.1 + footverttf * -1.4,
|
||||
s_a.feet_b.2 + ((footvertf * 1.5).max(-1.0)),
|
||||
);
|
||||
next.leg_br.orientation =
|
||||
Quaternion::rotation_x(-0.25 + skeleton_attr.maximize * footverttf * -0.8)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
next.leg_br.scale = Vec3::one() * 1.02;
|
||||
next.leg_br.orientation = Quaternion::rotation_x(-0.25 + s_a.maximize * footverttf * -0.8)
|
||||
* Quaternion::rotation_y(tilt * 1.5)
|
||||
* Quaternion::rotation_z(tilt * -1.5);
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_x(short * 0.2 + x_tilt)
|
||||
* Quaternion::rotation_y(tilt * 0.8)
|
||||
* Quaternion::rotation_z(tilt * 1.5);
|
||||
next.tail.scale = Vec3::one();
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -36,59 +36,53 @@ impl Animation for IdleAnimation {
|
||||
* 0.25,
|
||||
);
|
||||
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.neck.scale = Vec3::one() * 0.98;
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.foot_l.scale = Vec3::one() * 0.96;
|
||||
next.foot_r.scale = Vec3::one() * 0.96;
|
||||
next.chest_front.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.3);
|
||||
next.head.orientation = Quaternion::rotation_x(head_look.y + breathe * 0.1 - 0.1)
|
||||
* Quaternion::rotation_z(head_look.x);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(breathe * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1 + breathe * 0.2);
|
||||
next.neck.orientation = Quaternion::rotation_x(-0.1);
|
||||
next.neck.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest_front.position =
|
||||
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1 + breathe * 0.3) / s_a.scaler;
|
||||
next.chest_front.orientation = Quaternion::rotation_x(breathe * 0.04);
|
||||
next.chest_front.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);
|
||||
next.chest_back.orientation = Quaternion::rotation_x(breathe * -0.04);
|
||||
next.chest_back.scale = Vec3::one();
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation = Quaternion::rotation_x(0.1);
|
||||
next.tail_front.scale = Vec3::one();
|
||||
|
||||
next.tail_back.position = Vec3::new(0.0, s_a.tail_back.0, s_a.tail_back.1 - 0.5);
|
||||
next.tail_back.orientation = Quaternion::rotation_x(0.1);
|
||||
next.tail_back.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(breathe * 0.2);
|
||||
next.hand_l.scale = Vec3::one();
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(breathe * 0.2);
|
||||
next.hand_r.scale = Vec3::one();
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.05);
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_l.scale = Vec3::one();
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.05);
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_r.scale = Vec3::one();
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.15);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.15);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -15,66 +15,49 @@ impl Animation for JumpAnimation {
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
_global_time: Self::Dependency,
|
||||
anim_time: f64,
|
||||
_anim_time: f64,
|
||||
_rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let breathe = (anim_time as f32 * 0.8).sin();
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.3);
|
||||
next.head.orientation = Quaternion::rotation_x(breathe * 0.1 - 0.1);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(breathe * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1 + breathe * 0.2);
|
||||
next.neck.orientation = Quaternion::rotation_x(-0.1);
|
||||
next.neck.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest_front.position =
|
||||
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1 + breathe * 0.3) / s_a.scaler;
|
||||
next.chest_front.orientation = Quaternion::rotation_x(breathe * 0.04);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.foot_l.scale = Vec3::one() * 0.96;
|
||||
next.foot_r.scale = Vec3::one() * 0.96;
|
||||
next.chest_front.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x(-0.1);
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
|
||||
next.neck.orientation = Quaternion::rotation_x(-0.1);
|
||||
|
||||
next.chest_front.position =
|
||||
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1) / s_a.scaler;
|
||||
|
||||
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);
|
||||
next.chest_back.orientation = Quaternion::rotation_x(breathe * -0.04);
|
||||
next.chest_back.scale = Vec3::one();
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation = Quaternion::rotation_x(0.1);
|
||||
next.tail_front.scale = Vec3::one();
|
||||
|
||||
next.tail_back.position = Vec3::new(0.0, s_a.tail_back.0, s_a.tail_back.1);
|
||||
next.tail_back.orientation = Quaternion::rotation_x(0.1);
|
||||
next.tail_back.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(breathe * 0.2);
|
||||
next.hand_l.scale = Vec3::one();
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(breathe * 0.2);
|
||||
next.hand_r.scale = Vec3::one();
|
||||
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.05);
|
||||
next.leg_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_l.scale = Vec3::one();
|
||||
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
|
||||
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + breathe * 0.05);
|
||||
next.leg_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_r.scale = Vec3::one();
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.35);
|
||||
next.foot_l.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_l.scale = Vec3::one() * 1.02;
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + breathe * -0.45);
|
||||
next.foot_r.orientation = Quaternion::rotation_z(0.0);
|
||||
next.foot_r.scale = Vec3::one() * 1.02;
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -59,48 +59,46 @@ impl Animation for RunAnimation {
|
||||
//BL
|
||||
//BR
|
||||
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.neck.scale = Vec3::one() * 0.98;
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
next.foot_l.scale = Vec3::one() * 0.96;
|
||||
next.foot_r.scale = Vec3::one() * 0.96;
|
||||
next.chest_front.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + breathe * 0.3);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_x(-0.1 + short * -0.05) * Quaternion::rotation_z(shortalt * -0.2);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(short * -0.03);
|
||||
next.jaw.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
|
||||
next.neck.orientation =
|
||||
Quaternion::rotation_x(-0.1 + short * -0.04) * Quaternion::rotation_z(shortalt * -0.1);
|
||||
next.neck.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.chest_front.position =
|
||||
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1 + short * 0.5) / s_a.scaler;
|
||||
next.chest_front.orientation =
|
||||
Quaternion::rotation_x(short * 0.07) * Quaternion::rotation_z(shortalt * 0.15);
|
||||
next.chest_front.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);
|
||||
next.chest_back.orientation =
|
||||
Quaternion::rotation_x(short * -0.04) * Quaternion::rotation_z(shortalt * -0.15);
|
||||
next.chest_back.scale = Vec3::one();
|
||||
|
||||
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);
|
||||
next.tail_front.orientation =
|
||||
Quaternion::rotation_x(0.1 + short * -0.02) * Quaternion::rotation_z(shortalt * -0.1);
|
||||
next.tail_front.scale = Vec3::one();
|
||||
|
||||
next.tail_back.position = Vec3::new(0.0, s_a.tail_back.0, s_a.tail_back.1);
|
||||
next.tail_back.orientation =
|
||||
Quaternion::rotation_x(0.2 + short * -0.2) * Quaternion::rotation_z(shortalt * -0.2);
|
||||
next.tail_back.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot2a * 0.3);
|
||||
next.hand_l.scale = Vec3::one();
|
||||
|
||||
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot1a * 0.3);
|
||||
next.hand_r.scale = Vec3::one();
|
||||
|
||||
next.leg_l.position = Vec3::new(
|
||||
-s_a.leg.0,
|
||||
@ -108,9 +106,7 @@ impl Animation for RunAnimation {
|
||||
s_a.leg.2 + amplitude3 * foot1a * 1.4,
|
||||
);
|
||||
next.leg_l.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot1a * 0.2)
|
||||
* Quaternion::rotation_z(foot1a * -0.3)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.leg_l.scale = Vec3::one() * 1.0;
|
||||
* Quaternion::rotation_z(foot1a * -0.3);
|
||||
|
||||
next.leg_r.position = Vec3::new(
|
||||
s_a.leg.0,
|
||||
@ -118,9 +114,7 @@ impl Animation for RunAnimation {
|
||||
s_a.leg.2 + amplitude3 * foot2a * 1.4,
|
||||
);
|
||||
next.leg_r.orientation = Quaternion::rotation_x(-0.2 + amplitude3 * foot2a * 0.2)
|
||||
* Quaternion::rotation_z(foot2a * 0.3)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.leg_r.scale = Vec3::one() * 1.0;
|
||||
* Quaternion::rotation_z(foot2a * 0.3);
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0,
|
||||
@ -129,16 +123,13 @@ impl Animation for RunAnimation {
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(-0.3 + amplitude2 * foot1b * -0.35)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.foot_l.scale = Vec3::one() * 0.96;
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0,
|
||||
s_a.foot.1 + canceler * -2.0 + amplitude3 * foot2b * -2.0,
|
||||
s_a.foot.2 + canceler * 2.0 + (foot2a * 2.0).max(0.0) * amplitude2,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.3 + amplitude2 * foot2b * -0.35)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.foot_r.scale = Vec3::one() * 0.96;
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.3 + amplitude2 * foot2b * -0.35);
|
||||
|
||||
next
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user