2019-05-25, 11:55 PM
What you want is the concept of a?Unit Vector.?Simplified version: vectors have both direction (where?), and a magnitude (how large?). A unit vector is defined to connect two arbitrary points in space with a magnitude of length 1 -> it effectively gives us the "direction" of the destination point with respect to the origin.
You also have the option of then "scaling" the vector - somewhat along the lines of what Y_Less was saying. However, if you're interested in only getting the direction, use the unit vector. The reason behind this is that most of the vector algebra you can do (cross product, dot product, etc). will use the magnitude, and since it is literally 1 you're making the computations easier for the server to handle.
You also have the option of then "scaling" the vector - somewhat along the lines of what Y_Less was saying. However, if you're interested in only getting the direction, use the unit vector. The reason behind this is that most of the vector algebra you can do (cross product, dot product, etc). will use the magnitude, and since it is literally 1 you're making the computations easier for the server to handle.