Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
With #57 I introduced the
VectorUtil
class used for the Areaportal/Occluder mapper. The purpose of its methods is to compareWindings
by their surface area and get the overlap as a percentage. Internally this is done by first testing if both windings share a common plane and then converting them to 2 dimensional convex polygons to make comparison easy.Changes
Previously, all relevant calculations were all done in the
VectorUtil
class. To make the class less bloated with methods, this pr transfers some of that code into a new class calledConvexPolygon
. As the name already suggest, this is a class which represents a convex polygon defined by a list of vertex positions.Additionally, there are also some improvements to the javadoc and the algorithm for testing if a position is inside a convex polygon has been change to a different one.
Practically, this pr shouldn't change anything visible to the user but rather just improve code readability and reusability.