mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-20 23:01:16 +00:00
Add BETA10 annotations and fixes
This commit is contained in:
parent
8fc84f6f9f
commit
7844465f18
@ -86,6 +86,8 @@ class LegoEntity : public MxEntity {
|
|||||||
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
|
MxBool GetUnknown0x10IsSet(MxU8 p_flag) { return m_unk0x10 & p_flag; }
|
||||||
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
|
MxBool GetFlagsIsSet(MxU8 p_flag) { return m_flags & p_flag; }
|
||||||
MxU8 GetFlags() { return m_flags; }
|
MxU8 GetFlags() { return m_flags; }
|
||||||
|
|
||||||
|
// FUNCTION: BETA10 0x10049db0
|
||||||
MxFloat GetWorldSpeed() { return m_worldSpeed; }
|
MxFloat GetWorldSpeed() { return m_worldSpeed; }
|
||||||
|
|
||||||
// FUNCTION: BETA10 0x1000f2f0
|
// FUNCTION: BETA10 0x1000f2f0
|
||||||
|
|||||||
@ -191,9 +191,10 @@ inline void LegoExtraActor::FUN_1002ad8a()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002aba0
|
// FUNCTION: LEGO1 0x1002aba0
|
||||||
|
// FUNCTION: BETA10 0x1008114a
|
||||||
MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
||||||
{
|
{
|
||||||
if (p_actor->GetActorState() != c_initial || m_actorState != c_initial) {
|
if (p_actor->GetActorState() != c_initial || GetActorState() != c_initial) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +223,7 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
for (MxS32 i = 0; i < m_boundary->GetNumEdges(); i++) {
|
for (MxS32 i = 0; i < m_boundary->GetNumEdges(); i++) {
|
||||||
Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i);
|
Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i);
|
||||||
|
|
||||||
if (positionRef.Dot(*normal, positionRef) + (*normal)[3] < -0.001) {
|
if (positionRef.Dot(*normal, positionRef) + normal->index_operator(3) < -0.001) {
|
||||||
b = TRUE;
|
b = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -232,41 +233,34 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
m_roi->FUN_100a58f0(matrix2);
|
m_roi->FUN_100a58f0(matrix2);
|
||||||
m_roi->VTable0x14();
|
m_roi->VTable0x14();
|
||||||
FUN_1002ad8a();
|
FUN_1002ad8a();
|
||||||
|
assert(m_roi);
|
||||||
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
||||||
m_scheduledTime = Timer()->GetTime() + m_disAnim->GetDuration();
|
m_scheduledTime = Timer()->GetTime() + m_disAnim->GetDuration();
|
||||||
m_prevWorldSpeed = m_worldSpeed;
|
m_prevWorldSpeed = GetWorldSpeed();
|
||||||
VTable0xc4();
|
VTable0xc4();
|
||||||
SetWorldSpeed(0);
|
SetWorldSpeed(0);
|
||||||
m_whichAnim = 1;
|
m_whichAnim = 1;
|
||||||
m_actorState = c_one | c_noCollide;
|
SetActorState(c_one | c_noCollide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
LegoROI* roi = m_roi;
|
LegoROI* roi = GetROI();
|
||||||
|
assert(roi);
|
||||||
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
||||||
VTable0xc4();
|
VTable0xc4();
|
||||||
m_actorState = c_two | c_noCollide;
|
SetActorState(c_two | c_noCollide);
|
||||||
Mx3DPointFloat dir = p_actor->GetWorldDirection();
|
Mx3DPointFloat dir = p_actor->GetWorldDirection();
|
||||||
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
|
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
|
||||||
Vector3 positionRef(matrix3[3]);
|
Vector3 positionRef(matrix3[3]);
|
||||||
positionRef += g_unk0x10104c18;
|
positionRef += g_unk0x10104c18;
|
||||||
roi->FUN_100a58f0(matrix3);
|
roi->FUN_100a58f0(matrix3);
|
||||||
|
|
||||||
#ifdef COMPAT_MODE
|
|
||||||
float dotX, dotZ;
|
|
||||||
{
|
|
||||||
Mx3DPointFloat tmp(1.0f, 0, 0);
|
|
||||||
dotX = dir.Dot(dir, tmp);
|
|
||||||
Mx3DPointFloat tmp2(0, 0, 1.0f);
|
|
||||||
dotZ = dir.Dot(dir, tmp2);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
float dotX = dir.Dot(dir, Mx3DPointFloat(1.0f, 0, 0));
|
float dotX = dir.Dot(dir, Mx3DPointFloat(1.0f, 0, 0));
|
||||||
float dotZ = dir.Dot(dir, Mx3DPointFloat(0, 0, 1.0f));
|
float dotZ = dir.Dot(dir, Mx3DPointFloat(0, 0, 1.0f));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (abs(dotZ) < abs(dotX)) {
|
if (fabs(dotZ) < fabs(dotX)) {
|
||||||
m_axis = dotX > 0.0 ? e_posz : e_negz;
|
m_axis = dotX > 0.0 ? e_posz : e_negz;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user