From 906d290935904a85d87f760eaaf14324eec3fab0 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 12 Sep 2012 12:41:12 +0200 Subject: [PATCH 1/2] Markers are actually hidden now. Inspecting the markers in NifSkope revealed why it didn't work previously: the flag that is being looked for is not present in any of the markers, nor any other flag or extra data to identify them. However, the root node name always starts with "marker", making it possible to do a string search. --- components/nifbullet/bullet_nif_loader.cpp | 5 +++++ components/nifogre/ogre_nif_loader.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/nifbullet/bullet_nif_loader.cpp b/components/nifbullet/bullet_nif_loader.cpp index 071f03630..b70404635 100644 --- a/components/nifbullet/bullet_nif_loader.cpp +++ b/components/nifbullet/bullet_nif_loader.cpp @@ -164,6 +164,11 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags, // the flags we currently use, at least. 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; + // Check for extra data Nif::Extra *e = node; while (!e->extra.empty()) diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 5a5a614ef..5127af966 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -940,6 +940,11 @@ public: { 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; while(!e.empty()) { From b5ddc8d4fb3af8d050ee852bee63a0380fed947f Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Sep 2012 13:10:02 +0200 Subject: [PATCH 2/2] Fix the marker collision; also, nodes marked with NCO are now correctly ignored for collision. --- components/nifbullet/bullet_nif_loader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/nifbullet/bullet_nif_loader.cpp b/components/nifbullet/bullet_nif_loader.cpp index b70404635..0fb758ea8 100644 --- a/components/nifbullet/bullet_nif_loader.cpp +++ b/components/nifbullet/bullet_nif_loader.cpp @@ -164,10 +164,12 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags, // the flags we currently use, at least. flags |= node->flags; - // Marker objects: just skip the entire node + // Marker objects: no collision /// \todo don't do this in the editor if (node->name.find("marker") != std::string::npos) - return; + { + flags |= 0x800; + } // Check for extra data Nif::Extra *e = node; @@ -183,12 +185,10 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags, // affecting the entire subtree of this node 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. - // We ignor this node! flags |= 0x800; - return; } else if (sd->string == "MRK" && !raycastingOnly) // Marker objects. These are only visible in the @@ -234,7 +234,7 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags, } else if (node->recType == Nif::RC_NiTriShape && (isCollisionNode || !hasCollisionNode)) { - cShape->collide = true; + cShape->collide = !(flags&0x800); handleNiTriShape(dynamic_cast(node), flags,node->trafo.rotation,node->trafo.pos,node->trafo.scale,raycastingOnly); } else if(node->recType == Nif::RC_RootCollisionNode)