Extract scaling from all the animations

This commit is contained in:
Imbris 2021-06-26 17:27:19 -04:00
parent 6a15501b27
commit 32915f89a8
95 changed files with 213 additions and 269 deletions

View File

@ -173,7 +173,7 @@ impl Animation for AlphaAnimation {
if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
match spec.as_str() {
"Wendigo Magic" => {
next.torso.position = Vec3::new(0.0, 0.0, move1 * -0.3);
next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18);
next.upper_torso.orientation =
Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4);
next.lower_torso.orientation =
@ -262,7 +262,7 @@ impl Animation for AlphaAnimation {
next.shoulder_l.orientation = Quaternion::rotation_x(0.0);
};
next.torso.position = Vec3::new(0.0, move2 * -2.2, move2 * -1.0);
next.torso.position = Vec3::new(0.0, move2 * -10.35, move2 * -4.7);
},
"Minotaur" => {
next.control_l.position = Vec3::new(0.0, 4.0, 5.0);

View File

@ -170,7 +170,7 @@ impl Animation for BetaAnimation {
if let Some(AbilitySpec::Custom(spec)) = active_tool_spec {
match spec.as_str() {
"Wendigo Magic" => {
next.torso.position = Vec3::new(0.0, 0.0, move1 * -0.3);
next.torso.position = Vec3::new(0.0, 0.0, move1 * -2.18);
next.upper_torso.orientation =
Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4);
next.lower_torso.orientation =
@ -198,7 +198,7 @@ impl Animation for BetaAnimation {
next.head.orientation = Quaternion::rotation_x(move1 * 0.3);
},
"Tidal Claws" => {
next.torso.position = Vec3::new(0.0, 0.0, move1 * -0.3);
next.torso.position = Vec3::new(0.0, 0.0, move1 * -1.4);
next.upper_torso.orientation =
Quaternion::rotation_x(move1 * -0.5 + move2 * -0.4);
next.lower_torso.orientation =

View File

@ -121,7 +121,7 @@ impl Animation for ChargeMeleeAnimation {
-6.0 + move1 * 22.0 + move2 * 8.0,
-18.0 + move1 * 14.0 + move2 * -19.0,
);
next.torso.position = Vec3::new(0.0, move2 * 1.5, 0.0);
next.torso.position = Vec3::new(0.0, move2 * 7.06, 0.0);
next.second.scale = Vec3::one() * 1.0;
next.weapon_l.orientation =

View File

@ -62,7 +62,6 @@ impl Animation for IdleAnimation {
next.hand_r.scale = Vec3::one() * 1.04;
next.lower_torso.scale = Vec3::one() * 1.02;
next.hold.scale = Vec3::one() * 0.0;
next.torso.scale = Vec3::one();
next.second.scale = Vec3::one() * 0.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + torso * 0.2);
@ -137,7 +136,7 @@ impl Animation for IdleAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0 * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
if s_a.float {
next.upper_torso.position = Vec3::new(

View File

@ -116,7 +116,7 @@ impl Animation for JumpAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, 5.0 + s_a.foot.1, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.4);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0 * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next

View File

@ -81,11 +81,10 @@ impl Skeleton for BipedLargeSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let upper_torso = Mat4::<f32>::from(self.upper_torso)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let torso_mat = base_mat * Mat4::<f32>::from(self.torso);
let upper_torso_mat = torso_mat * upper_torso;
let upper_torso_mat = torso_mat * Mat4::<f32>::from(self.upper_torso);
let control_mat = Mat4::<f32>::from(self.control);
let control_l_mat = Mat4::<f32>::from(self.control_l);
let control_r_mat = Mat4::<f32>::from(self.control_r);

View File

@ -138,7 +138,6 @@ impl Animation for RunAnimation {
next.hand_l.scale = Vec3::one() * 1.04;
next.hand_r.scale = Vec3::one() * 1.04;
next.hold.scale = Vec3::one() * 0.0;
next.torso.scale = Vec3::one();
next.second.scale = Vec3::one() * 0.0;
if s_a.beast {
@ -256,10 +255,9 @@ impl Animation for RunAnimation {
next.torso.position = Vec3::new(
0.0,
0.0 + (short * 0.75).max(-2.0),
speedavg * 0.15 + (short * 0.75).max(-2.0),
) / 8.0
* s_a.scaler;
0.0 + (short * 6.0).max(-16.0),
speedavg * 1.2 + (short * 6.0).max(-16.0),
);
next.torso.orientation =
Quaternion::rotation_x(x_tilt + amplitude * short * 0.1 + speedavg * -0.045);
} else {
@ -410,7 +408,7 @@ impl Animation for RunAnimation {
tilt * 1.0 + side * 0.3 + side * (foothorir * 0.3),
) * Quaternion::rotation_z(side * 0.2);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.torso.orientation = Quaternion::rotation_x(-0.25 * speednorm);
}

View File

@ -113,7 +113,7 @@ impl Animation for SpinMeleeAnimation {
next.upper_torso.orientation = Quaternion::rotation_x(move1 * -0.5);
next.lower_torso.orientation = Quaternion::rotation_x(move1 * 0.8);
next.torso.position = Vec3::new(0.0, 0.0, move1 * 0.8);
next.torso.position = Vec3::new(0.0, 0.0, move1 * 6.4);
},
_ => {},

View File

@ -133,7 +133,7 @@ impl Animation for SummonAnimation {
let pullback = 1.0 - move3;
let move1 = move1base * pullback;
let move2 = move2base * pullback;
next.torso.position = Vec3::new(0.0, 0.0 + move1 * 1.0, move1 * -4.0);
next.torso.position = Vec3::new(0.0, 0.0 + move1 * 4.7, move1 * -18.8);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);

View File

@ -74,7 +74,7 @@ impl Animation for AlphaAnimation {
next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3)
* Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6)
* Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3)
* Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6);

View File

@ -27,14 +27,9 @@ impl Animation for IdleAnimation {
let mut next = (*skeleton).clone();
let slow = (anim_time * 4.0).sin();
next.foot_l.scale = Vec3::one() * s_a.scaler / 11.0;
next.foot_r.scale = Vec3::one() * s_a.scaler / 11.0;
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + slow * -0.1);
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.3) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.3);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.main.position = Vec3::new(2.0, -3.0, -3.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
@ -42,8 +37,8 @@ impl Animation for IdleAnimation {
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2 + slow * -0.1);
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2 + slow * -0.1);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) * s_a.scaler / 11.0;
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) * s_a.scaler / 11.0;
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next
}

