Namespace: Intersects

Phaser.Geom. Intersects

Methods


<static> CircleToCircle(circleA, circleB)

Checks if two Circles intersect.

Parameters:
Name Type Description
circleA Phaser.Geom.Circle

The first Circle to check for intersection.

circleB Phaser.Geom.Circle

The second Circle to check for intersection.

Since: 3.0.0
Source: src/geom/intersects/CircleToCircle.js (Line 9)
Returns:

true if the two Circles intersect, otherwise false.

Type
boolean

<static> CircleToRectangle(circle, rect)

[description]

Parameters:
Name Type Description
circle Phaser.Geom.Circle

[description]

rect Phaser.Geom.Rectangle

[description]

Since: 3.0.0
Source: src/geom/intersects/CircleToRectangle.js (Line 7)
Returns:

[description]

Type
boolean

<static> GetRectangleIntersection(rectA, rectB [, output])

Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object.

If optional output parameter is omitted, new Rectangle object is created and returned. If there is intersection, it will contain intersection area. If there is no intersection, it wil be empty Rectangle (all values set to zero).

If Rectangle object is passed as output and there is intersection, then intersection area data will be loaded into it and it will be returned. If there is no intersetion, it will be returned without any change.

Parameters:
Name Type Argument Description
rectA Phaser.Geom.Rectangle

The first Rectangle object.

rectB Phaser.Geom.Rectangle

The second Rectangle object.

output Phaser.Geom.Rectangle <optional>

Optional Rectangle object. If given, the intersection data will be loaded into it (in case of no intersection, it will be left unchanged). Otherwise, new Rectangle object will be created and returned with either intersection data or empty (all values set to zero), if there is no intersection.

Since: 3.0.0
Source: src/geom/intersects/GetRectangleIntersection.js (Line 10)
Returns:

A rectangle object with intersection data.

Type
Phaser.Geom.Rectangle

<static> LineToCircle(line, circle [, nearest])

[description]

Parameters:
Name Type Argument Description
line Phaser.Geom.Line

[description]

circle Phaser.Geom.Circle

[description]

nearest Phaser.Geom.Point <optional>

[description]

Since: 3.0.0
Source: src/geom/intersects/LineToCircle.js (Line 15)
Returns:

[description]

Type
boolean

<static> LineToLine(line1, line2 [, out])

Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus non-intersecting.

Parameters:
Name Type Argument Description
line1 Phaser.Geom.Line

The first Line to check.

line2 Phaser.Geom.Line

The second Line to check.

out Phaser.Geom.Point <optional>

A Point in which to optionally store the point of intersection.

Since: 3.0.0
Source: src/geom/intersects/LineToLine.js (Line 12)
Returns:

true if the two Lines intersect, and the out object will be populated, if given. Otherwise, false.

Type
boolean

<static> LineToRectangle(line, rect)

Checks for intersection between the Line and a Rectangle shape, or a rectangle-like
object, with public x, y, right and bottom properties, such as a Sprite or Body.

An intersection is considered valid if:

The line starts within, or ends within, the Rectangle.
The line segment intersects one of the 4 rectangle edges.

The for the purposes of this function rectangles are considered 'solid'.

Parameters:
Name Type Description
line Phaser.Geom.Line

[description]

rect Phaser.Geom.Rectangle | object

[description]

Since: 3.0.0
Source: src/geom/intersects/LineToRectangle.js (Line 7)
Returns:

[description]

Type
boolean

<static> PointToLine(point, line)

[description]

Parameters:
Name Type Description
point Phaser.Geom.Point

[description]

line Phaser.Geom.Line

[description]

Since: 3.0.0
Source: src/geom/intersects/PointToLine.js (Line 7)
Returns:

[description]

Type
boolean

<static> PointToLineSegment(point, line)

[description]

Parameters:
Name Type Description
point Phaser.Geom.Point

[description]

line Phaser.Geom.Line

[description]

Since: 3.0.0
Source: src/geom/intersects/PointToLineSegment.js (Line 9)
Returns:

[description]

Type
boolean

<static> RectangleToRectangle(rectA, rectB)

[description]

Parameters:
Name Type Description
rectA Phaser.Geom.Rectangle

[description]

rectB Phaser.Geom.Rectangle

[description]

Since: 3.0.0
Source: src/geom/intersects/RectangleToRectangle.js (Line 7)
Returns:

[description]

Type
boolean

<static> RectangleToTriangle(rect, triangle)

Checks for intersection between Rectangle shape and Triangle shape.

Parameters:
Name Type Description
rect Phaser.Geom.Rectangle

Rectangle object to test.

triangle Phaser.Geom.Triangle

Triangle object to test.

Since: 3.0.0
Source: src/geom/intersects/RectangleToTriangle.js (Line 12)
Returns:

A value of true if objects intersect; otherwise false.

Type
boolean

<static> RectangleToValues(rect, left, right, top, bottom [, tolerance])

[description]

Parameters:
Name Type Argument Default Description
rect Phaser.Geom.Rectangle

[description]

left number

[description]

right number

[description]

top number

[description]

bottom number

[description]

tolerance number <optional>
0

[description]

Since: 3.0.0
Source: src/geom/intersects/RectangleToValues.js (Line 7)
Returns:

[description]

Type
boolean

<static> TriangleToCircle(triangle, circle)

[description]

Parameters:
Name Type Description
triangle Phaser.Geom.Triangle

[description]

circle Phaser.Geom.Circle

[description]

Since: 3.0.0
Source: src/geom/intersects/TriangleToCircle.js (Line 10)
Returns:

[description]

Type
boolean

<static> TriangleToLine(triangle, line)

Checks if a Triangle and a Line intersect.

The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid".

Parameters:
Name Type Description
triangle Phaser.Geom.Triangle

The Triangle to check with.

line Phaser.Geom.Line

The Line to check with.

Since: 3.0.0
Source: src/geom/intersects/TriangleToLine.js (Line 10)
Returns:

true if the Triangle and the Line intersect, otherwise false.

Type
boolean

<static> TriangleToTriangle(triangleA, triangleB)

[description]

Parameters:
Name Type Description
triangleA Phaser.Geom.Triangle

[description]

triangleB Phaser.Geom.Triangle

[description]

Since: 3.0.0
Source: src/geom/intersects/TriangleToTriangle.js (Line 11)
Returns:

[description]

Type
boolean