3D vector class (double precision). More...
#include <Inventor/SbVec.h>
Public Member Functions | |
SbVec3d () | |
SbVec3d (const double v[3]) | |
SbVec3d (double x, double y, double z) | |
SbVec3d (SbPlane &p0, SbPlane &p1, SbPlane &p2) | |
SbVec3d | cross (const SbVec3d &v) const |
double | dot (const SbVec3d &v) const |
const double * | getValue () const |
void | getValue (double &x, double &y, double &z) const |
double | length () const |
double | lengthSquared () const |
double | normalize () |
void | negate () |
SbVec3d & | setValue (const double v[3]) |
SbVec3d & | setValue (double x, double y, double z) |
SbVec3d & | setValue (const SbVec3d &barycentic, const SbVec3d &v0, const SbVec3d &v1, const SbVec3d &v2) |
SbVec3d & | setValue (const SbVec3f &vec3f) |
SbVec3d & | operator*= (double d) |
SbVec3d & | operator/= (double d) |
SbVec3d & | operator+= (const SbVec3d &v) |
SbVec3d & | operator-= (const SbVec3d &v) |
SbVec3d | operator- () const |
SbVec3d | operator* (const SbVec3d &v) const |
SbVec3d & | operator*= (const SbVec3d &v) |
SbBool | equals (const SbVec3d &v, double tolerance) const |
SbVec3d | getClosestAxis () const |
template<typename T > | |
SbVec3d (const T &v) | |
Friends | |
SbVec3d | operator* (const SbVec3d &v, double d) |
SbVec3d | operator* (double d, const SbVec3d &v) |
SbVec3d | operator/ (const SbVec3d &v, double d) |
SbVec3d | operator+ (const SbVec3d &v1, const SbVec3d &v2) |
SbVec3d | operator- (const SbVec3d &v1, const SbVec3d &v2) |
int | operator== (const SbVec3d &v1, const SbVec3d &v2) |
int | operator!= (const SbVec3d &v1, const SbVec3d &v2) |
std::ostream & | operator<< (std::ostream &os, const SbVec3d &v) |
| |
double & | operator[] (int i) |
const double & | operator[] (int i) const |
3D vector class used to store 3D vectors and points. Although Open Inventor fields still store only single precision values, for certain applications it is useful and convenient to be able to store and manipulate double precision values, for example, double precision coordinate data or values that will be used for further computation.
SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us
SbVec3d::SbVec3d | ( | ) | [inline] |
Default constructor.
The vector is initialized with zeros.
SbVec3d::SbVec3d | ( | const double | v[3] | ) | [inline, explicit] |
Constructor given vector components.
SbVec3d::SbVec3d | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
Constructor given vector components.
SbVec3d::SbVec3d | ( | const T & | v | ) | [inline, explicit] |
Constructor that converts an arbitrary SbVec3 to an SbVec3d.
Returns right-handed cross product of vector and another vector.
double SbVec3d::dot | ( | const SbVec3d & | 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.
SbVec3d SbVec3d::getClosestAxis | ( | ) | const |
Returns principal axis that is closest (based on maximum dot product) to this vector.
void SbVec3d::getValue | ( | double & | x, | |
double & | y, | |||
double & | z | |||
) | const |
Returns vector components.
const double* SbVec3d::getValue | ( | ) | const [inline] |
Returns vector components.
double SbVec3d::length | ( | ) | const |
Returns geometric length of vector.
double SbVec3d::lengthSquared | ( | ) | const [inline] |
Returns square length of vector.
Faster than length().
void SbVec3d::negate | ( | ) |
Negates each component of vector in place.
double SbVec3d::normalize | ( | ) |
Changes vector to be unit length, returning the length before normalization.
Component-wise vector multiplication operator.
Component-wise vector multiplication operator.
SbVec3d& SbVec3d::operator*= | ( | double | d | ) | [inline] |
Component-wise scalar multiplication operator.
Component-wise vector addition operator.
SbVec3d SbVec3d::operator- | ( | ) | const [inline] |
Nondestructive unary negation - returns a new vector.
Component-wise vector subtraction operator.
SbVec3d& SbVec3d::operator/= | ( | double | d | ) | [inline] |
Component-wise scalar division operator.
const double& SbVec3d::operator[] | ( | int | i | ) | const [inline] |
Accesses indexed component of vector.
double& SbVec3d::operator[] | ( | int | i | ) | [inline] |
Accesses indexed component of vector.
Sets value of vector from a single precision vector.
SbVec3d& SbVec3d::setValue | ( | const SbVec3d & | barycentic, | |
const SbVec3d & | v0, | |||
const SbVec3d & | v1, | |||
const SbVec3d & | v2 | |||
) |
Sets value of vector as the weighted average of 3 other vectors.
SbVec3d& SbVec3d::setValue | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
Sets the vector components.
SbVec3d& SbVec3d::setValue | ( | const double | v[3] | ) | [inline] |
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 SbVec3d & | v | |||
) | [friend] |
Writes the vector to the specified output stream.