From bf02233106a053bd31b9cff51af6c831626eadee Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Mon, 31 Aug 2020 17:00:55 -0400 Subject: [PATCH] Combine KCL materials that use unique IDs per every triangle. --- File_Format_Library/FileFormats/Collision/KCL.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/File_Format_Library/FileFormats/Collision/KCL.cs b/File_Format_Library/FileFormats/Collision/KCL.cs index 921d8434..7a73cd79 100644 --- a/File_Format_Library/FileFormats/Collision/KCL.cs +++ b/File_Format_Library/FileFormats/Collision/KCL.cs @@ -531,6 +531,19 @@ namespace FirstPlugin triangleList[prism.CollisionFlags].Add(triangle); } + //Triangle indexed + //It's not pratical to split materials up with these. + //Materials are instead handled seperately and need to be handled in another way. + if (triangleList.Count == model.Prisms.Length) + { + triangleList.Clear(); + triangleList.Add(0, new List()); + foreach (var prism in model.Prisms) + { + var triangle = model.GetTriangle(prism); + triangleList[0].Add(triangle); + } + } } Renderer.models.Clear();