mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
add animations
This commit is contained in:
parent
5e225d7f35
commit
d890190af4
@ -115,7 +115,7 @@ impl Animation for AlphaAnimation {
|
||||
next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel)
|
||||
* Quaternion::rotation_z(fast * 0.15 * speednormcancel);
|
||||
},
|
||||
Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick) => {
|
||||
Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.head.orientation = Quaternion::rotation_z(move1abs * 0.3 + move2abs * -0.6);
|
||||
next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0);
|
||||
next.control_r.position = Vec3::new(
|
||||
|
@ -39,7 +39,7 @@ impl Animation for LeapAnimation {
|
||||
_ => (0.0, 0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
if let Some(ToolKind::Hammer | ToolKind::Pick) = active_tool_kind {
|
||||
if let Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) = active_tool_kind {
|
||||
next.hand_l.position = Vec3::new(s_a.grip.0 * 2.0, 0.0, s_a.grip.2);
|
||||
next.hand_r.position = Vec3::new(-s_a.grip.0 * 2.0, 0.0, s_a.grip.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
|
@ -65,7 +65,7 @@ impl Animation for AlphaAnimation {
|
||||
next.head.orientation = Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8);
|
||||
},
|
||||
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) | Some(ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
let (move1, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
|
||||
@ -96,7 +96,7 @@ impl Animation for AlphaAnimation {
|
||||
match hands {
|
||||
(Some(Hands::Two), _) | (None, Some(Hands::Two)) => {
|
||||
match ability_info.and_then(|a| a.tool) {
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) | Some(ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
let (move1, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time, 0.0),
|
||||
@ -144,7 +144,7 @@ impl Animation for AlphaAnimation {
|
||||
next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
},
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) | Some(ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.control_l.position = Vec3::new(
|
||||
-7.0,
|
||||
8.0 + move1 * -4.0 + move2 * 4.0,
|
||||
@ -173,7 +173,7 @@ impl Animation for AlphaAnimation {
|
||||
next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
|
||||
},
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) | Some(ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.control_r.position = Vec3::new(
|
||||
7.0,
|
||||
8.0 + move1 * -4.0 + move2h * 4.0,
|
||||
|
@ -139,7 +139,7 @@ impl Animation for BlockAnimation {
|
||||
* Quaternion::rotation_y(s_a.ac.4 + move1 * -1.8)
|
||||
* Quaternion::rotation_z(s_a.ac.5 + move1 * 4.0);
|
||||
},
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.hand_l.position = Vec3::new(
|
||||
s_a.hhl.0,
|
||||
s_a.hhl.1 + move1 * 6.0,
|
||||
|
@ -121,7 +121,7 @@ impl Animation for LeapAnimation {
|
||||
|
||||
match hands {
|
||||
(Some(Hands::One), _) => match ability_info.and_then(|a| a.tool) {
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.control_l.position = Vec3::new(
|
||||
-7.0,
|
||||
8.0 + move2 * -5.0 + move3 * 9.0,
|
||||
@ -140,7 +140,7 @@ impl Animation for LeapAnimation {
|
||||
match hands {
|
||||
(None | Some(Hands::One), Some(Hands::One)) => {
|
||||
match ability_info.and_then(|a| a.tool) {
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.control_r.position = Vec3::new(
|
||||
7.0 + move2 * 3.0 + move3 * -3.0,
|
||||
8.0 + move2 * -9.0 + move3 * 15.0,
|
||||
|
@ -179,7 +179,7 @@ impl Animation for SneakEquipAnimation {
|
||||
next.hand_l.position = Vec3::new(-7.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-5.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
next.hand_l.position = Vec3::new(-5.0, -5.0, 13.0);
|
||||
next.hand_r.position = Vec3::new(-3.0, -4.5, 10.0);
|
||||
},
|
||||
|
@ -232,7 +232,7 @@ impl Animation for SneakWieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
},
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
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)
|
||||
|
@ -103,7 +103,7 @@ impl Animation for StaggeredAnimation {
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
},
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
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)
|
||||
|
@ -223,7 +223,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(s_a.ac.4)
|
||||
* Quaternion::rotation_z(s_a.ac.5);
|
||||
},
|
||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) | Some(ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user