示例#1
0
 /// <summary>
 /// Returns true if the ray hits the supplied sphere within the
 /// supplied parameter interval and before the parameter value
 /// contained in the supplied hit. Note that a hit is only
 /// registered if the front or the backsurface is encountered
 /// within the interval.
 /// </summary>
 public bool Hits(
     Sphere3d sphere,
     double tmin, double tmax,
     ref RayHit3d hit)
 {
     return(HitsSphere(sphere.Center, sphere.Radius, tmin, tmax, ref hit));
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Sphere3d"/> class using values from another sphere instance.
 /// </summary>
 public Sphere3d(Sphere3d sphere)
 {
     Center = sphere.Center;
     Radius = sphere.Radius;
 }
示例#3
0
 public static bool ApproximateEquals(this Sphere3d a, Sphere3d b, double tolerance) =>
 ApproximateEquals(a.Center, b.Center, tolerance) &&
 ApproximateEquals(a.Radius, b.Radius, tolerance);
示例#4
0
 public static bool ApproximateEquals(this Sphere3d a, Sphere3d b)
 => ApproximateEquals(a, b, Constant <double> .PositiveTinyValue);
示例#5
0
 public bool Equals(Sphere3d other)
 => Center.Equals(other.Center) && Radius.Equals(other.Radius);