00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 INLINE void OdeHinge2Joint::
00017 set_anchor(dReal x, dReal y, dReal z) {
00018 dJointSetHinge2Anchor(_id, x, y, z);
00019 }
00020
00021 INLINE void OdeHinge2Joint::
00022 set_anchor(const LVecBase3f &anchor) {
00023 dJointSetHinge2Anchor(_id, anchor[0], anchor[1], anchor[2]);
00024 }
00025
00026 INLINE void OdeHinge2Joint::
00027 set_axis1(dReal x, dReal y, dReal z) {
00028 dJointSetHinge2Axis1(_id, x, y, z);
00029 }
00030
00031 INLINE void OdeHinge2Joint::
00032 set_axis1(const LVecBase3f &axis) {
00033 dJointSetHinge2Axis1(_id, axis[0], axis[1], axis[2]);
00034 }
00035
00036 INLINE void OdeHinge2Joint::
00037 set_axis2(dReal x, dReal y, dReal z) {
00038 dJointSetHinge2Axis2(_id, x, y, z);
00039 }
00040
00041 INLINE void OdeHinge2Joint::
00042 set_axis2(const LVecBase3f &axis) {
00043 dJointSetHinge2Axis2(_id, axis[0], axis[1], axis[2]);
00044 }
00045
00046 INLINE void OdeHinge2Joint::
00047 add_torques(dReal torque1, dReal torque2) {
00048 dJointAddHinge2Torques(_id, torque1, torque2);
00049 }
00050
00051 INLINE LVecBase3f OdeHinge2Joint::
00052 get_anchor() const {
00053 dVector3 result;
00054 dJointGetHinge2Anchor(_id, result);
00055 return LVecBase3f(result[0], result[1], result[2]);
00056 }
00057
00058 INLINE LVecBase3f OdeHinge2Joint::
00059 get_anchor2() const {
00060 dVector3 result;
00061 dJointGetHinge2Anchor2(_id, result);
00062 return LVecBase3f(result[0], result[1], result[2]);
00063 }
00064
00065 INLINE LVecBase3f OdeHinge2Joint::
00066 get_axis1() const {
00067 dVector3 result;
00068 dJointGetHinge2Axis1(_id, result);
00069 return LVecBase3f(result[0], result[1], result[2]);
00070 }
00071
00072 INLINE LVecBase3f OdeHinge2Joint::
00073 get_axis2() const {
00074 dVector3 result;
00075 dJointGetHinge2Axis2(_id, result);
00076 return LVecBase3f(result[0], result[1], result[2]);
00077 }
00078
00079 INLINE dReal OdeHinge2Joint::
00080 get_angle1() const {
00081 return dJointGetHinge2Angle1(_id);
00082 }
00083
00084 INLINE dReal OdeHinge2Joint::
00085 get_angle1_rate() const {
00086 return dJointGetHinge2Angle1Rate(_id);
00087 }
00088
00089 INLINE dReal OdeHinge2Joint::
00090 get_angle2_rate() const {
00091 return dJointGetHinge2Angle2Rate(_id);
00092 }
00093
00094 INLINE void OdeHinge2Joint::
00095 set_param_lo_stop(int axis, dReal val) {
00096 nassertv( _id != 0 );
00097 nassertv( 0 <= axis && axis <= 1 );
00098 if ( axis == 0 ) {
00099 dJointSetHinge2Param(_id, dParamLoStop, val);
00100 } else if ( axis == 1 ) {
00101 dJointSetHinge2Param(_id, dParamLoStop2, val);
00102 }
00103 }
00104
00105 INLINE void OdeHinge2Joint::
00106 set_param_hi_stop(int axis, dReal val) {
00107 nassertv( _id != 0 );
00108 nassertv( 0 <= axis && axis <= 1 );
00109 if ( axis == 0 ) {
00110 dJointSetHinge2Param(_id, dParamHiStop, val);
00111 } else if ( axis == 1 ) {
00112 dJointSetHinge2Param(_id, dParamHiStop2, val);
00113 }
00114 }
00115
00116 INLINE void OdeHinge2Joint::
00117 set_param_vel(int axis, dReal val) {
00118 nassertv( _id != 0 );
00119 nassertv( 0 <= axis && axis <= 1 );
00120 if ( axis == 0 ) {
00121 dJointSetHinge2Param(_id, dParamVel, val);
00122 } else if ( axis == 1 ) {
00123 dJointSetHinge2Param(_id, dParamVel2, val);
00124 }
00125 }
00126
00127 INLINE void OdeHinge2Joint::
00128 set_param_f_max(int axis, dReal val) {
00129 nassertv( _id != 0 );
00130 nassertv( 0 <= axis && axis <= 1 );
00131 if ( axis == 0 ) {
00132 dJointSetHinge2Param(_id, dParamFMax, val);
00133 } else if ( axis == 1 ) {
00134 dJointSetHinge2Param(_id, dParamFMax2, val);
00135 }
00136 }
00137
00138 INLINE void OdeHinge2Joint::
00139 set_param_fudge_factor(int axis, dReal val) {
00140 nassertv( _id != 0 );
00141 nassertv( 0 <= axis && axis <= 1 );
00142 if ( axis == 0 ) {
00143 dJointSetHinge2Param(_id, dParamFudgeFactor, val);
00144 } else if ( axis == 1 ) {
00145 dJointSetHinge2Param(_id, dParamFudgeFactor2, val);
00146 }
00147 }
00148
00149 INLINE void OdeHinge2Joint::
00150 set_param_bounce(int axis, dReal val) {
00151 nassertv( _id != 0 );
00152 nassertv( 0 <= axis && axis <= 1 );
00153 if ( axis == 0 ) {
00154 dJointSetHinge2Param(_id, dParamBounce, val);
00155 } else if ( axis == 1 ) {
00156 dJointSetHinge2Param(_id, dParamBounce2, val);
00157 }
00158 }
00159
00160 INLINE void OdeHinge2Joint::
00161 set_param_CFM(int axis, dReal val) {
00162 nassertv( _id != 0 );
00163 nassertv( 0 <= axis && axis <= 1 );
00164 if ( axis == 0 ) {
00165 dJointSetHinge2Param(_id, dParamCFM, val);
00166 } else if ( axis == 1 ) {
00167 dJointSetHinge2Param(_id, dParamCFM2, val);
00168 }
00169 }
00170
00171 INLINE void OdeHinge2Joint::
00172 set_param_stop_ERP(int axis, dReal val) {
00173 nassertv( _id != 0 );
00174 nassertv( 0 <= axis && axis <= 1 );
00175 if ( axis == 0 ) {
00176 dJointSetHinge2Param(_id, dParamStopERP, val);
00177 } else if ( axis == 1 ) {
00178 dJointSetHinge2Param(_id, dParamStopERP2, val);
00179 }
00180 }
00181
00182 INLINE void OdeHinge2Joint::
00183 set_param_stop_CFM(int axis, dReal val) {
00184 nassertv( _id != 0 );
00185 nassertv( 0 <= axis && axis <= 1 );
00186 if ( axis == 0 ) {
00187 dJointSetHinge2Param(_id, dParamStopCFM, val);
00188 } else if ( axis == 1 ) {
00189 dJointSetHinge2Param(_id, dParamStopCFM2, val);
00190 }
00191 }
00192
00193 INLINE void OdeHinge2Joint::
00194 set_param_suspension_ERP(int axis, dReal val) {
00195 nassertv( _id != 0 );
00196 nassertv( 0 <= axis && axis <= 1 );
00197 if ( axis == 0 ) {
00198 dJointSetHinge2Param(_id, dParamSuspensionERP, val);
00199 } else if ( axis == 1 ) {
00200 dJointSetHinge2Param(_id, dParamSuspensionERP2, val);
00201 }
00202 }
00203
00204 INLINE void OdeHinge2Joint::
00205 set_param_suspension_CFM(int axis, dReal val) {
00206 nassertv( _id != 0 );
00207 nassertv( 0 <= axis && axis <= 1 );
00208 if ( axis == 0 ) {
00209 dJointSetHinge2Param(_id, dParamSuspensionCFM, val);
00210 } else if ( axis == 1 ) {
00211 dJointSetHinge2Param(_id, dParamSuspensionCFM2, val);
00212 }
00213 }
00214
00215 INLINE dReal OdeHinge2Joint::
00216 get_param_lo_stop(int axis) const {
00217 nassertr( _id != 0, 0 );
00218 nassertr( 0 <= axis && axis <= 1, 0 );
00219 if ( axis == 0 ) {
00220 return dJointGetHinge2Param(_id, dParamLoStop);
00221 } else if ( axis == 1 ) {
00222 return dJointGetHinge2Param(_id, dParamLoStop2);
00223 }
00224 return 0;
00225 }
00226
00227 INLINE dReal OdeHinge2Joint::
00228 get_param_hi_stop(int axis) const {
00229 nassertr( _id != 0, 0 );
00230 nassertr( 0 <= axis && axis <= 1, 0 );
00231 if ( axis == 0 ) {
00232 return dJointGetHinge2Param(_id, dParamHiStop);
00233 } else if ( axis == 1 ) {
00234 return dJointGetHinge2Param(_id, dParamHiStop2);
00235 }
00236 return 0;
00237 }
00238
00239 INLINE dReal OdeHinge2Joint::
00240 get_param_vel(int axis) const {
00241 nassertr( _id != 0, 0 );
00242 nassertr( 0 <= axis && axis <= 1, 0 );
00243 if ( axis == 0 ) {
00244 return dJointGetHinge2Param(_id, dParamVel);
00245 } else if ( axis == 1 ) {
00246 return dJointGetHinge2Param(_id, dParamVel2);
00247 }
00248 return 0;
00249 }
00250
00251 INLINE dReal OdeHinge2Joint::
00252 get_param_f_max(int axis) const {
00253 nassertr( _id != 0, 0 );
00254 nassertr( 0 <= axis && axis <= 1, 0 );
00255 if ( axis == 0 ) {
00256 return dJointGetHinge2Param(_id, dParamFMax);
00257 } else if ( axis == 1 ) {
00258 return dJointGetHinge2Param(_id, dParamFMax2);
00259 }
00260 return 0;
00261 }
00262
00263 INLINE dReal OdeHinge2Joint::
00264 get_param_fudge_factor(int axis) const {
00265 nassertr( _id != 0, 0 );
00266 nassertr( 0 <= axis && axis <= 1, 0 );
00267 if ( axis == 0 ) {
00268 return dJointGetHinge2Param(_id, dParamFudgeFactor);
00269 } else if ( axis == 1 ) {
00270 return dJointGetHinge2Param(_id, dParamFudgeFactor2);
00271 }
00272 return 0;
00273 }
00274
00275 INLINE dReal OdeHinge2Joint::
00276 get_param_bounce(int axis) const {
00277 nassertr( _id != 0, 0 );
00278 nassertr( 0 <= axis && axis <= 1, 0 );
00279 if ( axis == 0 ) {
00280 return dJointGetHinge2Param(_id, dParamBounce);
00281 } else if ( axis == 1 ) {
00282 return dJointGetHinge2Param(_id, dParamBounce2);
00283 }
00284 return 0;
00285 }
00286
00287 INLINE dReal OdeHinge2Joint::
00288 get_param_CFM(int axis) const {
00289 nassertr( _id != 0, 0 );
00290 nassertr( 0 <= axis && axis <= 1, 0 );
00291 if ( axis == 0 ) {
00292 return dJointGetHinge2Param(_id, dParamCFM);
00293 } else if ( axis == 1 ) {
00294 return dJointGetHinge2Param(_id, dParamCFM2);
00295 }
00296 return 0;
00297 }
00298
00299 INLINE dReal OdeHinge2Joint::
00300 get_param_stop_ERP(int axis) const {
00301 nassertr( _id != 0, 0 );
00302 nassertr( 0 <= axis && axis <= 1, 0 );
00303 if ( axis == 0 ) {
00304 return dJointGetHinge2Param(_id, dParamStopERP);
00305 } else if ( axis == 1 ) {
00306 return dJointGetHinge2Param(_id, dParamStopERP2);
00307 }
00308 return 0;
00309 }
00310
00311 INLINE dReal OdeHinge2Joint::
00312 get_param_stop_CFM(int axis) const {
00313 nassertr( _id != 0, 0 );
00314 nassertr( 0 <= axis && axis <= 1, 0 );
00315 if ( axis == 0 ) {
00316 return dJointGetHinge2Param(_id, dParamStopCFM);
00317 } else if ( axis == 1 ) {
00318 return dJointGetHinge2Param(_id, dParamStopCFM2);
00319 }
00320 return 0;
00321 }
00322
00323 INLINE dReal OdeHinge2Joint::
00324 get_param_suspension_ERP(int axis) const {
00325 nassertr( _id != 0, 0 );
00326 nassertr( 0 <= axis && axis <= 1, 0 );
00327 if ( axis == 0 ) {
00328 return dJointGetHinge2Param(_id, dParamSuspensionERP);
00329 } else if ( axis == 1 ) {
00330 return dJointGetHinge2Param(_id, dParamSuspensionERP2);
00331 }
00332 return 0;
00333 }
00334
00335 INLINE dReal OdeHinge2Joint::
00336 get_param_suspension_CFM(int axis) const {
00337 nassertr( _id != 0, 0 );
00338 nassertr( 0 <= axis && axis <= 1, 0 );
00339 if ( axis == 0 ) {
00340 return dJointGetHinge2Param(_id, dParamSuspensionCFM);
00341 } else if ( axis == 1 ) {
00342 return dJointGetHinge2Param(_id, dParamSuspensionCFM2);
00343 }
00344 return 0;
00345 }
00346