circleIntersection for CollisionDetection (f.e. dartboard) #1593
Repith
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
There is possibility, that someone would like to use dnd-kit for creating dartboard or any other kind of circle droppable tables.
Here is a custom collision algorithm for circleIntersection adapted for a full rounded rings.
Maybe someone would enjoy :)
#Function getCircleIntersectionRatio
This function calculates the intersection ratio between two "circular" areas derived from rectangular shapes (ClientRect).
#Function circleIntersection
This function uses getCircleIntersectionRatio to find collisions and sorts them by the most significant intersection ratio.
Beta Was this translation helpful? Give feedback.
All reactions