class osg::Vec2d

General purpose double pair, uses include representation of texture coordinates.

Public Fields

[more]value_type _v[2]

Public Methods

[more] Vec2d()
[more] Vec2d(value_type x, value_type y)
[more]inline Vec2d(const Vec2f& vec)
[more]inline operator Vec2f() const
[more]inline bool operator == (const Vec2d& v) const
[more]inline bool operator != (const Vec2d& v) const
[more]inline bool operator < (const Vec2d& v) const
[more]inline value_type* ptr()
[more]inline const value_type* ptr() const
[more]inline void set( value_type x, value_type y )
[more]inline value_type& operator [] (int i)
[more]inline value_type operator [] (int i) const
[more]inline value_type& x()
[more]inline value_type& y()
[more]inline value_type x() const
[more]inline value_type y() const
[more]inline bool valid() const
[more]inline bool isNaN() const
[more]inline value_type operator * (const Vec2d& rhs) const
dot product
[more]inline const Vec2d operator * (value_type rhs) const
multiply by scalar
[more]inline Vec2d& operator *= (value_type rhs)
unary multiply by scalar
[more]inline const Vec2d operator / (value_type rhs) const
divide by scalar
[more]inline Vec2d& operator /= (value_type rhs)
unary divide by scalar
[more]inline const Vec2d operator + (const Vec2d& rhs) const
binary vector add
[more]inline Vec2d& operator += (const Vec2d& rhs)
unary vector add.
[more]inline const Vec2d operator - (const Vec2d& rhs) const
binary vector subtract
[more]inline Vec2d& operator -= (const Vec2d& rhs)
unary vector subtract
[more]inline const Vec2d operator - () const
negation operator.
[more]inline value_type length() const
Length of the vector = sqrt( vec .
[more]inline value_type length2( void ) const
Length squared of the vector = vec .
[more]inline value_type normalize()
normalize the vector so that it has length unity returns the previous length of the vector

Public

[more]typedef double value_type


Documentation

General purpose double pair, uses include representation of texture coordinates. No support yet added for double * Vec2d - is it necessary? Need to define a non-member non-friend operator* etc. BTW: Vec2d * double is okay
otypedef double value_type

ovalue_type _v[2]

o Vec2d()

o Vec2d(value_type x, value_type y)

oinline Vec2d(const Vec2f& vec)

oinline operator Vec2f() const

oinline bool operator == (const Vec2d& v) const

oinline bool operator != (const Vec2d& v) const

oinline bool operator < (const Vec2d& v) const

oinline value_type* ptr()

oinline const value_type* ptr() const

oinline void set( value_type x, value_type y )

oinline value_type& operator [] (int i)

oinline value_type operator [] (int i) const

oinline value_type& x()

oinline value_type& y()

oinline value_type x() const

oinline value_type y() const

oinline bool valid() const

oinline bool isNaN() const

oinline value_type operator * (const Vec2d& rhs) const
dot product

oinline const Vec2d operator * (value_type rhs) const
multiply by scalar

oinline Vec2d& operator *= (value_type rhs)
unary multiply by scalar

oinline const Vec2d operator / (value_type rhs) const
divide by scalar

oinline Vec2d& operator /= (value_type rhs)
unary divide by scalar

oinline const Vec2d operator + (const Vec2d& rhs) const
binary vector add

oinline Vec2d& operator += (const Vec2d& rhs)
unary vector add. Slightly more efficient because no temporary intermediate object.

oinline const Vec2d operator - (const Vec2d& rhs) const
binary vector subtract

oinline Vec2d& operator -= (const Vec2d& rhs)
unary vector subtract

oinline const Vec2d operator - () const
negation operator. Returns the negative of the Vec2d

oinline value_type length() const
Length of the vector = sqrt( vec . vec )

oinline value_type length2( void ) const
Length squared of the vector = vec . vec

oinline value_type normalize()
normalize the vector so that it has length unity returns the previous length of the vector


This class has no child classes.
Friends:
inline std::ostream& operator << (std::ostream& output, const Vec2d& vec)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.