Exemplo n.º 1
0
        public static void DistanceSq_point_inside()
        {
            var center = new float3(1.0f);
            var aabb   = new AABB {
                Center = center, Extents = new float3(0.5f)
            };

            TestUtils.AreEqual(0.0f, aabb.DistanceSq(center), 0.0f);
            TestUtils.AreEqual(0.0f, aabb.DistanceSq(center + new float3(0.5f)));
            TestUtils.AreEqual(0.0f, aabb.DistanceSq(center + new float3(-0.5f)));
        }
Exemplo n.º 2
0
        public static void DistanceSq_point_outside_corner()
        {
            var center = new float3(1.0f);
            var aabb   = new AABB {
                Center = center, Extents = new float3(0.5f)
            };

            TestUtils.AreEqual(0.75f, aabb.DistanceSq(center + new float3(1.0f)));
        }
Exemplo n.º 3
0
        public static void DistanceSq_trivial()
        {
            var aabb = new AABB();

            TestUtils.AreEqual(0.0f, aabb.DistanceSq(float3.zero));
        }