From ad3ce3f9fc4333dd59a961f3c9a46faf73935163 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 6 May 2018 11:52:10 -0400 Subject: [PATCH] Minor comment fix --- core/src/io/anuke/mindustry/entities/Predict.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/io/anuke/mindustry/entities/Predict.java b/core/src/io/anuke/mindustry/entities/Predict.java index a97165a0d1..a39eced4da 100644 --- a/core/src/io/anuke/mindustry/entities/Predict.java +++ b/core/src/io/anuke/mindustry/entities/Predict.java @@ -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, @@ -19,7 +21,7 @@ public class Predict { 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); @@ -36,10 +38,7 @@ public class Predict { } - /** - * 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) {