mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Only build a box shape for collision nodes; use StringUtils
This commit is contained in:
parent
d7c4a622cf
commit
14964e9fcd
1 changed files with 15 additions and 11 deletions
|
@ -25,7 +25,8 @@ http://www.gnu.org/licenses/ .
|
|||
|
||||
#include <cstdio>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
#include "../nif/niffile.hpp"
|
||||
#include "../nif/node.hpp"
|
||||
|
@ -188,7 +189,7 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node *
|
|||
// Marker objects: no collision
|
||||
/// \todo don't do this in the editor
|
||||
std::string nodename = node->name;
|
||||
boost::algorithm::to_lower(nodename);
|
||||
Misc::StringUtils::toLower(nodename);
|
||||
if (nodename.find("marker") != std::string::npos)
|
||||
{
|
||||
return;
|
||||
|
@ -222,17 +223,20 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node *
|
|||
}
|
||||
}
|
||||
|
||||
if (isCollisionNode || (!hasCollisionNode && !raycasting))
|
||||
{
|
||||
if(node->hasBounds)
|
||||
{
|
||||
cShape->mBoxTranslation = node->boundPos;
|
||||
cShape->mBoxRotation = node->boundRot;
|
||||
mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ));
|
||||
}
|
||||
else if( (isCollisionNode || (!hasCollisionNode && !raycasting)) && node->recType == Nif::RC_NiTriShape)
|
||||
else if(node->recType == Nif::RC_NiTriShape)
|
||||
{
|
||||
cShape->mCollide = !(flags&0x800);
|
||||
handleNiTriShape(mesh, static_cast<const Nif::NiTriShape*>(node), flags, node->getWorldTransform(), raycasting);
|
||||
}
|
||||
}
|
||||
|
||||
// For NiNodes, loop through children
|
||||
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
|
||||
|
|
Loading…
Reference in a new issue