1
0
forked from mirrors/0ad

Fix bounding boxes after f73fa05542

Skinning calculations must happen in bone-space.

Fixes f73fa05542

Reported by: langbart
Fixes #6168

Differential Revision: https://code.wildfiregames.com/D3927
This was SVN commit r25387.
This commit is contained in:
wraitii
2021-05-05 16:20:33 +00:00
parent 781afea4b1
commit 100159548c
3 changed files with 25 additions and 12 deletions
+7 -4
View File
@@ -28,19 +28,22 @@
#include "ps/CLogger.h"
#include "ps/FileIo.h"
namespace
{
// Start IDs at 1 to leave 0 as a special value.
u32 CSkeletonAnimDef::nextUID = 1;
u32 g_NextSkeletonDefUID = 1;
}
///////////////////////////////////////////////////////////////////////////////////////////
// CSkeletonAnimDef constructor
CSkeletonAnimDef::CSkeletonAnimDef() : m_FrameTime(0), m_NumKeys(0), m_NumFrames(0)
{
m_UID = nextUID++;
m_UID = g_NextSkeletonDefUID++;
// Log a warning if we ever overflow. Should that not result from a bug, bumping to u64 ought to suffice.
if (nextUID == 0)
if (g_NextSkeletonDefUID == 0)
{
// Reset to 1.
nextUID++;
g_NextSkeletonDefUID++;
LOGWARNING("CSkeletonAnimDef unique ID overflowed to 0 - model-animation bounds may be incorrect.");
}
}