951 {
952 vector targetDirection = GetDirection();
953 vector toSourceDirection = (pSource.GetPosition() -
GetPosition());
954
955 targetDirection[1] = 0;
956 toSourceDirection[1] = 0;
957
960
961 float cosFi = vector.Dot(targetDirection, toSourceDirection);
962 vector cross = targetDirection * toSourceDirection;
963
964 float dirAngle = Math.Acos(cosFi) * Math.RAD2DEG;
965
966
967 if ( invertHitDir > 0 )
968 dirAngle -= 180;
969
970 if ( cross[1] < 0 )
971 dirAngle = -dirAngle;
972
973 return dirAngle;
974 }
proto float Normalize()
Normalizes vector. Returns length.
vector GetPosition()
Get the world position of the Effect.