Merge pull request #13212 from AndreaCatania/margin

Removed shape margin
This commit is contained in:
Rémi Verschelde 2017-11-23 15:01:13 +01:00 committed by GitHub
commit ee3179fc5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -285,10 +285,10 @@ void RigidCollisionObjectBullet::on_shapes_changed() {
const int size = shapes.size(); const int size = shapes.size();
for (i = 0; i < size; ++i) { for (i = 0; i < size; ++i) {
shpWrapper = &shapes[i]; shpWrapper = &shapes[i];
if (shpWrapper->active) {
if (!shpWrapper->bt_shape) { if (!shpWrapper->bt_shape) {
shpWrapper->bt_shape = shpWrapper->shape->create_bt_shape(); shpWrapper->bt_shape = shpWrapper->shape->create_bt_shape();
} }
if (shpWrapper->active) {
compoundShape->addChildShape(shpWrapper->transform, shpWrapper->bt_shape); compoundShape->addChildShape(shpWrapper->transform, shpWrapper->bt_shape);
} else { } else {
compoundShape->addChildShape(shpWrapper->transform, BulletPhysicsServer::get_empty_shape()); compoundShape->addChildShape(shpWrapper->transform, BulletPhysicsServer::get_empty_shape());

View file

@ -45,6 +45,7 @@ ShapeBullet::~ShapeBullet() {}
btCollisionShape *ShapeBullet::prepare(btCollisionShape *p_btShape) const { btCollisionShape *ShapeBullet::prepare(btCollisionShape *p_btShape) const {
p_btShape->setUserPointer(const_cast<ShapeBullet *>(this)); p_btShape->setUserPointer(const_cast<ShapeBullet *>(this));
p_btShape->setMargin(0.);
return p_btShape; return p_btShape;
} }