YASim comments
This commit is contained in:
parent
1198f5a3ec
commit
dc66959b83
1 changed files with 3 additions and 5 deletions
|
@ -203,8 +203,7 @@ void Surface::calcForce(const float* v, const float rho, float* out, float* torq
|
||||||
// Split v into magnitude and direction:
|
// Split v into magnitude and direction:
|
||||||
float vel = Math::mag3(v);
|
float vel = Math::mag3(v);
|
||||||
|
|
||||||
// Handle the blowup condition. Zero velocity means zero force by
|
// Zero velocity means zero force by definition (also prevents div0).
|
||||||
// definition.
|
|
||||||
if(vel == 0) {
|
if(vel == 0) {
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<3; i++) out[i] = torque[i] = 0;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Normalize wind and convert to the surface's coordinates
|
||||||
Math::mul3(1/vel, v, out);
|
Math::mul3(1/vel, v, out);
|
||||||
|
|
||||||
// Convert to the surface's coordinates
|
|
||||||
Math::vmul33(_orient, out, out);
|
Math::vmul33(_orient, out, out);
|
||||||
|
|
||||||
// "Rotate" by the incidence angle. Assume small angles, so we
|
// "Rotate" by the incidence angle. Assume small angles, so we
|
||||||
|
|
Loading…
Add table
Reference in a new issue