Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Polygon Intersection #37

Merged
merged 1 commit into from
Mar 2, 2024
Merged

Conversation

Cleptomania
Copy link
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
2 checks passed
@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