From 79bd6309a525c0ff5b9b0ecc4513fc5246836515 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 7 Nov 2024 16:53:03 +0100 Subject: [PATCH] Apply rotation when computing the bounding box of a paged reference --- apps/openmw/mwrender/renderingmanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 4268a6b7e4e..eb73f9ac5a3 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -1687,6 +1687,10 @@ namespace MWRender const float refScale = ptr.getCellRef().getScale(); rootNode->setScale({ refScale, refScale, refScale }); + const auto& rotation = ptr.getCellRef().getPosition().rot; + if (!ptr.getClass().isActor()) + rootNode->setAttitude(osg::Quat(rotation[0], osg::Vec3(-1, 0, 0)) + * osg::Quat(rotation[1], osg::Vec3(0, -1, 0)) * osg::Quat(rotation[2], osg::Vec3(0, 0, -1))); rootNode->setPosition(ptr.getCellRef().getPosition().asVec3()); osg::ref_ptr animation = nullptr;