Ejemplo n.º 1
0
 public static bool isInFront(Vector2 viewersPosition, Vector2 viewersDirection, Vector2 positionInQuestion)
 {
     viewersDirection.normalize();
     return dot(viewersDirection, positionInQuestion - viewersPosition) > 0F;
 }
Ejemplo n.º 2
0
 /// <summary>returns the internal angle (radian) between the 2 Vectors</summary>
 public static float internalAngle(Vector2 v1, Vector2 v2)
 {
     v1.normalize();
     v2.normalize();
     return (float)Math.Acos(dot(v1, v2));
 }