1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-06 17:15:35 +00:00

Deal with empty meshes

This commit is contained in:
scrawl 2015-11-17 01:51:21 +01:00
parent 83e9a649e5
commit d68ea994d5

View file

@ -80,6 +80,9 @@ public:
osg::ref_ptr<BulletShape> getShape()
{
if (!mTriangleMesh)
return osg::ref_ptr<BulletShape>();
osg::ref_ptr<BulletShape> shape (new BulletShape);
TriangleMeshShape* meshShape = new TriangleMeshShape(mTriangleMesh, true);
shape->mCollisionShape = meshShape;
@ -134,6 +137,8 @@ osg::ref_ptr<BulletShapeInstance> BulletShapeManager::createInstance(const std::
NodeToShapeVisitor visitor;
node->accept(visitor);
shape = visitor.getShape();
if (!shape)
return osg::ref_ptr<BulletShapeInstance>();
}
mIndex[normalized] = shape;