SBVEC4F(3iv)
β¨ SbVec4f β¨
okay bestie, welcome to the SbVec4f(3IV) manual page β this is the one, the icon, the 4D vector class π
π NAME π
SbVec4f β 4D vector class π¦
πΈ INHERITS FROM πΈ
SbVec4f β yes bestie, it inherits from itself, it's giving main character energy and honestly? we respect it π
β¨ SYNOPSIS β¨
#include <Inventor/SbLinear.h>
Methods from class SbVec4f:
SbVec4f()
SbVec4f(const float v[4])
SbVec4f(float x, float y, float z, float w)
float dot(const SbVec4f &v) const
SbBool equals(const SbVec4f v, float tolerance) const
void getReal(SbVec3f &v) const
const float * getValue() const
void getValue(float &x, float &y, float &z, float &w) const
float length() const
void negate()
normalize()
SbVec4f & setValue(const float v[4])
SbVec4f & setValue(float x, float y, float z, float w)
float & operator [](int i)
const float & operator [](int i)
SbVec4f & operator *=(float d)
SbVec4f & operator /=(float d)
SbVec4f & operator +=(const SbVec4f &u)
SbVec4f & operator -=(const SbVec4f &u)
SbVec4f operator -() const
SbVec4f operator *(const SbVec4f &v, float d)
SbVec4f operator *(float d, const SbVec4f &v)
SbVec4f operator /(const SbVec4f &v, float d)
SbVec4f operator +(const SbVec4f &v1, const SbVec4f &v2)
SbVec4f operator -(const SbVec4f &v1, const SbVec4f &v2)
int operator ==(const SbVec4f &v1, const SbVec4f &v2)
int operator !=(const SbVec4f &v1, const SbVec4f &v2)
π DESCRIPTION π
so basically: this is a 4D vector class used to store homogeneous coordinates β¨. Like, four whole numbers, all together, living their best life.
and the way that Inventor uses it?? it's literally used in Inventor for arguments and return values β no cap. it's the it-girl of parameter passing, periodt π
π§ METHODS π§
π Constructors π
SbVec4f()β the default constructor. she's empty, she's fresh, she's ready to be filled in π«ΆSbVec4f(const float v[4])SbVec4f(float x, float y, float z, float w)
constructor given vector components β¨ you hand over the numbers, she becomes the vector, iconic.
π¦ dot & equals π¦
float dot(const SbVec4f &v) constβ returns the dot (inner) product of the vector and another vector. two vectors, one number, slay.SbBool equals(const SbVec4f v, float tolerance) constβ equality comparison within a given tolerance. and lowkey the important detail: the tolerance is the square of the length of the maximum distance between the two vectors. so like, it's not the distance, it's the squared distance. don't come for me, that's just what it is π
π getReal & getValue π
void getReal(SbVec3f &v) constβ returns the real portion of the vector by dividing by the fourth value. yeah, dividing byw, that's the move πconst float *getValue() constvoid getValue(float &x, float &y, float &z, float &w) const
returns vector components. either as a pointer, or handed out one by one into x, y, z, w. pick your vibe π
πΈ length, negate, normalize πΈ
float length() constβ returns the geometric length of the vector. the actual how-long-is-she number πvoid negate()β negates each component of the vector in place. she changes herself, no new object, no notes.normalize()β changes the vector to be unit length. glow-up to length one, fr fr β¨
π setValue π
SbVec4f &setValue(const float v[4])SbVec4f &setValue(float x, float y, float z, float w)
sets the vector components. feed her the numbers, she returns a reference so you can chain π
π operator [] π
float &operator [](int i)const float &operator [](int i)
accesses the indexed component of the vector. index in, component out, no drama π―
π Compound assignment operators π
SbVec4f &operator *=(float d)SbVec4f &operator /=(float d)
component-wise scalar multiplication and division operators. every component gets the same treatment, equal rights π
SbVec4f &operator +=(const SbVec4f &u)SbVec4f &operator -=(const SbVec4f &u)
component-wise vector addition and subtraction operators. vector meets vector, chaos ensues, in a math way π¦
π Unary operator π
SbVec4f operator -() constβ nondestructive unary negation β returns a new vector. the original stays untouched, she's protected, we love boundaries π
β Binary scalar operators β
SbVec4f operator *(const SbVec4f &v, float d)SbVec4f operator *(float d, const SbVec4f &v)SbVec4f operator /(const SbVec4f &v, float d)
component-wise binary scalar multiplication and division operators. note that * comes in both orders β v * d and d * v β because she's flexible like that π
π Binary vector operators π
SbVec4f operator +(const SbVec4f &v1, const SbVec4f &v2)SbVec4f operator -(const SbVec4f &v1, const SbVec4f &v2)
component-wise binary vector addition and subtraction operators. two vectors walk in, one brand new vector walks out β¨
π Equality operators π
int operator ==(const SbVec4f &v1, const SbVec4f &v2)int operator !=(const SbVec4f &v1, const SbVec4f &v2)
equality comparison operators. returns an int, not a bool, so clock that tea β
π₯ SEE ALSO π₯
SbVec2f, SbVec3f, SbVec2s, SbRotation β the whole friend group, go say hi π«Ά
okay that's the whole page bestie, you ate it up π
and for the record, this was SbVec4f(3IV), from the SbVec4f(3IV)() era β that's the source/version and date situation, cute lil timestamp, iconic, no further questions πβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms