Type of the custom data property (optional, inferred automatically).
Line Constructor
Type of the custom data property (optional, inferred automatically).
Line properties
OptionaldataCustom data.
X start of the line.
X end of the line.
Y start of the line.
Y end of the line.
BetaDetermine which quadrant this line belongs to.
Quadtree node to be checked
Array containing indexes of intersecting subnodes (0-3 = top-right, top-left, bottom-left, bottom-right)
StaticintersectBetacheck if a line segment (the first 4 parameters) intersects an axis aligned rectangle (the last 4 parameters)
line start X
line start Y
line end X
line end Y
rectangle start X
rectangle start Y
rectangle end X
rectangle end Y
true if the line segment intersects the axis aligned rectangle
There is a bug where detection fails on corner intersections when the line enters/exits the node exactly at corners (45°) https://stackoverflow.com/a/18292964/860205
Class representing a Line
Example: Without custom data
Example: With custom data
Example: With custom data (TS)
Example: With custom class extending Line
Example: With custom class and mapping
Example: With custom object (implements LineGeometry)
Example: With custom object and mapping