Biomechanical Joint Model
 Author: Anderson Maciel

VCOLLIDE/demos/rings/quatlib/quat.h

Go to the documentation of this file.
00001 
00002 /* prevent multiple includes    */
00003 #ifndef Q_INCLUDED
00004 #define Q_INCLUDED
00005 
00006 
00007 /*****************************************************************************
00008  *
00009     quat.h -  include file for quaternion, vector and matrix routines.  
00010 
00011     
00012     Overview:
00013     
00014         quatlib is a library of routines that implements a grab-bag of 
00015         useful routines for dealing with quaternions, vectors, and 
00016         matrices.  See the quatlib man page for an overview.
00017 
00018 
00019     Notes:
00020 
00021       - to address the quaternion elements, use the Q_X, Q_Y, Q_Z and Q_W
00022         #defines from this file, or X,Y,Z,W from pphigs.h, although the
00023         latter is not guaranteed to work forever.
00024       
00025       - to find out which version of the library you're using, do:
00026             
00027             % ident  <path>/libquat.a
00028         
00029         (this information is in the rcsid string in quat.c)
00030     
00031       - see /afs/unc/proj/hmd/src/quat/{quat,vector,matrix}.c 
00032         for implementation details.
00033 
00034 
00035     Conventions:
00036 
00037       - general-purpose quaternion routines start with q_
00038 
00039       - pphigs-specific routines start with qp_ and expect data
00040            types as defined in pphigs.h (vectors are currently 
00041            arrays of floats)
00042 
00043       - all non-integer values are doubles by default-  the exceptions
00044         to this are routines dealing with PPHIGS vectors and matrices,
00045         which use floats.
00046       
00047       - vector routines have the string "vec" somewhere in their name
00048       
00049       - matrix routines have the string "matrix" somewhere in their name
00050 
00051       - all matrices are 4x4 unless otherwise noted by qp_ prefix
00052 
00053       - positive rotation directions are as follows:
00054 
00055                 about Z axis: from X axis to Y axis
00056                 about X axis: from Y axis to Z axis
00057                 about Y axis: from Z axis to X axis
00058 
00059       - all angles are specified in radians
00060 
00061       - destination parameter (if any) is always first argument (as in
00062             Unix string routines)
00063 
00064       - src and dest parameters can always be the same, as long as they 
00065             are of the same type (copying is done if necessary) 
00066 
00067       - naming conventions for conversion routines:
00068       
00069             q{p}_{to,from}_whatever for routines involving quaternions
00070             q{p}_x_to_y for all others (ie., no "from" is used)
00071 
00072 
00073    RCS Header:
00074    $Id: quat.h,v 2.27 1997/01/09 23:08:07 livingst Exp $
00075    
00076    Revision History (for whole library, not just this file):
00077 
00078    Author               Date      Comments
00079    ------               --------  ----------------------------
00080    Mark Livingston      01/09/96   Added routines for OpenGL matrices
00081    Rich Holloway        09/27/93   Added Gary Bishop's matrix to euler rtn
00082    Rich Holloway        07/16/92   Added q_euler_to_col_matrix(), routines
00083                                     for working with GL matrices, added
00084                                     documentation for euler angle routines
00085    Erik Erikson/        06/26/92   Added q_xyz_quat_compose
00086    Stefan Gottschalk/
00087    Russ Taylor
00088    Rich Holloway        05/13/92   Added Q_NULL_VECTOR, Q_ID_MATRIX
00089    Jon Leech/           04/29/92   Added CM_ prototypes
00090    Erik Erikson
00091    
00092    Rich Holloway        09/21/90   Made into library, made all matrices 4x4,
00093                                     added matrix routines for 
00094                                     4x4 (standard) or 3x4 (for PPHIGS),
00095                                     changed names of 
00096                                     routines (to avoid name conflicts with
00097                                     non-library routines) by prefixing
00098                                     everything with "q_".
00099    
00100    Russ Taylor           1990      Modified q_slerp to pick shortest path
00101                                     between two angles
00102    
00103    Warren Robinett      12/89      Added PPHIGS support routines
00104    
00105    Ken Shoemake          1985      Initial version
00106  
00107  *
00108  *****************************************************************************/
00109 
00110 
00111 #include <stdio.h>
00112 #include <math.h>
00113 #include <cm_macros.h>
00114 #include <pdefs.h>
00115 
00116 /*****************************************************************************
00117  *
00118     #defines
00119  *
00120  *****************************************************************************/
00121 
00122 /* for accessing the elements of q_type and q_vec_type  */
00123 #define Q_X     0
00124 #define Q_Y     1
00125 #define Q_Z     2
00126 #define Q_W     3
00127 
00128 /* tolerance for quaternion operations  */
00129 #define Q_EPSILON   (1e-10)
00130 
00131 /* min and max macros   */
00132 #define Q_MAX(x, y)       ( ((x) > (y)) ? (x) : (y) )
00133 #define Q_MIN(x, y)       ( ((x) < (y)) ? (x) : (y) )
00134 
00135 #define Q_ABS(x)       ( ((x) > 0 ) ? (x) : (-(x)) )
00136 
00137 /* 
00138  * use local definition of PI for machines that have no def in math.h; this
00139  *  value stolen from DEC Ultrix 4.1 math.h
00140  */
00141 #define Q_PI    3.14159265358979323846
00142 
00143 #define Q_ID_QUAT   { 0.0, 0.0, 0.0, 1.0 }
00144 
00145 #define Q_ID_MATRIX { {1.0, 0.0, 0.0, 0.0}, \
00146                       {0.0, 1.0, 0.0, 0.0}, \
00147                       {0.0, 0.0, 1.0, 0.0}, \
00148                       {0.0, 0.0, 0.0, 1.0} }
00149 
00150 #define QP_ID_MATRIX { {1.0, 0.0, 0.0, 0.0}, \
00151                        {0.0, 1.0, 0.0, 0.0}, \
00152                        {0.0, 0.0, 1.0, 0.0} }
00153 
00154 #define Q_NULL_VECTOR   { 0.0, 0.0, 0.0 }
00155 
00156 /* 
00157  * degree/radian conversion
00158  */
00159 #define Q_DEG_TO_RAD(deg)       ( ((deg)*Q_PI)/180.0 )
00160 #define Q_RAD_TO_DEG(rad)       ( (((rad)*180.0)/Q_PI) )
00161 
00162 /* compatibility w/ old for a while */
00163 #define q_vec_set   q_set_vec
00164 
00165 
00166 /*****************************************************************************
00167  *
00168     typedefs
00169  *
00170  *****************************************************************************/
00171 
00172 /* basic quaternion type- scalar part is last element in array    */
00173 typedef double  q_type[4];
00174 
00175 /* basic vector type    */
00176 typedef double  q_vec_type[3];
00177 
00178 /* for row and column matrices  */
00179 typedef double  q_matrix_type[4][4];
00180 
00181 /* for working with gl or other 4x4 float matrices  */
00182 typedef float   qgl_matrix_type[4][4];
00183 
00184 /* for working with OpenGL matrices - these are really just like row matrices
00185 ** (i.e. same bits in same order), but the decl is a 1-D array, not 2-D, sigh
00186 */
00187 typedef double  qogl_matrix_type[16];
00188 
00189 /* special transformation type using quaternions and vectors    */
00190 typedef struct  q_xyz_quat_struct
00191     {
00192     q_vec_type  xyz;  /* translation  */
00193     q_type      quat;  /* rotation          */
00194     } q_xyz_quat_type;
00195 
00196 
00197 
00198 /*****************************************************************************
00199  *****************************************************************************
00200  *
00201     function declarations
00202  *
00203  *****************************************************************************
00204  *****************************************************************************/
00205 
00206 
00207 
00208 /*****************************************************************************
00209  *
00210     strictly quaternion operations
00211  *
00212  *****************************************************************************/
00213 
00214 /*  prints a quaternion */
00215 CM_EXTERN_FUNCTION( void q_print, ( q_type quat ));
00216 
00217 /* make a quaternion given an axis and an angle;  x,y,z is axis of 
00218  *  rotation;  angle is angle of rotation in radians (see also q_from_two_vecs)
00219  *
00220  *  rotation is counter-clockwise when rotation axis vector is 
00221  *              pointing at you
00222  *
00223  * if angle or vector are 0, the identity quaternion is returned.
00224  */
00225 CM_EXTERN_FUNCTION( void q_make, ( q_type destQuat,
00226                                    double x,  double y,  double z,
00227                                    double angle ));
00228 
00229 /*  copy srcQuat to destQuat    */
00230 CM_EXTERN_FUNCTION( void q_copy, ( q_type destQuat, q_type srcQuat ));
00231 
00232 /* normalizes quaternion;  src and dest can be same */
00233 CM_EXTERN_FUNCTION( void q_normalize, ( q_type destQuat, 
00234                                         q_type srcQuat ));
00235 
00236 /* invert quat;  src and dest can be the same   */
00237 CM_EXTERN_FUNCTION( void q_invert, ( q_type destQuat, q_type srcQuat ));
00238 
00239 /*
00240  * computes quaternion product destQuat = qLeft * qRight.
00241  *          destQuat can be same as either qLeft or qRight or both.
00242  */
00243 CM_EXTERN_FUNCTION( void q_mult, ( q_type destQuat, 
00244                                    q_type qLeft,  
00245                                    q_type qRight ));
00246 
00247 /* conjugate quat; src and dest can be same */
00248 CM_EXTERN_FUNCTION( void q_conjugate, ( q_type destQuat, 
00249                                         q_type srcQuat ));
00250 
00251 /* take natural log of unit quat; src and dest can be same  */
00252 CM_EXTERN_FUNCTION( void q_log, ( q_type destQuat, 
00253                                   q_type srcQuat ));
00254 
00255 /* exponentiate quaternion, assuming scalar part 0.  src can be same as dest */
00256 CM_EXTERN_FUNCTION( void q_exp, ( q_type destQuat, 
00257                                   q_type srcQuat ));
00258 
00259 
00260 /*
00261  * q_slerp: Spherical linear interpolation of unit quaternions.
00262  *
00263  *      As t goes from 0 to 1, destQuat goes from startQ to endQuat.
00264  *      This routine should always return a point along the shorter
00265  *      of the two paths between the two.  That is why the vector may be
00266  *      negated in the end.
00267  *      
00268  *      src == dest should be ok, although that doesn't seem to make much
00269  *      sense here.
00270  */
00271 CM_EXTERN_FUNCTION( void q_slerp, ( q_type       destQuat, 
00272                                     q_type startQuat,
00273                                     q_type endQuat, 
00274                                     double       t ));
00275 
00276 /*****************************************************************************
00277  *  
00278     q_from_euler - converts 3 euler angles (in radians) to a quaternion
00279      
00280         Assumes roll is rotation about X, pitch
00281         is rotation about Y, yaw is about Z.  Assumes order of 
00282         yaw, pitch, roll applied as follows:
00283             
00284             p' = roll( pitch( yaw(p) ) )
00285 
00286         See comments for q_euler_to_col_matrix for more on this.
00287  *
00288  *****************************************************************************/
00289 CM_EXTERN_FUNCTION( void q_from_euler, ( q_type destQuat, 
00290                                          double yaw, 
00291                                          double pitch, 
00292                                          double roll ));
00293 
00294 
00295 /*****************************************************************************
00296  *
00297     mixed quaternion operations:  conversions to and from vectors & matrices
00298  *
00299  *****************************************************************************/
00300 
00301 /* destVec = q * vec * q(inverse);  vec can be same storage as destVec  */
00302 CM_EXTERN_FUNCTION( void q_xform, ( q_vec_type destVec, 
00303                                     q_type q,
00304                                     q_vec_type vec ));
00305 
00306 /* quat/vector conversion       */
00307 /* create a quaternion from two vectors that rotates v1 to v2 
00308  *   about an axis perpendicular to both
00309  */
00310 CM_EXTERN_FUNCTION( void q_from_two_vecs, ( q_type destQuat,
00311                                             q_vec_type v1, 
00312                                             q_vec_type v2 ));
00313 
00314 /* simple conversion    */
00315 CM_EXTERN_FUNCTION( void q_from_vec, ( q_type destQuat, 
00316                                        q_vec_type srcVec ));
00317 CM_EXTERN_FUNCTION( void q_to_vec, ( q_vec_type destVec, 
00318                                      q_type srcQuat ));
00319 
00320 /* quaternion/4x4 matrix conversions    */
00321 CM_EXTERN_FUNCTION( void q_from_row_matrix, ( q_type destQuat, 
00322                                               q_matrix_type matrix ));
00323 CM_EXTERN_FUNCTION( void q_from_col_matrix, ( q_type destQuat, 
00324                                               q_matrix_type matrix ));
00325 CM_EXTERN_FUNCTION( void q_to_row_matrix, ( q_matrix_type destMatrix, 
00326                                             q_type srcQuat ));
00327 CM_EXTERN_FUNCTION( void q_to_col_matrix, ( q_matrix_type destMatrix, 
00328                                             q_type srcQuat ));
00329 
00330 /* quat/pphigs conversion   */
00331 CM_EXTERN_FUNCTION( void qp_to_matrix, ( Q_MatrixType destMatrix, 
00332                                          q_type srcQuat ));
00333 CM_EXTERN_FUNCTION( void qp_from_matrix, ( q_type destQuat, 
00334                                            Q_MatrixType srcMatrix ));
00335 
00336 /* quat/ogl conversion */
00337 CM_EXTERN_FUNCTION( void q_from_ogl_matrix, ( q_type destQuat,
00338                                               qogl_matrix_type matrix ));
00339 CM_EXTERN_FUNCTION( void q_to_ogl_matrix, ( qogl_matrix_type matrix,
00340                                             q_type srcQuat ));
00341 
00342 /*****************************************************************************
00343  *
00344     strictly vector operations
00345  *
00346  *****************************************************************************/
00347 
00348 
00349 /* prints a vector to stdout  */
00350 CM_EXTERN_FUNCTION( void q_vec_print, ( q_vec_type  vec ));
00351 
00352 /* sets vector equal to 3 values given  */
00353 CM_EXTERN_FUNCTION( void q_set_vec, ( q_vec_type vec, 
00354                                       double x, double y, double z ));
00355 
00356 /* copies srcVec to destVec */
00357 CM_EXTERN_FUNCTION( void q_vec_copy, ( q_vec_type destVec, 
00358                                        q_vec_type srcVec ));
00359 
00360 /* adds two vectors */
00361 CM_EXTERN_FUNCTION( void q_vec_add, ( q_vec_type destVec, 
00362                                       q_vec_type aVec, 
00363                                       q_vec_type bVec ));
00364 
00365 /* destVec = v1 - v2 (v1, v2, destVec need not be distinct storage) */
00366 CM_EXTERN_FUNCTION( void q_vec_subtract, ( q_vec_type       destVec, 
00367                                            q_vec_type v1, 
00368                                            q_vec_type v2 ));
00369 
00370 /* returns value of dot product of v1 and v2    */
00371 CM_EXTERN_FUNCTION( double q_vec_dot_product, ( q_vec_type v1, 
00372                                                 q_vec_type v2 ));
00373 
00374 /* scale a vector  (src and dest need not be distinct) */
00375 CM_EXTERN_FUNCTION( void q_vec_scale, ( q_vec_type        destVec,
00376                                         double            scaleFactor,
00377                                         q_vec_type  srcVec ));
00378 
00379 
00380 /* negate a vector to point in the opposite direction   */
00381 CM_EXTERN_FUNCTION( void q_vec_invert, ( q_vec_type destVec, 
00382                                          q_vec_type srcVec ));
00383 
00384 /*  normalize a vector  (destVec and srcVec may be the same) */
00385 CM_EXTERN_FUNCTION( void q_vec_normalize, ( q_vec_type destVec, 
00386                                             q_vec_type srcVec ));
00387 
00388 /* returns magnitude of vector  */
00389 CM_EXTERN_FUNCTION( double q_vec_magnitude, ( q_vec_type  vec ));
00390 
00391 /*  returns distance between two points/vectors */
00392 CM_EXTERN_FUNCTION( double q_vec_distance, ( q_vec_type vec1, 
00393                                              q_vec_type vec2 ));
00394 
00395 /* computes cross product of two vectors:  destVec = aVec X bVec
00396  *      destVec same as aVec or bVec ok
00397  */
00398 CM_EXTERN_FUNCTION( void q_vec_cross_product, ( q_vec_type       destVec, 
00399                                                 q_vec_type aVec, 
00400                                                 q_vec_type bVec ));
00401 
00402 
00403 /* copies PPHIGS 3-vectors */
00404 CM_EXTERN_FUNCTION( void qp_vec_copy, ( Q_VectorType destVec, 
00405                                         Q_VectorType srcVec ));
00406 
00407 /* convert PPHIGS srcVec to quatlib destVec */
00408 CM_EXTERN_FUNCTION( void qp_pvec_to_vec, ( q_vec_type destVec, 
00409                                            Q_VectorType srcVec ));
00410 
00411 /* convert quatlib srcVec to PPHIGS destVec */
00412 CM_EXTERN_FUNCTION( void qp_vec_to_pvec, ( Q_VectorType destVec, 
00413                                            q_vec_type srcVec ));
00414 
00415 
00416 /*****************************************************************************
00417  *
00418     strictly matrix operations
00419  *
00420  *****************************************************************************/
00421 
00422 /* q_matrix_copy - copies srcMatrix to destMatrix (both matrices are 4x4)   */
00423 CM_EXTERN_FUNCTION( void q_matrix_copy, ( q_matrix_type destMatrix, 
00424                                           q_matrix_type srcMatrix ));
00425 
00426 /* copy dest to src, both PPHIGS matrices   */
00427 CM_EXTERN_FUNCTION( void qp_matrix_copy, ( Q_MatrixType destMatrix, 
00428                                            Q_MatrixType srcMatrix ));
00429 
00430 CM_EXTERN_FUNCTION( void qogl_matrix_copy, ( qogl_matrix_type dest,
00431                                             qogl_matrix_type src ));
00432 
00433 /* does a 4x4 matrix multiply (the input matrices are 4x4) and
00434  *                puts the result in a 4x4 matrix.  src == dest ok.
00435  */
00436 CM_EXTERN_FUNCTION( void q_matrix_mult, ( q_matrix_type resultMatrix,
00437                                           q_matrix_type leftMatrix,
00438                                           q_matrix_type rightMatrix ));
00439 
00440 /* multiply two pphigs matrices (dest = source ok)  */
00441 CM_EXTERN_FUNCTION( void qp_matrix_mult, ( Q_MatrixType result, 
00442                                            Q_MatrixType A, 
00443                                            Q_MatrixType B ));
00444 
00445 CM_EXTERN_FUNCTION( void qogl_matrix_mult, ( qogl_matrix_type result,
00446                                              qogl_matrix_type left,
00447                                              qogl_matrix_type right ));
00448 
00449 /* calc determinant the rotation part of a pphigs matrix        */
00450 CM_EXTERN_FUNCTION( double qp_matrix_3x3_determinant, 
00451                    ( Q_MatrixType mat ));
00452 
00453 /*****************************************************************************
00454  *
00455    q_euler_to_col_matrix - euler angles should be in radians
00456         computed assuming the order of rotation is: yaw, pitch, roll.
00457    
00458     This means the following:
00459     
00460         p' = roll( pitch( yaw(p) ) )
00461          
00462          or
00463 
00464         p' = Mr * Mp * My * p
00465 
00466     Yaw is rotation about Z axis, pitch is rotation about Y axis, and roll
00467     is rotation about X axis.  In terms of these axes, then, the process is:
00468     
00469         p' = Mx * My * Mz * p
00470  
00471     where Mx = the standard Foley and van Dam column matrix for rotation
00472     about the X axis, and similarly for Y and Z.
00473     
00474     Thus the calling sequence in terms of X, Y, Z is:
00475     
00476         q_euler_to_col_matrix(destMatrix, zRot, yRot, xRot);
00477  *
00478  *****************************************************************************/
00479 CM_EXTERN_FUNCTION( void q_euler_to_col_matrix, ( q_matrix_type destMatrix,
00480                                                   double yaw, 
00481                                                   double pitch, 
00482                                                   double roll ));
00483 
00484 /*****************************************************************************
00485  *
00486     q_col_matrix_to_euler- convert a column matrix to euler angles    
00487  
00488     input:
00489         - vector to hold euler angles
00490         - src column matrix
00491     
00492     output:
00493         - euler angles in radians in the range -pi to pi;
00494             vec[0] = yaw, vec[1] = pitch, vec[2] = roll
00495             yaw is rotation about Z axis, pitch is about Y, roll -> X rot.
00496     
00497     notes:
00498         - written by Gary Bishop
00499  *
00500  *****************************************************************************/
00501 CM_EXTERN_FUNCTION( void q_col_matrix_to_euler, ( q_vec_type    angles,
00502                                                   q_matrix_type colMatrix ));
00503 
00504 /* prints 4x4 matrix    */
00505 CM_EXTERN_FUNCTION( void q_print_matrix, ( q_matrix_type matrix ));
00506 
00507 /* prints PPHIGS 3x4 matrix */
00508 CM_EXTERN_FUNCTION( void qp_print_matrix, ( Q_MatrixType matrix ));
00509 
00510 CM_EXTERN_FUNCTION( void qogl_print_matrix, ( qogl_matrix_type ));
00511 
00512 /* prints PPHIGS 3x4 matrix to file */
00513 CM_EXTERN_FUNCTION( void qp_file_print_matrix, ( FILE         *filePtr,
00514                                                  Q_MatrixType matrix ));
00515 
00516 /* from 4x4 row matrix to PPHIGS 3x4 matrix     */
00517 CM_EXTERN_FUNCTION( void qp_row_to_pmatrix, ( Q_MatrixType          pMatrix,
00518                                               q_matrix_type rowMatrix ));
00519 
00520 /* converts PPHIGS matrix to row matrix */
00521 CM_EXTERN_FUNCTION( void qp_pmatrix_to_row_matrix, 
00522                    ( q_matrix_type rowMatrix,
00523                      Q_MatrixType pMatrix ));
00524 
00525 
00526 /* inverts a PPHIGS matrix  */
00527 CM_EXTERN_FUNCTION( void qp_invert_matrix, ( Q_MatrixType invertedMatrix, 
00528                                              Q_MatrixType srcMatrix ));
00529 
00530 
00531 
00532 /*****************************************************************************
00533  *
00534     xyz_quat routines
00535  *
00536  *****************************************************************************/
00537 
00538 /* invert a vector/quaternion transformation pair   */
00539 CM_EXTERN_FUNCTION( void q_xyz_quat_invert, ( q_xyz_quat_type *destPtr, 
00540                                               q_xyz_quat_type *srcPtr ));
00541 
00542 
00543 
00544 /* converts a row matrix to an xyz_quat */
00545 CM_EXTERN_FUNCTION( void q_row_matrix_to_xyz_quat, 
00546                    ( q_xyz_quat_type     *xyzQuatPtr,
00547                      q_matrix_type  rowMatrix ));
00548 
00549 /* convert an xyz_quat to a row matrix  */
00550 CM_EXTERN_FUNCTION( void q_xyz_quat_to_row_matrix, 
00551                    ( q_matrix_type   rowMatrix,
00552                      q_xyz_quat_type *xyzQuatPtr ));
00553 
00554 /* converts a pphigs matrix to an xyz_quat      */
00555 CM_EXTERN_FUNCTION( void qp_pmatrix_to_xyz_quat, 
00556                    ( q_xyz_quat_type *xyzQuatPtr,
00557                      Q_MatrixType pMatrix ));
00558 
00559 /* convert an xyz_quat to a pphigs matrix       */
00560 CM_EXTERN_FUNCTION( void qp_xyz_quat_to_pmatrix, 
00561                    ( Q_MatrixType       pMatrix,
00562                      q_xyz_quat_type    *xyzQuatPtr ));
00563 
00564 CM_EXTERN_FUNCTION( void q_ogl_matrix_to_xyz_quat,
00565                     ( q_xyz_quat_type *xyzQuatPtr,
00566                       qogl_matrix_type matrix ));
00567 
00568 CM_EXTERN_FUNCTION( void q_xyz_quat_to_ogl_matrix,
00569                     ( qogl_matrix_type matrix,
00570                       q_xyz_quat_type *xyzQuatPtr ));
00571 
00572 /* compose q_xyz_quat_vecs to form a third. */
00573 /* C_from_A_ptr may be = to either C_from_B_ptr or B_from_A_ptr (or both) */
00574 CM_EXTERN_FUNCTION( void q_xyz_quat_compose, ( q_xyz_quat_type *C_from_A_ptr,
00575                                                q_xyz_quat_type *C_from_B_ptr,
00576                                                q_xyz_quat_type *B_from_A_ptr));
00577 
00578 /*****************************************************************************
00579  *
00580     GL support
00581  *
00582  *****************************************************************************/
00583 
00584 /* convert from quat to GL 4x4 float row matrix */
00585 CM_EXTERN_FUNCTION( void  qgl_to_matrix,
00586                    (  qgl_matrix_type   destMatrix,
00587                       q_type            srcQuat ));
00588 
00589 
00590 /* qgl_from_matrix- Convert GL 4x4 row-major rotation matrix to 
00591  * unit quaternion.
00592  *      - same as q_from_row_matrix, except basic type is float, not double
00593  */
00594 CM_EXTERN_FUNCTION( void  qgl_from_matrix,
00595                    (  q_type            destQuat,
00596                       qgl_matrix_type   srcMatrix ));
00597 
00598 /* print gl-style matrix    */
00599 CM_EXTERN_FUNCTION( void  qgl_print_matrix,
00600                    (  qgl_matrix_type   matrix ));
00601 
00602 #endif /* Q_INCLUDED */
00603 
00604 
00605 
00606 

Generated on Thu Dec 1 10:13:40 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5