Question Difference between toVector() and getDirection()?

Discussion in 'General Help' started by jetp250, Jul 8, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    jetp250

    The title tells it all, is there even a difference? As they both return a vector.
     
  2. Offline

    waiching514

  3. Offline

    I Al Istannen

    @waiching514
    ??


    @jetp250
    getDirection().

    toVector() just returns a vector with the coordinates of the location. So a Location (10, 9, 8) to vector would be a vector (10, 9, 8).
     
  4. Offline

    jetp250

    @I Al Istannen Thanks! How about the getDirection()? Does it return a normalized toVector() or something? Still confused, but that explains a lot already.
     
  5. Offline

    I Al Istannen

    @jetp250
    Nearly.
    A player can look somewhere. He can look up, down, left, right and so on. This is called the direction. So, the Location#getDirection() returns a unit vector (= normalized) pointing in the direction the player is looking.

    It has nothing to do with the toVector() method.
     
Thread Status:
Not open for further replies.

Share This Page