Run anim progress

This commit is contained in:
Snowram 2020-06-12 03:56:43 +02:00 committed by jshipsey
parent 1f5e0216c4
commit 1ffefde739
3 changed files with 115 additions and 51 deletions

View File

@ -341,69 +341,69 @@
), ),
(Tiger, Male): ( (Tiger, Male): (
leg_fl: ( leg_fl: (
offset: (-2.0, -1.5, -2.5), offset: (-2.0, -1.5, -9.0),
lateral: ("npc.tiger.male.leg_fl"), lateral: ("npc.tiger.male.leg_fl"),
), ),
leg_fr: ( leg_fr: (
offset: (-2.0, -1.5, -2.5), offset: (-2.0, -1.5, -9.0),
lateral: ("npc.tiger.male.leg_fr"), lateral: ("npc.tiger.male.leg_fr"),
), ),
leg_bl: ( leg_bl: (
offset: (-2.0, -2.0, -3.5), offset: (-2.0, -2.0, -9.0),
lateral: ("npc.tiger.male.leg_bl"), lateral: ("npc.tiger.male.leg_bl"),
), ),
leg_br: ( leg_br: (
offset: (-2.0, -2.0, -3.5), offset: (-2.0, -2.0, -9.0),
lateral: ("npc.tiger.male.leg_br"), lateral: ("npc.tiger.male.leg_br"),
), ),
foot_fl: ( foot_fl: (
offset: (-2.5, -1.5, -2.5), offset: (-2.5, -1.5, -6.0),
lateral: ("npc.tiger.male.foot_fl"), lateral: ("npc.tiger.male.foot_fl"),
), ),
foot_fr: ( foot_fr: (
offset: (-2.5, -1.5, -2.5), offset: (-2.5, -1.5, -6.0),
lateral: ("npc.tiger.male.foot_fr"), lateral: ("npc.tiger.male.foot_fr"),
), ),
foot_bl: ( foot_bl: (
offset: (-2.5, -2.0, -3.5), offset: (-2.5, -2.0, -6.0),
lateral: ("npc.tiger.male.foot_bl"), lateral: ("npc.tiger.male.foot_bl"),
), ),
foot_br: ( foot_br: (
offset: (-2.5, -2.0, -3.5), offset: (-2.5, -2.0, -6.0),
lateral: ("npc.tiger.male.foot_br"), lateral: ("npc.tiger.male.foot_br"),
), ),
), ),
(Tiger, Female): ( (Tiger, Female): (
leg_fl: ( leg_fl: (
offset: (-1.5, -1.5, -2.5), offset: (-1.5, -1.5, -9.0),
lateral: ("npc.tiger.female.leg_fl"), lateral: ("npc.tiger.female.leg_fl"),
), ),
leg_fr: ( leg_fr: (
offset: (-1.5, -1.5, -2.5), offset: (-1.5, -1.5, -9.0),
lateral: ("npc.tiger.female.leg_fr"), lateral: ("npc.tiger.female.leg_fr"),
), ),
leg_bl: ( leg_bl: (
offset: (-1.5, -2.0, -3.5), offset: (-1.5, -2.0, -9.0),
lateral: ("npc.tiger.female.leg_bl"), lateral: ("npc.tiger.female.leg_bl"),
), ),
leg_br: ( leg_br: (
offset: (-1.5, -2.0, -3.5), offset: (-1.5, -2.0, -9.0),
lateral: ("npc.tiger.female.leg_br"), lateral: ("npc.tiger.female.leg_br"),
), ),
foot_fl: ( foot_fl: (
offset: (-1.5, -1.5, -2.5), offset: (-1.5, -1.5, -6.0),
lateral: ("npc.tiger.female.foot_fl"), lateral: ("npc.tiger.female.foot_fl"),
), ),
foot_fr: ( foot_fr: (
offset: (-1.5, -1.5, -2.5), offset: (-1.5, -1.5, -6.0),
lateral: ("npc.tiger.female.foot_fr"), lateral: ("npc.tiger.female.foot_fr"),
), ),
foot_bl: ( foot_bl: (
offset: (-1.5, -2.0, -3.5), offset: (-1.5, -2.0, -6.0),
lateral: ("npc.tiger.female.foot_bl"), lateral: ("npc.tiger.female.foot_bl"),
), ),
foot_br: ( foot_br: (
offset: (-1.5, -2.0, -3.5), offset: (-1.5, -2.0, -6.0),
lateral: ("npc.tiger.female.foot_br"), lateral: ("npc.tiger.female.foot_br"),
), ),
), ),

