forked from BitcoderCZ/BuildPlate_Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vertex.cs
34 lines (29 loc) · 850 Bytes
/
Vertex.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
using OpenTK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace BuildPlate_Editor
{
[StructLayout(LayoutKind.Sequential)]
public struct Vertex
{
public const int Size = 6 * sizeof(float);
public Vector3 position;
public Vector3 uv;
public Vertex(Vector3 _pos, Vector2 _uv, uint _id)
{
position = _pos;
uv = new Vector3(_uv.X, _uv.Y, (float)_id - 1f);
}
public Vertex(float x, float y, float z, float u, float v, uint _id)
{
position = new Vector3(x, y, z);
uv = new Vector3(u, v, (float)_id - 1f);
}
public Vertex(float x, float y, float z) : this(x, y, z, 0f, 0f, 1)
{ }
}
}