Esempio n. 1
0
        public Box(Point center)
            : base(Physics.Material.Wood, new Point(0, 0), false, null)
        {
            type = random.Next(0, 3);
            Point v      = new Point(Size / 2, Size / 2);
            var   points = new[]
            {
                center + v, center + v.RotateAroundOrigin(Math.PI / 2),
                center - v, center - v.RotateAroundOrigin(Math.PI / 2)
            };

            Shape = new ConvexPolygon(points);
        }
Esempio n. 2
0
        public IceWall(Point center, double width, double height)
            : base(Physics.Material.Ice, new Point(0, 0), true, null)
        {
            this.width  = width;
            this.height = height;
            Point v      = new Point(width / 2, height / 2);
            var   points = new[]
            {
                center + v, center + v.RotateAroundOrigin(Math.PI / 2),
                center - v, center - v.RotateAroundOrigin(Math.PI / 2)
            };

            Shape = new ConvexPolygon(points);
        }
Esempio n. 3
0
        public Ground(Point center, double width, double height)
            : base(Physics.Material.Grass, new Point(0, 0), true, null)
        {
            type        = random.Next(3);
            this.width  = width;
            this.height = height;
            var v      = new Point(width / 2, height / 2);
            var points = new[]
            {
                center + v, center + v.RotateAroundOrigin(Math.PI / 2),
                center - v, center - v.RotateAroundOrigin(Math.PI / 2)
            };

            Shape = new ConvexPolygon(points);
        }
Esempio n. 4
0
 public Segment RotateAroundOrigin(double angle)
 {
     return(new Segment(A.RotateAroundOrigin(angle),
                        B.RotateAroundOrigin(angle)));
 }
Esempio n. 5
0
        public Point RotateAroundPoint(Point center, double angle)
        {
            Point v = this - center;

            return(center + v.RotateAroundOrigin(angle));
        }
Esempio n. 6
0
 public Line RotateAroundOrigin(double angle)
 {
     return(new Line(A.RotateAroundOrigin(angle),
                     B.RotateAroundOrigin(angle)));
 }