def METHOD_NAME(osmid, tags, ref):
    """Add a new barrier to the list of barriers."""
    if 'barrier' in tags:
        settingsSection = Settings.get_section('barrier', tags['barrier'])
        if settingsSection is None:
            return
        if Settings.has_option(settingsSection, 'ignore') and Settings.get(settingsSection, 'ignore') == 'TRUE':
            return
        barrier = Barrier()
        barrier.OSMID = osmid
        barrier.type = tags['barrier']
        barrier.ref = ref
        if 'height' in tags:
            barrier.height = extract_float_from_string(tags['height'])
        elif Settings.has_option(settingsSection, 'height'):
            barrier.height = Settings.getfloat(settingsSection, 'height')
        if 'width' in tags:
            barrier.width = extract_float_from_string(tags['width'])
        elif Settings.has_option(settingsSection, 'width'):
            barrier.width = Settings.getfloat(settingsSection, 'width')
        if WebotsObject.enable3D:
            barrier.ref = Barrier.add_intermediate_point_where_needed(barrier.ref)
        Barrier.list.append(barrier)