more progress on on quad_med run

This commit is contained in:
jshipsey 2020-06-12 01:07:48 -04:00
parent 7d7ee11eef
commit e362749fc7
3 changed files with 165 additions and 99 deletions

View File

@ -67,17 +67,17 @@ impl Animation for RunAnimation {
let footvertr = (anim_time as f32 * 16.0 * lab as f32 + PI).sin();
let footrotl = (((5.0)
/ (2.5
+ (2.5)
/ (0.5
+ (4.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin());
let footrotr = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.3).sin())
/ (0.5
+ (4.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin());
@ -100,16 +100,16 @@ impl Animation for RunAnimation {
let footvertrb = (anim_time as f32 * 16.0 * lab as f32 + PI*0.8).sin();
let footrotlb = (((5.0)
/ (2.5
+ (2.5)
/ (0.5
+ (4.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.2).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.2).sin());
let footrotrb = (((5.0)
/ (1.0
+ (4.0)
/ (0.5
+ (4.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.2).sin())
.powf(2.0 as f32)))
.sqrt())

View File

@ -35,15 +35,15 @@ const HEAD_UPPER_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const HEAD_LOWER_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const HEAD_LOWER_Z: f32 = 0.5;
const HEAD_LOWER_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const JAW_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const JAW_Z: f32 = -4.0;
const JAW_Z: f32 = -0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const TAIL_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const TAIL_Z: f32 = -7.0;
const TAIL_Z: f32 = -0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const TORSO_BACK_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
@ -55,31 +55,31 @@ const TORSO_FRONT_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const EARS_Y: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const EARS_Z: f32 = 5.0;
const EARS_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_FRONT_X: f32 = 6.0;
const LEG_FRONT_X: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_FRONT_Y: f32 = -0.5;
const LEG_FRONT_Y: f32 = -0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_FRONT_Z: f32 = 14.0;
const LEG_FRONT_Z: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_BACK_X: f32 = 5.5;
const LEG_BACK_X: f32 = 0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_BACK_Y: f32 = -14.0;
const LEG_BACK_Y: f32 = -0.0;
#[const_tweaker::tweak(min = -20.0, max = 20.0, step = 0.5)]
const LEG_BACK_Z: f32 = 13.5;
const LEG_BACK_Z: f32 = 0.0;
#[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.0;
#[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 = -8.0;
const FEET_FRONT_Z: f32 = 0.0;
#[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.0;
#[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 = -7.5;
const FEET_BACK_Z: f32 = 0.0;
impl QuadrupedMediumSkeleton {
@ -199,7 +199,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (14.0, 12.0),
(Tuskram, _) => (9.0, 12.0),
(Lion, _) => (12.5, 14.0),
(Tarasque, _) => (*HEAD_UPPER_Y+14.0, *HEAD_UPPER_Z+2.5),
(Tarasque, _) => (14.0, 3.5),
(Tiger, _) => (12.0, 19.0),
},
head_lower: match (body.species, body.body_type) {
@ -207,8 +207,8 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (-6.0, 0.0),
(Tuskram, _) => (-3.0, -1.0),
(Lion, _) => (-5.0, -1.0),
(Tiger, _) => (*HEAD_LOWER_X, *HEAD_LOWER_Z),
(Tarasque, _) => (*HEAD_LOWER_Y+0.5, *HEAD_LOWER_Z-3.0),
(Tiger, _) => (0.0, 0.0),
(Tarasque, _) => (0.5, -2.0),
(Tiger, _) => (-5.0, -6.0),
},
jaw: match (body.species, body.body_type) {
@ -216,8 +216,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (2.0, -1.0),
(Tuskram, _) => (2.0, -2.0),
(Lion, _) => (2.0, -3.0),
(Tarasque, _) => (4.0, -9.0),
(Tarasque, _) => (*JAW_Y+0.5, *JAW_Z-11.0),
(Tarasque, _) => (1.5, -10.0),
(Tiger, _) => (4.0, -9.0),
},
tail: match (body.species, body.body_type) {
@ -225,7 +224,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (-4.0, -2.0),
(Tuskram, _) => (-6.0, -2.0),
(Lion, _) => (-8.0, -6.0),
(Tarasque, _) => (*TAIL_Y-4.5, *TAIL_Z+0.0),
(Tarasque, _) => (-4.5, 0.0),
(Tiger, _) => (-7.0, -2.0),
},
torso_front: match (body.species, body.body_type) {
@ -233,7 +232,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (-7.0, 9.5),
(Tuskram, _) => (-7.0, 9.0),
(Lion, _) => (-9.0, 9.0),
(Tarasque, _) => (*TORSO_FRONT_Y+11.5, *TORSO_FRONT_Z+18.5),
(Tarasque, _) => (11.5, 18.5),
(Tiger, _) => (-7.0, 8.0),
},
torso_back: match (body.species, body.body_type) {
@ -241,7 +240,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (4.0, 9.0),
(Tuskram, _) => (4.0, 9.0),
(Lion, _) => (4.0, 10.0),
(Tarasque, _) => (*TORSO_BACK_Y-20.0, *TORSO_BACK_Z-1.0),
(Tarasque, _) => (-20.0, -1.0),
(Tiger, _) => (4.0, 9.0),
},
ears: match (body.species, body.body_type) {
@ -249,7 +248,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (-1.0, 6.0),
(Tuskram, _) => (10.0, 2.0),
(Lion, _) => (-2.0, 4.0),
(Tarasque, _) => (*EARS_Y-5.0, *EARS_Z+0.5),
(Tarasque, _) => (-5.0, 1.0),
(Tiger, _) => (1.5, -2.0),
},
leg_f: match (body.species, body.body_type) {
@ -257,7 +256,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (4.0, 6.0, 3.0),
(Tuskram, _) => (4.0, 6.0, 4.5),
(Lion, _) => (5.0, 6.0, 3.0),
(Tarasque, _) => (*LEG_FRONT_X+8.0, *LEG_FRONT_Y+4.5, *LEG_FRONT_Z+12.5),
(Tarasque, _) => (7.5, 4.5, 12.5),
(Tiger, _) => (4.0, 6.0, 3.0),
},
leg_b: match (body.species, body.body_type) {
@ -265,7 +264,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (4.0, -6.0, 3.5),
(Tuskram, _) => (4.0, -8.0, 5.5),
(Lion, _) => (5.5, -8.0, 3.5),
(Tarasque, _) => (*LEG_BACK_X+6.0, *LEG_BACK_Y-12.0, *LEG_BACK_Z+10.5),
(Tarasque, _) => (6.0, -10.0, 10.5),
(Tiger, _) => (4.0, -8.0, 3.5),
},
feet_f: match (body.species, body.body_type) {
@ -273,8 +272,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (4.0, 6.0, 3.0),
(Tuskram, _) => (4.0, 6.0, 4.5),
(Lion, _) => (5.0, 6.0, 3.0),
(Tarasque, _) => (4.0, 6.0, 3.0),
(Tarasque, _) => (*FEET_FRONT_X+2.0, *FEET_FRONT_Y+3.5, *FEET_FRONT_Z-3.5),
(Tarasque, _) => (2.0, -0.5, -3.5),
(Tiger, _) => (4.0, 6.0, 3.0),
},
feet_b: match (body.species, body.body_type) {
@ -282,7 +280,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Saber, _) => (4.0, -6.0, 3.5),
(Tuskram, _) => (4.0, -8.0, 5.5),
(Lion, _) => (5.5, -8.0, 3.5),
(Tarasque, _) => (*FEET_BACK_X+1.5, *FEET_BACK_Y+1.5, *FEET_BACK_Z-2.5),
(Tarasque, _) => (1.5, -0.5, -2.5),
(Tiger, _) => (4.0, -8.0, 3.5),
},
height: match (body.species, body.body_type) {

View File

@ -21,7 +21,103 @@ impl Animation for RunAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let lab = 14;
let lab = 0.1;
let short = (((5.0)
/ (3.6
+ 1.4 * ((anim_time as f32 *16.0* lab as f32+ PI * 1.0).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 *16.0* lab as f32+ PI * 1.0).sin());
let foothoril = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.45).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.45).sin());
let foothorir = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI *0.45).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.45).sin());
let footvertl = (anim_time as f32 * 16.0 * lab as f32+PI*0.0).sin();
let footvertr = (anim_time as f32 * 16.0 * lab as f32 + PI).sin();
let footrotl = (((5.0)
/ (2.5
+ (2.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin());
let footrotr = (((5.0)
/ (2.5
+ (2.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin());
///
let foothorilb = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI *1.05).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.05).sin());
let foothorirb = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI *0.05).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.05).sin());
let footvertlb = (anim_time as f32 * 16.0 * lab as f32+PI*(-0.4)).sin();
let footvertrb = (anim_time as f32 * 16.0 * lab as f32 + PI*0.6).sin();
let footrotlb = (((5.0)
/ (2.5
+ (2.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.0).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.0).sin());
let footrotrb = (((5.0)
/ (2.5
+ (2.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.0).sin())
.powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.0).sin());
let shortalt = (anim_time as f32 *16.0* lab as f32 + PI * 0.5).sin();
let vertlf = (anim_time as f32 * lab as f32 + PI * 1.8).sin().max(0.15);
let vertrfoffset = (anim_time as f32 * lab as f32 + PI * 0.80).sin().max(0.15);
let vertlboffset = (anim_time as f32 * lab as f32).sin().max(0.15);
@ -66,23 +162,11 @@ impl Animation for RunAnimation {
.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,
skeleton_attr.head_upper.0,
skeleton_attr.head_upper.1,
);
next.head_upper.ori =
Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x);
@ -91,7 +175,7 @@ impl Animation for RunAnimation {
next.head_lower.offset = Vec3::new(
0.0,
skeleton_attr.head_lower.0 + horichest * 0.8,
skeleton_attr.head_lower.1 + vertchest * -0.8 + verthead * 1.8,
skeleton_attr.head_lower.1 + vertchest * -0.8,
);
next.head_lower.ori = Quaternion::rotation_z(0.0);
next.head_lower.scale = Vec3::one() * 1.02;
@ -106,18 +190,18 @@ impl Animation for RunAnimation {
next.torso_front.offset = Vec3::new(
0.0,
skeleton_attr.torso_front.0 + horichest * 2.5,
skeleton_attr.torso_front.1 + vertchest * -3.2 + 1.0,
skeleton_attr.torso_front.0,
skeleton_attr.torso_front.1+shortalt*1.0,
) / 8.0;
next.torso_front.ori = Quaternion::rotation_y(horichest * -0.09);
next.torso_front.ori = Quaternion::rotation_x(short * -0.05);
next.torso_front.scale = Vec3::one() / 8.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,
skeleton_attr.torso_back.0,
skeleton_attr.torso_back.1,
);
next.torso_back.ori = Quaternion::rotation_y(horichest * -0.12);
next.torso_back.ori = Quaternion::rotation_y(0.0);
next.torso_back.scale = Vec3::one();
next.ears.offset = Vec3::new(0.0, skeleton_attr.ears.0, skeleton_attr.ears.1);
@ -126,85 +210,69 @@ impl Animation for RunAnimation {
next.leg_fl.offset = Vec3::new(
-skeleton_attr.leg_f.0,
skeleton_attr.leg_f.1,
skeleton_attr.leg_f.2,
skeleton_attr.leg_f.1 + foothoril * -3.5,
skeleton_attr.leg_f.2 +1.0+ ((footvertl * -1.0).max(-1.0)),
) / 8.0;
next.leg_fl.ori = Quaternion::rotation_x(horilf * 0.4);
next.leg_fl.scale = Vec3::one()/8.0;
next.leg_fl.ori = Quaternion::rotation_x(footrotl * -0.4);
next.leg_fl.scale = Vec3::one()/8.0*0.99;
next.leg_fr.offset = Vec3::new(
skeleton_attr.leg_f.0,
skeleton_attr.leg_f.1,
skeleton_attr.leg_f.2,
skeleton_attr.leg_f.1 + foothorir * -3.5,
skeleton_attr.leg_f.2 +1.0+ ((footvertr * -1.0).max(-1.0)),
) / 8.0;
next.leg_fr.ori = Quaternion::rotation_x(horilf * 0.4);
next.leg_fr.scale = Vec3::one();
) / 8.0;
next.leg_fr.ori = Quaternion::rotation_x(0.0);
next.leg_fr.scale = Vec3::one() / 8.0;
next.leg_fr.ori = Quaternion::rotation_x(footrotr * -0.4);
next.leg_fr.scale = Vec3::one()/8.0*0.99;
next.leg_bl.offset = Vec3::new(
-skeleton_attr.leg_b.0,
skeleton_attr.leg_b.1,
skeleton_attr.leg_b.2,
skeleton_attr.leg_b.1 + foothorilb * -3.5,
skeleton_attr.leg_b.2 +1.0+ ((footvertlb * -1.2).max(-1.0)),
) / 8.0;
next.leg_bl.ori = Quaternion::rotation_x(horirb * 0.55);
next.leg_bl.scale = Vec3::one() / 11.0;
next.leg_bl.ori = Quaternion::rotation_x(footrotlb * -0.4);
next.leg_bl.scale = Vec3::one() / 8.0*0.99;
next.leg_br.offset = Vec3::new(
skeleton_attr.leg_b.0,
skeleton_attr.leg_b.1 + horirb * 3.0,
skeleton_attr.leg_b.2,
skeleton_attr.leg_b.1 + foothorirb * -3.5,
skeleton_attr.leg_b.2 +1.0+ ((footvertrb * -1.2).max(-1.0)),
) / 8.0;
next.leg_br.ori = Quaternion::rotation_x(horirb * 0.55);
next.leg_br.scale = Vec3::one() / 8.0;
next.leg_bl.ori = Quaternion::rotation_x(0.0);
next.leg_bl.scale = Vec3::one() / 8.0;
next.leg_br.offset = Vec3::new(
skeleton_attr.leg_b.0,
skeleton_attr.leg_b.1,
skeleton_attr.leg_b.2,
) / 8.0;
next.leg_br.ori = Quaternion::rotation_x(0.0);
next.leg_br.scale = Vec3::one() / 8.0;
next.leg_br.ori = Quaternion::rotation_x(footrotrb * -0.4);
next.leg_br.scale = Vec3::one() / 8.0*0.99;
next.foot_fl.offset = Vec3::new(
-skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2,
);
next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.6);
next.foot_fl.ori = Quaternion::rotation_x(0.0);
next.foot_fl.scale = Vec3::one();
next.foot_fl.ori = Quaternion::rotation_x(footrotl * -0.7);
next.foot_fl.scale = Vec3::one()*0.98;
next.foot_fr.offset = Vec3::new(
skeleton_attr.feet_f.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_fr.ori = Quaternion::rotation_x(footrotr * -0.7);
next.foot_fr.scale = Vec3::one()*0.98;
next.foot_bl.offset = Vec3::new(
-skeleton_attr.feet_b.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_bl.ori = Quaternion::rotation_x(footrotlb * -0.7);
next.foot_bl.scale = Vec3::one()*0.98;
next.foot_br.offset = Vec3::new(
skeleton_attr.feet_b.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();
next.foot_br.ori = Quaternion::rotation_x(footrotrb * -0.7);
next.foot_br.scale = Vec3::one()*0.98;
next
}