forked from KhronosGroup/glTF-Asset-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeshPrimitive.cs
66 lines (58 loc) · 1.92 KB
/
MeshPrimitive.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System.Numerics;
using static glTFLoader.Schema.MeshPrimitive;
namespace AssetGenerator.Runtime
{
internal enum MeshPrimitiveMode
{
Points = ModeEnum.POINTS,
Lines = ModeEnum.LINES,
LineLoop = ModeEnum.LINE_LOOP,
LineStrip = ModeEnum.LINE_STRIP,
Triangles = ModeEnum.TRIANGLES,
TriangleStrip = ModeEnum.TRIANGLE_STRIP,
TriangleFan = ModeEnum.TRIANGLE_FAN,
}
internal class JointVector
{
public int Index0 { get; }
public int Index1 { get; }
public int Index2 { get; }
public int Index3 { get; }
public JointVector(int index0, int index1 = 0, int index2 = 0, int index3 = 0)
{
Index0 = index0;
Index1 = index1;
Index2 = index2;
Index3 = index3;
}
}
internal class WeightVector
{
public float Value0 { get; }
public float Value1 { get; }
public float Value2 { get; }
public float Value3 { get; }
public WeightVector(float value0, float value1 = 0.0f, float value2 = 0.0f, float value3 = 0.0f)
{
Value0 = value0;
Value1 = value1;
Value2 = value2;
Value3 = value3;
}
}
internal class MeshPrimitive
{
public Material Material { get; set; }
public MeshPrimitiveMode Mode { get; set; } = MeshPrimitiveMode.Triangles;
public Data<int> Indices { get; set; }
public bool? Interleave { get; set; }
public Data<Vector3> Positions { get; set; }
public Data<Vector3> Normals { get; set; }
public Data<Vector4> Tangents { get; set; }
public Data Colors { get; set; }
public Data<Vector2> TexCoords0 { get; set; }
public Data<Vector2> TexCoords1 { get; set; }
public Data<JointVector> Joints { get; set; }
public Data<WeightVector> Weights { get; set; }
}
}