rotation.h

00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.       *
00004  * All rights reserved.  Email: russ@q12.org   Web: www.q12.org          *
00005  *                                                                       *
00006  * This library is free software; you can redistribute it and/or         *
00007  * modify it under the terms of EITHER:                                  *
00008  *   (1) The GNU Lesser General Public License as published by the Free  *
00009  *       Software Foundation; either version 2.1 of the License, or (at  *
00010  *       your option) any later version. The text of the GNU Lesser      *
00011  *       General Public License is included with this library in the     *
00012  *       file LICENSE.TXT.                                               *
00013  *   (2) The BSD-style license that is included with this library in     *
00014  *       the file LICENSE-BSD.TXT.                                       *
00015  *                                                                       *
00016  * This library is distributed in the hope that it will be useful,       *
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00019  * LICENSE.TXT and LICENSE-BSD.TXT for more details.                     *
00020  *                                                                       *
00021  *************************************************************************/
00022 
00023 #ifndef _ODE_ROTATION_H_
00024 #define _ODE_ROTATION_H_
00025 
00026 #include <ode/common.h>
00027 #include <ode/compatibility.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 
00034 ODE_API void dRSetIdentity (dMatrix3 R);
00035 
00036 ODE_API void dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az,
00037           dReal angle);
00038 
00039 ODE_API void dRFromEulerAngles (dMatrix3 R, dReal phi, dReal theta, dReal psi);
00040 
00041 ODE_API void dRFrom2Axes (dMatrix3 R, dReal ax, dReal ay, dReal az,
00042         dReal bx, dReal by, dReal bz);
00043 
00044 ODE_API void dRFromZAxis (dMatrix3 R, dReal ax, dReal ay, dReal az);
00045 
00046 ODE_API void dQSetIdentity (dQuaternion q);
00047 
00048 ODE_API void dQFromAxisAndAngle (dQuaternion q, dReal ax, dReal ay, dReal az,
00049           dReal angle);
00050 
00051 /* Quaternion multiplication, analogous to the matrix multiplication routines. */
00052 /* qa = rotate by qc, then qb */
00053 ODE_API void dQMultiply0 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
00054 /* qa = rotate by qc, then by inverse of qb */
00055 ODE_API void dQMultiply1 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
00056 /* qa = rotate by inverse of qc, then by qb */
00057 ODE_API void dQMultiply2 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
00058 /* qa = rotate by inverse of qc, then by inverse of qb */
00059 ODE_API void dQMultiply3 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
00060 
00061 ODE_API void dRfromQ (dMatrix3 R, const dQuaternion q);
00062 ODE_API void dQfromR (dQuaternion q, const dMatrix3 R);
00063 ODE_API void dDQfromW (dReal dq[4], const dVector3 w, const dQuaternion q);
00064 
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif
00069 
00070 #endif

Generated on Fri Oct 12 08:36:51 2007 for Open Dynamics Engine by  doxygen 1.5.3