View File

@ -49,8 +49,9 @@ impl Skeleton for BipedSmallSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let chest_mat = base_mat * Mat4::<f32>::from(self.chest);
//TODO: * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let pants_mat = chest_mat * Mat4::<f32>::from(self.pants);
let control_mat = chest_mat * Mat4::<f32>::from(self.control);
let control_l_mat = Mat4::<f32>::from(self.control_l);

View File

@ -78,9 +78,6 @@ impl Animation for RunAnimation {
(global_time + anim_time / 18.0).floor().mul(7331.0).sin() * 0.2,
(global_time + anim_time / 18.0).floor().mul(1137.0).sin() * 0.1,
);
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
next.foot_l.scale = Vec3::one() * s_a.scaler / 11.0;
next.foot_r.scale = Vec3::one() * s_a.scaler / 11.0;
next.head.position = Vec3::new(0.0, -1.0 + s_a.head.0, s_a.head.1 + short * 0.1);
next.head.orientation =
Quaternion::rotation_z(tilt * -2.5 + head_look.x * 0.2 - short * 0.02)
@ -90,8 +87,7 @@ impl Animation for RunAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + 1.0 * speednorm + shortalt * -0.8,
) * s_a.scaler
/ 11.0;
);
next.chest.orientation = Quaternion::rotation_z(short * 0.06 + tilt * -0.6)
* Quaternion::rotation_y(tilt * 1.6)
* Quaternion::rotation_x(shortalter * 0.035 + speednorm * -0.4 + (tilt.abs()));
@ -121,7 +117,6 @@ impl Animation for RunAnimation {
Quaternion::rotation_x(0.4 * speednorm + (footrotl * -1.2) * speednorm)
* Quaternion::rotation_y(footrotl * -0.4 * speednorm);
//
next.foot_l.position = Vec3::new(
-s_a.foot.0 + footstrafel * sideabs * 3.0 + tilt * -2.0,
s_a.foot.1
@ -130,8 +125,7 @@ impl Animation for RunAnimation {
s_a.foot.2
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertl * -1.1 * speednorm).max(-1.0)))
+ side * ((footvertsl * 1.5).max(-1.0)),
) * s_a.scaler
/ 11.0;
);
next.foot_l.orientation = Quaternion::rotation_x(
(1.0 - sideabs) * (-0.2 * speednorm + foothoril * -0.9 * speednorm) + sideabs * -0.5,
) * Quaternion::rotation_y(
@ -146,8 +140,7 @@ impl Animation for RunAnimation {
s_a.foot.2
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertr * -1.1 * speednorm).max(-1.0)))
+ side * ((footvertsr * -1.5).max(-1.0)),
) * s_a.scaler
/ 11.0;
);
next.foot_r.orientation = Quaternion::rotation_x(
(1.0 - sideabs) * (-0.2 * speednorm + foothorir * -0.9 * speednorm) + sideabs * -0.5,
) * Quaternion::rotation_y(

View File

@ -61,8 +61,7 @@ impl Animation for ShootAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + fastalt * 0.4 * speednormcancel + speednormcancel * -0.5,
) * s_a.scaler
/ 11.0;
);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);

View File

@ -66,8 +66,7 @@ impl Animation for StunnedAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation =
Quaternion::rotation_x(movement1 * 0.2) * Quaternion::rotation_z(movement1 * -0.3);
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs - 3.0) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs - 3.0);
next.chest.orientation = Quaternion::rotation_z(movement1 * 1.2);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
@ -162,13 +161,9 @@ impl Animation for StunnedAnimation {
_ => {},
}
} else {
next.foot_l.scale = Vec3::one() * s_a.scaler / 11.0;
next.foot_r.scale = Vec3::one() * s_a.scaler / 11.0;
next.chest.scale = Vec3::one() * s_a.scaler / 11.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.main.position = Vec3::new(2.0, -3.0, -3.0);
next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(PI / 2.0);
@ -176,11 +171,10 @@ impl Animation for StunnedAnimation {
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.hand_l.position = Vec3::new(-s_a.hand.0, s_a.hand.1, s_a.hand.2);
next.hand_r.position = Vec3::new(s_a.hand.0, s_a.hand.1, s_a.hand.2);
next.foot_l.position =
Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) * s_a.scaler / 11.0;
next.foot_r.position =
Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) * s_a.scaler / 11.0;
};
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
}
next
}
}

View File

@ -51,8 +51,7 @@ impl Animation for WieldAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + fastalt * 0.4 * speednormcancel + speednormcancel * -0.5,
) * s_a.scaler
/ 11.0;
);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);

View File

@ -53,13 +53,12 @@ impl Animation for AlphaAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06) * s_a.scaler / 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06);
next.chest.orientation = Quaternion::rotation_x(move1 * 0.5 - move2 * 0.8);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);

View File

@ -53,8 +53,8 @@ impl Animation for BreatheAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -62,8 +62,7 @@ impl Animation for BreatheAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + wave_slow_cos * 0.06 + twitch2 * 0.1,
) * s_a.scaler
/ 8.0;
);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
next.neck.orientation = Quaternion::rotation_x(movement1abs * 0.5 - movement2abs * 0.5);

View File

@ -89,8 +89,8 @@ impl Animation for DashAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -113,8 +113,7 @@ impl Animation for DashAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + short * 0.5 + 0.5 * speednorm,
) * s_a.scaler
/ 8.0;
);
next.chest.orientation =
Quaternion::rotation_x(short * 0.07 + movement1abs * 0.8 + movement2abs * -1.2)
* Quaternion::rotation_y(tilt * 0.8)

View File

@ -41,14 +41,12 @@ impl Animation for FeedAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 - 1.8)
* s_a.scaler
/ 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 - 1.8);
next.chest.orientation = Quaternion::rotation_x(s_a.feed);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
@ -84,9 +82,9 @@ impl Animation for FeedAnimation {
next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2);
next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_l.orientation = Quaternion::rotation_x(0.0);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_r.orientation = Quaternion::rotation_x(0.0);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);

View File

