def __init__(self, viewport, camera, pointer, **unused): """Instance initializer. Args: viewport: Instance of mujoco_viewer.Viewport. camera: Instance of mujoco_viewer.SceneCamera. pointer: A pointer that moves around the screen and is used to point at bodies. Implements a single attribute - 'position' - that returns a 2-component vector of pointer's screen space position. **unused: Other arguments, unused by this class. """ del unused # Unused. self._viewport = viewport self._camera = camera self._pointer = pointer self._action = util.AtomicAction(self._update_action) self._perturb = None
def __init__(self, viewport, camera, pointer, selection_service, **unused): """Instance initializer. Args: viewport: Instance of mujoco_viewer.Viewport. camera: Instance of mujoco_viewer.SceneCamera. pointer: A pointer that moves around the screen and is used to point at bodies. Implements a single attribute - 'position' - that returns a 2-component vector of pointer's screen space position. selection_service: An instance of a class implementing a 'selected_body_id' property. **unused: Other optional parameters not used by this class. """ del unused # Unused. self._viewport = viewport self._camera = camera self._pointer = pointer self._selection_service = selection_service self._active = True self._tracked_body_idx = -1 self._action = util.AtomicAction()
def setUp(self): self.callback = mock.MagicMock() self.action = util.AtomicAction(self.callback)
def deactivate(self): """Deactivates the controller.""" self._active = False self._action = util.AtomicAction()
def setUp(self): super(AtomicActionTests, self).setUp() self.callback = mock.MagicMock() self.action = util.AtomicAction(self.callback)