Open Inventor Reference
|
2D vector class. More...
#include <Inventor/SbLinear.h>
Public Member Functions | |
SbVec2f () | |
Default constructor. More... | |
SbVec2f (const float v[2]) | |
Constructor given vector components. More... | |
SbVec2f (float x, float y) | |
Constructor given vector components. More... | |
float | dot (const SbVec2f &v) const |
Returns dot (inner) product of vector and another vector. More... | |
const float * | getValue () const |
Returns vector components. More... | |
void | getValue (float &x, float &y) const |
Returns vector components. More... | |
float | length () const |
Returns geometric length of vector. More... | |
void | negate () |
Negates each component of vector in place. More... | |
float | normalize () |
Changes vector to be unit length. More... | |
SbVec2f & | setValue (const float v[2]) |
Sets the vector components. More... | |
SbVec2f & | setValue (float x, float y) |
Sets the vector components. More... | |
float & | operator[] (int i) |
Accesses indexed component of vector. More... | |
const float & | operator[] (int i) const |
SbVec2f & | operator*= (float d) |
Component-wise scalar multiplication and division operators. More... | |
SbVec2f & | operator/= (float d) |
Component-wise scalar multiplication and division operators. More... | |
SbVec2f & | operator+= (const SbVec2f &u) |
Component-wise vector addition and subtraction operators. More... | |
SbVec2f & | operator-= (const SbVec2f &u) |
Component-wise vector addition and subtraction operators. More... | |
SbVec2f | operator- () const |
Nondestructive unary negation - returns a new vector. More... | |
bool | equals (const SbVec2f v, float tolerance) const |
Equality comparison within given tolerance em the square of the length of the maximum distance between the two vectors. More... | |
Protected Attributes | |
float | vec [2] |
Storage for vector components. More... | |
Friends | |
INVENTOR_API SbVec2f | operator* (const SbVec2f &v, float d) |
Component-wise binary scalar multiplication and division operators. More... | |
INVENTOR_API SbVec2f | operator* (float d, const SbVec2f &v) |
INVENTOR_API SbVec2f | operator/ (const SbVec2f &v, float d) |
INVENTOR_API SbVec2f | operator+ (const SbVec2f &v1, const SbVec2f &v2) |
Component-wise binary vector addition and subtraction operators. More... | |
INVENTOR_API SbVec2f | operator- (const SbVec2f &v1, const SbVec2f &v2) |
INVENTOR_API bool | operator== (const SbVec2f &v1, const SbVec2f &v2) |
Equality comparison operator. More... | |
INVENTOR_API bool | operator!= (const SbVec2f &v1, const SbVec2f &v2) |
2D vector class used to store 2D vectors and points. This class is used throughout Inventor for arguments and return values. {}
Definition at line 246 of file SbLinear.h.
|
inline |
Definition at line 250 of file SbLinear.h.
|
inline |
Definition at line 253 of file SbLinear.h.
|
inline |
Definition at line 256 of file SbLinear.h.
float SbVec2f::dot | ( | const SbVec2f & | v | ) | const |
bool SbVec2f::equals | ( | const SbVec2f | v, |
float | tolerance | ||
) | const |
|
inline |
Definition at line 262 of file SbLinear.h.
void SbVec2f::getValue | ( | float & | x, |
float & | y | ||
) | const |
float SbVec2f::length | ( | ) | const |
void SbVec2f::negate | ( | ) |
float SbVec2f::normalize | ( | ) |
SbVec2f& SbVec2f::operator*= | ( | float | d | ) |
SbVec2f SbVec2f::operator- | ( | ) | const |
|
inline |
Definition at line 290 of file SbLinear.h.
|
inline |
Definition at line 283 of file SbLinear.h.
|
inline |
Definition at line 284 of file SbLinear.h.
SbVec2f& SbVec2f::setValue | ( | const float | v[2] | ) |
SbVec2f& SbVec2f::setValue | ( | float | x, |
float | y | ||
) |
|
friend |
Definition at line 334 of file SbLinear.h.
|
friend |
|
friend |
Definition at line 324 of file SbLinear.h.
|
friend |
|
friend |
|
friend |
Definition at line 326 of file SbLinear.h.
|
friend |
|
protected |
Definition at line 320 of file SbLinear.h.