mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
create static functions to set/get hidden node mask; compromise on magic numbers to make things easier to understand
This commit is contained in:
parent
e1a5435531
commit
68549828b4
7 changed files with 30 additions and 15 deletions
|
@ -269,12 +269,14 @@ void UVController::apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
|
|||
}
|
||||
}
|
||||
|
||||
VisController::VisController(const Nif::NiVisData *data)
|
||||
VisController::VisController(const Nif::NiVisData *data, unsigned int mask)
|
||||
: mData(data->mVis)
|
||||
, mMask(mask)
|
||||
{
|
||||
}
|
||||
|
||||
VisController::VisController()
|
||||
: mMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -282,6 +284,7 @@ VisController::VisController(const VisController ©, const osg::CopyOp ©o
|
|||
: osg::NodeCallback(copy, copyop)
|
||||
, Controller(copy)
|
||||
, mData(copy.mData)
|
||||
, mMask(copy.mMask)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -303,8 +306,7 @@ void VisController::operator() (osg::Node* node, osg::NodeVisitor* nv)
|
|||
if (hasInput())
|
||||
{
|
||||
bool vis = calculate(getInputValue(nv));
|
||||
// Leave 0x1 enabled for UpdateVisitor, so we can make ourselves visible again in the future from this update callback
|
||||
node->setNodeMask(vis ? ~0 : 0x1);
|
||||
node->setNodeMask(vis ? ~0 : mMask);
|
||||
}
|
||||
traverse(node, nv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue