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) constreturns the right-handed cross product of vector and another vector. perpendicular queen πfloat dot(const SbVec3f &v) constreturns the dot (inner) product of vector and another vector. just multiply-y vibes fr frSbBool equals(const SbVec3f v, float tolerance) constequality 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() constreturns the principal axis that is closest (based on maximum dot product) to this vector. it's picking its favorite direction πconst float * getValue() constvoid getValue(float &x, float &y, float &z) constreturns vector components. either as a pointer or by filling inx,yandzβ choose your fighter π«Άfloat length() constreturns 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 -() constnondestructive 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 β¨π
π«Ά
π¦ 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