Revert "fix(rendering): remap M2 vertex bone indices through bone lookup table"

This reverts commit 04ad88330f.
This commit is contained in:
Kelsi 2026-04-03 22:26:14 -07:00
parent 04ad88330f
commit 634bac6c7a
2 changed files with 5 additions and 19 deletions

View file

@ -1158,14 +1158,10 @@ bool M2Renderer::loadModel(const pipeline::M2Model& model, uint32_t modelId) {
vertexData.push_back(w1);
vertexData.push_back(w2);
vertexData.push_back(w3);
// Remap bone indices through the bone lookup table.
// M2 vertex bone indices are lookup table indices, not direct bone indices.
for (int j = 0; j < 4; j++) {
uint8_t idx = v.boneIndices[j];
uint16_t actual = (idx < model.boneLookupTable.size())
? model.boneLookupTable[idx] : 0;
vertexData.push_back(static_cast<float>(std::min(actual, uint16_t(127))));
}
vertexData.push_back(static_cast<float>(std::min(v.boneIndices[0], uint8_t(127))));
vertexData.push_back(static_cast<float>(std::min(v.boneIndices[1], uint8_t(127))));
vertexData.push_back(static_cast<float>(std::min(v.boneIndices[2], uint8_t(127))));
vertexData.push_back(static_cast<float>(std::min(v.boneIndices[3], uint8_t(127))));
}
// Upload vertex buffer to GPU