示例#1
0
        public void AssertThat_RayAlmostStartingOnPlane_Intersects_WithPositivePlaneDistance()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), 5);
            Ray3 r = new Ray3(new Vector3(0, -4.999999f, 0), new Vector3(0, 1, 0));

            var i = r.Intersects(p);

            Assert.AreEqual(0, i);
        }
示例#2
0
        public void AssertThat_DownwardRayIntersectsPlane_ReturnsCorrectValue_WithPositivePlaneDistance()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), 5);
            Ray3 r = new Ray3(new Vector3(0, 10, 0), new Vector3(0, -1, 0));

            var i = r.Intersects(p);

            Assert.AreEqual(15, i);
        }
示例#3
0
        public void AssertThat_ParallelRayDoesNotIntersect_WithPositivePlaneDistance()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), 5);
            Ray3 r = new Ray3(new Vector3(0, 10, 0), new Vector3(1, 0, 0));

            var i = r.Intersects(p);

            Assert.IsNull(i);
        }
 /// <summary>
 /// Checks whether the current BoundingBox intersects a Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with.</param><param name="result">[OutAttribute] Distance at which the ray intersects the BoundingBox, or null if there is no intersection.</param>
 public void Intersects(ref Ray3 ray, out float? result)
 {
     result = ray.Intersects(this);
 }
示例#5
0
 /// <summary>
 /// Checks whether the current BoundingSphere intersects a Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with.</param><param name="result">[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.</param>
 public void Intersects(ref Ray3 ray, out float?result)
 {
     ray.Intersects(ref this, out result);
 }
示例#6
0
 /// <summary>
 /// Checks whether the current BoundingSphere intersects with a specified Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with the current BoundingSphere.</param>
 public float?Intersects(Ray3 ray)
 {
     return(ray.Intersects(this));
 }
示例#7
0
 /// <summary>
 /// Checks whether the current BoundingBox intersects a Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with.</param><param name="result">[OutAttribute] Distance at which the ray intersects the BoundingBox, or null if there is no intersection.</param>
 public void Intersects(ref Ray3 ray, out float?result)
 {
     result = ray.Intersects(this);
 }
示例#8
0
        public void AssertThat_UpwardRayIntersectsPlane_ReturnsCorrectValue()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), 0);
            Ray3 r = new Ray3(new Vector3(0, -10, 0), new Vector3(0, 1, 0));

            var i = r.Intersects(p);

            Assert.AreEqual(10, i);
        }
示例#9
0
        public void AssertThat_RayStartingOnPlane_Intersects_WithNegativePlaneDistance()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), -5);
            Ray3 r = new Ray3(new Vector3(0, 5, 0), new Vector3(0, -1, 0));

            var i = r.Intersects(p);

            Assert.AreEqual(0, i);
        }
示例#10
0
        public void AssertThat_RayPointingAwayDoesNotIntersect_WithNegativePlaneDistance()
        {
            Plane p = new Plane(new Vector3(0, 1, 0), -5);
            Ray3 r = new Ray3(new Vector3(0, -10, 0), new Vector3(0, -1, 0));

            var i = r.Intersects(p);

            Assert.IsNull(i);
        }
 /// <summary>
 /// Checks whether the current BoundingSphere intersects a Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with.</param><param name="result">[OutAttribute] Distance at which the ray intersects the BoundingSphere or null if there is no intersection.</param>
 public void Intersects(ref Ray3 ray, out float? result)
 {
     ray.Intersects(ref this, out result);
 }
 /// <summary>
 /// Checks whether the current BoundingSphere intersects with a specified Ray.
 /// </summary>
 /// <param name="ray">The Ray to check for intersection with the current BoundingSphere.</param>
 public float? Intersects(Ray3 ray)
 {
     return ray.Intersects(this);
 }