cugl Namespace Reference


Classes

class  Point
class  Line
class  Plane
class  Vector
class  Matrix
class  Quaternion
class  BaseCamera
class  Camera
class  Interpolator
class  PixelMap
class  Revolute

Typedefs

typedef GLfloat GL_Matrix [4][4]
typedef GLfloat * GLfloatArray

Enumerations

enum  CUGLErrorType {
  NO_ERROR = 0, BAD_INDEX, BAD_MATRIX_MODE, BAD_ROTATION_MATRIX,
  SINGULAR_MATRIX, ZERO_DIVISOR, ZERO_NORM, BAD_INTERPOLATOR_ARG,
  OPEN_FAILED, NOT_BMP_FILE, NOT_24_BITS, COMPRESSED_BMP_FILE,
  NOT_ENOUGH_MEMORY, NO_PIX_MAP, BAD_PLANE, BAD_LINE,
  TOO_MANY_MATERIALS, TOO_MANY_POINTS
}
enum  MATERIAL {
  BLACK, WHITE, RED, GREEN,
  BLUE, METAL, GLASS, BRASS,
  BRONZE, POLISHED_BRONZE, CHROME, COPPER,
  POLISHED_COPPER, GOLD, POLISHED_GOLD, PEWTER,
  SILVER, POLISHED_SILVER, EMERALD, JADE,
  OBSIDIAN, PEARL, RUBY, TURQUOISE,
  BLACK_PLASTIC, BLACK_RUBBER, LAST_VALUE
}

Functions

CUGLErrorType getError ()
const char * getErrorString (CUGLErrorType err)
void checkCUGLStatus ()
void checkOpenGLStatus ()
double radians (double angle)
double degrees (double angle)
void triStripNormals (Point points[], Vector normals[], int numPoints, bool neg=false)
void revolve (int numSteps, GLfloat coor[][2], int numSlices, bool drawNormals=false)
void lookAt (Point eye)
void lookAt (Point eye, Point model)
void lookAt (Point eye, Point model, Vector up)
void axes (GLfloat size=1)
void buildPlane (bool shadow=false)
GLuint makePlaneList (bool shadow=false)
void setMaterial (const int m, GLenum face=GL_FRONT)
int addMaterial (GLfloat ambR, GLfloat ambG, GLfloat ambB, GLfloat ambA, GLfloat difR, GLfloat difG, GLfloat difB, GLfloat difA, GLfloat speR, GLfloat speG, GLfloat speB, GLfloat speA, GLfloat shine)
int addMaterial (GLfloat params[])
Point operator+ (const Point &p, const Vector &v)
Point operator+ (const Vector &v, const Point &p)
Point operator * (const Point &p, GLfloat s)
Point operator * (GLfloat s, const Point &p)
bool operator== (const Point &p, const Point &q)
bool operator!= (const Point &p, const Point &q)
GLfloat dist (const Point &p, const Plane &s)
GLfloat dist (const Plane &s, const Point &p)
bool operator== (const Line &m, const Line &n)
bool operator!= (const Line &m, const Line &n)
bool operator== (const Plane &p, const Plane &q)
bool operator!= (const Plane &p, const Plane &q)
Vector operator- (const Point &p, const Point &q)
Vector operator+ (const Vector &u, const Vector &v)
Vector operator- (const Vector &u, const Vector &v)
Vector operator * (const Vector &v, GLfloat s)
Vector operator * (GLfloat s, const Vector &v)
Vector cross (const Vector &u, const Vector &v)
Vector operator * (const Vector &u, const Vector &v)
GLfloat dot (const Vector &u, const Vector &v)
bool operator== (const Vector &u, const Vector &v)
bool operator!= (const Vector &u, const Vector &v)
Matrix operator * (const Matrix &m, const Matrix &n)
bool operator== (const Matrix &m, const Matrix &n)
bool operator!= (const Matrix &m, const Matrix &n)
GLfloat dot (const Quaternion &q, const Quaternion &r)
Quaternion operator+ (const Quaternion &q, const Quaternion &r)
Quaternion operator- (const Quaternion &q, const Quaternion &r)
Quaternion operator * (const Quaternion &q, const Quaternion &r)
Quaternion operator * (const Vector &v, const Quaternion &q)
Quaternion operator * (const Quaternion &q, const Vector &v)
Quaternion operator/ (const Quaternion &q, const Quaternion &r)
Quaternion operator * (const Quaternion &q, GLfloat a)
Quaternion operator * (GLfloat a, const Quaternion &q)
bool operator== (const Quaternion &q, const Quaternion &r)
bool operator!= (const Quaternion &q, const Quaternion &r)

Variables

const char version [] = "CUGL V1 2003.12.25"
const double PI = 4 * atan(1.0)
const Vector I (1, 0, 0)
const Vector J (0, 1, 0)
const Vector K (0, 0, 1)


Typedef Documentation

typedef GLfloat cugl::GL_Matrix[4][4]

