diff --git a/project/code/TMV/MeshSurfaceData.cs b/project/code/TMV/MeshSurfaceData.cs index f738a23..dcdba98 100644 --- a/project/code/TMV/MeshSurfaceData.cs +++ b/project/code/TMV/MeshSurfaceData.cs @@ -12,19 +12,19 @@ public class MeshSurfaceData private readonly List _vertices = new(); private readonly List _normals = new(); private readonly List _indices = new(); - private readonly List _textureUvs = new(); - private readonly List _lightmapUvs = new(); + private readonly List _uv1s = new(); + private readonly List _uv2s = new(); public MeshSurfaceData() { Empty = true; } - public void TransformLightmapUvs(int start, int end, Func f) + public void TransformUv2s(int start, int end, Func f) { for (var i = start; i < end; i++) { - _lightmapUvs[i] = f(_lightmapUvs[i]); + _uv2s[i] = f(_uv2s[i]); } } @@ -32,8 +32,8 @@ public class MeshSurfaceData public (int, int) AddPolygon( List vertices, Vector3 normal, - List textureUvs, - List lightmapUvs) + List uv1s, + List uv2s) { Empty = false; @@ -54,11 +54,11 @@ public class MeshSurfaceData _indices.Add(indexOffset + j + 1); } - _textureUvs.AddRange(textureUvs); - _lightmapUvs.AddRange(lightmapUvs); + _uv1s.AddRange(uv1s); + _uv2s.AddRange(uv2s); - var end = _lightmapUvs.Count; - var start = end - lightmapUvs.Count; + var end = _uv2s.Count; + var start = end - uv2s.Count; return (start, end); } @@ -69,8 +69,8 @@ public class MeshSurfaceData array[(int)Mesh.ArrayType.Vertex] = _vertices.ToArray(); array[(int)Mesh.ArrayType.Normal] = _normals.ToArray(); array[(int)Mesh.ArrayType.Index] = _indices.ToArray(); - array[(int)Mesh.ArrayType.TexUV] = _textureUvs.ToArray(); - array[(int)Mesh.ArrayType.TexUV2] = _lightmapUvs.ToArray(); + array[(int)Mesh.ArrayType.TexUV] = _uv1s.ToArray(); + array[(int)Mesh.ArrayType.TexUV2] = _uv2s.ToArray(); return array; } diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index 27b631f..96860b1 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -229,7 +229,7 @@ public partial class Mission : Node3D } if (!surfaceDataMap.ContainsKey(info.textureId)) GD.Print("Invalid SurfaceDataMap key"); - surfaceDataMap[info.textureId].TransformLightmapUvs(info.uvStart, info.uvEnd, (uv) => + surfaceDataMap[info.textureId].TransformUv2s(info.uvStart, info.uvEnd, (uv) => { var u = uv.X; var v = uv.Y;