Remove redundant .nor() in nearestPoint()

This commit is contained in:
BlueNutterfly 2018-11-11 20:41:01 +04:00
parent 81fc6e91c9
commit a0b0753c5e

View File

@ -14,7 +14,7 @@ public class Utils {
float lineLen = lineDir.len(); float lineLen = lineDir.len();
lineDir.nor(); lineDir.nor();
Vector2 ballDir = p1.sub(linep1); Vector2 ballDir = p1.sub(linep1);
return linep1.add(lineDir.nor().scl(MathUtils.clamp(ballDir.dot(lineDir), 0, lineLen))); return linep1.add(lineDir.scl(MathUtils.clamp(ballDir.dot(lineDir), 0, lineLen)));
} }
} }