MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / dJointAddSliderForce

Function dJointAddSliderForce

3rd_party/Src/ode/ode/src/joint.cpp:1236–1254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1234
1235
1236extern "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
1257dxJoint::Vtable __dslider_vtable = {

Callers 1

addForceMethod · 0.85

Calls 2

getAxisFunction · 0.85
dBodyAddForceFunction · 0.85

Tested by

no test coverage detected