diff --git a/common/src/sys/control.rs b/common/src/sys/control.rs index df1b63fc26..0fa60fe0d0 100644 --- a/common/src/sys/control.rs +++ b/common/src/sys/control.rs @@ -86,7 +86,7 @@ impl<'a> System<'a> for Sys { if control.move_dir.magnitude() > 0.01 { Animation::Run } else { - Animation::Attack + Animation::Idle } } else if gliding { Animation::Gliding diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 793e19d1dc..6126fe3a45 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -47,19 +47,19 @@ impl Animation for AttackAnimation { .sin() * 0.25, ); - next.head.offset = Vec3::new(5.5, 2.0, 11.0); + next.head.offset = Vec3::new(0.0, 2.0, 11.0); next.head.ori = Quaternion::rotation_z(0.0); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(5.5, 0.0, 7.0); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0); next.chest.ori = Quaternion::rotation_x(0.0); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(5.5, 0.0, 5.0); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0); next.belt.ori = Quaternion::rotation_x(0.0); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(5.5, 0.0, 2.0); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); @@ -87,7 +87,7 @@ impl Animation for AttackAnimation { next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0); + next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); @@ -99,8 +99,7 @@ impl Animation for AttackAnimation { next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.04; - next.draw.offset = Vec3::new(5.5, 0.0, 0.0); - + next.draw.offset = Vec3::new(0.0, 5.0, 0.0); next.draw.ori = Quaternion::rotation_y(0.0); next.draw.scale = Vec3::one() * 0.0; @@ -108,8 +107,11 @@ impl Animation for AttackAnimation { next.left_equip.ori = Quaternion::rotation_x(0.0 + wave * 2.0)* Quaternion::rotation_z(1.57 + wave * 2.0); next.left_equip.scale = Vec3::one() / 11.0; - - next.torso.offset = Vec3::new(-0.5, -0.2, 0.1); + next.right_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; + next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.scale = Vec3::one() * 0.0; + + next.torso.offset = Vec3::new(0.0, -0.2, 0.1); next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0; next diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index 3e28bc91bd..2834657832 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -46,20 +46,20 @@ impl Animation for GlidingAnimation { .sin() * 0.25, ); - next.head.offset = Vec3::new(5.5, 2.0, 12.0); + next.head.offset = Vec3::new(0.0, 2.0, 12.0); next.head.ori = Quaternion::rotation_x(0.35 - wave_very_slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + wave_very_slow_cos * 0.15); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(5.5, 0.0, 8.0); + next.chest.offset = Vec3::new(0.0, 0.0, 8.0); next.chest.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.15); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(5.5, 0.0, 6.0); + next.belt.offset = Vec3::new(0.0, 0.0, 6.0); next.belt.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.20); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(5.5, 0.0, 3.0); + next.shorts.offset = Vec3::new(0.0, 0.0, 3.0); next.shorts.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.25); next.shorts.scale = Vec3::one(); @@ -92,7 +92,7 @@ impl Animation for GlidingAnimation { ); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0); + next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); @@ -105,16 +105,19 @@ impl Animation for GlidingAnimation { next.r_shoulder.scale = Vec3::one() * 1.04; - next.draw.offset = Vec3::new(5.5, -9.0 + wave_very_slow * 0.10, 18.0); + next.draw.offset = Vec3::new(0.0, -9.0 + wave_very_slow * 0.10, 18.0); next.draw.ori = Quaternion::rotation_x(0.95 - wave_very_slow * 0.15) * Quaternion::rotation_y(wave_very_slow_cos * 0.04); next.draw.scale = Vec3::one(); next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; next.left_equip.ori = Quaternion::rotation_x(0.0);; next.left_equip.scale = Vec3::one() *0.0; + + next.right_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; + next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.scale = Vec3::one() * 0.0; - - next.torso.offset = Vec3::new(-0.5, -0.2, 0.0); + next.torso.offset = Vec3::new(0.0, -0.2, 0.0); next.torso.ori = Quaternion::rotation_x(-0.8 + wave_very_slow * 0.10); next.torso.scale = Vec3::one() / 11.0; diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 8805d2285d..acf5a67596 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -39,19 +39,19 @@ impl Animation for IdleAnimation { .sin() * 0.25, ); - next.head.offset = Vec3::new(5.5, 2.0, 11.0 + wave_ultra_slow * 0.3); + next.head.offset = Vec3::new(0.0, 2.0, 11.0 + wave_ultra_slow * 0.3); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(5.5, 0.0, 7.0 + wave_ultra_slow * 0.3); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.3); next.chest.ori = Quaternion::rotation_x(0.0); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(5.5, 0.0, 5.0 + wave_ultra_slow * 0.3); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_ultra_slow * 0.3); next.belt.ori = Quaternion::rotation_x(0.0); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(5.5, 0.0, 2.0 + wave_ultra_slow * 0.3); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_ultra_slow * 0.3); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); @@ -59,7 +59,6 @@ impl Animation for IdleAnimation { -7.5, -2.0 + wave_ultra_slow_cos * 0.15, 8.0 + wave_ultra_slow * 0.5, - 11.5 + wave_ultra_slow * 0.5, ) / 11.0; next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); @@ -74,15 +73,15 @@ impl Animation for IdleAnimation { next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); next.r_hand.scale = Vec3::one() / 11.; - next.l_foot.offset = Vec3::new(-3.3, -0.1, 8.0); + next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); next.l_foot.ori = Quaternion::identity(); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(4.1, -0.1, 8.0); + next.r_foot.offset = Vec3::new(3.4, -0.1, 8.0); next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0); + next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); @@ -94,21 +93,19 @@ impl Animation for IdleAnimation { next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.04; - next.draw.offset = Vec3::new(5.5, 0.0, 0.0); + next.draw.offset = Vec3::new(0.0, 5.0, 0.0); next.draw.ori = Quaternion::rotation_y(0.0); next.draw.scale = Vec3::one() * 0.0; next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; next.left_equip.ori = Quaternion::rotation_x(0.0);; - next.left_equip.scale = Vec3::one() *0.0; - + next.left_equip.scale = Vec3::one() * 0.0; - next.draw.offset = Vec3::new(13.5, 0.0, 0.0); - next.draw.ori = Quaternion::rotation_y(0.0); - next.draw.scale = Vec3::one() * 0.0; - + next.right_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; + next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(-0.5, -0.2, 0.1); + next.torso.offset = Vec3::new(0.0, -0.2, 0.1); next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0; diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index 3c090a41f8..f1e9c943ca 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -25,19 +25,19 @@ impl Animation for JumpAnimation { let wave_stop_alt = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); - next.head.offset = Vec3::new(5.5, 2.0, 12.0); - next.head.ori = Quaternion::rotation_x(0.25); + next.head.offset = Vec3::new(0.0, 3.0, 13.0); + next.head.ori = Quaternion::rotation_x(0.25 + wave_stop * 0.1 + wave_slow * 0.04); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(5.5, 0.0, 8.0); + next.chest.offset = Vec3::new(0.0, 0.0, 8.0); next.chest.ori = Quaternion::rotation_z(0.0); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(5.5, 0.0, 6.0); + next.belt.offset = Vec3::new(0.0, 0.0, 6.0); next.belt.ori = Quaternion::rotation_z(0.0); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(5.5, 0.0, 3.0); + next.shorts.offset = Vec3::new(0.0, 0.0, 3.0); next.shorts.ori = Quaternion::rotation_z(0.0); next.shorts.scale = Vec3::one(); @@ -57,7 +57,7 @@ impl Animation for JumpAnimation { next.r_foot.ori = Quaternion::rotation_x(wave_stop * 1.2 + wave_slow * 0.2); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0); + next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); @@ -69,7 +69,7 @@ impl Animation for JumpAnimation { next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.04; - next.draw.offset = Vec3::new(5.5, 0.0, 0.0); + next.draw.offset = Vec3::new(0.0, 5.0, 0.0); next.draw.ori = Quaternion::rotation_y(0.0); next.draw.scale = Vec3::one() * 0.0; @@ -77,13 +77,11 @@ impl Animation for JumpAnimation { next.left_equip.ori = Quaternion::rotation_x(0.0);; next.left_equip.scale = Vec3::one() *0.0; - next.draw.offset = Vec3::new(13.5, 0.0, 0.0); - next.draw.ori = Quaternion::rotation_y(0.0); - next.draw.scale = Vec3::one() * 0.0; + next.right_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; + next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.scale = Vec3::one() * 0.0; - - - next.torso.offset = Vec3::new(-0.5, -0.2, 0.0); + next.torso.offset = Vec3::new(0.0, -0.2, 0.0); next.torso.ori = Quaternion::rotation_x(-0.2); next.torso.scale = Vec3::one() / 11.0; diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 6738970965..d6713d907b 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -34,6 +34,7 @@ pub struct CharacterSkeleton { r_shoulder: Bone, draw: Bone, left_equip: Bone, + right_equip: Bone, torso: Bone, } @@ -53,6 +54,7 @@ impl CharacterSkeleton { r_shoulder: Bone::default(), draw: Bone::default(), left_equip: Bone::default(), + right_equip: Bone::default(), torso: Bone::default(), } } @@ -78,9 +80,9 @@ impl Skeleton for CharacterSkeleton { FigureBoneData::new(torso_mat * chest_mat * self.r_shoulder.compute_base_matrix()), FigureBoneData::new(torso_mat * self.draw.compute_base_matrix()), FigureBoneData::new(self.left_equip.compute_base_matrix()), + FigureBoneData::new(self.right_equip.compute_base_matrix()), FigureBoneData::new(torso_mat), FigureBoneData::default(), - FigureBoneData::default(), ] @@ -100,6 +102,7 @@ impl Skeleton for CharacterSkeleton { self.r_shoulder.interpolate(&target.r_shoulder); self.draw.interpolate(&target.draw); self.left_equip.interpolate(&target.left_equip); + self.right_equip.interpolate(&target.right_equip); self.torso.interpolate(&target.torso); } } diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 82c89e87d5..d8292286c4 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -36,19 +36,19 @@ impl Animation for RunAnimation { * 0.1, ); - next.head.offset = Vec3::new(5.5, 2.0, 11.0 + wave_cos * 1.3); + next.head.offset = Vec3::new(0.0, 3.0, 12.0 + wave_cos * 1.3); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y + 0.35); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(5.5, 0.0, 7.0 + wave_cos * 1.1); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_cos * 1.1); next.chest.ori = Quaternion::rotation_z(wave * 0.1); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(5.5, 0.0, 5.0 + wave_cos * 1.1); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_cos * 1.1); next.belt.ori = Quaternion::rotation_z(wave * 0.25); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(5.5, 0.0, 2.0 + wave_cos * 1.1); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_cos * 1.1); next.shorts.ori = Quaternion::rotation_z(wave * 0.6); next.shorts.scale = Vec3::one(); @@ -68,7 +68,7 @@ impl Animation for RunAnimation { next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave * 1.5); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-9.0, -5.0, 15.0); + next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); @@ -80,17 +80,22 @@ impl Animation for RunAnimation { next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.04; - next.torso.offset = Vec3::new(-0.5, -0.2, 0.4); - next.torso.ori = Quaternion::rotation_x(-velocity * 0.05 - wave_cos * 0.1); - next.torso.scale = Vec3::one() / 11.0; + next.draw.offset = Vec3::new(0.0, 5.0, 0.0); + next.draw.ori = Quaternion::rotation_y(0.0); + next.draw.scale = Vec3::one() * 0.0; next.left_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; next.left_equip.ori = Quaternion::rotation_x(0.0);; next.left_equip.scale = Vec3::one() * 0.0; - next.draw.offset = Vec3::new(5.5, 0.0, 0.0); - next.draw.ori = Quaternion::rotation_y(0.0); - next.draw.scale = Vec3::one() * 0.0; + next.right_equip.offset = Vec3::new(0.0, 0.0, 5.0) / 11.0; + next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.scale = Vec3::one() * 0.0; + + next.torso.offset = Vec3::new(0.0, -0.2, 0.4); + next.torso.ori = Quaternion::rotation_x(-velocity * 0.04 - wave_cos * 0.10); + next.torso.scale = Vec3::one() / 11.0; + next diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 911ae52f35..5cb6506dc4 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -70,7 +70,7 @@ impl FigureModelCache { Some(Self::load_right_shoulder(body.shoulder)), Some(Self::load_draw(body.draw)), Some(Self::load_left_equip(body.weapon)), - None, + Some(Self::load_right_equip(body.hand)), None, None, ], @@ -138,6 +138,7 @@ impl FigureModelCache { ) } + fn load_chest(chest: Chest) -> Mesh { Self::load_mesh( match chest { @@ -200,7 +201,7 @@ impl FigureModelCache { Foot::Default => "figure/body/foot.vox", Foot::Dark => "armor/foot/foot_dark.vox", }, - Vec3::new(2.5, -3.5, -9.0), + Vec3::new(-2.5, -3.5, -9.0), ) } @@ -210,7 +211,7 @@ impl FigureModelCache { Foot::Default => "figure/body/foot.vox", Foot::Dark => "armor/foot/foot_dark.vox", }, - Vec3::new(2.5, -3.5, -9.0), + Vec3::new(-2.5, -3.5, -9.0), ) } @@ -262,6 +263,15 @@ impl FigureModelCache { Vec3::new(-6.5, -1.5, -5.0), ) } + fn load_right_equip(hand: Hand) -> Mesh { + Self::load_mesh( + match hand { + Hand::Default => "figure/body/hand.vox", + }, + Vec3::new(-2.0, -2.5, -2.0), + ) + } +