CUGL
2.0
|
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 () |
const Vector | I (1, 0, 0) |
const Vector | J (0, 1, 0) |
const Vector | K (0, 0, 1) |
double | radians (double angle) |
double | degrees (double angle) |
double | sqr (double x) |
unsigned int | randInt (unsigned int max) |
int | randSym (unsigned int max) |
double | randReal () |
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) |
Matrix | operator- (const Matrix &m, const Matrix &n) |
Matrix | operator* (const Matrix &m, const Matrix &n) |
bool | operator== (const Matrix &m, const Matrix &n) |
bool | operator!= (const Matrix &m, const Matrix &n) |
Matrix | operator* (GLfloat s, const Matrix &m) |
Matrix | operator* (const Matrix &m, GLfloat s) |
Matrix | operator/ (const Matrix &m, GLfloat s) |
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, 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 V2 2009.11.24" |
const double | PI = 4 * atan(1.0) |
Extensions
Quaternion += and -=
Matrix operator*=(Matrix) - done
bool isVisible(Point) - harder than it looks
typedef GLfloat cugl::GL_Matrix[4][4] |
typedef GLfloat* cugl::GLfloatArray |
|
inline |
Return cross product of vectors u
and v
.
Definition at line 2859 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
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 2673 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.
|
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 2678 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.
|
inline |
Return dot product of vectors u
and v
.
Definition at line 2875 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
Referenced by dot().
|
inline |
The 'logarithm' of a unit quaternion is a vector. This function is defined because it appears in descriptions of quaternions. Although the name 'ln' is appropriate in some ways, this function must be used with caution because it may not have the properties you expect of a logarithm. For example, ln(q1)+ln(q2) makes sense only if q1 and q2 have the same axis.
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. q
and r
. Definition at line 3219 of file cugl.h.
References dot(), cugl::Quaternion::s, and cugl::Quaternion::v.
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Scale a point.
Definition at line 2653 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.
|
inline |
Scale a point. Multiply each of the components of the Point by s. In homogeneous coordinates, this operation does not change the ``position'' of the Point. However, it may be used, for example, to normalize a Point.
Definition at line 2658 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.
|
inline |
Return Vector s*v.
Definition at line 2849 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
Return Vector s*v.
Definition at line 2854 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
Return cross product of vectors u
and v
.
Definition at line 2867 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
|
inline |
|
inline |
|
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.
Definition at line 3234 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
Promote the vector v to a quaternion qv and return the quaternion product qv*q.
Definition at line 3245 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
Promote the vector v to a quaternion qv and return the quaternion product q*qv.
Definition at line 3256 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
Return the quaternion a*q, where a is a scalar. a is a scalar and a*(s,v) = (a*s, a*v).
Definition at line 3281 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
Return the quaternion a*q, where a is a scalar. a is a scalar and a*(s,v) = (a*s, a*v).
Definition at line 3286 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
Displace a Point with a Vector. The components of the Vector are added to the corresponding components of the Point. If the Point is not in normal form, the Vector is implicitly scaled.
Definition at line 2643 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Vector::x, cugl::Point::y, cugl::Vector::y, cugl::Point::z, and cugl::Vector::z.
|
inline |
Displace a Point with a Vector. The components of the Vector are added to the corresponding components of the Point. If the Point is not in normal form, the Vector is implicitly scaled.
Definition at line 2648 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Vector::x, cugl::Point::y, cugl::Vector::y, cugl::Point::z, and cugl::Vector::z.
|
inline |
Return Vector u+v.
Definition at line 2839 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
|
inline |
Return the quaternion q+r.
Definition at line 3224 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
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.
Definition at line 2831 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.
|
inline |
Return Vector u-v.
Definition at line 2844 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
|
inline |
Return the quaternion q-r.
Definition at line 3229 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.
|
inline |
|
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 2663 of file cugl.h.
References cugl::Point::w, cugl::Point::x, cugl::Point::y, and cugl::Point::z.
|
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 2696 of file cugl.h.
References cugl::Line::f, and cugl::Line::s.
|
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 2717 of file cugl.h.
References cugl::Plane::a, cugl::Plane::b, cugl::Plane::c, and cugl::Plane::d.
|
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 2880 of file cugl.h.
References cugl::Vector::x, cugl::Vector::y, and cugl::Vector::z.
|
inline |
|
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 3291 of file cugl.h.
References cugl::Quaternion::s, and cugl::Quaternion::v.