@ -60,8 +60,8 @@ impl Animation for FlyAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -78,8 +78,7 @@ impl Animation for FlyAnimation {
next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1);
if velocity.z > 2.0 || velocity.xy().magnitude() < 12.0 {
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - flap4 * 1.5) * s_a.scaler / 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - flap4 * 1.5);
next.chest.orientation = Quaternion::rotation_x(
(0.8 - 0.8 * velocity.xy().magnitude() / 5.0).max(-0.2) - flap1 * 0.2,
) * Quaternion::rotation_y(tilt * 1.8 + fast * 0.01);
@ -109,11 +108,11 @@ impl Animation for FlyAnimation {
next.tail_rear.orientation =
Quaternion::rotation_x(-flap3 * 0.3 + 0.15) * Quaternion::rotation_z(-tilt * 0.8);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5);
next.leg_l.orientation = Quaternion::rotation_x(
(-1.0 * velocity.xy().magnitude() / 5.0).max(-1.2) + flap1 * -0.1,
) * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 - flap4 * 1.5);
next.leg_r.orientation = Quaternion::rotation_x(
(-1.0 * velocity.xy().magnitude() / 5.0).max(-1.2) + flap1 * -0.1,
) * Quaternion::rotation_y(tilt * 1.6 + fast * 0.01);
@ -123,8 +122,7 @@ impl Animation for FlyAnimation {
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(flap1 * -0.1);
} else {
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.05) * s_a.scaler / 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.05);
next.chest.orientation =
Quaternion::rotation_x(-0.2 + slow * 0.05 + (0.8 * velocity.z / 80.0).min(0.8))
* Quaternion::rotation_y(tilt * 1.8 + fast * 0.01);
@ -158,10 +156,10 @@ impl Animation for FlyAnimation {
next.tail_rear.orientation =
Quaternion::rotation_x(slow * 0.08) * Quaternion::rotation_z(-tilt * 0.8);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05);
next.leg_l.orientation = Quaternion::rotation_x(-1.2 + slow * -0.05)
* Quaternion::rotation_y(tilt * 1.6 + fast * 0.01);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + slow * 0.05);
next.leg_r.orientation = Quaternion::rotation_x(-1.2 + slow * -0.05)
* Quaternion::rotation_y(tilt * 1.6 + fast * 0.01);

View File

@ -39,14 +39,12 @@ impl Animation for IdleAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 + 1.5)
* s_a.scaler
/ 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 + 1.5);
next.chest.orientation = Quaternion::rotation_x(0.0);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
@ -82,9 +80,9 @@ impl Animation for IdleAnimation {
next.wing_out_l.orientation = Quaternion::rotation_y(-0.4) * Quaternion::rotation_z(0.2);
next.wing_out_r.orientation = Quaternion::rotation_y(0.4) * Quaternion::rotation_z(-0.2);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_l.orientation = Quaternion::rotation_x(0.0);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_r.orientation = Quaternion::rotation_x(0.0);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);

View File

@ -59,11 +59,9 @@ impl Skeleton for BirdLargeSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let chest_mat = base_mat
* Mat4::<f32>::from(self.chest)
// TODO: refactor animations so that we can apply this after the chest transform
// (note: this todo applies to all the other skeletons as well)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let chest_mat = base_mat * Mat4::<f32>::from(self.chest);
let neck_mat = chest_mat * Mat4::<f32>::from(self.neck);
let head_mat = neck_mat * Mat4::<f32>::from(self.head);
let beak_mat = head_mat * Mat4::<f32>::from(self.beak);

View File

@ -67,8 +67,8 @@ impl Animation for RunAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -89,8 +89,7 @@ impl Animation for RunAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + short * 0.5 + 0.5 * speednorm,
) * s_a.scaler
/ 8.0;
);
next.chest.orientation = Quaternion::rotation_x(short * 0.07)
* Quaternion::rotation_y(tilt * 0.8)
* Quaternion::rotation_z(shortalt * 0.10);
@ -123,7 +122,7 @@ impl Animation for RunAnimation {
-s_a.leg.0 + speednorm * 1.5,
s_a.leg.1 + foot1b * -2.3,
s_a.leg.2,
) / 8.0;
);
next.leg_l.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot1a * 0.15)
* Quaternion::rotation_y(tilt * 0.5);
@ -131,7 +130,7 @@ impl Animation for RunAnimation {
s_a.leg.0 + speednorm * -1.5,
s_a.leg.1 + foot2b * -2.3,
s_a.leg.2,
) / 8.0;
);
next.leg_r.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot2a * 0.15)
* Quaternion::rotation_y(tilt * 0.5);

View File

@ -40,13 +40,12 @@ impl Animation for ShockwaveAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs * 1.5) * s_a.scaler / 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs * 1.5);
next.chest.orientation = Quaternion::rotation_x(movement1abs * 1.0 + movement2abs * -1.0);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
@ -88,9 +87,9 @@ impl Animation for ShockwaveAnimation {
next.wing_out_r.orientation =
Quaternion::rotation_y(0.4) * Quaternion::rotation_z(-0.2);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_l.orientation = Quaternion::rotation_x(0.0);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_r.orientation = Quaternion::rotation_x(0.0);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);

View File

@ -45,8 +45,8 @@ impl Animation for ShootAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -54,8 +54,7 @@ impl Animation for ShootAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + wave_slow_cos * 0.06 + twitch2 * 0.1,
) * s_a.scaler
/ 8.0;
);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation =

View File

@ -39,13 +39,12 @@ impl Animation for StunnedAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06) * s_a.scaler / 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06);
next.chest.orientation = Quaternion::rotation_x(movement1base * 0.5);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
@ -78,9 +77,9 @@ impl Animation for StunnedAnimation {
next.wing_out_l.orientation = Quaternion::rotation_y(-0.2) * Quaternion::rotation_z(0.2);
next.wing_out_r.orientation = Quaternion::rotation_y(0.2) * Quaternion::rotation_z(-0.2);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_l.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);

View File

@ -46,8 +46,8 @@ impl Animation for SummonAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
@ -55,8 +55,7 @@ impl Animation for SummonAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + wave_slow_cos * 0.06 + twitch2 * 0.1,
) * s_a.scaler
/ 8.0;
);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation =

View File

@ -43,14 +43,12 @@ impl Animation for SwimAnimation {
next.head.scale = Vec3::one() * 0.98;
next.neck.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 8.0 * 0.98;
next.leg_r.scale = Vec3::one() / 8.0 * 0.98;
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.scale = Vec3::one() * 1.02;
next.foot_r.scale = Vec3::one() * 1.02;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 + 1.5)
* s_a.scaler
/ 8.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + wave_slow_cos * 0.06 + 1.5);
next.chest.orientation = Quaternion::rotation_x(0.0);
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
@ -86,9 +84,9 @@ impl Animation for SwimAnimation {
next.wing_out_l.orientation = Quaternion::rotation_y(-0.4) * Quaternion::rotation_z(0.2);
next.wing_out_r.orientation = Quaternion::rotation_y(0.4) * Quaternion::rotation_z(-0.2);
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_l.orientation = Quaternion::rotation_x(-0.8 + wave_fast * 0.5);
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2) / 8.0;
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2);
next.leg_r.orientation = Quaternion::rotation_x(-0.8 + wave_fast_cos * 0.5);
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);

