1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 09:53:50 +00:00

Merge pull request #2813 from Capostrophic/collisionswitch

Fix collision switch node mask (again)
This commit is contained in:
Bret Curtis 2020-04-30 13:50:09 +02:00 committed by GitHub
commit 7345c89b54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -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");

View file

@ -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:

View file

@ -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;
};