The type of OpenGL projection and model view matrices.

Definition at line 53 of file cugl.h.

typedef GLfloat* cugl::GLfloatArray

The type of an array of GLfloats.

Definition at line 2031 of file cugl.h.


Function Documentation

Vector cugl::cross ( const Vector &  u,
const Vector &  v 
) [inline]

Return cross product of vectors u and v.

Definition at line 2671 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

GLfloat cugl::dist ( const Plane &  s,
const Point &  p 
) [inline]

Return the distance between a Point and a Plane. The result has the correct magnitude only if the Point and the Plane are both in normal form. In particular, the result is incorrect if the Point is at infinity. However, the sign of the result is correct in all cases, and so it is not necessary to provide normalized arguments if only the sign is important.

Definition at line 2499 of file cugl.h.

References cugl::Plane::a, cugl::Plane::b, cugl::Plane::c, cugl::Plane::d, cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.

GLfloat cugl::dist ( const Point &  p,
const Plane &  s 
) [inline]

Return the distance between a Point and a Plane. The result has the correct magnitude only if the Point and the Plane are both in normal form. In particular, the result is incorrect if the Point is at infinity. However, the sign of the result is correct in all cases, and so it is not necessary to provide normalized arguments if only the sign is important.

Definition at line 2494 of file cugl.h.

References cugl::Plane::a, cugl::Plane::b, cugl::Plane::c, cugl::Plane::d, cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.

GLfloat cugl::dot ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Return the dot product of quaternions q and r. The dot product of (s,u) and (t,v) is st+dot(u,v) where dot(u,v) denotes the vector dot product of u and v.

Returns:
the dot product of quaternions q and r.

Definition at line 2878 of file cugl.h.

References cugl::Quaternion::dot, cugl::Quaternion::s, and cugl::Quaternion::v.

GLfloat cugl::dot ( const Vector &  u,
const Vector &  v 
) [inline]

Return dot product of vectors u and v.

Definition at line 2687 of file cugl.h.

References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Quaternion cugl::operator * ( GLfloat  a,
const Quaternion &  q 
) [inline]

Return the quaternion a*q, where a is a scalar. a is a scalar and a*(s,v) = (a*s, a*v).

Returns:
the Quaternion a*q.

Definition at line 2957 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Quaternion cugl::operator * ( const Quaternion &  q,
GLfloat  a 
) [inline]

Return the quaternion a*q, where a is a scalar. a is a scalar and a*(s,v) = (a*s, a*v).

Returns:
the Quaternion a*q.

Definition at line 2952 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Quaternion cugl::operator * ( const Quaternion &  q,
const Vector &  v 
) [inline]

Promote the vector v to a quaternion qv and return the quaternion product q*qv.

Definition at line 2915 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Quaternion cugl::operator * ( const Vector &  v,
const Quaternion &  q 
) [inline]

Promote the vector v to a quaternion qv and return the quaternion product qv*q.

Definition at line 2904 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Quaternion cugl::operator * ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Return the quaternion product q*r. If q and r represent rotations, then q*r represents the rotation q followed by the rotation r.

Note:
Quaternion multiplication is not commutative: q*r is not equal to r*q.
Returns:
the Quaternion product q*r.

Definition at line 2893 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Matrix cugl::operator * ( const Matrix &  m,
const Matrix &  n 
) [inline]

Multiply two matrices.

Definition at line 2767 of file cugl.h.

References cugl::Matrix::m.

Vector cugl::operator * ( const Vector &  u,
const Vector &  v 
) [inline]

Return cross product of vectors u and v.

Definition at line 2679 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Vector cugl::operator * ( GLfloat  s,
const Vector &  v 
) [inline]

Return Vector s*v.

Definition at line 2666 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Vector cugl::operator * ( const Vector &  v,
GLfloat  s 
) [inline]

Return Vector s*v.

Definition at line 2661 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Point cugl::operator * ( GLfloat  s,
const Point &  p 
) [inline]

Scale a point.

Returns:
Point at (p.x + p.w*v.x, p.y + p.w*v.y, p.z + p.w*v.z).

Definition at line 2479 of file cugl.h.

References cugl::Point::Point(), cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.

Point cugl::operator * ( const Point &  p,
GLfloat  s 
) [inline]

Scale a point.

Returns:
Point at (p.x + p.w*v.x, p.y + p.w*v.y, p.z + p.w*v.z).

Definition at line 2474 of file cugl.h.

References cugl::Point::Point(), cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.

bool cugl::operator!= ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Compare two quaternions. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2967 of file cugl.h.

bool cugl::operator!= ( const Matrix &  m,
const Matrix &  n 
) [inline]

Compare two matrices. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2798 of file cugl.h.

References cugl::Matrix::m.

bool cugl::operator!= ( const Vector &  u,
const Vector &  v 
) [inline]

Compare two vectors. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2697 of file cugl.h.

