SbSphere(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸ’– SbSphere(3) πŸ’–

okay bestie, so this is a page from the Library Functions Manual and it's literally all about SbSphere β€” the glow-up your 3D geometry toolkit didn't know it needed. grab a strawberry πŸ“ and let's go.


✨ NAME ✨

SbSphere β€” the SbSphere class is a representation of a sphere.


🌸 SYNOPSIS 🌸

#include <Inventor/SbLinear.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 πŸ¦‹

The SbSphere class is a representation of a sphere. no cap, that's the whole vibe.

This class is used within many other classes in Coin. It contains the data neccessary to represent a sphere (a 3D point and a radius). so like... a center and a radius, that's it, that's the whole personality πŸ’…

See also

  • SbCylinder β€” its sibling, iconic in its own right

πŸ‘‘ Constructor & Destructor Documentation πŸ‘‘

🌈 SbSphere::SbSphere (void )

The default constructor does nothing. The center point and the radius will be uninitialized. it's giving "woke up, no thoughts, head empty" 😭 so fr fr, don't use it without setting stuff first.

✨ SbSphere::SbSphere (const SbVec3f & centerarg, const float radiusarg)

Construct an SbSphere instance with the given center point and radius. cute, functional, slays.

References SoDebugError::postWarning(), and setValue().


πŸ’œ Member Function Documentation πŸ’œ

⭐ void SbSphere::setValue (const SbVec3f & centerarg, const float radiusarg)

Set the sphere's center point and radius. two birds, one call, efficiency queen.

See also

  • getCenter(), getRadius().

References SoDebugError::postWarning(), setCenter(), and setRadius().

Referenced by SbSphere().


🫢 void SbSphere::setCenter (const SbVec3f & centerarg)

Set the sphere's center point. just the middle, bestie.

See also

  • setValue(), setRadius() and getCenter().

Referenced by circumscribe(), and setValue().


🌸 void SbSphere::setRadius (const float radiusarg)

Set the sphere's radius. how big is she? now you decide.

See also

  • setValue(), setCenter() and getRadius().

References SoDebugError::postWarning().

Referenced by circumscribe(), SbBSPTree::findClosest(), and setValue().


πŸŽ€ const SbVec3f & SbSphere::getCenter (void ) const

Returns an SbVec3f with the sphere's center point.

See also

  • setCenter(), getRadius().

Referenced by SbBSPTree::findClosest(), SbBSPTree::findClosest(), intersect(), and print(). (yes, SbBSPTree::findClosest() is listed twice β€” we don't make the rules, we just report them πŸ’€)


πŸ¦‹ float SbSphere::getRadius (void ) const

Returns the sphere's radius.

See also

  • setRadius(), getCenter().

Referenced by intersect(), print(), SoFrustumCamera::viewBoundingBox(), SoOrthographicCamera::viewBoundingBox(), and SoPerspectiveCamera::viewBoundingBox().


πŸ”₯ void SbSphere::circumscribe (const SbBox3f & box)

Make the sphere exactly contain box, i.e. the sphere center point will be the same as that of the box, and the radius will be the distance from the box center point to any of the corners. snug fit, no gaps, periodt.

References SbBox3f::getCenter(), SbBox3f::getSize(), SbBox3f::isEmpty(), SoDebugError::postWarning(), setCenter(), and setRadius().

Referenced by SoFrustumCamera::viewBoundingBox(), SoOrthographicCamera::viewBoundingBox(), and SoPerspectiveCamera::viewBoundingBox().


πŸ’… 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.

References intersect().

Referenced by intersect(). (she's referencing herself, main character energy fr)


🌈 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. If the ray just "grazes" the sphere, the enter and exit points have equal values.

If the ray does not intersect the sphere, FALSE is returned, otherwise we will return TRUE.

References SbVec3f::dot(), getCenter(), SbLine::getDirection(), SbLine::getPosition(), getRadius(), SbVec3f::length(), SbVec3f::normalize(), and SoDebugError::postWarning().


🧚 SbBool SbSphere::pointInside (const SbVec3f & p) const

Returns TRUE of the given point p lies within the sphere. (yes, "of" β€” that's what the page says, and we are nothing if not faithful πŸ™ˆ)


πŸ“ void SbSphere::print (FILE * fp) const

Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.

⚠️ warning bestie: in an optimized build this is a whole lot of nothing. don't sit there waiting for output, she's not coming.

References getCenter(), getRadius(), and SbVec3f::print().


⭐ Author ⭐

Generated automatically by Doxygen for Coin from the source code. (not a human, just vibes and a parser 🫢)


and that's the whole page, bestie β€” you ate πŸ’– this was Coin, Version 2.5.0, signing off like the icon she is. go build something spherical, iykyk 🌟

πŸ“¦ where this page comes from