When we are asked to produce no force on a Surface (e.g. a weight that
is "off"), make sure the force is actually zero. Kind of a hack -- a better idea would be flag to set at a higher level.
This commit is contained in:
parent
1dae811546
commit
91c024ebec
1 changed files with 7 additions and 0 deletions
|
@ -158,6 +158,13 @@ void Surface::calcForce(float* v, float rho, float* out, float* torque)
|
|||
return;
|
||||
}
|
||||
|
||||
// special case this so the logic below doesn't produce a non-zero
|
||||
// force; should probably have a "no force" flag instead...
|
||||
if(_cx == 0. && _cy == 0. && _cz == 0.) {
|
||||
for(int i=0; i<3; i++) out[i] = torque[i] = 0.;
|
||||
return;
|
||||
}
|
||||
|
||||
Math::mul3(1/vel, v, out);
|
||||
|
||||
// Convert to the surface's coordinates
|
||||
|
|
Loading…
Add table
Reference in a new issue