Merge branch 'next' of https://github.com/zinnschlag/openmw into globalmap

This commit is contained in:
scrawl 2012-09-20 17:41:14 +02:00
commit 8214966d44
55 changed files with 1173 additions and 346 deletions

View file

@ -72,6 +72,9 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
cShape = static_cast<BulletShape *>(resource);
resourceName = cShape->getName();
cShape->collide = false;
mBoundingBox = NULL;
cShape->boxTranslation = Ogre::Vector3(0,0,0);
cShape->boxRotation = Ogre::Quaternion::IDENTITY;
mTriMesh = new btTriangleMesh();
@ -125,9 +128,14 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
delete m_meshInterface;
}
};
if(mBoundingBox != NULL)
cShape->Shape = mBoundingBox;
currentShape = new TriangleMeshShape(mTriMesh,true);
cShape->Shape = currentShape;
else
{
currentShape = new TriangleMeshShape(mTriMesh,true);
cShape->Shape = currentShape;
}
}
bool ManualBulletShapeLoader::hasRootCollisionNode(Nif::Node* node)
@ -218,6 +226,17 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
}
if(node->hasBounds)
{
btVector3 boxsize = getbtVector((node->boundXYZ));
cShape->boxTranslation = node->boundPos;
cShape->boxRotation = node->boundRot;
mBoundingBox = new btBoxShape(boxsize);
}
// For NiNodes, loop through children
if (node->recType == Nif::RC_NiNode)

View file

@ -102,8 +102,11 @@ private:
std::string resourceName;
std::string resourceGroup;
BulletShape* cShape;//current shape
btTriangleMesh *mTriMesh;
btBoxShape *mBoundingBox;
btBvhTriangleMeshShape* currentShape;//the shape curently under construction
};