Exemplo n.º 1
0
        public void PolygonClone()
        {
            Polygon a = new Polygon();
            a.SetPoints( new[]{
                new Vector2(0, 0),
                new Vector2(2, 0),
                new Vector2(2, 1),
                new Vector2(0, 1),
            });

            var b = a.Clone();
            Assert.AreEqual( 0 , b.Points[0].X );
            Assert.AreEqual(2, b.Points[1].X);
            Assert.AreEqual(1, b.Points[3].Y);
        }
Exemplo n.º 2
0
            public Orbit(Polygon body, Vector2 velocity)
            {
                List<Vector2> points = new List<Vector2>();
                points.AddRange(body.Points);

                var polygon = body.Clone();
                polygon.Offset(velocity);

                points.AddRange(polygon.Points);
                _Rect = points.ToRect();
            }
Exemplo n.º 3
0
 public void _SetBody(Polygon body)
 {
     _Mesh = body.Clone();
     _Bound = this._BuildBound(this._Mesh);
     _DetectionRange = 1.0f + _Mesh.Points.ToRect().Width;
 }
Exemplo n.º 4
0
 public void SetBody(Polygon body)
 {
     _SetBody(body.Clone());
 }
Exemplo n.º 5
0
 public Entity(Polygon mesh)
 {
     SetBody(mesh.Clone());
 }