SbVec4f(3)

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

πŸ’– SbVec4f β€” NAME ✨

okay so bestie, welcome to the Library Functions Manual 🌸 this one's about SbVec4f, and it's literally a 4 dimensional vector with floating point coordinates. that's the whole vibe. four floats. living their best life together. πŸ‘‘


πŸŽ€ SYNOPSIS πŸ’…

#include <Inventor/SbLinear.h>

πŸ¦‹ Public Member Functions

  • SbVec4f (void) β€” the no-argument constructor 🐣
  • SbVec4f (const float v[4]) β€” construct from an array of four floats
  • SbVec4f (const float x, const float y, const float z, const float w) β€” construct from x, y, z, w
  • SbVec4f (const SbVec4d &v) β€” construct from an SbVec4d
  • float dot (const SbVec4f &v) const β€” dot product time ✨
  • SbBool equals (const SbVec4f &v, const float tolerance) const β€” are these two basically the same?
  • void getReal (SbVec3f &v) const β€” hand back the Cartesian 3D version
  • const float * getValue (void) const β€” pointer to the four floats
  • void getValue (float &x, float &y, float &z, float &w) const β€” get the components out into your own variables
  • float length (void) const β€” length in 4D space
  • float sqrLength (void) const β€” that, but squared
  • void negate (void) β€” flip every component
  • float normalize (void) β€” make it unit length
  • SbVec4f & setValue (const float v[4]) β€” set from an array
  • SbVec4f & setValue (const float x, const float y, const float z, const float w) β€” set from four floats
  • SbVec4f & setValue (const SbVec4d &v) β€” set from an SbVec4d
  • float & operator[] (const int i) β€” index in, modifiable
  • const float & operator[] (const int i) const β€” index in, read-only
  • SbVec4f & operator*= (const float d) β€” multiply in place
  • SbVec4f & operator/= (const float d) β€” divide in place
  • SbVec4f & operator+= (const SbVec4f &u) β€” add in place
  • SbVec4f & operator-= (const SbVec4f &u) β€” subtract in place
  • SbVec4f operator- (void) const β€” negate without destroying the original
  • void print (FILE *fp) const β€” dump the state to a file stream

