Skip to content

line_in_rectangle_rotated_all

Vašek edited this page Feb 10, 2019 · 3 revisions

line_in_rectangle_rotated_all

Returns a list of all the positions where the given line intersects the given rectangle

Syntax:

line_in_rectangle_rotated_all(p1, p2, r)
Argument Description
Vector2 p1 The first position of the given line
Vector2 p2 The other position of the given line
RotatedRectangle r The given rectangle

Returns: list <Vector2>

Description:

This function returns a list of all positions - in Vector2 format - where the given line intersects the given rectangle.

Example:

Vector2 p1 = new Vector2(8, 8);
Vector2 p2 = new Vector2(8, 24);
Vector2 p3 = new Vector2(24, 24);
Vector2 p4 = new Vector2(24, 8);
RotatedRectangle r = new RotatedRectangle(p1, p2, p3, p4);

list = line_in_rectangle_rotated_all(new Vector2(0, 0), new Vector2(64, 64), r);

This function will save positions: 8, 8 and 24, 24 to list.

Back to number_functions

Clone this wiki locally