mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
starting to wire in new wield setup
This commit is contained in:
parent
72b15a1e24
commit
3d23475abd
@ -76,27 +76,26 @@ impl Animation for AlphaAnimation {
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
next.hand_l.scale = Vec3::one() * 1.05;
|
||||
next.hand_r.position = Vec3::new(0.75, -1.5, -0.5);
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
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, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-7.0,
|
||||
7.0 + movement1 * -4.0 + movement2 * 16.0 + movement3 * -4.0,
|
||||
2.0 + movement1 * 1.0,
|
||||
s_a.sc.0,
|
||||
s_a.sc.1 + movement1 * -4.0 + movement2 * 16.0 + movement3 * -4.0,
|
||||
s_a.sc.2 + movement1 * 1.0,
|
||||
);
|
||||
next.control.orientation = Quaternion::rotation_x(movement1 * -0.5)
|
||||
* Quaternion::rotation_y(movement1 * -1.0 + movement2 * -0.6 + movement3 * 1.0)
|
||||
* Quaternion::rotation_z(movement1 * -1.2 + movement2 * 1.3);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + movement1 * -0.5)
|
||||
* Quaternion::rotation_y(
|
||||
s_a.sc.4 + movement1 * -1.0 + movement2 * -0.6 + movement3 * 1.0,
|
||||
)
|
||||
* Quaternion::rotation_z(s_a.sc.5 + movement1 * -1.2 + movement2 * 1.3);
|
||||
|
||||
next.chest.orientation = Quaternion::rotation_z(
|
||||
movement1 * 1.5 + (movement2 * 1.75).sin() * -3.0 + movement3 * 0.5,
|
||||
@ -147,23 +146,6 @@ impl Animation for AlphaAnimation {
|
||||
next.control_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.control_r.scale = Vec3::one();
|
||||
|
||||
// next.control_r.position = Vec3::new(-10.0 + push * 5.0, 6.0 + push * 5.0,
|
||||
// 2.0); next.control_r.orientation =
|
||||
// Quaternion::rotation_x(-1.4 + slow * 0.4)
|
||||
// * Quaternion::rotation_y(slow * -1.3)
|
||||
// * Quaternion::rotation_z(1.4 + slow * -0.5);
|
||||
// next.control_r.scale = Vec3::one();
|
||||
|
||||
// next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
|
||||
// next.hand_r.orientation = Quaternion::rotation_x(1.27);
|
||||
// next.hand_r.scale = Vec3::one() * 1.05;
|
||||
|
||||
// next.control.position = Vec3::new(-10.0 + push * 5.0, 6.0 + push * 5.0, 2.0);
|
||||
// next.control.orientation = Quaternion::rotation_x(-1.4 + slow * 0.4)
|
||||
// * Quaternion::rotation_y(slow * -1.3)
|
||||
// * Quaternion::rotation_z(1.4 + slow * -0.5);
|
||||
// next.control.scale = Vec3::one();
|
||||
|
||||
next.foot_l.position =
|
||||
Vec3::new(-s_a.foot.0, slow * -3.0 + quick * 3.0 - 4.0, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(slow * 0.6)
|
||||
|
@ -42,29 +42,31 @@ impl Animation for BetaAnimation {
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
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.main.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-8.0 + movement1 * -5.0
|
||||
s_a.sc.0
|
||||
+ movement1 * -5.0
|
||||
+ (movement2 as f32 * 2.5).sin() * 30.0
|
||||
+ movement3 * -5.0,
|
||||
1.0 - (movement1 as f32 * 8.0).sin() * 0.8 + movement1 * 2.0 + movement3 * 2.0,
|
||||
2.0 - (movement1 as f32 * 8.0).sin() * 0.4,
|
||||
s_a.sc.1 - (movement1 as f32 * 8.0).sin() * 0.8
|
||||
+ movement1 * 2.0
|
||||
+ movement3 * 2.0,
|
||||
s_a.sc.2 - (movement1 as f32 * 8.0).sin() * 0.4,
|
||||
);
|
||||
next.control.orientation = Quaternion::rotation_x(-1.57)
|
||||
next.control.orientation = Quaternion::rotation_x(-1.57 + s_a.sc.3)
|
||||
* Quaternion::rotation_y(
|
||||
0.0 + movement1 * 1.5 + (movement2 as f32 * 2.5).sin() * 0.5,
|
||||
s_a.sc.4 + movement1 * 1.5 + (movement2 as f32 * 2.5).sin() * 0.5,
|
||||
)
|
||||
* Quaternion::rotation_z(1.0 + (movement2 as f32 * 2.5).sin() * 1.0);
|
||||
* Quaternion::rotation_z(1.0 + s_a.sc.5 + (movement2 as f32 * 2.5).sin() * 1.0);
|
||||
next.chest.orientation = Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(
|
||||
0.4 + movement1 * 1.5
|
||||
|
@ -73,20 +73,27 @@ impl Animation for DashAnimation {
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
next.hand_l.position = Vec3::new(-0.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(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.02;
|
||||
next.main.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
s_a.sc.0 + movement1 * -5.0 + movement3 * -2.0,
|
||||
s_a.sc.1 + movement2.min(1.0) * -2.0,
|
||||
s_a.sc.2 + movement2.min(1.0) * 2.0,
|
||||
);
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(s_a.sc.3 + movement1 * -1.0 + movement3 * -0.5)
|
||||
* Quaternion::rotation_y(s_a.sc.4 + movement1 * 1.5 + movement3 * -2.5);
|
||||
|
||||
next.head.position =
|
||||
Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1 + movement2.min(1.0) * 1.0);
|
||||
next.head.orientation = Quaternion::rotation_x(0.0)
|
||||
@ -103,17 +110,6 @@ impl Animation for DashAnimation {
|
||||
* Quaternion::rotation_y(movement2.min(1.0) * -0.2 + movement3 * 0.3)
|
||||
* Quaternion::rotation_z(movement1 * 1.1 + movement3 * -2.2);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-7.0 + movement1 * -5.0 + movement3 * -2.0,
|
||||
7.0 + movement2.min(1.0) * -2.0,
|
||||
2.0 + movement2.min(1.0) * 2.0,
|
||||
);
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(movement1 * -1.0 + movement3 * -0.5)
|
||||
* Quaternion::rotation_y(movement1 * 1.5 + movement3 * -2.5)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.shorts.orientation = Quaternion::rotation_z(short(movement2).min(1.0) * 0.25);
|
||||
|
||||
next.belt.orientation = Quaternion::rotation_z(short(movement2).min(1.0) * 0.1);
|
||||
@ -134,107 +130,17 @@ impl Animation for DashAnimation {
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.6 + footrotr(movement2) * -0.6)
|
||||
* Quaternion::rotation_z(-0.2);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, -2.0 + s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.head.scale = Vec3::one() * s_a.head_scale;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, 0.0, 7.0 + slow(anim_time as f32) * 2.0);
|
||||
next.chest.orientation =
|
||||
Quaternion::rotation_x(-0.5) * Quaternion::rotation_z(-0.7);
|
||||
|
||||
next.belt.position = Vec3::new(0.0, 1.0, -1.0);
|
||||
next.belt.orientation = Quaternion::rotation_x(0.2) * Quaternion::rotation_z(0.2);
|
||||
|
||||
next.shorts.position = Vec3::new(0.0, 3.0, -3.0);
|
||||
next.shorts.orientation = Quaternion::rotation_x(0.4) * Quaternion::rotation_z(0.3);
|
||||
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.27);
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(1.27);
|
||||
next.hand_r.scale = Vec3::one() * 1.05;
|
||||
next.main.position = Vec3::new(0.0, 6.0, -1.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.3);
|
||||
next.main.scale = Vec3::one();
|
||||
|
||||
next.control.position = Vec3::new(-8.0 - slow(anim_time as f32) * 0.5, 3.0, 3.0);
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3)
|
||||
* Quaternion::rotation_z(1.1 + slow(anim_time as f32) * 0.2);
|
||||
next.control.scale = Vec3::one();
|
||||
next.foot_l.position = Vec3::new(-1.4, 2.0, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(-0.8);
|
||||
|
||||
next.foot_r.position = Vec3::new(5.4, -1.0, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.8);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
match second_tool_kind {
|
||||
//TODO: Inventory
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, -2.0 + s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_z(0.0)
|
||||
* Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.head.scale = Vec3::one() * s_a.head_scale;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, 0.0, 7.0 + slow(anim_time as f32) * 2.0);
|
||||
next.chest.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.belt.position = Vec3::new(0.0, 1.0, -1.0);
|
||||
next.belt.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.shorts.position = Vec3::new(0.0, 3.0, -3.0);
|
||||
next.shorts.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_x(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.control_l.position = Vec3::new(-8.0, -10.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.04;
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.main.scale = Vec3::one();
|
||||
|
||||
next.control_r.position = Vec3::new(8.0, 10.0, 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.05;
|
||||
|
||||
next.second.position = Vec3::new(0.0, 6.0, -1.0);
|
||||
next.second.orientation = Quaternion::rotation_x(-0.3);
|
||||
next.second.scale = Vec3::one();
|
||||
|
||||
next.foot_l.position = Vec3::new(-1.4, 2.0, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(-0.8);
|
||||
|
||||
next.foot_r.position = Vec3::new(5.4, -1.0, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(-0.8);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2);
|
||||
next.lantern.orientation = Quaternion::rotation_x(slow(anim_time as f32) * -0.7 + 0.4)
|
||||
* Quaternion::rotation_y(slow(anim_time as f32) * 0.4);
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
|
||||
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.control_l.scale = Vec3::one();
|
||||
|
||||
next.control_r.scale = Vec3::one();
|
||||
|
||||
next.second.scale = match (
|
||||
active_tool_kind.map(|tk| tk.hands()),
|
||||
second_tool_kind.map(|tk| tk.hands()),
|
||||
|
@ -39,7 +39,6 @@ pub use self::{
|
||||
stand::StandAnimation, swim::SwimAnimation, swimwield::SwimWieldAnimation,
|
||||
wield::WieldAnimation,
|
||||
};
|
||||
|
||||
use super::{make_bone, vek::*, FigureBoneData, Skeleton};
|
||||
use common::comp;
|
||||
use core::convert::TryFrom;
|
||||
@ -131,6 +130,12 @@ pub struct SkeletonAttr {
|
||||
foot: (f32, f32, f32),
|
||||
shoulder: (f32, f32, f32),
|
||||
lantern: (f32, f32, f32),
|
||||
shl: (f32, f32, f32, f32, f32, f32),
|
||||
shr: (f32, f32, f32, f32, f32, f32),
|
||||
sc: (f32, f32, f32, f32, f32, f32),
|
||||
hhl: (f32, f32, f32, f32, f32, f32),
|
||||
hhr: (f32, f32, f32, f32, f32, f32),
|
||||
hc: (f32, f32, f32, f32, f32, f32),
|
||||
}
|
||||
|
||||
impl Default for SkeletonAttr {
|
||||
@ -147,6 +152,12 @@ impl Default for SkeletonAttr {
|
||||
foot: (0.0, 0.0, 0.0),
|
||||
shoulder: (0.0, 0.0, 0.0),
|
||||
lantern: (0.0, 0.0, 0.0),
|
||||
shl: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
shr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
sc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
hhl: (0.0, 0.0, 10.0, 0.0, 0.0, 0.0),
|
||||
hhr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
hc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -220,6 +231,24 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
lantern: match (body.species, body.body_type) {
|
||||
(_, _) => (5.0, 2.5, 5.5),
|
||||
},
|
||||
shl: match (body.species, body.body_type) {
|
||||
(_, _) => (-0.75, -1.0, 0.5, 1.47, -0.2, 0.0),
|
||||
},
|
||||
shr: match (body.species, body.body_type) {
|
||||
(_, _) => (0.75, -1.5, -2.5, 1.47, 0.3, 0.0),
|
||||
},
|
||||
sc: match (body.species, body.body_type) {
|
||||
(_, _) => (-7.0, 7.0, 2.0, -0.1, 0.0, 0.0),
|
||||
},
|
||||
hhl: match (body.species, body.body_type) {
|
||||
(_, _) => (-0.5, -1.0, 10.0, 1.57, 0.0, 0.0),
|
||||
},
|
||||
hhr: match (body.species, body.body_type) {
|
||||
(_, _) => (0.0, 0.0, 0.0, 1.57, 0.0, 0.0),
|
||||
},
|
||||
hc: match (body.species, body.body_type) {
|
||||
(_, _) => (6.0, 7.0, 1.0, -0.3, -1.57, 0.5),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ impl Animation for RepeaterAnimation {
|
||||
|
||||
// end spin stuff
|
||||
|
||||
fn fire (x: f32) -> f32 { (x * 18.0).sin() }
|
||||
fn fire(x: f32) -> f32 { (x * 18.0).sin() }
|
||||
|
||||
if let Some(ToolKind::Bow(_)) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(2.0, 1.5, 0.0);
|
||||
@ -75,37 +75,42 @@ impl Animation for RepeaterAnimation {
|
||||
s_a.foot.1 + movement1 * 4.0 + 4.0,
|
||||
s_a.foot.2 + movement1 * 2.5 + 2.5,
|
||||
);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2)
|
||||
* Quaternion::rotation_z(movement1 * 0.3 + 0.3);
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2)
|
||||
* Quaternion::rotation_z(movement1 * 0.3 + 0.3);
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0 + movement1 * 0.75 + 0.75,
|
||||
s_a.foot.1 + movement1 * 4.0 + 4.0,
|
||||
s_a.foot.2 + movement1 * 2.5 + 2.5,
|
||||
);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2)
|
||||
* Quaternion::rotation_z(movement1 * -0.3 - 0.3);
|
||||
next.foot_r.orientation =
|
||||
Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2)
|
||||
* Quaternion::rotation_z(movement1 * -0.3 - 0.3);
|
||||
next.shorts.position = Vec3::new(
|
||||
0.0,
|
||||
s_a.shorts.0 + movement1 * 4.0,
|
||||
s_a.shorts.1 + movement1 * 1.0,
|
||||
);
|
||||
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.6);
|
||||
next.belt.position =
|
||||
Vec3::new(0.0, s_a.belt.0 + movement1 * 2.0, s_a.belt.1);
|
||||
next.belt.position = Vec3::new(0.0, s_a.belt.0 + movement1 * 2.0, s_a.belt.1);
|
||||
next.belt.orientation = Quaternion::rotation_x(movement1 * 0.2);
|
||||
next.control.position = Vec3::new(
|
||||
-7.0 + movement1 * 5.0,
|
||||
6.0 + movement1 * 3.0,
|
||||
6.0 + movement1 * 1.0,
|
||||
);
|
||||
next.control.orientation = Quaternion::rotation_x(movement1 * 0.4)
|
||||
* Quaternion::rotation_y(movement1 * 0.8);
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(movement1 * 0.4) * Quaternion::rotation_y(movement1 * 0.8);
|
||||
next.head.orientation = Quaternion::rotation_y(movement1 * 0.15 + movement2 * 0.05);
|
||||
next.torso.orientation = Quaternion::rotation_x(movement1 * 0.1 + movement2 * 0.1 + movement3 * 0.15);
|
||||
next.torso.orientation =
|
||||
Quaternion::rotation_x(movement1 * 0.1 + movement2 * 0.1 + movement3 * 0.15);
|
||||
|
||||
next.hand_l.position =
|
||||
Vec3::new(2.0 + fire(movement3) * -6.0 - 3.0, 1.5 + fire(movement3) * -6.0 - 3.0, 0.0);
|
||||
next.hand_l.position = Vec3::new(
|
||||
2.0 + fire(movement3) * -6.0 - 3.0,
|
||||
1.5 + fire(movement3) * -6.0 - 3.0,
|
||||
0.0,
|
||||
);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
* Quaternion::rotation_z(-0.3);
|
||||
|
@ -60,32 +60,39 @@ impl Animation for SpinAnimation {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
if let Some(ToolKind::Sword(_)) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
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.main.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
5.0 + movement1 * 2.0 + movement2 * -8.0 + movement3 * -7.0,
|
||||
11.0 + slow(movement1) * 0.6
|
||||
s_a.sc.0 + movement1 * 2.0 + movement2 * -8.0 + movement3 * -7.0,
|
||||
s_a.sc.1
|
||||
+ 8.0
|
||||
+ slow(movement1) * 0.6
|
||||
+ slow(movement2) * 3.0
|
||||
+ slow(movement3) * -0.8
|
||||
+ movement3 * -10.0,
|
||||
2.0 + slow(movement1) * 0.6
|
||||
s_a.sc.2
|
||||
+ 1.0
|
||||
+ slow(movement1) * 0.6
|
||||
+ slow(movement2) * 3.5
|
||||
+ movement2 * 3.0
|
||||
+ slow(movement3) * -0.4
|
||||
+ movement3 * -4.0,
|
||||
);
|
||||
next.control.orientation = Quaternion::rotation_x(
|
||||
movement1 * -1.57 + movement2 * -0.6 + slow(movement2) * -0.25,
|
||||
-0.5 + s_a.sc.4 + movement1 * -1.57 + movement2 * -0.6 + slow(movement2) * -0.25,
|
||||
) * Quaternion::rotation_y(
|
||||
-0.57 + movement1 * 2.0 + movement2 * -2.0,
|
||||
) * Quaternion::rotation_z(movement1 + movement2);
|
||||
s_a.sc.4 - 0.6 + movement1 * 2.0 + movement2 * -2.0,
|
||||
) * Quaternion::rotation_z(
|
||||
s_a.sc.5 + 0.1 + movement1 + movement2,
|
||||
);
|
||||
|
||||
next.head.orientation = Quaternion::rotation_z(slow(movement2) * -0.8);
|
||||
|
||||
|
@ -66,20 +66,20 @@ impl Animation for SpinMeleeAnimation {
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
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.main.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 7.0, 2.0);
|
||||
next.control.orientation = Quaternion::rotation_x(-PI / 2.0 + movement3 * PI / 2.0)
|
||||
* Quaternion::rotation_z(-PI / 2.0 + movement3 * PI / 2.0);
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(s_a.sc.3 - PI / 2.0 + movement3 * PI / 2.0)
|
||||
* Quaternion::rotation_z(s_a.sc.5 - PI / 2.0 + movement3 * PI / 2.0);
|
||||
next.torso.orientation = Quaternion::rotation_z(movement2 * PI * 2.0);
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
|
@ -39,27 +39,29 @@ impl Animation for StandAnimation {
|
||||
.sin()
|
||||
* 0.15,
|
||||
);
|
||||
next.head.position = Vec3::new(
|
||||
0.0,
|
||||
2.0 + s_a.head.0,
|
||||
s_a.head.1 + slow * 0.3 + breathe * -0.05,
|
||||
);
|
||||
next.head.scale = Vec3::one() * s_a.head_scale + breathe * -0.05;
|
||||
next.chest.scale = Vec3::one() * 1.01 + breathe * 0.03;
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
next.hand_r.scale = Vec3::one() * 1.04;
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
next.belt.scale = Vec3::one() + breathe * -0.03;
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
next.lantern.scale = Vec3::one() * 0.65;
|
||||
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * 0.3 + breathe * -0.05);
|
||||
next.head.orientation = Quaternion::rotation_z(head_look.x)
|
||||
* Quaternion::rotation_x(impact * -0.02 + head_look.y.abs());
|
||||
next.head.scale = Vec3::one() * s_a.head_scale + breathe * -0.05;
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.3 + impact * 0.2);
|
||||
next.chest.orientation =
|
||||
Quaternion::rotation_z(head_look.x * 0.6) * Quaternion::rotation_x(impact * 0.04);
|
||||
next.chest.scale = Vec3::one() * 1.01 + breathe * 0.03;
|
||||
|
||||
next.belt.position = Vec3::new(0.0, s_a.belt.0 + impact * 0.005, s_a.belt.1);
|
||||
next.belt.orientation =
|
||||
Quaternion::rotation_z(head_look.x * -0.1) * Quaternion::rotation_x(impact * -0.03);
|
||||
next.belt.scale = Vec3::one() + breathe * -0.03;
|
||||
|
||||
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.position = Vec3::new(0.0, s_a.shorts.0 + impact * -0.2, s_a.shorts.1);
|
||||
next.shorts.orientation =
|
||||
@ -73,7 +75,6 @@ impl Animation for StandAnimation {
|
||||
);
|
||||
|
||||
next.hand_l.orientation = Quaternion::rotation_x(slow * -0.06 + impact * -0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.04;
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
s_a.hand.0,
|
||||
@ -81,15 +82,12 @@ impl Animation for StandAnimation {
|
||||
s_a.hand.2 + slow * 0.5 + impact * -0.1,
|
||||
);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(slow * -0.06 + impact * -0.1);
|
||||
next.hand_r.scale = Vec3::one() * 1.04;
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 - impact * 0.15, s_a.foot.2);
|
||||
next.foot_l.orientation = Quaternion::rotation_x(impact * 0.02);
|
||||
next.foot_l.scale = Vec3::one();
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + impact * 0.15, s_a.foot.2);
|
||||
next.foot_r.orientation = Quaternion::rotation_x(impact * -0.02);
|
||||
next.foot_r.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_l.scale = (Vec3::one() + breathe * -0.05) * 1.15;
|
||||
@ -100,7 +98,6 @@ impl Animation for StandAnimation {
|
||||
next.glider.position = Vec3::new(0.0, 0.0, 10.0);
|
||||
next.glider.scale = Vec3::one() * 0.0;
|
||||
next.hold.position = Vec3::new(0.4, -0.3, -5.8);
|
||||
next.hold.scale = Vec3::one() * 0.0;
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
next.main.position = Vec3::new(-4.0, -5.0, 7.0);
|
||||
@ -136,15 +133,11 @@ impl Animation for StandAnimation {
|
||||
Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57);
|
||||
},
|
||||
}
|
||||
next.second.scale = Vec3::one();
|
||||
|
||||
next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2);
|
||||
next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1);
|
||||
next.lantern.scale = Vec3::one() * 0.65;
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
|
||||
next.torso.orientation = Quaternion::rotation_x(0.0);
|
||||
next.torso.scale = Vec3::one() / 11.0 * s_a.scaler;
|
||||
|
||||
next.second.scale = match (
|
||||
active_tool_kind.map(|tk| tk.hands()),
|
||||
|
@ -92,23 +92,21 @@ impl Animation for WieldAnimation {
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-0.75, -1.0, 2.5);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
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.main.position = Vec3::new(0.0, 0.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 7.0, 2.0);
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.15)
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
|
||||
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Dagger(_)) => {
|
||||
// hands should be larger when holding a dagger grip,
|
||||
// also reduce flicker with overlapping polygons
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -175,19 +173,19 @@ impl Animation for WieldAnimation {
|
||||
next.control.position = Vec3::new(-3.0, 11.0, 3.0);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0);
|
||||
next.hand_r.position = Vec3::new(2.0, 0.0, 0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4);
|
||||
|
||||
next.control.position = Vec3::new(6.0, 7.0, 1.0);
|
||||
next.control.orientation = Quaternion::rotation_x(0.3 + u_slow * 0.15)
|
||||
* Quaternion::rotation_y(0.0)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
next.control.position = Vec3::new(s_a.hc.0, s_a.hc.1, s_a.hc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.hc.3 + u_slow * 0.15)
|
||||
* Quaternion::rotation_y(s_a.hc.4)
|
||||
* Quaternion::rotation_z(s_a.hc.5 + u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
if speed > 0.5 && velocity.z == 0.0 {
|
||||
|
Loading…
Reference in New Issue
Block a user