mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Trails now controlled and enabled from animation files.
This commit is contained in:
parent
fc1a9f3c61
commit
a967daa2f5
@ -49,6 +49,9 @@ impl Animation for AlphaAnimation {
|
|||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ skeleton_impls!(struct CharacterSkeleton {
|
|||||||
control_r,
|
control_r,
|
||||||
:: // Begin non-bone fields
|
:: // Begin non-bone fields
|
||||||
holding_lantern: bool,
|
holding_lantern: bool,
|
||||||
|
main_weapon_trail: bool,
|
||||||
});
|
});
|
||||||
|
|
||||||
impl CharacterSkeleton {
|
impl CharacterSkeleton {
|
||||||
@ -156,7 +157,7 @@ impl Skeleton for CharacterSkeleton {
|
|||||||
.into(),
|
.into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
weapon_trail_mat: Some(main_mat),
|
weapon_trail_mat: self.main_weapon_trail.then_some(main_mat),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#![feature(generic_associated_types)]
|
#![feature(
|
||||||
|
generic_associated_types,
|
||||||
|
bool_to_option,
|
||||||
|
)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]
|
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]
|
||||||
compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once");
|
compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once");
|
||||||
|
@ -33,7 +33,7 @@ use common::{
|
|||||||
comp::{
|
comp::{
|
||||||
inventory::slot::EquipSlot,
|
inventory::slot::EquipSlot,
|
||||||
item::{Hands, ItemKind, ToolKind},
|
item::{Hands, ItemKind, ToolKind},
|
||||||
Body, CharacterAbilityType, CharacterState, Collider, Controller, Health, Inventory, Item,
|
Body, CharacterState, Collider, Controller, Health, Inventory, Item,
|
||||||
ItemKey, Last, LightAnimation, LightEmitter, Ori, PhysicsState, PoiseState, Pos, Scale,
|
ItemKey, Last, LightAnimation, LightEmitter, Ori, PhysicsState, PoiseState, Pos, Scale,
|
||||||
Vel,
|
Vel,
|
||||||
},
|
},
|
||||||
@ -864,7 +864,6 @@ impl FigureMgr {
|
|||||||
mount_transform_pos,
|
mount_transform_pos,
|
||||||
body: Some(body),
|
body: Some(body),
|
||||||
tools: (active_tool_kind, second_tool_kind),
|
tools: (active_tool_kind, second_tool_kind),
|
||||||
char_ability: character.map(|c| c.into()),
|
|
||||||
col,
|
col,
|
||||||
dt,
|
dt,
|
||||||
_lpindex: lpindex,
|
_lpindex: lpindex,
|
||||||
@ -6249,7 +6248,6 @@ pub struct FigureUpdateCommonParameters<'a> {
|
|||||||
pub mount_transform_pos: Option<(anim::vek::Transform<f32, f32, f32>, anim::vek::Vec3<f32>)>,
|
pub mount_transform_pos: Option<(anim::vek::Transform<f32, f32, f32>, anim::vek::Vec3<f32>)>,
|
||||||
pub body: Option<Body>,
|
pub body: Option<Body>,
|
||||||
pub tools: (Option<ToolKind>, Option<ToolKind>),
|
pub tools: (Option<ToolKind>, Option<ToolKind>),
|
||||||
pub char_ability: Option<CharacterAbilityType>,
|
|
||||||
pub col: vek::Rgba<f32>,
|
pub col: vek::Rgba<f32>,
|
||||||
pub dt: f32,
|
pub dt: f32,
|
||||||
// TODO: evaluate unused variable
|
// TODO: evaluate unused variable
|
||||||
@ -6304,7 +6302,6 @@ impl<S: Skeleton> FigureState<S> {
|
|||||||
mount_transform_pos,
|
mount_transform_pos,
|
||||||
body,
|
body,
|
||||||
tools,
|
tools,
|
||||||
char_ability,
|
|
||||||
col,
|
col,
|
||||||
dt,
|
dt,
|
||||||
_lpindex,
|
_lpindex,
|
||||||
@ -6465,18 +6462,6 @@ impl<S: Skeleton> FigureState<S> {
|
|||||||
if let (Some((p1, p2)), Some((p4, p3))) =
|
if let (Some((p1, p2)), Some((p4, p3))) =
|
||||||
(self.abs_trail_points, offsets_abs_trail_points)
|
(self.abs_trail_points, offsets_abs_trail_points)
|
||||||
{
|
{
|
||||||
use StageSection::{Action, Movement, Recover};
|
|
||||||
if matches!(
|
|
||||||
char_ability,
|
|
||||||
Some(
|
|
||||||
CharacterAbilityType::BasicMelee(Action)
|
|
||||||
| CharacterAbilityType::ChargedMelee(Action)
|
|
||||||
| CharacterAbilityType::DashMelee(Action)
|
|
||||||
| CharacterAbilityType::ComboMelee(Action | Recover, _)
|
|
||||||
| CharacterAbilityType::LeapMelee(Movement | Action)
|
|
||||||
| CharacterAbilityType::SpinMelee(Action)
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
let vertex = |p: anim::vek::Vec3<f32>| trail::Vertex {
|
let vertex = |p: anim::vek::Vec3<f32>| trail::Vertex {
|
||||||
pos: p.into_array(),
|
pos: p.into_array(),
|
||||||
};
|
};
|
||||||
@ -6485,7 +6470,6 @@ impl<S: Skeleton> FigureState<S> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
self.abs_trail_points = offsets_abs_trail_points;
|
self.abs_trail_points = offsets_abs_trail_points;
|
||||||
|
|
||||||
// TODO: compute the mount bone only when it is needed
|
// TODO: compute the mount bone only when it is needed
|
||||||
|
@ -158,7 +158,6 @@ impl Scene {
|
|||||||
mount_transform_pos: None,
|
mount_transform_pos: None,
|
||||||
body: None,
|
body: None,
|
||||||
tools: (None, None),
|
tools: (None, None),
|
||||||
char_ability: None,
|
|
||||||
col: Rgba::broadcast(1.0),
|
col: Rgba::broadcast(1.0),
|
||||||
dt: 15.0, // Want to get there immediately.
|
dt: 15.0, // Want to get there immediately.
|
||||||
_lpindex: 0,
|
_lpindex: 0,
|
||||||
@ -351,7 +350,6 @@ impl Scene {
|
|||||||
mount_transform_pos: None,
|
mount_transform_pos: None,
|
||||||
body: None,
|
body: None,
|
||||||
tools: (None, None),
|
tools: (None, None),
|
||||||
char_ability: None,
|
|
||||||
col: Rgba::broadcast(1.0),
|
col: Rgba::broadcast(1.0),
|
||||||
dt: scene_data.delta_time,
|
dt: scene_data.delta_time,
|
||||||
_lpindex: 0,
|
_lpindex: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user