Skip to content

Commit

Permalink
Minor comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed May 6, 2018
1 parent c74ee21 commit ad3ce3f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/io/anuke/mindustry/entities/Predict.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class Predict {
private static Vector2 vec = new Vector2();
private static Vector2 vresult = new Vector2();

/**Returns resulting predicted vector.
* Don't call from multiple threads, ever.*/
public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v) {
float tx = dstx - srcx,
ty = dsty - srcy,
Expand All @@ -19,7 +21,7 @@ public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty,
float c = tx*tx + ty*ty;

// Solve quadratic
Vector2 ts = quad(a, b, c); // See quad(), below
Vector2 ts = quad(a, b, c);

// Find smallest positive solution
Vector2 sol = vresult.set(0, 0);
Expand All @@ -36,10 +38,7 @@ public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty,
}


/**
* Return solutions for quadratic
*/
public static Vector2 quad(float a, float b, float c) {
private static Vector2 quad(float a, float b, float c) {
Vector2 sol = null;
if (Math.abs(a) < 1e-6) {
if (Math.abs(b) < 1e-6) {
Expand Down

0 comments on commit ad3ce3f

Please sign in to comment.