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

Syntax

Sphere::Sphere(); [1 line of code]

The default constructor does not initialize any members of this class.

This means that the values of the members pos and r are undefined after creating a new Sphere using this default constructor. Remember to assign to them before use.

See Also

pos, r.

Syntax

Sphere::Sphere(const float4 &center, float radius); [4 lines of code]

Constructs a sphere with a given position and radius.

Parameters

floatradiusA value > 0 constructs a sphere with positive volume. A value of <= 0 is valid, and constructs a degenerate sphere.

See Also

pos, r, IsFinite(), IsDegenerate()

Syntax

Sphere::Sphere(const float4 &pointA, const float4 &pointB); [4 lines of code]

Constructs a sphere that passes through the given two points.

The constructed sphere will be the minimal sphere that encloses the given two points. The center point of this sphere will lie midway between pointA and pointB, and the radius will be half the distance between pointA and pointB. Both input points are assumed to be finite.

Syntax

Sphere::Sphere(const float4 &pointA, const float4 &pointB, const float4 &pointC); [4 lines of code]

Constructs a sphere that passes through the given three points.

Note
The resulting sphere may not be the minimal enclosing sphere for the three points!

Syntax

Sphere::Sphere(const float4 &pointA, const float4 &pointB, const float4 &pointC, const float4 &pointD); [4 lines of code]

Constructs a sphere that passes through the given four points.

Note
The resulting sphere may not be the minimal enclosing sphere for the four points!