1
0
Fork 0
mirror of https://github.com/isledecomp/isle.git synced 2025-03-21 20:30:06 -04:00

Implement/match LegoAnimNodeData::FUN_100a0990 ()

This commit is contained in:
Christian Semmler 2024-03-12 14:11:13 -04:00 committed by GitHub
parent 02838d0f57
commit 9d80cf4824
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 6 deletions
LEGO1/lego/sources/anim

View file

@ -289,7 +289,7 @@ LegoAnimNodeData::LegoAnimNodeData()
m_translationIndex = 0;
m_rotationIndex = 0;
m_scaleIndex = 0;
m_unk0x30 = 0;
m_morphIndex = 0;
}
// FUNCTION: LEGO1 0x1009fda0
@ -605,11 +605,27 @@ inline void LegoAnimNodeData::GetScale(
p_matrix.Scale(x, y, z);
}
// STUB: LEGO1 0x100a0990
// FUNCTION: LEGO1 0x100a0990
LegoBool LegoAnimNodeData::FUN_100a0990(LegoFloat p_time)
{
// TODO
return TRUE;
LegoU32 i, n;
LegoU32 index = GetMorphIndex();
LegoBool result;
n = FindKeys(p_time, m_numMorphKeys, m_morphKeys, sizeof(*m_morphKeys), i, index);
SetMorphIndex(index);
switch (n) {
case 0:
result = TRUE;
break;
case 1:
case 2:
result = m_morphKeys[i].GetUnknown0x08();
break;
}
return result;
}
// STUB: LEGO1 0x100a0a00

View file

@ -90,9 +90,10 @@ class LegoMorphKey : public LegoAnimKey {
public:
LegoMorphKey();
LegoResult Read(LegoStorage* p_storage);
LegoBool GetUnknown0x08() { return m_unk0x08; }
protected:
undefined m_unk0x08; // 0x08
LegoBool m_unk0x08; // 0x08
};
// SIZE 0x0c
@ -121,10 +122,12 @@ public:
LegoU32 GetTranslationIndex() { return m_translationIndex; }
LegoU32 GetRotationIndex() { return m_rotationIndex; }
LegoU32 GetScaleIndex() { return m_scaleIndex; }
LegoU32 GetMorphIndex() { return m_morphIndex; }
void SetTranslationIndex(LegoU32 p_translationIndex) { m_translationIndex = p_translationIndex; }
void SetRotationIndex(LegoU32 p_rotationIndex) { m_rotationIndex = p_rotationIndex; }
void SetScaleIndex(LegoU32 p_scaleIndex) { m_scaleIndex = p_scaleIndex; }
void SetMorphIndex(LegoU32 p_morphIndex) { m_morphIndex = p_morphIndex; }
LegoResult CreateLocalTransform(LegoTime p_time, Matrix4& p_matrix)
{
@ -188,7 +191,7 @@ protected:
LegoU32 m_translationIndex; // 0x24
LegoU32 m_rotationIndex; // 0x28
LegoU32 m_scaleIndex; // 0x2c
undefined4 m_unk0x30; // 0x30
LegoU32 m_morphIndex; // 0x30
};
// SIZE 0x08