49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Parabox.CSG
|
|
{
|
|
// Token: 0x0200001B RID: 27
|
|
internal struct CSG_Vertex
|
|
{
|
|
// Token: 0x060000BF RID: 191 RVA: 0x0000E00B File Offset: 0x0000C40B
|
|
public CSG_Vertex(Vector3 position, Vector3 normal, Vector2 uv, Color color)
|
|
{
|
|
this.position = position;
|
|
this.normal = normal;
|
|
this.uv = uv;
|
|
this.color = color;
|
|
}
|
|
|
|
// Token: 0x060000C0 RID: 192 RVA: 0x0000E02A File Offset: 0x0000C42A
|
|
public void Flip()
|
|
{
|
|
this.normal *= -1f;
|
|
}
|
|
|
|
// Token: 0x060000C1 RID: 193 RVA: 0x0000E044 File Offset: 0x0000C444
|
|
public static CSG_Vertex Interpolate(CSG_Vertex a, CSG_Vertex b, float t)
|
|
{
|
|
return new CSG_Vertex
|
|
{
|
|
position = Vector3.Lerp(a.position, b.position, t),
|
|
normal = Vector3.Lerp(a.normal, b.normal, t),
|
|
uv = Vector2.Lerp(a.uv, b.uv, t),
|
|
color = (a.color + b.color) / 2f
|
|
};
|
|
}
|
|
|
|
// Token: 0x0400003F RID: 63
|
|
public Vector3 position;
|
|
|
|
// Token: 0x04000040 RID: 64
|
|
public Color color;
|
|
|
|
// Token: 0x04000041 RID: 65
|
|
public Vector3 normal;
|
|
|
|
// Token: 0x04000042 RID: 66
|
|
public Vector2 uv;
|
|
}
|
|
}
|