4D vector class. More...
#include <Inventor/SbVec.h>
Public Member Functions | |
SbVec4f () | |
SbVec4f (const float v[4]) | |
SbVec4f (float x, float y, float z, float w) | |
float | dot (const SbVec4f &v) const |
void | getReal (SbVec3f &v) const |
const float * | getValue () const |
void | getValue (float &x, float &y, float &z, float &w) const |
float | length () const |
float | lengthSquared () const |
void | negate () |
float | normalize () |
SbVec4f & | setValue (const float v[4]) |
SbVec4f & | setValue (float x, float y, float z, float w) |
SbVec4f & | setValue (const SbVec4d &vec4d) |
SbVec4f & | operator*= (float d) |
SbVec4f & | operator/= (float d) |
SbVec4f & | operator+= (const SbVec4f &u) |
SbVec4f & | operator-= (const SbVec4f &u) |
SbVec4f | operator- () const |
SbBool | equals (const SbVec4f &v, float tolerance) const |
template<typename T > | |
SbVec4f (const T &v) | |
Friends | |
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) |
std::ostream & | operator<< (std::ostream &os, const SbVec4f &v) |
| |
float & | operator[] (int i) |
const float & | operator[] (int i) const |
4D vector class.
4D vector class used to store homogeneous coordinates. This class is used in Open Inventor for arguments and return values.
SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us
SbVec4f::SbVec4f | ( | ) | [inline] |
Default constructor.
The vector is initialized with zeros.
SbVec4f::SbVec4f | ( | const float | v[4] | ) | [inline, explicit] |
Constructor given vector components.
SbVec4f::SbVec4f | ( | float | x, | |
float | y, | |||
float | z, | |||
float | w | |||
) | [inline] |
Constructor given vector components.
SbVec4f::SbVec4f | ( | const T & | v | ) | [inline, explicit] |
Constructor that converts an arbitrary SbVec4 to an SbVec4f.
float SbVec4f::dot | ( | const SbVec4f & | v | ) | const [inline] |
Returns dot (inner) product of vector and another vector.
Equality comparison within given tolerance - the square of the length of the maximum distance between the two vectors.
void SbVec4f::getReal | ( | SbVec3f & | v | ) | const |
Returns the real portion of the vector by dividing by the fourth value.
void SbVec4f::getValue | ( | float & | x, | |
float & | y, | |||
float & | z, | |||
float & | w | |||
) | const |
Returns vector components.
const float* SbVec4f::getValue | ( | ) | const [inline] |
Returns vector components.
float SbVec4f::length | ( | ) | const |
Returns geometric length of vector.
float SbVec4f::lengthSquared | ( | ) | const [inline] |
Returns square length of vector.
Faster than length().
void SbVec4f::negate | ( | ) |
Negates each component of vector in place.
float SbVec4f::normalize | ( | ) |
Changes vector to be unit length.
SbVec4f& SbVec4f::operator*= | ( | float | d | ) |
Component-wise scalar multiplication operator.
SbVec4f SbVec4f::operator- | ( | ) | const |
Nondestructive unary negation - returns a new vector.
SbVec4f& SbVec4f::operator/= | ( | float | d | ) |
Component-wise scalar division operator.
const float& SbVec4f::operator[] | ( | int | i | ) | const [inline] |
Accesses indexed component of vector.
float& SbVec4f::operator[] | ( | int | i | ) | [inline] |
Accesses indexed component of vector.
Sets value of vector from a double precision vector.
SbVec4f& SbVec4f::setValue | ( | float | x, | |
float | y, | |||
float | z, | |||
float | w | |||
) |
Sets the vector components.
SbVec4f& SbVec4f::setValue | ( | const float | v[4] | ) |
Sets the vector components.
Component-wise binary scalar multiplication operator.
Component-wise binary scalar multiplication operator.
Component-wise binary vector addition operator.
Component-wise binary vector subtraction operator.
Component-wise binary scalar division operator.
std::ostream& operator<< | ( | std::ostream & | os, | |
const SbVec4f & | v | |||
) | [friend] |
Writes the vector to the specified output stream.