diff --git a/assets/voxygen/voxel/humanoid_head_manifest.ron b/assets/voxygen/voxel/humanoid_head_manifest.ron index f44f59da5f..66fd22d638 100644 --- a/assets/voxygen/voxel/humanoid_head_manifest.ron +++ b/assets/voxygen/voxel/humanoid_head_manifest.ron @@ -1,6 +1,6 @@ ({ (Human, Male): ( - offset: (-7.0, -4.0, -6.0), + offset: (-7.0, -4.0, -2.0), head: ("figure.head.human.male", (0, 2, 0)), eyes: [ Some(("figure.eyes.general.male_default-0", (3, 9, 2))), @@ -45,7 +45,7 @@ None] ), (Human, Female): ( - offset: (-7.0, -4.0, -6.0), + offset: (-7.0, -4.0, -2.0), head: ("figure.head.human.female", (0, 3, 0)), eyes: [ Some(("figure.eyes.general.female_default-0", (2, 10, 2))), @@ -82,7 +82,7 @@ None] ), (Orc, Male): ( - offset: (-8.0, -5.0, -6.75), + offset: (-8.0, -5.0, -2.0), head: ("figure.head.orc.male", (0, 3, 0)), eyes: [ Some(("figure.eyes.orc.male-0", (5, 10, 6))), @@ -113,7 +113,7 @@ ], ), (Orc, Female): ( - offset: (-8.0, -2.5, -6.0), + offset: (-8.0, -2.5, -2.0), head: ("figure.head.orc.female", (0, 1, 0)), eyes: [ Some(("figure.eyes.general.female_default-0", (3, 8, 2))), @@ -141,7 +141,7 @@ ], ), (Elf, Male): ( - offset: (-8.0, -4.0, -6.0), + offset: (-8.0, -4.0, -2.0), head: ("figure.head.elf.male", (0, 2, 0)), eyes: [ Some(("figure.eyes.general.male_default-0", (4, 9, 2))), @@ -164,7 +164,7 @@ ] ), (Elf, Female): ( - offset: (-8.0, -4.0, -6.0), + offset: (-8.0, -4.0, -2.0), head: ("figure.head.elf.female", (0, 2, 0)), eyes: [ Some(("figure.eyes.general.female_styled-0", (3, 9, 2))), @@ -204,7 +204,7 @@ Some(("figure.accessory.elf.headband-0", (6, 9, 4))),] ), (Dwarf, Male): ( - offset: (-6.0, -4.5, -6.0), + offset: (-6.0, -4.5, -2.0), head: ("figure.head.dwarf.male", (0, 3, 0)), eyes: [ Some(("figure.eyes.general.male_bushy-0", (2, 10, 2))), @@ -257,7 +257,7 @@ ] ), (Dwarf, Female): ( - offset: (-6.0, -4.5, -6.0), + offset: (-6.0, -4.5, -2.0), head: ("figure.head.dwarf.female", (0, 3, 0)), eyes: [ Some(("figure.eyes.general.female_default-0", (1, 10, 2))), @@ -289,7 +289,7 @@ ] ), (Undead, Male): ( - offset: (-5.0, -4.0, -6.75), + offset: (-5.0, -4.0, -2.0), head: ("figure.head.undead.male", (0, 2, 0)), eyes: [ Some(("figure.eyes.undead.male-0", (2, 8, 4))), @@ -310,7 +310,7 @@ Some(("figure.accessory.undead.male_eyepatch", (0, 1, 0))),] ), (Undead, Female): ( - offset: (-5.0, -4.0, -6.75), + offset: (-5.0, -4.0, -2.0), head: ("figure.head.undead.female", (0, 2, 0)), eyes: [ Some(("figure.eyes.undead.female-0", (2, 8, 3))), @@ -331,7 +331,7 @@ Some(("figure.accessory.undead.female_eyepatch", (0, 1, -1))),] ), (Danari, Male): ( - offset: (-9.0, -4.0, -7.5), + offset: (-9.0, -4.0, -2.0), head: ("figure.head.danari.male", (0, 2, 2)), eyes: [ Some(("figure.eyes.general.male_bushy-0", (5, 9, 4))), @@ -357,7 +357,7 @@ Some(("figure.accessory.danari.horns-0", (4, 8, 8))),] ), (Danari, Female): ( - offset: (-9.0, -4.0, -7.5), + offset: (-9.0, -4.0, -2.0), head: ("figure.head.danari.female", (0, 2, 2)), eyes: [ Some(("figure.eyes.general.female_default-0", (4, 9, 4))), diff --git a/voxygen/anim/src/character/climb.rs b/voxygen/anim/src/character/climb.rs index 3cc1afc84e..c8c476d137 100644 --- a/voxygen/anim/src/character/climb.rs +++ b/voxygen/anim/src/character/climb.rs @@ -61,7 +61,7 @@ impl Animation for ClimbAnimation { let stagnant = if speed > -0.7 { 1.0 } else { 0.0 }; //sets static position when there is no movement if speed > 0.7 || lateral > 0.1 { - next.head.position = Vec3::new(0.0, -4.0 + s_a.head.0, s_a.head.1 + smootha * 0.2); + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + smootha * 0.2); next.head.orientation = Quaternion::rotation_z(smooth * 0.1) * Quaternion::rotation_x(0.6) * Quaternion::rotation_y(quick * 0.1); diff --git a/voxygen/anim/src/character/gliding.rs b/voxygen/anim/src/character/gliding.rs index d230e919e8..c3461630a7 100644 --- a/voxygen/anim/src/character/gliding.rs +++ b/voxygen/anim/src/character/gliding.rs @@ -76,6 +76,7 @@ impl Animation for GlidingAnimation { anim_time as f32 }; + next.head.position = Vec3::new(0.0, s_a.head.0 + 1.0, s_a.head.1); next.head.orientation = Quaternion::rotation_x(0.35 - slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + slowa * 0.15); diff --git a/voxygen/anim/src/character/jump.rs b/voxygen/anim/src/character/jump.rs index b012388d12..76882bbfef 100644 --- a/voxygen/anim/src/character/jump.rs +++ b/voxygen/anim/src/character/jump.rs @@ -61,7 +61,7 @@ impl Animation for JumpAnimation { next.shoulder_r.scale = Vec3::one() * 1.1; next.back.scale = Vec3::one() * 1.02; - next.head.position = Vec3::new(0.0, -1.0 + s_a.head.0, -1.0 + s_a.head.1); + next.head.position = Vec3::new(0.0, s_a.head.0, -1.0 + s_a.head.1); next.head.orientation = Quaternion::rotation_x(0.25 + slow * 0.04) * Quaternion::rotation_z(tilt * -2.5); diff --git a/voxygen/anim/src/character/mod.rs b/voxygen/anim/src/character/mod.rs index 8999c390bd..bd9a6c5c82 100644 --- a/voxygen/anim/src/character/mod.rs +++ b/voxygen/anim/src/character/mod.rs @@ -229,18 +229,18 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Danari, Female) => 1.15, }, head: match (body.species, body.body_type) { - (Orc, Male) => (-2.0, 13.5), - (Orc, Female) => (-2.0, 13.0), - (Human, Male) => (-2.3, 13.0), - (Human, Female) => (-2.0, 13.0), - (Elf, Male) => (-2.5, 13.0), - (Elf, Female) => (-1.0, 13.0), - (Dwarf, Male) => (-2.0, 14.0), - (Dwarf, Female) => (-2.0, 13.5), - (Undead, Male) => (-1.5, 13.0), - (Undead, Female) => (-1.5, 14.0), - (Danari, Male) => (-1.5, 12.5), - (Danari, Female) => (-1.5, 13.5), + (Orc, Male) => (-2.0, 9.0), + (Orc, Female) => (-2.0, 9.5), + (Human, Male) => (-2.3, 9.5), + (Human, Female) => (-2.0, 9.5), + (Elf, Male) => (-2.5, 9.5), + (Elf, Female) => (-1.0, 9.5), + (Dwarf, Male) => (-2.0, 10.0), + (Dwarf, Female) => (-2.0, 9.5), + (Undead, Male) => (-1.5, 8.5), + (Undead, Female) => (-1.5, 9.5), + (Danari, Male) => (-1.5, 7.0), + (Danari, Female) => (-1.5, 7.0), }, chest: match (body.species, body.body_type) { (_, _) => (0.0, 8.0), diff --git a/voxygen/anim/src/character/run.rs b/voxygen/anim/src/character/run.rs index fb95b4879e..d72d5aedfc 100644 --- a/voxygen/anim/src/character/run.rs +++ b/voxygen/anim/src/character/run.rs @@ -119,8 +119,7 @@ impl Animation for RunAnimation { * 0.1, ); - next.head.position = - Vec3::new(0.0, -1.0 * speednorm + s_a.head.0, s_a.head.1 + short * 0.1); + next.head.position = Vec3::new(0.0, 1.0 * speednorm + s_a.head.0, s_a.head.1 + short * 0.1); next.head.orientation = Quaternion::rotation_z(tilt * -2.5 + head_look.x * 0.2 - short * 0.02) * Quaternion::rotation_x(head_look.y + 0.45 * speednorm); diff --git a/voxygen/anim/src/character/shoot.rs b/voxygen/anim/src/character/shoot.rs index 7217109854..8a6a63e269 100644 --- a/voxygen/anim/src/character/shoot.rs +++ b/voxygen/anim/src/character/shoot.rs @@ -2,7 +2,7 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::{comp::item::ToolKind, states::utils::StageSection}; +use common::{comp::item::ToolKind, states::utils::StageSection, util::Dir}; use std::f32::consts::PI; pub struct ShootAnimation; @@ -13,6 +13,7 @@ type ShootAnimationDependency = ( f32, Vec3, Vec3, + Dir, f64, Option, ); @@ -33,6 +34,7 @@ impl Animation for ShootAnimation { velocity, orientation, last_ori, + _look_dir, _global_time, stage_section, ): Self::Dependency, diff --git a/voxygen/anim/src/character/sneak.rs b/voxygen/anim/src/character/sneak.rs index 2d4f9bae15..e5e67cacf0 100644 --- a/voxygen/anim/src/character/sneak.rs +++ b/voxygen/anim/src/character/sneak.rs @@ -93,8 +93,7 @@ impl Animation for SneakAnimation { next.hand_r.position = Vec3::new(-1.0 + s_a.hand.0, -1.0 + s_a.hand.1, s_a.hand.2); next.hand_r.orientation = Quaternion::rotation_x(0.4); - next.head.position = - Vec3::new(0.0, -1.0 + s_a.head.0, -1.0 + s_a.head.1 + short * 0.06); + next.head.position = Vec3::new(0.0, 1.0 + s_a.head.0, -1.0 + s_a.head.1 + short * 0.06); next.head.orientation = Quaternion::rotation_z(tilt * -2.5 + head_look.x * 0.2 - short * 0.06) * Quaternion::rotation_x(head_look.y + 0.45); @@ -144,7 +143,7 @@ impl Animation for SneakAnimation { } else { next.head.position = Vec3::new( 0.0, - -1.0 + s_a.head.0, + 1.0 + s_a.head.0, -2.0 + s_a.head.1 + slow * 0.1 + breathe * -0.05, ); next.head.orientation = Quaternion::rotation_z(head_look.x) diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index f1717bd619..3419d79000 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -29,13 +29,14 @@ use common::{ comp::{ inventory::slot::EquipSlot, item::{ItemKind, ToolKind}, - Body, CharacterState, Health, Inventory, Item, Last, LightAnimation, LightEmitter, Ori, - PhysicsState, PoiseState, Pos, Scale, Vel, + Body, CharacterState, Controller, Health, Inventory, Item, Last, LightAnimation, + LightEmitter, Ori, PhysicsState, PoiseState, Pos, Scale, Vel, }, resources::DeltaTime, span, states::utils::StageSection, terrain::TerrainChunk, + util::Dir, vol::RectRasterableVol, }; use common_sys::state::State; @@ -543,6 +544,7 @@ impl FigureMgr { ( entity, pos, + controller, interpolated, vel, scale, @@ -557,6 +559,7 @@ impl FigureMgr { ) in ( &ecs.entities(), &ecs.read_storage::(), + ecs.read_storage::().maybe(), ecs.read_storage::().maybe(), &ecs.read_storage::(), ecs.read_storage::().maybe(), @@ -572,6 +575,9 @@ impl FigureMgr { .enumerate() { let vel = (anim::vek::Vec3::::from(vel.0),); + let look_dir = controller + .map(|c| c.inputs.look_dir) + .unwrap_or(Dir::default()); let is_player = scene_data.player_entity == entity; let player_camera_mode = if is_player { camera_mode @@ -881,6 +887,7 @@ impl FigureMgr { // TODO: Update to use the quaternion. ori * anim::vek::Vec3::::unit_y(), state.last_ori * anim::vek::Vec3::::unit_y(), + look_dir, time, Some(s.stage_section), ), @@ -912,6 +919,7 @@ impl FigureMgr { // TODO: Update to use the quaternion. ori * anim::vek::Vec3::::unit_y(), state.last_ori * anim::vek::Vec3::::unit_y(), + look_dir, time, Some(s.stage_section), ),