diff --git a/doc/flame/collision_detection.md b/doc/flame/collision_detection.md index e22874fee3d..d0b4ff017da 100644 --- a/doc/flame/collision_detection.md +++ b/doc/flame/collision_detection.md @@ -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 diff --git a/doc/flame/components.md b/doc/flame/components.md index a0f59320cf5..0cc4b0eb3bb 100644 --- a/doc/flame/components.md +++ b/doc/flame/components.md @@ -1070,9 +1070,9 @@ For example you could create a diamond shapes polygon like this: void main() { PolygonComponent.relative( [ - Vector2(0.0, 1.0), // Middle of top wall + Vector2(0.0, -1.0), // Middle of top wall Vector2(1.0, 0.0), // Middle of right wall - Vector2(0.0, -1.0), // Middle of bottom wall + Vector2(0.0, 1.0), // Middle of bottom wall Vector2(-1.0, 0.0), // Middle of left wall ], size: Vector2.all(100), @@ -1090,9 +1090,6 @@ the center of the polygon. In the image you can see how the polygon shape formed by the purple arrows is defined by the red arrows. -Remember to define the lists in a counter clockwise manner (if you think in the screen coordinate -system where the y-axis is flipped, otherwise it is clockwise). - ### RectangleComponent diff --git a/doc/images/polygon_shape.png b/doc/images/polygon_shape.png index bd44befc135..8e1e28b56cd 100644 Binary files a/doc/images/polygon_shape.png and b/doc/images/polygon_shape.png differ