Checks if two Circles intersect.
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. 
true
if the two Circles intersect, otherwise false
.
Checks for intersection between a circle and a rectangle.
name  type  description 

circle  Phaser.Geom.Circle 
The circle to be checked. 
rect  Phaser.Geom.Rectangle 
The rectangle to be checked. 
true
if the two objects intersect, otherwise false
.
Checks if two Circles intersect and returns the intersection points as a Point object array.
name  type  arguments  description 

circleA  Phaser.Geom.Circle 
The first Circle to check for intersection. 

circleB  Phaser.Geom.Circle 
The second Circle to check for intersection. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks for intersection between a circle and a rectangle, and returns the intersection points as a Point object array.
name  type  arguments  description 

circle  Phaser.Geom.Circle 
The circle to be checked. 

rect  Phaser.Geom.Rectangle 
The rectangle to be checked. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks for intersection between the line segment and circle, and returns the intersection points as a Point object array.
name  type  arguments  description 

line  Phaser.Geom.Line 
The line segment to check. 

circle  Phaser.Geom.Circle 
The circle to check against the line. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks for intersection between the two line segments and returns the intersection point as a Vector3,
or null
if the lines are parallel, or do not intersect.
The z
property of the Vector3 contains the intersection distance, which can be used to find
the closest intersecting point from a group of line segments.
name  type  arguments  description 

line1  Phaser.Geom.Line 
The first line segment to check. 

line2  Phaser.Geom.Line 
The second line segment to check. 

out  Phaser.Math.Vector3  <optional> 
A Vector3 to store the intersection results in. 
A Vector3 containing the intersection results, or null
.
Checks for the closest point of intersection between a line segment and an array of points, where each pair of points are converted to line segments for the intersection tests.
If no intersection is found, this function returns null
.
If intersection was found, a Vector3 is returned with the following properties:
The x
and y
components contain the point of the intersection.
The z
component contains the closest distance.
name  type  arguments  description 

line  Phaser.Geom.Line 
The line segment to check. 

points  Array.<Phaser.Math.Vector2>  Array.<Phaser.Geom.Point> 
An array of points to check. 

out  Phaser.Math.Vector3  <optional> 
A Vector3 to store the intersection results in. 
A Vector3 containing the intersection results, or null
.
Checks for the closest point of intersection between a line segment and an array of polygons.
If no intersection is found, this function returns null
.
If intersection was found, a Vector4 is returned with the following properties:
The x
and y
components contain the point of the intersection.
The z
component contains the closest distance.
The w
component contains the index of the polygon, in the given array, that triggered the intersection.
name  type  arguments  description 

line  Phaser.Geom.Line 
The line segment to check. 

polygons  Phaser.Geom.Polygon  Array.<Phaser.Geom.Polygon> 
A single polygon, or array of polygons, to check. 

out  Phaser.Math.Vector4  <optional> 
A Vector4 to store the intersection results in. 
A Vector4 containing the intersection results, or null
.
Checks for intersection between the Line and a Rectangle shape, and returns the intersection points as a Point object array.
name  type  arguments  description 

line  Phaser.Geom.Line 
The Line to check for intersection. 

rect  object  Phaser.Geom.Rectangle 
The Rectangle to check for intersection. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Projects rays out from the given point to each line segment of the polygons.
If the rays intersect with the polygons, the points of intersection are returned in an array.
If no intersections are found, the returned array will be empty.
Each Vector4 intersection result has the following properties:
The x
and y
components contain the point of the intersection.
The z
component contains the angle of intersection.
The w
component contains the index of the polygon, in the given array, that triggered the intersection.
name  type  description 

x  number 
The x coordinate to project the rays from. 
y  number 
The y coordinate to project the rays from. 
polygons  Phaser.Geom.Polygon  Array.<Phaser.Geom.Polygon> 
A single polygon, or array of polygons, to check against the rays. 
An array containing all intersections in Vector4s.
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 intersection, it will be returned without any change.
name  type  arguments  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. 
A rectangle object with intersection data.
Checks if two Rectangles intersect and returns the intersection points as a Point object array.
A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle.
name  type  arguments  description 

rectA  Phaser.Geom.Rectangle 
The first Rectangle to check for intersection. 

rectB  Phaser.Geom.Rectangle 
The second Rectangle to check for intersection. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks for intersection between Rectangle shape and Triangle shape, and returns the intersection points as a Point object array.
name  type  arguments  description 

rect  Phaser.Geom.Rectangle 
Rectangle object to test. 

