projects
/
sixth-3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
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
6e4c5ec
..
7f0f698
100755
(executable)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
@@
-14,7
+14,7
@@
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
-public class Avatar implements View
Update
Listener {
+public class Avatar implements View
Render
Listener {
public static final double SPEED_LIMIT = 30;
/**
public static final double SPEED_LIMIT = 30;
/**
@@
-70,7
+70,7
@@
public class Avatar implements ViewUpdateListener {
}
@Override
}
@Override
- public boolean before
ViewUpdate
(final ViewContext viewContext, final int millisecondsSinceLastFrame) {
+ public boolean before
Render
(final ViewContext viewContext, final int millisecondsSinceLastFrame) {
final Point3D locationBeforeUpdate = new Point3D(location);
translateAvatarLocation(millisecondsSinceLastFrame);
final Point3D locationBeforeUpdate = new Point3D(location);
translateAvatarLocation(millisecondsSinceLastFrame);
@@
-84,8
+84,7
@@
public class Avatar implements ViewUpdateListener {
}
public void enforceSpeedLimit() {
}
public void enforceSpeedLimit() {
- final double currentSpeed = movementVector
- .getDistanceTo(Point3D.ZERO);
+ final double currentSpeed = movementVector.getVectorLength();
if (currentSpeed <= SPEED_LIMIT)
return;
if (currentSpeed <= SPEED_LIMIT)
return;
@@
-122,7
+121,7
@@
public class Avatar implements ViewUpdateListener {
}
public double getMovementSpeed() {
}
public double getMovementSpeed() {
- return movementVector.get
DistanceTo(Point3D.ZERO
);
+ return movementVector.get
VectorLength(
);
}
private void applyFrictionToUserMovement(int millisecondsPassedSinceLastFrame) {
}
private void applyFrictionToUserMovement(int millisecondsPassedSinceLastFrame) {