public void DistanceFlatPlaneYZPlane3D()
 {
     var hypotenuse = (float)(2f.Sq() + 2d.Sq()).Sqrt();
     var newBox = new ThreeDimensionalBoundingBox(2, 2, 2, 2);
     var dist = newBox.BoundsDistance(6, 2, 6);
     Assert.AreEqual(hypotenuse, dist);
 }
Пример #2
0
 public void Setup()
 {
     _box = new ThreeDimensionalBoundingBox(10, 10, 10, 10);
     _tree = new Octree<TestObject>(_box, 2);
 }
 public void Setup()
 {
     _box = new ThreeDimensionalBoundingBox(10, 10, 10, 10);
 }
 public void DistancePointInside3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(2, 2, 2, 2);
     var dist = newBox.BoundsDistance(2, 4, 4);
     Assert.AreEqual(-2, dist);
 }
 public void DistanceAlongStraightPath3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(2, 2, 2, 2);
     var dist = newBox.BoundsDistance(6, 2, 2);
     Assert.AreEqual(2, dist);
 }
 public void BoundsBoundsNonIntersections3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(-5, -5, -5, 3);
     Assert.False(_box.Intersects(newBox));
 }
 public void BoundsBoundsInnerIntersection3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(11, 11, 11, 2);
     Assert.True(_box.Intersects(newBox));
     Assert.True(newBox.Intersects(_box));
 }
 public void BoundsBoundsEdgeIntersection3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(15, 15, 15, 10);
     Assert.True(_box.Intersects(newBox));
 }