Skip to content

FIX: The out parameter 'isClockwise' must be assigned to before contr… #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SimulationFramework/Polygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private static bool RayLineIntersect(Vector2 position, Vector2 direction, Vector
/// <returns><see langword="true"/> if <paramref name="polygon"/> is convex; otherwise <see langword="false"/></returns>
public static bool IsConvex(ReadOnlySpan<Vector2> polygon, [NotNullWhen(true)] out bool? isClockwise)
{
isClockwise = null;
// for a convex polygon every point will have the same winding value
bool isAllClockwise = IsClockwiseWinding(polygon, 0);
for (int i = 0; i < polygon.Length; i++)
Expand All @@ -157,7 +158,6 @@ public static bool IsConvex(ReadOnlySpan<Vector2> polygon, [NotNullWhen(true)] o
}
}

isClockwise = null;
return false;

// determines the winding order at a specific vertex
Expand Down