コード例 #1
0
    public void ContactArea_NE()
    {
        RectangleInt a = new RectangleInt(0, 0, 5, 5);
        RectangleInt b = new RectangleInt(-1, 5, 3, 3);

        Assert.IsTrue(a.ContactArea(b).Contains(new int2(0, 4)) &&
                      a.ContactArea(b).Contains(new int2(1, 4)));
    }
コード例 #2
0
    public void ContactArea_W_DiscardEdges()
    {
        RectangleInt a = new RectangleInt(0, 0, 5, 5);
        RectangleInt b = new RectangleInt(-3, 1, 3, 3);

        Assert.IsTrue(a.ContactArea(b, true).Contains(new int2(0, 2)) &&
                      a.ContactArea(b, true).Count == 1);
    }
コード例 #3
0
    public void ContactArea_W()
    {
        RectangleInt a = new RectangleInt(0, 0, 5, 5);
        RectangleInt b = new RectangleInt(-3, 1, 3, 3);

        Assert.IsTrue(a.ContactArea(b).Contains(new int2(0, 1)) &&
                      a.ContactArea(b).Contains(new int2(0, 2)) &&
                      a.ContactArea(b).Contains(new int2(0, 3)) &&
                      a.ContactArea(b).Count == 3);
    }
コード例 #4
0
    public void ContactArea_S()
    {
        RectangleInt a = new RectangleInt(0, 0, 5, 5);
        RectangleInt b = new RectangleInt(1, -3, 3, 3);

        Assert.IsTrue(a.ContactArea(b).Contains(new int2(1, 0)) &&
                      a.ContactArea(b).Contains(new int2(2, 0)) &&
                      a.ContactArea(b).Contains(new int2(3, 0)) &&
                      a.ContactArea(b).Count == 3);
    }