diff --git a/voxygen/src/anim/character/charge.rs b/voxygen/src/anim/character/charge.rs index bb6e3b168b..bd5d9d6b2a 100644 --- a/voxygen/src/anim/character/charge.rs +++ b/voxygen/src/anim/character/charge.rs @@ -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); diff --git a/voxygen/src/anim/character/climb.rs b/voxygen/src/anim/character/climb.rs index 463a4fdd0e..d2ea2f66da 100644 --- a/voxygen/src/anim/character/climb.rs +++ b/voxygen/src/anim/character/climb.rs @@ -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) diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 594b4634d2..3c9917ae2b 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -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); diff --git a/voxygen/src/anim/character/shoot.rs b/voxygen/src/anim/character/shoot.rs index 26f0d6c443..f064477536 100644 --- a/voxygen/src/anim/character/shoot.rs +++ b/voxygen/src/anim/character/shoot.rs @@ -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); diff --git a/voxygen/src/anim/character/sit.rs b/voxygen/src/anim/character/sit.rs index 4dadd1e095..e9eea8063b 100644 --- a/voxygen/src/anim/character/sit.rs +++ b/voxygen/src/anim/character/sit.rs @@ -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(); diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index 97f9660e39..97baf7bba5 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -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); diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 9b5e1193f8..0b2102f9ff 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -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(); diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index a35edb4b6c..c0c5143a0b 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -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(); diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index fb12fe9740..cd7d738fd2 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -31,6 +31,7 @@ struct CharacterCacheKey { chest: Option, belt: Option, back: Option, + lantern: Option, hand: Option, pants: Option, foot: Option, @@ -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 FigureModelCache { 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 FigureModelCache { } else { None }, - Some(mesh_lantern()), + Some(humanoid_armor_lantern_spec.mesh_lantern(&body, loadout)), None, None, ] diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index bcae0fbf7c..7bfac88f5e 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -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 { + pub fn mesh_head(&self, body: &Body, loadout: &Loadout) -> Mesh { 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 { + pub fn mesh_tabard(&self, body: &Body, loadout: &Loadout) -> Mesh { let spec = if let Some(ItemKind::Armor { kind: Armor::Tabard(tabard), .. @@ -849,9 +831,6 @@ impl HumArmorTabardSpec { pub fn mesh_glider() -> Mesh { load_mesh("object.glider", Vec3::new(-26.0, -26.0, -5.0)) } -pub fn mesh_lantern() -> Mesh { - load_mesh("object.lantern0", Vec3::new(0.0, 0.0, 0.0)) -} ///////// #[derive(Serialize, Deserialize)]