From e23ade111060d34e9b661538994346c1d78aef50 Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Wed, 7 Jan 2026 23:50:34 +0100 Subject: [PATCH 01/11] Rename FUN_100042a0 to SetupCameraTransition --- LEGO1/lego/legoomni/include/helicopter.h | 2 +- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 8496faf9..59ec5407 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -86,7 +86,7 @@ class Helicopter : public IslePathActor { friend class Act3; protected: - void FUN_100042a0(const Matrix4& p_matrix); + void SetupCameraTransition(const Matrix4& p_matrix); MxMatrix m_unk0x160; // 0x160 MxMatrix m_unk0x1a8; // 0x1a8 diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 0337e96a..6847a057 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -445,7 +445,7 @@ void Helicopter::Animate(float p_time) } // FUNCTION: LEGO1 0x100042a0 -void Helicopter::FUN_100042a0(const Matrix4& p_matrix) +void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) { MxMatrix local48; MxMatrix local90; @@ -493,7 +493,7 @@ void Helicopter::FUN_10004640(const Matrix4& p_matrix) { if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { m_state->m_unk0x08 = 4; - FUN_100042a0(p_matrix); + SetupCameraTransition(p_matrix); } } @@ -502,6 +502,6 @@ void Helicopter::FUN_10004670(const Matrix4& p_matrix) { if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { m_state->m_unk0x08 = 5; - FUN_100042a0(p_matrix); + SetupCameraTransition(p_matrix); } } From d16b3765f0ee7e7a3cd8a7bcef319e0619e5cdab Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Wed, 7 Jan 2026 23:53:35 +0100 Subject: [PATCH 02/11] Rename EndingCamera methods --- LEGO1/lego/legoomni/include/helicopter.h | 4 ++-- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 4 ++-- LEGO1/lego/legoomni/src/worlds/act3.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 59ec5407..1e7b860b 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -76,8 +76,8 @@ class Helicopter : public IslePathActor { void Exit() override; // vtable+0xe4 void CreateState(); - void FUN_10004640(const Matrix4& p_matrix); - void FUN_10004670(const Matrix4& p_matrix); + void StartGoodEndingCamera(const Matrix4& p_matrix); + void StartBadEndingCamera(const Matrix4& p_matrix); // SYNTHETIC: LEGO1 0x10003210 // Helicopter::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 6847a057..59772499 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -489,7 +489,7 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) } // FUNCTION: LEGO1 0x10004640 -void Helicopter::FUN_10004640(const Matrix4& p_matrix) +void Helicopter::StartGoodEndingCamera(const Matrix4& p_matrix) { if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { m_state->m_unk0x08 = 4; @@ -498,7 +498,7 @@ void Helicopter::FUN_10004640(const Matrix4& p_matrix) } // FUNCTION: LEGO1 0x10004670 -void Helicopter::FUN_10004670(const Matrix4& p_matrix) +void Helicopter::StartBadEndingCamera(const Matrix4& p_matrix) { if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { m_state->m_unk0x08 = 5; diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 74c2b383..2cdf2d4c 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -783,7 +783,7 @@ void Act3::GoodEnding(const Matrix4& p_destination) #ifndef BETA10 m_unk0x4220.Clear(); - m_copter->FUN_10004640(p_destination); + m_copter->StartGoodEndingCamera(p_destination); DebugPrintf("In Good Ending..."); DebugCopter( @@ -866,7 +866,7 @@ void Act3::BadEnding(const Matrix4& p_destination) m_brickster->SetActorState(LegoPathActor::c_disabled); m_unk0x4220.Clear(); - m_copter->FUN_10004670(p_destination); + m_copter->StartBadEndingCamera(p_destination); DebugPrintf("In Bad Ending..."); DebugCopter( From c83a42738b84e97ddcf71f6c7fc571565fbd78ad Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Wed, 7 Jan 2026 23:57:40 +0100 Subject: [PATCH 03/11] Rename m_unk0x08 to m_status --- LEGO1/lego/legoomni/include/helicopter.h | 6 ++-- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 32 +++++++++---------- LEGO1/lego/legoomni/src/worlds/act3.cpp | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 1e7b860b..8b2b08c7 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -12,7 +12,7 @@ class Act3; // SIZE 0x0c class HelicopterState : public LegoState { public: - HelicopterState() : m_unk0x08(0) {} + HelicopterState() : m_status(0) {} // FUNCTION: LEGO1 0x1000e0b0 MxBool IsSerializable() override { return FALSE; } // vtable+0x14 @@ -20,7 +20,7 @@ class HelicopterState : public LegoState { // FUNCTION: LEGO1 0x1000e0c0 MxBool Reset() override { - m_unk0x08 = 0; + m_status = 0; return TRUE; } // vtable+0x18 @@ -41,7 +41,7 @@ class HelicopterState : public LegoState { // SYNTHETIC: LEGO1 0x1000e190 // HelicopterState::`scalar deleting destructor' - MxU32 m_unk0x08; // 0x08 + MxU32 m_status; // 0x08 }; // VTABLE: LEGO1 0x100d40f8 diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 59772499..4687a7e6 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -102,7 +102,7 @@ void Helicopter::Exit() } } - m_state->m_unk0x08 = 0; + m_state->m_status = 0; RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterDashboard_Bitmap); RemoveFromCurrentWorld(m_script, IsleScript::c_HelicopterArms_Ctl); RemoveFromCurrentWorld(m_script, IsleScript::c_Helicopter_TakeOff_Ctl); @@ -198,7 +198,7 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param) ((Act3*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } - else if (m_state->m_unk0x08 != 0) { + else if (m_state->m_status != 0) { break; } @@ -213,9 +213,9 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param) Act1State* act1State = (Act1State*) GameState()->GetState("Act1State"); assert(act1State); - if (m_state->m_unk0x08 == 0) { + if (m_state->m_status == 0) { act1State->m_state = Act1State::e_helicopter; - m_state->m_unk0x08 = 1; + m_state->m_status = 1; m_world->RemoveActor(this); InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterTakeOff_Anim, NULL); SetActorState(c_initial); @@ -229,8 +229,8 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param) break; } - if (m_state->m_unk0x08 == 2) { - m_state->m_unk0x08 = 3; + if (m_state->m_status == 2) { + m_state->m_status = 3; m_world->RemoveActor(this); InvokeAction(Extra::ActionType::e_start, script, IsleScript::c_HelicopterLand_Anim, NULL); SetActorState(c_disabled); @@ -313,7 +313,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param) { MxLong result = 0; - switch (m_state->m_unk0x08) { + switch (m_state->m_status) { case 1: { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { Act1State* act1State = (Act1State*) GameState()->GetState("Act1State"); @@ -333,7 +333,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param) ); } - m_state->m_unk0x08 = 2; + m_state->m_status = 2; MxMatrix matrix; matrix.SetIdentity(); @@ -374,7 +374,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param) ); } - m_state->m_unk0x08 = 0; + m_state->m_status = 0; result = 1; break; } @@ -402,8 +402,8 @@ void Helicopter::VTable0x74(Matrix4& p_transform) // FUNCTION: LEGO1 0x10003ee0 void Helicopter::Animate(float p_time) { - if (m_state->m_unk0x08 == 4 || m_state->m_unk0x08 == 5) { - float f = m_unk0x1f0 - p_time + 3000.0f; + if (m_state->m_status == 4 || m_state->m_status == 5) { + float f = m_cameraTransitionTime - p_time + 3000.0f; if (f >= 0) { float f2 = f / -3000.0f + 1; if (f2 < 0) { @@ -429,7 +429,7 @@ void Helicopter::Animate(float p_time) m_world->GetCameraController()->TransformPointOfView(mat, 0); } else { - if (m_state->m_unk0x08 == 4) { + if (m_state->m_status == 4) { ((Act3*) m_world)->FUN_10073400(); } else { @@ -491,8 +491,8 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) // FUNCTION: LEGO1 0x10004640 void Helicopter::StartGoodEndingCamera(const Matrix4& p_matrix) { - if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { - m_state->m_unk0x08 = 4; + if (m_state->m_status != 4 && m_state->m_status != 5) { + m_state->m_status = 4; SetupCameraTransition(p_matrix); } } @@ -500,8 +500,8 @@ void Helicopter::StartGoodEndingCamera(const Matrix4& p_matrix) // FUNCTION: LEGO1 0x10004670 void Helicopter::StartBadEndingCamera(const Matrix4& p_matrix) { - if (m_state->m_unk0x08 != 4 && m_state->m_unk0x08 != 5) { - m_state->m_unk0x08 = 5; + if (m_state->m_status != 4 && m_state->m_status != 5) { + m_state->m_status = 5; SetupCameraTransition(p_matrix); } } diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 2cdf2d4c..130d1fb0 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -650,7 +650,7 @@ MxLong Act3::Notify(MxParam& p_param) m_state->m_state = Act3State::e_initial; Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); m_copter->HandleClick(); - m_copter->m_state->m_unk0x08 = 1; + m_copter->m_state->m_status = 1; m_copter->HandleEndAnim((LegoEndAnimNotificationParam&) param); } break; From 274e2ddfe008222c4ec0e894e31ad5755f44eb8b Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:00:01 +0100 Subject: [PATCH 04/11] Rename cameraTransition variables --- LEGO1/lego/legoomni/include/helicopter.h | 8 +++--- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 26 +++++++++---------- LEGO1/lego/legoomni/src/worlds/act3.cpp | 8 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 8b2b08c7..ceced18d 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -88,10 +88,10 @@ class Helicopter : public IslePathActor { protected: void SetupCameraTransition(const Matrix4& p_matrix); - MxMatrix m_unk0x160; // 0x160 - MxMatrix m_unk0x1a8; // 0x1a8 - float m_unk0x1f0; // 0x1f0 - MxQuaternionTransformer m_unk0x1f4; // 0x1f4 + MxMatrix m_cameraTransitionStartMatrix; // 0x160 + MxMatrix m_cameraTransitionEndMatrix; // 0x1a8 + float m_cameraTransitionTime; // 0x1f0 + MxQuaternionTransformer m_cameraTransitionInterpolator; // 0x1f4 HelicopterState* m_state; // 0x228 MxAtomId m_script; // 0x22c }; diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 4687a7e6..6adfc618 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -414,12 +414,12 @@ void Helicopter::Animate(float p_time) } MxMatrix mat; - Vector3 v1(m_unk0x160[3]); + Vector3 v1(m_cameraTransitionStartMatrix[3]); Vector3 v2(mat[3]); - Vector3 v3(m_unk0x1a8[3]); + Vector3 v3(m_cameraTransitionEndMatrix[3]); mat.SetIdentity(); - m_unk0x1f4.InterpolateToMatrix(mat, f2); + m_cameraTransitionInterpolator.InterpolateToMatrix(mat, f2); v2 = v3; v2 -= v1; @@ -452,15 +452,15 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) Vector3 vec1(local48[3]); // local98 // esp+0x30 Vector3 vec2(local90[3]); // localac // esp+0x1c - Vector3 vec3(m_unk0x1a8[0]); // locala8 // esp+0x20 - Vector3 vec4(m_unk0x1a8[1]); // localb8 // esp+0x10 - Vector3 vec5(m_unk0x1a8[2]); // EDI + Vector3 vec3(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 + Vector3 vec4(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 + Vector3 vec5(m_cameraTransitionEndMatrix[2]); // EDI // the typecast makes this function match for unknown reasons - Vector3 vec6((const float*) m_unk0x1a8[3]); // locala0 // esp+0x28 + Vector3 vec6((const float*) m_cameraTransitionEndMatrix[3]); // locala0 // esp+0x28 m_world->GetCameraController()->GetPointOfView(local48); - m_unk0x1a8.SetIdentity(); + m_cameraTransitionEndMatrix.SetIdentity(); local90 = p_matrix; vec2[1] += 20.0f; @@ -476,16 +476,16 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) vec4.EqualsCross(vec5, vec3); vec6 = vec2; - local90 = m_unk0x1a8; - m_unk0x160 = local48; + local90 = m_cameraTransitionEndMatrix; + m_cameraTransitionStartMatrix = local48; vec1.Clear(); vec2.Clear(); - m_unk0x1f0 = Timer()->GetTime(); + m_cameraTransitionTime = Timer()->GetTime(); - m_unk0x1f4.SetStartEnd(local48, local90); - m_unk0x1f4.NormalizeDirection(); + m_cameraTransitionInterpolator.SetStartEnd(local48, local90); + m_cameraTransitionInterpolator.NormalizeDirection(); } // FUNCTION: LEGO1 0x10004640 diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 130d1fb0..b057201a 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -789,9 +789,9 @@ void Act3::GoodEnding(const Matrix4& p_destination) DebugCopter( m_copter->GetROI()->GetLocal2World(), p_destination, - m_copter->m_unk0x160, - m_copter->m_unk0x1a8, - m_copter->m_unk0x1f4 + m_copter->m_cameraTransitionStartMatrix, + m_copter->m_cameraTransitionEndMatrix, + m_copter->m_cameraTransitionInterpolator ); #else m_state->m_state = Act3State::e_goodEnding; @@ -874,7 +874,7 @@ void Act3::BadEnding(const Matrix4& p_destination) p_destination, m_copter->m_unk0x160, m_copter->m_unk0x1a8, - m_copter->m_unk0x1f4 + m_copter->m_cameraTransitionInterpolator ); } From 695d1076c98ca84104dff851e21deacf4c531c60 Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:00:29 +0100 Subject: [PATCH 05/11] Auto-formatting --- LEGO1/lego/legoomni/include/helicopter.h | 10 +++++----- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index ceced18d..4096a7d8 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -88,12 +88,12 @@ class Helicopter : public IslePathActor { protected: void SetupCameraTransition(const Matrix4& p_matrix); - MxMatrix m_cameraTransitionStartMatrix; // 0x160 - MxMatrix m_cameraTransitionEndMatrix; // 0x1a8 - float m_cameraTransitionTime; // 0x1f0 + MxMatrix m_cameraTransitionStartMatrix; // 0x160 + MxMatrix m_cameraTransitionEndMatrix; // 0x1a8 + float m_cameraTransitionTime; // 0x1f0 MxQuaternionTransformer m_cameraTransitionInterpolator; // 0x1f4 - HelicopterState* m_state; // 0x228 - MxAtomId m_script; // 0x22c + HelicopterState* m_state; // 0x228 + MxAtomId m_script; // 0x22c }; #endif // HELICOPTER_H diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 6adfc618..896a5ce6 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -450,8 +450,8 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) MxMatrix local48; MxMatrix local90; - Vector3 vec1(local48[3]); // local98 // esp+0x30 - Vector3 vec2(local90[3]); // localac // esp+0x1c + Vector3 vec1(local48[3]); // local98 // esp+0x30 + Vector3 vec2(local90[3]); // localac // esp+0x1c Vector3 vec3(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 Vector3 vec4(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 Vector3 vec5(m_cameraTransitionEndMatrix[2]); // EDI From 1955b342bafd2f52a7ac6dc8a60b7bcb90b27ccb Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:26:20 +0100 Subject: [PATCH 06/11] Renaming local variables in HandleControl --- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 896a5ce6..7358926d 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -261,11 +261,11 @@ MxLong Helicopter::HandleControl(LegoControlManagerNotificationParam& p_param) lookat *= 3.0f; location += lookat; - Mx3DPointFloat v68, va4, up; - Mx3DPointFloat v90(0, 1, 0); - v68 = m_world->GetCameraController()->GetWorldUp(); - va4.EqualsCross(v68, direction); - up.EqualsCross(va4, v90); + Mx3DPointFloat cameraUp, right, up; + Mx3DPointFloat worldUp(0, 1, 0); + cameraUp = m_world->GetCameraController()->GetWorldUp(); + right.EqualsCross(cameraUp, direction); + up.EqualsCross(right, worldUp); if (isPizza) { if (((Act3*) m_world)->ShootPizza(m_pathController, location, direction, up) != SUCCESS) { From 03d14decef09b372603da50cd7f8ce0f8eb5ea04 Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:26:35 +0100 Subject: [PATCH 07/11] Renaming local variables in VTable0x74 --- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 7358926d..122073fd 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -403,30 +403,30 @@ void Helicopter::VTable0x74(Matrix4& p_transform) void Helicopter::Animate(float p_time) { if (m_state->m_status == 4 || m_state->m_status == 5) { - float f = m_cameraTransitionTime - p_time + 3000.0f; - if (f >= 0) { - float f2 = f / -3000.0f + 1; - if (f2 < 0) { - f2 = 0; + float remainingTime = m_cameraTransitionTime - p_time + 3000.0f; + if (remainingTime >= 0) { + float interpolationFactor = remainingTime / -3000.0f + 1; + if (interpolationFactor < 0) { + interpolationFactor = 0; } - if (f2 > 1.0f) { - f2 = 1.0f; + if (interpolationFactor > 1.0f) { + interpolationFactor = 1.0f; } - MxMatrix mat; - Vector3 v1(m_cameraTransitionStartMatrix[3]); - Vector3 v2(mat[3]); - Vector3 v3(m_cameraTransitionEndMatrix[3]); + MxMatrix transform; + Vector3 startPosition(m_cameraTransitionStartMatrix[3]); + Vector3 interpolatedPosition(transform[3]); + Vector3 endPosition(m_cameraTransitionEndMatrix[3]); - mat.SetIdentity(); - m_cameraTransitionInterpolator.InterpolateToMatrix(mat, f2); + transform.SetIdentity(); + m_cameraTransitionInterpolator.InterpolateToMatrix(transform, interpolationFactor); - v2 = v3; - v2 -= v1; - v2 *= f2; - v2 += v1; + interpolatedPosition = endPosition; + interpolatedPosition -= startPosition; + interpolatedPosition *= interpolationFactor; + interpolatedPosition += startPosition; - m_world->GetCameraController()->TransformPointOfView(mat, 0); + m_world->GetCameraController()->TransformPointOfView(transform, 0); } else { if (m_state->m_status == 4) { From 55bbc5bfbe7d55b027e4005f3823d5d7c5fcb5cb Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:26:46 +0100 Subject: [PATCH 08/11] Renaming local variables in Animate --- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index 122073fd..de6f94ec 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -447,44 +447,44 @@ void Helicopter::Animate(float p_time) // FUNCTION: LEGO1 0x100042a0 void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) { - MxMatrix local48; - MxMatrix local90; + MxMatrix startMatrix; + MxMatrix endMatrix; - Vector3 vec1(local48[3]); // local98 // esp+0x30 - Vector3 vec2(local90[3]); // localac // esp+0x1c - Vector3 vec3(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 - Vector3 vec4(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 - Vector3 vec5(m_cameraTransitionEndMatrix[2]); // EDI + Vector3 startPos(startMatrix[3]); // local98 // esp+0x30 + Vector3 endPos(endMatrix[3]); // localac // esp+0x1c + Vector3 endMatrixX(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 + Vector3 endMatrixY(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 + Vector3 endMatrixZ(m_cameraTransitionEndMatrix[2]); // EDI // the typecast makes this function match for unknown reasons - Vector3 vec6((const float*) m_cameraTransitionEndMatrix[3]); // locala0 // esp+0x28 + Vector3 endMatrixPos((const float*) m_cameraTransitionEndMatrix[3]); // locala0 // esp+0x28 - m_world->GetCameraController()->GetPointOfView(local48); + m_world->GetCameraController()->GetPointOfView(startMatrix); m_cameraTransitionEndMatrix.SetIdentity(); - local90 = p_matrix; + endMatrix = p_matrix; - vec2[1] += 20.0f; - vec4 = vec2; - vec4 -= vec1; - vec4.Unitize(); + endPos[1] += 20.0f; + endMatrixY = endPos; + endMatrixY -= startPos; + endMatrixY.Unitize(); - vec5[0] = vec5[2] = 0.0f; - vec5[1] = -1.0f; + endMatrixZ[0] = endMatrixZ[2] = 0.0f; + endMatrixZ[1] = -1.0f; - vec3.EqualsCross(vec4, vec5); - vec3.Unitize(); - vec4.EqualsCross(vec5, vec3); - vec6 = vec2; + endMatrixX.EqualsCross(endMatrixY, endMatrixZ); + endMatrixX.Unitize(); + endMatrixY.EqualsCross(endMatrixZ, endMatrixX); + endMatrixPos = endPos; - local90 = m_cameraTransitionEndMatrix; - m_cameraTransitionStartMatrix = local48; + endMatrix = m_cameraTransitionEndMatrix; + m_cameraTransitionStartMatrix = startMatrix; - vec1.Clear(); - vec2.Clear(); + startPos.Clear(); + endPos.Clear(); m_cameraTransitionTime = Timer()->GetTime(); - m_cameraTransitionInterpolator.SetStartEnd(local48, local90); + m_cameraTransitionInterpolator.SetStartEnd(startMatrix, endMatrix); m_cameraTransitionInterpolator.NormalizeDirection(); } From 45e325e3a66d4cee137049db694db456b5e28f11 Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:29:10 +0100 Subject: [PATCH 09/11] Auto-formatting --- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index de6f94ec..f48e25cc 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -450,11 +450,11 @@ void Helicopter::SetupCameraTransition(const Matrix4& p_matrix) MxMatrix startMatrix; MxMatrix endMatrix; - Vector3 startPos(startMatrix[3]); // local98 // esp+0x30 - Vector3 endPos(endMatrix[3]); // localac // esp+0x1c - Vector3 endMatrixX(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 - Vector3 endMatrixY(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 - Vector3 endMatrixZ(m_cameraTransitionEndMatrix[2]); // EDI + Vector3 startPos(startMatrix[3]); // local98 // esp+0x30 + Vector3 endPos(endMatrix[3]); // localac // esp+0x1c + Vector3 endMatrixX(m_cameraTransitionEndMatrix[0]); // locala8 // esp+0x20 + Vector3 endMatrixY(m_cameraTransitionEndMatrix[1]); // localb8 // esp+0x10 + Vector3 endMatrixZ(m_cameraTransitionEndMatrix[2]); // EDI // the typecast makes this function match for unknown reasons Vector3 endMatrixPos((const float*) m_cameraTransitionEndMatrix[3]); // locala0 // esp+0x28 From b855b4629fb688adfb509b152f0d02012384d30c Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:29:37 +0100 Subject: [PATCH 10/11] Fix Act3 renaming error --- LEGO1/lego/legoomni/src/worlds/act3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index b057201a..6fc1588e 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -872,8 +872,8 @@ void Act3::BadEnding(const Matrix4& p_destination) DebugCopter( m_copter->GetROI()->GetLocal2World(), p_destination, - m_copter->m_unk0x160, - m_copter->m_unk0x1a8, + m_copter->m_cameraTransitionStartMatrix, + m_copter->m_cameraTransitionEndMatrix, m_copter->m_cameraTransitionInterpolator ); } From c2629ced7cd4872553fba59b8bafa2daee299aca Mon Sep 17 00:00:00 2001 From: Sebastian Mischke Date: Thu, 8 Jan 2026 00:38:25 +0100 Subject: [PATCH 11/11] Add documentation for m_status --- LEGO1/lego/legoomni/include/helicopter.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 4096a7d8..fddd69b6 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -41,6 +41,13 @@ class HelicopterState : public LegoState { // SYNTHETIC: LEGO1 0x1000e190 // HelicopterState::`scalar deleting destructor' + // Status of the helicopter: + // 0: Landed + // 1: Taking off + // 2: In the air + // 3: Landing + // 4: Good ending + // 5: Bad ending MxU32 m_status; // 0x08 };