it was in radians
parent
e72828cbde
commit
cfb98c412c
|
@ -32,12 +32,14 @@ public class Player extends RenderObject
|
||||||
position.x -= Math.sin(ry) * Constants.movementSpeed;
|
position.x -= Math.sin(ry) * Constants.movementSpeed;
|
||||||
break;
|
break;
|
||||||
case LEFT:
|
case LEFT:
|
||||||
position.z -= Math.cos(ry + 105) * Constants.movementSpeed;
|
ry -= NINETY_DEGREES;
|
||||||
position.x += Math.sin(ry + 105) * Constants.movementSpeed;
|
position.z -= Math.cos(ry) * Constants.movementSpeed;
|
||||||
|
position.x += Math.sin(ry) * Constants.movementSpeed;
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
position.z -= Math.cos(ry - 105) * Constants.movementSpeed;
|
ry += NINETY_DEGREES;
|
||||||
position.x += Math.sin(ry - 105) * Constants.movementSpeed;
|
position.z -= Math.cos(ry) * Constants.movementSpeed;
|
||||||
|
position.x += Math.sin(ry) * Constants.movementSpeed;
|
||||||
break;
|
break;
|
||||||
case UP:
|
case UP:
|
||||||
if (this.noWeight) position.y += Constants.movementSpeed;
|
if (this.noWeight) position.y += Constants.movementSpeed;
|
||||||
|
@ -49,6 +51,8 @@ public class Player extends RenderObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final float NINETY_DEGREES = (float) (Math.PI / 2f);
|
||||||
|
|
||||||
private void jump()
|
private void jump()
|
||||||
{
|
{
|
||||||
if (!isInAir)
|
if (!isInAir)
|
||||||
|
|
Loading…
Reference in New Issue