Trigger RigidBodyBullet space override updates when Area properties change.

(cherry picked from commit 41d85ed5a9)
This commit is contained in:
Marcel Admiraal 2020-09-27 16:10:12 +01:00 committed by Rémi Verschelde
parent 84af1d9248
commit 2176b694ac
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -96,8 +96,14 @@ void AreaBullet::dispatch_callbacks() {
otherObj.object->on_exit_area(this); otherObj.object->on_exit_area(this);
overlappingObjects.remove(i); // Remove after callback overlappingObjects.remove(i); // Remove after callback
break; break;
case OVERLAP_STATE_INSIDE: {
if (otherObj.object->getType() == TYPE_RIGID_BODY) {
RigidBodyBullet *body = static_cast<RigidBodyBullet *>(otherObj.object);
body->scratch_space_override_modificator();
}
break;
}
case OVERLAP_STATE_DIRTY: case OVERLAP_STATE_DIRTY:
case OVERLAP_STATE_INSIDE:
break; break;
} }
} }
@ -255,6 +261,7 @@ void AreaBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant &
default: default:
WARN_PRINT("Area doesn't support this parameter in the Bullet backend: " + itos(p_param)); WARN_PRINT("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
} }
scratch();
} }
Variant AreaBullet::get_param(PhysicsServer::AreaParameter p_param) const { Variant AreaBullet::get_param(PhysicsServer::AreaParameter p_param) const {