Panda3D
Loading...
Searching...
No Matches
odeAMotorJoint.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 odeAMotorJoint.I
10 * @author joswilso
11 * @date 2006-12-27
12 */
13
14INLINE void OdeAMotorJoint::
15set_num_axes(int num) {
16 dJointSetAMotorNumAxes(_id, num);
17}
18
19INLINE void OdeAMotorJoint::
20set_axis(int anum, int rel, dReal x, dReal y, dReal z) {
21 dJointSetAMotorAxis(_id, anum, rel, x, y, z);
22}
23
24INLINE void OdeAMotorJoint::
25set_axis(int anum, int rel, const LVecBase3f &axis) {
26 dJointSetAMotorAxis(_id, anum, rel, axis[0], axis[1], axis[2]);
27}
28
29INLINE void OdeAMotorJoint::
30set_angle(int anum, dReal angle) {
31 dJointSetAMotorAngle(_id, anum, angle);
32}
33
34INLINE void OdeAMotorJoint::
35set_mode(int mode) {
36 dJointSetAMotorMode(_id, mode);
37}
38
39INLINE void OdeAMotorJoint::
40add_torques(dReal torque1, dReal torque2, dReal torque3) {
41 dJointAddAMotorTorques(_id, torque1, torque2, torque3);
42}
43
44INLINE int OdeAMotorJoint::
45get_num_axes() const {
46 return dJointGetAMotorNumAxes(_id);
47}
48
49INLINE LVecBase3f OdeAMotorJoint::
50get_axis(int anum) const {
51 dVector3 result;
52 dJointGetAMotorAxis(_id, anum, result);
53 return LVecBase3f(result[0], result[1], result[2]);
54}
55
56INLINE int OdeAMotorJoint::
57get_axis_rel(int anum) const {
58 return dJointGetAMotorAxisRel(_id, anum);
59}
60
61INLINE dReal OdeAMotorJoint::
62get_angle(int anum) const {
63 return dJointGetAMotorAngle(_id, anum);
64}
65
66INLINE dReal OdeAMotorJoint::
67get_angle_rate(int anum) const {
68 return dJointGetAMotorAngleRate(_id, anum);
69}
70
71INLINE int OdeAMotorJoint::
72get_mode() const {
73 return dJointGetAMotorMode(_id);
74}
75
76INLINE void OdeAMotorJoint::
77set_param_lo_stop(int axis, dReal val) {
78 nassertv( _id != 0 );
79 nassertv( 0 <= axis && axis <= 2 );
80 if ( axis == 0 ) {
81 dJointSetAMotorParam(_id, dParamLoStop, val);
82 } else if ( axis == 1 ) {
83 dJointSetAMotorParam(_id, dParamLoStop, val);
84 } else if ( axis == 2 ) {
85 dJointSetAMotorParam(_id, dParamLoStop, val);
86 }
87}
88
89INLINE void OdeAMotorJoint::
90set_param_hi_stop(int axis, dReal val) {
91 nassertv( _id != 0 );
92 nassertv( 0 <= axis && axis <= 2 );
93 if ( axis == 0 ) {
94 dJointSetAMotorParam(_id, dParamHiStop, val);
95 } else if ( axis == 1 ) {
96 dJointSetAMotorParam(_id, dParamHiStop, val);
97 } else if ( axis == 2 ) {
98 dJointSetAMotorParam(_id, dParamHiStop, val);
99 }
100}
101
102INLINE void OdeAMotorJoint::
103set_param_vel(int axis, dReal val) {
104 nassertv( _id != 0 );
105 nassertv( 0 <= axis && axis <= 2 );
106 if ( axis == 0 ) {
107 dJointSetAMotorParam(_id, dParamVel, val);
108 } else if ( axis == 1 ) {
109 dJointSetAMotorParam(_id, dParamVel, val);
110 } else if ( axis == 2 ) {
111 dJointSetAMotorParam(_id, dParamVel, val);
112 }
113}
114
115INLINE void OdeAMotorJoint::
116set_param_f_max(int axis, dReal val) {
117 nassertv( _id != 0 );
118 nassertv( 0 <= axis && axis <= 2 );
119 if ( axis == 0 ) {
120 dJointSetAMotorParam(_id, dParamFMax, val);
121 } else if ( axis == 1 ) {
122 dJointSetAMotorParam(_id, dParamFMax, val);
123 } else if ( axis == 2 ) {
124 dJointSetAMotorParam(_id, dParamFMax, val);
125 }
126}
127
128INLINE void OdeAMotorJoint::
129set_param_fudge_factor(int axis, dReal val) {
130 nassertv( _id != 0 );
131 nassertv( 0 <= axis && axis <= 2 );
132 if ( axis == 0 ) {
133 dJointSetAMotorParam(_id, dParamFudgeFactor, val);
134 } else if ( axis == 1 ) {
135 dJointSetAMotorParam(_id, dParamFudgeFactor, val);
136 } else if ( axis == 2 ) {
137 dJointSetAMotorParam(_id, dParamFudgeFactor, val);
138 }
139}
140
141INLINE void OdeAMotorJoint::
142set_param_bounce(int axis, dReal val) {
143 nassertv( _id != 0 );
144 nassertv( 0 <= axis && axis <= 2 );
145 if ( axis == 0 ) {
146 dJointSetAMotorParam(_id, dParamBounce, val);
147 } else if ( axis == 1 ) {
148 dJointSetAMotorParam(_id, dParamBounce, val);
149 } else if ( axis == 2 ) {
150 dJointSetAMotorParam(_id, dParamBounce, val);
151 }
152}
153
154INLINE void OdeAMotorJoint::
155set_param_CFM(int axis, dReal val) {
156 nassertv( _id != 0 );
157 nassertv( 0 <= axis && axis <= 2 );
158 if ( axis == 0 ) {
159 dJointSetAMotorParam(_id, dParamCFM, val);
160 } else if ( axis == 1 ) {
161 dJointSetAMotorParam(_id, dParamCFM, val);
162 } else if ( axis == 2 ) {
163 dJointSetAMotorParam(_id, dParamCFM, val);
164 }
165}
166
167INLINE void OdeAMotorJoint::
168set_param_stop_ERP(int axis, dReal val) {
169 nassertv( _id != 0 );
170 nassertv( 0 <= axis && axis <= 2 );
171 if ( axis == 0 ) {
172 dJointSetAMotorParam(_id, dParamStopERP, val);
173 } else if ( axis == 1 ) {
174 dJointSetAMotorParam(_id, dParamStopERP, val);
175 } else if ( axis == 2 ) {
176 dJointSetAMotorParam(_id, dParamStopERP, val);
177 }
178}
179
180INLINE void OdeAMotorJoint::
181set_param_stop_CFM(int axis, dReal val) {
182 nassertv( _id != 0 );
183 nassertv( 0 <= axis && axis <= 2 );
184 if ( axis == 0 ) {
185 dJointSetAMotorParam(_id, dParamStopCFM, val);
186 } else if ( axis == 1 ) {
187 dJointSetAMotorParam(_id, dParamStopCFM, val);
188 } else if ( axis == 2 ) {
189 dJointSetAMotorParam(_id, dParamStopCFM, val);
190 }
191}
192
193INLINE dReal OdeAMotorJoint::
194get_param_lo_stop(int axis) const {
195 nassertr( _id != 0, 0 );
196 nassertr( 0 <= axis && axis <= 2, 0 );
197 if ( axis == 0 ) {
198 return dJointGetAMotorParam(_id, dParamLoStop);
199 } else if ( axis == 1 ) {
200 return dJointGetAMotorParam(_id, dParamLoStop);
201 } else if ( axis == 2 ) {
202 return dJointGetAMotorParam(_id, dParamLoStop);
203 }
204 return 0;
205}
206
207INLINE dReal OdeAMotorJoint::
208get_param_hi_stop(int axis) const {
209 nassertr( _id != 0, 0 );
210 nassertr( 0 <= axis && axis <= 2, 0 );
211 if ( axis == 0 ) {
212 return dJointGetAMotorParam(_id, dParamHiStop);
213 } else if ( axis == 1 ) {
214 return dJointGetAMotorParam(_id, dParamHiStop);
215 } else if ( axis == 2 ) {
216 return dJointGetAMotorParam(_id, dParamHiStop);
217 }
218 return 0;
219}
220
221INLINE dReal OdeAMotorJoint::
222get_param_vel(int axis) const {
223 nassertr( _id != 0, 0 );
224 nassertr( 0 <= axis && axis <= 2, 0 );
225 if ( axis == 0 ) {
226 return dJointGetAMotorParam(_id, dParamVel);
227 } else if ( axis == 1 ) {
228 return dJointGetAMotorParam(_id, dParamVel);
229 } else if ( axis == 2 ) {
230 return dJointGetAMotorParam(_id, dParamVel);
231 }
232 return 0;
233}
234
235INLINE dReal OdeAMotorJoint::
236get_param_f_max(int axis) const {
237 nassertr( _id != 0, 0 );
238 nassertr( 0 <= axis && axis <= 2, 0 );
239 if ( axis == 0 ) {
240 return dJointGetAMotorParam(_id, dParamFMax);
241 } else if ( axis == 1 ) {
242 return dJointGetAMotorParam(_id, dParamFMax);
243 } else if ( axis == 2 ) {
244 return dJointGetAMotorParam(_id, dParamFMax);
245 }
246 return 0;
247}
248
249INLINE dReal OdeAMotorJoint::
250get_param_fudge_factor(int axis) const {
251 nassertr( _id != 0, 0 );
252 nassertr( 0 <= axis && axis <= 2, 0 );
253 if ( axis == 0 ) {
254 return dJointGetAMotorParam(_id, dParamFudgeFactor);
255 } else if ( axis == 1 ) {
256 return dJointGetAMotorParam(_id, dParamFudgeFactor);
257 } else if ( axis == 2 ) {
258 return dJointGetAMotorParam(_id, dParamFudgeFactor);
259 }
260 return 0;
261}
262
263INLINE dReal OdeAMotorJoint::
264get_param_bounce(int axis) const {
265 nassertr( _id != 0, 0 );
266 nassertr( 0 <= axis && axis <= 2, 0 );
267 if ( axis == 0 ) {
268 return dJointGetAMotorParam(_id, dParamBounce);
269 } else if ( axis == 1 ) {
270 return dJointGetAMotorParam(_id, dParamBounce);
271 } else if ( axis == 2 ) {
272 return dJointGetAMotorParam(_id, dParamBounce);
273 }
274 return 0;
275}
276
277INLINE dReal OdeAMotorJoint::
278get_param_CFM(int axis) const {
279 nassertr( _id != 0, 0 );
280 nassertr( 0 <= axis && axis <= 2, 0 );
281 if ( axis == 0 ) {
282 return dJointGetAMotorParam(_id, dParamCFM);
283 } else if ( axis == 1 ) {
284 return dJointGetAMotorParam(_id, dParamCFM);
285 } else if ( axis == 2 ) {
286 return dJointGetAMotorParam(_id, dParamCFM);
287 }
288 return 0;
289}
290
291INLINE dReal OdeAMotorJoint::
292get_param_stop_ERP(int axis) const {
293 nassertr( _id != 0, 0 );
294 nassertr( 0 <= axis && axis <= 2, 0 );
295 if ( axis == 0 ) {
296 return dJointGetAMotorParam(_id, dParamStopERP);
297 } else if ( axis == 1 ) {
298 return dJointGetAMotorParam(_id, dParamStopERP);
299 } else if ( axis == 2 ) {
300 return dJointGetAMotorParam(_id, dParamStopERP);
301 }
302 return 0;
303}
304
305INLINE dReal OdeAMotorJoint::
306get_param_stop_CFM(int axis) const {
307 nassertr( _id != 0, 0 );
308 nassertr( 0 <= axis && axis <= 2, 0 );
309 if ( axis == 0 ) {
310 return dJointGetAMotorParam(_id, dParamStopCFM);
311 } else if ( axis == 1 ) {
312 return dJointGetAMotorParam(_id, dParamStopCFM);
313 } else if ( axis == 2 ) {
314 return dJointGetAMotorParam(_id, dParamStopCFM);
315 }
316 return 0;
317}