SBVEC2S(3iv)

πŸ’– SbVec2s πŸ’–

okay bestie, so this is the manual page for SbVec2s, and it lives in the 3IV manual. it's a 2D vector class. that's the whole vibe. let's get into it 🫢


🌸 NAME 🌸

SbVec2s β€” 2D vector class ✨


πŸ¦‹ INHERITS FROM πŸ¦‹

SbVec2s

(yes babe it inherits from itself, we don't make the rules, that's just what the page says πŸ’€)


⭐ SYNOPSIS ⭐

#include <Inventor/SbLinear.h>

   Methods from class SbVec2s:

                  SbVec2s()
                  SbVec2s(const short v[2])
                  SbVec2s(short x, short y)
     int32_t      dot(const SbVec2f &v) const
     const short *getValue() const
     void         getValue(short &x, short &y) const
     void         negate()
     SbVec2s &    setValue(const short v[2])
     SbVec2s &    setValue(short x, short y)
     short &      operator [](int i)
     const short &operator [](int i)
     SbVec2s &    operator *=(int d)
     SbVec2s &    operator *=(double d)
     SbVec2s &    operator /=(int d)
     SbVec2s &    operator /=(double d)
     SbVec2s &    operator +=(const SbVec2s &u)
     SbVec2s &    operator -=(const SbVec2s &u)
     SbVec2s      operator -() const
     SbVec2s      operator *(const SbVec2s &v, int d)
     SbVec2s      operator *(const SbVec2s &v, double d)
     SbVec2s      operator *(int d, const SbVec2s &v)
     SbVec2s      operator *(double d, const SbVec2s &v)
     SbVec2s      operator /(const SbVec2s &v, int d)
     SbVec2s      operator /(const SbVec2s &v, double d)
     SbVec2s      operator +(const SbVec2s &v1, const SbVec2s &v2)
     SbVec2s      operator -(const SbVec2s &v1, const SbVec2s &v2)
     int          operator ==(const SbVec2s &v1, const SbVec2s &v2)
     int          operator !=(const SbVec2s &v1, const SbVec2s &v2)

🌈 DESCRIPTION 🌈

so this is a 2D vector class used to store 2D integer vectors and points. and the way Inventor uses it everywhere β€” like, throughout the whole library β€” for arguments and return values. it's giving main character energy fr fr πŸ‘‘


✨ METHODS ✨

  • SbVec2s() β€” default constructor. no args, no drama, just a fresh lil vector.
  • SbVec2s(const short v[2]) SbVec2s(short x, short y) β€” constructor given 2 components. you hand it the goods, it makes the vector. slay.
  • int32_t dot(const SbVec2f &v) const β€” returns the dot (inner) product of the vector and another vector. math bestie moment πŸ”₯
  • const short *getValue() const void getValue(short &x, short &y) const β€” returns the vector components. two ways, both valid, pick your fighter.
  • void negate() β€” negates each component of the vector in place. note: in place. it's not giving you a new one, it's changing this one. periodt.
  • SbVec2s &setValue(const short v[2]) SbVec2s &setValue(short x, short y) β€” sets the vector components. πŸ’…
  • short &operator [](int i) const short &operator [](int i) β€” accesses the indexed component of the vector. square brackets, do your thing πŸŽ€
  • SbVec2s &operator *=(int d) SbVec2s &operator *=(double d) SbVec2s &operator /=(int d) SbVec2s &operator /=(double d) β€” component-wise scalar multiplication and division operators. one number in, every component gets the treatment ✨
  • SbVec2s &operator +=(const SbVec2s &u) SbVec2s &operator -=(const SbVec2s &u) β€” component-wise vector addition and subtraction operators. vector meets vector 🫢
  • SbVec2s operator -() const β€” nondestructive unary negation β€” returns a new vector. unlike negate(), this one doesn't touch the original, it just hands you a fresh little guy πŸ˜­πŸ’–
  • SbVec2s operator *(const SbVec2s &v, int d) SbVec2s operator *(const SbVec2s &v, double d) SbVec2s operator *(int d, const SbVec2s &v) SbVec2s operator *(double d, const SbVec2s &v) SbVec2s operator /(const SbVec2s &v, int d) SbVec2s operator /(const SbVec2s &v, double d) β€” component-wise binary scalar multiplication and division operators. and yes, the scalar can come first or second for the multiplication ones, they're flexible like that πŸ’…
  • SbVec2s operator +(const SbVec2s &v1, const SbVec2s &v2) SbVec2s operator -(const SbVec2s &v1, const SbVec2s &v2) β€” component-wise binary vector addition and subtraction operators. two vectors walk in, one vector walks out πŸ¦‹
  • int operator ==(const SbVec2s &v1, const SbVec2s &v2) int operator !=(const SbVec2s &v1, const SbVec2s &v2) β€” equality comparison operators. are they the same or are they not, that is the question ⭐

πŸ‘‘ SEE ALSO πŸ‘‘

SbVec3f, SbVec4f, SbVec2f

go read those next, bestie, they're the siblings 🧚


ok that's the whole page, no cap. every flag, every operator, every component β€” all accounted for πŸ’€βœ¨

and that's a wrap! this was SbVec2s from the 3IV manual, and the date slot at the bottom is literally just sitting there empty β€” iconic, honestly, it said "no date, only vibes" πŸ™ˆ the source and version are all there in that 3IV, so you know exactly where this came from. bye bestie, go build something cute with your 2D integer vectors πŸ’–πŸŽ€πŸ¦‹