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