Open DragoniteSpam opened 9 months ago
+1.
It'd also be nice to have a more-generic _collisionpolygon and _collision_polygonlist as well, that would take an array of points, have an optional concave solver (it's waaaay more expensive) and provide a useful error if the resultant polygon crosses line segments.
Is your feature request related to a problem?
Currently we have collision overlap functions for circles, ellipses, lines, points, and rectangles, plus _list functions to go with them. One shape that's notably missing is the triangle, not counting the
point_in_triangle
andrectangle_in_triangle
functions. These would be useful to have for things like attacks that hit in a fan or view cones.Describe the solution you'd like
collision_triangle
andcollision_triangle_list
Describe alternatives you've considered
Creating a triangle-shaped sprite and doing precise collision checks on it
Additional context
You can use point_direction or dot products to do view cones but most people who aren't mathy probably won't think about that and, in any case, collision_triangle_list would be one line of code vs like ten or twenty you'd need to filter for objects if you did it yourself