Back to class index

Class Sphere

Summary

A 3D sphere.

Member Reference

SphereA 3D sphere.
posThe center point of this sphere.
rThe radius of this sphere.
ctor (+4 overloads)The default constructor does not initialize any members of this class.
Translate(offset)Translates this Sphere in world space.
Transform(transform) (+3 overloads)Applies a transformation to this Sphere, in-place.
MinimalEnclosingAABB()[const]Returns the smallest AABB that encloses this sphere.
MaximalContainedAABB()[const]Returns the largest AABB that fits inside this sphere.
SetNegativeInfinity()Sets pos = (0,0,0) and r = -inf.
Volume()[const]Computes the volume of this sphere.
SurfaceArea()[const]Computes the surface area of this sphere.
Diameter()[const]Computes the diameter of this sphere.
Centroid()[const]Returns the center of mass of this sphere.
AnyPointFast()[const]Quickly returns an arbitrary point inside this Sphere. Used in GJK intersection test.
ExtremePoint(direction)[const] (+1 overload)Computes the extreme point of this Sphere in the given direction.
ProjectToAxis(...)[const]Projects this Sphere onto the given 1D axis direction vector.
IsFinite()[const]Tests if this Sphere is finite.
IsDegenerate()[const]Returns true if this Sphere is degenerate.
SetDegenerate()Resets the members of this Sphere to NaN values.
Contains(point)[const] (+11 overloads)Tests if the given object is fully contained inside this sphere.
Distance(point)[const] (+9 overloads)Returns the distance between this sphere and the given object.
MaxDistance(point)[const]Returns the maximal distance of this sphere to the given point.
ClosestPoint(point)[const]Computes the closest point on this sphere to the given object.
Intersects(...)[const] (+11 overloads)Tests whether this sphere and the given object intersect.
Enclose(point,epsilon) (+10 overloads)Expands this sphere to enclose both the original sphere and the given object.
ExtendRadiusToContain(point,epsilon) (+1 overload)Expands the radius of this Sphere until it encloses the given object.
RandomPointInside(lcg)Generates a random point inside this sphere.
RandomPointOnSurface(lcg)Generates a random point on the surface of this sphere.
Triangulate(...)[const]Produces a geosphere-triangulation of this sphere.
ToString()[const]Returns a human-readable representation of this Sphere. Most useful for debugging purposes.
SerializeToString()[const]
SerializeToCodeString()[const]Returns a string of C++ code that can be used to construct this object. Useful for generating test cases from badly behaving objects.
Equals(rhs,epsilon)[const]
BitEquals(other)[const]Compares whether this Sphere and the given Sphere are identical bit-by-bit in the underlying representation.
FastEnclosingSphere(...)[static]Computes a Sphere that bounds the given point array.
OptimalEnclosingSphere(...)[static] (+4 overloads)Computes the minimal bounding sphere for the given point array.
FitThroughPoints(a,b)[static] (+2 overloads)Fits a sphere through the given two points.
RandomPointInside(lcg,center,radius)[static]
RandomPointOnSurface(lcg,center,radius)[static]
RandomUnitaryFloat3(lcg)[static]Returns a random normalized direction vector.
IntersectLine(...)[static]Computes the intersection of a line and a sphere.
FromString(str,outEndStr)[static] (+1 overload)
Back to class index