mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-19 19:46:37 +00:00
Fix compilation after master merge
This commit is contained in:
parent
277c179fe9
commit
380d357d02
2 changed files with 12 additions and 3 deletions
|
@ -326,7 +326,16 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
const osg::Quat rotate = rotateController->getRotate();
|
const osg::Quat rotate = rotateController->getRotate();
|
||||||
const osg::Vec3f offset = rotateController->getOffset();
|
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();
|
const osg::Quat worldOrientInverse = worldOrient.inverse();
|
||||||
|
|
||||||
mBlendStartTrans -= worldOrientInverse * offset;
|
mBlendStartTrans -= worldOrientInverse * offset;
|
||||||
|
|
|
@ -20,8 +20,6 @@ namespace MWRender
|
||||||
public:
|
public:
|
||||||
RotateController(osg::Node* relativeTo);
|
RotateController(osg::Node* relativeTo);
|
||||||
|
|
||||||
osg::Quat getWorldOrientation(osg::Node* node);
|
|
||||||
|
|
||||||
void setEnabled(bool enabled);
|
void setEnabled(bool enabled);
|
||||||
void setOffset(const osg::Vec3f& offset);
|
void setOffset(const osg::Vec3f& offset);
|
||||||
void setRotate(const osg::Quat& rotate);
|
void setRotate(const osg::Quat& rotate);
|
||||||
|
@ -30,6 +28,8 @@ namespace MWRender
|
||||||
|
|
||||||
const osg::Quat getRotate() const { return mRotate; }
|
const osg::Quat getRotate() const { return mRotate; }
|
||||||
|
|
||||||
|
osg::Node* getRelativeTo() const { return mRelativeTo; }
|
||||||
|
|
||||||
void operator()(osg::MatrixTransform* node, osg::NodeVisitor* nv);
|
void operator()(osg::MatrixTransform* node, osg::NodeVisitor* nv);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue