-
-
Notifications
You must be signed in to change notification settings - Fork 235
/
Copy pathIntersectionSphereSphere.cs
47 lines (42 loc) · 1.24 KB
/
IntersectionSphereSphere.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
46
47
using UnityEngine;
namespace ProceduralToolkit
{
public struct IntersectionSphereSphere
{
public IntersectionType type;
public Vector3 point;
public Vector3 normal;
public float radius;
public static IntersectionSphereSphere None()
{
return new IntersectionSphereSphere {type = IntersectionType.None};
}
public static IntersectionSphereSphere Point(Vector3 point)
{
return new IntersectionSphereSphere
{
type = IntersectionType.Point,
point = point,
};
}
public static IntersectionSphereSphere Circle(Vector3 center, Vector3 normal, float radius)
{
return new IntersectionSphereSphere
{
type = IntersectionType.Circle,
point = center,
normal = normal,
radius = radius,
};
}
public static IntersectionSphereSphere Sphere(Vector3 center, float radius)
{
return new IntersectionSphereSphere
{
type = IntersectionType.Sphere,
point = center,
radius = radius,
};
}
}
}