diff --git a/components/resource/bulletshape.cpp b/components/resource/bulletshape.cpp index 5e0415e59e..3f599e5386 100644 --- a/components/resource/bulletshape.cpp +++ b/components/resource/bulletshape.cpp @@ -32,11 +32,17 @@ namespace return newShape; } - if (const btBvhTriangleMeshShape* trishape = dynamic_cast(shape)) + if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) + { + const btBvhTriangleMeshShape* trishape = static_cast(shape); return new btScaledBvhTriangleMeshShape(const_cast(trishape), btVector3(1.f, 1.f, 1.f)); + } - if (const btBoxShape* boxshape = dynamic_cast(shape)) + if (shape->getShapeType() == BOX_SHAPE_PROXYTYPE) + { + const btBoxShape* boxshape = static_cast(shape); return new btBoxShape(*boxshape); + } if (shape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE) return new btHeightfieldTerrainShape(static_cast(*shape));