Fiex bullet crash

This commit is contained in:
Andrea Catania
2018-09-10 07:55:11 +02:00
parent af290f7b7d
commit b252e66414
3 changed files with 12 additions and 4 deletions

View File

@ -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() {