diff options
| author | chai <215380520@qq.com> | 2024-05-19 16:05:58 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-19 16:05:58 +0800 |
| commit | 8e13e7e2874adc8982e16d1d2ed2e28d7480b45f (patch) | |
| tree | 63ef85c460288891f5a593d69afeca16cba050b3 /Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs | |
| parent | c5f145786f4c6d2fe4bea831dfc16e52228920a5 (diff) | |
+1.57
Diffstat (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs')
| -rw-r--r-- | Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs new file mode 100644 index 0000000..5c5de9e --- /dev/null +++ b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/LightweightVertex.cs @@ -0,0 +1,95 @@ +using Unity.Mathematics; +using UnityEngine; + +namespace NGS.MeshFusionPro; + +public struct LightweightVertex +{ + public float3 pos; + + public sbyte normX; + + public sbyte normY; + + public sbyte normZ; + + public sbyte normW; + + public sbyte tanX; + + public sbyte tanY; + + public sbyte tanZ; + + public sbyte tanW; + + public half2 uv; + + public half2 uv2; + + public Vector3 Position + { + get + { + return pos; + } + set + { + pos = value; + } + } + + public Vector3 Normal + { + get + { + return new Vector3((float)normX / 127f, (float)normY / 127f, (float)normZ / 127f); + } + set + { + normX = (sbyte)(value.x * 127f); + normY = (sbyte)(value.y * 127f); + normZ = (sbyte)(value.z * 127f); + normW = 1; + } + } + + public Vector4 Tangent + { + get + { + return new Vector4((float)tanX / 127f, (float)tanY / 127f, (float)tanZ / 127f, (float)tanW / 127f); + } + set + { + tanX = (sbyte)(value.x * 127f); + tanY = (sbyte)(value.y * 127f); + tanZ = (sbyte)(value.z * 127f); + tanW = (sbyte)(value.w * 127f); + } + } + + public Vector2 UV + { + get + { + return new Vector2(uv.x, uv.y); + } + set + { + uv = new half2((half)value.x, (half)value.y); + } + } + + public Vector2 UV2 + { + get + { + return new Vector2(uv2.x, uv2.y); + } + set + { + uv2 = new half2((half)value.x, (half)value.y); + } + } +} |
