X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FAvatar.java;h=050a14ec1757a34495815c0c308d89d03755f76f;hp=52d78b2471fe836b1707393061d3a205125d7d13;hb=59baa428fb2d9e7f0fe5423f4cea47f2d6245914;hpb=e56f9b775bd49c31e8efab7204bee699036942b3 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java index 52d78b2..050a14e 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine. Copyright ©2012-2019, 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 @@ -70,7 +70,7 @@ public class Avatar implements ViewRenderListener { public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) { final Point3D locationBeforeUpdate = new Point3D(location); - translateAvatarLocation(millisecondsSinceLastFrame); + translateAvatarLocationBasedOnMovementVector(millisecondsSinceLastFrame); applyFrictionToUserMovement(millisecondsSinceLastFrame); return isFrameRepaintNeeded(locationBeforeUpdate); } @@ -139,7 +139,7 @@ public class Avatar implements ViewRenderListener { * Therefore we take frame rendering time into account when translating * avatar between consecutive frames. */ - private void translateAvatarLocation(int millisecondsPassedSinceLastFrame) { + private void translateAvatarLocationBasedOnMovementVector(int millisecondsPassedSinceLastFrame) { location.x -= (float) sin(getAngleXZ()) * getMovementVector().z * SPEED_MULTIPLIER * millisecondsPassedSinceLastFrame;