diff --git a/src/Libraries/MeshCompiler.hpp b/src/Libraries/MeshCompiler.hpp index 4e84949..f20b8ea 100644 --- a/src/Libraries/MeshCompiler.hpp +++ b/src/Libraries/MeshCompiler.hpp @@ -99,20 +99,8 @@ namespace SH_COMP try { - std::vectorweights; - std::vectorjoints; - FetchData(primitive.attributes.at(ATT_WEIGHTS.data()), weights); - FetchData(primitive.attributes.at(ATT_JOINT.data()), joints); - meshIn.weights.resize(weights.size()); - std::ranges::transform( - weights, - joints, - meshIn.weights.begin(), - [](SHVec4 const& weights, SHVec4i const& joints) ->VertexWeights - { - return { weights, joints }; - } - ); + FetchData(primitive.attributes.at(ATT_WEIGHTS.data()), meshIn.weights); + FetchData(primitive.attributes.at(ATT_JOINT.data()), meshIn.joints); std::cout << "hi\n"; } diff --git a/src/Libraries/MeshWriter.cpp b/src/Libraries/MeshWriter.cpp index 54ef691..a48295b 100644 --- a/src/Libraries/MeshWriter.cpp +++ b/src/Libraries/MeshWriter.cpp @@ -58,10 +58,16 @@ namespace SH_COMP ); if (header.hasWeights) - file.write( - reinterpret_cast(asset.weights.data()), - sizeof(VertexWeights) * header.vertexCount - ); + { + file.write( + reinterpret_cast(asset.weights.data()), + sizeof(SHVec4) * header.vertexCount + ); + file.write( + reinterpret_cast(asset.joints.data()), + sizeof(SHVec4i) * header.vertexCount + ); + } } } diff --git a/src/Types/MeshAsset.h b/src/Types/MeshAsset.h index 91680f9..9eff386 100644 --- a/src/Types/MeshAsset.h +++ b/src/Types/MeshAsset.h @@ -15,12 +15,6 @@ namespace SH_COMP bool hasWeights; }; - struct VertexWeights - { - SHVec4 weights; - SHVec4i joints; - }; - struct MeshData { std::string name; @@ -32,6 +26,7 @@ namespace SH_COMP std::vector indices; //Variable data - std::vector weights; + std::vector weights; + std::vector joints; }; } \ No newline at end of file