Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
55dc7108
Commit
55dc7108
authored
Sep 25, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1351 from vlidholt/master
Renames pointQuickDist in GameMath
parents
91cb07f6
0cb811ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
game_objects.dart
examples/game/lib/game_objects.dart
+1
-1
effect_line.dart
packages/flutter_sprites/lib/effect_line.dart
+2
-2
textured_line.dart
packages/flutter_sprites/lib/textured_line.dart
+2
-2
No files found.
examples/game/lib/game_objects.dart
View file @
55dc7108
...
...
@@ -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
);
}
...
...
packages/flutter_sprites/lib/effect_line.dart
View file @
55dc7108
...
...
@@ -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
...
...
packages/flutter_sprites/lib/textured_line.dart
View file @
55dc7108
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment