2023-06-29 04:10:08 -04:00
|
|
|
#include "helicopter.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
#include "act1state.h"
|
2023-10-24 04:14:45 -04:00
|
|
|
#include "act3.h"
|
2024-03-18 11:05:05 -04:00
|
|
|
#include "act3_actions.h"
|
2023-12-14 11:50:29 -05:00
|
|
|
#include "isle.h"
|
2024-03-18 11:05:05 -04:00
|
|
|
#include "isle_actions.h"
|
2024-01-20 12:41:22 -05:00
|
|
|
#include "jukebox.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "jukebox_actions.h"
|
2023-10-24 08:37:02 -04:00
|
|
|
#include "legoanimationmanager.h"
|
2023-10-24 04:14:45 -04:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legogamestate.h"
|
2023-10-24 08:37:02 -04:00
|
|
|
#include "legoomni.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legoutils.h"
|
2023-10-24 04:14:45 -04:00
|
|
|
#include "legoworld.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
2023-12-14 11:50:29 -05:00
|
|
|
#include "mxtransitionmanager.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-10-24 04:14:45 -04:00
|
|
|
DECOMP_SIZE_ASSERT(Helicopter, 0x230)
|
2024-01-24 21:16:29 -05:00
|
|
|
DECOMP_SIZE_ASSERT(Mx3DPointFloat, 0x14)
|
|
|
|
DECOMP_SIZE_ASSERT(Mx4DPointFloat, 0x18)
|
|
|
|
DECOMP_SIZE_ASSERT(MxMatrix, 0x48)
|
2023-10-24 04:14:45 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10001e60
|
2023-06-29 04:10:08 -04:00
|
|
|
Helicopter::Helicopter()
|
|
|
|
{
|
2023-12-13 05:48:14 -05:00
|
|
|
m_unk0x13c = 60;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10003230
|
2023-06-29 04:10:08 -04:00
|
|
|
Helicopter::~Helicopter()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
IslePathActor::Destroy(TRUE);
|
2023-10-24 04:14:45 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100032c0
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult Helicopter::Create(MxDSAction& p_dsAction)
|
2023-10-24 04:14:45 -04:00
|
|
|
{
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult result = IslePathActor::Create(p_dsAction);
|
2024-02-02 12:18:46 -05:00
|
|
|
LegoWorld* world = CurrentWorld();
|
2023-10-24 19:38:27 -04:00
|
|
|
SetWorld(world);
|
|
|
|
if (world->IsA("Act3")) {
|
2024-03-29 14:09:53 -04:00
|
|
|
((Act3*) GetWorld())->SetUnknown420c(this);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
|
|
|
world = GetWorld();
|
2024-02-01 15:42:10 -05:00
|
|
|
if (world) {
|
2024-01-26 16:00:02 -05:00
|
|
|
world->Add(this);
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-10-24 19:38:27 -04:00
|
|
|
GetState();
|
|
|
|
return result;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-10-24 04:14:45 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10003320
|
2023-10-24 04:14:45 -04:00
|
|
|
void Helicopter::GetState()
|
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
m_state = (HelicopterState*) GameState()->GetState("HelicopterState");
|
2024-02-01 15:42:10 -05:00
|
|
|
if (!m_state) {
|
2023-10-24 19:38:27 -04:00
|
|
|
m_state = (HelicopterState*) GameState()->CreateState("HelicopterState");
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-10-24 08:37:02 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10003360
|
2023-10-24 08:37:02 -04:00
|
|
|
void Helicopter::VTable0xe4()
|
|
|
|
{
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk40, TRUE, 7);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
IslePathActor::VTable0xe4();
|
2024-02-10 11:37:22 -05:00
|
|
|
|
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-03-17 13:01:47 -04:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_copter);
|
2024-02-26 11:19:16 -05:00
|
|
|
if (CurrentActor()) {
|
|
|
|
if (CurrentActor()->IsA("IslePathActor")) {
|
2024-03-18 10:38:02 -04:00
|
|
|
((IslePathActor*) CurrentActor())->VTable0xe8(LegoGameState::e_unk55, TRUE, 7);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
m_state->SetUnknown8(0);
|
2024-03-19 16:07:07 -04:00
|
|
|
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterDashboard_Bitmap);
|
|
|
|
RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterArms_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, IsleScript::c_Helicopter_TakeOff_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, IsleScript::c_Helicopter_Land_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, Act3Script::c_Helicopter_Pizza_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, Act3Script::c_Helicopter_Donut_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, Act3Script::c_Helicopter_Info_Ctl);
|
|
|
|
RemoveFromCurrentWorld(m_script, 0x1d);
|
|
|
|
RemoveFromCurrentWorld(m_script, 0x1e);
|
|
|
|
RemoveFromCurrentWorld(m_script, 0x1f);
|
2023-10-24 19:38:27 -04:00
|
|
|
AnimationManager()->FUN_1005f6d0(TRUE);
|
|
|
|
ControlManager()->Unregister(this);
|
2023-10-24 08:37:02 -04:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10003480
|
|
|
|
MxU32 Helicopter::VTable0xcc()
|
|
|
|
{
|
2024-02-01 15:42:10 -05:00
|
|
|
if (!FUN_1003ef60()) {
|
2023-12-14 11:50:29 -05:00
|
|
|
return 1;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
if (!m_world) {
|
2024-02-02 12:18:46 -05:00
|
|
|
m_world = CurrentWorld();
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2024-02-26 11:19:16 -05:00
|
|
|
if (CurrentActor()) {
|
|
|
|
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
|
|
|
|
CurrentActor()->VTable0xe4();
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
|
|
|
switch (GameState()->GetCurrentAct()) {
|
|
|
|
case LegoGameState::e_act1:
|
2023-12-14 11:50:29 -05:00
|
|
|
m_script = *g_isleScript;
|
|
|
|
AnimationManager()->FUN_10064670(FALSE);
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk41, TRUE, 7);
|
2024-03-17 13:01:47 -04:00
|
|
|
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_copter);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(TRUE, 0);
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE);
|
2024-03-30 12:18:15 -04:00
|
|
|
SetState(4);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_Jail_Music);
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act2:
|
2023-12-14 11:50:29 -05:00
|
|
|
m_script = *g_act2mainScript;
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2023-12-14 11:50:29 -05:00
|
|
|
m_script = *g_act3Script;
|
|
|
|
break;
|
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
VTable0xe0();
|
2024-01-17 11:53:53 -05:00
|
|
|
InvokeAction(Extra::ActionType::e_start, m_script, 0x15, NULL);
|
2023-12-14 11:50:29 -05:00
|
|
|
GetCurrentAction().SetObjectId(-1);
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100035e0
|
2024-01-28 16:09:33 -05:00
|
|
|
MxU32 Helicopter::VTable0xd4(LegoControlManagerEvent& p_param)
|
2023-12-14 11:50:29 -05:00
|
|
|
{
|
|
|
|
MxU32 ret = 0;
|
|
|
|
MxAtomId script;
|
2024-02-10 11:37:22 -05:00
|
|
|
|
|
|
|
switch (GameState()->GetCurrentAct()) {
|
|
|
|
case LegoGameState::e_act1:
|
2023-12-14 11:50:29 -05:00
|
|
|
script = *g_isleScript;
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act2:
|
2023-12-14 11:50:29 -05:00
|
|
|
script = *g_act2mainScript;
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2023-12-14 11:50:29 -05:00
|
|
|
script = *g_act3Script;
|
|
|
|
break;
|
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
|
2024-01-28 16:09:33 -05:00
|
|
|
if (p_param.GetUnknown0x28() == 1) {
|
|
|
|
switch (p_param.GetClickedObjectId()) {
|
2024-03-18 11:05:05 -04:00
|
|
|
case IsleScript::c_HelicopterArms_Ctl:
|
2023-12-14 11:50:29 -05:00
|
|
|
if (*g_act3Script == script) {
|
2024-03-29 14:09:53 -04:00
|
|
|
((Act3*) CurrentWorld())->SetUnknown4270(2);
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
2024-02-01 15:42:10 -05:00
|
|
|
else if (m_state->GetUnkown8() != 0) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
VTable0xe4();
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_unk66);
|
2023-12-14 11:50:29 -05:00
|
|
|
ret = 1;
|
|
|
|
break;
|
2024-03-18 11:05:05 -04:00
|
|
|
case IsleScript::c_Helicopter_TakeOff_Ctl: {
|
2024-02-01 15:42:10 -05:00
|
|
|
if (*g_act3Script == script) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
Act1State* state = (Act1State*) GameState()->GetState("Act1State");
|
|
|
|
if (m_state->GetUnkown8() == 0) {
|
|
|
|
state->SetUnknown18(4);
|
|
|
|
m_state->SetUnknown8(1);
|
|
|
|
m_world->FUN_1001fc80(this);
|
2024-01-17 11:53:53 -05:00
|
|
|
InvokeAction(Extra::ActionType::e_start, script, 0x20, NULL);
|
2024-03-30 12:18:15 -04:00
|
|
|
SetState(0);
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
break;
|
|
|
|
}
|
2024-03-18 11:05:05 -04:00
|
|
|
case IsleScript::c_Helicopter_Land_Ctl:
|
2024-02-01 15:42:10 -05:00
|
|
|
if (*g_act3Script == script) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
if (m_state->GetUnkown8() == 2) {
|
|
|
|
m_state->SetUnknown8(3);
|
|
|
|
m_world->FUN_1001fc80(this);
|
2024-01-17 11:53:53 -05:00
|
|
|
InvokeAction(Extra::ActionType::e_start, script, 0x21, NULL);
|
2024-03-30 12:18:15 -04:00
|
|
|
SetState(4);
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
break;
|
2024-03-18 11:05:05 -04:00
|
|
|
case Act3Script::c_Helicopter_Pizza_Ctl:
|
2024-02-01 15:42:10 -05:00
|
|
|
if (*g_act3Script != script) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
ret = 1;
|
|
|
|
/* fall through */
|
2024-03-18 11:05:05 -04:00
|
|
|
case Act3Script::c_Helicopter_Donut_Ctl:
|
2024-02-01 15:42:10 -05:00
|
|
|
if (*g_act3Script != script) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
if (m_world && m_world->GetCamera()) {
|
2024-01-12 19:34:38 -05:00
|
|
|
Mx3DPointFloat loc, dir, lookat;
|
2024-03-05 14:31:57 -05:00
|
|
|
loc = m_world->GetCamera()->GetWorldLocation();
|
|
|
|
dir = m_world->GetCamera()->GetWorldDirection();
|
2023-12-14 11:50:29 -05:00
|
|
|
lookat = dir;
|
|
|
|
float scale = 3;
|
|
|
|
lookat.Mul(scale);
|
|
|
|
lookat.Add(&loc);
|
2024-01-12 19:34:38 -05:00
|
|
|
Mx3DPointFloat v68, v7c, v90(0, 1, 0), va4;
|
2024-03-05 14:31:57 -05:00
|
|
|
v68 = m_world->GetCamera()->GetWorldUp();
|
2023-12-14 11:50:29 -05:00
|
|
|
va4.EqualsCross(v68, dir);
|
|
|
|
v7c.EqualsCross(va4, v90);
|
2024-02-01 15:42:10 -05:00
|
|
|
if (ret) {
|
2024-03-23 10:09:20 -04:00
|
|
|
if (((Act3*) m_world)->FUN_100727e0(m_controller, loc, dir, v7c)) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-03-23 10:09:20 -04:00
|
|
|
else if (((Act3*) m_world)->FUN_10072980(m_controller, loc, dir, v7c)) {
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
break;
|
2024-03-18 11:05:05 -04:00
|
|
|
/* case Act3Script::c_Helicopter_Info_Ctl: */
|
|
|
|
case IsleScript::c_Helicopter_Info_Ctl:
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-03-17 13:01:47 -04:00
|
|
|
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2023-12-14 11:50:29 -05:00
|
|
|
VTable0xe4();
|
|
|
|
}
|
|
|
|
ret = 1;
|
|
|
|
break;
|
|
|
|
case 0x1d:
|
|
|
|
ret = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10003c20
|
|
|
|
MxU32 Helicopter::VTable0xd8(MxType18NotificationParam& p_param)
|
|
|
|
{
|
2024-01-12 19:34:38 -05:00
|
|
|
MxU32 ret = 0;
|
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
switch (m_state->GetUnkown8()) {
|
|
|
|
case 1: {
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2023-12-14 11:50:29 -05:00
|
|
|
((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(4);
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk42, TRUE, 7);
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
2024-02-01 15:42:10 -05:00
|
|
|
else {
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk49, TRUE, 7);
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-01-12 19:34:38 -05:00
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
m_state->SetUnknown8(2);
|
2024-01-12 19:34:38 -05:00
|
|
|
|
|
|
|
MxMatrix matrix;
|
|
|
|
matrix.SetIdentity();
|
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
float s = sin(0.5235987901687622); // PI / 6, 30 deg
|
|
|
|
float c = cos(0.5235987901687622); // PI / 6, 30 deg
|
2024-01-12 19:34:38 -05:00
|
|
|
|
|
|
|
float matrixCopy[4][4];
|
|
|
|
memcpy(matrixCopy, matrix.GetData(), sizeof(matrixCopy));
|
2023-12-21 10:59:26 -05:00
|
|
|
for (MxS32 i = 0; i < 4; i++) {
|
2024-01-12 19:34:38 -05:00
|
|
|
matrix.GetData()[i][1] = matrixCopy[i][1] * c - matrixCopy[i][2] * s;
|
|
|
|
matrix.GetData()[i][2] = matrixCopy[i][2] * c + matrixCopy[i][1] * s;
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
2024-01-12 19:34:38 -05:00
|
|
|
|
|
|
|
Vector3 at(matrix[3]), dir(matrix[2]), up(matrix[1]);
|
2024-01-09 04:43:21 -05:00
|
|
|
m_world->GetCamera()->SetWorldTransform(at, dir, up);
|
2023-12-14 11:50:29 -05:00
|
|
|
FUN_10010c30();
|
2024-01-12 19:34:38 -05:00
|
|
|
ret = 1;
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: {
|
2024-01-12 19:34:38 -05:00
|
|
|
MxMatrix matrix;
|
|
|
|
matrix.SetIdentity();
|
|
|
|
|
|
|
|
Vector3 at(matrix[3]), dir(matrix[2]), up(matrix[1]);
|
2023-12-14 11:50:29 -05:00
|
|
|
at[1] = 1.25;
|
2024-01-09 04:43:21 -05:00
|
|
|
m_world->GetCamera()->SetWorldTransform(at, dir, up);
|
2024-01-12 19:34:38 -05:00
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2023-12-14 11:50:29 -05:00
|
|
|
((Act1State*) GameState()->GetState("Act1State"))->SetUnknown18(0);
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk41, TRUE, 7);
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
2024-02-01 15:42:10 -05:00
|
|
|
else {
|
2024-03-18 10:38:02 -04:00
|
|
|
VTable0xe8(LegoGameState::e_unk48, TRUE, 7);
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-01-12 19:34:38 -05:00
|
|
|
|
2023-12-14 11:50:29 -05:00
|
|
|
m_state->SetUnknown8(0);
|
2024-01-12 19:34:38 -05:00
|
|
|
ret = 1;
|
2023-12-14 11:50:29 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2024-01-12 19:34:38 -05:00
|
|
|
|
|
|
|
return ret;
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10003e90
|
2024-01-12 19:34:38 -05:00
|
|
|
void Helicopter::VTable0x74(Matrix4& p_transform)
|
2023-12-14 11:50:29 -05:00
|
|
|
{
|
2024-03-26 13:51:52 -04:00
|
|
|
if (m_userNavFlag) {
|
2023-12-14 11:50:29 -05:00
|
|
|
m_roi->FUN_100a46b0(p_transform);
|
|
|
|
FUN_10010c30();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
m_roi->FUN_100a58f0(p_transform);
|
|
|
|
m_roi->VTable0x14();
|
2024-02-01 15:42:10 -05:00
|
|
|
if (m_cameraFlag) {
|
2023-12-14 11:50:29 -05:00
|
|
|
FUN_10010c30();
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10003ee0
|
|
|
|
void Helicopter::VTable0x70(float p_float)
|
|
|
|
{
|
|
|
|
MxU32 state = m_state->GetUnkown8();
|
|
|
|
switch (state) {
|
|
|
|
default:
|
|
|
|
LegoPathActor::VTable0x70(p_float);
|
|
|
|
return;
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
float f = m_unk0x1f0 - p_float + 3000;
|
|
|
|
if (f >= 0) {
|
|
|
|
float f2 = f / 3000 + 1;
|
2024-02-01 15:42:10 -05:00
|
|
|
if (f2 < 0) {
|
2023-12-14 11:50:29 -05:00
|
|
|
f2 = 0;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
if (1.0f < f2) {
|
2023-12-14 11:50:29 -05:00
|
|
|
f2 = 1.0f;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-01-12 19:34:38 -05:00
|
|
|
Vector3 v(m_unk0x160[3]);
|
|
|
|
MxMatrix mat;
|
|
|
|
Vector3 v2(m_unk0x1a8[3]);
|
|
|
|
float* loc = m_unk0x1a8[3];
|
2023-12-14 11:50:29 -05:00
|
|
|
mat.SetIdentity();
|
|
|
|
float fa[4];
|
2024-01-12 19:34:38 -05:00
|
|
|
Vector4 v3(fa);
|
2023-12-14 11:50:29 -05:00
|
|
|
if (m_unk0x1f4.FUN_100040a0(v3, f2) == SUCCESS) {
|
|
|
|
mat.FromQuaternion(v3);
|
|
|
|
}
|
|
|
|
v2.SetVector(loc);
|
|
|
|
v2.Sub(&v);
|
|
|
|
v2.Mul(f2);
|
|
|
|
v2.Add(&v);
|
|
|
|
m_world->GetCamera()->FUN_100123e0(mat, 0);
|
|
|
|
}
|
|
|
|
else {
|
2024-02-01 15:42:10 -05:00
|
|
|
if (state == 4) {
|
2024-01-27 12:15:14 -05:00
|
|
|
((Act3*) m_world)->FUN_10073400();
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-01-27 12:15:14 -05:00
|
|
|
((Act3*) m_world)->FUN_10073430();
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-03-30 12:18:15 -04:00
|
|
|
LegoPathActor::m_state = 4;
|
2023-12-14 11:50:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|