View File

@ -50,7 +50,7 @@ impl Animation for FeedAnimation {
0.0,
s_a.chest.0 + s_a.feed,
-1.0 - 5.0 * (s_a.feed - 1.0) + wave_slow * 0.3 + s_a.chest.1,
) / 11.0;
);
next.torso.orientation =
Quaternion::rotation_x(-0.5 * s_a.feed) * Quaternion::rotation_y(wave_slow * 0.03);
@ -63,9 +63,9 @@ impl Animation for FeedAnimation {
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
next.wing_r.orientation = Quaternion::rotation_y(-0.4 + wave_slow * 0.1);
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next
}
}

View File

@ -30,11 +30,8 @@ impl Animation for FlyAnimation {
let center = (anim_time * lab + PI / 2.0).sin();
let centeroffset = (anim_time * lab + PI * 1.5).sin();
next.torso.scale = Vec3::one() / 11.0;
next.wing_l.scale = Vec3::one() * 1.05;
next.wing_r.scale = Vec3::one() * 1.05;
next.leg_l.scale = Vec3::one() / 11.0;
next.leg_r.scale = Vec3::one() / 11.0;
next.head.position = Vec3::new(0.0, s_a.head.0 + 0.5, s_a.head.1 + center * 0.5 - 1.0);
next.head.orientation =
@ -44,7 +41,7 @@ impl Animation for FlyAnimation {
0.0,
s_a.chest.0 + centeroffset * 0.6,
center * 0.6 + s_a.chest.1,
) / 11.0;
);
next.torso.orientation = Quaternion::rotation_y(center * 0.05);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1 + centeroffset * 0.6);
@ -56,10 +53,10 @@ impl Animation for FlyAnimation {
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
next.wing_r.orientation = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0));
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.leg_l.orientation = Quaternion::rotation_x(-1.3 + footl * 0.06);
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.leg_r.orientation = Quaternion::rotation_x(-1.3 + footr * 0.06);
next
}

View File

@ -40,17 +40,14 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.torso.scale = Vec3::one() / 11.0;
next.wing_l.scale = Vec3::one() * 1.02;
next.wing_r.scale = Vec3::one() * 1.02;
next.leg_l.scale = Vec3::one() / 11.0;
next.leg_r.scale = Vec3::one() / 11.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z(duck_head_look.x)
* Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03);
next.torso.position = Vec3::new(0.0, s_a.chest.0, wave_slow * 0.3 + s_a.chest.1) / 11.0;
next.torso.position = Vec3::new(0.0, s_a.chest.0, wave_slow * 0.3 + s_a.chest.1);
next.torso.orientation = Quaternion::rotation_y(wave_slow * 0.03);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
@ -60,9 +57,9 @@ impl Animation for IdleAnimation {
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2) / 11.0;
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
next
}
}

View File

@ -36,10 +36,10 @@ impl Skeleton for BirdMediumSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let base_mat = base_mat * Mat4::scaling_3d(1.0 / 11.0);
let torso_mat = base_mat * Mat4::<f32>::from(self.torso);
//TODO: * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
*(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [
make_bone(torso_mat * Mat4::<f32>::from(self.head)),

View File

@ -30,11 +30,8 @@ impl Animation for RunAnimation {
let center = (anim_time * lab + PI / 2.0).sin();
let centeroffset = (anim_time * lab + PI * 1.5).sin();
next.torso.scale = Vec3::one() / 11.0;
next.wing_l.scale = Vec3::one() * 1.05;
next.wing_r.scale = Vec3::one() * 1.05;
next.leg_l.scale = Vec3::one() / 11.0;
next.leg_r.scale = Vec3::one() / 11.0;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + center * 0.5);
next.head.orientation =
@ -44,9 +41,8 @@ impl Animation for RunAnimation {
0.0,
s_a.chest.0 + centeroffset * 0.6,
center * 0.6 + s_a.chest.1,
) / 11.0;
);
next.torso.orientation = Quaternion::rotation_y(center * 0.05);
next.torso.scale = Vec3::one() / 11.0;
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1 + centeroffset * 0.6);
next.tail.orientation = Quaternion::rotation_x(center * 0.03);
@ -57,10 +53,10 @@ impl Animation for RunAnimation {
next.wing_r.position = Vec3::new(s_a.wing.0, s_a.wing.1, s_a.wing.2);
next.wing_r.orientation = Quaternion::rotation_y((footr * 0.35).min(0.0));
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 + footl * 1.0, s_a.foot.2) / 11.0;
next.leg_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 + footl * 1.0, s_a.foot.2);
next.leg_l.orientation = Quaternion::rotation_x(footl * 0.5);
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + footr * 1.0, s_a.foot.2) / 11.0;
next.leg_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + footr * 1.0, s_a.foot.2);
next.leg_r.orientation = Quaternion::rotation_x(footr * 0.5);
next
}

View File

