(self, state)
return (pos, vel, log_radius)
Updates state based on an event (collision).
Updates state based on an event (collision).
Updates state based on an event ( collision ) .
def state_update(self, state):
        """ Updates state based on an event (collision)."""
        pos, vel, log_radius = state
        pos = pos + 1e-7  # need to add a small eps so as not to trigger the event function immediately.
        vel = -vel * (1 - self.absorption)
        return (pos, vel, log_radius)
def state_update ( self , state ) : pos , vel , log_radius = state pos = pos + 1e-7 # need to add a small eps so as not to trigger the event function immediately. vel = - vel * ( 1 - self . absorption ) return ( pos , vel , log_radius )