Detecting collision between 2 rotated rectangles with limited parameters

by Noah Gerard   Last Updated May 16, 2019 00:13 AM

Are there any function that can detect collisions between 2 rotated rectangles in javascript with this kind of information:

r1 = {x:0,y:0,w:2,h:2,transformX:5,transformY:Y,rot:30}
r2 = {x:1,y:1,w:2,h:2,transformX:5,transformY:Y,rot:30}
//rot is degrees
function rectColliding(rect1,rect2){
  //Code
}

console.log(rectColliding(r1,r2))


Related Questions


Updated June 28, 2015 18:05 PM

Updated July 26, 2016 08:05 AM

Updated August 07, 2016 08:05 AM

Updated August 21, 2018 00:13 AM

Updated April 11, 2016 08:05 AM