General purpose float pair, uses include representation of texture coordinates.
Public Fields
-
value_type _v[2]
Public Methods
-
Vec2f()
-
Vec2f(value_type x, value_type y)
-
inline bool operator == (const Vec2f& v) const
-
inline bool operator != (const Vec2f& v) const
-
inline bool operator < (const Vec2f& v) const
-
inline value_type* ptr()
-
inline const value_type* ptr() const
-
inline void set( value_type x, value_type y )
-
inline value_type& operator [] (int i)
-
inline value_type operator [] (int i) const
-
inline value_type& x()
-
inline value_type& y()
-
inline value_type x() const
-
inline value_type y() const
-
inline bool valid() const
-
inline bool isNaN() const
-
inline value_type operator * (const Vec2f& rhs) const
- dot product
-
inline const Vec2f operator * (value_type rhs) const
- multiply by scalar
-
inline Vec2f& operator *= (value_type rhs)
- unary multiply by scalar
-
inline const Vec2f operator / (value_type rhs) const
- divide by scalar
-
inline Vec2f& operator /= (value_type rhs)
- unary divide by scalar
-
inline const Vec2f operator + (const Vec2f& rhs) const
- binary vector add
-
inline Vec2f& operator += (const Vec2f& rhs)
- unary vector add.
-
inline const Vec2f operator - (const Vec2f& rhs) const
- binary vector subtract
-
inline Vec2f& operator -= (const Vec2f& rhs)
- unary vector subtract
-
inline const Vec2f operator - () const
- negation operator.
-
inline value_type length() const
- Length of the vector = sqrt( vec .
-
inline value_type length2( void ) const
- Length squared of the vector = vec .
-
inline value_type normalize()
- normalize the vector so that it has length unity returns the previous length of the vector
Public
-
typedef float value_type
Documentation
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 value_type
- value_type _v[2]
- Vec2f()
- Vec2f(value_type x, value_type y)
- inline bool operator == (const Vec2f& v) const
- inline bool operator != (const Vec2f& v) const
- inline bool operator < (const Vec2f& v) const
- inline value_type* ptr()
- inline const value_type* ptr() const
- inline void set( value_type x, value_type y )
- inline value_type& operator [] (int i)
- inline value_type operator [] (int i) const
- inline value_type& x()
- inline value_type& y()
- inline value_type x() const
- inline value_type y() const
- inline bool valid() const
- inline bool isNaN() const
- inline value_type operator * (const Vec2f& rhs) const
- dot product
- inline const Vec2f operator * (value_type rhs) const
- multiply by scalar
- inline Vec2f& operator *= (value_type rhs)
- unary multiply by scalar
- inline const Vec2f operator / (value_type rhs) const
- divide by scalar
- inline Vec2f& operator /= (value_type rhs)
- unary divide by scalar
- inline const Vec2f operator + (const Vec2f& rhs) const
- binary vector add
- inline Vec2f& operator += (const Vec2f& rhs)
- unary vector add. Slightly more efficient because no temporary
intermediate object.
- inline const Vec2f operator - (const Vec2f& rhs) const
- binary vector subtract
- inline Vec2f& operator -= (const Vec2f& rhs)
- unary vector subtract
- inline const Vec2f operator - () const
- negation operator. Returns the negative of the Vec2f
- inline value_type length() const
- Length of the vector = sqrt( vec . vec )
- inline value_type length2( void ) const
- Length squared of the vector = vec . vec
- inline 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 Vec2f& vec)
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.