mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-29 19:05:34 -05:00
Implement/match LegoAnimPresenter::PutFrame (#796)
* Implement/match LegoAnimPresenter::PutFrame * compat mode
This commit is contained in:
parent
d469cabd6b
commit
67127e2515
3 changed files with 56 additions and 3 deletions
|
@ -92,6 +92,7 @@ class LegoAnimPresenter : public MxVideoPresenter {
|
||||||
LegoBool FUN_1006aba0();
|
LegoBool FUN_1006aba0();
|
||||||
MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi);
|
MxBool FUN_1006abb0(LegoTreeNode* p_node, LegoROI* p_roi);
|
||||||
void FUN_1006ac90();
|
void FUN_1006ac90();
|
||||||
|
void FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, MxMatrix& p_matrix);
|
||||||
void FUN_1006c8a0(MxBool p_bool);
|
void FUN_1006c8a0(MxBool p_bool);
|
||||||
|
|
||||||
LegoAnim* m_anim; // 0x64
|
LegoAnim* m_anim; // 0x64
|
||||||
|
|
|
@ -510,10 +510,57 @@ void LegoAnimPresenter::FUN_1006ac90()
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1006ad30
|
// FUNCTION: LEGO1 0x1006ad30
|
||||||
void LegoAnimPresenter::PutFrame()
|
void LegoAnimPresenter::PutFrame()
|
||||||
{
|
{
|
||||||
// TODO
|
if (m_currentTickleState == e_streaming) {
|
||||||
|
MxLong time;
|
||||||
|
|
||||||
|
if (m_action->GetStartTime() <= m_action->GetElapsedTime()) {
|
||||||
|
time = m_action->GetElapsedTime() - m_action->GetStartTime();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
FUN_1006b9a0(m_anim, time, *m_unk0x78);
|
||||||
|
|
||||||
|
if (m_unk0x8c != NULL && m_currentWorld != NULL && m_currentWorld->GetCamera() != NULL) {
|
||||||
|
for (MxS32 i = 0; i < m_unk0x94; i++) {
|
||||||
|
if (m_unk0x8c[i] != NULL) {
|
||||||
|
MxMatrix mat(m_unk0x8c[i]->GetLocal2World());
|
||||||
|
|
||||||
|
Vector3 pos(mat[0]);
|
||||||
|
Vector3 dir(mat[1]);
|
||||||
|
Vector3 up(mat[2]);
|
||||||
|
Vector3 und(mat[3]);
|
||||||
|
|
||||||
|
float possqr = sqrt(pos.LenSquared());
|
||||||
|
float dirsqr = sqrt(dir.LenSquared());
|
||||||
|
float upsqr = sqrt(up.LenSquared());
|
||||||
|
|
||||||
|
up = und;
|
||||||
|
|
||||||
|
#ifdef COMPAT_MODE
|
||||||
|
Mx3DPointFloat location = m_currentWorld->GetCamera()->GetWorldLocation();
|
||||||
|
((Vector3&) up).Sub(&location);
|
||||||
|
#else
|
||||||
|
((Vector3&) up).Sub(&m_currentWorld->GetCamera()->GetWorldLocation());
|
||||||
|
#endif
|
||||||
|
((Vector3&) dir).Div(dirsqr);
|
||||||
|
pos.EqualsCross(&dir, &up);
|
||||||
|
pos.Unitize();
|
||||||
|
up.EqualsCross(&pos, &dir);
|
||||||
|
((Vector3&) pos).Mul(possqr);
|
||||||
|
((Vector3&) dir).Mul(dirsqr);
|
||||||
|
((Vector3&) up).Mul(upsqr);
|
||||||
|
|
||||||
|
m_unk0x8c[i]->FUN_100a58f0(mat);
|
||||||
|
m_unk0x8c[i]->VTable0x14();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1006b550
|
// FUNCTION: LEGO1 0x1006b550
|
||||||
|
@ -643,6 +690,11 @@ const char* LegoAnimPresenter::GetActionObjectName()
|
||||||
return m_action->GetObjectName();
|
return m_action->GetObjectName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STUB: LEGO1 0x1006b9a0
|
||||||
|
void LegoAnimPresenter::FUN_1006b9a0(LegoAnim* p_anim, MxLong p_time, MxMatrix& p_matrix)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1006bac0
|
// STUB: LEGO1 0x1006bac0
|
||||||
void LegoAnimPresenter::ParseExtra()
|
void LegoAnimPresenter::ParseExtra()
|
||||||
{
|
{
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Vector2 {
|
||||||
virtual void Sub(float* p_other) { SubImpl(p_other); } // vtable+0x58
|
virtual void Sub(float* p_other) { SubImpl(p_other); } // vtable+0x58
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002200
|
// FUNCTION: LEGO1 0x10002200
|
||||||
virtual void Sub(Vector2* p_other) { SubImpl(p_other->m_data); } // vtable+0x54
|
virtual void Sub(const Vector2* p_other) { SubImpl((float*) p_other->m_data); } // vtable+0x54
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002210
|
// FUNCTION: LEGO1 0x10002210
|
||||||
virtual void Mul(float* p_other) { MulVectorImpl(p_other); } // vtable+0x64
|
virtual void Mul(float* p_other) { MulVectorImpl(p_other); } // vtable+0x64
|
||||||
|
|
Loading…
Reference in a new issue