Search Unity

Vector3.Direction

Discussion in 'Wish List' started by Maker16, Sep 19, 2009.

  1. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    Maybe it's in there somewhere and I missed it, but it would be convenient to have something like:

    Code (csharp):
    1.  
    2. Vector3.Direction(from : Vector3,to : Vector3) : Vector3
    3. {
    4.    return Vector3(to - from).normalized;
    5. }
    6.  
    Not that just doing it directly isn't easy, but you have Vector3.Distance, and that's a simple matter to do directly as well. Just a thought.
     
    Merman and MaximilianPs like this.
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,921
    Very good idea, but as you already pointed out, its quite easy to do it manually, as it only requires one line code to get the direction between two points. So i don't thinks Unity guys will bother with this.
    Its not like Angle between two vectors, as it requires more steps and of course calculations. :)
    Cheers.
    Also, doing theses stuff manually, will keep your vector maths pretty fresh. ( a joke btw ) xD
     
  3. Maker16

    Maker16

    Joined:
    Mar 4, 2009
    Posts:
    779
    Just in response to your comment about keeping the math skills sharp...NO JOKE!! I sucked at trigonometry and physics and vector math up until this year. Since I've been actively designing and developing, I've really gotten sharp with the stuff I used to hate, and I've learned a ton of new aspects of math and physics. Now I don't have the same aprehension about my kid needing help in math and me not being able to help him. Thanks, Unity, for making me a better father!!
     
  4. jeremyace

    jeremyace

    Joined:
    Oct 12, 2005
    Posts:
    1,661
    That should definitely be a testimonial on the Unity site. :)

    -Jeremy
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,921
    Thumbs up! :D