-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlane.cs
More file actions
37 lines (32 loc) · 772 Bytes
/
Plane.cs
File metadata and controls
37 lines (32 loc) · 772 Bytes
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Plane
{
public Coords A;
Coords B;
Coords C;
public Coords v;
public Coords u;
public Plane(Coords _A, Coords _B, Coords _C)
{
A = _A;
B = _B;
C = _C;
v = B - A;
u = C - A;
}
public Plane(Coords _A, Vector3 V, Vector3 U)
{
A = _A;
v = new Coords(V.x, V.y, V.z);
u = new Coords(U.x, U.y, U.z);
}
public Coords Lerp(float s, float t)
{
float xst = A.x + v.x * s + u.x * t;
float yst = A.y + v.y * s + u.y * t;
float zst = A.z + v.z * s + u.z * t;
return new Coords(xst, yst, zst);
}
}