From 5431ec77b9395a0ded2ea9b3b8307b5ce4804453 Mon Sep 17 00:00:00 2001 From: Ulysse Martin Date: Tue, 28 May 2019 00:51:40 +0200 Subject: [PATCH] UPBGE: Fix ImageRender modelview matrix picked from 302d894108c6a17c79 and tested with martinsh water demo file --- source/gameengine/VideoTexture/ImageRender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index fba92af5b28b..e8e30255b20d 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -262,7 +262,7 @@ bool ImageRender::Render() mirrorWorldX[1], mirrorWorldY[1], mirrorWorldZ[1], mirrorWorldX[2], mirrorWorldY[2], mirrorWorldZ[2]); - camtrans = mt::mat3x4(cameraWorldOri, cameraWorldPos); + camtrans = mt::mat3x4(cameraWorldOri, cameraWorldPos).Inverse(); // compute camera frustum: // get position of mirror relative to camera: offset = mirrorPos-cameraPos mt::vec3 mirrorOffset = mirrorWorldPos - cameraWorldPos; @@ -377,7 +377,7 @@ bool ImageRender::Render() m_rasterizer->SetProjectionMatrix(projmat); - const mt::mat4 viewmat = mt::mat4::FromAffineTransform(camtrans).Inverse(); + const mt::mat4 viewmat = mt::mat4::FromAffineTransform(camtrans); m_rasterizer->SetViewMatrix(viewmat);