Skip to content

Commit

Permalink
#60 smooth out model leaning
Browse files Browse the repository at this point in the history
  • Loading branch information
der-fruhling committed Jun 6, 2024
1 parent 358578a commit 68c4743
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ public class PlayerRendererMixin {
value = "HEAD"
)
)
protected void setupRotations(AbstractClientPlayer p_117802_, PoseStack p_117803_, float p_117804_, float p_117805_, float p_117806_, CallbackInfo ci) {
protected void setupRotations(AbstractClientPlayer p_117802_, PoseStack p_117803_, float p_117804_, float p_117805_, float f, CallbackInfo ci) {
if(ctp$perspectiveActive && Conditional.shouldApplyPerspectiveTo(p_117802_)) {
float height = 0;

if(p_117802_.getVehicle() != null) {
height = p_117802_.getEyeHeight();
}

p_117803_.rotateAround(Axis.ZP.rotationDegrees(Mth.cos(Mth.DEG_TO_RAD * ctp$yaw) * ctp$lean), 0, height, 0);
p_117803_.rotateAround(Axis.XP.rotationDegrees(Mth.sin(Mth.DEG_TO_RAD * ctp$yaw) * -ctp$lean), 0, height, 0);
var lean = ctp$getLean(f);
p_117803_.rotateAround(Axis.ZP.rotationDegrees(Mth.cos(Mth.DEG_TO_RAD * ctp$yaw) * lean), 0, height, 0);
p_117803_.rotateAround(Axis.XP.rotationDegrees(Mth.sin(Mth.DEG_TO_RAD * ctp$yaw) * -lean), 0, height, 0);
}
}
}

0 comments on commit 68c4743

Please sign in to comment.