mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Improved existing weapon wielding animations
This commit is contained in:
parent
148069b4ad
commit
2d68a93a78
@ -163,24 +163,6 @@ impl Animation for WieldAnimation {
|
||||
next.hand_r.position = Vec3::zero();
|
||||
next.hand_r.orientation =
|
||||
next.hand_l.orientation * Quaternion::rotation_y(PI * 0.3);
|
||||
//carried position
|
||||
/*
|
||||
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.sc.0+6.0,
|
||||
-4.0,
|
||||
-2.0,
|
||||
);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.9);
|
||||
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 )
|
||||
;
|
||||
*/
|
||||
},
|
||||
Some(ToolKind::Axe) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
@ -205,56 +187,52 @@ impl Animation for WieldAnimation {
|
||||
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
|
||||
next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1 + 2.0, s_a.ahr.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(s_a.ahr.3)
|
||||
* Quaternion::rotation_z(s_a.ahr.5)
|
||||
* Quaternion::rotation_y(PI * -0.25);
|
||||
|
||||
next.control.position =
|
||||
Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2 + direction * -5.0);
|
||||
Vec3::new(s_a.ac.0, s_a.ac.1 - 4.0, s_a.ac.2 + direction * -5.0);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
},
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1 + 3.0, s_a.hhl.2 - 1.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
|
||||
* Quaternion::rotation_y(s_a.hhl.4)
|
||||
* Quaternion::rotation_z(s_a.hhl.5);
|
||||
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
|
||||
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1 + 3.0, s_a.hhr.2 + 1.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
|
||||
* Quaternion::rotation_y(s_a.hhr.4)
|
||||
* Quaternion::rotation_z(s_a.hhr.5);
|
||||
|
||||
next.control.position =
|
||||
Vec3::new(s_a.hc.0, s_a.hc.1, s_a.hc.2 + direction * -5.0);
|
||||
Vec3::new(s_a.hc.0 - 1.0, s_a.hc.1, s_a.hc.2 + direction * -5.0 - 3.0);
|
||||
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.07);
|
||||
},
|
||||
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
|
||||
if speed > 0.5 && velocity.z == 0.0 {
|
||||
next.hand_r.position = Vec3::new(
|
||||
7.0 + s_a.hand.0 + foothoril * 1.3,
|
||||
-4.0 + s_a.hand.1 + foothoril * -7.0,
|
||||
1.0 + s_a.hand.2 - foothoril * 5.5,
|
||||
next.control_l.position = next.hand_l.position * 0.2
|
||||
+ Vec3::new(
|
||||
s_a.sc.0 + 1.0,
|
||||
s_a.sc.1 - slow * 2.0 * speednorm - 3.0,
|
||||
s_a.sc.2 + direction * -5.0 - slow * 2.0 * speednorm - 3.0,
|
||||
);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.6 + footrotl * -1.2)
|
||||
* Quaternion::rotation_y(footrotl * -0.4);
|
||||
} else {
|
||||
next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
|
||||
};
|
||||
next.control_r.position = next.control_l.position;
|
||||
|
||||
next.control.position =
|
||||
Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2 + direction * -5.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
|
||||
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + u_slow * 0.1)
|
||||
* Quaternion::rotation_y(s_a.stc.4)
|
||||
* Quaternion::rotation_z(s_a.stc.5 + u_slowalt * 0.1);
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0 - 0.5, s_a.shl.1, s_a.shl.2 + 0.0);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 + u_slow * 0.05)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.04);
|
||||
next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 + u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
next.hand_r.position = Vec3::new(0.0, 0.0, 8.0);
|
||||
next.hand_r.orientation =
|
||||
next.hand_l.orientation * Quaternion::rotation_y(PI * 0.3);
|
||||
},
|
||||
Some(ToolKind::Bow) => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
|
Loading…
Reference in New Issue
Block a user