View File

@ -51,7 +51,7 @@ const TORSO_BACK_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const TORSO_MID_X: f32 = 0.0; const TORSO_MID_X: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[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_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const EARS_X: f32 = -2.5; const EARS_X: f32 = -2.5;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.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_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_FRONT_X: f32 = 6.0; const LEG_FRONT_X: f32 = 6.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[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_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_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_BACK_X: f32 = 5.5; const LEG_BACK_X: f32 = 5.5;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_BACK_Y: f32 = -14.0; const LEG_BACK_Y: f32 = -14.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[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_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const FEET_FRONT_X: f32 = 0.5; const FEET_FRONT_X: f32 = 0.5;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const FEET_FRONT_Y: f32 = 0.0; const FEET_FRONT_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[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_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const FEET_BACK_X: f32 = 0.5; const FEET_BACK_X: f32 = 0.5;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const FEET_BACK_Y: f32 = 0.0; const FEET_BACK_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)] #[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 { impl QuadrupedMediumSkeleton {

View File

@ -49,14 +49,44 @@ impl Animation for RunAnimation {
* 0.125, * 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( next.head_upper.offset = Vec3::new(
0.0, 0.0,
skeleton_attr.head_upper.0 + horichest * 1.8, skeleton_attr.head_upper.0 + horichest * 1.8,
skeleton_attr.head_upper.1 + verthead * -1.8, skeleton_attr.head_upper.1 + verthead * -1.8,
) / 11.0; );
next.head_upper.ori = next.head_upper.ori =
Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); 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( next.head_lower.offset = Vec3::new(
0.0, 0.0,
@ -74,14 +104,6 @@ impl Animation for RunAnimation {
next.tail.ori = Quaternion::rotation_x(0.0); next.tail.ori = Quaternion::rotation_x(0.0);
next.tail.scale = Vec3::one(); 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( next.torso_front.offset = Vec3::new(
0.0, 0.0,
skeleton_attr.torso_front.0 + horichest * 2.5, 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.ori = Quaternion::rotation_y(horichest * -0.09);
next.torso_front.scale = Vec3::one() * 0.98 / 11.0; 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.offset = Vec3::new(0.0, skeleton_attr.ears.0, skeleton_attr.ears.1);
next.ears.ori = Quaternion::rotation_x(0.0); next.ears.ori = Quaternion::rotation_x(0.0);
next.ears.scale = Vec3::one() * 1.02; 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( next.foot_fl.offset = Vec3::new(
-skeleton_attr.feet_f.0, -skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1 + horilf * 2.5, skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2 + vertlf * 5.0 * skeleton_attr.height - 0.5, skeleton_attr.feet_f.2,
) / 11.0; );
next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.4); next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.6);
next.foot_fl.scale = Vec3::one() / 11.0; next.foot_fl.scale = Vec3::one();
next.foot_fr.offset = Vec3::new( next.foot_fr.offset = Vec3::new(
skeleton_attr.feet_f.0, skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1 + horirfoffset * 2.5, skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2 + vertrfoffset * 5.0 * skeleton_attr.height - 0.5, skeleton_attr.feet_f.2,
) / 11.0; );
next.foot_fr.ori = Quaternion::rotation_x(horirfoffset * 0.4); next.foot_fr.ori = Quaternion::rotation_x(horilf * 0.6);
next.foot_fr.scale = Vec3::one() / 11.0; next.foot_fr.scale = Vec3::one();
next.foot_bl.offset = Vec3::new( next.foot_bl.offset = Vec3::new(
-skeleton_attr.feet_b.0, -skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1 + horilboffset * 3.0, skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2 + vertlboffset * 5.0 * skeleton_attr.height - 0.5, skeleton_attr.feet_b.2,
) / 11.0; );
next.foot_bl.ori = Quaternion::rotation_x(horilboffset * 0.35); next.foot_bl.ori = Quaternion::rotation_x(horirb * 0.35);
next.foot_bl.scale = Vec3::one() / 11.0; next.foot_bl.scale = Vec3::one();
next.foot_br.offset = Vec3::new( next.foot_br.offset = Vec3::new(
skeleton_attr.feet_b.0, skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1 + horirb * 3.0, skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2 + vertrb * 5.0 * skeleton_attr.height - 0.5, skeleton_attr.feet_b.2,
) / 11.0; );
next.foot_br.ori = Quaternion::rotation_x(horirb * 0.35); 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 next
} }