mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
cape work
This commit is contained in:
parent
66b283209b
commit
e2d60b858e
@ -135,6 +135,7 @@ impl Animation for ChargeAnimation {
|
||||
* Quaternion::rotation_z(0.4)
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.r_foot.scale = Vec3::one();
|
||||
|
||||
next.torso.offset =
|
||||
Vec3::new(0.0 + foot * 0.03, foote * 0.05, 0.1) * skeleton_attr.scaler;
|
||||
next.torso.ori = Quaternion::rotation_z(0.0)
|
||||
@ -158,6 +159,9 @@ impl Animation for ChargeAnimation {
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
}
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_x(-0.3);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7);
|
||||
next.l_shoulder.ori = Quaternion::rotation_x(0.0);
|
||||
|
@ -57,6 +57,10 @@ impl Animation for ClimbAnimation {
|
||||
next.belt.ori = Quaternion::rotation_z(quick * 0.0) * Quaternion::rotation_x(0.0);
|
||||
next.belt.scale = Vec3::one();
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_z(-0.2);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.offset = Vec3::new(0.0, 1.0, -5.0);
|
||||
next.shorts.ori = Quaternion::rotation_z(quick * 0.0)
|
||||
* Quaternion::rotation_x(0.1)
|
||||
|
@ -91,7 +91,7 @@ impl Animation for RunAnimation {
|
||||
next.belt.scale = Vec3::one();
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_z(0.0);
|
||||
next.back.ori = Quaternion::rotation_x(-0.2 + short * 0.2);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.offset = Vec3::new(0.0, 0.0, -5.0);
|
||||
@ -138,7 +138,7 @@ impl Animation for RunAnimation {
|
||||
|
||||
next.main.offset = Vec3::new(
|
||||
-7.0 + skeleton_attr.weapon_x,
|
||||
-5.0 + skeleton_attr.weapon_y,
|
||||
-6.5 + skeleton_attr.weapon_y,
|
||||
15.0,
|
||||
);
|
||||
next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + short * 0.25);
|
||||
|
@ -138,6 +138,9 @@ impl Animation for ShootAnimation {
|
||||
* Quaternion::rotation_y(0.0);
|
||||
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
}
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_x(-0.3);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7);
|
||||
next.l_shoulder.ori = Quaternion::rotation_x(0.0);
|
||||
|
@ -52,6 +52,10 @@ impl Animation for SitAnimation {
|
||||
next.belt.ori = Quaternion::rotation_x(stop * 0.3);
|
||||
next.belt.scale = (Vec3::one() + slow_abs * 0.05) * 1.02;
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_z(0.0);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.offset = Vec3::new(0.0, stop * 2.5, -5.0 + stop * 0.6);
|
||||
next.shorts.ori = Quaternion::rotation_x(stop * 0.6);
|
||||
next.shorts.scale = Vec3::one();
|
||||
|
@ -105,7 +105,7 @@ impl Animation for StandAnimation {
|
||||
|
||||
next.lantern.offset = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.lantern.ori = Quaternion::rotation_x(0.0);
|
||||
next.lantern.scale = Vec3::one() * 5.0;
|
||||
next.lantern.scale = Vec3::one() * 50.0;
|
||||
|
||||
next.torso.offset = Vec3::new(0.0, -0.1, 0.1) * skeleton_attr.scaler;
|
||||
next.torso.ori = Quaternion::rotation_x(0.0);
|
||||
|
@ -63,6 +63,10 @@ impl Animation for SwimAnimation {
|
||||
next.belt.ori = Quaternion::rotation_z(short * 0.25);
|
||||
next.belt.scale = Vec3::one();
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_z(0.0);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.offset = Vec3::new(0.0, 0.0, -5.0);
|
||||
next.shorts.ori = Quaternion::rotation_z(short * 0.4);
|
||||
next.shorts.scale = Vec3::one();
|
||||
|
@ -17,11 +17,16 @@ impl Animation for WieldAnimation {
|
||||
skeleton_attr: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
*rate = 1.0;
|
||||
let lab = 1.0;
|
||||
|
||||
let mut next = (*skeleton).clone();
|
||||
let slow_cos = (anim_time as f32 * 6.0 + PI).cos();
|
||||
let ultra_slow = (anim_time as f32 * 1.0 + PI).sin();
|
||||
let ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
|
||||
|
||||
let short = (((5.0)
|
||||
/ (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 16.0).sin()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * lab as f32 * 16.0).sin());
|
||||
let wave = (anim_time as f32 * 16.0).sin();
|
||||
match active_tool_kind {
|
||||
//TODO: Inventory
|
||||
@ -193,6 +198,10 @@ impl Animation for WieldAnimation {
|
||||
next.torso.ori = Quaternion::rotation_x(-0.2);
|
||||
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_x(-0.4 + short * 0.3);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.l_control.offset = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.l_control.ori = Quaternion::rotation_x(0.0);
|
||||
next.l_control.scale = Vec3::one();
|
||||
@ -232,6 +241,10 @@ impl Animation for WieldAnimation {
|
||||
Quaternion::rotation_y(ultra_slow_cos * 0.03) * Quaternion::rotation_z(0.22);
|
||||
next.belt.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.back.offset = Vec3::new(0.0, -2.8, 7.25);
|
||||
next.back.ori = Quaternion::rotation_x(-0.2);
|
||||
next.back.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shorts.offset = Vec3::new(0.0, 0.0, -5.0);
|
||||
next.shorts.ori = Quaternion::rotation_z(0.3);
|
||||
next.shorts.scale = Vec3::one();
|
||||
|
@ -31,6 +31,7 @@ struct CharacterCacheKey {
|
||||
chest: Option<Item>,
|
||||
belt: Option<Item>,
|
||||
back: Option<Item>,
|
||||
lantern: Option<Item>,
|
||||
hand: Option<Item>,
|
||||
pants: Option<Item>,
|
||||
foot: Option<Item>,
|
||||
@ -51,6 +52,7 @@ impl CharacterCacheKey {
|
||||
chest: loadout.chest.clone(),
|
||||
belt: loadout.belt.clone(),
|
||||
back: loadout.back.clone(),
|
||||
lantern: loadout.lantern.clone(),
|
||||
hand: loadout.hand.clone(),
|
||||
pants: loadout.pants.clone(),
|
||||
foot: loadout.foot.clone(),
|
||||
@ -122,6 +124,8 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
|
||||
HumArmorBeltSpec::load_watched(&mut self.manifest_indicator);
|
||||
let humanoid_armor_back_spec =
|
||||
HumArmorBackSpec::load_watched(&mut self.manifest_indicator);
|
||||
let humanoid_armor_lantern_spec =
|
||||
HumArmorLanternSpec::load_watched(&mut self.manifest_indicator);
|
||||
let humanoid_armor_pants_spec =
|
||||
HumArmorPantsSpec::load_watched(&mut self.manifest_indicator);
|
||||
let humanoid_armor_foot_spec =
|
||||
@ -234,7 +238,7 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
|
||||
} else {
|
||||
None
|
||||
},
|
||||
Some(mesh_lantern()),
|
||||
Some(humanoid_armor_lantern_spec.mesh_lantern(&body, loadout)),
|
||||
None,
|
||||
None,
|
||||
]
|
||||
|
@ -710,39 +710,21 @@ impl HumArmorLanternSpec {
|
||||
Some(spec) => spec,
|
||||
None => {
|
||||
error!("No lantern specification exists for {:?}", lantern);
|
||||
return load_mesh("not_found", Vec3::new(-5.0, -3.5, 1.0));
|
||||
return load_mesh("not_found", Vec3::new(-4.0, -3.5, 2.0));
|
||||
},
|
||||
}
|
||||
} else {
|
||||
&self.0.default
|
||||
};
|
||||
|
||||
let color = |mat_segment| {
|
||||
color_segment(
|
||||
mat_segment,
|
||||
body.race.skin_color(body.skin),
|
||||
body.race.hair_color(body.hair_color),
|
||||
body.race.eye_color(body.eye_color),
|
||||
)
|
||||
};
|
||||
let lantern_segment = color_segment(
|
||||
graceful_load_mat_segment(&spec.vox_spec.0),
|
||||
body.race.skin_color(body.skin),
|
||||
body.race.hair_color(body.hair_color),
|
||||
body.race.eye_color(body.eye_color),
|
||||
);
|
||||
|
||||
let bare_lantern = graceful_load_mat_segment("armor.empty");
|
||||
|
||||
let mut lantern_armor = graceful_load_mat_segment(&spec.vox_spec.0);
|
||||
|
||||
if let Some(color) = spec.color {
|
||||
let lantern_color = Vec3::from(color);
|
||||
lantern_armor =
|
||||
lantern_armor.map_rgb(|rgb| recolor_grey(rgb, Rgb::from(lantern_color)));
|
||||
}
|
||||
|
||||
let lantern = DynaUnionizer::new()
|
||||
.add(color(bare_lantern), Vec3::new(0, 0, 0))
|
||||
.add(color(lantern_armor), Vec3::new(0, 0, 0))
|
||||
.unify()
|
||||
.0;
|
||||
|
||||
generate_mesh(&lantern, Vec3::from(spec.vox_spec.1))
|
||||
generate_mesh(&lantern_segment, Vec3::from(spec.vox_spec.1))
|
||||
}
|
||||
}
|
||||
impl HumArmorHeadSpec {
|
||||
@ -751,7 +733,7 @@ impl HumArmorHeadSpec {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn mesh_lantern(&self, body: &Body, loadout: &Loadout) -> Mesh<FigurePipeline> {
|
||||
pub fn mesh_head(&self, body: &Body, loadout: &Loadout) -> Mesh<FigurePipeline> {
|
||||
let spec = if let Some(ItemKind::Armor {
|
||||
kind: Armor::Head(head),
|
||||
..
|
||||
@ -801,7 +783,7 @@ impl HumArmorTabardSpec {
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn mesh_lantern(&self, body: &Body, loadout: &Loadout) -> Mesh<FigurePipeline> {
|
||||
pub fn mesh_tabard(&self, body: &Body, loadout: &Loadout) -> Mesh<FigurePipeline> {
|
||||
let spec = if let Some(ItemKind::Armor {
|
||||
kind: Armor::Tabard(tabard),
|
||||
..
|
||||
@ -849,9 +831,6 @@ impl HumArmorTabardSpec {
|
||||
pub fn mesh_glider() -> Mesh<FigurePipeline> {
|
||||
load_mesh("object.glider", Vec3::new(-26.0, -26.0, -5.0))
|
||||
}
|
||||
pub fn mesh_lantern() -> Mesh<FigurePipeline> {
|
||||
load_mesh("object.lantern0", Vec3::new(0.0, 0.0, 0.0))
|
||||
}
|
||||
|
||||
/////////
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
Loading…
Reference in New Issue
Block a user