예제 #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);
        }
예제 #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));
        }
예제 #3
0
파일: ConeTests.cs 프로젝트: basp/pixie
        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));
        }
예제 #4
0
파일: ConeTests.cs 프로젝트: basp/pixie
        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);
        }