Skip to content

Commit

Permalink
Fixes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Feb 16, 2023
1 parent c2894cc commit b18ef2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ else if (motionZ > 0)

move(motionX, motionY, motionZ);

rot.x = (float) FastMath.round(rot.x / 90) * 90;
rot.z = (float) FastMath.round(rot.z / 90) * 90;
if (onGround) {
rot.x = (float) FastMath.round(rot.x / 90) * 90;
rot.z = (float) FastMath.round(rot.z / 90) * 90;
}

if (MathUtil.absolute((float) motionX) > 0.00001)
prevMotionX = motionX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ public void onUpdate() {

move(motionX, motionY, motionZ);

rot.x = (float) FastMath.round(rot.x / 90) * 90;
rot.z = (float) FastMath.round(rot.z / 90) * 90;
if (onGround) {
rot.x = (float) FastMath.round(rot.x / 90) * 90;
rot.z = (float) FastMath.round(rot.z / 90) * 90;
}

motionX *= 0.98;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static void putCube(BufferBuilder buffer, float x, float y, float z, floa
MATRIX_STACK.modelMatrix().setIdentity();
MATRIX_STACK.normalMatrix().setIdentity();
MATRIX_STACK.translate(x, y, z);
Quaternion rotation = Quaternion.createRotateX((float) Math.toRadians(rotX));
Quaternion rotation = Quaternion.createRotateY((float) Math.toRadians(rotY));
rotation.rotateZ((float) Math.toRadians(rotZ));
rotation.rotateY((float) Math.toRadians(rotY));
rotation.rotateX((float) Math.toRadians(rotX));
MATRIX_STACK.rotate(rotation);
MATRIX_STACK.scale(scaleX, scaleY, scaleZ);

Expand Down

0 comments on commit b18ef2c

Please sign in to comment.