(self, share_model=False)
return new_obj
Creates a copy of this `Physics` instance.

    Args:
      share_model: If True, the copy and the original will share a common
        MjModel instance. By default, both model and data will both be copied.

    Returns:
      A `Physics` instance.
Creates a copy of this `Physics` instance.
Creates a copy of this Physics instance .
def copy(self, share_model=False):
    """Creates a copy of this `Physics` instance.

    Args:
      share_model: If True, the copy and the original will share a common
        MjModel instance. By default, both model and data will both be copied.

    Returns:
      A `Physics` instance.
    """
    if not share_model:
      new_model = self.model.copy()
    else:
      new_model = self.model
    new_data = wrapper.MjData(new_model)
    mjlib.mj_copyData(new_data.ptr, new_data.model.ptr, self.data.ptr)
    cls = self.__class__
    new_obj = cls.__new__(cls)
    # pylint: disable=protected-access
    new_obj._warnings_cause_exception = True
    new_obj._reload_from_data(new_data)
    # pylint: enable=protected-access
    return new_obj
def copy ( self , share_model = False ) : if not share_model : new_model = self . model . copy ( ) else : new_model = self . model new_data = wrapper . MjData ( new_model ) mjlib . mj_copyData ( new_data . ptr , new_data . model . ptr , self . data . ptr ) cls = self . __class__ new_obj = cls . __new__ ( cls ) # pylint: disable=protected-access new_obj . _warnings_cause_exception = True new_obj . _reload_from_data ( new_data ) # pylint: enable=protected-access return new_obj