1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 05:23:51 +00:00

Merge remote-tracking branch 'scrawl/hide_markers'

This commit is contained in:
Marc Zinnschlag 2012-09-13 13:23:07 +02:00
commit 90466fe5c9
2 changed files with 14 additions and 4 deletions

View file

@ -164,6 +164,13 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
// the flags we currently use, at least. // the flags we currently use, at least.
flags |= node->flags; flags |= node->flags;
// Marker objects: no collision
/// \todo don't do this in the editor
if (node->name.find("marker") != std::string::npos)
{
flags |= 0x800;
}
// Check for extra data // Check for extra data
Nif::Extra *e = node; Nif::Extra *e = node;
while (!e->extra.empty()) while (!e->extra.empty())
@ -178,12 +185,10 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
// affecting the entire subtree of this node // affecting the entire subtree of this node
Nif::NiStringExtraData *sd = (Nif::NiStringExtraData*)e; Nif::NiStringExtraData *sd = (Nif::NiStringExtraData*)e;
if (sd->string == "NCO" && !raycastingOnly) if (sd->string == "NCO")
{ {
// No collision. Use an internal flag setting to mark this. // No collision. Use an internal flag setting to mark this.
// We ignor this node!
flags |= 0x800; flags |= 0x800;
return;
} }
else if (sd->string == "MRK" && !raycastingOnly) else if (sd->string == "MRK" && !raycastingOnly)
// Marker objects. These are only visible in the // Marker objects. These are only visible in the
@ -229,7 +234,7 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
} }
else if (node->recType == Nif::RC_NiTriShape && (isCollisionNode || !hasCollisionNode)) else if (node->recType == Nif::RC_NiTriShape && (isCollisionNode || !hasCollisionNode))
{ {
cShape->collide = true; cShape->collide = !(flags&0x800);
handleNiTriShape(dynamic_cast<Nif::NiTriShape*>(node), flags,node->trafo.rotation,node->trafo.pos,node->trafo.scale,raycastingOnly); handleNiTriShape(dynamic_cast<Nif::NiTriShape*>(node), flags,node->trafo.rotation,node->trafo.pos,node->trafo.scale,raycastingOnly);
} }
else if(node->recType == Nif::RC_RootCollisionNode) else if(node->recType == Nif::RC_RootCollisionNode)

View file

@ -940,6 +940,11 @@ public:
{ {
flags |= node->flags; flags |= node->flags;
// Marker objects: just skip the entire node
/// \todo don't do this in the editor
if (node->name.find("marker") != std::string::npos)
return;
Nif::ExtraPtr e = node->extra; Nif::ExtraPtr e = node->extra;
while(!e.empty()) while(!e.empty())
{ {