vector_math.dart icon indicating copy to clipboard operation
vector_math.dart copied to clipboard

Polygon

Open spydon opened this issue 4 years ago • 4 comments

There are currently many shapes included in vector_math, but an important one is missing; the polygon. The general polygon is of course a bit tricky (expensive) to do collision detection on, but maybe only convex polygons could be supported for example?

This would be of tremendous help to us at Flame, which is one of the most popular packages using vector_math (even the most popular in terms of GitHub stars). We could help to implement it, if there are no resources that can be spared from your side, but in that case we'd need to come up with a clear plan together first.

Thanks for a great package!

spydon avatar Dec 21 '21 10:12 spydon

Any updates on providing polygon shape implemented in vector2_math?

shtse8 avatar Feb 24 '23 08:02 shtse8

@spydon What sort of API are you looking for? Hit testing? Collision detection?

johnmccutchan avatar Feb 24 '23 19:02 johnmccutchan

@johnmccutchan the more the better of course, but on par with the other shapes would be great.

spydon avatar Feb 24 '23 21:02 spydon

I would accept a Polygon contribution

johnmccutchan avatar Apr 24 '24 14:04 johnmccutchan