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::FitThroughPoints

Syntax

Sphere Sphere::FitThroughPoints(const float4 &a, const float4 &b); [1 line of code]

Fits a sphere through the given two points.

Two points do not uniquely define a sphere in 3D space. This function computes the minimal enclosing sphere for the given two points, which is uniquely defined. This function is identical to OptimalEnclosingSphere(a, b) and is simply an alias for that function.

See Also

OptimalEnclosingSphere().

Syntax

Sphere Sphere::FitThroughPoints(const float4 &a, const float4 &b, const float4 &c); [27 lines of code]

Fits a sphere through the given three points.

For reference, see http://realtimecollisiondetection.net/blog/?p=20 .

Three points do not uniquely define a sphere in 3D space. This function computes the sphere that goes through these three points and has the minimal volume. Note that this is not the same than the smallest sphere that encloses three given points, since the smallest enclosing sphere does not necessarily pass through all the three points.

Note
The three points that are passed in must not be collinear, because in that case a sphere cannot be fitted through these points.

See Also

OptimalEnclosingSphere().

Syntax

Sphere Sphere::FitThroughPoints(const float4 &a, const float4 &b, const float4 &c, const float4 &d); [23 lines of code]

Fits a sphere through the given four points.

For reference, see http://realtimecollisiondetection.net/blog/?p=20 .

Four points uniquely define a sphere in 3D space. This function computes the sphere that passes through these four points. Note that this is not the same than the smallest enclosing sphere for the four points, since the smallest enclosing sphere does not necessarily need to pass through all of these four points.

Note
The four points that are passed in must not be coplanar, because in that case a sphere cannot be fitted through these points.

See Also

OptimalEnclosingSphere().