Back to class index
Sphere[Class Summary]
pos
r
ctor (+4 overloads)
Translate(offset)
Transform(transform) (+3 overloads)
MinimalEnclosingAABB()[const]
MaximalContainedAABB()[const]
SetNegativeInfinity()
Volume()[const]
SurfaceArea()[const]
Diameter()[const]
Centroid()[const]
AnyPointFast()[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
IsFinite()[const]
IsDegenerate()[const]
SetDegenerate()
Contains(point)[const] (+11 overloads)
Distance(point)[const] (+9 overloads)
MaxDistance(point)[const]
ClosestPoint(point)[const]
Intersects(...)[const] (+11 overloads)
Enclose(point,epsilon) (+10 overloads)
ExtendRadiusToContain(point,epsilon) (+1 overload)
RandomPointInside(lcg)
RandomPointOnSurface(lcg)
Triangulate(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
FastEnclosingSphere(...)[static]
OptimalEnclosingSphere(...)[static] (+4 overloads)
FitThroughPoints(a,b)[static] (+2 overloads)
RandomPointInside(lcg,center,radius)[static]
RandomPointOnSurface(lcg,center,radius)[static]
RandomUnitaryFloat3(lcg)[static]
IntersectLine(...)[static]
FromString(str,outEndStr)[static] (+1 overload)

Sphere::Distance

Syntax

float Sphere::Distance(const float4 &point) const; [4 lines of code]
float Sphere::Distance(const Sphere &sphere) const; [4 lines of code]
float Sphere::Distance(const Capsule &capsule) const; [4 lines of code]
float Sphere::Distance(const AABB &aabb) const; [4 lines of code]
float Sphere::Distance(const OBB &obb) const; [4 lines of code]
float Sphere::Distance(const Plane &plane) const; [4 lines of code]
float Sphere::Distance(const Triangle &triangle) const; [4 lines of code]
float Sphere::Distance(const Ray &ray) const; [4 lines of code]
float Sphere::Distance(const Line &line) const; [4 lines of code]
float Sphere::Distance(const LineSegment &lineSegment) const; [4 lines of code]

Returns the distance between this sphere and the given object.

This function finds the nearest pair of points on this and the given object, and computes their distance. If the two objects intersect, or one object is contained inside the other, the returned distance is zero.

See Also

Contains(), Intersects(), ClosestPoint().

Work in progress:

Todo: in float Sphere::Distance(const float4 &point) const:
Add Sphere::Distance(Polygon/Circle/Disc/Frustum/Polyhedron).