Looking for rotated, scaled box collisions

BlitzMax Forums/BlitzMax Programming/Looking for rotated, scaled box collisions

Robert Cummings(Posted 2007) [#1]
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?


tonyg(Posted 2007) [#2]
this?


Jesse(Posted 2007) [#3]
I converted this lib from BlitzBasic:
name it :"npoly.bmx"



below is the demo
put both files in the same folder.




BlitzSupport(Posted 2007) [#4]
Wow, nice!


Robert Cummings(Posted 2007) [#5]
Wow perfect! really neat stuff thanks!


mongia2(Posted 2007) [#6]
it work perfectly!
thanks


TartanTangerine (was Indiepath)(Posted 2007) [#7]
Or grab my poly lib http://modules.indiepath.com


xMicky(Posted 2007) [#8]
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):