diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 80296d00..2af03ca8 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 8ed6549c..3f9a447d 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 04039679..c6344270 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/BFRES/BfresStructs.cs b/Switch_FileFormatsMain/FileFormats/BFRES/BfresStructs.cs index c2d5d5d0..8b835e49 100644 --- a/Switch_FileFormatsMain/FileFormats/BFRES/BfresStructs.cs +++ b/Switch_FileFormatsMain/FileFormats/BFRES/BfresStructs.cs @@ -2201,15 +2201,6 @@ namespace Bfres.Structs } } } - public void TransformPosition(Vector3 Position, Vector3 Rotation, Vector3 Scale) - { - Matrix4 BonePosExtra = Utils.TransformValues(Position, Rotation, Scale); - foreach (Vertex v in vertices) - { - v.pos = Vector3.TransformPosition(v.pos, BonePosExtra); - v.nrm = Vector3.TransformNormal(v.pos, BonePosExtra); - } - } private void OpenMaterialEditor(object sender, EventArgs args) { FormLoader.LoadMatEditor(GetMaterial()); diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index c98dd42a..6987a444 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index e4dbdbbd..7602dde8 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs index 0b666ccf..7569b718 100644 --- a/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs +++ b/Switch_Toolbox_Library/FileFormats/Assimp/Assimp.cs @@ -418,6 +418,8 @@ namespace Switch_Toolbox.Library } public List GetVertices(Mesh msh, Matrix4 transform, STGenericObject STobj) { + Matrix4 NormalsTransform = Matrix4.CreateFromQuaternion(transform.ExtractRotation()); + List vertices = new List(); for (int v = 0; v < msh.VertexCount; v++) { @@ -426,7 +428,7 @@ namespace Switch_Toolbox.Library if (msh.HasVertices) vert.pos = Vector3.TransformPosition(AssimpHelper.FromVector(msh.Vertices[v]), transform); if (msh.HasNormals) - vert.nrm = Vector3.TransformNormal(AssimpHelper.FromVector(msh.Normals[v]), transform); + vert.nrm = Vector3.TransformNormal(AssimpHelper.FromVector(msh.Normals[v]), NormalsTransform); if (msh.HasTextureCoords(0)) vert.uv0 = new Vector2(msh.TextureCoordinateChannels[0][v].X, msh.TextureCoordinateChannels[0][v].Y); if (msh.HasTextureCoords(1)) diff --git a/Switch_Toolbox_Library/Generics/GenericObject.cs b/Switch_Toolbox_Library/Generics/GenericObject.cs index e40884e0..251ad4f6 100644 --- a/Switch_Toolbox_Library/Generics/GenericObject.cs +++ b/Switch_Toolbox_Library/Generics/GenericObject.cs @@ -172,9 +172,7 @@ namespace Switch_Toolbox.Library Matrix4 Transformation = (rotXMat * rotYMat * rotZMat) * positionMat; foreach (Vertex v in vertices) { - v.pos = Vector3.TransformPosition(v.pos, Transformation); - v.pos = Vector3.TransformPosition(v.pos, scaleMat); - + v.pos = Vector3.TransformPosition(v.pos, scaleMat * Transformation); v.nrm = Vector3.TransformNormal(v.nrm, Transformation); } }