コード例 #1
0
        public void TestContain()
        {
            Assert.IsTrue(aabbOne.IsContain(Vector2.zero));
            Assert.IsTrue(aabbOne.IsContain(Vector2.one));
            Assert.IsTrue(aabbOne.IsContain(-Vector2.one));
            Assert.IsTrue(aabbOne.IsContain(Vector2.half));
            Assert.IsTrue(aabbOne.IsContain(-Vector2.half));
            Assert.IsFalse(aabbOne.IsContain(Vector2.two));
            Assert.IsFalse(aabbOne.IsContain(-Vector2.two));
            Assert.IsTrue(aabbOne.IsContain(aabbHalf));
            Assert.IsFalse(aabbOne.IsContain(aabbZeroTwo));
            Assert.IsFalse(aabbOne.IsContain(aabbOneTwo));

            Assert.IsTrue(aabbHalf.IsContain(Vector2.zero));
            Assert.IsFalse(aabbHalf.IsContain(Vector2.one));
            Assert.IsFalse(aabbHalf.IsContain(-Vector2.one));
            Assert.IsTrue(aabbHalf.IsContain(Vector2.half));
            Assert.IsTrue(aabbHalf.IsContain(-Vector2.half));
            Assert.IsFalse(aabbHalf.IsContain(Vector2.two));
            Assert.IsFalse(aabbHalf.IsContain(-Vector2.two));
            Assert.IsFalse(aabbHalf.IsContain(aabbOne));
            Assert.IsFalse(aabbHalf.IsContain(aabbZeroTwo));
            Assert.IsFalse(aabbHalf.IsContain(aabbOneTwo));

            Assert.IsTrue(aabbZeroTwo.IsContain(Vector2.zero));
            Assert.IsTrue(aabbZeroTwo.IsContain(Vector2.one));
            Assert.IsFalse(aabbZeroTwo.IsContain(-Vector2.one));
            Assert.IsTrue(aabbZeroTwo.IsContain(Vector2.half));
            Assert.IsFalse(aabbZeroTwo.IsContain(-Vector2.half));
            Assert.IsTrue(aabbZeroTwo.IsContain(Vector2.two));
            Assert.IsFalse(aabbZeroTwo.IsContain(-Vector2.two));
            Assert.IsFalse(aabbZeroTwo.IsContain(aabbOne));
            Assert.IsFalse(aabbZeroTwo.IsContain(aabbHalf));
            Assert.IsTrue(aabbZeroTwo.IsContain(aabbOneTwo));

            Assert.IsFalse(aabbOneTwo.IsContain(Vector2.zero));
            Assert.IsTrue(aabbOneTwo.IsContain(Vector2.one));
            Assert.IsFalse(aabbOneTwo.IsContain(-Vector2.one));
            Assert.IsFalse(aabbOneTwo.IsContain(Vector2.half));
            Assert.IsFalse(aabbOneTwo.IsContain(-Vector2.half));
            Assert.IsTrue(aabbOneTwo.IsContain(Vector2.two));
            Assert.IsFalse(aabbOneTwo.IsContain(-Vector2.two));
            Assert.IsFalse(aabbOneTwo.IsContain(aabbOne));
            Assert.IsFalse(aabbOneTwo.IsContain(aabbHalf));
            Assert.IsFalse(aabbOneTwo.IsContain(aabbZeroTwo));
        }