SbSphere(3)
β¨ NAME β¨
SbSphere β bestie, it's a sphere. Literally. The SbSphere class is a representation of a sphere. π
(Also hi, you're reading page SbSphere(3) out of the Coin manual, in case you were wondering where you wandered into. Welcome. Sit down. Stay a while. π«Ά)
πΈ SYNOPSIS πΈ
#include <Inventor/SbSphere.h>
π Public Member Functions
SbSphere (void)
SbSphere (const SbVec3f ¢er, const float radius)
void setValue (const SbVec3f ¢er, const float radius)
void setCenter (const SbVec3f ¢er)
void setRadius (const float radius)
const SbVec3f & getCenter (void) const
float getRadius (void) const
void circumscribe (const SbBox3f &box)
SbBool intersect (const SbLine &l, SbVec3f &intersection) const
SbBool intersect (const SbLine &l, SbVec3f &enter, SbVec3f &exit) const
SbBool pointInside (const SbVec3f &p) const
void print (FILE *file) const
π Detailed Description π
okay so. The SbSphere class is a representation of a sphere. That's the whole vibe. π
The way this class gets used everywhere β it lives inside so many other classes in Coin like it's the main character of geometry. And what does it actually hold? The data necessary to represent a sphere, which is:
- a 3D point (the center, obviously π«)
- a radius (a
float, no drama)
That's it. That's the whole thing. Two pieces of info carrying the entire spherical fantasy. iconic behavior, honestly. β¨
See also SbCylinder β its sibling, its partner in crime, its round-object bestie. π¦
π Constructor & Destructor Documentation π
SbSphere::SbSphere (void )
The default constructor does literally nothing. Not a single thing. Bestie is just vibing. π
The center point and the radius will be uninitialized β so don't go reading them like they mean something, because they do NOT. That's undefined-adjacent chaos and we don't do that here. π
SbSphere::SbSphere (const SbVec3f & centerarg, const float radiusarg)
Construct an SbSphere instance with the given center point and radius. Yes. You hand it a center, you hand it a radius, you get a sphere. Slay. π
π¦ Member Function Documentation π¦
void SbSphere::setValue (const SbVec3f & centerarg, const float radiusarg)
Set the sphere's center point and radius. Both at once. Efficient queen. π
See also: getCenter(), getRadius().
void SbSphere::setCenter (const SbVec3f & centerarg)
Set the sphere's center point. Just the center. Radius stays exactly how you left it. π
See also: setValue(), setRadius() and getCenter().
void SbSphere::setRadius (const float radiusarg)
Set the sphere's radius. Just the radius this time. Center is untouched, living its life. β¨
See also: setValue(), setCenter() and getRadius().
const SbVec3f & SbSphere::getCenter (void ) const
Returns an SbVec3f with the sphere's center point. Hand it right back to you, no cap. π«
See also: setCenter(), getRadius().
float SbSphere::getRadius (void ) const
Returns the sphere's radius. A float. Simple. Gorgeous. Perfect. πΈ
See also: setRadius(), getCenter().
void SbSphere::circumscribe (const SbBox3f & box)
Make the sphere exactly contain box. Like, hug it perfectly. π€ Here's the tea:
- the sphere's center point will be the same as that of the box
- the radius will be the distance from the box's center point to any of the corners
so the sphere ends up being the smallest round thing that fully wraps your box. it's giving geometric devotion. π
SbBool SbSphere::intersect (const SbLine & l, SbVec3f & intersection) const
Finds the intersection enter point for the given line l on the sphere. π―
If the line does not intersect the sphere, FALSE is returned. No intersection, no entry point, no problem. π
SbBool SbSphere::intersect (const SbLine & l, SbVec3f & enter, SbVec3f & exit) const
Find the intersection points of the ray l on the sphere and return these in enter and exit. πͺπͺ
And here's a cute little detail β if the ray just "grazes" the sphere, then the enter and exit points have equal values. Like, it barely touched it. a whisper of a tangent. π
If the ray does not intersect the sphere,FALSEis returned. Otherwise we will returnTRUE. β¨
SbBool SbSphere::pointInside (const SbVec3f & p) const
Returns TRUE if the given point p lies within the sphere. Are you in the sphere or are you not. Vibe check, but make it geometry. π₯
void SbSphere::print (FILE * fp) const
Dump the state of this object to the fp file stream. π
Heads up though β this only works in the debug version of the library. In an optimized build, the method does nothing. Zero. Zilch. Not a single byte printed. So don't be out here debugging a release build and wondering why your output is empty, bestie, because it's not a bug, it's a build config. π
β Author β
Generated automatically by Doxygen for Coin from the source code. Not a human, not a poet, just a doc generator doing its thing. π«Ά
and that's the whole page, babe! π this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, page SbSphere(3) β go forth and sphere responsibly. πβ¨π¦
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms