SbVec4d(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

πŸ’– 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]
(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. πŸ’€


returns an SbVec4d instance which is the components of vector v multiplied with d.

returns an SbVec4d instance which is the components of vector v multiplied with d. (yes, same thing, just flipped. commutative babe. πŸ’…)

returns an SbVec4d instance which is the components of vector v divided on the scalar factor d.

returns an SbVec4d instance which is the sum of vectors v1 and v2.

returns an SbVec4d instance which is vector v2 subtracted from vector v1. order matters, don't @ me. 🫢

returns 1 if v1 and v2 are equal, 0 otherwise.

See also β€” equals().

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