forked from Syomus/ProceduralToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntersectionRayRay2.cs
45 lines (40 loc) · 1.13 KB
/
IntersectionRayRay2.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using UnityEngine;
namespace ProceduralToolkit
{
public struct IntersectionRayRay2
{
public IntersectionType type;
public Vector2 pointA;
public Vector2 pointB;
public static IntersectionRayRay2 None()
{
return new IntersectionRayRay2 {type = IntersectionType.None};
}
public static IntersectionRayRay2 Point(Vector2 point)
{
return new IntersectionRayRay2
{
type = IntersectionType.Point,
pointA = point,
};
}
public static IntersectionRayRay2 Ray(Vector2 origin, Vector2 direction)
{
return new IntersectionRayRay2
{
type = IntersectionType.Ray,
pointA = origin,
pointB = direction,
};
}
public static IntersectionRayRay2 Segment(Vector2 pointA, Vector2 pointB)
{
return new IntersectionRayRay2
{
type = IntersectionType.Segment,
pointA = pointA,
pointB = pointB,
};
}
}
}