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