Garry Newman wrote:
--
[ Picked text/plain from multipart/alternative ]
Vector v1 = Player1->GetAbsOrigin()
Vector v2 = Player2->GetAbsOrigin()
Vector v3 = v2 - v1
v3 is now the vector between the two, v3.Distance() would return the
distance between them
v3.NormalizeInPlace()
v3 is now the normal between the two
v1 = v1 + (v3 * 128)
v2 = v2 - (v3 * 128)
That moves the players 128 units in the opposite direction (I might have got
it the wrong way around).
Yeah, I think that's backwards. Your v3 vector is from v1 towards v2,
so adding v3 to v1 will be in the direction of v2 (not away from v2).
If you subtract A from B, (i.e. B - A) the vector will be in the
direction of B. I remember it by subtracting one integer from another.
5 - 3 is +2 (i.e. going in the direction of 5 from 3). 3 - 5 is -2
(going in the direction of 3 from 5).
--
Jeffrey "botman" Broome
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders