From ea68494d6aee4e2c90084241637085e124b313fb Mon Sep 17 00:00:00 2001 From: jonschz Date: Tue, 30 Apr 2024 20:58:47 +0200 Subject: [PATCH] 100 % on FUN_10010510 --- LEGO1/lego/legoomni/src/actors/skateboard.cpp | 5 +---- LEGO1/lego/sources/anim/legoanim.cpp | 2 +- LEGO1/realtime/matrix.h | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 9a716507..115a0de9 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -148,10 +148,7 @@ void SkateBoard::FUN_10010510() if (m_act1state->m_unk0x022 == '\0') { m_act1state->m_unk0x022 = 1; MxMatrix matrix = MxMatrix(CurrentActor()->GetROI()->GetLocal2World()); - float x = 2.5 * matrix[2][0]; - float z = 2.5 * matrix[2][2]; - float y = 0.2 + matrix[2][1]; - matrix.TranslateBy(&x, &y, &z); + matrix.TranslateBy(2.5 * matrix[2][0], 0.2 + matrix[2][1], 2.5 * matrix[2][2]); AnimationManager() ->FUN_10060dc0(IsleScript::c_sns008in_RunAnim, &matrix, '\x01', '\0', NULL, 0, TRUE, TRUE, '\x01'); } diff --git a/LEGO1/lego/sources/anim/legoanim.cpp b/LEGO1/lego/sources/anim/legoanim.cpp index 202f0236..92de53ae 100644 --- a/LEGO1/lego/sources/anim/legoanim.cpp +++ b/LEGO1/lego/sources/anim/legoanim.cpp @@ -515,7 +515,7 @@ inline void LegoAnimNodeData::GetTranslation( break; } - p_matrix.TranslateBy(&x, &y, &z); + p_matrix.TranslateBy(x, y, z); } // FUNCTION: LEGO1 0x100a06f0 diff --git a/LEGO1/realtime/matrix.h b/LEGO1/realtime/matrix.h index 1e14db26..4e114c34 100644 --- a/LEGO1/realtime/matrix.h +++ b/LEGO1/realtime/matrix.h @@ -74,11 +74,11 @@ class Matrix4 { } // vtable+0x2c // FUNCTION: LEGO1 0x10002460 - virtual void TranslateBy(const float* p_x, const float* p_y, const float* p_z) + virtual void TranslateBy(const float &p_x, const float &p_y, const float &p_z) { - m_data[3][0] += *p_x; - m_data[3][1] += *p_y; - m_data[3][2] += *p_z; + m_data[3][0] += p_x; + m_data[3][1] += p_y; + m_data[3][2] += p_z; } // vtable+0x30 // FUNCTION: LEGO1 0x100024a0