From 822fa73b0784694af6ceeb8d265a5d14a15e2571 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Wed, 11 May 2016 19:34:30 -0400 Subject: [PATCH] Fix camera roll in cutscenes --- src/modes/cutscene_world.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modes/cutscene_world.cpp b/src/modes/cutscene_world.cpp index 61008088c..48722f421 100644 --- a/src/modes/cutscene_world.cpp +++ b/src/modes/cutscene_world.cpp @@ -301,6 +301,12 @@ void CutsceneWorld::update(float dt) rot2.setPitch(rot2.getPitch() + 90.0f); m_camera->setRotation(rot2.toIrrVector()); + // irrlicht's "setRotation" only moves the lookat point but does not affect + // the up vector, so "roll" is lost in setRotation. Apply roll manually + irr::core::matrix4 affector; + affector.setRotationDegrees(core::vector3df(0.0f, 0.0f, rot2.z())); + m_camera->setViewMatrixAffector(affector); + SFXManager::get()->positionListener(m_camera->getAbsolutePosition(), m_camera->getTarget() - m_camera->getAbsolutePosition(),