OpenGLPrakt --> math
A class for representing a quaternion and its operations.
Contains a class representing a quaternion and allowing operations like multiplying quaternions, transforming vertices and generating a matrix from a quaternion.
public cQuaternion ( ) ;
default constructor
public cQuaternion ( const GLfloat cw , const GLfloat cx , const GLfloat cy , const GLfloat cz ) ;
constructor w/ hard initialization of quaternion
cw | scalar value of quaternion |
cx | x component of complex value |
cy | y component of complex value |
cz | z component of complex value |
public cQuaternion ( const GLfloat angle , const cVertex & axis ) ;
constructor w/ initialization
angle | angle in degree |
axis | vector to rotate around |
public cQuaternion operator * ( const cQuaternion & q ) const ;
operator * for two quaternions (multiply two quaternions)
q | quaternion to multiply with |
public cQuaternion & operator *= ( const cQuaternion & q ) ;
operator *= for quaternions (multiply two quaternions)
q | quaternion to multiply with |
public cVertex operator * ( const cVertex & v ) ;
operator * for vertices (applies quaternion to vertex)
v | cVertex to transform |
public void SetIdentity ( ) ;
set quaternion to identity (no transformation/rotation)
public void SetRotation ( const GLfloat angle , const cVertex & axis ) ;
set quaternion to represent given rotation (angle in degree)
angle | in degree |
axis | to turn around |
public void Normalize ( ) ;
normalize the quaternion (make it length 1)
public GLfloat GetS ( ) const ;
return s component of quaternion
public cVertex GetV ( ) const ;
return v component of quaternion
public GLfloat GetLength ( ) const ;
return "length" of quaternion
public cQuaternion GetInverse ( ) ;
return the inverse of the quaternion
public cMatrix GetAsMatrix ( ) ;
return the matrix representation of the quaternion
public void GetAsMatrix ( cMatrix & tmp ) ;
shortcut for retrieving the quaternion in matrix representation prevents allocating temporary on stack
tmp | reference to cMatrix object |
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.