[ODE] C++
Colin Reed
colin at nintendo.co.jp
Tue Nov 6 01:37:02 MST 2001
Any chance of adding these functions to the codebase ?
/*----------------------------------------------------------------------------------*/
// Please add to include/ode/objects.h
//
void dBodyAddForceAtRelPos (dBodyID, dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz);
void dBodyGetPointVel (dBodyID, dReal px, dReal py, dReal pz, dVector3
result);
/*----------------------------------------------------------------------------------*/
// Please add to ode.cpp
//
void dBodyAddForceAtRelPos (dBodyID b, dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz) {
dAASSERT (b);
b->facc[0] += fx;
b->facc[1] += fy;
b->facc[2] += fz;
dVector3 prel,f,p;
prel[0] = px;
prel[1] = py;
prel[2] = pz;
prel[3] = 0;
dMULTIPLY0_331 (p,b->R,prel);
f[0] = fx;
f[1] = fy;
f[2] = fz;
dCROSS (b->tacc,+=,p,f);
}
void dBodyGetPointVel (dBodyID b, dReal px, dReal py, dReal pz, dVector3
result) {
dAASSERT (b);
dVector3 prel;
prel[0] = px - b->pos[0];
prel[1] = py - b->pos[1];
prel[2] = pz - b->pos[2];
prel[3] = 0;
result[0] = b->lvel[0];
result[1] = b->lvel[1];
result[2] = b->lvel[2];
dCROSS (result,+=,b->avel,prel);
}
/*----------------------------------------------------------------------------------*/
Thanks,
Colin
More information about the ODE
mailing list