mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 16:39:41 +00:00
Physics: Recognize BBoxCollision flag, but don't use it for raycasting (Fixes #1349)
This commit is contained in:
parent
e002acdeae
commit
0bed6d9d56
1 changed files with 5 additions and 8 deletions
|
@ -137,12 +137,7 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
|
||||||
|
|
||||||
handleNode(mesh2, node,0,true,true,false);
|
handleNode(mesh2, node,0,true,true,false);
|
||||||
|
|
||||||
if(mBoundingBox != NULL)
|
if (mHasShape)
|
||||||
{
|
|
||||||
mShape->mRaycastingShape = mBoundingBox;
|
|
||||||
delete mesh2;
|
|
||||||
}
|
|
||||||
else if (mHasShape)
|
|
||||||
{
|
{
|
||||||
mShape->mRaycastingShape = new TriangleMeshShape(mesh2,true);
|
mShape->mRaycastingShape = new TriangleMeshShape(mesh2,true);
|
||||||
}
|
}
|
||||||
|
@ -227,10 +222,12 @@ void ManualBulletShapeLoader::handleNode(btTriangleMesh* mesh, const Nif::Node *
|
||||||
if ( (isCollisionNode || (!mShape->mHasCollisionNode && !raycasting))
|
if ( (isCollisionNode || (!mShape->mHasCollisionNode && !raycasting))
|
||||||
&& (!isMarker || (mShape->mHasCollisionNode && !raycasting)))
|
&& (!isMarker || (mShape->mHasCollisionNode && !raycasting)))
|
||||||
{
|
{
|
||||||
|
// NOTE: a trishape with hasBounds=true, but no BBoxCollision flag should NOT go through handleNiTriShape!
|
||||||
|
// It must be ignored completely.
|
||||||
|
// (occurs in tr_ex_imp_wall_arch_04.nif)
|
||||||
if(node->hasBounds)
|
if(node->hasBounds)
|
||||||
{
|
{
|
||||||
// Checking for BBoxCollision flag causes issues with some actors :/
|
if (flags & Nif::NiNode::Flag_BBoxCollision && !raycasting)
|
||||||
if (!(node->flags & Nif::NiNode::Flag_Hidden))
|
|
||||||
{
|
{
|
||||||
mShape->mBoxTranslation = node->boundPos;
|
mShape->mBoxTranslation = node->boundPos;
|
||||||
mShape->mBoxRotation = node->boundRot;
|
mShape->mBoxRotation = node->boundRot;
|
||||||
|
|
Loading…
Reference in a new issue