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

Function makeTriangle

tests/geom/intersects/TriangleToLine.test.js:13–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 // Helper: create a mock triangle with an axis-aligned right triangle
12 // vertices: (0,0), (100,0), (0,100)
13 function makeTriangle()
14 {
15 return {
16 contains: function (x, y)
17 {
18 // Inside if x>=0, y>=0, x+y<=100
19 return x >= 0 && y >= 0 && (x + y) <= 100;
20 },
21 getLineA: function () { return makeLine(0, 0, 100, 0); }, // bottom edge
22 getLineB: function () { return makeLine(100, 0, 0, 100); }, // hypotenuse
23 getLineC: function () { return makeLine(0, 100, 0, 0); } // left edge
24 };
25 }
26
27 it('should return true when the line starts inside the triangle', function ()
28 {

Callers 1

Calls 1

makeLineFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…