OpenGLPrakt --> math
A class for easy matrix math.
Always remember: This class might be used a lot and during time-critical operations. Thus, it's optimized for speed, which has the consequence that it cannot be derived from this class.
cVertex
cVertex
Assign
CrossProd
CrossProd
GetLength
GetX
GetY
GetZ
Invert
Normalize
operator *
operator *
operator *=
operator +
operator +=
operator -
operator -=
operator []
operator GLfloat*
SetZero
Translate
public cVertex ( ) ;
default constructor (initializes to zero)
public cVertex ( GLfloat vx ,
GLfloat vy ,
GLfloat vz ) ;
constructor accepting a vertex split into it's components
| vx | n.x component |
| vy | n.y component |
| vz | n.z component |
public inline cVertex & operator *= ( const GLfloat s ) ;
operator for scaling by a given value
| s | scale factor |
public inline cVertex & operator += ( const cVertex & v ) ;
operator for adding two cVertex objects
| v | cVertex to add |
public inline cVertex & operator -= ( const cVertex & v ) ;
operator for subtracting two cVertex objects
| v | cVertex to subtract |
public inline cVertex operator * ( const GLfloat s ) const ;
operator for multiplying any cVertex with a scalar
| s | value to scale by |
public inline cVertex operator + ( const cVertex & v ) const ;
operator to add two cVertex objects
| v | cVertex object to add |
public inline cVertex operator - ( const cVertex & v ) const ;
operator for subtracting two cVertex objects
| v | cVertex object to substract |
public inline GLfloat operator * ( const cVertex & v ) const ;
operator to multiply two cVertex objects (dot product)
| v | cVertex to calculate dot product with |
public inline GLfloat & operator [ ] ( const int idx ) ;
operator to retrieve a component of an cVertex by index
| idx | index of value (0 = x, 1 = y, 2 = z) |
public inline operator GLfloat * ( ) ;
converting to GLfloat *
public inline cVertex Assign ( GLfloat vx ,
GLfloat vy ,
GLfloat vz ) ;
assign a new value to all three components (it's basically superfluous)
| vx | n.x component |
| vy | n.y component |
| vz | n.z component |
public inline cVertex & Normalize ( ) ;
normalize the vertex (make it length 1)
public inline void Translate ( GLfloat tx ,
GLfloat ty ,
GLfloat tz ) ;
convenience function: translate by given vertex
| tx | n.x component |
| ty | n.y component |
| tz | n.z component |
public inline cVertex & Invert ( ) ;
invert direction of vector by inverting all its components
public inline cVertex CrossProd ( const cVertex & v1 ,
const cVertex & v2 ) const ;
calculate cross product of two given vertices
| v1 | first vertex |
| v2 | second vertex |
public inline cVertex CrossProd ( const cVertex & v ) const ;
calculate cross product (does not change class)
| v | vector to calculate cross product with |
public inline void SetZero ( ) ;
set vertex to zero vector
public inline GLfloat GetX ( ) const ;
query current x component of vector
public inline GLfloat GetY ( ) const ;
query current y component of vector
public inline GLfloat GetZ ( ) const ;
query current z component of vector
public inline GLfloat GetLength ( ) const ;
determine length of vertex
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.