コード例 #1
0
 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
ファイル: OctreeTests.cs プロジェクト: cybergen/bri-lib
 public void Setup()
 {
     _box = new ThreeDimensionalBoundingBox(10, 10, 10, 10);
     _tree = new Octree<TestObject>(_box, 2);
 }
コード例 #3
0
 public void Setup()
 {
     _box = new ThreeDimensionalBoundingBox(10, 10, 10, 10);
 }
コード例 #4
0
 public void DistancePointInside3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(2, 2, 2, 2);
     var dist = newBox.BoundsDistance(2, 4, 4);
     Assert.AreEqual(-2, dist);
 }
コード例 #5
0
 public void DistanceAlongStraightPath3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(2, 2, 2, 2);
     var dist = newBox.BoundsDistance(6, 2, 2);
     Assert.AreEqual(2, dist);
 }
コード例 #6
0
 public void BoundsBoundsNonIntersections3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(-5, -5, -5, 3);
     Assert.False(_box.Intersects(newBox));
 }
コード例 #7
0
 public void BoundsBoundsInnerIntersection3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(11, 11, 11, 2);
     Assert.True(_box.Intersects(newBox));
     Assert.True(newBox.Intersects(_box));
 }
コード例 #8
0
 public void BoundsBoundsEdgeIntersection3D()
 {
     var newBox = new ThreeDimensionalBoundingBox(15, 15, 15, 10);
     Assert.True(_box.Intersects(newBox));
 }