Scroll REALLY Fixed

This commit is contained in:
Arthur 2021-03-01 13:34:04 +01:00
parent 41fc399f70
commit 161f9b64c2

View File

@ -75,16 +75,12 @@ public class JoglMouseListener implements MouseListener, MouseMotionListener, Mo
@Override @Override
public void mouseWheelMoved(MouseWheelEvent e) { public void mouseWheelMoved(MouseWheelEvent e) {
if( 45 > Math.abs(canvas.camera[3])) if( 45 > Math.abs(canvas.camera[3]) && 45>Math.abs(canvas.camera[4]))
canvas.camera[0] += e.getWheelRotation()*Math.tan(Math.toRadians(-canvas.camera[3]))*0.25; canvas.camera[0] += e.getWheelRotation() * Math.tan(Math.toRadians(-canvas.camera[3])) * 0.25;
else else
canvas.camera[0] += e.getWheelRotation()*Math.tan(Math.toRadians(canvas.camera[3]))*0.25; canvas.camera[0] += e.getWheelRotation() * Math.tan(Math.toRadians(canvas.camera[3])) * 0.25;
if(45>Math.abs(canvas.camera[4])) canvas.camera[1] += e.getWheelRotation() * Math.tan(Math.toRadians(canvas.camera[4])) * 0.25;
canvas.camera[1] += e.getWheelRotation()*Math.tan(Math.toRadians(canvas.camera[4]))*0.25; if( 45 < Math.abs(canvas.camera[3]) || 45 < Math.abs(canvas.camera[4]))
else
canvas.camera[1] += e.getWheelRotation()*Math.tan(Math.toRadians(-canvas.camera[4]))*0.25;
if( 45 < Math.abs(canvas.camera[3]) || 45<Math.abs(canvas.camera[4]))
canvas.camera[2] += -e.getWheelRotation()*0.25; canvas.camera[2] += -e.getWheelRotation()*0.25;
else else
canvas.camera[2] += e.getWheelRotation()*0.25; canvas.camera[2] += e.getWheelRotation()*0.25;