MCPcopy Create free account
hub / github.com/phaserjs/phaser / GetRectangleToTriangle

Function GetRectangleToTriangle

src/geom/intersects/GetRectangleToTriangle.js:24–40  ·  view source on GitHub ↗
(rect, triangle, out)

Source from the content-addressed store, hash-verified

22 * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.
23 */
24var GetRectangleToTriangle = function (rect, triangle, out)
25{
26 if (out === undefined) { out = []; }
27
28 if (RectangleToTriangle(rect, triangle))
29 {
30 var lineA = triangle.getLineA();
31 var lineB = triangle.getLineB();
32 var lineC = triangle.getLineC();
33
34 GetLineToRectangle(lineA, rect, out);
35 GetLineToRectangle(lineB, rect, out);
36 GetLineToRectangle(lineC, rect, out);
37 }
38
39 return out;
40};
41
42module.exports = GetRectangleToTriangle;

Callers 1

Calls 2

RectangleToTriangleFunction · 0.85
GetLineToRectangleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…