Looking for rotated, scaled box collisions
BlitzMax Forums/BlitzMax Programming/Looking for rotated, scaled box collisions
| ||
Hi, Looking for something pretty cool like this, or using vectors. Its for a shootemup, be nice to define a rectangle area then check collisions against its rotated and scaled state with other rects and circles. Does such a library exist? |
| ||
this? |
| ||
I converted this lib from BlitzBasic: name it :"npoly.bmx" below is the demo put both files in the same folder. |
| ||
Wow, nice! |
| ||
Wow perfect! really neat stuff thanks! |
| ||
it work perfectly! thanks |
| ||
Or grab my poly lib http://modules.indiepath.com |
| ||
I just found out that the bounding box check in Function nP_PolyOverlap() must be executed lately (and always at least one time, while the first bounding box check may be skipped with bCheckBounding = FALSE) to avoid wrongly detection of collisions if two sides of two non-overlapping polygons are parallel and within the same line. See the code sample (you have to bring two parallel sides of the two polygons in the same line while the polygons may not overlap): |