🫢 Friends

  • SbVec4f operator* (const SbVec4f &v, const float d)
  • SbVec4f operator* (const float d, const SbVec4f &v)
  • SbVec4f operator/ (const SbVec4f &v, const 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. iconic.

This vector class is used by many other classes in Coin. It provides storage for a 3 dimensional homogeneoues vector (with the 4 components usually referred to as <x, y, z, w>) aswell as simple floating point arithmetic operations. πŸ’œ

See also

SbVec2f, SbVec2d, SbVec3f, SbVec3d, SbVec4d


🌈 Constructor & Destructor Documentation 🌈

SbVec4f::SbVec4f (void )

The default constructor does nothing. The vector coordinates will be uninitialized until a call the setValue(). no cap, don't read from it before you fill it in bestie 😭

Referenced by dot(), equals(), operator!=, operator*, operator*, operator+, operator+=(), operator-, operator-(), operator-=(), operator/, and operator==.

SbVec4f::SbVec4f (const float v[4])

Constructs an SbVec4f instance with initial values from v. πŸ“

SbVec4f::SbVec4f (const float x, const float y, const float z, const float w)

Constructs an SbVec4f instance with the initial homogeneous vector set to <x,y,z,w>. four values, one slay πŸ’…

SbVec4f::SbVec4f (const SbVec4d & v) [inline], [explicit]

Constructs an SbVec4f instance with initial values from the vector v.

Since

Coin-2.5

References setValue().


πŸ’– Member Function Documentation πŸ’–

float SbVec4f::dot (const SbVec4f & v) const

Calculates and returns the result of taking the dot product of this vector and v.

References SbVec4f().

Referenced by SbRotation::slerp().

SbBool SbVec4f::equals (const SbVec4f & v, const 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. important detail, don't skip it 🫢

References SoDebugError::postWarning(), and SbVec4f().

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.

References SoDebugError::postWarning().

Referenced by SoIndexedNurbsSurface::computeBBox(), SoIndexedShape::computeBBox(), and SoNonIndexedShape::computeCoordBBox().

const float * SbVec4f::getValue (void ) const

Returns a pointer to an array of four floats containing the x, y, z and w coordinates of the vector.

See also

setValue().

Referenced by SoTextureCombine::doAction(), SoDirectionalLight::GLRender(), SoPointLight::GLRender(), SoSpotLight::GLRender(), SoVRMLDirectionalLight::GLRender(), SoVRMLPointLight::GLRender(), SoVRMLSpotLight::GLRender(), SoShape::invokeLineSegmentCallbacks(), SoShape::invokePointCallbacks(), and SoShape::invokeTriangleCallbacks().

void SbVec4f::getValue (float & x, float & y, float & z, float & w) const

Returns the x, y, z and w coordinates of the vector.

See also

setValue().

float SbVec4f::length (void ) const

Return the length of the vector in 4D space.

Referenced by normalize().

float SbVec4f::sqrLength (void ) const

Return the square of the length of the vector in 4D space.

Since

Coin-2.5

void SbVec4f::negate (void )

Negate the vector. flip it, reverse it, main character energy πŸ”₯

Referenced by SbRotation::slerp().

float SbVec4f::normalize (void )

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

References length(), operator/=(), and SoDebugError::postWarning().

SbVec4f & SbVec4f::setValue (const float v[4])

Set new coordinates for the vector from v. Returns reference to self.

See also

getValue().

Referenced by SoShape::generateVertex(), and SbVec4f().

SbVec4f & SbVec4f::setValue (const float x, const float y, const float z, const float w)

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. Returns reference to self.

Since

Coin-2.5

float & SbVec4f::operator[] (const int i)

Index operator. Returns modifiable x, y, z or w component of vector.

See also

getValue() and setValue().

References SoDebugError::postWarning().

const float & SbVec4f::operator[] (const int i) const

Index operator. Returns x, y, z or w component of vector.

See also

getValue() and setValue().

References SoDebugError::postWarning().

SbVec4f & SbVec4f::operator*= (const float d)

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

SbVec4f & SbVec4f::operator/= (const float d)

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

References SoDebugError::postWarning().

Referenced by normalize().

SbVec4f & SbVec4f::operator+= (const SbVec4f & u)

Adds this vector and vector u. Returns reference to self.

References SbVec4f().

SbVec4f & SbVec4f::operator-= (const SbVec4f & u)

Subtracts vector u from this vector. Returns reference to self.

References SbVec4f().

SbVec4f SbVec4f::operator- (void ) const

Non-destructive negation operator. Returns a new SbVec4f instance which has all components negated.

See also

negate().

References SbVec4f().

void SbVec4f::print (FILE * fp) const

Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile. so if you're in release and it's silent... that's why bestie πŸ™ˆ


SbVec4f operator* (const SbVec4f & v, const float d) [friend]

Returns an SbVec4f instance which is the components of vector v multiplied with d.

References SbVec4f().

SbVec4f operator* (const float d, const SbVec4f & v) [friend]

Returns an SbVec4f instance which is the components of vector v multiplied with d.

References SbVec4f().

SbVec4f operator/ (const SbVec4f & v, const float d) [friend]

Returns an SbVec4f instance which is the components of vector v divided on the scalar factor d.

References SoDebugError::postWarning(), and SbVec4f().

SbVec4f operator+ (const SbVec4f & v1, const SbVec4f & v2) [friend]

Returns an SbVec4f instance which is the sum of vectors v1 and v2.

References SbVec4f().

SbVec4f operator- (const SbVec4f & v1, const SbVec4f & v2) [friend]

Returns an SbVec4f instance which is vector v2 subtracted from vector v1.

References SbVec4f().

int operator== (const SbVec4f & v1, const SbVec4f & v2) [friend]

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

See also

equals().

References SbVec4f().

int operator!= (const SbVec4f & v1, const SbVec4f & v2) [friend]

Returns 1 if v1 and v2 are not equal, 0 if they are equal.

See also

equals().

References SbVec4f().


🧚 Author 🧚

Generated automatically by Doxygen for Coin from the source code. yes bestie the robots wrote the docs, we just gave them a glow up ✨


and that's a wrap on SbVec4f(3), mwah πŸ’‹ this page came from Coin, Version 2.5.0, so go forth and vector responsibly πŸŽ€

πŸ“¦ where this page comes from