Simbody
3.5
|
A geometric primitive representing a sphere by its radius and center point, and a collection of sphere-related utility methods. More...
Public Member Functions | |
Sphere_ () | |
Construct an uninitialized Sphere object; the center point and radius will be garbage. More... | |
Sphere_ (const Vec3P ¢er, RealP radius) | |
Construct a sphere from its center location and radius. More... | |
Sphere_ & | setRadius (RealP radius) |
Change the radius of this sphere. More... | |
Sphere_ & | setCenter (const Vec3P ¢er) |
Change the center location of this sphere. More... | |
Sphere_ & | scaleBy (RealP f) |
Modify this sphere to scale its radius by a fractional amount f, that is we set radius to f*radius. More... | |
Sphere_ & | stretchBoundary () |
Stretch this sphere in place by a small amount to ensure that there will be no roundoff problems if this is used as a bounding sphere. More... | |
RealP | findVolume () const |
Return the volume of this sphere (4/3 pi r^3). More... | |
RealP | findArea () const |
Return the surface area of this sphere (4 pi r^2). More... | |
bool | isPointOutside (const Vec3P &p) const |
Return true if a given point is strictly outside this sphere. More... | |
bool | isPointOutside (const Vec3P &p, RealP tol) const |
Return true if a given point is more than a given tolerance outside the sphere. More... | |
const Vec3P & | getCenter () const |
Get the location of the sphere's center point. More... | |
Vec3P & | updCenter () |
Get a writable reference to the sphere's center point. More... | |
RealP | getRadius () const |
Get the sphere's radius. More... | |
RealP & | updRadius () |
Get a writable reference to the sphere's radius. More... | |
A geometric primitive representing a sphere by its radius and center point, and a collection of sphere-related utility methods.
|
inline |
Construct an uninitialized Sphere object; the center point and radius will be garbage.
|
inline |
Construct a sphere from its center location and radius.
|
inline |
Change the radius of this sphere.
|
inline |
Change the center location of this sphere.
|
inline |
Modify this sphere to scale its radius by a fractional amount f, that is we set radius to f*radius.
|
inline |
Stretch this sphere in place by a small amount to ensure that there will be no roundoff problems if this is used as a bounding sphere.
The amount to stretch depends on the default tolerance for this precision, the radius, and the position of the sphere in space. A very large sphere, or a sphere that is very far from the origin, must be stretched more than a small one at the origin. Cost is 6 flops.
|
inline |
Return the volume of this sphere (4/3 pi r^3).
|
inline |
Return the surface area of this sphere (4 pi r^2).
|
inline |
Return true if a given point is strictly outside this sphere.
Just touching the sphere does not qualify.
|
inline |
Return true if a given point is more than a given tolerance outside the sphere.
|
inline |
Get the location of the sphere's center point.
|
inline |
Get a writable reference to the sphere's center point.
|
inline |
Get the sphere's radius.
|
inline |
Get a writable reference to the sphere's radius.