1 /*************************************************************************
3 * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
4 * All rights reserved. Email: russ@q12.org Web: www.q12.org *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of EITHER: *
8 * (1) The GNU Lesser General Public License as published by the Free *
9 * Software Foundation; either version 2.1 of the License, or (at *
10 * your option) any later version. The text of the GNU Lesser *
11 * General Public License is included with this library in the *
13 * (2) The BSD-style license that is included with this library in *
14 * the file LICENSE-BSD.TXT. *
16 * This library is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
19 * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
21 *************************************************************************/
23 #ifndef _ODE_ROTATION_H_
24 #define _ODE_ROTATION_H_
26 #include <ode/common.h>
27 #include <ode/compatibility.h>
34 ODE_API void dRSetIdentity (dMatrix3 R);
36 ODE_API void dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az,
39 ODE_API void dRFromEulerAngles (dMatrix3 R, dReal phi, dReal theta, dReal psi);
41 ODE_API void dRFrom2Axes (dMatrix3 R, dReal ax, dReal ay, dReal az,
42 dReal bx, dReal by, dReal bz);
44 ODE_API void dRFromZAxis (dMatrix3 R, dReal ax, dReal ay, dReal az);
46 ODE_API void dQSetIdentity (dQuaternion q);
48 ODE_API void dQFromAxisAndAngle (dQuaternion q, dReal ax, dReal ay, dReal az,
51 /* Quaternion multiplication, analogous to the matrix multiplication routines. */
52 /* qa = rotate by qc, then qb */
53 ODE_API void dQMultiply0 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
54 /* qa = rotate by qc, then by inverse of qb */
55 ODE_API void dQMultiply1 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
56 /* qa = rotate by inverse of qc, then by qb */
57 ODE_API void dQMultiply2 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
58 /* qa = rotate by inverse of qc, then by inverse of qb */
59 ODE_API void dQMultiply3 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
61 ODE_API void dRfromQ (dMatrix3 R, const dQuaternion q);
62 ODE_API void dQfromR (dQuaternion q, const dMatrix3 R);
63 ODE_API void dDQfromW (dReal dq[4], const dVector3 w, const dQuaternion q);