/*
- * 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.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
*/
-
package eu.svjatoslav.sixth.e3d.gui;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) {
final Point3D locationBeforeUpdate = new Point3D(location);
- translateAvatarLocation(millisecondsSinceLastFrame);
+ translateAvatarLocationBasedOnMovementVector(millisecondsSinceLastFrame);
applyFrictionToUserMovement(millisecondsSinceLastFrame);
return isFrameRepaintNeeded(locationBeforeUpdate);
}
* 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;