@ -44,7 +44,7 @@ impl Animation for AlphaAnimation {
next.main.orientation = Quaternion::rotation_x(0.0);
next.second.position = Vec3::new(0.0, 0.0, 0.0);
next.second.orientation = Quaternion::rotation_z(0.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 1.1);
next.torso.orientation = Quaternion::rotation_z(0.0);
match ability_info.and_then(|a| a.tool) {

View File

@ -106,7 +106,7 @@ impl Animation for ClimbAnimation {
next.lantern.orientation =
Quaternion::rotation_x(smooth * -0.3) * Quaternion::rotation_y(smooth * -0.3);
next.torso.position = Vec3::new(0.0, -0.2 + smooth * -0.08, 0.4) * s_a.scaler;
next.torso.position = Vec3::new(0.0, -2.2 + smooth * -0.88, 4.4);
} else {
next.head.position = Vec3::new(0.0, -1.0 - stagnant + s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_x(
@ -158,7 +158,7 @@ impl Animation for ClimbAnimation {
next.foot_r.orientation =
Quaternion::rotation_x(0.2 + smooth * 0.15 * (1.0 - stagnant));
next.torso.position = Vec3::new(0.0, -0.2, 0.4) * s_a.scaler;
next.torso.position = Vec3::new(0.0, -2.2, 4.4);
};
next

View File

@ -104,7 +104,7 @@ impl Animation for DanceAnimation {
next.lantern.orientation =
Quaternion::rotation_x(shorte * 0.7 + 0.4) * Quaternion::rotation_y(shorte * 0.4);
next.torso.position = Vec3::new(0.0, -0.3, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, -3.3, 0.0);
next.torso.orientation = Quaternion::rotation_z(short * -0.2);
next

View File

@ -135,7 +135,7 @@ impl Animation for IdleAnimation {
next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2);
next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.second.scale = match hands {
(Some(Hands::One), Some(Hands::One)) => Vec3::one(),

View File

@ -205,7 +205,7 @@ impl Animation for JumpAnimation {
* Quaternion::rotation_y(tilt * 4.0 * slow + tilt * 3.0);
}
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.torso.orientation = Quaternion::rotation_x(0.0);
match hands {

View File

@ -51,7 +51,7 @@ impl Animation for LeapAnimation {
next.second.orientation = Quaternion::rotation_z(0.0);
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_z(0.0);
next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 1.1);
next.torso.orientation = Quaternion::rotation_z(0.0);
match ability_info.and_then(|a| a.tool) {

View File

@ -100,9 +100,12 @@ impl Skeleton for CharacterSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let torso_mat = base_mat
* Mat4::<f32>::from(self.torso)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
// TODO: extract scaler from body to it's own method so we can call that
// directly instead of going through SkeletonAttr? (note todo also
// appiles to other body variant animations)
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let torso_mat = base_mat * Mat4::<f32>::from(self.torso);
let chest_mat = torso_mat * Mat4::<f32>::from(self.chest);
let head_mat = chest_mat * Mat4::<f32>::from(self.head);
let shorts_mat = chest_mat * Mat4::<f32>::from(self.shorts);

View File

@ -132,7 +132,7 @@ impl Animation for MountAnimation {
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(0.0);
next.torso.position = Vec3::new(0.0, 0.0, stop * -0.16) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, stop * -1.76);
if skeleton.holding_lantern {
next.hand_r.position = Vec3::new(

View File

@ -109,7 +109,7 @@ impl Animation for RollAnimation {
);
next.foot_r.orientation = Quaternion::rotation_x(0.9 * movement1);
next.torso.position = Vec3::new(0.0, 0.0, 8.0 * movement1) / 11.0 * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 8.0 * movement1);
next.torso.orientation = Quaternion::rotation_x(movement1 * -0.4 + movement2 * -2.0 * PI)
* Quaternion::rotation_z(tilt * -10.0);

View File

@ -275,7 +275,7 @@ impl Animation for RunAnimation {
* Quaternion::rotation_y(tilt * 4.0 * fast + tilt * 3.0 + fast2 * speednorm * 0.25);
}
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
match hands {
(Some(Hands::One), _) => match active_tool_kind {

View File

@ -85,7 +85,7 @@ impl Animation for SitAnimation {
next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
next.shoulder_r.orientation = Quaternion::rotation_x(0.0);
next.torso.position = Vec3::new(0.0, -0.2, stop * -0.16) * s_a.scaler;
next.torso.position = Vec3::new(0.0, -2.2, stop * -1.76);
if skeleton.holding_lantern {
next.hand_r.position = Vec3::new(

View File

@ -96,8 +96,9 @@ impl Animation for SpinAnimation {
next.torso.position = Vec3::new(
0.0,
0.0,
-1.0 + 1.0 * (movement1 * 0.5 * PI).sin()
+ 1.0 * (movement2 * 0.5 * PI + 0.5 * PI).sin(),
-11.0
+ 11.0 * (movement1 * 0.5 * PI).sin()
+ 11.0 * (movement2 * 0.5 * PI + 0.5 * PI).sin(),
);
next.torso.orientation =
Quaternion::rotation_z(movement1.powi(2) * -6.0 + movement2 * -1.7);

View File

@ -253,7 +253,7 @@ impl Animation for StaggeredAnimation {
);
next.foot_l.orientation = Quaternion::rotation_z(movement1 * 0.6);
};
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.torso.orientation = Quaternion::rotation_z(0.0);
if let (None, Some(Hands::Two)) = hands {

View File

@ -177,7 +177,7 @@ impl Animation for StandAnimation {
* Quaternion::rotation_y(fast2 * 0.1 + tilt * 3.0);
}
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.second.scale = Vec3::one();
next.second.scale = match hands {
(Some(Hands::One) | None, Some(Hands::One)) => Vec3::one(),

View File

@ -213,7 +213,7 @@ impl Animation for StunnedAnimation {
next.hand_l.orientation = Quaternion::rotation_x(movement1abs * 1.2)
* Quaternion::rotation_y(movement1 * 1.2);
};
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.torso.orientation = Quaternion::rotation_z(0.0);
if let (None, Some(Hands::Two)) = hands {

View File

@ -232,7 +232,7 @@ impl Animation for SwimAnimation {
} else {
avgtotal
};
next.torso.position = Vec3::new(0.0, 0.0, 1.0 - avgspeed * 0.05) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 11.0 - avgspeed * 0.55);
next.torso.orientation = Quaternion::rotation_x(
(((1.0 / switch) * PI / 2.0 + avg_vel.z * 0.12).min(PI / 2.0) - PI / 2.0)
+ avgspeed * avg_vel.z * -0.003,

View File

@ -75,7 +75,7 @@ impl Animation for SwimWieldAnimation {
next.hold.scale = Vec3::one() * 0.0;
if velocity > 0.01 {
next.torso.position = Vec3::new(0.0, 0.0, 1.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 11.0);
next.torso.orientation = Quaternion::rotation_x(velocity * -0.05);
next.back.position = Vec3::new(0.0, s_a.back.0, s_a.back.1);
@ -91,7 +91,7 @@ impl Animation for SwimWieldAnimation {
next.chest.position =
Vec3::new(0.0 + slowalt * 0.5, s_a.chest.0, s_a.chest.1 + u_slow * 0.5);
next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler;
next.torso.position = Vec3::new(0.0, 0.0, 0.0);
next.foot_l.position = Vec3::new(-s_a.foot.0, -2.0 + s_a.foot.1, s_a.foot.2);

View File

@ -43,10 +43,10 @@ impl Skeleton for DragonSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let base_mat = base_mat * Mat4::scaling_3d(1.0);
let chest_front_mat = base_mat * Mat4::<f32>::from(self.chest_front);
//* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 1.0);
let chest_rear_mat = chest_front_mat * Mat4::<f32>::from(self.chest_rear);
let head_lower_mat = chest_front_mat * Mat4::<f32>::from(self.head_lower);
let wing_in_l_mat = chest_front_mat * Mat4::<f32>::from(self.wing_in_l);

View File

@ -36,7 +36,7 @@ impl Animation for IdleAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1) / 11.0;
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1);
next.chest_front.orientation = Quaternion::rotation_x(0.0);
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);

View File

@ -33,10 +33,11 @@ impl Skeleton for FishMediumSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let chest_front_mat =
base_mat * Mat4::<f32>::from(self.chest_front) * Mat4::scaling_3d(1.0 / 11.0);
let base_mat = base_mat * Mat4::scaling_3d(1.0 / 11.0);
let chest_front_mat = base_mat * Mat4::<f32>::from(self.chest_front);
let chest_back_mat = Mat4::<f32>::from(self.chest_back);
let head_mat = Mat4::<f32>::from(self.head);

View File

@ -52,7 +52,7 @@ impl Animation for SwimAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1) / 11.0;
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1);
next.chest_front.orientation = Quaternion::rotation_x(velocity.z.abs() * -0.005 + x_tilt)
* Quaternion::rotation_z(fast * vel * -0.02);

View File

@ -28,7 +28,7 @@ impl Animation for IdleAnimation {
let slow = (anim_time * 3.5 + PI).sin();
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) / 13.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation = Quaternion::rotation_z(slow * 0.1);

View File

@ -30,9 +30,10 @@ impl Skeleton for FishSmallSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let chest_mat = base_mat * Mat4::<f32>::from(self.chest) * Mat4::scaling_3d(1.0 / 13.0);
let base_mat = base_mat * Mat4::scaling_3d(1.0 / 13.0);
let chest_mat = base_mat * Mat4::<f32>::from(self.chest);
*(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [
make_bone(chest_mat),

View File

@ -45,7 +45,7 @@ impl Animation for SwimAnimation {
let vel = (velocity.magnitude()).min(s_a.amplitude);
let slowvel = vel * 0.1;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) / 13.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_x(velocity.z.abs() * -0.005 + x_tilt)
* Quaternion::rotation_z(fast * -0.1);

View File

@ -79,7 +79,7 @@ impl Animation for AlphaAnimation {
next.hand_r.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_x(move1 * -1.0 + move2 * 1.8);
};
next.torso.position = Vec3::new(0.0, move1 * 0.7, move1 * -0.3);
next.torso.position = Vec3::new(0.0, move1 * 3.7, move1 * -1.6);
next
}
}

View File

@ -55,7 +55,7 @@ impl Animation for IdleAnimation {
next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 0.1);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5) * s_a.scaler / 8.0;
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + breathe * 0.5);
next.lower_torso.position =
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + breathe * -0.2);

View File

@ -49,9 +49,9 @@ impl Skeleton for GolemSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let torso_mat = base_mat
* Mat4::<f32>::from(self.torso)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 8.0);
let torso_mat = base_mat * Mat4::<f32>::from(self.torso);
let upper_torso_mat = torso_mat * Mat4::<f32>::from(self.upper_torso);
let lower_torso_mat = upper_torso_mat * Mat4::<f32>::from(self.lower_torso);
let leg_l_mat = lower_torso_mat * Mat4::<f32>::from(self.leg_l);

View File

@ -79,7 +79,7 @@ impl Animation for RunAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1) * 1.02;
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + short * 1.0) * s_a.scaler / 8.0;
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + short * 1.0);
next.upper_torso.orientation = Quaternion::rotation_z(tilt * -4.0 + short * 0.40);
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);

View File

@ -40,7 +40,7 @@ impl Animation for ShockwaveAnimation {
next.head.orientation = Quaternion::rotation_z(move1 * -PI);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + move2 * -5.0) * s_a.scaler / 8.0;
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + move2 * -5.0);
next.upper_torso.orientation = Quaternion::rotation_z(move1 * -PI);
next.lower_torso.position =

View File

@ -37,8 +37,7 @@ impl Animation for SpinMeleeAnimation {
next.head.orientation =
Quaternion::rotation_z(movement2 * -2.0 * PI) * Quaternion::rotation_x(-0.2);
next.upper_torso.position =
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1) * s_a.scaler / 8.0;
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
next.upper_torso.orientation = Quaternion::rotation_z(movement2 * 2.0 * PI);
next.lower_torso.position =

View File

@ -33,10 +33,10 @@ impl Animation for BeamAnimation {
let mut next = (*skeleton).clone();
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2) / 11.0;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
next.bone0.orientation = Quaternion::rotation_z(0.0);
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2) / 11.0;
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2);
next.bone1.orientation = Quaternion::rotation_z(0.0);
next

View File

@ -23,9 +23,9 @@ impl Animation for IdleAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2) / 11.0;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2) / 11.0;
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2);
next
}

View File

@ -29,13 +29,15 @@ impl Skeleton for ObjectSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let bone0_mat = base_mat * Mat4::<f32>::from(self.bone0);
let scale_mat = Mat4::scaling_3d(1.0 / 11.0);
let bone0_mat = base_mat * scale_mat * Mat4::<f32>::from(self.bone0);
*(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [
make_bone(bone0_mat * Mat4::scaling_3d(1.0 / 11.0)),
make_bone(Mat4::<f32>::from(self.bone1) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */
make_bone(bone0_mat),
make_bone(scale_mat * Mat4::<f32>::from(self.bone1)), /* Decorellated from ori */
];
Offsets {
lantern: Vec3::default(),

View File

@ -40,17 +40,17 @@ impl Animation for ShootAnimation {
_ => (0.0, 0.0, 0.0),
};
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2) / 11.0;
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2) / 11.0;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2);
#[allow(clippy::single_match)]
match body {
Body::Crossbow => {
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2) / 11.0;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
next.bone0.orientation =
Quaternion::rotation_x(movement1 * 0.05 + movement2 * 0.1) * (1.0 - movement3);
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2) / 11.0;
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2);
next.bone1.orientation = Quaternion::rotation_z(0.0);
},
_ => {},

