예제 #1
0
 /// <summary>
 /// Returns a random point inside a sphere
 /// </summary>
 public static Vector3 PointInSphere(Sphere sphere)
 {
     return(PointInSphere(sphere.center, sphere.radius));
 }
예제 #2
0
 /// <summary>
 /// Computes an intersection of the spheres
 /// </summary>
 /// <returns>True if the spheres intersect or one sphere is contained within the other</returns>
 public static bool SphereSphere(Sphere sphereA, Sphere sphereB, out IntersectionSphereSphere intersection)
 {
     return(SphereSphere(sphereA.center, sphereA.radius, sphereB.center, sphereB.radius, out intersection));
 }
예제 #3
0
 /// <summary>
 /// Tests if the point is inside the sphere
 /// </summary>
 public static bool PointSphere(Vector3 point, Sphere sphere)
 {
     return(PointSphere(point, sphere.center, sphere.radius));
 }
예제 #4
0
 /// <summary>
 /// Computes an intersection of the segment and the sphere
 /// </summary>
 public static bool SegmentSphere(Segment3 segment, Sphere sphere, out IntersectionSegmentSphere intersection)
 {
     return(SegmentSphere(segment.a, segment.b, sphere.center, sphere.radius, out intersection));
 }
예제 #5
0
 /// <summary>
 /// Computes an intersection of the ray and the sphere
 /// </summary>
 public static bool RaySphere(Ray ray, Sphere sphere, out IntersectionRaySphere intersection)
 {
     return(RaySphere(ray.origin, ray.direction, sphere.center, sphere.radius, out intersection));
 }
예제 #6
0
 /// <summary>
 /// Computes an intersection of the line and the sphere
 /// </summary>
 public static bool LineSphere(Line3 line, Sphere sphere, out IntersectionLineSphere intersection)
 {
     return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out intersection));
 }
 /// <summary>
 /// Computes an intersection of the line and the sphere
 /// </summary>
 public static bool LineSphere(Line3 line, Sphere sphere, out Vector3 pointA, out Vector3 pointB)
 {
     return(LineSphere(line.origin, line.direction, sphere.center, sphere.radius, out pointA, out pointB));
 }
 /// <summary>
 /// Computes an intersection of the ray and the sphere
 /// </summary>
 public static bool RaySphere(Ray ray, Sphere sphere, out Vector3 pointA, out Vector3 pointB)
 {
     return(RaySphere(ray.origin, ray.direction, sphere.center, sphere.radius, out pointA, out pointB));
 }