public void TestExtendingPolygon()
        {
            var polygon = new Polygon( new []
            {
                new Vector2(0,1),
                new Vector2(1,0),
                new Vector2(-1,0),
                new Vector2(0,-1),
            });

            var extendPolygon = new ExtendPolygon(polygon , 1.0f);
            var result = extendPolygon.Result;

            Assert.AreEqual(new Vector2(0, 2), result.Points[0] );
            Assert.AreEqual(new Vector2(2,0), result.Points[1] );
            Assert.AreEqual(new Vector2(-2,0),result.Points[2] );
            Assert.AreEqual(new Vector2(0,-2),result.Points[3] );
        }
 public Polygon GetExploreBound()
 {
     var ext = new ExtendPolygon(_Mesh, _DetectionRange);
     return ext.Result;
 }
Example #3
0
        public Polygon GetExploreBound()
        {
            var ext = new ExtendPolygon(_Mesh, _DetectionRange);

            return(ext.Result);
        }
        public ExtendPolygon(Polygon polygon, float extend)
        {
            var newPoints = ExtendPolygon._GetPoints(polygon, extend);

            Result = new Polygon(newPoints.ToArray());
        }