Exemple #1
0
        public void BoundingBoxForBoundedCone_ShouldExist()
        {
            var shape = new Cone();

            shape.Minimum = -5;
            shape.Maximum = 3;
            var box = shape.GetBounds();

            Assert.Equal(new Point(-5, -5, -5), box.Min, PointComparer);
            Assert.Equal(new Point(5, 3, 5), box.Max, PointComparer);
        }
Exemple #2
0
        public void BoundingBoxForUnboundedCone_ShouldExist()
        {
            var shape = new Cone();
            var box   = shape.GetBounds();

            Assert.True(double.IsNegativeInfinity(box.Min.x));
            Assert.True(double.IsNegativeInfinity(box.Min.y));
            Assert.True(double.IsNegativeInfinity(box.Min.z));
            Assert.True(double.IsPositiveInfinity(box.Max.x));
            Assert.True(double.IsPositiveInfinity(box.Max.y));
            Assert.True(double.IsPositiveInfinity(box.Max.z));
        }
Exemple #3
0
        public void UnboundedConeHasBoundingBox()
        {
            var shape = new Cone();
            var box   = shape.GetBounds();

            Assert.True(double.IsNegativeInfinity(box.Min.X));
            Assert.True(double.IsNegativeInfinity(box.Min.Y));
            Assert.True(double.IsNegativeInfinity(box.Min.Z));

            Assert.True(double.IsPositiveInfinity(box.Max.X));
            Assert.True(double.IsPositiveInfinity(box.Max.Y));
            Assert.True(double.IsPositiveInfinity(box.Max.Z));
        }
Exemple #4
0
        public void BoundedConeHasBoundingBox()
        {
            var shape = new Cone()
            {
                Minimum = -5,
                Maximum = 3,
            };

            var box = shape.GetBounds();

            Assert.Equal(
                Vector4.CreatePosition(-5, -5, -5),
                box.Min);
            Assert.Equal(
                Vector4.CreatePosition(5, 3, 5),
                box.Max);
        }