forked from mirror/openmw-tes3mp
Deal with empty meshes
This commit is contained in:
parent
83e9a649e5
commit
d68ea994d5
1 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,9 @@ public:
|
||||||
|
|
||||||
osg::ref_ptr<BulletShape> getShape()
|
osg::ref_ptr<BulletShape> getShape()
|
||||||
{
|
{
|
||||||
|
if (!mTriangleMesh)
|
||||||
|
return osg::ref_ptr<BulletShape>();
|
||||||
|
|
||||||
osg::ref_ptr<BulletShape> shape (new BulletShape);
|
osg::ref_ptr<BulletShape> shape (new BulletShape);
|
||||||
TriangleMeshShape* meshShape = new TriangleMeshShape(mTriangleMesh, true);
|
TriangleMeshShape* meshShape = new TriangleMeshShape(mTriangleMesh, true);
|
||||||
shape->mCollisionShape = meshShape;
|
shape->mCollisionShape = meshShape;
|
||||||
|
@ -134,6 +137,8 @@ osg::ref_ptr<BulletShapeInstance> BulletShapeManager::createInstance(const std::
|
||||||
NodeToShapeVisitor visitor;
|
NodeToShapeVisitor visitor;
|
||||||
node->accept(visitor);
|
node->accept(visitor);
|
||||||
shape = visitor.getShape();
|
shape = visitor.getShape();
|
||||||
|
if (!shape)
|
||||||
|
return osg::ref_ptr<BulletShapeInstance>();
|
||||||
}
|
}
|
||||||
|
|
||||||
mIndex[normalized] = shape;
|
mIndex[normalized] = shape;
|
||||||
|
|
Loading…
Reference in a new issue