openscenegraph
|
#include <Vec2f>
Public Types | |
enum | { num_components = 2 } |
typedef float | value_type |
Public Member Functions | |
Vec2f () | |
Vec2f (value_type x, value_type y) | |
bool | operator== (const Vec2f &v) const |
bool | operator!= (const Vec2f &v) const |
bool | operator< (const Vec2f &v) const |
value_type * | ptr () |
const value_type * | ptr () const |
void | set (value_type x, value_type y) |
void | set (const Vec2f &rhs) |
value_type & | operator[] (int i) |
value_type | operator[] (int i) const |
value_type & | x () |
value_type & | y () |
value_type | x () const |
value_type | y () const |
bool | valid () const |
bool | isNaN () const |
value_type | operator* (const Vec2f &rhs) const |
const Vec2f | operator* (value_type rhs) const |
Vec2f & | operator*= (value_type rhs) |
const Vec2f | operator/ (value_type rhs) const |
Vec2f & | operator/= (value_type rhs) |
const Vec2f | operator+ (const Vec2f &rhs) const |
Vec2f & | operator+= (const Vec2f &rhs) |
const Vec2f | operator- (const Vec2f &rhs) const |
Vec2f & | operator-= (const Vec2f &rhs) |
const Vec2f | operator- () const |
value_type | length () const |
value_type | length2 (void) const |
value_type | normalize () |
Public Attributes | |
value_type | _v [2] |
General purpose float pair. Uses include representation of texture coordinates. No support yet added for float * Vec2f - is it necessary? Need to define a non-member non-friend operator* etc. BTW: Vec2f * float is okay
typedef float osg::Vec2f::value_type |
Data type of vector components.
|
inline |
Constructor that sets all components of the vector to zero
|
inline |
|
inline |
Returns true if at least one component has value NaN.
|
inline |
Length of the vector = sqrt( vec . vec )
|
inline |
Length squared of the vector = vec . vec
|
inline |
Normalize the vector so that it has length unity. Returns the previous length of the vector.
|
inline |
|
inline |
Dot product.
|
inline |
Multiply by scalar.
|
inline |
Unary multiply by scalar.
Unary vector add. Slightly more efficient because no temporary intermediate object.
|
inline |
Negation operator. Returns the negative of the Vec2f.
|
inline |
Divide by scalar.
|
inline |
Unary divide by scalar.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if all components have values that are not NaN.
|
inline |
|
inline |
|
inline |
|
inline |
value_type osg::Vec2f::_v[2] |
Vec member variable.