def checkCrossConstraint(env, trajEvader, trajPursuer):
  """Checks if the evader crosses the boundary.

  Args:
      env (gym.Env): the environment.
      trajEvader (np.ndarray): the trajectory of the evader.
      trajPursuer (np.ndarray): the trajectory of the pursuer.

  Returns:
      bool: True if crossing the boundary.
      int: the time step at which the evader hits the obstacle.
  """
  numStep = trajEvader.shape[0]
  crossConstraintFlag = False
  crossConstraintInstant = None
  for t in range(numStep):
    posEvader = trajEvader[t, :2]
    evader_g_x = env.evader.safety_margin(posEvader)
    if not crossConstraintFlag and evader_g_x > 0:
      crossConstraintInstant = t
      crossConstraintFlag = True
  return crossConstraintFlag, crossConstraintInstant