View File

@ -56,7 +56,7 @@ impl Animation for IdleAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05 - 0.05);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_y(slow * 0.03);
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);

View File

@ -32,7 +32,7 @@ impl Animation for JumpAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);

View File

@ -50,9 +50,9 @@ impl Skeleton for QuadrupedLowSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let chest_mat = base_mat
* Mat4::<f32>::from(self.chest)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let chest_mat = base_mat * Mat4::<f32>::from(self.chest);
let tail_front = chest_mat * Mat4::<f32>::from(self.tail_front);
let head_lower_mat = chest_mat * Mat4::<f32>::from(self.head_lower);
let head_upper_mat = head_lower_mat * Mat4::<f32>::from(self.head_upper);

View File

@ -106,7 +106,7 @@ impl Animation for RunAnimation {
* Quaternion::rotation_y(shortalt * 0.08)
* Quaternion::rotation_x(-0.04 + x_tilt * 0.5);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_z(short * 0.13 + tilt * -1.9)
* Quaternion::rotation_y(short * 0.12 + tilt * 0.7)
* Quaternion::rotation_x(x_tilt + s_a.lean.0);

View File

@ -44,7 +44,7 @@ impl Animation for ShootAnimation {
next.jaw.position = Vec3::new(0.0, s_a.jaw.0, s_a.jaw.1);
next.jaw.orientation = Quaternion::rotation_x(movement1 * -0.5);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_x(0.0);
next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1);

View File

@ -59,8 +59,7 @@ impl Animation for AlphaAnimation {
0.0,
s_a.torso_front.0 + movement1abs * -4.0,
s_a.torso_front.1,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25)
* Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45);

