(self, cursor_position)
return Selected(
        body=body_id, geom=geom_id, skin=skin_id, world_position=pos)
Returns bodies and geoms visible at given coordinates in the frame.

    Args:
      cursor_position:  A `tuple` containing x and y coordinates, normalized to
        between 0 and 1, and where (0, 0) is bottom-left.

    Returns:
      A `Selected` namedtuple. Fields are None if nothing is selected.
Returns bodies and geoms visible at given coordinates in the frame.
Returns bodies and geoms visible at given coordinates in the frame .
def select(self, cursor_position):
    """Returns bodies and geoms visible at given coordinates in the frame.

    Args:
      cursor_position:  A `tuple` containing x and y coordinates, normalized to
        between 0 and 1, and where (0, 0) is bottom-left.

    Returns:
      A `Selected` namedtuple. Fields are None if nothing is selected.
    """
    self.update()
    aspect_ratio = self._width / self._height
    cursor_x, cursor_y = cursor_position
    pos = np.empty(3, np.double)
    geom_id_arr = np.intc([-1])
    skin_id_arr = np.intc([-1])
    body_id = mjlib.mjv_select(
        self._physics.model.ptr,
        self._physics.data.ptr,
        self._scene_option.ptr,
        aspect_ratio,
        cursor_x,
        cursor_y,
        self._scene.ptr,
        pos,
        geom_id_arr,
        skin_id_arr)
    [geom_id] = geom_id_arr
    [skin_id] = skin_id_arr

    # Validate IDs
    if body_id != -1:
      assert 0 <= body_id < self._physics.model.nbody
    else:
      body_id = None
    if geom_id != -1:
      assert 0 <= geom_id < self._physics.model.ngeom
    else:
      geom_id = None
    if skin_id != -1:
      assert 0 <= skin_id < self._physics.model.nskin
    else:
      skin_id = None

    if all(id_ is None for id_ in (body_id, geom_id, skin_id)):
      pos = None

    return Selected(
        body=body_id, geom=geom_id, skin=skin_id, world_position=pos)
def select ( self , cursor_position ) : self . update ( ) aspect_ratio = self . _width / self . _height cursor_x , cursor_y = cursor_position pos = np . empty ( 3 , np . double ) geom_id_arr = np . intc ( [ - 1 ] ) skin_id_arr = np . intc ( [ - 1 ] ) body_id = mjlib . mjv_select ( self . _physics . model . ptr , self . _physics . data . ptr , self . _scene_option . ptr , aspect_ratio , cursor_x , cursor_y , self . _scene . ptr , pos , geom_id_arr , skin_id_arr ) [ geom_id ] = geom_id_arr [ skin_id ] = skin_id_arr # Validate IDs if body_id != - 1 : assert 0 <= body_id < self . _physics . model . nbody else : body_id = None if geom_id != - 1 : assert 0 <= geom_id < self . _physics . model . ngeom else : geom_id = None if skin_id != - 1 : assert 0 <= skin_id < self . _physics . model . nskin else : skin_id = None if all ( id_ is None for id_ in ( body_id , geom_id , skin_id ) ) : pos = None return Selected ( body = body_id , geom = geom_id , skin = skin_id , world_position = pos )