Exemplo n.º 1
0
    def getForward(self):
        """Return this vehicle's forward direction, a unit vector (SteerVec).

    """
        forward = SteerVec(self._velocity.getX(), self._velocity.getY())
        forward.normalize()
        return forward
Exemplo n.º 2
0
  def getForward(self):
    """Return this vehicle's forward direction, a unit vector (SteerVec).

    """
    forward = SteerVec(self._velocity.getX(),self._velocity.getY())
    forward.normalize()
    return forward
Exemplo n.º 3
0
    def _steerForFollow(self, target=None):
        """Return the steering_direction (SteerVec) required to follow target.
    target should be another Vehicle. Follow is like the pursue behavior
    but the vehicle will follow behind its target instead of catching up
    to it. The arrive behavior is place of seek in pursuit"""

        if target == None: target = self._target
        direction = SteerVec(target._velocity.getX(), target._velocity.getY())
        direction.normalize()
        point = target._pos + direction * -5
        return self._steerForArrive(point)
Exemplo n.º 4
0
  def _steerForFollow(self, target=None):
    """Return the steering_direction (SteerVec) required to follow target.
    target should be another Vehicle. Follow is like the pursue behavior
    but the vehicle will follow behind its target instead of catching up
    to it. The arrive behavior is place of seek in pursuit"""

    if target == None: target = self._target
    direction = SteerVec(target._velocity.getX(),target._velocity.getY())
    direction.normalize()
    point = target._pos + direction*-5
    return self._steerForArrive(point)