X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2Fhumaninput%2FWorldNavigationTracker.java;h=cc99c42f32d54f1b51377801d3155776bd1de70f;hb=baab2e2c2ad89695293f3136311c585c9a5afed1;hp=34fd37e42dd5f45fa76ceb61e82fbf37959fa2a4;hpb=6213716671ccab6b7256de41838e1f5401ce173c;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationTracker.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationTracker.java index 34fd37e..cc99c42 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationTracker.java @@ -1,10 +1,10 @@ /* - * Sixth - System for data storage, computation, exploration and interaction. - * Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. + * */ package eu.svjatoslav.sixth.e3d.gui.humaninput; @@ -18,8 +18,8 @@ import java.awt.event.KeyEvent; public class WorldNavigationTracker implements UserInputHandler { @Override - public boolean beforeViewUpdate(final ViewContext viewContext, - final int millisecondsSinceLastFrame) { + public boolean beforeRender(final ViewContext viewContext, + final int millisecondsSinceLastFrame) { trackKeys(millisecondsSinceLastFrame, viewContext); return false; @@ -56,16 +56,16 @@ public class WorldNavigationTracker implements UserInputHandler { * (1 + (avatar.getMovementSpeed() / 10)); if (inputTracker.isKeyPressed(KeyboardHelper.UP)) - avatar.getMovementDirection().z += actualAcceleration; + avatar.getMovementVector().z += actualAcceleration; if (inputTracker.isKeyPressed(KeyboardHelper.DOWN)) - avatar.getMovementDirection().z -= actualAcceleration; + avatar.getMovementVector().z -= actualAcceleration; if (inputTracker.isKeyPressed(KeyboardHelper.RIGHT)) - avatar.getMovementDirection().x += actualAcceleration; + avatar.getMovementVector().x += actualAcceleration; if (inputTracker.isKeyPressed(KeyboardHelper.LEFT)) - avatar.getMovementDirection().x -= actualAcceleration; + avatar.getMovementVector().x -= actualAcceleration; avatar.enforceSpeedLimit(); }