From 4f8856f887c3823f84ad1edca75136167b312217 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Thu, 13 Jun 2024 22:24:40 +0300 Subject: [PATCH] Don't let the optimizer mess with collision switch nodes (again) --- components/nifosg/nifloader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 3245f8c4a2..7c9ff45f1e 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -741,7 +741,11 @@ namespace NifOsg } if (nifNode->recType == Nif::RC_NiCollisionSwitch && !nifNode->collisionActive()) + { node->setNodeMask(Loader::getIntersectionDisabledNodeMask()); + // Don't let the optimizer mess with this node + node->setDataVariance(osg::Object::DYNAMIC); + } osg::ref_ptr composite = new SceneUtil::CompositeStateSetUpdater;