SbVec4d(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– SbVec4d β€” the manual page, but make it make sense πŸ’–

Hi bestie!! You've landed on SbVec4d(3) from the Library Functions Manual, and honestly? She's iconic. Let's get into it. πŸ¦‹


✨ NAME ✨

SbVec4d β€” the class that is literally a 4 dimensional vector with double precision floating point coordinates. No cap, 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, okay? They're just living next door. 🏑
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 πŸ’…

So. The SbVec4d class is a 4 dimensional vector with double precision floating point coordinates. That's the headline, periodt.

Lowkey, this vector class isn't used by many other classes in Coin. What she does do is provide storage for a 3 dimensional homogeneous vector β€” the 4 components are usually referred to as <x, y, z, w> β€” as well as simple double precision floating point arithmetic operations. And when I say simple I mean it, she keeps it cute and unbothered. 🌈

🌟 See also

  • SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3f, SbVec3d, SbVec4f.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

SbVec4d::SbVec4d (void ) [inline]

The default constructor does nothing. Not a single thing. The vector coordinates will be uninitialized until a call the setValue(). So don't come for her if the values are giving chaos β€” she hasn't been told what she is yet. 😭

SbVec4d::SbVec4d (const double v[4]) [inline]

Constructs an SbVec4d instance with initial values from v. She's born knowing. πŸ‘‘

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>.

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::SbVec4i32 constructor ✨

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 reference to self. (Self-love, honestly. 🫢)

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.

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. (Yes, there are two getValues. She contains multitudes. πŸ’œ)

See also: setValue().

double & SbVec4d::operator[] (int i) [inline]

Index operator. Returns modifiable x, y, z or w component of vector. Go off, change things.

See also: getValue() and setValue().

const double & SbVec4d::operator[] (int i) const [inline]

Index operator. Returns x, y, z or w component of vector. Look-only, bestie, no touching.

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.

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 don't expect her to do that little conversion, okay? That's just not the assignment. πŸ’€

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.

void SbVec4d::negate (void ) [inline]

Negate the vector. Flip the whole mood. ✨

double SbVec4d::normalize (void )

Normalize the vector to unit length. Return value is the original length of the vector before normalization.

SbVec4d & SbVec4d::operator*= (double d) [inline]

Multiply components of vector with value d. Returns reference to self.

SbVec4d & SbVec4d::operator+= (const SbVec4d & v) [inline]

SbVec4d & SbVec4d::operator /= (double d)

Okay so these two got squished together in the source, no biggie, we're separating them so it actually reads:
  • SbVec4d & SbVec4d::operator /= (double d) β€” Divides components of vector with value d. Returns reference to self.
  • SbVec4d & SbVec4d::operator+= (const SbVec4d & v) β€” 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. She changes her whole life but doesn't touch yours, we love a boundary. 🫢

See also: negate().

void SbVec4d::print (FILE * fp) const

Dump the state of this object to the file stream. ⚠️ Only works in debug version of library β€” in an optimized compile, method does nothing. So if you're yelling "where's my output" in release mode… that's why, babe.


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, other order. She's flexible. πŸ’…)

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.

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. (Not me, bestie, I just did the glow-up. πŸ’–)


And that's the whole page!! 🌸 This one came from Coin, Version 3.1.3, and she is filed under SbVec4d(3). Thank you for coming to my ted talk, drink some water, and remember: uninitialized coordinates are a choice and only you can call setValue(). βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from