What do the parameters of Shape:testPoint do?
Posted: Sat Nov 12, 2022 6:21 pm
Hello,
I'm implementing basic mouse click overlap for (convex) polygons. I have the polygon, now I just need to understand how to use testPoint(). The docs don't do an adequate job of explaining how exactly to use testPoint - what do the t- parameters do? Could someone provide the most basic example of what each of the parameters is for and how to use them? There's no example in the docs, searching the forums and Stack Overflow yielded nada.
If you need an example, let's say that my polygon is:
p = love.physics.newPolygonShape(30, 30, 30, 60, 75, 75, 75, 30)
And it's smack in the middle of a 200 by 300 window.
My mouse point is at 40, 40 (which is an overlap).
Thanks so much!
I'm implementing basic mouse click overlap for (convex) polygons. I have the polygon, now I just need to understand how to use testPoint(). The docs don't do an adequate job of explaining how exactly to use testPoint - what do the t- parameters do? Could someone provide the most basic example of what each of the parameters is for and how to use them? There's no example in the docs, searching the forums and Stack Overflow yielded nada.
If you need an example, let's say that my polygon is:
p = love.physics.newPolygonShape(30, 30, 30, 60, 75, 75, 75, 30)
And it's smack in the middle of a 200 by 300 window.
My mouse point is at 40, 40 (which is an overlap).
Thanks so much!