SbVec2b(3)
π 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 twoint8_ts.SbVec2b(int8_t x, int8_t y)β build it from two separateint8_tvalues, one for each axis, slay.SbVec2b(const SbVec2ub &v)β convert from anSbVec2ub.SbVec2b(const SbVec2s &v)β convert from anSbVec2s.SbVec2b(const SbVec2i32 &v)β convert from anSbVec2i32.SbVec2b(const SbVec2f &v)β convert from anSbVec2f.SbVec2b(const SbVec2d &v)β convert from anSbVec2d.
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 twoint8_ts.SbVec2b & setValue(int8_t x, int8_t y)β set from twoint8_tvalues.SbVec2b & setValue(const SbVec2ub &v)β set from anSbVec2ub.SbVec2b & setValue(const SbVec2s &v)β set from anSbVec2s.SbVec2b & setValue(const SbVec2i32 &v)β set from anSbVec2i32.SbVec2b & setValue(const SbVec2f &v)β set from anSbVec2f.SbVec2b & setValue(const SbVec2d &v)β set from anSbVec2d.
getting the values back out, because reading is fundamental:
const int8_t * getValue(void) constβ hands you a pointer to the internalint8_tarray.void getValue(int8_t &x, int8_t &y) constβ writes the two components into your ownxandyvariables.
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 withv, returned as anint32_t.void negate(void)β flips both components to their negatives, in place.SbVec2b & operator*=(int d)β multiply in place by anint.SbVec2b & operator*=(double d)β multiply in place by adouble.SbVec2b & operator/=(int d)β divide in place by anint.SbVec2b & operator/=(double d)β divide in place by adouble.SbVec2b & operator+=(SbVec2b v)β addvin place.SbVec2b & operator-=(SbVec2b v)β subtractvin 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
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.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