bool cugl::operator!= ( const Plane &  p,
const Plane &  q 
) [inline]

Compare two planes. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2543 of file cugl.h.

bool cugl::operator!= ( const Line &  m,
const Line &  n 
) [inline]

Compare two lines. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2522 of file cugl.h.

bool cugl::operator!= ( const Point &  p,
const Point &  q 
) [inline]

Compare two points. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2489 of file cugl.h.

Quaternion cugl::operator+ ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Return the quaternion q+r.

Note:
The sum of two unit quaternions is not in general a unit quaternion. However, it occasionally appears in expressions such as k q1 + (1 - k) q2, which does yield a unit quaternion.
Returns:
the Quaternion q+r.

Definition at line 2883 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Vector cugl::operator+ ( const Vector &  u,
const Vector &  v 
) [inline]

Return Vector u+v.

Definition at line 2651 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Point cugl::operator+ ( const Vector &  v,
const Point &  p 
) [inline]

Displace a Point with a Vector.

Returns:
Point at (p.x+p.w*v.x, p.y+p.w*v.y, p.z+p.w*v.z, p.w).

Definition at line 2469 of file cugl.h.

References cugl::Point::Point(), cugl::Point::w, cugl::Vector::x, cugl::Point::x, cugl::Vector::y, cugl::Point::y, cugl::Vector::z, and cugl::Point::z.

Point cugl::operator+ ( const Point &  p,
const Vector &  v 
) [inline]

Displace a Point with a Vector.

Returns:
Point at (p.x+p.w*v.x, p.y+p.w*v.y, p.z+p.w*v.z, p.w).

Definition at line 2464 of file cugl.h.

References cugl::Point::Point(), cugl::Point::w, cugl::Vector::x, cugl::Point::x, cugl::Vector::y, cugl::Point::y, cugl::Vector::z, and cugl::Point::z.

Quaternion cugl::operator- ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Return the quaternion q-r.

Note:
The difference of two unit quaternions is not in general a unit quaternion.
Returns:
the Quaternion q-r.

Definition at line 2888 of file cugl.h.

References cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

Vector cugl::operator- ( const Vector &  u,
const Vector &  v 
) [inline]

Return Vector u-v.

Definition at line 2656 of file cugl.h.

References cugl::Vector::Vector(), cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

Vector cugl::operator- ( const Point &  p,
const Point &  q 
) [inline]

Return the vector corresponding to the displacement between the two points. This is the vector (p.x/p.w - q.x/q.w, p.y/p.w - q.y/q.w, p.z/p.w - q.z/q.w). If p or q is a point at infinity, return the zero vector.

Returns:
the Vector corresponding to the displacement between the two points.

Definition at line 2643 of file cugl.h.

References cugl::Vector::Vector(), cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.

Quaternion cugl::operator/ ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Return the quaternion ratio q/r. If q and r represent rotations, then q/r represents the rotation q followed by the rotation that is the inverse of r.

Returns:
the Quaternion ratio q/r.

Definition at line 2926 of file cugl.h.

References cugl::Quaternion::norm(), cugl::Quaternion::Quaternion(), cugl::Quaternion::s, and cugl::Quaternion::v.

bool cugl::operator== ( const Quaternion &  q,
const Quaternion &  r 
) [inline]

Compare two quaternions. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2962 of file cugl.h.

References cugl::Quaternion::s, and cugl::Quaternion::v.

bool cugl::operator== ( const Matrix &  m,
const Matrix &  n 
) [inline]

Compare two matrices. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2789 of file cugl.h.

References cugl::Matrix::m.

bool cugl::operator== ( const Vector &  u,
const Vector &  v 
) [inline]

Compare two vectors. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2692 of file cugl.h.

References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.

bool cugl::operator== ( const Plane &  p,
const Plane &  q 
) [inline]

Compare two planes. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2538 of file cugl.h.

References cugl::Plane::a, cugl::Plane::b, cugl::Plane::c, and cugl::Plane::d.

bool cugl::operator== ( const Line &  m,
const Line &  n 
) [inline]

Compare two lines. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2517 of file cugl.h.

References cugl::Line::f, and cugl::Line::s.

bool cugl::operator== ( const Point &  p,
const Point &  q 
) [inline]

Compare two points. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2484 of file cugl.h.

References cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.


Variable Documentation

const Vector cugl::I(1, 0, 0)

Unit vector parallel to X axis.

const Vector cugl::J(0, 1, 0)

Unit vector parallel to Y axis.

const Vector cugl::K(0, 0, 1)

Unit vector parallel to Z axis.

const double cugl::PI = 4 * atan(1.0)

A well-known mathematical constant.

Definition at line 48 of file cugl.h.

Referenced by degrees(), and radians().

const char cugl::version[] = "CUGL V1 2003.12.25"

Indicates version and last compile date.

Definition at line 43 of file cugl.h.


Generated on Wed Sep 12 14:31:41 2007 for CUGL by  doxygen 1.5.2