mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-06 19:01:21 +03:00
Merge branch 'next' of https://github.com/zinnschlag/openmw into globalmap
This commit is contained in:
commit
8214966d44
55 changed files with 1173 additions and 346 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue