|
|
|
@ -158,7 +158,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
|
|
|
|
|
mShape->mAutogenerated = hasAutoGeneratedCollision(node);
|
|
|
|
|
|
|
|
|
|
//do a first pass
|
|
|
|
|
handleNode(node,0,false,false,false);
|
|
|
|
|
handleNode(node,0,false,false);
|
|
|
|
|
|
|
|
|
|
if(mBoundingBox != NULL)
|
|
|
|
|
{
|
|
|
|
@ -232,7 +232,7 @@ bool ManualBulletShapeLoader::hasAutoGeneratedCollision(Nif::Node const * rootNo
|
|
|
|
|
|
|
|
|
|
void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
|
|
|
|
|
bool isCollisionNode,
|
|
|
|
|
bool raycasting, bool isMarker, bool isAnimated)
|
|
|
|
|
bool raycasting, bool isAnimated)
|
|
|
|
|
{
|
|
|
|
|
// Accumulate the flags from all the child nodes. This works for all
|
|
|
|
|
// the flags we currently use, at least.
|
|
|
|
@ -254,13 +254,6 @@ void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
|
|
|
|
|
if(node->recType == Nif::RC_AvoidNode)
|
|
|
|
|
flags |= 0x800;
|
|
|
|
|
|
|
|
|
|
// Marker objects
|
|
|
|
|
/// \todo don't do this in the editor
|
|
|
|
|
std::string nodename = node->name;
|
|
|
|
|
Misc::StringUtils::toLower(nodename);
|
|
|
|
|
if (nodename.find("marker") != std::string::npos)
|
|
|
|
|
isMarker = true;
|
|
|
|
|
|
|
|
|
|
// Check for extra data
|
|
|
|
|
Nif::Extra const *e = node;
|
|
|
|
|
while (!e->extra.empty())
|
|
|
|
@ -285,12 +278,11 @@ void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
|
|
|
|
|
// Marker objects. These are only visible in the
|
|
|
|
|
// editor. Until and unless we add an editor component to
|
|
|
|
|
// the engine, just skip this entire node.
|
|
|
|
|
isMarker = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( (isCollisionNode || (mShape->mAutogenerated && !raycasting))
|
|
|
|
|
&& (!isMarker || (!mShape->mAutogenerated && !raycasting)))
|
|
|
|
|
if (isCollisionNode || (mShape->mAutogenerated && !raycasting))
|
|
|
|
|
{
|
|
|
|
|
// NOTE: a trishape with hasBounds=true, but no BBoxCollision flag should NOT go through handleNiTriShape!
|
|
|
|
|
// It must be ignored completely.
|
|
|
|
@ -319,7 +311,7 @@ void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
|
|
|
|
|
for(size_t i = 0;i < list.length();i++)
|
|
|
|
|
{
|
|
|
|
|
if(!list[i].empty())
|
|
|
|
|
handleNode(list[i].getPtr(), flags, isCollisionNode, raycasting, isMarker, isAnimated);
|
|
|
|
|
handleNode(list[i].getPtr(), flags, isCollisionNode, raycasting, isAnimated);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|