SBVEC3F(3iv)

✨ SbVec3f ✨

okay bestie, welcome to the SbVec3f(3IV) manual page πŸŽ€ this is the 3D vector class and honestly? iconic. let's get into it πŸ’…


🌸 INHERITS FROM 🌸

SbVec3f

like, it inherits from itself. main character energy, no notes πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <Inventor/SbLinear.h>

   Methods from class SbVec3f:

                  SbVec3f()
                  SbVec3f(const float v[3])
                  SbVec3f(float x, float y, float z)
                  SbVec3f(SbPlane &p0, SbPlane &p1, SbPlane &p2)
SbVec3f             cross(const SbVec3f &v) const
float               dot(const SbVec3f &v) const
SbBool              equals(const SbVec3f v, float tolerance) const
SbVec3f             getClosestAxis() const
const float *       getValue() const
void                getValue(float &x, float &y, float &z) const
float               length() const
void                negate()
float               normalize()
SbVec3f &           setValue(const float v[3])
SbVec3f &           setValue(float x, float y, float z)
SbVec3f &           setValue(const SbVec3f &barycentic, const SbVec3f &v0,
                         const SbVec3f &v1, const SbVec3f &v2)
float &             operator [](int i)
const float &       operator [](int i)
SbVec3f &           operator *=(float d)
SbVec3f &           operator /=(float d)
SbVec3f &           operator +=(const SbVec3f &u)
SbVec3f &           operator -=(const SbVec3f &u)
SbVec3f             operator -() const
SbVec3f             operator *(const SbVec3f &v, float d)
SbVec3f             operator *(float d, const SbVec3f &v)
SbVec3f             operator /(const SbVec3f &v, float d)
SbVec3f             operator +(const SbVec3f &v1, const SbVec3f &v2)
SbVec3f             operator -(const SbVec3f &v1, const SbVec3f &v2)
int                 operator ==(const SbVec3f &v1, const SbVec3f &v2)
int                 operator !=(const SbVec3f &v1, const SbVec3f &v2)

πŸ’œ DESCRIPTION πŸ’œ

okay so. SbVec3f is the 3D vector class β€” it stores 3D vectors and points, that's its whole thing and it does it flawlessly 🫢

and like, this class is everywhere in Inventor. arguments? return values? it's giving "I'm in every function you've ever met". the way that Inventor could not function without it... periodt πŸ’…


🌈 METHODS 🌈

  • SbVec3f() default constructor. the og. the blank slate ✨
  • SbVec3f(const float v[3])
  • SbVec3f(float x, float y, float z) constructor given vector components β€” you hand it the numbers, it becomes the vector, slay πŸŽ€
  • SbVec3f(SbPlane &p0, SbPlane &p1, SbPlane &p2) constructor given 3 planes. three planes walk into a bar and out comes a vector, no cap πŸ¦‹
  • SbVec3f cross(const SbVec3f &v) const returns the right-handed cross product of vector and another vector. perpendicular queen πŸ‘‘
  • float dot(const SbVec3f &v) const returns the dot (inner) product of vector and another vector. just multiply-y vibes fr fr
  • SbBool equals(const SbVec3f v, float tolerance) const equality comparison within given tolerance β€” and the tolerance is the square of the length of the maximum distance between the two vectors. that's the whole definition, don't @ me, it's in the source 😭
  • SbVec3f getClosestAxis() const returns the principal axis that is closest (based on maximum dot product) to this vector. it's picking its favorite direction πŸ’–
  • const float * getValue() const
  • void getValue(float &x, float &y, float &z) const returns vector components. either as a pointer or by filling in x, y and z β€” choose your fighter 🫢
  • float length() const returns the geometric length of vector. yes bestie, it measures itself πŸ“
  • void negate() negates each component of vector in place. no new object, just flipping the sign right where it stands πŸ’…
  • float normalize() changes vector to be unit length, and returns the length before normalization. so you get the receipt of what it used to be 🧾✨
  • SbVec3f & setValue(const float v[3])
  • SbVec3f & setValue(float x, float y, float z) sets the vector components. give it numbers, get a vector back πŸŽ€
  • SbVec3f & setValue(const SbVec3f &barycentic, const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2) sets the value of the vector as the weighted average of 3 other vectors. barycentric core 🌸
  • float & operator [](int i)
  • const float & operator [](int i) accesses the indexed component of the vector. v[0], v[1], v[2] β€” pick your index, bestie πŸ”’
  • SbVec3f & operator *=(float d)
  • SbVec3f & operator /=(float d) component-wise scalar multiplication and division operators. scale it up, scale it down πŸ’«
  • SbVec3f & operator +=(const SbVec3f &u)
  • SbVec3f & operator -=(const SbVec3f &u) component-wise vector addition and subtraction operators. math but make it cozy 🫢
  • SbVec3f operator -() const nondestructive unary negation β€” returns a new vector. the original is untouched, we respect boundaries here πŸ’…
  • SbVec3f operator *(const SbVec3f &v, float d)
  • SbVec3f operator *(float d, const SbVec3f &v)
  • SbVec3f operator /(const SbVec3f &v, float d) component-wise binary scalar multiplication and division operators. both orders of multiplication are here because it said "why not both" πŸ’–
  • SbVec3f operator +(const SbVec3f &v1, const SbVec3f &v2)
  • SbVec3f operator -(const SbVec3f &v1, const SbVec3f &v2) component-wise binary vector addition and subtraction operators. two vectors, one result, iconic 🌈
  • int operator ==(const SbVec3f &v1, const SbVec3f &v2)
  • int operator !=(const SbVec3f &v1, const SbVec3f &v2) equality comparison operators. are they the same? are they not? find out πŸ¦‹

πŸ‘‘ SEE ALSO πŸ‘‘

SbVec2f, SbVec4f, SbVec2s, SbRotation

go read those too bestie, they're the friend group πŸ’–


and that's the whole page! this was the SbVec3f(3IV) manual β€” the source/version and date slots on this one are just kinda empty, vibing, no thoughts head empty πŸŽ€ so consider this your cute little sign-off: stay perpendicular, normalize yourself, and never forget to return the length before you do it βœ¨πŸ’…πŸ«Ά