class osg::Vec4

General purpose float quad, uses include representation of colour coordinates.

Public Fields

[more]float _v[4]

Public Methods

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


Documentation

General purpose float quad, uses include representation of colour coordinates. No support yet added for float * Vec4 - is it necessary? Need to define a non-member non-friend operator* etc. Vec4 * float is okay
o Vec4()

o Vec4(float x, float y, float z, float w)

o Vec4(const Vec3& v3, float w)

ofloat _v[4]

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

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

oinline const bool operator < (const Vec4& v) const

oinline float* ptr()

oinline const float* ptr() const

oinline void set( float x, float y, float z, float w)

oinline float& operator [] (const int i)

oinline float operator [] (const int i) const

oinline float& x()

oinline float& y()

oinline float& z()

oinline float& w()

oinline float x() const

oinline float y() const

oinline float z() const

oinline float w() const

oinline unsigned long asABGR() const

oinline const unsigned long asRGBA() const

oinline const bool valid() const

oinline const bool isNaN() const

oinline float operator * (const Vec4& rhs) const
dot product

oinline Vec4 operator * (const float& rhs) const
multiply by scalar

oinline Vec4& operator *= (const float& rhs)
unary multiply by scalar

oinline Vec4 operator / (const float& rhs) const
divide by scalar

oinline Vec4& operator /= (const float& rhs)
unary divide by scalar

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

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

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

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

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

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

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

oinline const float 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 Vec4& vec)

Alphabetic index HTML hierarchy of classes or Java



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