General purpose float triple for use as vertices, vectors and normals.
Public Fields
-
value_type _v[3]
Public Methods
-
Vec3f()
-
Vec3f(value_type x, value_type y, value_type z)
-
inline bool operator == (const Vec3f& v) const
-
inline bool operator != (const Vec3f& v) const
-
inline bool operator < (const Vec3f& v) const
-
inline value_type* ptr()
-
inline const value_type* ptr() const
-
inline void set( value_type x, value_type y, value_type z)
-
inline void set( const Vec3f& rhs)
-
inline value_type& operator [] (int i)
-
inline value_type operator [] (int i) const
-
inline value_type& x()
-
inline value_type& y()
-
inline value_type& z()
-
inline value_type x() const
-
inline value_type y() const
-
inline value_type z() const
-
inline bool valid() const
-
inline bool isNaN() const
-
inline value_type operator * (const Vec3f& rhs) const
- dot product
-
inline const Vec3f operator ^ (const Vec3f& rhs) const
- cross product
-
inline const Vec3f operator * (value_type rhs) const
- multiply by scalar
-
inline Vec3f& operator *= (value_type rhs)
- unary multiply by scalar
-
inline const Vec3f operator / (value_type rhs) const
- divide by scalar
-
inline Vec3f& operator /= (value_type rhs)
- unary divide by scalar
-
inline const Vec3f operator + (const Vec3f& rhs) const
- binary vector add
-
inline Vec3f& operator += (const Vec3f& rhs)
- unary vector add.
-
inline const Vec3f operator - (const Vec3f& rhs) const
- binary vector subtract
-
inline Vec3f& operator -= (const Vec3f& rhs)
- unary vector subtract
-
inline const Vec3f operator - () const
- negation operator.
-
inline value_type length() const
- Length of the vector = sqrt( vec .
-
inline value_type length2() 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 triple for use as vertices, vectors and normals.
Provides general maths operations from addition through to cross products.
No support yet added for float * Vec3f - is it necessary?
Need to define a non-member non-friend operator* etc.
Vec3f * float is okay
- typedef float value_type
- value_type _v[3]
- Vec3f()
- Vec3f(value_type x, value_type y, value_type z)
- inline bool operator == (const Vec3f& v) const
- inline bool operator != (const Vec3f& v) const
- inline bool operator < (const Vec3f& v) const
- inline value_type* ptr()
- inline const value_type* ptr() const
- inline void set( value_type x, value_type y, value_type z)
- inline void set( const Vec3f& rhs)
- inline value_type& operator [] (int i)
- inline value_type operator [] (int i) const
- inline value_type& x()
- inline value_type& y()
- inline value_type& z()
- inline value_type x() const
- inline value_type y() const
- inline value_type z() const
- inline bool valid() const
- inline bool isNaN() const
- inline value_type operator * (const Vec3f& rhs) const
- dot product
- inline const Vec3f operator ^ (const Vec3f& rhs) const
- cross product
- inline const Vec3f operator * (value_type rhs) const
- multiply by scalar
- inline Vec3f& operator *= (value_type rhs)
- unary multiply by scalar
- inline const Vec3f operator / (value_type rhs) const
- divide by scalar
- inline Vec3f& operator /= (value_type rhs)
- unary divide by scalar
- inline const Vec3f operator + (const Vec3f& rhs) const
- binary vector add
- inline Vec3f& operator += (const Vec3f& rhs)
- unary vector add. Slightly more efficient because no temporary
intermediate object
- inline const Vec3f operator - (const Vec3f& rhs) const
- binary vector subtract
- inline Vec3f& operator -= (const Vec3f& rhs)
- unary vector subtract
- inline const Vec3f operator - () const
- negation operator. Returns the negative of the Vec3f
- inline value_type length() const
- Length of the vector = sqrt( vec . vec )
- inline value_type length2() 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 Vec3f& vec)
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.