SbVec3f(3)
πΈ NAME πΈ
okay so, this is the manual page for SbVec3f from Coin β and SbVec3f is literally the 3 dimensional vector class with floating point coordinates. that's it, that's the whole personality, and honestly? iconic. π
π¦ SYNOPSIS π¦
#include <Inventor/SbVec3f.h>
Inherited by SbColor.
β¨ Public Member Functions β¨
SbVec3f (void)
SbVec3f (const float v[3])
SbVec3f (float x, float y, float z)
SbVec3f (const SbVec3d &v)
SbVec3f (const SbVec3b &v)
SbVec3f (const SbVec3s &v)
SbVec3f (const SbVec3i32 &v)
SbVec3f (const SbPlane &p0, const SbPlane &p1, const SbPlane &p2)
SbVec3f & setValue (const float v[3])
SbVec3f & setValue (float x, float y, float z)
SbVec3f & setValue (const SbVec3f &barycentric, const SbVec3f &v0, const
SbVec3f &v1, const SbVec3f &v2)
SbVec3f & setValue (const SbVec3d &v)
SbVec3f & setValue (const SbVec3b &v)
SbVec3f & setValue (const SbVec3s &v)
SbVec3f & setValue (const SbVec3i32 &v)
const float * getValue (void) const
void getValue (float &x, float &y, float &z) const
float & operator[] (int i)
const float & operator[] (int i) const
SbBool equals (const SbVec3f &v, float tolerance) const
SbVec3f cross (const SbVec3f &v) const
float dot (const SbVec3f &v) const
SbVec3f getClosestAxis (void) const
float length (void) const
float sqrLength (void) const
float normalize (void)
void negate (void)
SbVec3f & operator*= (float d)
SbVec3f & operator/= (float d)
SbVec3f & operator+= (const SbVec3f &v)
SbVec3f & operator-= (const SbVec3f &v)
SbVec3f operator- (void) const
SbString toString () const
SbBool fromString (const SbString &str)
void print (FILE *fp) const
π Protected Attributes π
float vec [3]
π«Ά Related Symbols π«Ά
(Note that these are not member symbols.)
SbVec3f operator* (const SbVec3f &v, float d)
SbVec3f operator* (float d, const SbVec3f &v)
SbVec3f operator/ (const SbVec3f &v, float d)
SbVec3f operator+ (const SbVec3f &v1, const SbVec3f &v2)
SbVec3f operator- (const SbVec3f &v1, const SbVec3f &v2)
int operator== (const SbVec3f &v1, const SbVec3f &v2)
int operator!= (const SbVec3f &v1, const SbVec3f &v2)
π Detailed Description π
so. SbVec3f is a 3 dimensional vector with floating point coordinates. periodt.
this vector class gets used by like, so many other classes in Coin. it's basically the main character of the math dept. π it stores a 3 dimensional vector for you, and it also handles the simple floating point arithmetic operations, no big deal.
See also β SbVec2s, SbVec2f, SbVec2d, SbVec3s, SbVec3d, SbVec4f, SbVec4d.
π§ Constructor & Destructor Documentation π§
SbVec3f::SbVec3f (void ) [inline]
the default constructor does nothing. not a single thing. the vector coordinates stay uninitialized until you do a setValue() call. so like, please call setValue(). don't be out here reading uninitialized coords, that's giving chaos. π
SbVec3f::SbVec3f (const float v[3]) [inline]
makes you an SbVec3f instance, initial values straight outta v. slay.
SbVec3f::SbVec3f (float x, float y, float z) [inline]
makes you an SbVec3f instance with the initial vector endpoint set to <x,y,z>. π¦
SbVec3f::SbVec3f (const SbVec3d & v) [inline], [explicit]
makes you an SbVec3f instance, and you're building it from an SbVec3d instance. glow-up from double to single precision fr fr.
SbVec3f::SbVec3f (const SbVec3b & v) [inline], [explicit]
makes you an SbVec3f instance out of an SbVec3b instance.
- Since β Coin 2.5
SbVec3f::SbVec3f (const SbVec3s & v) [inline], [explicit]
makes you an SbVec3f instance out of an SbVec3s instance.
- Since β Coin 2.5
SbVec3f::SbVec3f (const SbVec3i32 & v) [inline], [explicit]
makes you an SbVec3f instance out of an SbVec3i32 instance.
- Since β Coin 2.5
SbVec3f::SbVec3f (const SbPlane & p0, const SbPlane & p1, const SbPlane & p2)
makes you an SbVec3f instance by combining the three planes you handed over. π
bestie. listen. none of the planes should be parallel to any of the other two β otherwise a divide by zero error will occur. that's not a vibe, that's a crash.
π Member Function Documentation π
SbVec3f & SbVec3f::setValue (const float v[3]) [inline]
sets brand new coordinates for the vector, taken from v. returns a reference to itself, because it's self-obsessed (affectionate). π
See also β getValue().
SbVec3f & SbVec3f::setValue (float x, float y, float z) [inline]
sets brand new coordinates for the vector. returns a reference to itself.
See also β getValue().
SbVec3f & SbVec3f::setValue (const SbVec3f & barycentric, const SbVec3f & v0, const SbVec3f & v1, const SbVec3f & v2)
sets this vector to be the average of v0, v1 and v2. the vector components get weighted by the barycentric vector. math girlies rise π
See also β getValue().
SbVec3f & SbVec3f::setValue (const SbVec3d & v)
sets this vector to the double precision vector v, converting the vector to a single precision vector.
this is a Coin extension.
- Since β Coin 2.0
SbVec3f & SbVec3f::setValue (const SbVec3b & v)
- Since β Coin 2.5
See also β getValue()
SbVec3f & SbVec3f::setValue (const SbVec3s & v)
- Since β Coin 2.5
See also β getValue()
SbVec3f & SbVec3f::setValue (const SbVec3i32 & v)
- Since β Coin 2.5
See also β getValue()
const float * SbVec3f::getValue (void ) const [inline]
hands you back a pointer to an array of three floats holding the x, y and z coordinates of the vector. three floats. that's the whole squad. πΈ
See also β setValue().
void SbVec3f::getValue (float & x, float & y, float & z) const [inline]
hands you back the x, y and z coordinates of the vector.
See also β setValue().
float & SbVec3f::operator[] (int i) [inline]
the index operator. returns a modifiable x, y or z coordinate of the vector. go off, change it, live your truth. π₯
See also β getValue() and setValue().
const float & SbVec3f::operator[] (int i) const [inline]
the index operator. returns the x, y or z coordinate of the vector.
See also β getValue() and setValue().
SbBool SbVec3f::equals (const SbVec3f & 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. (yes, the square root. not the tolerance itself. read it again. π)
SbVec3f SbVec3f::cross (const SbVec3f & v) const
returns the result of taking the cross product of this vector and v.
float SbVec3f::dot (const SbVec3f & v) const [inline]
calculates and returns the result of taking the dot product of this vector and v.
SbVec3f SbVec3f::getClosestAxis (void ) const
returns the vector representing the principal axis closest to this vector.
float SbVec3f::length (void ) const
returns the length of the vector. that's it. that's the function. π
float SbVec3f::sqrLength (void ) const [inline]
returns the squared length of the vector. no square root, she's low effort and thriving.
float SbVec3f::normalize (void )
normalizes the vector to unit length. the return value is the original length of the vector before normalization.
if the vector is the null vector, no attempt at normalization will be done. and if the Coin library was built in a debug version, and the COIN_DEBUG_NORMALIZE environment variable is set, this error message will then be shown:
Coin warning in SbVec3f::normalize(): The length of the vector
should be > 0.0f to be able to normalize.
we've made it possible for Coin to spit out a warning when an attempt at normalizing a null-vector is made, because that seems to sometimes be a symptom caused by some graver error somewhere else β could be an internal error in Coin code, a programming error in application code, or an error in an input file (like for instance invalid polygon specifications). π΅βπ«
if you run into bugs/problems with your application or with Coin, it could be a good idea to set COIN_DEBUG_NORMALIZE=1, and then restart the application to see if you get any warnings from normalize().
if this happens, you should run the application in a debugger and see how the call-stack backtrace looks when it hits. an easy way of getting a debugger break at the warning spot is to set the following debugging environment variable, which will make the code assert:
COIN_DEBUG_BREAK="SbVec3f::normalize"
if you from the backtrace analysis strongly suspects an internal Coin bug, please report the call-stack to us at coin-support@coin3d.org and we'll look into it. example code that triggers the bug would then also be very helpful. π«Ά
a note for developers porting code from SGI or TGS Inventor to Coin: those Inventor implementations are more slack about detecting and giving out warning messages upon API misuses, and you may suddenly have gotten this warning with Coin without seeing any indication of an error with SGI/TGS Inventor. this does not necessarily mean that it is a bug in Coin β it is much more likely that you are getting a warning as an indication of API misuse or import file errors which were just not detected and/or reported with those Inventor implementations. β¨
void SbVec3f::negate (void ) [inline]
negate the vector β i.e. point it in the opposite direction. she's doing a 180 and honestly? good for her. π
SbVec3f & SbVec3f::operator*= (float d) [inline]
multiplies components of the vector with the scalar value d. returns a reference to itself.
SbVec3f & SbVec3f::operator/= (float d) [inline]
divides components of the vector with the scalar value d. returns a reference to itself.
SbVec3f & SbVec3f::operator+= (const SbVec3f & u) [inline]
adds this vector and vector u. returns a reference to itself.
SbVec3f & SbVec3f::operator-= (const SbVec3f & u) [inline]
subtracts vector u from this vector. returns a reference to itself.
SbVec3f SbVec3f::operator- (void ) const [inline]
non-destructive negation operator. returns a new SbVec3f instance which points in the opposite direction of this vector.
See also β negate().
SbString SbVec3f::toString () const
returns a string representation of this object.
SbBool SbVec3f::fromString (const SbString & str)
converts from a string representation, and returns whether this is a valid conversion.
void SbVec3f::print (FILE * fp) const
dumps the state of this object to the fp file stream. only works in the debug version of the library β the method does nothing in an optimized build. π
π Friends And Related Symbol Documentation π
SbVec3f operator* (const SbVec3f & v, float d) [related]
returns an SbVec3f instance which is the components of vector v multiplied with d.
SbVec3f operator* (float d, const SbVec3f & v) [related]
returns an SbVec3f instance which is the components of vector v multiplied with d.
SbVec3f operator/ (const SbVec3f & v, float d) [related]
returns an SbVec3f instance which is the components of vector v divided on the scalar factor d.
SbVec3f operator+ (const SbVec3f & v1, const SbVec3f & v2) [related]
returns an SbVec3f instance which is the sum of vectors v1 and v2.
SbVec3f operator- (const SbVec3f & v1, const SbVec3f & v2) [related]
returns an SbVec3f instance which is vector v2 subtracted from vector v1.
int operator== (const SbVec3f & v1, const SbVec3f & v2) [related]
returns 1 if v1 and v2 are exactly equal, 0 otherwise. exact. no tolerance, no wiggle room, no "close enough". π
See also β equals().
int operator!= (const SbVec3f & v1, const SbVec3f & v2) [related]
returns 1 if v1 and v2 are not equal, 0 if they are equal.
See also β equals().
π Member Data Documentation π
float SbVec3f::vec[3] [protected]
the container for all values of this class. that's where the x, y and z live. their little home. π
part 2 is right behind this, bestie β don't wander off π
β¨ AUTHOR β¨
Generated automatically by Doxygen for Coin from the source code.
That's it, that's the whole author section bestie π nobody hand-wrote this one, Doxygen did the honors β it read the Coin source code and spat this whole page out, no cap.
So likeβ¦ that's the page? That's the page. π You made it all the way to the bottom, which is genuinely iconic of you. Slay. π¦
This was SbVec3f(3) β Version 4.0.10, dated Thu Jun 25 2026 00:00:00 β brought to you by Coin and auto-built by Doxygen. π«Ά
Go forth and vector, bestie. Three floats, infinite main character energy. πβ¨
π¦ 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