Back to index

kdeartwork  4.3.2
Public Member Functions | Public Attributes
rsVec Class Reference

List of all members.

Public Member Functions

 rsVec ()
 rsVec (float xx, float yy, float zz)
void set (float xx, float yy, float zz)
float normalize ()
float dot (rsVec)
void cross (rsVec, rsVec)
float & operator[] (int i)
const float & operator[] (int i) const
rsVecoperator= (const rsVec &vec)
rsVec operator+ (const rsVec &vec)
rsVec operator- (const rsVec &vec)
rsVec operator* (const float &mul)
rsVec operator/ (const float &div)
rsVecoperator+= (const rsVec &vec)
rsVecoperator-= (const rsVec &vec)
rsVecoperator*= (const rsVec &vec)
rsVecoperator*= (const float &mul)

Public Attributes

float v [3]

Detailed Description

Definition at line 57 of file Euphoria.cpp.


Constructor & Destructor Documentation

rsVec::rsVec ( ) [inline]

Definition at line 63 of file Euphoria.cpp.

{}

Here is the caller graph for this function:

rsVec::rsVec ( float  xx,
float  yy,
float  zz 
)

Definition at line 94 of file Euphoria.cpp.

                                        {
    v[0] = xx;
    v[1] = yy;
    v[2] = zz;
}

Member Function Documentation

void rsVec::cross ( rsVec  vec1,
rsVec  vec2 
)

Definition at line 131 of file Euphoria.cpp.

                                       {
    v[0] = vec1[1] * vec2[2] - vec2[1] * vec1[2];
    v[1] = vec1[2] * vec2[0] - vec2[2] * vec1[0];
    v[2] = vec1[0] * vec2[1] - vec2[0] * vec1[1];
}

Here is the caller graph for this function:

float rsVec::dot ( rsVec  vec1)

Definition at line 126 of file Euphoria.cpp.

                          {
    return(v[0] * vec1[0] + v[1] * vec1[1] + v[2] * vec1[2]);
}
float rsVec::normalize ( )

Definition at line 108 of file Euphoria.cpp.

                      {
    float length = float(sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
    if(length == 0.0f){
        v[1] = 1.0f;
        return(0.0f);
    }
    float reciprocal = 1.0f / length;
    v[0] *= reciprocal;
    v[1] *= reciprocal;
    v[2] *= reciprocal;
    // Really freakin' stupid compiler bug fix for VC++ 5.0
    /*v[0] /= length;
    v[1] /= length;
    v[2] /= length;*/
    return(length);
}

Here is the caller graph for this function:

rsVec rsVec::operator* ( const float &  mul) [inline]

Definition at line 79 of file Euphoria.cpp.

        {return(rsVec(v[0]*mul, v[1]*mul, v[2]*mul));}

Here is the call graph for this function:

rsVec& rsVec::operator*= ( const rsVec vec) [inline]

Definition at line 87 of file Euphoria.cpp.

        {v[0]*=vec[0];v[1]*=vec[1];v[2]*=vec[2];return *this;}
rsVec& rsVec::operator*= ( const float &  mul) [inline]

Definition at line 89 of file Euphoria.cpp.

        {v[0]*=mul;v[1]*=mul;v[2]*=mul;return *this;}
rsVec rsVec::operator+ ( const rsVec vec) [inline]

Definition at line 75 of file Euphoria.cpp.

        {return(rsVec(v[0]+vec[0], v[1]+vec[1], v[2]+vec[2]));}

Here is the call graph for this function:

rsVec& rsVec::operator+= ( const rsVec vec) [inline]

Definition at line 83 of file Euphoria.cpp.

        {v[0]+=vec[0];v[1]+=vec[1];v[2]+=vec[2];return *this;}
rsVec rsVec::operator- ( const rsVec vec) [inline]

Definition at line 77 of file Euphoria.cpp.

        {return(rsVec(v[0]-vec[0], v[1]-vec[1], v[2]-vec[2]));}

Here is the call graph for this function:

rsVec& rsVec::operator-= ( const rsVec vec) [inline]

Definition at line 85 of file Euphoria.cpp.

        {v[0]-=vec[0];v[1]-=vec[1];v[2]-=vec[2];return *this;}
rsVec rsVec::operator/ ( const float &  div) [inline]

Definition at line 81 of file Euphoria.cpp.

        {float rec = 1.0f/div; return(rsVec(v[0]*rec, v[1]*rec, v[2]*rec));}

Here is the call graph for this function:

rsVec& rsVec::operator= ( const rsVec vec) [inline]

Definition at line 73 of file Euphoria.cpp.

        {v[0]=vec[0];v[1]=vec[1];v[2]=vec[2];return *this;}
float& rsVec::operator[] ( int  i) [inline]

Definition at line 71 of file Euphoria.cpp.

{return v[i];}
const float& rsVec::operator[] ( int  i) const [inline]

Definition at line 72 of file Euphoria.cpp.

{return v[i];}
void rsVec::set ( float  xx,
float  yy,
float  zz 
)

Definition at line 101 of file Euphoria.cpp.

                                           {
    v[0] = xx;
    v[1] = yy;
    v[2] = zz;
}

Here is the caller graph for this function:


Member Data Documentation

float rsVec::v[3]

Definition at line 61 of file Euphoria.cpp.


The documentation for this class was generated from the following file: