forked from WolvenKit/WolvenKit-7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MeshData.cs
85 lines (66 loc) · 2.13 KB
/
MeshData.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System.Collections.Generic;
using IrrlichtLime.Core;
namespace WolvenKit.Render
{
public class SBufferInfos
{
public uint vertexBufferOffset = 0;
public uint vertexBufferSize = 0;
public uint indexBufferOffset = 0;
public uint indexBufferSize = 0;
public Vector3Df quantizationScale = new Vector3Df(1, 1, 1);
public Vector3Df quantizationOffset = new Vector3Df(0, 0, 0);
public List<SVertexBufferInfos> verticesBuffer = new List<SVertexBufferInfos>();
}
// Informations about the .buffer file
public class SVertexBufferInfos
{
public uint verticesCoordsOffset = 0;
public uint uvOffset = 0;
public uint normalsOffset = 0;
public uint indicesOffset = 0;
public ushort nbVertices = 0;
public uint nbIndices = 0;
public byte materialID = 0;
public byte lod = 1;
}
// Information to load a mesh from the buffer
public class SMeshInfos
{
public enum EMeshVertexType
{
EMVT_STATIC,
EMVT_SKINNED
};
public uint numVertices = 0;
public uint numIndices = 0;
public uint numBonesPerVertex = 4;
public uint firstVertex = 0;
public uint firstIndex = 0;
public EMeshVertexType vertexType = EMeshVertexType.EMVT_STATIC;
public uint materialID = 0;
}
public class W3_DataCache
{
public class VertexSkinningEntry
{
public uint boneId = 0;
public ushort meshBufferId = 0;
public uint vertexId = 0;
public float strength = 0;
}
public class BoneEntry
{
public string name = "";
public Matrix offsetMatrix = new Matrix();
}
public List<VertexSkinningEntry> vertices = new List<VertexSkinningEntry>();
public List<BoneEntry> bones = new List<BoneEntry>();
}
public class BoneData
{
public uint nbBones = 0;
public List<string> jointNames = new List<string>();
public List<Matrix> boneMatrices = new List<Matrix>();
}
}