farhan
March 8, 2022, 12:17am
1
Does Phaser 3 have a math function to check a collision between a point and an arc?
I only know how to check a point collision with a circle which is by checking it’s distance to the circle center.
But now sure how to detect witn an arc. I tried Google but cannot find any.
Or can I use the Phase Arc polygon and check collision detection against a point? How would I do that?
If there is a simple math calculation that would be better.
Thanks.
If you go with generating your arc with polygon, you can probably use the Phaser.Geom. Polygon.ContainsPoint .
farhan
March 8, 2022, 10:01pm
3
Thanks, but that will be a triangle (unless if I just add more points).
But, yes that can be an alternative solution.
I’m still figuring out if there is a feature in Phaser 3 I can use for an arc.
I believe, matterjs could work. But I’m trying to avoid using physics.
samme
March 9, 2022, 1:54am
4
I don’t think so, because there’s no Phaser.Geom.Arc
class.
I’m sure there’s an algorithm for this somewhere.
farhan
March 10, 2022, 7:52pm
5
Thanks. I was just wondering if there were something in Phaser 3 engine I can use. Since there is none, then I will just use my own maths calculations. Thanks.