cluSet functions (complex)
[Standard functions]

Standard functions to automatically set variables in CL and CLU structs (often given some meaningful input data). More...

Functions

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)

Detailed Description

Functions of the form:

  [CL|CLU][name] cluSet[Name]Description(const [CL|CLU][name]* name, ...)
  

set some variables within the input struct. These functions may have descriptive names that indicate how they will condition the struct. For example, the function header for setting an image to the current OpenGL colour-buffer is:

  CLimage* cluSetImageColorBuffer(CLimage* image);
  

The arguments of these functions may also provide some other data that indicates how to set the variables. For example, the function prototype for setting a plane given a point on the plane and the plane normal is:

  CLUplane* cluSetPlanePointNormal(CLUplane* plane,
				   const CLvertex* point,
				   const CLnormal* normal);
  

Function Documentation

CLUcone* cluSetConeSphereVertex CLUcone cone,
const CLUsphere sphere,
const CLvertex *  vertex
 

Parameters:
cone The cone to set.
vertex The vertex at which the cone is to originate.
sphere The sphere that should be encompassed by the cone, this defines the cone direction and half_angle.
Returns:
A pointer to the completed CLUcone.
Note:
Coded using math from http://mathworld.wolfram.com/CircleTangentLine.html
Todo:
Move to cluset.c
Todo:
Comment.
Todo:
Eliminate divide by zero possibility?

Definition at line 767 of file cluset.c.

References cluNormalDifference(), cluNormalNormalise(), cluVertexDistance(), CLUcone::direction, CLUcone::half_angle, CLUsphere::origin, CLUcone::origin, and CLUsphere::radius.

Referenced by cluConeIntersectSphere().


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