Rotation Struct Reference

#include <Geometry.h>

List of all members.


Detailed Description

A 3x3 3D rotation matrix

This class implements the 3x3 3D rotation matrix. It is implemented in row-major order. Elements are accessed as Rotation::R[row][column] with both row and column being zero based. The rows of the matrix contain the unit coordinates of each of the axes of the resulting coordinate system, and can be accessed through Rotation::x, Rotation::y, Rotation::z. For example, after applying the rotation, a point with coordinate Rotation::x will become (1,0,0).


Public Member Functions

 Rotation ()
 Default constructor. Initializes to identity matrix.
 Rotation (point const &v, float angle)
 Rotation (float q[4])
Rotation operator! () const
 Returns the inverse of the rotation matrix.
void Translate (point const &o)
void Orthogonalize ()
void OrthogonalizeYZ ()
float Quaternion (float q[4])

Public Attributes

union {
   float   R [3][3]
 the rotation matrix representing the rotation.
   struct {
      pointNC   x
 unit coordinate on 1st (x) axis
      pointNC   y
 unit coordinate on 2nd (y) axis
      pointNC   z
 unit coordinate on 3rd (z) axis
   } 
}; 


Constructor & Destructor Documentation

Rotation ( point const &  v,
float  angle 
) [inline]

Constructs a rotation matrix corresponding to rotating about an arbitraty axis.

Parameters:
v axis of rotation (should be a unit vector)
angle counter-clockwise angle of rotation about the axis


Member Function Documentation

float Quaternion ( float  q[4]  )  [inline]

Returns the quaternion representation of the rotation matrix. The norm of the quaternion (before it is normalized) is returned


The documentation for this struct was generated from the following file:
Generated on Tue Mar 6 17:57:18 2007 for AME Repository by  doxygen 1.5.1-p1