Panda3D
odeHingeJoint.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file odeHingeJoint.I
10  * @author joswilso
11  * @date 2006-12-27
12  */
13 
14 INLINE void OdeHingeJoint::
15 set_anchor(dReal x, dReal y, dReal z) {
16  dJointSetHingeAnchor(_id, x, y, z);
17 }
18 
19 INLINE void OdeHingeJoint::
20 set_anchor(const LVecBase3f &anchor) {
21  dJointSetHingeAnchor(_id, anchor[0], anchor[1], anchor[2]);
22 }
23 
24 INLINE void OdeHingeJoint::
25 set_anchor_delta(dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az) {
26  dJointSetHingeAnchorDelta(_id, x, y, z, ax, ay, az);
27 }
28 
29 INLINE void OdeHingeJoint::
30 set_anchor_delta(const LVecBase3f &anchor, const LVecBase3f &vec) {
31  dJointSetHingeAnchorDelta(_id, anchor[0], anchor[1], anchor[2], vec[0], vec[1], vec[2]);
32 }
33 
34 INLINE void OdeHingeJoint::
35 set_axis(dReal x, dReal y, dReal z) {
36  dJointSetHingeAxis(_id, x, y, z);
37 }
38 
39 INLINE void OdeHingeJoint::
40 set_axis(const LVecBase3f &axis) {
41  dJointSetHingeAxis(_id, axis[0], axis[1], axis[2]);
42 }
43 
44 INLINE void OdeHingeJoint::
45 add_torque(dReal torque) {
46  dJointAddHingeTorque(_id, torque);
47 }
48 
49 INLINE LVecBase3f OdeHingeJoint::
50 get_anchor() const {
51  dVector3 result;
52  dJointGetHingeAnchor(_id, result);
53  return LVecBase3f(result[0], result[1], result[2]);
54 }
55 
56 INLINE LVecBase3f OdeHingeJoint::
57 get_anchor2() const {
58  dVector3 result;
59  dJointGetHingeAnchor2(_id, result);
60  return LVecBase3f(result[0], result[1], result[2]);
61 }
62 
63 INLINE LVecBase3f OdeHingeJoint::
64 get_axis() const {
65  dVector3 result;
66  dJointGetHingeAxis(_id, result);
67  return LVecBase3f(result[0], result[1], result[2]);
68 }
69 
70 INLINE dReal OdeHingeJoint::
71 get_angle() const {
72  return dJointGetHingeAngle(_id);
73 }
74 
75 INLINE dReal OdeHingeJoint::
76 get_angle_rate() const {
77  return dJointGetHingeAngleRate(_id);
78 }
79 
80 INLINE void OdeHingeJoint::
81 set_param_lo_stop(dReal val) {
82  nassertv( _id != 0 );
83  dJointSetHingeParam(_id, dParamLoStop, val);
84 }
85 
86 INLINE void OdeHingeJoint::
87 set_param_hi_stop(dReal val) {
88  nassertv( _id != 0 );
89  dJointSetHingeParam(_id, dParamHiStop, val);
90 }
91 
92 INLINE void OdeHingeJoint::
93 set_param_vel(dReal val) {
94  nassertv( _id != 0 );
95  dJointSetHingeParam(_id, dParamVel, val);
96 }
97 
98 INLINE void OdeHingeJoint::
99 set_param_f_max(dReal val) {
100  nassertv( _id != 0 );
101  dJointSetHingeParam(_id, dParamFMax, val);
102 }
103 
104 INLINE void OdeHingeJoint::
105 set_param_fudge_factor(dReal val) {
106  nassertv( _id != 0 );
107  dJointSetHingeParam(_id, dParamFudgeFactor, val);
108 }
109 
110 INLINE void OdeHingeJoint::
111 set_param_bounce(dReal val) {
112  nassertv( _id != 0 );
113  dJointSetHingeParam(_id, dParamBounce, val);
114 }
115 
116 INLINE void OdeHingeJoint::
117 set_param_CFM(dReal val) {
118  nassertv( _id != 0 );
119  dJointSetHingeParam(_id, dParamCFM, val);
120 }
121 
122 INLINE void OdeHingeJoint::
123 set_param_stop_ERP(dReal val) {
124  nassertv( _id != 0 );
125  dJointSetHingeParam(_id, dParamStopERP, val);
126 }
127 
128 INLINE void OdeHingeJoint::
129 set_param_stop_CFM(dReal val) {
130  nassertv( _id != 0 );
131  dJointSetHingeParam(_id, dParamStopCFM, val);
132 }
133 
134 INLINE dReal OdeHingeJoint::
135 get_param_lo_stop() const {
136  nassertr( _id != 0, 0 );
137  return dJointGetHingeParam(_id, dParamLoStop);
138 }
139 
140 INLINE dReal OdeHingeJoint::
141 get_param_hi_stop() const {
142  nassertr( _id != 0, 0 );
143  return dJointGetHingeParam(_id, dParamHiStop);
144 }
145 
146 INLINE dReal OdeHingeJoint::
147 get_param_vel() const {
148  nassertr( _id != 0, 0 );
149  return dJointGetHingeParam(_id, dParamVel);
150 }
151 
152 INLINE dReal OdeHingeJoint::
153 get_param_f_max() const {
154  nassertr( _id != 0, 0 );
155  return dJointGetHingeParam(_id, dParamFMax);
156 }
157 
158 INLINE dReal OdeHingeJoint::
159 get_param_fudge_factor() const {
160  nassertr( _id != 0, 0 );
161  return dJointGetHingeParam(_id, dParamFudgeFactor);
162 }
163 
164 INLINE dReal OdeHingeJoint::
165 get_param_bounce() const {
166  nassertr( _id != 0, 0 );
167  return dJointGetHingeParam(_id, dParamBounce);
168 }
169 
170 INLINE dReal OdeHingeJoint::
171 get_param_CFM() const {
172  nassertr( _id != 0, 0 );
173  return dJointGetHingeParam(_id, dParamCFM);
174 }
175 
176 INLINE dReal OdeHingeJoint::
177 get_param_stop_ERP() const {
178  nassertr( _id != 0, 0 );
179  return dJointGetHingeParam(_id, dParamStopERP);
180 }
181 
182 INLINE dReal OdeHingeJoint::
183 get_param_stop_CFM() const {
184  nassertr( _id != 0, 0 );
185  return dJointGetHingeParam(_id, dParamStopCFM);
186 }