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); }
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)); }
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)); }
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); }