mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 05:10:26 +00:00
Get rid of NifOsg::CollisionSwitch
This commit is contained in:
parent
899966f0d3
commit
4c9cefefdd
2 changed files with 7 additions and 34 deletions
|
@ -170,31 +170,6 @@ namespace
|
||||||
|
|
||||||
namespace NifOsg
|
namespace NifOsg
|
||||||
{
|
{
|
||||||
class CollisionSwitch : public osg::MatrixTransform
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CollisionSwitch() : osg::MatrixTransform()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CollisionSwitch(const CollisionSwitch& copy, const osg::CopyOp& copyop)
|
|
||||||
: osg::MatrixTransform(copy, copyop)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
META_Node(NifOsg, CollisionSwitch)
|
|
||||||
|
|
||||||
CollisionSwitch(const osg::Matrixf& transformations, bool enabled) : osg::MatrixTransform(transformations)
|
|
||||||
{
|
|
||||||
setEnabled(enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setEnabled(bool enabled)
|
|
||||||
{
|
|
||||||
setNodeMask(enabled ? ~0 : Loader::getIntersectionDisabledNodeMask());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bool Loader::sShowMarkers = false;
|
bool Loader::sShowMarkers = false;
|
||||||
|
|
||||||
void Loader::setShowMarkers(bool show)
|
void Loader::setShowMarkers(bool show)
|
||||||
|
@ -501,14 +476,6 @@ namespace NifOsg
|
||||||
case Nif::RC_NiBillboardNode:
|
case Nif::RC_NiBillboardNode:
|
||||||
dataVariance = osg::Object::DYNAMIC;
|
dataVariance = osg::Object::DYNAMIC;
|
||||||
break;
|
break;
|
||||||
case Nif::RC_NiCollisionSwitch:
|
|
||||||
{
|
|
||||||
bool enabled = nifNode->flags & Nif::NiNode::Flag_ActiveCollision;
|
|
||||||
node = new CollisionSwitch(nifNode->trafo.toMatrix(), enabled);
|
|
||||||
// This matrix transform must not be combined with another matrix transform.
|
|
||||||
dataVariance = osg::Object::DYNAMIC;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
// The Root node can be created as a Group if no transformation is required.
|
// The Root node can be created as a Group if no transformation is required.
|
||||||
// This takes advantage of the fact root nodes can't have additional controllers
|
// This takes advantage of the fact root nodes can't have additional controllers
|
||||||
|
@ -523,6 +490,13 @@ namespace NifOsg
|
||||||
if (!node)
|
if (!node)
|
||||||
node = new osg::MatrixTransform(nifNode->trafo.toMatrix());
|
node = new osg::MatrixTransform(nifNode->trafo.toMatrix());
|
||||||
|
|
||||||
|
if (nifNode->recType == Nif::RC_NiCollisionSwitch && !(nifNode->flags & Nif::NiNode::Flag_ActiveCollision))
|
||||||
|
{
|
||||||
|
node->setNodeMask(Loader::getIntersectionDisabledNodeMask());
|
||||||
|
// This node must not be combined with another node.
|
||||||
|
dataVariance = osg::Object::DYNAMIC;
|
||||||
|
}
|
||||||
|
|
||||||
node->setDataVariance(dataVariance);
|
node->setDataVariance(dataVariance);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
|
@ -131,7 +131,6 @@ void registerSerializers()
|
||||||
"NifOsg::StaticBoundingBoxCallback",
|
"NifOsg::StaticBoundingBoxCallback",
|
||||||
"NifOsg::GeomMorpherController",
|
"NifOsg::GeomMorpherController",
|
||||||
"NifOsg::UpdateMorphGeometry",
|
"NifOsg::UpdateMorphGeometry",
|
||||||
"NifOsg::CollisionSwitch",
|
|
||||||
"osgMyGUI::Drawable",
|
"osgMyGUI::Drawable",
|
||||||
"osg::DrawCallback",
|
"osg::DrawCallback",
|
||||||
"osgOQ::ClearQueriesCallback",
|
"osgOQ::ClearQueriesCallback",
|
||||||
|
|
Loading…
Reference in a new issue