Commit 0cb811ef authored by Viktor Lidholt's avatar Viktor Lidholt

Renames pointQuickDist in GameMath

parent 1836ca61
...@@ -19,7 +19,7 @@ abstract class GameObject extends Node { ...@@ -19,7 +19,7 @@ abstract class GameObject extends Node {
..setStyle(sky.PaintingStyle.stroke); ..setStyle(sky.PaintingStyle.stroke);
bool collidingWith(GameObject obj) { bool collidingWith(GameObject obj) {
return (GameMath.pointQuickDist(position, obj.position) return (GameMath.distanceBetweenPoints(position, obj.position)
< radius + obj.radius); < radius + obj.radius);
} }
......
...@@ -105,7 +105,7 @@ class EffectLine extends Node { ...@@ -105,7 +105,7 @@ class EffectLine extends Node {
while(_points.length > 0 && _pointAges[0] > (fadeDuration + fadeAfterDelay)) { while(_points.length > 0 && _pointAges[0] > (fadeDuration + fadeAfterDelay)) {
// Update scroll if it isn't the last and only point that is about to removed // Update scroll if it isn't the last and only point that is about to removed
if (_points.length > 1 && textureLoopLength != null) { if (_points.length > 1 && textureLoopLength != null) {
double dist = GameMath.pointQuickDist(_points[0], _points[1]); double dist = GameMath.distanceBetweenPoints(_points[0], _points[1]);
_offset = (_offset - (dist / textureLoopLength)) % 1.0; _offset = (_offset - (dist / textureLoopLength)) % 1.0;
if (_offset < 0.0) _offset += 1; if (_offset < 0.0) _offset += 1;
} }
...@@ -167,7 +167,7 @@ class EffectLine extends Node { ...@@ -167,7 +167,7 @@ class EffectLine extends Node {
if (points.length > 0 && point.x == points[points.length - 1].x && point.y == points[points.length - 1].y) if (points.length > 0 && point.x == points[points.length - 1].x && point.y == points[points.length - 1].y)
return; return;
if (simplify && points.length >= 2 && GameMath.pointQuickDist(point, points[points.length - 2]) < 10.0) { if (simplify && points.length >= 2 && GameMath.distanceBetweenPoints(point, points[points.length - 2]) < 10.0) {
// Check if we should remove last point before adding the new one // Check if we should remove last point before adding the new one
// Calculate the square distance from the middle point to the line of the // Calculate the square distance from the middle point to the line of the
......
...@@ -196,7 +196,7 @@ class TexturedLinePainter { ...@@ -196,7 +196,7 @@ class TexturedLinePainter {
Point intersection = GameMath.lineIntersection(oldVertex0, oldVertex1, vertex0, vertex1); Point intersection = GameMath.lineIntersection(oldVertex0, oldVertex1, vertex0, vertex1);
if (intersection != null) { if (intersection != null) {
if (GameMath.pointQuickDist(vertex0, intersection) < GameMath.pointQuickDist(vertex1, intersection)) { if (GameMath.distanceBetweenPoints(vertex0, intersection) < GameMath.distanceBetweenPoints(vertex1, intersection)) {
vertex0 = oldVertex0; vertex0 = oldVertex0;
} else { } else {
vertex1 = oldVertex1; vertex1 = oldVertex1;
...@@ -220,7 +220,7 @@ class TexturedLinePainter { ...@@ -220,7 +220,7 @@ class TexturedLinePainter {
Point lastPoint = _points[i - 1]; Point lastPoint = _points[i - 1];
Point currentPoint = _points[i]; Point currentPoint = _points[i];
double dist = GameMath.pointQuickDist(lastPoint, currentPoint); double dist = GameMath.distanceBetweenPoints(lastPoint, currentPoint);
length += dist; length += dist;
stops.add(length); stops.add(length);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment