-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
RegularPolygon
colliders with a custom shape (#367)
# Objective Currently, regular polygons don't have their own collider shape. Instead, the `From<RegularPolygon>` implementation computes the convex hull and creates a convex polygon from that. This may not be the most efficient approach however, as some computations can be simpler and more efficient if the polygon is known to be regular. This PR adds a custom shape implementation for the 2D `RegularPolygon` primitive. ## Solution Add a `RegularPolygonWrapper` type that is used as the internal representation for the custom regular polygon shape. The custom shape uses the ID `2`. --- ## Migration Guide If you had a custom Parry shape using the ID `2`, you might need to change it, because the ID is used for regular polygons.
- Loading branch information
Showing
5 changed files
with
266 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters