From 3d4da02b18941462211903e5db4210561e7e61a4 Mon Sep 17 00:00:00 2001 From: unelsson Date: Tue, 28 Mar 2023 23:54:26 +0300 Subject: [PATCH] Don't mess around with btEmptyShape. Use nullptr instead. --- components/resource/bulletshapemanager.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/components/resource/bulletshapemanager.cpp b/components/resource/bulletshapemanager.cpp index da0354104f..c2d38e164d 100644 --- a/components/resource/bulletshapemanager.cpp +++ b/components/resource/bulletshapemanager.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -75,22 +74,9 @@ namespace Resource osg::ref_ptr getShape() { - if (!mTriangleMesh) + if (!mTriangleMesh || mTriangleMesh->getNumTriangles() == 0) return osg::ref_ptr(); - if (mTriangleMesh->getNumTriangles() == 0) - { - osg::ref_ptr shape(new BulletShape); - mTriangleMesh.reset(nullptr); - auto emptyShape = std::make_unique(); - shape->mCollisionBox.mExtents[0] = 0.0f; - shape->mCollisionBox.mExtents[1] = 0.0f; - shape->mCollisionBox.mExtents[2] = 0.0f; - shape->mCollisionBox.mCenter = osg::Vec3f(0, 0, 0); - shape->mCollisionShape.reset(emptyShape.release()); - return shape; - } - osg::ref_ptr shape(new BulletShape); auto triangleMeshShape = std::make_unique(mTriangleMesh.release(), true);