#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 | |
CLUquaternion * | cluNewQuaternion (GLvoid) |
CLUplane * | cluNewPlane (GLvoid) |
CLUsphere * | cluNewSphere (GLvoid) |
CLUcone * | cluNewCone (GLvoid) |
CLUray * | cluNewRay (GLvoid) |
CLUalignedbox * | cluNewAlignedBox (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) |
CLUquaternion * | cluCopyQuaternion (CLUquaternion *dest, const CLUquaternion *src) |
CLUplane * | cluCopyPlane (CLUplane *dest, const CLUplane *src) |
CLUsphere * | cluCopySphere (CLUsphere *dest, const CLUsphere *src) |
CLUcone * | cluCopyCone (CLUcone *dest, const CLUcone *src) |
CLUray * | cluCopyRay (CLUray *dest, const CLUray *src) |
CLUalignedbox * | cluCopyAlignedBox (CLUalignedbox *dest, const CLUalignedbox *src) |
CLUquaternion * | cluDefaultQuaternion (CLUquaternion *quaternion) |
CLUplane * | cluDefaultPlane (CLUplane *plane) |
CLUsphere * | cluDefaultSphere (CLUsphere *sphere) |
CLUcone * | cluDefaultCone (CLUcone *cone) |
CLUray * | cluDefaultRay (CLUray *ray) |
CLUalignedbox * | cluDefaultAlignedBox (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) |
CLUquaternion * | cluSetQuaternion (CLUquaternion *quaternion, GLfloat x, GLfloat y, GLfloat z, GLfloat w) |
CLUplane * | cluSetPlane (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) |
CLUquaternion * | cluSetQuaternionAxisAngle (CLUquaternion *quaternion, const CLnormal *axis, GLfloat angle) |
CLUquaternion * | cluSetQuaternionMatrix (CLUquaternion *quaternion, const CLmatrix *matrix) |
CLUplane * | cluSetPlaneVertexNormal (CLUplane *plane, const CLvertex *vertex, const CLnormal *normal) |
CLUplane * | cluSetPlaneTriangle (CLUplane *plane, const CLvertex *vertex0, const CLvertex *vertex1, const CLvertex *vertex2) |
CLUfrustum * | cluSetFrustumModelviewProjection (CLUfrustum *frustum, const CLmatrix *modelview, const CLmatrix *projection) |
CLUsphere * | cluSetSphereVertices (CLUsphere *sphere, unsigned int num_vertices, const CLvertex *vertices) |
CLUsphere * | cluSetSphereMesh (CLUsphere *sphere, const CLmesh *mesh) |
CLUsphere * | cluSetSphereModel (CLUsphere *sphere, const CLmodel *model) |
CLUcone * | cluSetConeSphereVertex (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. | |
CLUray * | cluSetRay (CLUray *ray, GLfloat x, GLfloat y, GLfloat z, GLfloat i, GLfloat j, GLfloat k) |
CLUalignedbox * | cluSetAlignedBox (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) |
CLUquaternion * | cluQuaternionAdd (CLUquaternion *qf, const CLUquaternion *q) |
CLUquaternion * | cluQuaternionSubtract (CLUquaternion *qf, const CLUquaternion *q) |
CLUquaternion * | cluQuaternionScale (CLUquaternion *qf, GLfloat s) |
CLUquaternion * | cluQuaternionPower (CLUquaternion *qf, GLfloat n) |
GLfloat | cluQuaternionDotProduct (const CLUquaternion *q0, const CLUquaternion *q1) |
CLUquaternion * | cluQuaternionMultiply (CLUquaternion *qf, const CLUquaternion *q) |
CLUquaternion * | cluQuaternionNormalise (CLUquaternion *qf) |
GLfloat | cluQuaternionMagnitude (const CLUquaternion *q) |
GLfloat | cluQuaternionAngle (const CLUquaternion *q) |
CLUquaternion * | cluQuaternionConjugate (CLUquaternion *qf) |
CLUquaternion * | cluQuaternionInvert (CLUquaternion *qf) |
GLboolean | cluQuaternionEquals (const CLUquaternion *q0, const CLUquaternion *q1, GLfloat threshold) |
CLUplane * | cluPlaneNormalise (CLUplane *plane) |
CLUplane * | cluPlaneTransform (CLUplane *pf, const CLmatrix *m) |
CLUray * | cluRayTransform (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. | |
CLUray * | cluSetRayOriginDestination (CLUray *ray, CLvertex *origin, CLvertex *destination) |
Sets the value of a given ray based on the supplied origin and destination. | |
CLUsphere * | cluSphereAddSphere (CLUsphere *sf, const CLUsphere *s0, const CLUsphere *s1) |
CLUcone * | cluConeAddCone (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) |
Definition in file clu.h.