clu.h File Reference

This header file contains defines, typedefs, structs, and function headers for CLU. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <cl.h>

Go to the source code of this file.

Data Structures

struct  CLUquaternion
 Defines a quaternion (x, y, z, w). More...
struct  CLUplane
 Defines a plane (a, b, c, d). More...
struct  CLUfrustum
 Defines a frustum. More...
struct  CLUsphere
 Defines a sphere (origin, radius). More...
struct  CLUcone
 Defines a cone (origin, direction, angle). More...
struct  CLUray
struct  CLUalignedbox
 Defines a axis aligned box (min, max). More...

Defines

#define CLU_VERSION   1.0

Typedefs

typedef CLUquaternion CLUquaternion
typedef CLUplane CLUplane
typedef CLUfrustum CLUfrustum
typedef CLUsphere CLUsphere
typedef CLUcone CLUcone
typedef CLUray CLUray
typedef CLUalignedbox CLUalignedbox

Functions

CLUquaternioncluNewQuaternion (GLvoid)
CLUplanecluNewPlane (GLvoid)
CLUspherecluNewSphere (GLvoid)
CLUconecluNewCone (GLvoid)
CLUraycluNewRay (GLvoid)
CLUalignedboxcluNewAlignedBox (GLvoid)
GLvoid cluDeleteQuaternion (CLUquaternion *quaternion)
GLvoid cluDeletePlane (CLUplane *plane)
GLvoid cluDeleteSphere (CLUsphere *sphere)
GLvoid cluDeleteCone (CLUcone *cone)
GLvoid cluDeleteRay (CLUray *ray)
GLvoid cluDeleteAlignedBox (CLUalignedbox *box)
CLUquaternioncluCopyQuaternion (CLUquaternion *dest, const CLUquaternion *src)
CLUplanecluCopyPlane (CLUplane *dest, const CLUplane *src)
CLUspherecluCopySphere (CLUsphere *dest, const CLUsphere *src)
CLUconecluCopyCone (CLUcone *dest, const CLUcone *src)
CLUraycluCopyRay (CLUray *dest, const CLUray *src)
CLUalignedboxcluCopyAlignedBox (CLUalignedbox *dest, const CLUalignedbox *src)
CLUquaternioncluDefaultQuaternion (CLUquaternion *quaternion)
CLUplanecluDefaultPlane (CLUplane *plane)
CLUspherecluDefaultSphere (CLUsphere *sphere)
CLUconecluDefaultCone (CLUcone *cone)
CLUraycluDefaultRay (CLUray *ray)
CLUalignedboxcluDefaultAlignedBox (CLUalignedbox *box)
GLboolean cluWriteQuaternion (const CLUquaternion *src, FILE *file)
GLboolean cluWritePlane (const CLUplane *src, FILE *file)
GLboolean cluWriteSphere (const CLUsphere *src, FILE *file)
GLboolean cluWriteCone (const CLUcone *src, FILE *file)
GLboolean cluWriteRay (const CLUray *src, FILE *file)
GLboolean cluWriteAlignedBox (const CLUalignedbox *src, FILE *file)
GLboolean cluReadQuaternion (CLUquaternion *dest, FILE *file)
GLboolean cluReadPlane (CLUplane *dest, FILE *file)
GLboolean cluReadSphere (CLUsphere *dest, FILE *file)
GLboolean cluReadCone (CLUcone *dest, FILE *file)
GLboolean cluReadRay (CLUray *dest, FILE *file)
GLboolean cluReadAlignedBox (CLUalignedbox *dest, FILE *file)
GLboolean cluPrintQuaternion (const CLUquaternion *quaternion)
GLboolean cluPrintPlane (const CLUplane *plane)
GLboolean cluPrintSphere (const CLUsphere *sphere)
GLboolean cluPrintCone (const CLUcone *cone)
GLboolean cluPrintRay (const CLUray *ray)
GLboolean cluPrintAlignedBox (const CLUalignedbox *box)
CLcolour * cluSetColour (CLcolour *colour, GLfloat r, GLfloat g, GLfloat b, GLfloat a)
CLvertex * cluSetVertex (CLvertex *vertex, GLfloat x, GLfloat y, GLfloat z)
CLnormal * cluSetNormal (CLnormal *normal, GLfloat i, GLfloat j, GLfloat k)
CLtexcoord * cluSetTexCoord (CLtexcoord *texcoord, GLfloat s, GLfloat t)
CLedgeflag * cluSetEdgeFlag (CLedgeflag *edgeflag, GLboolean b)
CLmatrix * cluSetMatrix (CLmatrix *matrix, GLfloat m00, GLfloat m01, GLfloat m02, GLfloat m03, GLfloat m10, GLfloat m11, GLfloat m12, GLfloat m13, GLfloat m20, GLfloat m21, GLfloat m22, GLfloat m23, GLfloat m30, GLfloat m31, GLfloat m32, GLfloat m33)
CLUquaternioncluSetQuaternion (CLUquaternion *quaternion, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
CLUplanecluSetPlane (CLUplane *plane, GLfloat a, GLfloat b, GLfloat c, GLfloat d)
CLmatrix * cluSetMatrixAxesOrigin (CLmatrix *matrix, const CLnormal *axis_x, const CLnormal *axis_y, const CLnormal *axis_z, const CLvertex *origin)
CLvertex * cluSetVertexMatrixOrigin (CLvertex *vertex, const CLmatrix *matrix)
CLvertex * cluSetVertexRayDistance (CLvertex *vf, const CLUray *ray, float t)
CLnormal * cluSetNormalMatrixAxisX (CLnormal *normal, const CLmatrix *matrix)
CLnormal * cluSetNormalMatrixAxisY (CLnormal *normal, const CLmatrix *matrix)
CLnormal * cluSetNormalMatrixAxisZ (CLnormal *normal, const CLmatrix *matrix)
CLnormal * cluSetNormalPlane (CLnormal *normal, const CLUplane *plane)
CLnormal * cluSetNormalQuaternionAxis (CLnormal *normal, const CLUquaternion *quaternion)
CLnormal * cluSetNormalTriangle (CLnormal *normal, const CLvertex *vertex0, const CLvertex *vertex1, const CLvertex *vertex2)
CLmatrix * cluSetMatrixOrientation (CLmatrix *matrix, const CLUquaternion *orientation)
CLmatrix * cluSetMatrixPosition (CLmatrix *matrix, const CLvertex *position)
CLimage * cluSetImageChessBoard (CLimage *image)
CLimage * cluSetImageColorBuffer (CLimage *image)
CLlight * cluSetLightSubtle (CLlight *light)
CLlight * cluSetLightPoint (CLlight *light, const CLvertex *pos)
CLlight * cluSetLightDirectional (CLlight *light, const CLnormal *dir)
CLlight * cluSetLightSpotLight (CLlight *light, const CLvertex *pos, const CLnormal *dir, GLfloat cutoff)
CLtexture * cluSetTextureImage (CLtexture *texture, const CLimage *image)
CLUquaternioncluSetQuaternionAxisAngle (CLUquaternion *quaternion, const CLnormal *axis, GLfloat angle)
CLUquaternioncluSetQuaternionMatrix (CLUquaternion *quaternion, const CLmatrix *matrix)
CLUplanecluSetPlaneVertexNormal (CLUplane *plane, const CLvertex *vertex, const CLnormal *normal)
CLUplanecluSetPlaneTriangle (CLUplane *plane, const CLvertex *vertex0, const CLvertex *vertex1, const CLvertex *vertex2)
CLUfrustumcluSetFrustumModelviewProjection (CLUfrustum *frustum, const CLmatrix *modelview, const CLmatrix *projection)
CLUspherecluSetSphereVertices (CLUsphere *sphere, unsigned int num_vertices, const CLvertex *vertices)
CLUspherecluSetSphereMesh (CLUsphere *sphere, const CLmesh *mesh)
CLUspherecluSetSphereModel (CLUsphere *sphere, const CLmodel *model)
CLUconecluSetConeSphereVertex (CLUcone *cone, const CLUsphere *sphere, const CLvertex *vertex)
 Setup a cone originating at the given vertex and exactly large enough to encompass the given sphere.
CLUraycluSetRay (CLUray *ray, GLfloat x, GLfloat y, GLfloat z, GLfloat i, GLfloat j, GLfloat k)
CLUalignedboxcluSetAlignedBox (CLUalignedbox *box, CLvertex *min, CLvertex *max)
CLvertex * cluVertexAdd (CLvertex *vf, const CLnormal *n)
CLvertex * cluVertexSubtract (CLvertex *vf, const CLnormal *n)
CLvertex * cluVertexTransform (CLvertex *vf, const CLmatrix *m)
GLfloat cluVertexDifference (CLvertex *v0, CLvertex *v1)
CLnormal * cluNormalAdd (CLnormal *nf, const CLnormal *n)
CLnormal * cluNormalSubtract (CLnormal *nf, const CLnormal *n)
CLnormal * cluNormalScale (CLnormal *nf, GLfloat s)
CLnormal * cluNormalTransform (CLnormal *nf, const CLmatrix *m)
CLnormal * cluNormalNormalise (CLnormal *nf)
GLfloat cluNormalMagnitude (const CLnormal *n)
CLnormal * cluNormalDifference (CLnormal *nf, const CLvertex *v0, const CLvertex *v1)
GLfloat cluNormalDotProduct (const CLnormal *n0, const CLnormal *n1)
CLnormal * cluNormalCrossProduct (CLnormal *nf, const CLnormal *n0, const CLnormal *n1)
CLmatrix * cluMatrixTranslate (CLmatrix *mf, const CLnormal *n)
CLmatrix * cluMatrixTransform (CLmatrix *mf, const CLmatrix *m)
CLmatrix * cluMatrixInvert (CLmatrix *mf)
CLUquaternioncluQuaternionAdd (CLUquaternion *qf, const CLUquaternion *q)
CLUquaternioncluQuaternionSubtract (CLUquaternion *qf, const CLUquaternion *q)
CLUquaternioncluQuaternionScale (CLUquaternion *qf, GLfloat s)
CLUquaternioncluQuaternionPower (CLUquaternion *qf, GLfloat n)
GLfloat cluQuaternionDotProduct (const CLUquaternion *q0, const CLUquaternion *q1)
CLUquaternioncluQuaternionMultiply (CLUquaternion *qf, const CLUquaternion *q)
CLUquaternioncluQuaternionNormalise (CLUquaternion *qf)
GLfloat cluQuaternionMagnitude (const CLUquaternion *q)
GLfloat cluQuaternionAngle (const CLUquaternion *q)
CLUquaternioncluQuaternionConjugate (CLUquaternion *qf)
CLUquaternioncluQuaternionInvert (CLUquaternion *qf)
GLboolean cluQuaternionEquals (const CLUquaternion *q0, const CLUquaternion *q1, GLfloat threshold)
CLUplanecluPlaneNormalise (CLUplane *plane)
CLUplanecluPlaneTransform (CLUplane *pf, const CLmatrix *m)
CLUraycluRayTransform (CLUray *ray, const CLmatrix *matrix)
GLfloat cluAlignedBoxWidth (const CLUalignedbox *box)
GLfloat cluAlginedBoxHeight (const CLUalignedbox *box)
GLfloat cluAlginedBoxDepth (const CLUalignedbox *box)
CLvertex * cluAlignedBoxOrigin (CLvertex *v, const CLUalignedbox *box)
GLfloat cluVertexDistance (const CLvertex *v0, const CLvertex *v1)
GLfloat cluPlaneDistance (const CLUplane *plane, const CLvertex *v)
GLfloat cluSphereDistance (const CLUsphere *sphere, const CLvertex *v)
GLfloat cluSphereDistanceSphere (const CLUsphere *sphere0, const CLUsphere *sphere1)
GLboolean cluPlaneIntersect (const CLUplane *plane, const CLvertex *vertex)
GLboolean cluPlaneIntersectSphere (const CLUplane *plane, const CLUsphere *sphere)
GLboolean cluFrustumIntercept (const CLUfrustum *frustum, const CLvertex *vertex)
GLboolean cluFrustumInterceptSphere (const CLUfrustum *frustum, const CLUsphere *sphere)
GLboolean cluSphereIntersect (const CLUsphere *sphere, const CLvertex *vertex)
GLboolean cluSphereIntersectSphere (const CLUsphere *sphere0, const CLUsphere *sphere1)
GLboolean cluConeIntersect (const CLUcone *cone, const CLvertex *vertex)
GLboolean cluConeIntersectSphere (const CLUcone *cone, const CLUsphere *sphere)
bool cluRayIntersectSphere (float *t, const CLUray *ray, const CLUsphere *sphere)
 Calculates the intersection of a ray and a sphere.
bool cluRayIntersectTriangle (CLvertex *result, const CLUray *ray, const CLvertex *v0, const CLvertex *v1, const CLvertex *v2)
 Calculates the intersection between a ray and a triangle.
CLvertex * cluSetVertexRayT (CLvertex *vf, const CLUray *ray, float t)
 Sets the given vertex to a value calculated by a ray and offset (t) along the ray.
CLUraycluSetRayOriginDestination (CLUray *ray, CLvertex *origin, CLvertex *destination)
 Sets the value of a given ray based on the supplied origin and destination.
CLUspherecluSphereAddSphere (CLUsphere *sf, const CLUsphere *s0, const CLUsphere *s1)
CLUconecluConeAddCone (CLUcone *cf, const CLUcone *c0, const CLUcone *c1)
float cluSphereVolume (const CLUsphere *sphere)
float cluConeVolume (const CLUcone *cone)
GLuint cluMeshAddVertex (CLmesh *mesh, const CLvertex *vertex, const CLcolour *colour, const CLnormal *normal, const CLtexcoord *texcoord, const CLedgeflag *edgeflag)
GLboolean cluMeshRemoveVertex (CLmesh *mesh, GLuint index)
CLmesh * cluMeshGenerateNormals (CLmesh *mesh)
CLmesh * cluMeshRemoveUnusedVertices (CLmesh *mesh)
GLfloat cluMeshWidth (CLmesh *mesh)
GLfloat cluMeshHeight (CLmesh *mesh)
GLfloat cluMeshDepth (CLmesh *mesh)
CLvertex * cluMeshLocalOrigin (CLvertex *v, const CLmesh *mesh)
CLmesh * cluMeshCentre (CLmesh *mesh)
CLmesh * cluMeshSetOrigin (CLmesh *mesh, const CLvertex *v)
CLmesh * cluMeshScale (CLmesh *mesh, GLfloat scale)
CLmesh * cluMeshScaleUnitCube (CLmesh *mesh)
CLmesh * cluMeshResize (CLmesh *mesh, GLfloat sx, GLfloat sy, GLfloat sz)
GLvoid cluMeshMergePrimitiveSets (CLmesh *mesh)
CLmodel * cluModelGenerateNormals (CLmodel *model)
CLmodel * cluModelRemoveUnusedVertices (CLmodel *model)
GLfloat cluModelWidth (CLmodel *model)
GLfloat cluModelHeight (CLmodel *model)
GLfloat cluModelDepth (CLmodel *model)
CLvertex * cluModelLocalOrigin (CLvertex *v, const CLmodel *model)
CLmodel * cluModelCentre (CLmodel *model)
CLmodel * cluModelSetOrigin (CLmodel *model, const CLvertex *v)
CLmodel * cluModelScale (CLmodel *model, GLfloat scale)
CLmodel * cluModelScaleUnitCube (CLmodel *model)
CLmodel * cluModelResize (CLmodel *model, GLfloat sx, GLfloat sy, GLfloat sz)
CLmodel * cluModelMergeMeshes (CLmodel *model)
 Takes a model with many meshes and merges it together into a model with one mesh and many primitive sets.
CLcolour * cluColourGeneratePalette (unsigned int red_separation, unsigned int green_separation, unsigned int blue_separation)
 Generates an array of CLcolour (somewhat) evenly distrubuted throughout the colour spectrum.
GLvoid cluRenderMesh (CLmesh *mesh)
GLvoid cluRenderModel (CLmodel *model)


Detailed Description

This header file contains defines, typedes, structs, and function headers for CLU.

Definition in file clu.h.


Generated on Thu Dec 27 13:53:42 2007 for CLU by  doxygen 1.4.6