示例#1
0
        internal VEdge(Point start, FortuneSite left, FortuneSite right)
        {
            Start = start;
            Left  = left;
            Right = right;

            //for bounding box edges
            if (left == null || right == null)
            {
                return;
            }

            //from negative reciprocal of slope of line from left to right
            //ala m = (left.y -right.y / left.x - right.x)
            SlopeRise = left.X - right.X;
            SlopeRun  = -(left.Y - right.Y);
            Intercept = null;

            if (SlopeRise.ApproxEqual(0) || SlopeRun.ApproxEqual(0))
            {
                return;
            }
            Slope     = SlopeRise / SlopeRun;
            Intercept = start.Y - Slope * start.X;
        }
示例#2
0
    void getEdges(VoronoiLib.Structures.FortuneSite point)
    {
        Vector3 pos = new Vector3((float)point.X, (float)point.Y, -1.5f);
        var     a   = Instantiate(debugSphere, pos, Quaternion.identity);

        a.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
    }
示例#3
0
 internal BeachSection(FortuneSite site)
 {
     Site        = site;
     CircleEvent = null;
 }
示例#4
0
 public void Initialize(FortuneSite site)
 {
     Site        = site;
     Edge        = null;
     CircleEvent = null;
 }