Debian Codegraph @

source/unix/odesrc/joints/pr.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 #ifndef _ODE_JOINT_PR_H_
24 #define _ODE_JOINT_PR_H_
25
26 #include "joint.h"
27
28
29
30 /**
31 * The axisP must be perpendicular to axis2
32 * <PRE>
33 * +-------------+
34 * | x |
35 * +------------\+
36 * Prismatic articulation .. ..
37 * | .. ..
38 * \/ .. ..
39 * +--------------+ --| __.. .. anchor2
40 * | x | .....|.......(__) ..
41 * +--------------+ --| ^ <
42 * |----------------------->|
43 * Offset |--- Rotoide articulation
44 * </PRE>
45 */
46 struct dxJointPR : public dxJoint
47 {
48
49 /// @brief Position of the rotoide articulation w.r.t second body.
50 /// @note Position of body 2 in world frame + anchor2 in world frame give
51 /// the position of the rotoide articulation
52 dVector3 anchor2;
53
54
55 /// axis of the rotoide articulation w.r.t first body.
56 /// @note This is considered as axis1 from the parameter view.
57 dVector3 axisR1;
58
59 /// axis of the rotoide articulation w.r.t second body.
60 /// @note This is considered also as axis1 from the parameter view
61 dVector3 axisR2;
62
63 /// axis for the prismatic articulation w.r.t first body.
64 /// @note This is considered as axis2 in from the parameter view
65 dVector3 axisP1;
66
67
68 dQuaternion qrel; ///< initial relative rotation body1 -> body2.
69
70
71 /// @brief vector between the body1 and the rotoide articulation.
72 ///
73 /// Going from the first to the second in the frame of body1.
74 /// That should be aligned with body1 center along axisP.
75 /// This is calculated when the axis are set.
76 dVector3 offset;
77 dxJointLimitMotor limotR; ///< limit and motor information for the rotoide articulation.
78 dxJointLimitMotor limotP; ///< limit and motor information for the prismatic articulation.
79
80
81 void computeInitialRelativeRotation();
82
83
84 dxJointPR( dxWorld *w );
85 virtual void getSureMaxInfo( SureMaxInfo* info );
86 virtual void getInfo1( Info1* info );
87 virtual void getInfo2( dReal worldFPS, dReal worldERP,
88 int rowskip, dReal *J1, dReal *J2,
89 int pairskip, dReal *pairRhsCfm, dReal *pairLoHi,
90 int *findex );
91 virtual dJointType type() const;
92 virtual size_t size() const;
93
94 virtual void setRelativeValues();
95 };
96
97
98
99 #endif
100