void Area2DSW::set_space_override_mode(Physics2DServer::AreaSpaceOverrideMode p_mode) { bool do_override=p_mode!=Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED; if (do_override==(space_override_mode!=Physics2DServer::AREA_SPACE_OVERRIDE_DISABLED)) return; _unregister_shapes(); space_override_mode=p_mode; _shape_changed(); }
void AreaSW::set_monitor_callback(ObjectID p_id, const StringName& p_method) { if (p_id==monitor_callback_id) { monitor_callback_method=p_method; return; } _unregister_shapes(); monitor_callback_id=p_id; monitor_callback_method=p_method; monitored_bodies.clear(); _shape_changed(); }
void AreaSW::set_area_monitor_callback(ObjectID p_id, const StringName &p_method) { if (p_id == area_monitor_callback_id) { area_monitor_callback_method = p_method; return; } _unregister_shapes(); area_monitor_callback_id = p_id; area_monitor_callback_method = p_method; monitored_bodies.clear(); monitored_areas.clear(); _shape_changed(); if (!moved_list.in_list() && get_space()) get_space()->area_add_to_moved_list(&moved_list); }
void CollisionShape::set_shape(const Ref<Shape> &p_shape) { if (!shape.is_null()) { shape->unregister_owner(this); shape->disconnect("changed", this, "_shape_changed"); } shape = p_shape; if (!shape.is_null()) { shape->register_owner(this); shape->connect("changed", this, "_shape_changed"); } update_gizmo(); if (parent) { parent->shape_owner_clear_shapes(owner_id); if (shape.is_valid()) { parent->shape_owner_add_shape(owner_id, shape); } } if (is_inside_tree()) _shape_changed(); update_configuration_warning(); }