public void MaxRadiusSameCenter()
        {
            var spheres = new List <Vector4>()
            {
                new Vector4(0, 0, 0, 1), new Vector4(0, 0, 0, 2)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
        public void SingleBoundingSphere()
        {
            var spheres = new List <Vector4>()
            {
                new Vector4(0, 0, 0, 1)
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
        public void DifferentCenter3D()
        {
            var spheres = new List <Vector4>()
            {
                new Vector4(1, 0, 1, 1),
                new Vector4(-1, 0, 1, 1),
                new Vector4(-1, 2, -1, 1),
                new Vector4(1, 2, -1, 1),
            };

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(spheres);

            Assert.IsTrue(SpherePointUtils.SphereContainsSpheres(boundingSphere, spheres));
        }
Exemplo n.º 4
0
        public void UnitCube()
        {
            var points = new List <Vector3>();

            points.Add(new Vector3(0.5f, -0.5f, -0.5f));
            points.Add(new Vector3(0.5f, -0.5f, 0.5f));
            points.Add(new Vector3(-0.5f, -0.5f, 0.5f));
            points.Add(new Vector3(-0.5f, -0.5f, -0.5f));
            points.Add(new Vector3(0.5f, 0.5f, -0.5f));
            points.Add(new Vector3(0.5f, 0.5f, 0.5f));
            points.Add(new Vector3(-0.5f, 0.5f, 0.5f));
            points.Add(new Vector3(-0.5f, 0.5f, -0.5f));

            var boundingSphere = BoundingSphereGenerator.GenerateBoundingSphere(points);

            Assert.IsTrue(SpherePointUtils.SphereContainsPoints(boundingSphere, points));
        }