Skip to content

Commit

Permalink
Removed counterclockwise order requirement
Browse files Browse the repository at this point in the history
Clockwise or counterclockwise order are both OK now in lists of polygon vertices. Check https://github.com/flame-engine/flame/blob/main/packages/flame/lib/src/geometry/polygon_component.dart#L122-L124
  • Loading branch information
maurovanetti authored Oct 24, 2024
1 parent 65a145f commit c9e8f5b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions doc/flame/collision_detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ them so don't doubt to use them even if your use case isn't listed here.
It should be noted that if you want to use collision detection or `containsPoint` on the `Polygon`,
the polygon needs to be convex. So always use convex polygons or you will most likely run into
problems if you don't really know what you are doing.
It should also be noted that you should always define the vertices in your polygon
in a counter-clockwise order.

The other hitbox shapes don't have any mandatory constructor, that is because they can have a
default calculated from the size of the collidable that they are attached to, but since a
Expand Down

0 comments on commit c9e8f5b

Please sign in to comment.