SbVec4f(3)
π SbVec4f(3) β Library Functions Manual π
okay bestie, buckle up, we're doing a whole math class today but make it cute. this is SbVec4f, from the <Inventor/SbLinear.h> cinematic universe, and she is that girl. β¨
πΈ NAME πΈ
SbVec4f β the class that is a 4 dimensional vector with floating point coordinates. four numbers, one icon. no cap. π
π¦ SYNOPSIS π¦
#include <Inventor/SbLinear.h>
Inherited by SbColor4f. (yeah, she has a daughter. main character lineage fr.)
β¨ 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) constvoid getValue (float &x, float &y, float &z, float &w) constfloat & operator[] (int i)const float & operator[] (int i) constSbBool equals (const SbVec4f &v, float tolerance) constfloat dot (const SbVec4f &v) constvoid getReal (SbVec3f &v) constfloat length (void) constfloat sqrLength (void) constvoid 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) constvoid print (FILE *fp) const
π Protected Attributes π
float vec [4]
π«Ά Related Symbols π«Ά
(just so we're clear, these are not member symbols, they're the free-agent besties that hang around outside the class)
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. yes, literally, that's the whole personality and she wears it well. π
This vector class is used by so many other classes in Coin. she's everywhere, iykyk. What she actually does 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 floating point arithmetic operations. math but make it fashion. β¨
See also: SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3f, SbVec3d, SbVec4d.
π§ Constructor & Destructor Documentation π§
SbVec4f::SbVec4f (void ) [inline]
The default constructor does nothing. like, genuinely nothing. The vector coordinates will be uninitialized until a call the setValue(). so don't come crying to me when you read garbage floats out of her, bestie, that's on you. π
SbVec4f::SbVec4f (const float v[4]) [inline]
Constructs an SbVec4f instance with initial values from v.
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>.
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. (she gives herself back to you, generous queen. π«Ά)
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.
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 off, change her. π₯
See also: getValue() and setValue().
const float & SbVec4f::operator[] (int i) const [inline]
Index operator. Returns x, y, z or w component of vector. (read-only era, she's not letting you touch anything.)
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.
heads up bestie, this is important: the comparison is done in 4D-space, i.e. thewcomponent of the vector is not used to makex,yandzinto Cartesian coordinates first. so no sneaky 3D shortcuts here. π
float SbVec4f::dot (const SbVec4f & v) const [inline]
Calculates and returns the result of taking the dot product of this vector and v.
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. math girlies, this is the glow-down to 3D. β¨
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. (same energy, no square root tax. π)
void SbVec4f::negate (void ) [inline]
Negate the vector. flip the whole vibe. π
float SbVec4f::normalize (void )
Normalize the vector to unit length. Return value is the original length of the vector before normalization. she tells you what she used to be, iconic behavior honestly.
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. (unlike negate(), she doesn't change herself for you. growth. π)
See also: negate().
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 in release mode she's just standing there, silent, mysterious. πΈ
β 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 she does it in both orders. flexible queen. π)
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. order matters bestie, don't play yourself. π
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. (not a human, not a girlboss, just a doc generator doing its thing. we respect the hustle. π€)
okay that's the whole page, and that's on Coin, Version 3.1.3 β she was documented with love, by a robot, for you. now go normalize something. π¦πβ¨
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms