OpenSceneGraph
3.0.1
|
General purpose float pair. More...
Public Types | |
enum | { num_components = 2 } |
Number of vector components. More... | |
typedef float | value_type |
Data type of vector components. |
Public Member Functions | |
Vec2f () | |
Constructor that sets all components of the vector to zero. | |
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) |
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 |
Returns true if all components have values that are not NaN. | |
bool | isNaN () const |
Returns true if at least one component has value NaN. | |
value_type | operator* (const Vec2f &rhs) const |
Dot product. | |
const Vec2f | operator* (value_type rhs) const |
Multiply by scalar. | |
Vec2f & | operator*= (value_type rhs) |
Unary multiply by scalar. | |
const Vec2f | operator/ (value_type rhs) const |
Divide by scalar. | |
Vec2f & | operator/= (value_type rhs) |
Unary divide by scalar. | |
const Vec2f | operator+ (const Vec2f &rhs) const |
Binary vector add. | |
Vec2f & | operator+= (const Vec2f &rhs) |
Unary vector add. | |
const Vec2f | operator- (const Vec2f &rhs) const |
Binary vector subtract. | |
Vec2f & | operator-= (const Vec2f &rhs) |
Unary vector subtract. | |
const Vec2f | operator- () const |
Negation operator. | |
value_type | length () const |
Length of the vector = sqrt( vec . | |
value_type | length2 (void) const |
Length squared of the vector = vec . | |
value_type | normalize () |
Normalize the vector so that it has length unity. |
Public Attributes | |
value_type | _v [2] |
Vec member variable. |
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.
References _v.
Referenced by operator*(), operator+(), operator-(), and operator/().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Dot product.
References _v.
|
inline |
|
inline |
Unary multiply by scalar.
References _v.
|
inline |
|
inline |
|
inline |
Unary divide by scalar.
References _v.
|
inline |
References _v.
|
inline |
References _v.
|
inline |
References _v.
|
inline |
References _v.
|
inline |
|
inline |
Returns true if all components have values that are not NaN.
References isNaN().
|
inline |
References _v.
Referenced by osgWidget::Widget::addOrigin(), osgWidget::Widget::addSize(), osg::Image::getColor(), osgWidget::Widget::getImageColorAtXY(), osgParticle::Interpolator::interpolate(), osgWidget::Window::isPointerXYWithinVisible(), osgTerrain::ValidDataOperator::operator()(), set(), osgWidget::Widget::setMinimumSize(), osgWidget::Widget::setOrigin(), osgWidget::Window::setOrigin(), osgWidget::Widget::setSize(), osgWidget::Widget::setTexCoord(), osgWidget::Widget::setTexCoordRegion(), and Vec2f().
|
inline |
References _v.
|
inline |
References _v.
Referenced by osgWidget::Widget::addOrigin(), osgWidget::Widget::addSize(), osg::Image::getColor(), osgWidget::Widget::getImageColorAtXY(), osgParticle::Interpolator::interpolate(), osgWidget::Window::isPointerXYWithinVisible(), osgTerrain::ValidDataOperator::operator()(), set(), osgWidget::Widget::setMinimumSize(), osgWidget::Widget::setOrigin(), osgWidget::Window::setOrigin(), osgWidget::Widget::setSize(), osgWidget::Widget::setTexCoord(), osgWidget::Widget::setTexCoordRegion(), and Vec2f().
|
inline |
References _v.
value_type osg::Vec2f::_v[2] |
Vec member variable.
Referenced by isNaN(), length(), length2(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), osg::operator<<(), operator==(), osg::operator>>(), operator[](), ptr(), set(), osg::Vec2d::Vec2d(), Vec2f(), x(), and y().
![]() | Generated at Fri Sep 7 2012 17:49:43 for the OpenSceneGraph by doxygen 1.8.1.2. |