projects
/
sixth-3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code refactoring.
[sixth-3d.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
sixth
/
e3d
/
gui
/
Avatar.java
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
..
852dc97
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
@@
-70,7
+70,7
@@
public class Avatar implements ViewRenderListener {
public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) {
final Point3D locationBeforeUpdate = new Point3D(location);
public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) {
final Point3D locationBeforeUpdate = new Point3D(location);
- translateAvatarLocation(millisecondsSinceLastFrame);
+ translateAvatarLocation
BasedOnMovementVector
(millisecondsSinceLastFrame);
applyFrictionToUserMovement(millisecondsSinceLastFrame);
return isFrameRepaintNeeded(locationBeforeUpdate);
}
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.
*/
* Therefore we take frame rendering time into account when translating
* avatar between consecutive frames.
*/
- private void translateAvatarLocation(int millisecondsPassedSinceLastFrame) {
+ private void translateAvatarLocation
BasedOnMovementVector
(int millisecondsPassedSinceLastFrame) {
location.x -= (float) sin(getAngleXZ())
* getMovementVector().z * SPEED_MULTIPLIER
* millisecondsPassedSinceLastFrame;
location.x -= (float) sin(getAngleXZ())
* getMovementVector().z * SPEED_MULTIPLIER
* millisecondsPassedSinceLastFrame;