From 3277ef26dab02aeca1668f0bf1be33cde8edb6e1 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 21 Mar 2013 21:08:23 +0100 Subject: [PATCH] Fix a crash when dropping objects without a collision shape --- libs/openengine/bullet/physic.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index c4947af1e..864199676 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -603,6 +603,14 @@ namespace Physic btTransform trans; trans.setIdentity(); - shape->mCollisionShape->getAabb(trans, min, max); + if (shape->mRaycastingShape) + shape->mRaycastingShape->getAabb(trans, min, max); + else if (shape->mCollisionShape) + shape->mCollisionShape->getAabb(trans, min, max); + else + { + min = btVector3(0,0,0); + max = btVector3(0,0,0); + } } }}