Debian Codegraph @

source/unix/odesrc/joints/joint_internal.h

raw
1 /*************************************************************************
2 * *
3 * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
4 * All rights reserved. Email: [email protected] 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
24 #ifndef _ODE_JOINT_INTERNAL_H_
25 #define _ODE_JOINT_INTERNAL_H_
26
27
28 #include <ode/rotation.h>
29 #include <ode/objects.h>
30 #include "matrix.h"
31 #include "odemath.h"
32
33
34 #define checktype(j,t) dUASSERT(j->type() == dJointType##t, \
35 "joint type is not " #t)
36
37
38 void setBall( dxJoint *joint, dReal fps, dReal erp,
39 int rowskip, dReal *J1, dReal *J2,
40 int pairskip, dReal *pairRhsCfm,
41 dVector3 anchor1, dVector3 anchor2 );
42 void setBall2( dxJoint *joint, dReal fps, dReal erp,
43 int rowskip, dReal *J1, dReal *J2,
44 int pairskip, dReal *pairRhsCfm,
45 dVector3 anchor1, dVector3 anchor2,
46 dVector3 axis, dReal erp1 );
47
48 void setFixedOrientation( dxJoint *joint, dReal fps, dReal erp,
49 int rowskip, dReal *J1, dReal *J2,
50 int pairskip, dReal *pairRhsCfm,
51 dQuaternion qrel );
52
53
54 void setAnchors( dxJoint *j, dReal x, dReal y, dReal z,
55 dVector3 anchor1, dVector3 anchor2 );
56
57 void getAnchor( dxJoint *j, dVector3 result, dVector3 anchor1 );
58 void getAnchor2( dxJoint *j, dVector3 result, dVector3 anchor2 );
59
60 void setAxes( dxJoint *j, dReal x, dReal y, dReal z,
61 dVector3 axis1, dVector3 axis2 );
62 void getAxis( dxJoint *j, dVector3 result, dVector3 axis1 );
63 void getAxis2( dxJoint *j, dVector3 result, dVector3 axis2 );
64
65
66 dReal getHingeAngle( dxBody *body1, dxBody *body2, dVector3 axis, dQuaternion q_initial );
67 dReal getHingeAngleFromRelativeQuat( dQuaternion qrel, dVector3 axis );
68
69 #endif
70