SbVec2b(3)

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

πŸ’– SbVec2b πŸ’–

okay so bestie, welcome to the SbVec2b page from the Library Functions Manual β€” yes it's a manpage, yes it's giving vintage terminal chic, but we're gonna make it cute AND accurate, because knowing your vector classes is main character energy. πŸŽ€


✨ NAME ✨

SbVec2b β€” a vector class for containing two byte integers. that's it, that's the whole vibe: two little bytes, vibing together, forever. πŸ¦‹


🌸 SYNOPSIS 🌸

first things first, you gotta pull it in:

#include <Inventor/SbVec2b.h>

🫢 Public Member Functions 🫢

the constructors, aka the many ways to birth a SbVec2b:

  • SbVec2b(const int8_t v[2]) β€” build it from an array of two int8_ts.
  • SbVec2b(int8_t x, int8_t y) β€” build it from two separate int8_t values, one for each axis, slay.
  • SbVec2b(const SbVec2ub &v) β€” convert from an SbVec2ub.
  • SbVec2b(const SbVec2s &v) β€” convert from an SbVec2s.
  • SbVec2b(const SbVec2i32 &v) β€” convert from an SbVec2i32.
  • SbVec2b(const SbVec2f &v) β€” convert from an SbVec2f.
  • SbVec2b(const SbVec2d &v) β€” convert from an SbVec2d.

the setValue squad β€” same conversions, but as a glow-up in place, and each one hands you back a reference to the vector (chainable, iconic):

  • SbVec2b & setValue(const int8_t v[2]) β€” set from an array of two int8_ts.
  • SbVec2b & setValue(int8_t x, int8_t y) β€” set from two int8_t values.
  • SbVec2b & setValue(const SbVec2ub &v) β€” set from an SbVec2ub.
  • SbVec2b & setValue(const SbVec2s &v) β€” set from an SbVec2s.
  • SbVec2b & setValue(const SbVec2i32 &v) β€” set from an SbVec2i32.
  • SbVec2b & setValue(const SbVec2f &v) β€” set from an SbVec2f.
  • SbVec2b & setValue(const SbVec2d &v) β€” set from an SbVec2d.

getting the values back out, because reading is fundamental:

  • const int8_t * getValue(void) const β€” hands you a pointer to the internal int8_t array.
  • void getValue(int8_t &x, int8_t &y) const β€” writes the two components into your own x and y variables.

element access, lowkey the best part:

  • int8_t & operator[](int i) β€” indexed access, mutable flavor.
  • const int8_t & operator[](int i) const β€” indexed access, but make it const.

math time, no cap:

  • int32_t dot(SbVec2b v) const β€” the dot product with v, returned as an int32_t.
  • void negate(void) β€” flips both components to their negatives, in place.
  • SbVec2b & operator*=(int d) β€” multiply in place by an int.
  • SbVec2b & operator*=(double d) β€” multiply in place by a double.
  • SbVec2b & operator/=(int d) β€” divide in place by an int.
  • SbVec2b & operator/=(double d) β€” divide in place by a double.
  • SbVec2b & operator+=(SbVec2b v) β€” add v in place.
  • SbVec2b & operator-=(SbVec2b v) β€” subtract v in place.
  • SbVec2b operator-(void) const β€” returns the negated copy (the unary minus, bestie).

🧚 Protected Attributes 🧚

  • int8_t vec[2] β€” the actual storage, two bytes doing all the work behind the scenes. protected, so hands off unless you're a subclass. πŸ™ˆ

🌈 Detailed Description 🌈

a vector class for containing two byte integers. two. bytes. that's the whole assignment, and it ate. πŸ’…

πŸ‘€ See also

SbVec2ub β€” the unsigned sibling, go say hi.

⭐ Since

Coin 2.5 β€” so it's been around a minute, a true veteran of the codebase.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code. not a human, just a robot doing its little documentation dance, and honestly? respect. 🫢


and that's the whole page bestie!! 🌸 this was Coin, Version 3.1.3, and the page itself is the SbVec2b(3) manual entry β€” read it, love it, use it responsibly. mwah. πŸ’–βœ¨

πŸ“¦ where this page comes from