diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index ba870c6b2d..075cd1d758 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -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); diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 6af78b06e6..7ed6c398c4 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -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 = diff --git a/voxygen/anim/src/biped_large/chargemelee.rs b/voxygen/anim/src/biped_large/chargemelee.rs index 92311f793e..df141df553 100644 --- a/voxygen/anim/src/biped_large/chargemelee.rs +++ b/voxygen/anim/src/biped_large/chargemelee.rs @@ -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 = diff --git a/voxygen/anim/src/biped_large/idle.rs b/voxygen/anim/src/biped_large/idle.rs index e8d9049d01..18196eb150 100644 --- a/voxygen/anim/src/biped_large/idle.rs +++ b/voxygen/anim/src/biped_large/idle.rs @@ -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( diff --git a/voxygen/anim/src/biped_large/jump.rs b/voxygen/anim/src/biped_large/jump.rs index 682fbe0e0c..47c6b0788f 100644 --- a/voxygen/anim/src/biped_large/jump.rs +++ b/voxygen/anim/src/biped_large/jump.rs @@ -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 diff --git a/voxygen/anim/src/biped_large/mod.rs b/voxygen/anim/src/biped_large/mod.rs index 36613f0bde..05dbcc3032 100644 --- a/voxygen/anim/src/biped_large/mod.rs +++ b/voxygen/anim/src/biped_large/mod.rs @@ -81,11 +81,10 @@ impl Skeleton for BipedLargeSkeleton { buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], body: Self::Body, ) -> Offsets { - let upper_torso = Mat4::::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::::from(self.torso); - let upper_torso_mat = torso_mat * upper_torso; + let upper_torso_mat = torso_mat * Mat4::::from(self.upper_torso); let control_mat = Mat4::::from(self.control); let control_l_mat = Mat4::::from(self.control_l); let control_r_mat = Mat4::::from(self.control_r); diff --git a/voxygen/anim/src/biped_large/run.rs b/voxygen/anim/src/biped_large/run.rs index fce748be8a..e957775038 100644 --- a/voxygen/anim/src/biped_large/run.rs +++ b/voxygen/anim/src/biped_large/run.rs @@ -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); } diff --git a/voxygen/anim/src/biped_large/spinmelee.rs b/voxygen/anim/src/biped_large/spinmelee.rs index ea284922c8..eee429c8d6 100644 --- a/voxygen/anim/src/biped_large/spinmelee.rs +++ b/voxygen/anim/src/biped_large/spinmelee.rs @@ -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); }, _ => {}, diff --git a/voxygen/anim/src/biped_large/summon.rs b/voxygen/anim/src/biped_large/summon.rs index 1d128348bf..24960c3ec9 100644 --- a/voxygen/anim/src/biped_large/summon.rs +++ b/voxygen/anim/src/biped_large/summon.rs @@ -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); diff --git a/voxygen/anim/src/biped_small/alpha.rs b/voxygen/anim/src/biped_small/alpha.rs index 69dc4b0f10..0a14e920fb 100644 --- a/voxygen/anim/src/biped_small/alpha.rs +++ b/voxygen/anim/src/biped_small/alpha.rs @@ -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); diff --git a/voxygen/anim/src/biped_small/idle.rs b/voxygen/anim/src/biped_small/idle.rs index 929151f635..7881aed783 100644 --- a/voxygen/anim/src/biped_small/idle.rs +++ b/voxygen/anim/src/biped_small/idle.rs @@ -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 } diff --git a/voxygen/anim/src/biped_small/mod.rs b/voxygen/anim/src/biped_small/mod.rs index 467fc2f6ed..67aa543b92 100644 --- a/voxygen/anim/src/biped_small/mod.rs +++ b/voxygen/anim/src/biped_small/mod.rs @@ -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::::from(self.chest); - //TODO: * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0); let pants_mat = chest_mat * Mat4::::from(self.pants); let control_mat = chest_mat * Mat4::::from(self.control); let control_l_mat = Mat4::::from(self.control_l); diff --git a/voxygen/anim/src/biped_small/run.rs b/voxygen/anim/src/biped_small/run.rs index 9d85372dc7..08db2a3f30 100644 --- a/voxygen/anim/src/biped_small/run.rs +++ b/voxygen/anim/src/biped_small/run.rs @@ -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( diff --git a/voxygen/anim/src/biped_small/shoot.rs b/voxygen/anim/src/biped_small/shoot.rs index 4f5c52a20b..4368f70a78 100644 --- a/voxygen/anim/src/biped_small/shoot.rs +++ b/voxygen/anim/src/biped_small/shoot.rs @@ -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); diff --git a/voxygen/anim/src/biped_small/stunned.rs b/voxygen/anim/src/biped_small/stunned.rs index 401e63f8d8..82dff4248d 100644 --- a/voxygen/anim/src/biped_small/stunned.rs +++ b/voxygen/anim/src/biped_small/stunned.rs @@ -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 } } diff --git a/voxygen/anim/src/biped_small/wield.rs b/voxygen/anim/src/biped_small/wield.rs index 0b642440fd..8e17934746 100644 --- a/voxygen/anim/src/biped_small/wield.rs +++ b/voxygen/anim/src/biped_small/wield.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/alpha.rs b/voxygen/anim/src/bird_large/alpha.rs index 68bdb5be32..fef6419431 100644 --- a/voxygen/anim/src/bird_large/alpha.rs +++ b/voxygen/anim/src/bird_large/alpha.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/breathe.rs b/voxygen/anim/src/bird_large/breathe.rs index 128c95e4a1..798ad1cd47 100644 --- a/voxygen/anim/src/bird_large/breathe.rs +++ b/voxygen/anim/src/bird_large/breathe.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/dash.rs b/voxygen/anim/src/bird_large/dash.rs index cbe5015a20..c177986d15 100644 --- a/voxygen/anim/src/bird_large/dash.rs +++ b/voxygen/anim/src/bird_large/dash.rs @@ -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) diff --git a/voxygen/anim/src/bird_large/feed.rs b/voxygen/anim/src/bird_large/feed.rs index f9a55077eb..11b9aec664 100644 --- a/voxygen/anim/src/bird_large/feed.rs +++ b/voxygen/anim/src/bird_large/feed.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/fly.rs b/voxygen/anim/src/bird_large/fly.rs index 33efc0a2c1..acb32f23f0 100644 --- a/voxygen/anim/src/bird_large/fly.rs +++ b/voxygen/anim/src/bird_large/fly.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/idle.rs b/voxygen/anim/src/bird_large/idle.rs index 061b431eb2..c48f0fcf8f 100644 --- a/voxygen/anim/src/bird_large/idle.rs +++ b/voxygen/anim/src/bird_large/idle.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/mod.rs b/voxygen/anim/src/bird_large/mod.rs index b2c21876c8..483584169b 100644 --- a/voxygen/anim/src/bird_large/mod.rs +++ b/voxygen/anim/src/bird_large/mod.rs @@ -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::::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::::from(self.chest); let neck_mat = chest_mat * Mat4::::from(self.neck); let head_mat = neck_mat * Mat4::::from(self.head); let beak_mat = head_mat * Mat4::::from(self.beak); diff --git a/voxygen/anim/src/bird_large/run.rs b/voxygen/anim/src/bird_large/run.rs index a2b523f632..7ac8b4c905 100644 --- a/voxygen/anim/src/bird_large/run.rs +++ b/voxygen/anim/src/bird_large/run.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/shockwave.rs b/voxygen/anim/src/bird_large/shockwave.rs index c9ea5844e1..ea40d09785 100644 --- a/voxygen/anim/src/bird_large/shockwave.rs +++ b/voxygen/anim/src/bird_large/shockwave.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/shoot.rs b/voxygen/anim/src/bird_large/shoot.rs index 4ed3787396..2b346cc762 100644 --- a/voxygen/anim/src/bird_large/shoot.rs +++ b/voxygen/anim/src/bird_large/shoot.rs @@ -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 = diff --git a/voxygen/anim/src/bird_large/stunned.rs b/voxygen/anim/src/bird_large/stunned.rs index ba580c6b95..680da225ac 100644 --- a/voxygen/anim/src/bird_large/stunned.rs +++ b/voxygen/anim/src/bird_large/stunned.rs @@ -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); diff --git a/voxygen/anim/src/bird_large/summon.rs b/voxygen/anim/src/bird_large/summon.rs index 1f96750cf8..c650af8fc3 100644 --- a/voxygen/anim/src/bird_large/summon.rs +++ b/voxygen/anim/src/bird_large/summon.rs @@ -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 = diff --git a/voxygen/anim/src/bird_large/swim.rs b/voxygen/anim/src/bird_large/swim.rs index 17100e2be2..8535b06c47 100644 --- a/voxygen/anim/src/bird_large/swim.rs +++ b/voxygen/anim/src/bird_large/swim.rs @@ -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); diff --git a/voxygen/anim/src/bird_medium/feed.rs b/voxygen/anim/src/bird_medium/feed.rs index 1760ac7798..70e1bb43ac 100644 --- a/voxygen/anim/src/bird_medium/feed.rs +++ b/voxygen/anim/src/bird_medium/feed.rs @@ -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 } } diff --git a/voxygen/anim/src/bird_medium/fly.rs b/voxygen/anim/src/bird_medium/fly.rs index 5fefb3ffae..cd697db87c 100644 --- a/voxygen/anim/src/bird_medium/fly.rs +++ b/voxygen/anim/src/bird_medium/fly.rs @@ -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 } diff --git a/voxygen/anim/src/bird_medium/idle.rs b/voxygen/anim/src/bird_medium/idle.rs index d11b599c3c..833573f246 100644 --- a/voxygen/anim/src/bird_medium/idle.rs +++ b/voxygen/anim/src/bird_medium/idle.rs @@ -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 } } diff --git a/voxygen/anim/src/bird_medium/mod.rs b/voxygen/anim/src/bird_medium/mod.rs index 59610cc003..b10f92ec0b 100644 --- a/voxygen/anim/src/bird_medium/mod.rs +++ b/voxygen/anim/src/bird_medium/mod.rs @@ -36,10 +36,10 @@ impl Skeleton for BirdMediumSkeleton { &self, base_mat: Mat4, 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::::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::::from(self.head)), diff --git a/voxygen/anim/src/bird_medium/run.rs b/voxygen/anim/src/bird_medium/run.rs index 9f1dd93ac1..84f9d85655 100644 --- a/voxygen/anim/src/bird_medium/run.rs +++ b/voxygen/anim/src/bird_medium/run.rs @@ -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 } diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index c09dc33eb0..c7bcfbe010 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -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) { diff --git a/voxygen/anim/src/character/climb.rs b/voxygen/anim/src/character/climb.rs index b920e9c123..039e8ab66c 100644 --- a/voxygen/anim/src/character/climb.rs +++ b/voxygen/anim/src/character/climb.rs @@ -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 diff --git a/voxygen/anim/src/character/dance.rs b/voxygen/anim/src/character/dance.rs index f3239d0f5a..be42143a3f 100644 --- a/voxygen/anim/src/character/dance.rs +++ b/voxygen/anim/src/character/dance.rs @@ -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 diff --git a/voxygen/anim/src/character/idle.rs b/voxygen/anim/src/character/idle.rs index 30014247ae..81c3145038 100644 --- a/voxygen/anim/src/character/idle.rs +++ b/voxygen/anim/src/character/idle.rs @@ -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(), diff --git a/voxygen/anim/src/character/jump.rs b/voxygen/anim/src/character/jump.rs index bdbc86774d..73d6e7e685 100644 --- a/voxygen/anim/src/character/jump.rs +++ b/voxygen/anim/src/character/jump.rs @@ -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 { diff --git a/voxygen/anim/src/character/leapmelee.rs b/voxygen/anim/src/character/leapmelee.rs index 17e65007fc..b9268f368d 100644 --- a/voxygen/anim/src/character/leapmelee.rs +++ b/voxygen/anim/src/character/leapmelee.rs @@ -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) { diff --git a/voxygen/anim/src/character/mod.rs b/voxygen/anim/src/character/mod.rs index e07effd307..042a8520bd 100644 --- a/voxygen/anim/src/character/mod.rs +++ b/voxygen/anim/src/character/mod.rs @@ -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::::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::::from(self.torso); let chest_mat = torso_mat * Mat4::::from(self.chest); let head_mat = chest_mat * Mat4::::from(self.head); let shorts_mat = chest_mat * Mat4::::from(self.shorts); diff --git a/voxygen/anim/src/character/mount.rs b/voxygen/anim/src/character/mount.rs index da847e440e..8d5fc33535 100644 --- a/voxygen/anim/src/character/mount.rs +++ b/voxygen/anim/src/character/mount.rs @@ -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( diff --git a/voxygen/anim/src/character/roll.rs b/voxygen/anim/src/character/roll.rs index 7b7d53a3d9..55302c5c06 100644 --- a/voxygen/anim/src/character/roll.rs +++ b/voxygen/anim/src/character/roll.rs @@ -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); diff --git a/voxygen/anim/src/character/run.rs b/voxygen/anim/src/character/run.rs index 3c838235dd..9e1dbc966c 100644 --- a/voxygen/anim/src/character/run.rs +++ b/voxygen/anim/src/character/run.rs @@ -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 { diff --git a/voxygen/anim/src/character/sit.rs b/voxygen/anim/src/character/sit.rs index b620143c9c..d296480b88 100644 --- a/voxygen/anim/src/character/sit.rs +++ b/voxygen/anim/src/character/sit.rs @@ -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( diff --git a/voxygen/anim/src/character/spin.rs b/voxygen/anim/src/character/spin.rs index 47bf224d90..a9413004db 100644 --- a/voxygen/anim/src/character/spin.rs +++ b/voxygen/anim/src/character/spin.rs @@ -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); diff --git a/voxygen/anim/src/character/staggered.rs b/voxygen/anim/src/character/staggered.rs index fe090df31e..3389e12f73 100644 --- a/voxygen/anim/src/character/staggered.rs +++ b/voxygen/anim/src/character/staggered.rs @@ -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 { diff --git a/voxygen/anim/src/character/stand.rs b/voxygen/anim/src/character/stand.rs index 8275f31ce9..8301ca655e 100644 --- a/voxygen/anim/src/character/stand.rs +++ b/voxygen/anim/src/character/stand.rs @@ -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(), diff --git a/voxygen/anim/src/character/stunned.rs b/voxygen/anim/src/character/stunned.rs index a603507492..9edde52b15 100644 --- a/voxygen/anim/src/character/stunned.rs +++ b/voxygen/anim/src/character/stunned.rs @@ -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 { diff --git a/voxygen/anim/src/character/swim.rs b/voxygen/anim/src/character/swim.rs index d906e9afad..4bb79c4795 100644 --- a/voxygen/anim/src/character/swim.rs +++ b/voxygen/anim/src/character/swim.rs @@ -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, diff --git a/voxygen/anim/src/character/swimwield.rs b/voxygen/anim/src/character/swimwield.rs index 038c1c9588..7edf40e562 100644 --- a/voxygen/anim/src/character/swimwield.rs +++ b/voxygen/anim/src/character/swimwield.rs @@ -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); diff --git a/voxygen/anim/src/dragon/mod.rs b/voxygen/anim/src/dragon/mod.rs index 28efbd3562..8eb09204c5 100644 --- a/voxygen/anim/src/dragon/mod.rs +++ b/voxygen/anim/src/dragon/mod.rs @@ -43,10 +43,10 @@ impl Skeleton for DragonSkeleton { &self, base_mat: Mat4, 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::::from(self.chest_front); - //* Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 1.0); let chest_rear_mat = chest_front_mat * Mat4::::from(self.chest_rear); let head_lower_mat = chest_front_mat * Mat4::::from(self.head_lower); let wing_in_l_mat = chest_front_mat * Mat4::::from(self.wing_in_l); diff --git a/voxygen/anim/src/fish_medium/idle.rs b/voxygen/anim/src/fish_medium/idle.rs index 57f8154489..3770dac15c 100644 --- a/voxygen/anim/src/fish_medium/idle.rs +++ b/voxygen/anim/src/fish_medium/idle.rs @@ -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); diff --git a/voxygen/anim/src/fish_medium/mod.rs b/voxygen/anim/src/fish_medium/mod.rs index b6a16b2a8f..b2b1da5d7c 100644 --- a/voxygen/anim/src/fish_medium/mod.rs +++ b/voxygen/anim/src/fish_medium/mod.rs @@ -33,10 +33,11 @@ impl Skeleton for FishMediumSkeleton { &self, base_mat: Mat4, buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], - body: Self::Body, + _body: Self::Body, ) -> Offsets { - let chest_front_mat = - base_mat * Mat4::::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::::from(self.chest_front); let chest_back_mat = Mat4::::from(self.chest_back); let head_mat = Mat4::::from(self.head); diff --git a/voxygen/anim/src/fish_medium/swim.rs b/voxygen/anim/src/fish_medium/swim.rs index 879ef59cf3..05828b7ee8 100644 --- a/voxygen/anim/src/fish_medium/swim.rs +++ b/voxygen/anim/src/fish_medium/swim.rs @@ -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); diff --git a/voxygen/anim/src/fish_small/idle.rs b/voxygen/anim/src/fish_small/idle.rs index 1c17f2bbc3..71ebf6f48d 100644 --- a/voxygen/anim/src/fish_small/idle.rs +++ b/voxygen/anim/src/fish_small/idle.rs @@ -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); diff --git a/voxygen/anim/src/fish_small/mod.rs b/voxygen/anim/src/fish_small/mod.rs index 7b00acfbb8..e96ae2017f 100644 --- a/voxygen/anim/src/fish_small/mod.rs +++ b/voxygen/anim/src/fish_small/mod.rs @@ -30,9 +30,10 @@ impl Skeleton for FishSmallSkeleton { &self, base_mat: Mat4, buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], - body: Self::Body, + _body: Self::Body, ) -> Offsets { - let chest_mat = base_mat * Mat4::::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::::from(self.chest); *(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [ make_bone(chest_mat), diff --git a/voxygen/anim/src/fish_small/swim.rs b/voxygen/anim/src/fish_small/swim.rs index bbff763433..68f975519a 100644 --- a/voxygen/anim/src/fish_small/swim.rs +++ b/voxygen/anim/src/fish_small/swim.rs @@ -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); diff --git a/voxygen/anim/src/golem/alpha.rs b/voxygen/anim/src/golem/alpha.rs index d6a9241161..b0c5e6eb37 100644 --- a/voxygen/anim/src/golem/alpha.rs +++ b/voxygen/anim/src/golem/alpha.rs @@ -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 } } diff --git a/voxygen/anim/src/golem/idle.rs b/voxygen/anim/src/golem/idle.rs index 1a17b9c075..e9f70945b0 100644 --- a/voxygen/anim/src/golem/idle.rs +++ b/voxygen/anim/src/golem/idle.rs @@ -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); diff --git a/voxygen/anim/src/golem/mod.rs b/voxygen/anim/src/golem/mod.rs index 8096567c7f..9da100ab20 100644 --- a/voxygen/anim/src/golem/mod.rs +++ b/voxygen/anim/src/golem/mod.rs @@ -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::::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::::from(self.torso); let upper_torso_mat = torso_mat * Mat4::::from(self.upper_torso); let lower_torso_mat = upper_torso_mat * Mat4::::from(self.lower_torso); let leg_l_mat = lower_torso_mat * Mat4::::from(self.leg_l); diff --git a/voxygen/anim/src/golem/run.rs b/voxygen/anim/src/golem/run.rs index 9ac7a7ddd4..7f5f63f287 100644 --- a/voxygen/anim/src/golem/run.rs +++ b/voxygen/anim/src/golem/run.rs @@ -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); diff --git a/voxygen/anim/src/golem/shockwave.rs b/voxygen/anim/src/golem/shockwave.rs index bd7ea583ff..47efe596cc 100644 --- a/voxygen/anim/src/golem/shockwave.rs +++ b/voxygen/anim/src/golem/shockwave.rs @@ -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 = diff --git a/voxygen/anim/src/golem/spinmelee.rs b/voxygen/anim/src/golem/spinmelee.rs index b551bd8490..aef2b59288 100644 --- a/voxygen/anim/src/golem/spinmelee.rs +++ b/voxygen/anim/src/golem/spinmelee.rs @@ -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 = diff --git a/voxygen/anim/src/object/beam.rs b/voxygen/anim/src/object/beam.rs index ae81972718..df3a77bf54 100644 --- a/voxygen/anim/src/object/beam.rs +++ b/voxygen/anim/src/object/beam.rs @@ -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 diff --git a/voxygen/anim/src/object/idle.rs b/voxygen/anim/src/object/idle.rs index 1684db73a8..8a824993c3 100644 --- a/voxygen/anim/src/object/idle.rs +++ b/voxygen/anim/src/object/idle.rs @@ -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 } diff --git a/voxygen/anim/src/object/mod.rs b/voxygen/anim/src/object/mod.rs index 6ef7a2d826..9419ebae35 100644 --- a/voxygen/anim/src/object/mod.rs +++ b/voxygen/anim/src/object/mod.rs @@ -29,13 +29,15 @@ impl Skeleton for ObjectSkeleton { &self, base_mat: Mat4, buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], - body: Self::Body, + _body: Self::Body, ) -> Offsets { - let bone0_mat = base_mat * Mat4::::from(self.bone0); + let scale_mat = Mat4::scaling_3d(1.0 / 11.0); + + let bone0_mat = base_mat * scale_mat * Mat4::::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::::from(self.bone1) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */ + make_bone(bone0_mat), + make_bone(scale_mat * Mat4::::from(self.bone1)), /* Decorellated from ori */ ]; Offsets { lantern: Vec3::default(), diff --git a/voxygen/anim/src/object/shoot.rs b/voxygen/anim/src/object/shoot.rs index 9d74848a65..f3375a02db 100644 --- a/voxygen/anim/src/object/shoot.rs +++ b/voxygen/anim/src/object/shoot.rs @@ -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); }, _ => {}, diff --git a/voxygen/anim/src/quadruped_low/idle.rs b/voxygen/anim/src/quadruped_low/idle.rs index 93c4776ffb..bf08a98e39 100644 --- a/voxygen/anim/src/quadruped_low/idle.rs +++ b/voxygen/anim/src/quadruped_low/idle.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_low/jump.rs b/voxygen/anim/src/quadruped_low/jump.rs index 0f8a583c48..715eb7fb42 100644 --- a/voxygen/anim/src/quadruped_low/jump.rs +++ b/voxygen/anim/src/quadruped_low/jump.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_low/mod.rs b/voxygen/anim/src/quadruped_low/mod.rs index 382f702854..2f55de2ffb 100644 --- a/voxygen/anim/src/quadruped_low/mod.rs +++ b/voxygen/anim/src/quadruped_low/mod.rs @@ -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::::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::::from(self.chest); let tail_front = chest_mat * Mat4::::from(self.tail_front); let head_lower_mat = chest_mat * Mat4::::from(self.head_lower); let head_upper_mat = head_lower_mat * Mat4::::from(self.head_upper); diff --git a/voxygen/anim/src/quadruped_low/run.rs b/voxygen/anim/src/quadruped_low/run.rs index 349c2c717e..2d4fc85463 100644 --- a/voxygen/anim/src/quadruped_low/run.rs +++ b/voxygen/anim/src/quadruped_low/run.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_low/shoot.rs b/voxygen/anim/src/quadruped_low/shoot.rs index 3348541285..9f43cc2463 100644 --- a/voxygen/anim/src/quadruped_low/shoot.rs +++ b/voxygen/anim/src/quadruped_low/shoot.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/alpha.rs b/voxygen/anim/src/quadruped_medium/alpha.rs index 65de540295..62c920a8fc 100644 --- a/voxygen/anim/src/quadruped_medium/alpha.rs +++ b/voxygen/anim/src/quadruped_medium/alpha.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/beta.rs b/voxygen/anim/src/quadruped_medium/beta.rs index 94d4e761b7..9ab747861c 100644 --- a/voxygen/anim/src/quadruped_medium/beta.rs +++ b/voxygen/anim/src/quadruped_medium/beta.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/feed.rs b/voxygen/anim/src/quadruped_medium/feed.rs index c5b608b945..d49c74aa30 100644 --- a/voxygen/anim/src/quadruped_medium/feed.rs +++ b/voxygen/anim/src/quadruped_medium/feed.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/hoof.rs b/voxygen/anim/src/quadruped_medium/hoof.rs index 7adf0c9403..a48a2dbc06 100644 --- a/voxygen/anim/src/quadruped_medium/hoof.rs +++ b/voxygen/anim/src/quadruped_medium/hoof.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/idle.rs b/voxygen/anim/src/quadruped_medium/idle.rs index 12d954cda9..1fa199b00c 100644 --- a/voxygen/anim/src/quadruped_medium/idle.rs +++ b/voxygen/anim/src/quadruped_medium/idle.rs @@ -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 = diff --git a/voxygen/anim/src/quadruped_medium/jump.rs b/voxygen/anim/src/quadruped_medium/jump.rs index 1ab939a040..850bdc5dd8 100644 --- a/voxygen/anim/src/quadruped_medium/jump.rs +++ b/voxygen/anim/src/quadruped_medium/jump.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/leapmelee.rs b/voxygen/anim/src/quadruped_medium/leapmelee.rs index 9af1ddfcd9..2b284869c6 100644 --- a/voxygen/anim/src/quadruped_medium/leapmelee.rs +++ b/voxygen/anim/src/quadruped_medium/leapmelee.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_medium/mod.rs b/voxygen/anim/src/quadruped_medium/mod.rs index 83387f5cdd..65a8bc36cd 100644 --- a/voxygen/anim/src/quadruped_medium/mod.rs +++ b/voxygen/anim/src/quadruped_medium/mod.rs @@ -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::::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::::from(self.torso_front); let torso_back_mat = torso_front_mat * Mat4::::from(self.torso_back); let neck_mat = torso_front_mat * Mat4::::from(self.neck); let leg_fl_mat = torso_front_mat * Mat4::::from(self.leg_fl); diff --git a/voxygen/anim/src/quadruped_medium/run.rs b/voxygen/anim/src/quadruped_medium/run.rs index 96414103f0..041f2cd4f0 100644 --- a/voxygen/anim/src/quadruped_medium/run.rs +++ b/voxygen/anim/src/quadruped_medium/run.rs @@ -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), diff --git a/voxygen/anim/src/quadruped_medium/stunned.rs b/voxygen/anim/src/quadruped_medium/stunned.rs index 1e51088e68..45c24f5d2a 100644 --- a/voxygen/anim/src/quadruped_medium/stunned.rs +++ b/voxygen/anim/src/quadruped_medium/stunned.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_small/feed.rs b/voxygen/anim/src/quadruped_small/feed.rs index 2b8213f532..f2e2b6312f 100644 --- a/voxygen/anim/src/quadruped_small/feed.rs +++ b/voxygen/anim/src/quadruped_small/feed.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_small/idle.rs b/voxygen/anim/src/quadruped_small/idle.rs index a4bf1a6ef9..ef69d55d4a 100644 --- a/voxygen/anim/src/quadruped_small/idle.rs +++ b/voxygen/anim/src/quadruped_small/idle.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_small/jump.rs b/voxygen/anim/src/quadruped_small/jump.rs index 6c924a9448..e5bc7e9729 100644 --- a/voxygen/anim/src/quadruped_small/jump.rs +++ b/voxygen/anim/src/quadruped_small/jump.rs @@ -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); diff --git a/voxygen/anim/src/quadruped_small/mod.rs b/voxygen/anim/src/quadruped_small/mod.rs index a69ed01f12..e5208935cd 100644 --- a/voxygen/anim/src/quadruped_small/mod.rs +++ b/voxygen/anim/src/quadruped_small/mod.rs @@ -43,8 +43,8 @@ impl Skeleton for QuadrupedSmallSkeleton { body: Self::Body, ) -> Offsets { let chest_mat = base_mat - * Mat4::::from(self.chest) - * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0); + * Mat4::scaling_3d(SkeletonAttr::from(&body).scaler / 11.0) + * Mat4::::from(self.chest); *(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [ make_bone(chest_mat * Mat4::::from(self.head)), diff --git a/voxygen/anim/src/quadruped_small/run.rs b/voxygen/anim/src/quadruped_small/run.rs index ef807671bd..d88d272391 100644 --- a/voxygen/anim/src/quadruped_small/run.rs +++ b/voxygen/anim/src/quadruped_small/run.rs @@ -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) diff --git a/voxygen/anim/src/quadruped_small/stunned.rs b/voxygen/anim/src/quadruped_small/stunned.rs index bf2cfab502..60802f30a0 100644 --- a/voxygen/anim/src/quadruped_small/stunned.rs +++ b/voxygen/anim/src/quadruped_small/stunned.rs @@ -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); diff --git a/voxygen/anim/src/ship/idle.rs b/voxygen/anim/src/ship/idle.rs index 3375543052..d12fdf9b2d 100644 --- a/voxygen/anim/src/ship/idle.rs +++ b/voxygen/anim/src/ship/idle.rs @@ -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 } diff --git a/voxygen/anim/src/ship/mod.rs b/voxygen/anim/src/ship/mod.rs index 4b69adf237..c4aca71c7e 100644 --- a/voxygen/anim/src/ship/mod.rs +++ b/voxygen/anim/src/ship/mod.rs @@ -29,15 +29,15 @@ impl Skeleton for ShipSkeleton { &self, base_mat: Mat4, buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], - body: Self::Body, + _body: Self::Body, ) -> Offsets { - let bone0_mat = base_mat * Mat4::::from(self.bone0); + let bone0_mat = base_mat * Mat4::scaling_3d(1.0 / 11.0) * Mat4::::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::::from(self.bone1) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */ - make_bone(bone0_mat * Mat4::::from(self.bone2) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */ - make_bone(bone0_mat * Mat4::::from(self.bone3) * Mat4::scaling_3d(1.0 / 11.0)), /* Decorellated from ori */ + make_bone(bone0_mat), + make_bone(bone0_mat * Mat4::::from(self.bone1)), + make_bone(bone0_mat * Mat4::::from(self.bone2)), + make_bone(bone0_mat * Mat4::::from(self.bone3)), ]; Offsets { lantern: Vec3::default(), diff --git a/voxygen/anim/src/theropod/idle.rs b/voxygen/anim/src/theropod/idle.rs index b4a3b492cb..65b6ffbf72 100644 --- a/voxygen/anim/src/theropod/idle.rs +++ b/voxygen/anim/src/theropod/idle.rs @@ -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); diff --git a/voxygen/anim/src/theropod/jump.rs b/voxygen/anim/src/theropod/jump.rs index aa9bb049cc..2bb199434d 100644 --- a/voxygen/anim/src/theropod/jump.rs +++ b/voxygen/anim/src/theropod/jump.rs @@ -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); diff --git a/voxygen/anim/src/theropod/mod.rs b/voxygen/anim/src/theropod/mod.rs index 1794dfda01..3db3042f4a 100644 --- a/voxygen/anim/src/theropod/mod.rs +++ b/voxygen/anim/src/theropod/mod.rs @@ -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::::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::::from(self.chest_front); let neck_mat = chest_front_mat * Mat4::::from(self.neck); let head_mat = neck_mat * Mat4::::from(self.head); let chest_back_mat = chest_front_mat * Mat4::::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), }, } } diff --git a/voxygen/anim/src/theropod/run.rs b/voxygen/anim/src/theropod/run.rs index 097bba1c84..8a5dccff6e 100644 --- a/voxygen/anim/src/theropod/run.rs +++ b/voxygen/anim/src/theropod/run.rs @@ -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);