-
Notifications
You must be signed in to change notification settings - Fork 1
/
CSGVertex.cs
43 lines (35 loc) · 1.01 KB
/
CSGVertex.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CSGV1
{
public partial class CSGVertex
{
public CSGVector pos { get; set; }
public CSGVector normal { get; set; }
public CSGVertex(CSGVector pos,CSGVector normal)
{
this.pos = pos;
this.normal = normal;
}
public CSGVertex(float[] pos,float[] normal)
{
this.pos = new CSGVector(pos);
this.normal = new CSGVector(normal);
}
public CSGVertex clone()
{
return new CSGVertex(this.pos.clone(), this.normal.clone());
}
public void flip()
{
this.normal = this.normal.negated();
}
public CSGVertex interpolate(CSGVertex other,float t)
{
return new CSGVertex(this.pos.lerp(other.pos, t), this.normal.lerp(other.normal, t));
}
}
}