Esempio n. 1
0
        private void DrawCircle(Location loc, float radius, Color innerColor, Color outerColor, int complexity = 24, bool isFilled = true)
        {
            var vertices = new List<PositionColored>();
            if (isFilled)
                vertices.Add(new PositionColored(Vector3.Zero, innerColor.ToArgb()));

            double stepAngle = (Math.PI * 2) / complexity;
            for (int i = 0; i <= complexity; i++)
            {
                double angle = (Math.PI * 2) - (i * stepAngle);
                float x = (float)(radius * Math.Cos(angle));
                float y = (float)(-radius * Math.Sin(angle));
                vertices.Add(new PositionColored(new Vector3(x, y, 0), outerColor.ToArgb()));
            }

            var buffer = vertices.ToArray();

            SetTarget(loc.ToVector3() + new Vector3(0, 0, 0.3f));

            D3D.Device.DrawUserPrimitives(PrimitiveType.TriangleFan, buffer.Length - 2, buffer);
        }
Esempio n. 2
0
 public IEnumerable<Vector3> FindPath(Location start, Location end, bool hardFail)
 {
     return FindPath(start.ToVector3(), end.ToVector3(), this.Filter, hardFail);
 }