Fix collision switch node mask (again)

pull/2813/head
Capostrophic 5 years ago
parent 476a74c2d3
commit 89282d14aa

@ -376,6 +376,7 @@ namespace MWRender
mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
NifOsg::Loader::setHiddenNodeMask(Mask_UpdateVisitor);
NifOsg::Loader::setIntersectionDisabledNodeMask(Mask_Effect);
mNearClip = Settings::Manager::getFloat("near clip", "Camera");
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");

@ -177,7 +177,7 @@ namespace NifOsg
void setEnabled(bool enabled)
{
setNodeMask(enabled ? ~0 : 0);
setNodeMask(enabled ? ~0 : Loader::getIntersectionDisabledNodeMask());
}
};
@ -204,6 +204,18 @@ namespace NifOsg
return sHiddenNodeMask;
}
unsigned int Loader::sIntersectionDisabledNodeMask = ~0;
void Loader::setIntersectionDisabledNodeMask(unsigned int mask)
{
sIntersectionDisabledNodeMask = mask;
}
unsigned int Loader::getIntersectionDisabledNodeMask()
{
return sIntersectionDisabledNodeMask;
}
class LoaderImpl
{
public:

@ -79,8 +79,14 @@ namespace NifOsg
static void setHiddenNodeMask(unsigned int mask);
static unsigned int getHiddenNodeMask();
// Set the mask to use for nodes that ignore the crosshair intersection. The default is the default node mask.
// This is used for NiCollisionSwitch nodes with NiCollisionSwitch state set to disabled.
static void setIntersectionDisabledNodeMask(unsigned int mask);
static unsigned int getIntersectionDisabledNodeMask();
private:
static unsigned int sHiddenNodeMask;
static unsigned int sIntersectionDisabledNodeMask;
static bool sShowMarkers;
};

Loading…
Cancel
Save