From 8c177f0306c361f02bde0ec086870f86ce6e1e4d Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 25 Feb 2020 11:09:36 +0400 Subject: [PATCH] Take in account transformations of NiCollisionSwitch --- components/nifosg/nifloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 76fd4b656..b70391a58 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -168,10 +168,10 @@ namespace namespace NifOsg { - class CollisionSwitch : public osg::Group + class CollisionSwitch : public osg::MatrixTransform { public: - CollisionSwitch(bool enabled) : osg::Group() + CollisionSwitch(const osg::Matrixf& transformations, bool enabled) : osg::MatrixTransform(transformations) { setEnabled(enabled); } @@ -477,7 +477,7 @@ namespace NifOsg case Nif::RC_NiCollisionSwitch: { bool enabled = nifNode->flags & Nif::NiNode::Flag_ActiveCollision; - node = new CollisionSwitch(enabled); + node = new CollisionSwitch(nifNode->trafo.toMatrix(), enabled); dataVariance = osg::Object::STATIC; break;