From 25f05b0add4baca8bd5ebd5e75e6eed6353383f6 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sun, 19 May 2019 18:01:19 -0400 Subject: [PATCH] rotation simplification Former-commit-id: a948b8a62f42ff5f516721396c1e066fdd379794 --- voxygen/src/anim/character/attack.rs | 28 ++++++++++++++-------------- voxygen/src/anim/character/mod.rs | 6 +++--- voxygen/src/scene/figure.rs | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 000ef57c92..4e125ffda4 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -43,19 +43,19 @@ impl Animation for AttackAnimation { .sin() * 0.25, ); - next.head.offset = Vec3::new(5.5, 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.offset = Vec3::new(5.5, 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 + wave_ultra_slow * 0.3); + next.chest.offset = Vec3::new(5.5, 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 + wave_ultra_slow * 0.3); + next.belt.offset = Vec3::new(5.5, 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 + wave_ultra_slow * 0.3); + next.shorts.offset = Vec3::new(5.5, 0.0, 2.0); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); @@ -65,15 +65,15 @@ impl Animation for AttackAnimation { 11.5 + wave_ultra_slow * 0.5, ); - next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); + next.l_hand.ori = Quaternion::rotation_x(0.0); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( 9.0, - -2.0 + wave_ultra_slow_cos * 0.15, - 11.5 + wave_ultra_slow * 0.5, + -2.0, + 11.5, ); - next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * 0.06); + next.r_hand.ori = Quaternion::rotation_x(0.0); next.r_hand.scale = Vec3::one(); next.l_foot.offset = Vec3::new(-3.3, -0.1, 8.0); @@ -84,8 +84,8 @@ impl Animation for AttackAnimation { next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-5.0, -6.0, 18.0); - next.weapon.ori = Quaternion::rotation_z(wave * 1.0); + next.weapon.offset = Vec3::new(0.0, 0.0, 0.0); + next.weapon.ori = Quaternion::identity(); next.weapon.scale = Vec3::one(); next.l_shoulder.offset = Vec3::new(-10.0, -3.0, 2.5); @@ -100,11 +100,11 @@ impl Animation for AttackAnimation { next.draw.ori = Quaternion::rotation_y(0.0); next.draw.scale = Vec3::one() * 0.0; - next.l_hold.offset = Vec3::new(0.0, 0.0, 5.0); - next.l_hold.ori = Quaternion::rotation_x(0.0); + next.l_hold.offset = Vec3::new(0.0, 0.0, 25.0); + next.l_hold.ori = Quaternion::rotation_z(wave * 10.0); next.l_hold.scale = Vec3::one(); - next.r_hold.offset = Vec3::new(-2.0, -2.5, 0.0); + next.r_hold.offset = Vec3::new(2.0, 2.5, 0.0); next.r_hold.ori = Quaternion::rotation_x(0.0); next.r_hold.scale = Vec3::one(); diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 9935aa496d..539010e28d 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -75,12 +75,12 @@ impl Skeleton for CharacterSkeleton { FigureBoneData::new(torso_mat * self.r_hand.compute_base_matrix()), FigureBoneData::new(torso_mat * self.l_foot.compute_base_matrix()), FigureBoneData::new(torso_mat * self.r_foot.compute_base_matrix()), - FigureBoneData::new(torso_mat * chest_mat * weapon_mat), + FigureBoneData::new(torso_mat * chest_mat * self.l_hold.compute_base_matrix() * weapon_mat), FigureBoneData::new(torso_mat * chest_mat * self.l_shoulder.compute_base_matrix()), FigureBoneData::new(torso_mat * chest_mat * self.r_shoulder.compute_base_matrix()), FigureBoneData::new(torso_mat * l_hand_mat * self.draw.compute_base_matrix()), - FigureBoneData::new(torso_mat * weapon_mat * self.l_hold.compute_base_matrix()), - FigureBoneData::new(torso_mat * weapon_mat * self.r_hold.compute_base_matrix()), + FigureBoneData::new(torso_mat * self.l_hold.compute_base_matrix()), + FigureBoneData::new(torso_mat * self.r_hold.compute_base_matrix()), FigureBoneData::new(torso_mat), FigureBoneData::default(), ] diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 2c12797791..093470f806 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -257,7 +257,7 @@ impl FigureModelCache { match hand { Hand::Default => "figure/body/hand.vox", }, - Vec3::new(0.0, -2.5, 0.0), + Vec3::new(-2.0, -2.5, 0.0), ) } @@ -266,7 +266,7 @@ impl FigureModelCache { match hand { Hand::Default => "figure/body/hand.vox", }, - Vec3::new(-2.0, -2.5, 0.0), + Vec3::new(-2.0, 2.5, 0.0), ) }