| 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 |
#ifndef _ODE_JOINT_HINGE2_H_ |
| 24 |
#define _ODE_JOINT_HINGE2_H_ |
| 25 |
|
| 26 |
#include "joint.h" |
| 27 |
|
| 28 |
|
| 29 |
// hinge 2 |
| 30 |
|
| 31 |
struct dxJointHinge2 : public dxJoint |
| 32 |
{ |
| 33 |
dVector3 anchor1; // anchor w.r.t first body |
| 34 |
dVector3 anchor2; // anchor w.r.t second body |
| 35 |
dVector3 axis1; // axis 1 w.r.t first body |
| 36 |
dVector3 axis2; // axis 2 w.r.t second body |
| 37 |
dReal c0, s0; // cos,sin of desired angle between axis 1,2 |
| 38 |
dVector3 v1, v2; // angle ref vectors embedded in first body |
| 39 |
dVector3 w1, w2; // angle ref vectors embedded in second body |
| 40 |
dxJointLimitMotor limot1; // limit+motor info for axis 1 |
| 41 |
dxJointLimitMotor limot2; // limit+motor info for axis 2 |
| 42 |
dReal susp_erp, susp_cfm; // suspension parameters (erp,cfm) |
| 43 |
|
| 44 |
|
| 45 |
dReal measureAngle1() const; |
| 46 |
dReal measureAngle2() const; |
| 47 |
void makeV1andV2(); |
| 48 |
void makeW1andW2(); |
| 49 |
|
| 50 |
void getAxisInfo(dVector3 ax1, dVector3 ax2, dVector3 axis, |
| 51 |
dReal &sin_angle, dReal &cos_Angle) const; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
dxJointHinge2( dxWorld *w ); |
| 56 |
|
| 57 |
virtual void getSureMaxInfo( SureMaxInfo* info ); |
| 58 |
virtual void getInfo1( Info1* info ); |
| 59 |
virtual void getInfo2( dReal worldFPS, dReal worldERP, |
| 60 |
int rowskip, dReal *J1, dReal *J2, |
| 61 |
int pairskip, dReal *pairRhsCfm, dReal *pairLoHi, |
| 62 |
int *findex ); |
| 63 |
virtual dJointType type() const; |
| 64 |
virtual size_t size() const; |
| 65 |
|
| 66 |
virtual void setRelativeValues(); |
| 67 |
}; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
#endif |