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 24 #ifndef _ODE_JOINT_NTERNAL_H_ 25 #define _ODE_JOINT_INTERNAL_H_ 26 27 #include "config.h" 28 29 #include <ode/matrix.h> 30 #include <ode/odemath.h> 31 #include <ode/rotation.h> 32 #include <ode/objects.h> 33 34 #define checktype(j,t) dUASSERT(j->type() == dJointType##t, \ 35 "joint type is not " #t) 36 37 38 void setBall( dxJoint *joint, dxJoint::Info2 *info, 39 dVector3 anchor1, dVector3 anchor2 ); 40 void setBall2( dxJoint *joint, dxJoint::Info2 *info, 41 dVector3 anchor1, dVector3 anchor2, 42 dVector3 axis, dReal erp1 ); 43 44 45 void setAnchors( dxJoint *j, dReal x, dReal y, dReal z, 46 dVector3 anchor1, dVector3 anchor2 ); 47 48 void getAnchor( dxJoint *j, dVector3 result, dVector3 anchor1 ); 49 void getAnchor2( dxJoint *j, dVector3 result, dVector3 anchor2 ); 50 51 void setAxes( dxJoint *j, dReal x, dReal y, dReal z, 52 dVector3 axis1, dVector3 axis2 ); 53 void getAxis( dxJoint *j, dVector3 result, dVector3 axis1 ); 54 void getAxis2( dxJoint *j, dVector3 result, dVector3 axis2 ); 55 56 57 dReal getHingeAngle( dxBody *body1, dxBody *body2, dVector3 axis, dQuaternion q_initial ); 58 dReal getHingeAngleFromRelativeQuat( dQuaternion qrel, dVector3 axis ); 59 60 void setFixedOrientation( dxJoint *joint, dxJoint::Info2 *info, dQuaternion qrel, int start_row ); 61 62 #endif 63 64