The code is in javascript, but I can explain further.
I've got a class that takes a bezier curve to be constructed from three coordinate pairs, it then calculates a series of points along it. Using these points a set of polar coordinates are generated relative to a central point (of the starting point, end point, and control point averaged together). The polar coordinates are used to check if a point fed into a collision checking function attached to the class is within the shape created by the bezier curve. I've got some strange behavior though, this red line that turns green when the cursor is inside of the outer blue curve. The blue curve should line up perfectly with the red/green curve, but it doesn't and I'm not sure why. The red through green dots show the area that returns true in the 'hitcheck' function for the curve.
I've got a repo, the important bit is at the bottom if anyone is familiar with this kind of thing.
https://github.com/Packmanager9/Bezier-Connection
I've got a class that takes a bezier curve to be constructed from three coordinate pairs, it then calculates a series of points along it. Using these points a set of polar coordinates are generated relative to a central point (of the starting point, end point, and control point averaged together). The polar coordinates are used to check if a point fed into a collision checking function attached to the class is within the shape created by the bezier curve. I've got some strange behavior though, this red line that turns green when the cursor is inside of the outer blue curve. The blue curve should line up perfectly with the red/green curve, but it doesn't and I'm not sure why. The red through green dots show the area that returns true in the 'hitcheck' function for the curve.
I've got a repo, the important bit is at the bottom if anyone is familiar with this kind of thing.
https://github.com/Packmanager9/Bezier-Connection