SbVec4f(3)
πΈ NAME πΈ
SbVec4f β bestie, this is the SbVec4f class, aka a 4 dimensional vector with floating point coordinates. that's it, that's the vibe π
(this page lives in the Coin manual, in case you were wondering where you wandered into π¦)
β¨ SYNOPSIS β¨
#include <Inventor/SbVec4f.h>
Inherited by SbColor4f.
π Public Member Functions
SbVec4f (void)
SbVec4f (const float v[4])
SbVec4f (float x, float y, float z, float w)
SbVec4f (const SbVec4d &v)
SbVec4f (const SbVec4b &v)
SbVec4f (const SbVec4s &v)
SbVec4f (const SbVec4i32 &v)
SbVec4f & setValue (const float v[4])
SbVec4f & setValue (float x, float y, float z, float w)
SbVec4f & setValue (const SbVec4d &v)
SbVec4f & setValue (const SbVec4b &v)
SbVec4f & setValue (const SbVec4s &v)
SbVec4f & setValue (const SbVec4i32 &v)
const float * getValue (void) const
void getValue (float &x, float &y, float &z, float &w) const
float & operator[] (int i)
const float & operator[] (int i) const
SbBool equals (const SbVec4f &v, float tolerance) const
float dot (const SbVec4f &v) const
void getReal (SbVec3f &v) const
float length (void) const
float sqrLength (void) const
void negate (void)
float normalize (void)
SbVec4f & operator*= (float d)
SbVec4f & operator/= (float d)
SbVec4f & operator+= (const SbVec4f &v)
SbVec4f & operator-= (const SbVec4f &v)
SbVec4f operator- (void) const
void print (FILE *fp) const
π Protected Attributes
float vec [4]
π« Related Symbols
(Note that these are not member symbols.)
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)
π Detailed Description π
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Okay so real talk: this vector class is used by many other classes in Coin. it's literally out here providing storage for a 3 dimensional homogeneous vector (with the 4 components usually referred to as <x, y, z, w>) plus the simple floating point arithmetic operations. it's giving foundational, it's giving main character π«Ά
See also
SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3f, SbVec3d, SbVec4d. the whole fam is here π§
π Constructor & Destructor Documentation π
SbVec4f::SbVec4f (void ) [inline]
The default constructor does nothing. no cap. the vector coordinates will be uninitialized until a call the setValue(). so like... pls call setValue() bestie, i'm begging π
SbVec4f::SbVec4f (const float v[4]) [inline]
Constructs an SbVec4f instance with initial values from v. cute, it comes preloaded β¨
SbVec4f::SbVec4f (float x, float y, float z, float w) [inline]
Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>. yes queen, give us all four π
SbVec4f::SbVec4f (const SbVec4d & v) [inline], [explicit]
Constructs an SbVec4f instance from an SbVec4d instance.
SbVec4f::SbVec4f (const SbVec4b & v) [inline], [explicit]
Constructs an SbVec4f instance from an SbVec4b instance.
Since
Coin 2.5 β
SbVec4f::SbVec4f (const SbVec4s & v) [inline], [explicit]
Constructs an SbVec4f instance from an SbVec4s instance.
Since
Coin 2.5 β
SbVec4f::SbVec4f (const SbVec4i32 & v) [inline], [explicit]
Constructs an SbVec4f instance from an SbVec4i32 instance.
Since
Coin 2.5 β
π₯ Member Function Documentation π₯
SbVec4f & SbVec4f::setValue (const float v[4]) [inline]
Set new coordinates for the vector from v. Returns reference to self. so you can chain it, iykyk π
See also
getValue().
SbVec4f & SbVec4f::setValue (float x, float y, float z, float w) [inline]
Set new coordinates for the vector. Returns reference to self.
See also
getValue().
SbVec4f & SbVec4f::setValue (const SbVec4d & v)
Sets the value from an SbVec4d instance.
SbVec4f & SbVec4f::setValue (const SbVec4b & v)
Since
Coin 2.5 β
SbVec4f & SbVec4f::setValue (const SbVec4s & v)
Since
Coin 2.5 β
SbVec4f & SbVec4f::setValue (const SbVec4i32 & v)
Since
Coin 2.5 β
const float * SbVec4f::getValue (void ) const [inline]
Returns a pointer to an array of four floats containing the x, y, z and w coordinates of the vector. four floats, one lil pointer, slay π
See also
setValue().
void SbVec4f::getValue (float & x, float & y, float & z, float & w) const [inline]
Returns the x, y, z and w coordinates of the vector.
See also
setValue().
float & SbVec4f::operator[] (int i) [inline]
Index operator. Returns modifiable x, y, z or w component of vector. go ahead, poke at it π
See also
getValue() and setValue().
const float & SbVec4f::operator[] (int i) const [inline]
Index operator. Returns x, y, z or w component of vector.
See also
getValue() and setValue().
SbBool SbVec4f::equals (const SbVec4f & v, float tolerance) const
Compares the vector with v and returns TRUE if the distance between the vectors is smaller or equal to the square root of tolerance.
The comparison is done in 4D-space, i.e. the w component of the vector is not used to make x, y and z into Cartesian coordinates first. so like, don't come for it expecting 3D behavior, it said what it said π’
float SbVec4f::dot (const SbVec4f & v) const [inline]
Calculates and returns the result of taking the dot product of this vector and v. math girlies rise π§
void SbVec4f::getReal (SbVec3f & v) const
Returns the vector as a Cartesian 3D vector in v. This means that the 3 first components x, y and z will be divided by the fourth, w. dividing by w, as one does π«
float SbVec4f::length (void ) const
Return the length of the vector in 4D space.
float SbVec4f::sqrLength (void ) const [inline]
Return the square of the length of the vector in 4D space. it's the length but squared, lowkey efficient of it β¨
void SbVec4f::negate (void) [inline]
Negate the vector. flip the whole vibe, periodt π
float SbVec4f::normalize (void )
Normalize the vector to unit length. Return value is the original length of the vector before normalization. so you get the receipts of how long it used to be π
SbVec4f & SbVec4f::operator*= (float d) [inline]
Multiply components of vector with value d. Returns reference to self.
SbVec4f & SbVec4f::operator/= (float d) [inline]
Divides components of vector with value d. Returns reference to self.
SbVec4f & SbVec4f::operator+= (const SbVec4f & v) [inline]
Adds this vector and vector v. Returns reference to self.
SbVec4f & SbVec4f::operator-= (const SbVec4f & v) [inline]
Subtracts vector v from this vector. Returns reference to self.
SbVec4f SbVec4f::operator- (void ) const [inline]
Non-destructive negation operator. Returns a new SbVec4f instance which has all components negated. it negates without wrecking the original, so thoughtful π₯Ή
See also
negate().
void SbVec4f::print (FILE * fp) const
Dump the state of this object to the fp file stream.
π¨ heads up bestie: this only works in the debug version of the library. method does nothing in an optimized build. so if you're sitting there like "why is my print not printing" β that's why, it's not you, it's the build π
π¦ Friends And Related Symbol Documentation π¦
SbVec4f operator* (const SbVec4f & v, float d) [related]
Returns an SbVec4f instance which is the components of vector v multiplied with d.
SbVec4f operator* (float d, const SbVec4f & v) [related]
Returns an SbVec4f instance which is the components of vector v multiplied with d. yes it's the same thing with the args flipped, they did that on purpose π
SbVec4f operator/ (const SbVec4f & v, float d) [related]
Returns an SbVec4f instance which is the components of vector v divided on the scalar factor d.
SbVec4f operator+ (const SbVec4f & v1, const SbVec4f & v2) [related]
Returns an SbVec4f instance which is the sum of vectors v1 and v2.
SbVec4f operator- (const SbVec4f & v1, const SbVec4f & v2) [related]
Returns an SbVec4f instance which is vector v2 subtracted from vector v1.
int operator== (const SbVec4f & v1, const SbVec4f & v2) [related]
Returns 1 if v1 and v2 are equal, 0 otherwise.
See also
equals().
int operator!= (const SbVec4f & v1, const SbVec4f & v2) [related]
Returns 1 if v1 and v2 are not equal, 0 if they are equal.
See also
equals().
π Author π
Generated automatically by Doxygen for Coin from the source code. (yes the robots wrote it, we're just here to make it cute π)
okay bestie that's the whole page, we made it π«Ά this was Version 4.0.10, dated Thu Jun 25 2026 00:00:00, and it's SbVec4f(3) out of the Coin manual β go forth and vector responsibly, mwah πβ¨
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms