示例#1
0
        public void CheckLineIntersect_PositiveNoPointsInside()
        {
            var aabb = new AABB(new Vector2(10.0f, 10.0f), new Vector2(10.0f, 10.0f));

            var p0 = new Vector2(10.0f, -10.0f);
            var p1 = new Vector2(10.0f, 100.0f);

            var result = AABB.CheckLineIntersect(aabb, p0, p1);

            Assert.True(result);
        }
示例#2
0
        public void CheckLineIntersect_Negative()
        {
            var aabb = new AABB(new Vector2(10.0f, 10.0f), new Vector2(10.0f, 10.0f));

            var p0 = new Vector2(-10.0f, -10.0f);
            var p1 = new Vector2(-20.0f, -10.0f);

            var result = AABB.CheckLineIntersect(aabb, p0, p1);

            Assert.False(result);
        }