SBSPHERE(3iv)

πŸ’– SbSphere β€” bestie, it's a whole class for representing a sphere πŸ’–

Okay so real talk, this is the SbSphere(3IV) manual page, and it's genuinely one of the cutest little classes in the Inventor toolkit. It's giving main character energy but make it a 3D sphere. Let's get into it πŸ¦‹


🌸 INHERITS FROM 🌸

  • SbSphere β€” that's it bestie, she inherits from herself, she's self-made, periodt πŸ’…

✨ SYNOPSIS ✨

First thing first, you gotta pull her in:

#include <Inventor/SbLinear.h>

Then here's every single method from class SbSphere, laid out exactly as the header file does it:

                     SbSphere()
                     SbSphere(const SbVec3f &center, float radius)
void                setValue(const SbVec3f &center, float radius)
void                setCenter(const SbVec3f &center)
void                setRadius(float radius)
const SbVec3f &     getCenter() const
float               getRadius() const
void                circumscribe(const SbBox3f &box)
SbBool              intersect(const SbLine &l, SbVec3f &intersection)
                          const
SbBool              intersect(const SbLine &l, SbVec3f &enter, SbVec3f
                          &exit) const

Like… look at her. Organized. Efficient. No cap. πŸŽ€


🌈 DESCRIPTION 🌈

So SbSphere represents a sphere in 3D. That's the whole vibe. She is a lightweight datatype β€” think of her as the girl who shows up, does her job, and doesn't need a whole rendering pipeline to feel fulfilled. She's used for arguments or return values in the Inventor toolkit, which is very "I'm a supporting character but I carry the plot" of her.

Now β€” and this is important, bestie β€” if you want an actual database sphere, like one that gets rendered, picked, all of that, you want SoSphere instead. SbSphere is the math-y friend; SoSphere is the one who shows up on screen. Different queens, different jobs. Don't mix them up πŸ™ˆ


πŸ’… METHODS πŸ’…

🫢 Constructors

                     SbSphere()
                     SbSphere(const SbVec3f &center, float radius)

Two ways to be born: the no-arg one, and the one where you hand her a center and a radius right away. Iconic behavior.


⭐ Setting her up

  • void setValue(const SbVec3f &center, float radius) β€” change both the center and the radius at once. One call, whole glow-up.
  • void setCenter(const SbVec3f &center)
  • void setRadius(float radius)

These two let you set just the center or just the radius. Pick your lane, bestie πŸ’–


πŸ‘‘ Reading her mind

  • const SbVec3f & getCenter() const
  • float getRadius() const

Hand these back and you get the center and the radius. That's the tea. β˜•


πŸ¦‹ circumscribe

  • void circumscribe(const SbBox3f &box)

Give her a box and she'll return a sphere containing that box. She's a giver, she contains multitudes, literally. 🌈


πŸ”₯ intersect

SbBool              intersect(const SbLine &l, SbVec3f &intersection)
                         const
SbBool              intersect(const SbLine &l, SbVec3f &enter, SbVec3f
                         &exit) const

This is the moment, the crossover episode: intersect a line and a sphere, and she returns TRUE if there is an intersection. πŸ’€

⚠️ Heads up bestie, this one matters: the line is treated as a ray. Not an infinite line, a ray. Don't come for me when your intersection math is off because you forgot that part. Periodt.

Two flavors, btw:

  • the one that gives you back a single intersection
  • the one that gives you enter and exit β€” the whole entrance and exit of the drama 🎭

🌟 SEE ALSO 🌟

Go be nosy, she runs with a good crowd:

  • SbVec3f
  • SbLine
  • SoSphere

That's the whole page, bestie β€” every flag, every signature, every vibe, nothing skipped. Go build something cute with it. πŸ’œ

With love, from the SbSphere(3IV) manual page β€” that's the source/version stamp this one ships with, and yeah, no date was ever printed on it, so we're keeping it mysterious. πŸŽ€βœ¨