Skip to content

triangle_in_triangle_all

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

triangle_in_triangle_all

Returns a list of all the positions where the given triangles intersect

Syntax:

triangle_in_triangle_all(t1, t2)
Argument Description
Triangle t1 The first triangle
Triangle t2 The other triangle

Returns: list <Vector2>

Description:

This function returns a list of all positions - in Vector2 format - where the given triangles intersect.

Example:

List<Vector2> list = new List<Vector2>();

Vector2 p1t1 = new Vector2(0, 0);
Vector2 p2t1 = new Vector2(0, 16);
Vector2 p3t1 = new Vector2(16, 16);
Triangle t1 = new Triangle(p1t1, p2t1, p3t1);

Vector2 p1t2 = new Vector2(16, 16);
Vector2 p2t2 = new Vector2(32, 32);
Vector2 p3t2 = new Vector2(32, 16);
Triangle t2 = new Triangle(p1t2, p2t2, p3t2);

list = triangle_in_triangle_all(t1, t2);

This function will save position 16, 16 to list.

Back to Raycasting

Clone this wiki locally