Renames pointQuickDist in GameMath
This commit is contained in:
@@ -19,7 +19,7 @@ abstract class GameObject extends Node {
|
||||
..setStyle(sky.PaintingStyle.stroke);
|
||||
|
||||
bool collidingWith(GameObject obj) {
|
||||
return (GameMath.pointQuickDist(position, obj.position)
|
||||
return (GameMath.distanceBetweenPoints(position, obj.position)
|
||||
< radius + obj.radius);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class EffectLine extends Node {
|
||||
while(_points.length > 0 && _pointAges[0] > (fadeDuration + fadeAfterDelay)) {
|
||||
// Update scroll if it isn't the last and only point that is about to removed
|
||||
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;
|
||||
if (_offset < 0.0) _offset += 1;
|
||||
}
|
||||
@@ -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)
|
||||
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
|
||||
|
||||
// Calculate the square distance from the middle point to the line of the
|
||||
|
||||
@@ -196,7 +196,7 @@ class TexturedLinePainter {
|
||||
|
||||
Point intersection = GameMath.lineIntersection(oldVertex0, oldVertex1, vertex0, vertex1);
|
||||
if (intersection != null) {
|
||||
if (GameMath.pointQuickDist(vertex0, intersection) < GameMath.pointQuickDist(vertex1, intersection)) {
|
||||
if (GameMath.distanceBetweenPoints(vertex0, intersection) < GameMath.distanceBetweenPoints(vertex1, intersection)) {
|
||||
vertex0 = oldVertex0;
|
||||
} else {
|
||||
vertex1 = oldVertex1;
|
||||
@@ -220,7 +220,7 @@ class TexturedLinePainter {
|
||||
Point lastPoint = _points[i - 1];
|
||||
Point currentPoint = _points[i];
|
||||
|
||||
double dist = GameMath.pointQuickDist(lastPoint, currentPoint);
|
||||
double dist = GameMath.distanceBetweenPoints(lastPoint, currentPoint);
|
||||
length += dist;
|
||||
stops.add(length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user