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

Function dMassSetBoxTotal

3rd_party/Src/ode/ode/src/mass.cpp:197–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196
197void dMassSetBoxTotal (dMass *m, dReal total_mass,
198 dReal lx, dReal ly, dReal lz)
199{
200 dAASSERT (m);
201 dMassSetZero (m);
202 m->mass = total_mass;
203 m->_I(0,0) = total_mass/REAL(12.0) * (ly*ly + lz*lz);
204 m->_I(1,1) = total_mass/REAL(12.0) * (lx*lx + lz*lz);
205 m->_I(2,2) = total_mass/REAL(12.0) * (lx*lx + ly*ly);
206
207# ifndef dNODEBUG
208 checkMass (m);
209# endif
210}
211
212
213void dMassAdjust (dMass *m, dReal newmass)

Callers 1

dMassSetBoxFunction · 0.85

Calls 2

dMassSetZeroFunction · 0.85
checkMassFunction · 0.85

Tested by

no test coverage detected