Collision: Polygons and Lines
Posted: Sun Feb 16, 2014 8:28 pm
Hi guys.
I'll cut to the chase, I'm not sure how to approach checking if lines intersect with polygons. I would like my game to have enemies with hitboxes made out of polygons (probably mostly rectangles and triangles) and also laser weapons which pass through enemies whilst dealing damage to them.
I figure that there are probably some great libraries already out there for this but I'm not sure which are most suited to this, and I'd kind of like to get a better understanding of how to perform these kind of checks for when I start tackling poly vs poly collision.
Any recommendations or explanations would be much appreciated!
I'll cut to the chase, I'm not sure how to approach checking if lines intersect with polygons. I would like my game to have enemies with hitboxes made out of polygons (probably mostly rectangles and triangles) and also laser weapons which pass through enemies whilst dealing damage to them.
I figure that there are probably some great libraries already out there for this but I'm not sure which are most suited to this, and I'd kind of like to get a better understanding of how to perform these kind of checks for when I start tackling poly vs poly collision.
Any recommendations or explanations would be much appreciated!