From 1ffefde739c9caf02fa1c53b0a6adb08dfcf2240 Mon Sep 17 00:00:00 2001 From: Snowram Date: Fri, 12 Jun 2020 03:56:43 +0200 Subject: [PATCH] Run anim progress --- .../quadruped_medium_lateral_manifest.ron | 32 ++--- voxygen/src/anim/src/quadruped_medium/mod.rs | 12 +- voxygen/src/anim/src/quadruped_medium/run.rs | 122 +++++++++++++----- 3 files changed, 115 insertions(+), 51 deletions(-) diff --git a/assets/voxygen/voxel/quadruped_medium_lateral_manifest.ron b/assets/voxygen/voxel/quadruped_medium_lateral_manifest.ron index ec7737fcd0..7a825e71af 100644 --- a/assets/voxygen/voxel/quadruped_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/quadruped_medium_lateral_manifest.ron @@ -341,69 +341,69 @@ ), (Tiger, Male): ( leg_fl: ( - offset: (-2.0, -1.5, -2.5), + offset: (-2.0, -1.5, -9.0), lateral: ("npc.tiger.male.leg_fl"), ), leg_fr: ( - offset: (-2.0, -1.5, -2.5), + offset: (-2.0, -1.5, -9.0), lateral: ("npc.tiger.male.leg_fr"), ), leg_bl: ( - offset: (-2.0, -2.0, -3.5), + offset: (-2.0, -2.0, -9.0), lateral: ("npc.tiger.male.leg_bl"), ), leg_br: ( - offset: (-2.0, -2.0, -3.5), + offset: (-2.0, -2.0, -9.0), lateral: ("npc.tiger.male.leg_br"), ), foot_fl: ( - offset: (-2.5, -1.5, -2.5), + offset: (-2.5, -1.5, -6.0), lateral: ("npc.tiger.male.foot_fl"), ), foot_fr: ( - offset: (-2.5, -1.5, -2.5), + offset: (-2.5, -1.5, -6.0), lateral: ("npc.tiger.male.foot_fr"), ), foot_bl: ( - offset: (-2.5, -2.0, -3.5), + offset: (-2.5, -2.0, -6.0), lateral: ("npc.tiger.male.foot_bl"), ), foot_br: ( - offset: (-2.5, -2.0, -3.5), + offset: (-2.5, -2.0, -6.0), lateral: ("npc.tiger.male.foot_br"), ), ), (Tiger, Female): ( leg_fl: ( - offset: (-1.5, -1.5, -2.5), + offset: (-1.5, -1.5, -9.0), lateral: ("npc.tiger.female.leg_fl"), ), leg_fr: ( - offset: (-1.5, -1.5, -2.5), + offset: (-1.5, -1.5, -9.0), lateral: ("npc.tiger.female.leg_fr"), ), leg_bl: ( - offset: (-1.5, -2.0, -3.5), + offset: (-1.5, -2.0, -9.0), lateral: ("npc.tiger.female.leg_bl"), ), leg_br: ( - offset: (-1.5, -2.0, -3.5), + offset: (-1.5, -2.0, -9.0), lateral: ("npc.tiger.female.leg_br"), ), foot_fl: ( - offset: (-1.5, -1.5, -2.5), + offset: (-1.5, -1.5, -6.0), lateral: ("npc.tiger.female.foot_fl"), ), foot_fr: ( - offset: (-1.5, -1.5, -2.5), + offset: (-1.5, -1.5, -6.0), lateral: ("npc.tiger.female.foot_fr"), ), foot_bl: ( - offset: (-1.5, -2.0, -3.5), + offset: (-1.5, -2.0, -6.0), lateral: ("npc.tiger.female.foot_bl"), ), foot_br: ( - offset: (-1.5, -2.0, -3.5), + offset: (-1.5, -2.0, -6.0), lateral: ("npc.tiger.female.foot_br"), ), ), diff --git a/voxygen/src/anim/src/quadruped_medium/mod.rs b/voxygen/src/anim/src/quadruped_medium/mod.rs index 09611238b5..6394ac9e42 100644 --- a/voxygen/src/anim/src/quadruped_medium/mod.rs +++ b/voxygen/src/anim/src/quadruped_medium/mod.rs @@ -51,7 +51,7 @@ const TORSO_BACK_Z: f32 = 0.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const TORSO_MID_X: f32 = 0.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const TORSO_MID_Z: f32 = 12.5; +const TORSO_MID_Z: f32 = 13.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const EARS_X: f32 = -2.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] @@ -59,27 +59,27 @@ const EARS_Z: f32 = 5.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const LEG_FRONT_X: f32 = 6.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const LEG_FRONT_Y: f32 = 1.0; +const LEG_FRONT_Y: f32 = -0.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const LEG_FRONT_Z: f32 = 7.0; +const LEG_FRONT_Z: f32 = 14.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const LEG_BACK_X: f32 = 5.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const LEG_BACK_Y: f32 = -14.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const LEG_BACK_Z: f32 = 8.5; +const LEG_BACK_Z: f32 = 13.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const FEET_FRONT_X: f32 = 0.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const FEET_FRONT_Y: f32 = 0.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const FEET_FRONT_Z: f32 = -4.5; +const FEET_FRONT_Z: f32 = -8.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const FEET_BACK_X: f32 = 0.5; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] const FEET_BACK_Y: f32 = 0.0; #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] -const FEET_BACK_Z: f32 = -5.0; +const FEET_BACK_Z: f32 = -7.5; impl QuadrupedMediumSkeleton { diff --git a/voxygen/src/anim/src/quadruped_medium/run.rs b/voxygen/src/anim/src/quadruped_medium/run.rs index 2c814327b4..38a0a25ef1 100644 --- a/voxygen/src/anim/src/quadruped_medium/run.rs +++ b/voxygen/src/anim/src/quadruped_medium/run.rs @@ -49,14 +49,44 @@ impl Animation for RunAnimation { * 0.125, ); + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos(); + let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); + let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos(); + + let look = Vec2::new( + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(7331.0) + .sin() + * 0.5, + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(1337.0) + .sin() + * 0.25, + ); + let tailmove = Vec2::new( + ((global_time + anim_time) as f32 / 2.0) + .floor() + .mul(7331.0) + .sin() + * 0.25, + ((global_time + anim_time) as f32 / 2.0) + .floor() + .mul(1337.0) + .sin() + * 0.125, + ); + next.head_upper.offset = Vec3::new( 0.0, skeleton_attr.head_upper.0 + horichest * 1.8, skeleton_attr.head_upper.1 + verthead * -1.8, - ) / 11.0; + ); next.head_upper.ori = Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); - next.head_upper.scale = Vec3::one() / 10.98; + next.head_upper.scale = Vec3::one(); next.head_lower.offset = Vec3::new( 0.0, @@ -74,14 +104,6 @@ impl Animation for RunAnimation { next.tail.ori = Quaternion::rotation_x(0.0); next.tail.scale = Vec3::one(); - next.torso_back.offset = Vec3::new( - 0.0, - skeleton_attr.torso_back.0 + horichest * 2.9, - skeleton_attr.torso_back.1 + vertchest * -3.6 + 1.0, - ) / 11.0; - next.torso_back.ori = Quaternion::rotation_y(horichest * -0.12); - next.torso_back.scale = Vec3::one() / 11.0; - next.torso_front.offset = Vec3::new( 0.0, skeleton_attr.torso_front.0 + horichest * 2.5, @@ -90,41 +112,83 @@ impl Animation for RunAnimation { next.torso_front.ori = Quaternion::rotation_y(horichest * -0.09); next.torso_front.scale = Vec3::one() * 0.98 / 11.0; + next.torso_back.offset = Vec3::new( + 0.0, + skeleton_attr.torso_back.0 + horichest * 2.9, + skeleton_attr.torso_back.1 + vertchest * -3.6 + 1.0, + ); + next.torso_back.ori = Quaternion::rotation_y(horichest * -0.12); + next.torso_back.scale = Vec3::one(); + next.ears.offset = Vec3::new(0.0, skeleton_attr.ears.0, skeleton_attr.ears.1); next.ears.ori = Quaternion::rotation_x(0.0); next.ears.scale = Vec3::one() * 1.02; + + + next.leg_fl.offset = Vec3::new( + -skeleton_attr.leg_f.0, + skeleton_attr.leg_f.1, + skeleton_attr.leg_f.2, + ) / 11.0; + next.leg_fl.ori = Quaternion::rotation_x(horilf * 0.4); + next.leg_fl.scale = Vec3::one() / 11.0; + + next.leg_fr.offset = Vec3::new( + skeleton_attr.leg_f.0, + skeleton_attr.leg_f.1, + skeleton_attr.leg_f.2, + ) / 11.0; + next.leg_fr.ori = Quaternion::rotation_x(horilf * 0.4); + next.leg_fr.scale = Vec3::one() / 11.0; + + next.leg_bl.offset = Vec3::new( + -skeleton_attr.leg_b.0, + skeleton_attr.leg_b.1, + skeleton_attr.leg_b.2, + ) / 11.0; + next.leg_bl.ori = Quaternion::rotation_x(horirb * 0.55); + next.leg_bl.scale = Vec3::one() / 11.0; + + next.leg_br.offset = Vec3::new( + skeleton_attr.leg_b.0, + skeleton_attr.leg_b.1 + horirb * 3.0, + skeleton_attr.leg_b.2, + ) / 11.0; + next.leg_br.ori = Quaternion::rotation_x(horirb * 0.55); + next.leg_br.scale = Vec3::one() / 11.0; + next.foot_fl.offset = Vec3::new( -skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1 + horilf * 2.5, - skeleton_attr.feet_f.2 + vertlf * 5.0 * skeleton_attr.height - 0.5, - ) / 11.0; - next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.4); - next.foot_fl.scale = Vec3::one() / 11.0; + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ); + next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.6); + next.foot_fl.scale = Vec3::one(); next.foot_fr.offset = Vec3::new( skeleton_attr.feet_f.0, - skeleton_attr.feet_f.1 + horirfoffset * 2.5, - skeleton_attr.feet_f.2 + vertrfoffset * 5.0 * skeleton_attr.height - 0.5, - ) / 11.0; - next.foot_fr.ori = Quaternion::rotation_x(horirfoffset * 0.4); - next.foot_fr.scale = Vec3::one() / 11.0; + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ); + next.foot_fr.ori = Quaternion::rotation_x(horilf * 0.6); + next.foot_fr.scale = Vec3::one(); next.foot_bl.offset = Vec3::new( -skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1 + horilboffset * 3.0, - skeleton_attr.feet_b.2 + vertlboffset * 5.0 * skeleton_attr.height - 0.5, - ) / 11.0; - next.foot_bl.ori = Quaternion::rotation_x(horilboffset * 0.35); - next.foot_bl.scale = Vec3::one() / 11.0; + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ); + next.foot_bl.ori = Quaternion::rotation_x(horirb * 0.35); + next.foot_bl.scale = Vec3::one(); next.foot_br.offset = Vec3::new( skeleton_attr.feet_b.0, - skeleton_attr.feet_b.1 + horirb * 3.0, - skeleton_attr.feet_b.2 + vertrb * 5.0 * skeleton_attr.height - 0.5, - ) / 11.0; + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ); next.foot_br.ori = Quaternion::rotation_x(horirb * 0.35); - next.foot_br.scale = Vec3::one() / 11.0; + next.foot_br.scale = Vec3::one(); next }