mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-17 11:43:25 +00:00
Avoid dynamic cast in duplicateCollisionShape
This commit is contained in:
parent
ca8584f6f6
commit
80e3623d9a
@ -32,11 +32,17 @@ namespace
|
||||
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));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (shape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE)
|
||||
return new btHeightfieldTerrainShape(static_cast<const btHeightfieldTerrainShape&>(*shape));
|
||||
|
Loading…
x
Reference in New Issue
Block a user