Skip to content

Commit

Permalink
Merge branch 'pageswithattitude' into 'master'
Browse files Browse the repository at this point in the history
Apply rotation when computing the bounding box of a paged reference

See merge request OpenMW/openmw!4447
  • Loading branch information
psi29a committed Nov 9, 2024
2 parents 32a6ed6 + 79bd630 commit f5c457c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/openmw/mwrender/renderingmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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> animation = nullptr;
Expand Down

0 comments on commit f5c457c

Please sign in to comment.