Beispiel #1
0
 public static WallData CreateStreight(
     Vector2 start,
     Vector2 end,
     float width,
     float height,
     OpeningData[] openings          = null,
     WidthChangeType widthChangeType = WidthChangeType.Type1)
 {
     return(new WallData(
                new[] { start, end },
                width,
                height,
                openings,
                widthChangeType));
 }
Beispiel #2
0
 public static WallData CreateStreight(
     float x0,
     float y0,
     float x1,
     float y1,
     float width,
     float height,
     OpeningData[] openings          = null,
     WidthChangeType widthChangeType = WidthChangeType.Type1)
 {
     return(CreateStreight(
                new Vector2(x0, y0),
                new Vector2(x1, y1),
                width,
                height,
                openings,
                widthChangeType));
 }
Beispiel #3
0
        public static WallData CreateCurved(
            Vector2 p0,
            Vector2 p1,
            Vector2 p2,
            float width,
            float height,
            OpeningData[] openings          = null,
            WidthChangeType widthChangeType = WidthChangeType.Type1,
            int quality = 50)
        {
            var bezierSegment = new QuadraticBezierSegment(p0, p1, p2, quality);

            return(new WallData(
                       bezierSegment.Points.ToArray(),
                       width,
                       height,
                       openings,
                       widthChangeType));
        }
Beispiel #4
0
        public WallData(
            Vector2[] points,
            float width,
            float height,
            OpeningData[] openings,
            WidthChangeType widthChangeType)
        {
            Points          = points;
            Width           = width;
            Height          = height;
            Openings        = openings;
            WidthChangeType = widthChangeType;

            StartAngle  = new Lazy <float> (GetStartAngle);
            EndAngle    = new Lazy <float> (GetEndAngle);
            Normals     = new Lazy <WallPointNormals[]> (GetNormals);
            Lines       = new Lazy <WallSegmentLines[]> (GetLines);
            InnerPoints = new Lazy <Vector2[]> (GetInnerPoints);
            OuterPoints = new Lazy <Vector2[]> (GetOuterPoints);
        }
Beispiel #5
0
 public static WallData CreateCurved(
     float x0,
     float y0,
     float x1,
     float y1,
     float x2,
     float y2,
     float width,
     float height,
     OpeningData[] openings          = null,
     WidthChangeType widthChangeType = WidthChangeType.Type1,
     int quality = 50)
 {
     return(CreateCurved(
                new Vector2(x0, y0),
                new Vector2(x1, y1),
                new Vector2(x2, y2),
                width,
                height,
                openings,
                widthChangeType,
                quality));
 }