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

Syntax

void Sphere::Enclose(const float4 &point, float epsilon=1e-4f); [23 lines of code]
void Sphere::Enclose(const float4 *pointArray, int numPoints); [9 lines of code]
void Sphere::Enclose(const LineSegment &lineSegment); [13 lines of code]
void Sphere::Enclose(const AABB &aabb); [6 lines of code]
void Sphere::Enclose(const OBB &obb); [6 lines of code]
void Sphere::Enclose(const Sphere &sphere); [11 lines of code]
void Sphere::Enclose(const Triangle &triangle); [4 lines of code]
void Sphere::Enclose(const Polygon &polygon); [4 lines of code]
void Sphere::Enclose(const Polyhedron &polyhedron); [4 lines of code]
void Sphere::Enclose(const Frustum &frustum); [4 lines of code]
void Sphere::Enclose(const Capsule &capsule); [20 lines of code]

Expands this sphere to enclose both the original sphere and the given object.

This function may adjust both the position and the radius of this sphere to produce a new sphere that encloses both objects. The sphere that results may not be the optimal enclosing sphere. This function operates in-place.

Note
This function will not produce the optimal enclosure.

Parameters

floatepsilonAn extra distance-squared parameter for the amount to overgrow the Sphere to encompass the given point. This can be set to zero, but it may cause that Sphere::Contains(point) may return false.

See Also

FastEnclosingSphere(), OptimalEnclosingSphere().