mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-06 11:11:35 +00:00
Avoid dynamic cast in duplicateCollisionShape
This commit is contained in:
parent
ca8584f6f6
commit
80e3623d9a
1 changed files with 8 additions and 2 deletions
|
@ -32,11 +32,17 @@ namespace
|
||||||
return newShape;
|
return newShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const btBvhTriangleMeshShape* trishape = dynamic_cast<const btBvhTriangleMeshShape*>(shape))
|
if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
|
||||||
|
{
|
||||||
|
const btBvhTriangleMeshShape* trishape = static_cast<const btBvhTriangleMeshShape*>(shape);
|
||||||
return new btScaledBvhTriangleMeshShape(const_cast<btBvhTriangleMeshShape*>(trishape), btVector3(1.f, 1.f, 1.f));
|
return new btScaledBvhTriangleMeshShape(const_cast<btBvhTriangleMeshShape*>(trishape), btVector3(1.f, 1.f, 1.f));
|
||||||
|
}
|
||||||
|
|
||||||
if (const btBoxShape* boxshape = dynamic_cast<const btBoxShape*>(shape))
|
if (shape->getShapeType() == BOX_SHAPE_PROXYTYPE)
|
||||||
|
{
|
||||||
|
const btBoxShape* boxshape = static_cast<const btBoxShape*>(shape);
|
||||||
return new btBoxShape(*boxshape);
|
return new btBoxShape(*boxshape);
|
||||||
|
}
|
||||||
|
|
||||||
if (shape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE)
|
if (shape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE)
|
||||||
return new btHeightfieldTerrainShape(static_cast<const btHeightfieldTerrainShape&>(*shape));
|
return new btHeightfieldTerrainShape(static_cast<const btHeightfieldTerrainShape&>(*shape));
|
||||||
|
|
Loading…
Reference in a new issue