SBXFBOX3F(3iv)

πŸ’– SbXfBox3f β€” like, the whole vibe πŸ’–

okay bestie, gather round, because we're talking about SbXfBox3f, which lives in manual section 3iv (yes, the (3IV) in the corner is just its little name tag πŸŽ€). It's a 3D box with an associated transformation matrix, and honestly? she's iconic.


🌸 INHERITS FROM 🌸

SbBox3f > SbXfBox3f

so yes, she's a SbBox3f at heart, just with extra main character energy πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/SbBox.h>

πŸ¦‹ Methods from class SbXfBox3f:

                     SbXfBox3f()
                     SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)
                     SbXfBox3f(const SbBox3f &box)
                     ~SbXfBox3f()
 void                setTransform(const SbMatrix &m)
 const SbMatrix &    getTransform() const
 const SbMatrix &    getInverse() const
 SbVec3f             getCenter() const
 void                extendBy(const SbVec3f &pt)
 void                extendBy(const SbBox3f &bb)
 void                extendBy(const SbXfBox3f &bb)
 SbBool              intersect(const SbVec3f &pt) const
 SbBool              intersect(const SbBox3f &bb) const
 void                setBounds(float xmin, float ymin, float zmin, float
                          xmax, float ymax, float zmax)
 void                setBounds(const SbVec3f &_min, const SbVec3f &_max)
 void                getBounds(float &xmin, float &ymin, float &zmin, float
                          &xmax, float &ymax, float &zmax) const
 void                getBounds(SbVec3f &_min, SbVec3f &_max) const
 void                getOrigin(float &originX, float &originY, float
                          &originZ)
 void                getSize(float &sizeX, float &sizeY, float &sizeZ)
 float               getVolume() const
 void                makeEmpty()
 SbBool              isEmpty() const
 SbBool              hasVolume() const
 void                getSpan(const SbVec3f &direction, float &dMin, float
                          &dMax) const
 void                transform(const SbMatrix &m)
 SbBox3f             project() const
 int                 operator ==(const SbXfBox3f &b1, const SbXfBox3f &b2)
 int                 operator !=(const SbXfBox3f &b1, const SbXfBox3f &b2)

🌈 Methods from class SbBox3f:

 const SbVec3f &     getMin()
 const SbVec3f &     getMax()

πŸ’œ DESCRIPTION πŸ’œ

So picture this: it's a 3D box, but with an arbitrary transformation applied to it. That's the whole thing. That's her.

Why do you care? Because this class is literally built for when a box is gonna get transformed frequently. Here's the tea β˜• β€” if you used a plain SbBox3f for that job, it would expand every single time you transformed it, because it has to keep itself axis-aligned. Every transform, boom, bigger box. Not cute.

But an SbXfBox3f? Transformations can be accumulated on it without expanding the box at all. Then, once all your transformations are done, you can expand it to an axis-aligned box if you need to. Periodt. πŸ‘‘


πŸŽ€ METHODS πŸŽ€

                     SbXfBox3f()
                     SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)
                     SbXfBox3f(const SbBox3f &box)
                     ~SbXfBox3f()

Constructors and destructor. πŸ’–

  • void setTransform(const SbMatrix &m) β€” sets the transformation on the box.
  • const SbMatrix & getTransform() const
  • const SbMatrix & getInverse() const

gets the transformation on the box, and its inverse. both of them. a matching set 🫢

  • SbVec3f getCenter() const β€” returns the center of the box.
  • void extendBy(const SbVec3f &pt) β€” extends the box (if necessary) so it contains the given 3D point. Important caveat though bestie: if the box has had a non-identity transformation applied using the setTransform() method, the point is assumed to be in the transformed space. Like, here's the example from the source, verbatim:
SbXfBox3f bbox; bbox.extendBy(SbVec3f(0,0,0));
SbMatrix trans; trans.setTranslate(SbVec3f(1,1,1));
bbox.setTransform(trans);
bbox.extendBy(SbVec3f(0,0,0));

and that will result in a bounding box extending from (-1,-1,-1) to (0,0,0) in bbox'es local (untransformed) space. iykyk 😭

  • void extendBy(const SbBox3f &bb) β€” extends the box (if necessary) so it contains the given SbBox3f. Same caveat energy: if the box has had a non-identity transformation applied using setTransform(), the given SbBox3f is assumed to be in the transformed space.
  • void extendBy(const SbXfBox3f &bb) β€” extends the box (if necessary) so it contains the given SbXfBox3f.
  • SbBool intersect(const SbVec3f &pt) const β€” returns TRUE if the intersection of the given point and this box is not empty.
  • SbBool intersect(const SbBox3f &bb) const β€” returns TRUE if the intersection of the given box and this box is not empty.
  • void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
  • void setBounds(const SbVec3f &_min, const SbVec3f &_max)
  • void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
  • void getBounds(SbVec3f &_min, SbVec3f &_max) const

set and get the bounds of the box. your classic getter/setter duo πŸ’…

  • void getOrigin(float &originX, float &originY, float &originZ) β€” returns the origin (minimum point) of the box.
  • void getSize(float &sizeX, float &sizeY, float &sizeZ) β€” returns the size of the box.
  • float getVolume() const β€” gives the volume of the box (0 for an empty box).
  • void makeEmpty() β€” sets the box to contain nothing. the void era πŸ•³οΈ
  • SbBool isEmpty() const β€” checks if the box is empty (degenerate).
  • SbBool hasVolume() const β€” checks if the box has volume; i.e., all three dimensions have positive size.
  • void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const β€” finds the extent of the box along a particular direction.
  • void transform(const SbMatrix &m) β€” transforms the box by the given matrix.
  • SbBox3f project() const β€” projects an SbXfBox3f to an SbBox3f. she's demoting herself, respectfully πŸ™ˆ
  • int operator ==(const SbXfBox3f &b1, const SbXfBox3f &b2)
  • int operator !=(const SbXfBox3f &b1, const SbXfBox3f &b2)

equality comparisons. are they the same? are they not? find out πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

SbBox3f, SbBox2f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction

go read those too, they're all in the friend group πŸ¦‹


okay that's the whole page!! πŸ’– this was SbXfBox3f(3IV)() from the 3iv section β€” go slay your bounding boxes bestie, you got this βœ¨πŸŒΈπŸ‘‘