Beispiel #1
0
 internal override bool GetCollisionLine(CollisionLine obj)
 {
     return obj.GetCollision(this);
 }
 internal override bool GetCollisionLine(CollisionLine obj)
 {
     Apply();
     Vector2 end = obj.End;
     if (!outCircle.GetCollision(obj)) return false;
     if (inCircle.GetCollision(obj)) return true;
     for (int i = 0; i < temp.Length; i++)
     {
         if (obj.GetCollision(Line(i))) return true;
     }
     return false;
 }
Beispiel #3
0
 internal override bool GetCollisionLine(CollisionLine obj)
 {
     if (MathUtilXNA.Cross(Line, obj.Position - Position) * MathUtilXNA.Cross(Line, obj.End - Position) <= 0
         && MathUtilXNA.Cross(obj.Line, Position - obj.Position) * MathUtilXNA.Cross(obj.Line, End - obj.Position) <= 0) return true;
     return false;
 }
Beispiel #4
0
 internal abstract bool GetCollisionLine(CollisionLine obj);
Beispiel #5
0
 internal override bool GetCollisionLine(CollisionLine obj)
 {
     if (obj.Position.X > Left && obj.Position.X < Right && obj.Position.Y < Top && obj.Position.Y > Bottom) return true;
     if (obj.End.X > Left && obj.End.X < Right && obj.End.Y < Top && obj.End.Y > Bottom) return true;
     if (MathUtilXNA.Cross(obj.Line, TopLeft - obj.Begin) * MathUtilXNA.Cross(obj.Line, BottomRight - obj.Begin) <= 0) return true;
     if (MathUtilXNA.Cross(obj.Line, TopRight - obj.Begin) * MathUtilXNA.Cross(obj.Line, BottomLeft - obj.Begin) <= 0) return true;
     return false;
 }