Fix compilation after master merge

pull/3236/head
Sam Hellawell 6 months ago
parent 277c179fe9
commit 380d357d02

@ -326,7 +326,16 @@ namespace MWRender
{
const osg::Quat rotate = rotateController->getRotate();
const osg::Vec3f offset = rotateController->getOffset();
const osg::Quat worldOrient = rotateController->getWorldOrientation(node) * rotate.inverse();
osg::NodePathList nodepaths = node->getParentalNodePaths(rotateController->getRelativeTo());
osg::Quat worldOrient;
if (!nodepaths.empty())
{
osg::Matrixf worldMat = osg::computeLocalToWorld(nodepaths[0]);
worldOrient = worldMat.getRotate();
}
worldOrient = worldOrient * rotate.inverse();
const osg::Quat worldOrientInverse = worldOrient.inverse();
mBlendStartTrans -= worldOrientInverse * offset;

@ -20,8 +20,6 @@ namespace MWRender
public:
RotateController(osg::Node* relativeTo);
osg::Quat getWorldOrientation(osg::Node* node);
void setEnabled(bool enabled);
void setOffset(const osg::Vec3f& offset);
void setRotate(const osg::Quat& rotate);
@ -30,6 +28,8 @@ namespace MWRender
const osg::Quat getRotate() const { return mRotate; }
osg::Node* getRelativeTo() const { return mRelativeTo; }
void operator()(osg::MatrixTransform* node, osg::NodeVisitor* nv);
protected:

Loading…
Cancel
Save