triangle  Phaser.Geom.Triangle 
Triangle object to test. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array.
A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection.
name  type  arguments  description 

triangle  Phaser.Geom.Triangle 
The Triangle to check for intersection. 

circle  Phaser.Geom.Circle 
The Circle to check for intersection. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array.
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".
name  type  arguments  description 

triangle  Phaser.Geom.Triangle 
The Triangle to check with. 

line  Phaser.Geom.Line 
The Line to check with. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks if two Triangles intersect, and returns the intersection points as a Point object array.
A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid".
name  type  arguments  description 

triangleA  Phaser.Geom.Triangle 
The first Triangle to check for intersection. 

triangleB  Phaser.Geom.Triangle 
The second Triangle to check for intersection. 

out  array  <optional> 
An optional array in which to store the points of intersection. 
An array with the points of intersection if objects intersect, otherwise an empty array.
Checks for intersection between the line segment and circle.
Based on code by Matt DesLauriers.
name  type  arguments  description 

line  Phaser.Geom.Line 
The line segment to check. 

circle  Phaser.Geom.Circle 
The circle to check against the line. 

nearest  any  Phaser.Geom.Point  <optional> 
An optional Pointlike object. If given the closest point on the Line where the circle intersects will be stored in this object. 
true
if the two objects intersect, otherwise false
.
Checks if two Lines intersect. If the Lines are identical, they will be treated as parallel and thus nonintersecting.
name  type  arguments  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. 
true
if the two Lines intersect, and the out
object will be populated, if given. Otherwise, false
.
Checks for intersection between the Line and a Rectangle shape, or a rectanglelike
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'.
name  type  description 

line  Phaser.Geom.Line 
The Line to check for intersection. 
rect  object  Phaser.Geom.Rectangle 
The Rectangle to check for intersection. 
true
if the Line and the Rectangle intersect, false
otherwise.
Checks if the a Point falls between the two endpoints of a Line, based on the given line thickness.
Assumes that the line end points are circular, not square.
name  type  arguments  Default  description 

point  any  Phaser.Geom.Point 
The point, or pointlike object to check. 

line  Phaser.Geom.Line 
The line segment to test for intersection on. 

lineThickness  number  <optional>  1 
The line thickness. Assumes that the line end points are circular. 
true
if the Point falls on the Line, otherwise false
.
Checks if a Point is located on the given line segment.
name  type  description 

point  Phaser.Geom.Point 
The Point to check for intersection. 
line  Phaser.Geom.Line 
The line segment to check for intersection. 
true
if the Point is on the given line segment, otherwise false
.
Checks if two Rectangles intersect.
A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle.
name  type  description 

rectA  Phaser.Geom.Rectangle 
The first Rectangle to check for intersection. 
rectB  Phaser.Geom.Rectangle 
The second Rectangle to check for intersection. 
true
if the two Rectangles intersect, otherwise false
.
Checks for intersection between Rectangle shape and Triangle shape.
name  type  description 

rect  Phaser.Geom.Rectangle 
Rectangle object to test. 
triangle  Phaser.Geom.Triangle 
Triangle object to test. 
A value of true
if objects intersect; otherwise false
.
Check if rectangle intersects with values.
name  type  arguments  description 

rect  Phaser.Geom.Rectangle 
The rectangle object 

left  number 
The x coordinate of the left of the Rectangle. 

right  number 
The x coordinate of the right of the Rectangle. 

top  number 
The y coordinate of the top of the Rectangle. 

bottom  number 
The y coordinate of the bottom of the Rectangle. 

tolerance  number  <optional> 
Tolerance allowed in the calculation, expressed in pixels. 
Returns true if there is an intersection.
Checks if a Triangle and a Circle intersect.
A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection.
name  type  description 

triangle  Phaser.Geom.Triangle 
The Triangle to check for intersection. 
circle  Phaser.Geom.Circle 
The Circle to check for intersection. 
true
if the Triangle and the Circle
intersect, otherwise false
.
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".
name  type  description 

triangle  Phaser.Geom.Triangle 
The Triangle to check with. 
line  Phaser.Geom.Line 
The Line to check with. 
true
if the Triangle and the Line intersect, otherwise false
.
Checks if two Triangles intersect.
A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid".
name  type  description 

triangleA  Phaser.Geom.Triangle 
The first Triangle to check for intersection. 
triangleB  Phaser.Geom.Triangle 
The second Triangle to check for intersection. 
true
if the Triangles intersect, otherwise false
.