Set new type of animation

This commit is contained in:
Vladislav Khorev committed 2026-04-22 20:45:40 +03:00
1 parent 52c4ad8ee0
commit 4d9a5b0a6e
49 files changed
+684419 -64

No files matched your search

+16 -1
View File
@@ -167,6 +167,7 @@ namespace ZL
startBones = bones;
currentBones = bones;
this->boneNames = boneNames;
// ---- Multi-mesh header ----
std::getline(f, tempLine); // === TOTAL MESHES TO EXPORT: N ===
@@ -487,7 +488,7 @@ namespace ZL
if (std::memcmp(magic, "BSMF", 4) != 0)
throw std::runtime_error("Invalid multi-mesh binary animation file (bad magic)");
uint32_t version = readUint32();
if (version != 1)
if (version != 2)
throw std::runtime_error("Unsupported multi-mesh binary animation file version");
// Armature matrix (row-major in file, stored with stride-4 into Matrix4f)
@@ -528,6 +529,11 @@ namespace ZL
startBones = bones;
currentBones = bones;
// Bone names
boneNames.resize(numBones);
for (uint32_t i = 0; i < numBones; i++)
boneNames[i] = readString();
// Meshes
uint32_t numMeshes = readUint32();
@@ -629,6 +635,15 @@ namespace ZL
}
}
int BoneSystemNew::findBoneIndex(const std::string& name) const
{
for (size_t i = 0; i < boneNames.size(); i++)
{
if (boneNames[i] == name) return static_cast<int>(i);
}
return -1;
}
void BoneSystemNew::Interpolate(int frame)
{
int startingKeyFrame = -1;