SbSphere(3)
π 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 ¢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 π¦
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()andgetCenter().
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()andgetRadius().
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
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms