mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
anim additions
This commit is contained in:
parent
f3c5c2b5e3
commit
6ba8af5434
@ -46,40 +46,36 @@ impl Animation for AlphaAnimation {
|
|||||||
next.second.orientation = Quaternion::rotation_z(0.0);
|
next.second.orientation = Quaternion::rotation_z(0.0);
|
||||||
next.torso.position = Vec3::new(0.0, 0.0, 1.1);
|
next.torso.position = Vec3::new(0.0, 0.0, 1.1);
|
||||||
next.torso.orientation = Quaternion::rotation_z(0.0);
|
next.torso.orientation = Quaternion::rotation_z(0.0);
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
match ability_info.and_then(|a| a.tool) {
|
match ability_info.and_then(|a| a.tool) {
|
||||||
Some(ToolKind::Sword | ToolKind::Dagger) => {
|
Some(ToolKind::Sword | ToolKind::Dagger) => {
|
||||||
if matches!(
|
|
||||||
stage_section,
|
|
||||||
Some(StageSection::Action | StageSection::Recover)
|
|
||||||
) {
|
|
||||||
next.main_weapon_trail = true;
|
|
||||||
}
|
|
||||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||||
|
|
||||||
next.chest.orientation =
|
next.chest.orientation = Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0);
|
||||||
Quaternion::rotation_z(move1 * 1.1 + move2 * -2.0 + move3 * 0.2);
|
|
||||||
|
|
||||||
next.head.position = Vec3::new(0.0 + move2 * 2.0, s_a.head.0, s_a.head.1);
|
next.head.position = Vec3::new(0.0 + move2 * 2.0, s_a.head.0, s_a.head.1);
|
||||||
next.head.orientation =
|
next.head.orientation = Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8);
|
||||||
Quaternion::rotation_z(move1 * -0.9 + move2 * 1.8 + move3 * -0.2);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
Some(ToolKind::Axe) => {
|
Some(ToolKind::Axe) => {
|
||||||
let (move1, move2, move3) = match stage_section {
|
let (move1, move2, _move3) = match stage_section {
|
||||||
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
|
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0),
|
||||||
Some(StageSection::Action) => (1.0, anim_time, 0.0),
|
Some(StageSection::Action) => (1.0, anim_time, 0.0),
|
||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
|
||||||
_ => (0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
next.head.position = Vec3::new(move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1);
|
next.head.position = Vec3::new(move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1);
|
||||||
next.chest.orientation =
|
next.chest.orientation = Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6)
|
||||||
Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6 + move3 * 0.4)
|
* Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0)
|
||||||
* Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0)
|
* Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5);
|
||||||
* Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5 + move3 * 1.5);
|
next.head.orientation = Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5);
|
||||||
next.head.orientation =
|
|
||||||
Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5 + move3 * -1.0);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
Some(ToolKind::Hammer) | Some(ToolKind::Pick) => {
|
||||||
|
@ -41,6 +41,13 @@ impl Animation for BetaAnimation {
|
|||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)),
|
||||||
_ => (0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
next.second.orientation = Quaternion::rotation_z(0.0);
|
next.second.orientation = Quaternion::rotation_z(0.0);
|
||||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
|
@ -54,7 +54,13 @@ impl Animation for ChargeswingAnimation {
|
|||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 0.0, 1.0),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4), 0.0, 1.0),
|
||||||
_ => (0.0, 0.0, 0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Charge | StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
let pullback = 1.0 - movement3;
|
let pullback = 1.0 - movement3;
|
||||||
let move1 = move1base * pullback;
|
let move1 = move1base * pullback;
|
||||||
let move2 = move2base * pullback;
|
let move2 = move2base * pullback;
|
||||||
|
@ -42,6 +42,13 @@ impl Animation for DashAnimation {
|
|||||||
Some(StageSection::Recover) => (1.1, 1.0, 1.0, anim_time.powi(4)),
|
Some(StageSection::Recover) => (1.1, 1.0, 1.0, anim_time.powi(4)),
|
||||||
_ => (0.0, 0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
let pullback = 1.0 - move4;
|
let pullback = 1.0 - move4;
|
||||||
let move1 = movement1 * pullback;
|
let move1 = movement1 * pullback;
|
||||||
let move2 = movement2 * pullback;
|
let move2 = movement2 * pullback;
|
||||||
|
@ -42,6 +42,13 @@ impl Animation for LeapAnimation {
|
|||||||
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time.powf(0.75)),
|
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time.powf(0.75)),
|
||||||
_ => (0.0, 0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Movement | StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
let pullback = 1.0 - move4;
|
let pullback = 1.0 - move4;
|
||||||
let move1 = movement1 * pullback;
|
let move1 = movement1 * pullback;
|
||||||
let move2 = movement2 * pullback;
|
let move2 = movement2 * pullback;
|
||||||
|
@ -42,7 +42,13 @@ impl Animation for ShockwaveAnimation {
|
|||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||||
_ => (0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||||
|
|
||||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||||
|
@ -49,7 +49,13 @@ impl Animation for SpinAnimation {
|
|||||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
next.main.orientation = Quaternion::rotation_x(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.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
match ability_info.and_then(|a| a.tool) {
|
match ability_info.and_then(|a| a.tool) {
|
||||||
Some(ToolKind::Sword) => {
|
Some(ToolKind::Sword) => {
|
||||||
next.head.position = Vec3::new(
|
next.head.position = Vec3::new(
|
||||||
|
@ -39,10 +39,18 @@ impl Animation for SpinMeleeAnimation {
|
|||||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(2.0)),
|
Some(StageSection::Recover) => (1.0, 1.0, anim_time.powf(2.0)),
|
||||||
_ => (0.0, 0.0, 0.0),
|
_ => (0.0, 0.0, 0.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let pullback = 1.0 - movement3;
|
let pullback = 1.0 - movement3;
|
||||||
let move1 = movement1 * pullback;
|
let move1 = movement1 * pullback;
|
||||||
let move2 = movement2 * pullback;
|
let move2 = movement2 * pullback;
|
||||||
let mut next = (*skeleton).clone();
|
let mut next = (*skeleton).clone();
|
||||||
|
if matches!(
|
||||||
|
stage_section,
|
||||||
|
Some(StageSection::Action | StageSection::Recover)
|
||||||
|
) {
|
||||||
|
next.main_weapon_trail = true;
|
||||||
|
next.off_weapon_trail = true;
|
||||||
|
}
|
||||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
next.main.orientation = Quaternion::rotation_z(0.0);
|
next.main.orientation = Quaternion::rotation_z(0.0);
|
||||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||||
|
@ -815,7 +815,7 @@ impl FigureMgr {
|
|||||||
.unwrap_or_else(|| vek::Rgba::broadcast(1.0))
|
.unwrap_or_else(|| vek::Rgba::broadcast(1.0))
|
||||||
// Highlight targeted collectible entities
|
// Highlight targeted collectible entities
|
||||||
* if item.is_some() && scene_data.target_entity.map_or(false, |e| e == entity) {
|
* if item.is_some() && scene_data.target_entity.map_or(false, |e| e == entity) {
|
||||||
vek::Rgba::new(5.0, 5.0, 5.0, 1.0)
|
vek::Rgba::new(1.5, 1.5, 1.5, 1.0)
|
||||||
} else {
|
} else {
|
||||||
vek::Rgba::one()
|
vek::Rgba::one()
|
||||||
};
|
};
|
||||||
@ -6456,6 +6456,8 @@ impl<S: Skeleton> FigureState<S> {
|
|||||||
// TODO: Make sure these are good positions, only did tweaking on sword
|
// TODO: Make sure these are good positions, only did tweaking on sword
|
||||||
Some(ToolKind::Axe) => (10.0, 19.25),
|
Some(ToolKind::Axe) => (10.0, 19.25),
|
||||||
Some(ToolKind::Hammer) => (10.0, 19.25),
|
Some(ToolKind::Hammer) => (10.0, 19.25),
|
||||||
|
Some(ToolKind::Staff) => (10.0, 19.25),
|
||||||
|
Some(ToolKind::Sceptre) => (10.0, 19.25),
|
||||||
_ => (0.0, 0.0),
|
_ => (0.0, 0.0),
|
||||||
};
|
};
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user