mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement LegoExtraActor::VTable0x90 (#739)
* Implement LegoExtraActor::VTable0x90 * Improve LegoExtraActor::VTable0x90 * Match --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -46,7 +46,7 @@ LegoAnimActor::~LegoAnimActor()
|
||||
MxResult LegoAnimActor::FUN_1001c1f0(float& p_und)
|
||||
{
|
||||
float duration = (float) m_animMaps[m_curAnim]->m_AnimTreePtr->GetDuration();
|
||||
p_und = m_unk0x80 - duration * ((MxS32) (m_unk0x80 / duration));
|
||||
p_und = m_actorTime - duration * ((MxS32) (m_actorTime / duration));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ void LegoAnimActor::VTable0x74(Matrix4& p_transform)
|
||||
// FUNCTION: LEGO1 0x1001c290
|
||||
void LegoAnimActor::VTable0x70(float p_float)
|
||||
{
|
||||
if (m_unk0x84 == 0) {
|
||||
m_unk0x84 = p_float - 1.0f;
|
||||
if (m_lastTime == 0) {
|
||||
m_lastTime = p_float - 1.0f;
|
||||
}
|
||||
|
||||
if (m_unk0xdc == 0 && !m_userNavFlag && m_worldSpeed <= 0) {
|
||||
@@ -77,7 +77,7 @@ void LegoAnimActor::VTable0x70(float p_float)
|
||||
FUN_1001c360(f, matrix);
|
||||
}
|
||||
|
||||
m_unk0x84 = m_unk0x80 = p_float;
|
||||
m_lastTime = m_actorTime = p_float;
|
||||
}
|
||||
else {
|
||||
LegoPathActor::VTable0x70(p_float);
|
||||
|
@@ -2,11 +2,14 @@
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoExtraActor, 0x1dc)
|
||||
|
||||
// GLOBAL: LEGO1 0x10104c18
|
||||
Mx3DPointFloat g_unk0x10104c18 = Mx3DPointFloat(0.0f, 2.5f, 0.0f);
|
||||
|
||||
// FUNCTION: LEGO1 0x1002a500
|
||||
LegoExtraActor::LegoExtraActor()
|
||||
{
|
||||
m_unk0x70 = 0.0f;
|
||||
m_unk0x08 = 0;
|
||||
m_scheduledTime = 0;
|
||||
m_unk0x0c = 0;
|
||||
m_unk0x0e = 0;
|
||||
m_unk0x14 = 0;
|
||||
@@ -22,10 +25,65 @@ LegoExtraActor::~LegoExtraActor()
|
||||
delete m_unk0x64;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002a720
|
||||
MxS32 LegoExtraActor::VTable0x90()
|
||||
// FUNCTION: LEGO1 0x1002a720
|
||||
MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
|
||||
{
|
||||
return 0;
|
||||
switch (m_unk0xdc & 0xff) {
|
||||
case 0:
|
||||
case 1:
|
||||
return TRUE;
|
||||
case 2:
|
||||
m_scheduledTime = p_time + 2000.0f;
|
||||
m_unk0xdc = 3;
|
||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
||||
m_lastTime = p_time;
|
||||
return FALSE;
|
||||
case 3: {
|
||||
Vector3 positionRef(p_transform[3]);
|
||||
p_transform = m_roi->GetLocal2World();
|
||||
|
||||
if (p_time < m_scheduledTime) {
|
||||
Mx3DPointFloat position;
|
||||
position = positionRef;
|
||||
positionRef.Clear();
|
||||
|
||||
switch (m_axis) {
|
||||
case e_posz: {
|
||||
p_transform.RotateZ(0.7f);
|
||||
break;
|
||||
}
|
||||
case e_negz: {
|
||||
p_transform.RotateZ(-0.7f);
|
||||
break;
|
||||
}
|
||||
case e_posx: {
|
||||
p_transform.RotateX(0.7f);
|
||||
break;
|
||||
}
|
||||
case e_negx: {
|
||||
p_transform.RotateX(-0.7f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
positionRef = position;
|
||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
||||
m_lastTime = p_time;
|
||||
VTable0x74(p_transform);
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
m_unk0xdc = 0;
|
||||
m_scheduledTime = 0.0f;
|
||||
((Vector3&) positionRef).Sub(&g_unk0x10104c18); // TODO: Fix call
|
||||
m_roi->FUN_100a58f0(p_transform);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002aa90
|
||||
|
Reference in New Issue
Block a user