cluprint.c

00001 #include <clu.h>
00002 
00003 #define _CLU_PRINTF(...) \
00004                   do { \
00005                     if (printf(__VA_ARGS__) < 0) \
00006                       return GL_FALSE; \
00007                   } while(0) 
00008 
00009 GLboolean cluPrintQuaternion(const CLUquaternion* quaternion)
00010 {
00011   _CLU_PRINTF("CLUquaternion{x = %f, y = %f, z = %f, w = %f}\n", 
00012              quaternion->x, quaternion->y, quaternion->z, quaternion->w);
00013   
00014   return GL_TRUE;
00015 }
00016 
00017 GLboolean cluPrintPlane(const CLUplane* plane)
00018 {
00019   _CLU_PRINTF("CLUplane{a = %f, b = %f, c = %f, d = %f}\n", 
00020              plane->a, plane->b, plane->c, plane->d);
00021   
00022   return GL_TRUE;
00023 }
00024 
00025 GLboolean cluPrintSphere(const CLUsphere* sphere)
00026 {
00027   _CLU_PRINTF("CLUsphere\n{\n");
00028 
00029   _CLU_PRINTF("origin = ");
00030   if (!(clPrintVertex(&sphere->origin)))
00031     return GL_FALSE;
00032 
00033   _CLU_PRINTF("radius = %f\n}\n", sphere->radius);
00034 
00035   return GL_TRUE;
00036 }
00037 
00038 GLboolean cluPrintCone(const CLUcone* cone)
00039 {
00040   _CLU_PRINTF("CLUcone\n{\n");
00041 
00042   _CLU_PRINTF("origin = ");
00043   if (!(clPrintVertex(&cone->origin)))
00044     return GL_FALSE;
00045   
00046   _CLU_PRINTF("direction = ");
00047   if (!(clPrintNormal(&cone->direction)))
00048     return GL_FALSE;
00049   
00050   _CLU_PRINTF("half_angle = %f\n}\n", cone->half_angle);
00051 
00052   return GL_TRUE;
00053 }
00054 
00055 GLboolean cluPrintRay(const CLUray* ray)
00056 {
00057   _CLU_PRINTF("CLUray\n{\n");
00058 
00059   _CLU_PRINTF("origin = ");
00060   if (!(clPrintVertex(&ray->origin)))
00061     return GL_FALSE;
00062   
00063   _CLU_PRINTF("direction = ");
00064   if (!(clPrintNormal(&ray->direction)))
00065     return GL_FALSE;
00066   
00067   return GL_TRUE;
00068 }
00069 
00070 GLboolean cluPrintAlignedBox(const CLUalignedbox* box)
00071 {
00072   _CLU_PRINTF("CLUalignedbox\n{\n");
00073 
00074   _CLU_PRINTF("min = ");
00075   if (!(clPrintVertex(&box->min)))
00076     return GL_FALSE;
00077 
00078   _CLU_PRINTF("max = ");
00079   if (!(clPrintVertex(&box->max)))
00080     return GL_FALSE;
00081   
00082   return GL_TRUE;
00083 }

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