1
0
Fork 0

YASim comments

This commit is contained in:
Henning Stahlke 2017-02-27 09:09:16 +01:00
parent 1198f5a3ec
commit dc66959b83

View file

@ -203,8 +203,7 @@ void Surface::calcForce(const float* v, const float rho, float* out, float* torq
// Split v into magnitude and direction:
float vel = Math::mag3(v);
// Handle the blowup condition. Zero velocity means zero force by
// definition.
// Zero velocity means zero force by definition (also prevents div0).
if(vel == 0) {
int i;
for(i=0; i<3; i++) out[i] = torque[i] = 0;
@ -218,9 +217,8 @@ void Surface::calcForce(const float* v, const float rho, float* out, float* torq
return;
}
// Normalize wind and convert to the surface's coordinates
Math::mul3(1/vel, v, out);
// Convert to the surface's coordinates
Math::vmul33(_orient, out, out);
// "Rotate" by the incidence angle. Assume small angles, so we