Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Geometry Class Reference

Geometry intersection functions. More...

Public Member Functions

array Triangulate (array polygon, array holes)
 Triangulates a 2D polygon.
array Intersect (array subjects, array clips, GeoBooleanOp booleanOp=< ref GeoBooleanOp_Intersection >, GeoFillRule fillRule=< ref GeoFillRule_EvenOdd >)
 Intersects a 2D polygon.
boolean IsPointInsidePolygon (array polygon, decimal pointX, decimal pointY)
 Checks if a point is inside a polygon.
boolean IsLineIntersectingPolygon (array polygon, decimal x1, decimal y1, decimal x2, decimal y2)
 Checks if a line segment is intersecting a polygon.

Detailed Description

Geometry intersection functions.

Member Function Documentation

◆ Intersect()

array Geometry.Intersect ( array subjects,
array clips,
GeoBooleanOp booleanOp = < ref GeoBooleanOp_Intersection >,
GeoFillRule fillRule = < ref GeoFillRule_EvenOdd > )

Intersects a 2D polygon.

Parameters
subjectsArray of subject polygons.
clipsArray of clip polygons.
booleanOpThe boolean operation.
fillRuleThe fill rule.
Returns
Returns an array containing a list of intersected polygons, or null if the polygon could not be intersected.

◆ IsLineIntersectingPolygon()

boolean Geometry.IsLineIntersectingPolygon ( array polygon,
decimal x1,
decimal y1,
decimal x2,
decimal y2 )

Checks if a line segment is intersecting a polygon.

Parameters
polygonThe polygon to check.
x1The starting X of the segment.
y1The starting Y of the segment.
x2The ending X of the segment.
y2The ending Y of the segment.
Returns
Returns whether the line segment is intersecting the polygon.

◆ IsPointInsidePolygon()

boolean Geometry.IsPointInsidePolygon ( array polygon,
decimal pointX,
decimal pointY )

Checks if a point is inside a polygon.

Parameters
polygonThe polygon.
pointXThe X of the point.
pointYThe Y of the point.
Returns
Returns whether the point is inside.

◆ Triangulate()

array Geometry.Triangulate ( array polygon,
array holes )

Triangulates a 2D polygon.

Parameters
polygonArray of vertices that compromise the polygon to triangulate.
holesArray of polygons that compromise the holes to be made in the resulting shape.
Returns
Returns an array containing a list of triangles, or null if the polygon could not be triangulated.