[1812] | 1 | /*************************************************************************
|
---|
| 2 | * *
|
---|
| 3 | * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
|
---|
| 4 | * All rights reserved. Email: russ@q12.org Web: www.q12.org *
|
---|
| 5 | * *
|
---|
| 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 *
|
---|
| 12 | * file LICENSE.TXT. *
|
---|
| 13 | * (2) The BSD-style license that is included with this library in *
|
---|
| 14 | * the file LICENSE-BSD.TXT. *
|
---|
| 15 | * *
|
---|
| 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. *
|
---|
| 20 | * *
|
---|
| 21 | *************************************************************************/
|
---|
| 22 |
|
---|
| 23 | #ifndef _ODE_ROTATION_H_
|
---|
| 24 | #define _ODE_ROTATION_H_
|
---|
| 25 |
|
---|
| 26 | #include <ode/common.h>
|
---|
| 27 | #include <ode/compatibility.h>
|
---|
| 28 |
|
---|
| 29 | #ifdef __cplusplus
|
---|
| 30 | extern "C" {
|
---|
| 31 | #endif
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | void dRSetIdentity (dMatrix3 R);
|
---|
| 35 |
|
---|
| 36 | void dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az,
|
---|
| 37 | dReal angle);
|
---|
| 38 |
|
---|
| 39 | void dRFromEulerAngles (dMatrix3 R, dReal phi, dReal theta, dReal psi);
|
---|
| 40 |
|
---|
| 41 | void dRFrom2Axes (dMatrix3 R, dReal ax, dReal ay, dReal az,
|
---|
| 42 | dReal bx, dReal by, dReal bz);
|
---|
| 43 |
|
---|
| 44 | void dRFromZAxis (dMatrix3 R, dReal ax, dReal ay, dReal az);
|
---|
| 45 |
|
---|
| 46 | void dQSetIdentity (dQuaternion q);
|
---|
| 47 |
|
---|
| 48 | void dQFromAxisAndAngle (dQuaternion q, dReal ax, dReal ay, dReal az,
|
---|
| 49 | dReal angle);
|
---|
| 50 |
|
---|
| 51 | /* Quaternion multiplication, analogous to the matrix multiplication routines. */
|
---|
| 52 | /* qa = rotate by qc, then qb */
|
---|
| 53 | void dQMultiply0 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
|
---|
| 54 | /* qa = rotate by qc, then by inverse of qb */
|
---|
| 55 | void dQMultiply1 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
|
---|
| 56 | /* qa = rotate by inverse of qc, then by qb */
|
---|
| 57 | void dQMultiply2 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
|
---|
| 58 | /* qa = rotate by inverse of qc, then by inverse of qb */
|
---|
| 59 | void dQMultiply3 (dQuaternion qa, const dQuaternion qb, const dQuaternion qc);
|
---|
| 60 |
|
---|
| 61 | void dRfromQ (dMatrix3 R, const dQuaternion q);
|
---|
| 62 | void dQfromR (dQuaternion q, const dMatrix3 R);
|
---|
| 63 | void dDQfromW (dReal dq[4], const dVector3 w, const dQuaternion q);
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | #ifdef __cplusplus
|
---|
| 67 | }
|
---|
| 68 | #endif
|
---|
| 69 |
|
---|
| 70 | #endif
|
---|