From 176c550cd424df0447d09e67df100161e75a95e2 Mon Sep 17 00:00:00 2001 From: Trsdy <914137150@qq.com> Date: Thu, 4 Jan 2024 17:35:06 +0800 Subject: [PATCH] exchange matrix multiplication order --- src/Ext/TechnoType/Hooks.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Ext/TechnoType/Hooks.cpp b/src/Ext/TechnoType/Hooks.cpp index 7de1d0f279..f43f30779c 100644 --- a/src/Ext/TechnoType/Hooks.cpp +++ b/src/Ext/TechnoType/Hooks.cpp @@ -356,11 +356,9 @@ DEFINE_HOOK(0x4DB157, FootClass_DrawVoxelShadow_TurretShadow, 0x8) if (pTypeExt->TurretShadow.Get(RulesExt::Global()->DrawTurretShadow) && tur->VXL && tur->HVA) { auto mtx = pThis->Locomotor->Shadow_Matrix(0); + pTypeExt->ApplyTurretOffset(&mtx, *reinterpret_cast(0xB1D008)); + mtx.TranslateZ(-tur->HVA->Matrixes[0].GetZVal()); mtx.RotateZ(static_cast(pThis->SecondaryFacing.Current().GetRadian<32>() - pThis->PrimaryFacing.Current().GetRadian<32>())); - float x = static_cast(pTypeExt->TurretOffset.GetEx()->X / 8); - float y = static_cast(pTypeExt->TurretOffset.GetEx()->Y / 8); - float z = -tur->VXL->TailerData->MinBounds.Z; - mtx.Translate(x, y, z); Matrix3D::MatrixMultiply(&mtx, &Matrix3D::VoxelDefaultMatrix, &mtx); pThis->DrawVoxelShadow(tur, 0, angle, 0, a4, &a3, &mtx, a9, pSurface, pos);