View File

@ -59,8 +59,7 @@ impl Animation for BetaAnimation {
0.0,
s_a.torso_front.0 + movement1abs * -4.0,
s_a.torso_front.1,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation = Quaternion::rotation_y(movement1 * -0.25 * movement2 * 0.25)
* Quaternion::rotation_z(movement1 * 0.35 + movement2 * -0.45);

View File

@ -79,8 +79,7 @@ impl Animation for FeedAnimation {
0.0,
s_a.torso_front.0,
s_a.torso_front.1 + slower * 0.3 + transition * -6.0,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation =
Quaternion::rotation_x(transition * -0.7) * Quaternion::rotation_y(slow * 0.02);

View File

@ -57,8 +57,7 @@ impl Animation for HoofAnimation {
0.0,
s_a.torso_front.0 + movement1abs * -6.0,
s_a.torso_front.1 + movement1abs * 9.0,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation = Quaternion::rotation_x(movement1abs * 1.2);
next.torso_back.orientation = Quaternion::rotation_x(movement1abs * -0.8);

View File

@ -53,7 +53,6 @@ impl Animation for IdleAnimation {
next.neck.scale = Vec3::one() * 1.02;
next.jaw.scale = Vec3::one() * 1.02;
next.torso_front.scale = Vec3::one() * s_a.scaler / 11.0;
next.leg_fl.scale = Vec3::one() * 1.02;
next.leg_fr.scale = Vec3::one() * 1.02;
next.leg_bl.scale = Vec3::one() * 1.02;
@ -79,7 +78,7 @@ impl Animation for IdleAnimation {
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0);
next.torso_front.position =
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1 + slower * 0.3) * s_a.scaler / 11.0;
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1 + slower * 0.3);
next.torso_front.orientation = Quaternion::rotation_y(slow * 0.02);
next.torso_back.position =

View File

@ -43,8 +43,7 @@ impl Animation for JumpAnimation {
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.torso_front.position =
Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1) * s_a.scaler / 11.0;
next.torso_front.position = Vec3::new(0.0, s_a.torso_front.0, s_a.torso_front.1);
next.torso_front.orientation = Quaternion::rotation_y(0.0);
next.torso_back.position = Vec3::new(0.0, s_a.torso_back.0, s_a.torso_back.1);

View File

@ -56,8 +56,7 @@ impl Animation for LeapMeleeAnimation {
0.0,
s_a.torso_front.0 + movement1abs * -4.0,
s_a.torso_front.1,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation =
Quaternion::rotation_x(movement1abs * 0.3 + movement2abs * -0.3 + movement3abs * 0.3)
* Quaternion::rotation_y(twitch1abs * -0.1);

View File

@ -56,9 +56,9 @@ impl Skeleton for QuadrupedMediumSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let torso_front_mat = base_mat
* Mat4::<f32>::from(self.torso_front)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let torso_front_mat = base_mat * Mat4::<f32>::from(self.torso_front);
let torso_back_mat = torso_front_mat * Mat4::<f32>::from(self.torso_back);
let neck_mat = torso_front_mat * Mat4::<f32>::from(self.neck);
let leg_fl_mat = torso_front_mat * Mat4::<f32>::from(self.leg_fl);

View File

@ -128,8 +128,7 @@ impl Animation for RunAnimation {
+ canceler * 1.0
+ canceler * shortalt * 2.5 * s_a.spring
+ x_tilt * 10.0 * canceler,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation = Quaternion::rotation_x(
((amplitude * (short * -0.13).max(-0.2)) * s_a.spring).min(0.1)
+ x_tilt * (canceler * 6.0).min(1.0),

View File

@ -52,8 +52,7 @@ impl Animation for StunnedAnimation {
0.0,
s_a.torso_front.0 + movement1abs * -4.0,
s_a.torso_front.1,
) * s_a.scaler
/ 11.0;
);
next.torso_front.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_z(movement1 * 0.15);

View File

@ -45,7 +45,7 @@ impl Animation for FeedAnimation {
next.head.orientation = Quaternion::rotation_z(head_look.y)
* Quaternion::rotation_x(slow * 0.05 + quick * 0.08 - 0.4 * s_a.feed);
next.chest.position = Vec3::new(slow * 0.02, s_a.chest.0, s_a.chest.1) / 11.0 * s_a.scaler;
next.chest.position = Vec3::new(slow * 0.02, s_a.chest.0, s_a.chest.1);
next.chest.orientation =
Quaternion::rotation_x(-0.35 * s_a.feed) * Quaternion::rotation_y(head_look.y * 0.1);

View File

@ -44,7 +44,7 @@ impl Animation for IdleAnimation {
next.head.orientation = Quaternion::rotation_z(head_look.x)
* Quaternion::rotation_x(head_look.y + slow_alt * 0.03);
next.chest.position = Vec3::new(slow * 0.05, s_a.chest.0, s_a.chest.1) / 11.0 * s_a.scaler;
next.chest.position = Vec3::new(slow * 0.05, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_y(slow * 0.05);
next.leg_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2 + slow * -0.2);

View File

@ -24,7 +24,7 @@ impl Animation for JumpAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 11.0;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_y(0.0);
next.leg_fl.position = Vec3::new(-s_a.feet_f.0, s_a.feet_f.1, s_a.feet_f.2);

View File

@ -43,8 +43,8 @@ impl Skeleton for QuadrupedSmallSkeleton {
body: Self::Body,
) -> Offsets {
let chest_mat = base_mat
* Mat4::<f32>::from(self.chest)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0)
* Mat4::<f32>::from(self.chest);
*(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [
make_bone(chest_mat * Mat4::<f32>::from(self.head)),

View File

@ -70,8 +70,7 @@ impl Animation for RunAnimation {
0.0,
s_a.chest.0,
s_a.chest.1 + 2.0 * speednorm * s_a.spring + shortalt * 3.0 * s_a.spring,
) / 11.0
* s_a.scaler;
);
next.chest.orientation =
Quaternion::rotation_x(vertcancel * short * 0.2 * s_a.spring + x_tilt)
* Quaternion::rotation_y(tilt * 0.8)

View File

@ -39,8 +39,7 @@ impl Animation for StunnedAnimation {
let movement1abs = movement1base * pullback;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.chest.position =
Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs * -1.5) / 11.0 * s_a.scaler;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + movement1abs * -1.5);
next.head.orientation = Quaternion::rotation_x(movement1abs * -0.2)
* Quaternion::rotation_y(movement1 * -0.6)
* Quaternion::rotation_z(movement1 * 0.4 + twitch * 0.2 * mirror);

View File

@ -42,15 +42,15 @@ impl Animation for IdleAnimation {
} else {
0.0
} * 1.3;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2) / 11.0;
next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2) / 11.0;
next.bone1.position = Vec3::new(s_a.bone1.0, s_a.bone1.1, s_a.bone1.2);
next.bone1.orientation = Quaternion::rotation_y(acc_vel * 0.8);
next.bone2.position = Vec3::new(s_a.bone2.0, s_a.bone2.1, s_a.bone2.2) / 11.0;
next.bone2.position = Vec3::new(s_a.bone2.0, s_a.bone2.1, s_a.bone2.2);
next.bone2.orientation = Quaternion::rotation_y(-acc_vel * 0.8);
next.bone3.position = Vec3::new(s_a.bone3.0, s_a.bone3.1, s_a.bone3.2) / 11.0;
next.bone3.position = Vec3::new(s_a.bone3.0, s_a.bone3.1, s_a.bone3.2);
next.bone3.orientation = Quaternion::rotation_z(tilt * 25.0);
next
}

View File

@ -29,15 +29,15 @@ impl Skeleton for ShipSkeleton {
&self,
base_mat: Mat4<f32>,
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
_body: Self::Body,
) -> Offsets {
let bone0_mat = base_mat * Mat4::<f32>::from(self.bone0);
let bone0_mat = base_mat * Mat4::scaling_3d(1.0 / 11.0) * Mat4::<f32>::from(self.bone0);
*(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [
make_bone(bone0_mat * Mat4::scaling_3d(1.0 / 11.0)),
make_bone(bone0_mat * Mat4::<f32>::from(self.bone1) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */
make_bone(bone0_mat * Mat4::<f32>::from(self.bone2) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */
make_bone(bone0_mat * Mat4::<f32>::from(self.bone3) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */
make_bone(bone0_mat),
make_bone(bone0_mat * Mat4::<f32>::from(self.bone1)),
make_bone(bone0_mat * Mat4::<f32>::from(self.bone2)),
make_bone(bone0_mat * Mat4::<f32>::from(self.bone3)),
];
Offsets {
lantern: Vec3::default(),

View File

@ -59,7 +59,7 @@ impl Animation for IdleAnimation {
next.neck.orientation = Quaternion::rotation_x(-0.1);
next.chest_front.position =
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1 + breathe * 0.3) / s_a.scaler;
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1 + breathe * 0.3);
next.chest_front.orientation = Quaternion::rotation_x(breathe * 0.04);
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);

View File

@ -35,8 +35,7 @@ impl Animation for JumpAnimation {
next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1);
next.neck.orientation = Quaternion::rotation_x(-0.1);
next.chest_front.position =
Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1) / s_a.scaler;
next.chest_front.position = Vec3::new(0.0, s_a.chest_front.0, s_a.chest_front.1);
next.chest_back.position = Vec3::new(0.0, s_a.chest_back.0, s_a.chest_back.1);

View File

@ -49,9 +49,9 @@ impl Skeleton for TheropodSkeleton {
buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
body: Self::Body,
) -> Offsets {
let chest_front_mat = base_mat
* Mat4::<f32>::from(self.chest_front)
* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 1.0);
let base_mat = base_mat * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0);
let chest_front_mat = base_mat * Mat4::<f32>::from(self.chest_front);
let neck_mat = chest_front_mat * Mat4::<f32>::from(self.neck);
let head_mat = neck_mat * Mat4::<f32>::from(self.head);
let chest_back_mat = chest_front_mat * Mat4::<f32>::from(self.chest_back);
@ -229,14 +229,14 @@ impl<'a> From<&'a Body> for SkeletonAttr {
(Ntouka, _) => (1.5, -1.0, -2.5),
},
scaler: match (body.species, body.body_type) {
(Archaeos, _) => (3.75),
(Odonto, _) => (3.75),
(Sandraptor, _) => (10.0),
(Snowraptor, _) => (10.0),
(Woodraptor, _) => (10.0),
(Sunlizard, _) => (10.0),
(Yale, _) => (8.75),
(Ntouka, _) => (3.75),
(Archaeos, _) => (2.93),
(Odonto, _) => (2.93),
(Sandraptor, _) => (1.1),
(Snowraptor, _) => (1.1),
(Woodraptor, _) => (1.1),
(Sunlizard, _) => (1.1),
(Yale, _) => (1.26),
(Ntouka, _) => (2.93),
},
}
}

View File

@ -86,7 +86,7 @@ impl Animation for RunAnimation {
0.0,
s_a.chest_front.0,
s_a.chest_front.1 + short * 0.5 + x_tilt * 10.0 + 0.5 * speednorm,
) / s_a.scaler;
);
next.chest_front.orientation = Quaternion::rotation_x(short * 0.07 + x_tilt)
* Quaternion::rotation_y(tilt * 0.8)
* Quaternion::rotation_z(shortalt * 0.15 + tilt * -1.5);