Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osg::Vec4 Class Reference

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

List of all members.

Public Methods

 Vec4 ()
 Vec4 (float x, float y, float z, float w)
 Vec4 (const Vec3 &v3, float w)
const bool operator== (const Vec4 &v) const
const bool operator!= (const Vec4 &v) const
const bool operator< (const Vec4 &v) const
float * ptr ()
const float * ptr () const
void set (float x, float y, float z, float w)
float & operator[] (const int i)
float operator[] (const int i) const
float & x ()
float & y ()
float & z ()
float & w ()
float x () const
float y () const
float z () const
float w () const
unsigned long asABGR () const
const unsigned long asRGBA () const
const bool valid () const
const bool isNaN () const
float operator * (const Vec4 &rhs) const
 dot product

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

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

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

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

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

Vec4 & operator+= (const Vec4 &rhs)
 unary vector add.

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

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

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

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

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

const float normalize ()
 normalize the vector so that it has length unity returns the previous length of the vector


Public Attributes

float _v [4]

Friends

std::ostream & operator<< (std::ostream &output, const Vec4 &vec)


Detailed Description

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


Constructor & Destructor Documentation

osg::Vec4::Vec4 (    )  [inline]
 

osg::Vec4::Vec4 (  float    x,
float    y,
float    z,
float    w
)  [inline]
 

osg::Vec4::Vec4 (  const Vec3 &    v3,
float    w
)  [inline]
 


Member Function Documentation

unsigned long osg::Vec4::asABGR (    )  const [inline]
 

const unsigned long osg::Vec4::asRGBA (    )  const [inline]
 

const bool osg::Vec4::isNaN (    )  const [inline]
 

const float osg::Vec4::length (    )  const [inline]
 

Length of the vector = sqrt( vec . vec ).

const float osg::Vec4::length2 (    )  const [inline]
 

Length squared of the vector = vec . vec.

const float osg::Vec4::normalize (    )  [inline]
 

normalize the vector so that it has length unity returns the previous length of the vector

Vec4 osg::Vec4::operator * (  const float    rhs )  const [inline]
 

multiply by scalar

float osg::Vec4::operator * (  const Vec4 &    rhs )  const [inline]
 

dot product

Vec4& osg::Vec4::operator *= (  const float    rhs )  [inline]
 

unary multiply by scalar

const bool osg::Vec4::operator!= (  const Vec4 &    v )  const [inline]
 

Vec4 osg::Vec4::operator+ (  const Vec4 &    rhs )  const [inline]
 

binary vector add

Vec4& osg::Vec4::operator+= (  const Vec4 &    rhs )  [inline]
 

unary vector add.

Slightly more efficient because no temporary intermediate object

const Vec4 osg::Vec4::operator- (    )  const [inline]
 

negation operator. Returns the negative of the Vec4

Vec4 osg::Vec4::operator- (  const Vec4 &    rhs )  const [inline]
 

binary vector subtract

Vec4& osg::Vec4::operator-= (  const Vec4 &    rhs )  [inline]
 

unary vector subtract

Vec4 osg::Vec4::operator/ (  const float    rhs )  const [inline]
 

divide by scalar

Vec4& osg::Vec4::operator/= (  const float    rhs )  [inline]
 

unary divide by scalar

const bool osg::Vec4::operator< (  const Vec4 &    v )  const [inline]
 

const bool osg::Vec4::operator== (  const Vec4 &    v )  const [inline]
 

float osg::Vec4::operator[] (  const int    i )  const [inline]
 

float& osg::Vec4::operator[] (  const int    i )  [inline]
 

const float* osg::Vec4::ptr (    )  const [inline]
 

float* osg::Vec4::ptr (    )  [inline]
 

void osg::Vec4::set (  float    x,
float    y,
float    z,
float    w
)  [inline]
 

const bool osg::Vec4::valid (    )  const [inline]
 

float osg::Vec4::w (    )  const [inline]
 

float& osg::Vec4::w (    )  [inline]
 

float osg::Vec4::x (    )  const [inline]
 

float& osg::Vec4::x (    )  [inline]
 

float osg::Vec4::y (    )  const [inline]
 

float& osg::Vec4::y (    )  [inline]
 

float osg::Vec4::z (    )  const [inline]
 

float& osg::Vec4::z (    )  [inline]
 


Friends And Related Function Documentation

std::ostream& operator<< (  std::ostream &    output,
const Vec4 &    vec
)  [friend]
 


Member Data Documentation

float osg::Vec4::_v[4]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:47 2002 for the Open Scene Graph by doxygen 1.2.16.