Skip to content

Native Polygon Intersection#37

Merged
Cleptomania merged 1 commit intodevelopmentfrom
native-polygon-intersection
Mar 2, 2024
Merged

Native Polygon Intersection#37
Cleptomania merged 1 commit intodevelopmentfrom
native-polygon-intersection

Conversation

@Cleptomania
Copy link
Copy Markdown
Member

This duplicates the are_polygons_intersecting function essentially to have a "native" version which accepts a reference to the polygon points, which means that we do not need to clone the points when calling from with the SpriteList collision functions.

The other way of not accepting references is still necessary for the function which is exposed to Python, but we can leverage the native version within the rust code to avoid the unnecessary data copying, gives roughly a couple percent improvement to the overall collision detection performance because that is an incredibly hot loop. to be doing copies in.

@Cleptomania Cleptomania merged commit aa75d1c into development Mar 2, 2024
@Cleptomania Cleptomania deleted the native-polygon-intersection branch March 2, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant