Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.06 KB | None | 0 0
  1.     for (int r = 1; r < 40; r += (int)playerRadius)// (int)(crystalRadius / (2 * System.Math.PI)))
  2.                 {
  3.                     float sampleAngle = 10;
  4.  
  5.                     for (int i = 0; i < sampleAngle; i++)
  6.                     {
  7.                         float angle = i / sampleAngle * 2.0f * (float)System.Math.PI;
  8.                         angle = angle + ((2 * (float)System.Math.PI) / sampleAngle) * (float)rand.NextDouble();
  9.  
  10.                         float px = ObjectManager.Me.Position.X + r * (float)System.Math.Cos(angle);
  11.                         float py = ObjectManager.Me.Position.Y + r * (float)System.Math.Sin(angle);
  12.  
  13.                         float objColliding = 0;
  14.                         foreach (WoWGameObject obj in objList)
  15.                         {
  16.                             float distance = Vector3.Distance2D(new Vector3(px, py, ObjectManager.Me.Position.Z), new Vector3(obj.Position.X, obj.Position.Y, ObjectManager.Me.Position.Z));
  17.                             //Logging.Write("2D: " +distance + " 3D: " + Vector3.Distance(new Vector3(px, py, ObjectManager.Me.Position.Z), new Vector3(obj.Position.X, obj.Position.Y, ObjectManager.Me.Position.Z)));
  18.                             if (distance <= (aoeRadius + playerRadius))// * (aoeRadius + playerRadius))
  19.                             {
  20.                                 Radar3D.OnDrawEvent += () =>
  21.                                 {
  22.                                     Radar3D.DrawCircle(new Vector3(px, py, ObjectManager.Me.Position.Z), 1, Color.Red, false, 100);
  23.                                 };
  24.                                 objColliding++;
  25.                             }
  26.                             else
  27.                             {
  28.                                 Radar3D.OnDrawEvent += () =>
  29.                                 {
  30.                                     Radar3D.DrawCircle(new Vector3(px, py, ObjectManager.Me.Position.Z), 1, Color.Green, false, 100);
  31.                                 };
  32.                             }
  33.                         }
  34.                     }
  35.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement