| 1234 | |
| 1235 | |
| 1236 | extern "C" void dJointAddSliderForce (dxJointSlider *joint, dReal force) |
| 1237 | { |
| 1238 | dVector3 axis; |
| 1239 | dUASSERT(joint,"bad joint argument"); |
| 1240 | dUASSERT(joint->vtable == &__dslider_vtable,"joint is not a slider"); |
| 1241 | |
| 1242 | if (joint->flags & dJOINT_REVERSE) |
| 1243 | force -= force; |
| 1244 | |
| 1245 | getAxis (joint,axis,joint->axis1); |
| 1246 | axis[0] *= force; |
| 1247 | axis[1] *= force; |
| 1248 | axis[2] *= force; |
| 1249 | |
| 1250 | if (joint->node[0].body != 0) |
| 1251 | dBodyAddForce (joint->node[0].body,axis[0],axis[1],axis[2]); |
| 1252 | if (joint->node[1].body != 0) |
| 1253 | dBodyAddForce(joint->node[1].body, -axis[0], -axis[1], -axis[2]); |
| 1254 | } |
| 1255 | |
| 1256 | |
| 1257 | dxJoint::Vtable __dslider_vtable = { |
no test coverage detected