mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
more animation
This commit is contained in:
parent
98385b3b15
commit
ba1cee4fd2
@ -39,7 +39,7 @@ impl Animation for LeapAnimation {
|
||||
_ => (0.0, 0.0, 0.0, 0.0),
|
||||
};
|
||||
|
||||
if let Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) = active_tool_kind {
|
||||
if let Some(ToolKind::Hammer | ToolKind::Pick) = 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);
|
||||
|
@ -167,7 +167,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_y(-0.2 * speednorm)
|
||||
* Quaternion::rotation_z(0.5);
|
||||
},
|
||||
Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
Some(ToolKind::Axe | ToolKind::Hammer | ToolKind::Pick) => {
|
||||
next.control_l.position = Vec3::new(2.0 - s_a.grip.0 * 2.0, 1.0, 3.0);
|
||||
next.control_r.position =
|
||||
Vec3::new(9.0 + s_a.grip.0 * 2.0, -1.0, -2.0 + speednorm * -3.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 | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
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),
|
||||
@ -128,6 +128,30 @@ impl Animation for AlphaAnimation {
|
||||
)
|
||||
* Quaternion::rotation_z(s_a.hc.5 + (moveret2 * -0.5));
|
||||
},
|
||||
Some(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),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let moveret1 = move1 * pullback;
|
||||
let moveret2 = move2 * pullback;
|
||||
|
||||
next.hand_l.position = Vec3::new(8.0, 6.0, 3.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
|
||||
next.hand_r.position = Vec3::new(8.0, 6.0, 15.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
|
||||
next.main.position = Vec3::new(7.5, 7.5, 13.2);
|
||||
next.main.orientation = Quaternion::rotation_y(PI);
|
||||
|
||||
next.control.position = Vec3::new(-11.0 + moveret1 * 8.0, 1.8, 4.0);
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(moveret1 * 0.3 + moveret2 * 0.2)
|
||||
* Quaternion::rotation_y(0.8 - moveret1 * 0.7 + moveret2 * 0.7)
|
||||
* Quaternion::rotation_z(moveret2 * 0.1 - moveret1 * 0.4);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
},
|
||||
|
@ -121,7 +121,7 @@ impl Animation for LeapAnimation {
|
||||
|
||||
match hands {
|
||||
(Some(Hands::One), _) => match ability_info.and_then(|a| a.tool) {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
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 | ToolKind::Pick | ToolKind::Shovel) => {
|
||||
Some(ToolKind::Hammer | ToolKind::Pick) => {
|
||||
next.control_r.position = Vec3::new(
|
||||
7.0 + move2 * 3.0 + move3 * -3.0,
|
||||
8.0 + move2 * -9.0 + move3 * 15.0,
|
||||
|
Loading…
Reference in New Issue
Block a user