diff --git a/Kav b/Kav index 4c41506..da52273 160000 --- a/Kav +++ b/Kav @@ -1 +1 @@ -Subproject commit 4c4150620456c6625cf660d7a81571e4b1f7f9d5 +Subproject commit da52273dd0e9d67e7838d0d0e76e7154a675d95f diff --git a/KavTest/KavTestGame.cs b/KavTest/KavTestGame.cs index c6925d7..bc18d9b 100644 --- a/KavTest/KavTestGame.cs +++ b/KavTest/KavTestGame.cs @@ -31,7 +31,7 @@ namespace KavTest protected override void LoadContent() { - var rustyBallModel = ModelLoader.Load( + var rustyBallModel = Kav.ModelLoader.Load( GraphicsDevice, Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/rustysphere.glb")) ); diff --git a/KavTest/Utility/ModelLoader.cs b/KavTest/Utility/ModelLoader.cs deleted file mode 100644 index 629e3c4..0000000 --- a/KavTest/Utility/ModelLoader.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections.Generic; -using Microsoft.Xna.Framework.Graphics; - -namespace KavTest -{ - public static class ModelLoader - { - public static Kav.Model Load(GraphicsDevice graphicsDevice, Smuggler.ModelData modelData) - { - var meshes = new List(); - - foreach (var meshData in modelData.Meshes) - { - var meshParts = new List(); - - foreach (var meshPartData in meshData.MeshParts) - { - var effect = new Kav.PBREffect( - graphicsDevice - ) - { - Albedo = meshPartData.Albedo, - Metallic = meshPartData.Metallic, - Roughness = meshPartData.Roughness, - - AlbedoTexture = meshPartData.AlbedoTexture, - NormalTexture = meshPartData.NormalTexture, - MetallicRoughnessTexture = meshPartData.MetallicRoughnessTexture - }; - - var triangles = new Kav.Triangle[meshPartData.Triangles.Length]; - for (int i = 0; i < meshPartData.Triangles.Length; i++) - { - var smugglerTriangle = meshPartData.Triangles[i]; - - triangles[i] = new Kav.Triangle( - smugglerTriangle.A, - smugglerTriangle.B, - smugglerTriangle.C - ); - } - - meshParts.Add(new Kav.MeshPart( - meshPartData.VertexBuffer, - meshPartData.IndexBuffer, - meshPartData.Positions, - triangles, - effect - )); - } - - meshes.Add(new Kav.Mesh(meshParts.ToArray())); - } - - return new Kav.Model(meshes.ToArray()); - } - } -}