(rectA, rectB, out)
| 23 | * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array. |
| 24 | */ |
| 25 | var GetRectangleToRectangle = function (rectA, rectB, out) |
| 26 | { |
| 27 | if (out === undefined) { out = []; } |
| 28 | |
| 29 | if (RectangleToRectangle(rectA, rectB)) |
| 30 | { |
| 31 | var lineA = rectA.getLineA(); |
| 32 | var lineB = rectA.getLineB(); |
| 33 | var lineC = rectA.getLineC(); |
| 34 | var lineD = rectA.getLineD(); |
| 35 | |
| 36 | GetLineToRectangle(lineA, rectB, out); |
| 37 | GetLineToRectangle(lineB, rectB, out); |
| 38 | GetLineToRectangle(lineC, rectB, out); |
| 39 | GetLineToRectangle(lineD, rectB, out); |
| 40 | } |
| 41 | |
| 42 | return out; |
| 43 | }; |
| 44 | |
| 45 | module.exports = GetRectangleToRectangle; |
no test coverage detected
searching dependent graphs…