// for contrails bool Atmosphere::GetWind (SLong height, SLong& x, SLong& y, SLong& z) { if (Save_Data.flightdifficulty [FD_WINDEFFECTS]) { // x = (SLong)Wind.x; // y = (SLong)Wind.y; // z = (SLong)Wind.z; SWord dir, vel; GetWindDirVel(height, dir, vel); if (!vel) { x = y = z = 0; return(true); } SWord _sin, _cos; Math_Lib.high_sin_cos((Angles)dir, _sin, _cos); x = (-vel * _sin) / ANGLES_FRACT; y = 0; z = (-vel * _cos) / ANGLES_FRACT; } else { x = 0; y = 0; z = 0; } return true; }
// for contrails FP Atmosphere::GetWind (SLong height, SLong& x, SLong& y, SLong& z) { if (Save_Data.flightdifficulty [FD_WINDEFFECTS]) { SWord dir; FP vel; //RJS 16Dec99 GetWindDirVel(height, dir, vel); if(!vel) { x = y = z = 0; } else { Float sin, cos; Math_Lib.high_sin_cos((Angles)dir, sin, cos); x = -vel * sin; y = 0; z = -vel * cos; return vel; } } else { x = 0; y = 0; z = 0; } return 0; }
// for contrails Bool Atmosphere::GetWind (SLong height, SLong& x, SLong& y, SLong& z) { if (Save_Data.flightdifficulty [FD_WINDEFFECTS]) { // x = (SLong)Wind.x; // y = (SLong)Wind.y; // z = (SLong)Wind.z; //DeadCode CSB 10/06/99 if (height <= (WindAltHeight - FT_10000)) //DeadCode CSB 10/06/99 { //DeadCode CSB 10/06/99 x = (SLong)(Wind0.x * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 y = (SLong)(Wind0.y * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 z = (SLong)(Wind0.z * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 } //DeadCode CSB 10/06/99 else if (height > WindAltHeight) //DeadCode CSB 10/06/99 { //DeadCode CSB 10/06/99 x = (SLong)(WindAlt.x * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 y = (SLong)(WindAlt.y * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 z = (SLong)(WindAlt.z * 10.0); //RJS 30Apr99 //DeadCode CSB 10/06/99 //DeadCode CSB 10/06/99 }else //DeadCode CSB 10/06/99 { //DeadCode CSB 10/06/99 // FP h = height; //DeadCode CSB 10/06/99 // if (h < 0) h = 0; //DeadCode CSB 10/06/99 if (height < 0) height = 0; //DeadCode CSB 10/06/99 //DeadCode CSB 10/06/99 FP frac = (height - (WindAltHeight - FT_10000)); //DeadCode CSB 10/06/99 frac /= FP(FT_10000); //DeadCode CSB 10/06/99 //DeadCode CSB 10/06/99 x = (SLong)(((frac * (WindAlt.x - Wind0.x)) + Wind0.x) * 10.0);//RJS 30Apr99 //DeadCode CSB 10/06/99 y = (SLong)(((frac * (WindAlt.y - Wind0.y)) + Wind0.y) * 10.0);//RJS 30Apr99 //DeadCode CSB 10/06/99 z = (SLong)(((frac * (WindAlt.z - Wind0.z)) + Wind0.z) * 10.0);//RJS 30Apr99 //DeadCode CSB 10/06/99 } SWord dir, vel; GetWindDirVel(height, dir, vel); if(!vel) { x = y = z = 0; return(TRUE); } SWord _sin, _cos; Math_Lib.high_sin_cos((Angles)dir, _sin, _cos); x = (-vel * _sin) / ANGLES_FRACT; y = 0; z = (-vel * _cos) / ANGLES_FRACT; } else { x = 0; y = 0; z = 0; } return TRUE; }