Beispiel #1
0
 public static void DrawOBB(OBB rec, Color color, Color borderColor, float borderThickness = 1f, float depth = 0f)
 {
     sB.Draw(dot, rec.Center, null, color, rec.Rotation, new Vector2(0.5f, 0.5f), rec.Size, SpriteEffects.None, depth);
     if (borderThickness != 0f)
     {
         sB.Draw(dot, rec.TopLeft, null, borderColor, rec.Rotation, Vector2.Zero, new Vector2(rec.Width, borderThickness), SpriteEffects.None, depth);
         sB.Draw(dot, rec.BottomLeft, null, borderColor, rec.Rotation - MathHelper.PiOver2, Vector2.Zero, new Vector2(rec.Height, borderThickness), SpriteEffects.None, depth);
         sB.Draw(dot, rec.TopRight, null, borderColor, rec.Rotation + MathHelper.PiOver2, Vector2.Zero, new Vector2(rec.Height, borderThickness), SpriteEffects.None, depth);
         sB.Draw(dot, rec.BottomRight, null, borderColor, rec.Rotation + MathHelper.Pi, Vector2.Zero, new Vector2(rec.Width, borderThickness), SpriteEffects.None, depth);
     }
 }
Beispiel #2
0
 public static void DrawOBB(OBB rec, Color color, float depth = 0f)
 {
     sB.Draw(dot, rec.Center, null, color, rec.Rotation, new Vector2(0.5f, 0.5f), rec.Size, SpriteEffects.None, depth);
 }