SbVec4d(3)
π SbVec4d β the Coin manual, but make it make sense π
okay bestie, so this is SbVec4d(3) from the Coin manual set, and I'm gonna walk you through it like we're texting at 1am. no gatekeeping, no cap. β¨
πΈ NAME πΈ
SbVec4d β the class that is literally a 4 dimensional vector with double precision floating point coordinates. that's it, that's the whole vibe. π¦
β¨ SYNOPSIS β¨
#include <Inventor/SbVec4d.h>
π Public Member Functions π
SbVec4d (void)
SbVec4d (const double v[4])
SbVec4d (double x, double y, double z, double w)
SbVec4d (const SbVec4f &v)
SbVec4d (const SbVec4b &v)
SbVec4d (const SbVec4s &v)
SbVec4d (const SbVec4i32 &v)
SbVec4d & setValue (const double v[4])
SbVec4d & setValue (double x, double y, double z, double w)
SbVec4d & setValue (const SbVec4f &v)
SbVec4d & setValue (const SbVec4b &v)
SbVec4d & setValue (const SbVec4s &v)
SbVec4d & setValue (const SbVec4i32 &v)
const double * getValue (void) const
void getValue (double &x, double &y, double &z, double &w) const
double & operator[] (int i)
const double & operator[] (int i) const
double dot (const SbVec4d &v) const
SbBool equals (const SbVec4d &v, double tolerance) const
void getReal (SbVec3d &v) const
double length (void) const
double sqrLength (void) const
void negate (void)
double normalize (void)
SbVec4d & operator*= (double d)
SbVec4d & operator/= (double d)
SbVec4d & operator+= (const SbVec4d &v)
SbVec4d & operator-= (const SbVec4d &v)
SbVec4d operator- (void) const
void print (FILE *fp) const
π Protected Attributes π
double vec [4]
π Related Symbols π
(heads up bestie β these are not member symbols, they just live nearby π )
SbVec4d operator* (const SbVec4d &v, double d)
SbVec4d operator* (double d, const SbVec4d &v)
SbVec4d operator/ (const SbVec4d &v, double d)
SbVec4d operator+ (const SbVec4d &v1, const SbVec4d &v2)
SbVec4d operator- (const SbVec4d &v1, const SbVec4d &v2)
int operator== (const SbVec4d &v1, const SbVec4d &v2)
int operator!= (const SbVec4d &v1, const SbVec4d &v2)
π Detailed Description π
The SbVec4d class is a 4 dimensional vector with double precision floating point coordinates. iconic, honestly.
okay so real talk: this vector class is not used by many other classes in Coin. it's giving "niche queen" energy. what it does give you is storage for a 3 dimensional homogeneous vector β the 4 components usually referred to as <x, y, z, w> β plus simple double precision floating point arithmetic operations. periodt. π
See also π«Ά
SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3f, SbVec3d, SbVec4f.
π§ Constructor & Destructor Documentation π§
SbVec4d::SbVec4d (void ) [inline]
the default constructor does nothing. literally nothing. the vector coordinates are uninitialized until you call setValue(). so bestie, please don't read them before you set them, i'm begging π
SbVec4d::SbVec4d (const double v[4]) [inline]
constructs an SbVec4d instance with initial values from v. slay.
SbVec4d::SbVec4d (double x, double y, double z, double w) [inline]
constructs an SbVec4d instance with the initial homogeneous vector set to <x,y,z,w>. chef's kiss. β¨
SbVec4d::SbVec4d (const SbVec4f & v) [inline], [explicit]
constructs an SbVec4d instance from an SbVec4f instance.
SbVec4d::SbVec4d (const SbVec4b & v) [inline], [explicit]
constructs an SbVec4d instance from an SbVec4b instance.
Since β Coin 2.5 π
SbVec4d::SbVec4d (const SbVec4s & v) [inline], [explicit]
constructs an SbVec4d instance from an SbVec4s instance.
Since β Coin 2.5 π
SbVec4d::SbVec4d (const SbVec4i32 & v) [inline], [explicit]
constructs an SbVec4d instance from an SbVec4i32 instance.
Since β Coin 2.5 π
π Member Function Documentation π
SbVec4d & SbVec4d::setValue (const double v[4]) [inline]
set new coordinates for the vector from v. returns a reference to self. yes queen, chaining. π₯
See also β getValue().
SbVec4d & SbVec4d::setValue (double x, double y, double z, double w) [inline]
set new coordinates for the vector. returns reference to self.
See also β getValue().
SbVec4d & SbVec4d::setValue (const SbVec4f & v)
Since β Coin 2.5 π
SbVec4d & SbVec4d::setValue (const SbVec4b & v)
Since β Coin 2.5 π
SbVec4d & SbVec4d::setValue (const SbVec4s & v)
Since β Coin 2.5 π
SbVec4d & SbVec4d::setValue (const SbVec4i32 & v)
Since β Coin 2.5 π
const double * SbVec4d::getValue (void ) const [inline]
returns a pointer to an array of four doubles containing the x, y, z and w coordinates of the vector. mind the pointer, bestie, it's not a copy. π
See also β setValue().
void SbVec4d::getValue (double & x, double & y, double & z, double & w) const [inline]
returns the x, y, z and w coordinates of the vector.
See also β setValue().
double & SbVec4d::operator[] (int i) [inline]
index operator. returns a modifiable x, y, z or w component of the vector. go off, change it. π
See also β getValue() and setValue().
const double & SbVec4d::operator[] (int i) const [inline]
index operator. returns x, y, z or w component of the vector. (read-only era.)
See also β getValue() and setValue().
double SbVec4d::dot (const SbVec4d & v) const [inline]
calculates and returns the result of taking the dot product of this vector and v.
SbBool SbVec4d::equals (const SbVec4d & v, double 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. (yes, the square root. not tolerance itself. i said what i said.)
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. important detail, don't skip it. β
void SbVec4d::getReal (SbVec3d & 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. π¦
double SbVec4d::length (void ) const
return the length of the vector in 4D space.
double SbVec4d::sqrLength (void ) const [inline]
return the square of the length of the vector in 4D space. faster, same energy. β¨
void SbVec4d::negate (void ) [inline]
negate the vector. flip it, reverse it. π
double SbVec4d::normalize (void )
normalize the vector to unit length. the return value is the original length of the vector before normalization β so you don't lose that info, cute right?
SbVec4d & SbVec4d::operator*= (double d) [inline]
multiply components of vector with value d. returns reference to self.
SbVec4d & SbVec4d::operator/= (double d) [inline]
divides components of vector with value d. returns reference to self.
SbVec4d & SbVec4d::operator+= (const SbVec4d & v) [inline]
adds this vector and vector v. returns reference to self.
SbVec4d & SbVec4d::operator-= (const SbVec4d & v) [inline]
subtracts vector v from this vector. returns reference to self.
SbVec4d SbVec4d::operator- (void ) const [inline]
non-destructive negation operator. returns a new SbVec4d instance which has all components negated. your original stays untouched, main character behavior. π
See also β negate().
void SbVec4d::print (FILE * fp) const
dump the state of this object to the fp file stream. β οΈ only works in the debug version of the library β in an optimized build this method does nothing. don't be out here debugging with print statements in release, bestie, i've been there. π
π Friends And Related Symbol Documentation π
SbVec4d operator* (const SbVec4d & v, double d) [related]
returns an SbVec4d instance which is the components of vector v multiplied with d.
SbVec4d operator* (double d, const SbVec4d & v) [related]
returns an SbVec4d instance which is the components of vector v multiplied with d. (yes, same thing, just flipped. commutative babe. π
)
SbVec4d operator/ (const SbVec4d & v, double d) [related]
returns an SbVec4d instance which is the components of vector v divided on the scalar factor d.
SbVec4d operator+ (const SbVec4d & v1, const SbVec4d & v2) [related]
returns an SbVec4d instance which is the sum of vectors v1 and v2.
SbVec4d operator- (const SbVec4d & v1, const SbVec4d & v2) [related]
returns an SbVec4d instance which is vector v2 subtracted from vector v1. order matters, don't @ me. π«Ά
int operator== (const SbVec4d & v1, const SbVec4d & v2) [related]
returns 1 if v1 and v2 are equal, 0 otherwise.
See also β equals().
int operator!= (const SbVec4d & v1, const SbVec4d & 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. (the robot wrote it, i just gave it a glow-up β¨)
and that's the whole page bestie, you ate that. this was SbVec4d(3), Version 4.0.10, dated Thu Jun 25 2026 00:00:00. mwah, go build something iconic. π
ππ¦
π¦ 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