diff options
author | Andrea Catania <info@andreacatania.com> | 2018-09-10 07:55:11 +0200 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2018-09-10 07:55:11 +0200 |
commit | b252e66414c2dc70f5e36045e4f0144dd29147cc (patch) | |
tree | 734eee206e5fdc9ad33693a30cb59e3f2a8c3ae4 /modules/bullet/area_bullet.cpp | |
parent | af290f7b7d0ea22fbb8d4c3ca5c5a8fb72a30a7e (diff) | |
download | redot-engine-b252e66414c2dc70f5e36045e4f0144dd29147cc.tar.gz |
Fiex bullet crash
Diffstat (limited to 'modules/bullet/area_bullet.cpp')
-rw-r--r-- | modules/bullet/area_bullet.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp index f1da454e2e..3200b4a214 100644 --- a/modules/bullet/area_bullet.cpp +++ b/modules/bullet/area_bullet.cpp @@ -30,6 +30,7 @@ #include "area_bullet.h" +#include "bullet_physics_server.h" #include "bullet_types_converter.h" #include "bullet_utilities.h" #include "collision_object_bullet.h" @@ -57,6 +58,7 @@ AreaBullet::AreaBullet() : spOv_priority(0) { btGhost = bulletnew(btGhostObject); + btGhost->setCollisionShape(BulletPhysicsServer::get_empty_shape()); setupBulletCollisionObject(btGhost); /// Collision objects with a callback still have collision response with dynamic rigid bodies. /// In order to use collision objects as trigger, you have to disable the collision response. @@ -162,7 +164,10 @@ bool AreaBullet::is_monitoring() const { } void AreaBullet::main_shape_resetted() { - btGhost->setCollisionShape(get_main_shape()); + if (get_main_shape()) + btGhost->setCollisionShape(get_main_shape()); + else + btGhost->setCollisionShape(BulletPhysicsServer::get_empty_shape()); } void AreaBullet::reload_body() { |