SbSphere(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

✨ 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 &center, const float radius)
void setValue (const SbVec3f &center, const float radius)
void setCenter (const SbVec3f &center)
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, FALSE is returned. Otherwise we will return TRUE. ✨

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