1
0
Fork 0

FG_ to SG_ namespace changes.

This commit is contained in:
curt 2001-03-24 02:36:45 +00:00
parent 1bf3001749
commit 17f3d48e03
23 changed files with 103 additions and 102 deletions

View file

@ -274,7 +274,7 @@ float get_climb_rate( void )
float get_view_direction( void )
{
double view_off = SG_2PI - globals->get_current_view()->get_view_offset();
double view_off = SGD_2PI - globals->get_current_view()->get_view_offset();
double view = ( current_aircraft.fdm_state->get_Psi() + view_off)
* RAD_TO_DEG;

View file

@ -276,8 +276,8 @@ void HudLadder :: draw( void )
// velocity vector
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
for(count=0; count<50; count++) {
cosine = 6 * cos(count * 2 * SG_PI/50.0);
sine = 6 * sin(count * 2 * SG_PI/50.0);
cosine = 6 * cos(count * 2 * SGD_PI/50.0);
sine = 6 * sin(count * 2 * SGD_PI/50.0);
glVertex2f(cosine+vel_x, sine+vel_y);
}
glEnd();

View file

@ -68,18 +68,18 @@ operator = (const fgTBI_instr & rhs )
bank_angle = current_ch2(); // Roll limit +/- 30 degrees
if( bank_angle < -SG_PI_2/3 ) {
bank_angle = -SG_PI_2/3;
} else if( bank_angle > SG_PI_2/3 ) {
bank_angle = SG_PI_2/3;
if( bank_angle < -SGD_PI_2/3 ) {
bank_angle = -SGD_PI_2/3;
} else if( bank_angle > SGD_PI_2/3 ) {
bank_angle = SGD_PI_2/3;
}
sideslip_angle = current_ch1(); // Sideslip limit +/- 20 degrees
if( sideslip_angle < -SG_PI/9 ) {
sideslip_angle = -SG_PI/9;
} else if( sideslip_angle > SG_PI/9 ) {
sideslip_angle = SG_PI/9;
if( sideslip_angle < -SGD_PI/9 ) {
sideslip_angle = -SGD_PI/9;
} else if( sideslip_angle > SGD_PI/9 ) {
sideslip_angle = SGD_PI/9;
}
cen_x = centroid.x;
@ -88,7 +88,7 @@ operator = (const fgTBI_instr & rhs )
tee = -tee_height;
fspan = span;
hole = scr_hole;
ss_const = 2 * sideslip_angle * fspan/(SG_2PI/9); // width represents 40 degrees
ss_const = 2 * sideslip_angle * fspan/(SGD_2PI/9); // width represents 40 degrees
// printf("side_slip: %f fspan: %f\n", sideslip_angle, fspan);
// printf("ss_const: %f hole: %f\n", ss_const, hole);

View file

@ -78,10 +78,10 @@ balloon::balloon()
/* size for hot air balloons */
/************************************************************************/
balloon_envelope_area = 4.0 * (8.8 * 8.8) * SG_PI;
balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SG_PI;
balloon_envelope_area = 4.0 * (8.8 * 8.8) * SGD_PI;
balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SGD_PI;
wind_facing_area_of_balloon = SG_PI * (8.8 * 8.8);
wind_facing_area_of_balloon = SGD_PI * (8.8 * 8.8);
wind_facing_area_of_basket = 2.0; //guessed: 2 m^2
cw_envelope=0.45; //a sphere in this case

View file

@ -69,7 +69,7 @@ enum eParam {
FG_ALPHADOT,
FG_BETA,
FG_BETADOT,
SG_PITCHRATE,
SGD_PITCHRATE,
FG_ROLLRATE,
FG_YAWRATE,
FG_MACH,
@ -91,7 +91,7 @@ enum eParam {
FG_THROTTLE_CMD,
FG_THROTTLE_POS,
FG_HOVERB,
SG_PITCH_TRIM_CMD
SGD_PITCH_TRIM_CMD
};
/******************************************************************************/

View file

@ -89,7 +89,7 @@ CLASS DOCUMENTATION
&lt COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER"&gt
ID 0
INPUT FG_ELEVATOR_CMD
INPUT SG_PITCH_TRIM_CMD
INPUT SGD_PITCH_TRIM_CMD
CLIPTO -1 1
&lt/COMPONENT&gt

View file

@ -69,7 +69,7 @@ INCLUDES
#ifndef M_PI
# include <simgear/constants.h>
# define M_PI SG_PI
# define M_PI SGD_PI
#endif
#include "FGModel.h"

View file

@ -49,7 +49,7 @@ INCLUDES
#ifndef M_PI
# include <simgear/constants.h>
# define M_PI SG_PI
# define M_PI SGD_PI
#endif
#include "FGState.h"
@ -102,7 +102,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
RegisterVariable(FG_ALPHADOT, " alphadot " );
RegisterVariable(FG_BETA, " beta " );
RegisterVariable(FG_BETADOT, " betadot " );
RegisterVariable(SG_PITCHRATE, " pitch_rate " );
RegisterVariable(SGD_PITCHRATE, " pitch_rate " );
RegisterVariable(FG_ROLLRATE, " roll_rate " );
RegisterVariable(FG_YAWRATE, " yaw_rate " );
RegisterVariable(FG_MACH, " mach " );
@ -124,7 +124,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
RegisterVariable(FG_THROTTLE_CMD, " throttle_cmd " );
RegisterVariable(FG_THROTTLE_POS, " throttle_pos " );
RegisterVariable(FG_HOVERB, " height/span " );
RegisterVariable(SG_PITCH_TRIM_CMD, " pitch_trim_cmd " );
RegisterVariable(SGD_PITCH_TRIM_CMD, " pitch_trim_cmd " );
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -151,7 +151,7 @@ float FGState::GetParameter(eParam val_idx) {
return FDMExec->GetTranslation()->Getbeta();
case FG_BETADOT:
return FDMExec->GetTranslation()->Getbdot();
case SG_PITCHRATE:
case SGD_PITCHRATE:
return (FDMExec->GetRotation()->GetPQR())(2);
case FG_ROLLRATE:
return (FDMExec->GetRotation()->GetPQR())(1);
@ -201,7 +201,7 @@ float FGState::GetParameter(eParam val_idx) {
return FDMExec->GetFCS()->GetThrottlePos(0);
case FG_HOVERB:
return FDMExec->GetPosition()->GetHOverB();
case SG_PITCH_TRIM_CMD:
case SGD_PITCH_TRIM_CMD:
return FDMExec->GetFCS()->GetPitchTrimCmd();
default:
cerr << "FGState::GetParameter() - No handler for parameter " << val_idx << endl;

View file

@ -189,7 +189,7 @@ void FGTrim::ReportState(void) {
cout << out;
sprintf(out, " Normal Load Factor: %4.2f g's Pitch Rate: %5.2f deg/s\n",
fdmex->GetAircraft()->GetNlf(),
fdmex->GetState()->GetParameter(SG_PITCHRATE)*RADTODEG );
fdmex->GetState()->GetParameter(SGD_PITCHRATE)*RADTODEG );
cout << out;
sprintf(out, " Heading: %3.0f deg true Sideslip: %5.2f deg\n",
fdmex->GetRotation()->Getpsi()*RADTODEG,

View file

@ -474,12 +474,12 @@ bool FGLaRCsim::copy_from_LaRCsim() {
<< " radius_to_vehicle = " << Radius_to_vehicle );
double tmp_lon_geoc = Lon_geocentric;
while ( tmp_lon_geoc < -SG_PI ) { tmp_lon_geoc += SG_2PI; }
while ( tmp_lon_geoc > SG_PI ) { tmp_lon_geoc -= SG_2PI; }
while ( tmp_lon_geoc < -SGD_PI ) { tmp_lon_geoc += SG_2PI; }
while ( tmp_lon_geoc > SGD_PI ) { tmp_lon_geoc -= SG_2PI; }
double tmp_lon = Longitude;
while ( tmp_lon < -SG_PI ) { tmp_lon += SG_2PI; }
while ( tmp_lon > SG_PI ) { tmp_lon -= SG_2PI; }
while ( tmp_lon < -SGD_PI ) { tmp_lon += SG_2PI; }
while ( tmp_lon > SGD_PI ) { tmp_lon -= SG_2PI; }
// Positions
_set_Geocentric_Position( Lat_geocentric, tmp_lon_geoc,

View file

@ -62,11 +62,12 @@ bool FGMagicCarpet::update( int multiloop ) {
_set_V_ground_speed( kts );
// angle of turn
double turn_rate = controls.get_aileron() * SG_PI_4; // radians/sec
double turn_rate = controls.get_aileron() * SGD_PI_4; // radians/sec
double turn = turn_rate * time_step;
// update euler angles
_set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, SG_2PI) );
_set_Euler_Angles( get_Phi(), get_Theta(),
fmod(get_Psi() + turn, SGD_2PI) );
_set_Euler_Rates(0,0,0);
// update (lon/lat) position

View file

@ -349,7 +349,7 @@ void guiMotionFunc ( int x, int y )
need_warp = 1;
x = 1;
}
// try to get SG_PI movement in each half of screen
// try to get SGD_PI movement in each half of screen
// do spherical pan
W = ww;
H = wh;

View file

@ -152,28 +152,28 @@ void GLUTkey(unsigned char k, int x, int y) {
}
return;
case 49: // numeric keypad 1
v->set_goal_view_offset( SG_PI * 0.75 );
v->set_goal_view_offset( SGD_PI * 0.75 );
return;
case 50: // numeric keypad 2
v->set_goal_view_offset( SG_PI );
v->set_goal_view_offset( SGD_PI );
return;
case 51: // numeric keypad 3
v->set_goal_view_offset( SG_PI * 1.25 );
v->set_goal_view_offset( SGD_PI * 1.25 );
return;
case 52: // numeric keypad 4
v->set_goal_view_offset( SG_PI * 0.50 );
v->set_goal_view_offset( SGD_PI * 0.50 );
return;
case 54: // numeric keypad 6
v->set_goal_view_offset( SG_PI * 1.50 );
v->set_goal_view_offset( SGD_PI * 1.50 );
return;
case 55: // numeric keypad 7
v->set_goal_view_offset( SG_PI * 0.25 );
v->set_goal_view_offset( SGD_PI * 0.25 );
return;
case 56: // numeric keypad 8
v->set_goal_view_offset( 0.00 );
return;
case 57: // numeric keypad 9
v->set_goal_view_offset( SG_PI * 1.75 );
v->set_goal_view_offset( SGD_PI * 1.75 );
return;
case 65: // A key
speed = fgGetInt("/sim/speed-up");
@ -497,28 +497,28 @@ void GLUTspecialkey(int k, int x, int y) {
return;
}
case GLUT_KEY_END: // numeric keypad 1
v->set_goal_view_offset( SG_PI * 0.75 );
v->set_goal_view_offset( SGD_PI * 0.75 );
return;
case GLUT_KEY_DOWN: // numeric keypad 2
v->set_goal_view_offset( SG_PI );
v->set_goal_view_offset( SGD_PI );
return;
case GLUT_KEY_PAGE_DOWN: // numeric keypad 3
v->set_goal_view_offset( SG_PI * 1.25 );
v->set_goal_view_offset( SGD_PI * 1.25 );
return;
case GLUT_KEY_LEFT: // numeric keypad 4
v->set_goal_view_offset( SG_PI * 0.50 );
v->set_goal_view_offset( SGD_PI * 0.50 );
return;
case GLUT_KEY_RIGHT: // numeric keypad 6
v->set_goal_view_offset( SG_PI * 1.50 );
v->set_goal_view_offset( SGD_PI * 1.50 );
return;
case GLUT_KEY_HOME: // numeric keypad 7
v->set_goal_view_offset( SG_PI * 0.25 );
v->set_goal_view_offset( SGD_PI * 0.25 );
return;
case GLUT_KEY_UP: // numeric keypad 8
v->set_goal_view_offset( 0.00 );
return;
case GLUT_KEY_PAGE_UP: // numeric keypad 9
v->set_goal_view_offset( SG_PI * 1.75 );
v->set_goal_view_offset( SGD_PI * 1.75 );
return;
}
} else {

View file

@ -802,13 +802,13 @@ void fgUpdateTimeDepCalcs() {
// current_view.goal_view_offset
if ( v->get_goal_view_offset() > v->get_view_offset() )
{
if ( v->get_goal_view_offset() - v->get_view_offset() < SG_PI ){
if ( v->get_goal_view_offset() - v->get_view_offset() < SGD_PI ){
v->inc_view_offset( 0.01 );
} else {
v->inc_view_offset( -0.01 );
}
} else {
if ( v->get_view_offset() - v->get_goal_view_offset() < SG_PI ){
if ( v->get_view_offset() - v->get_goal_view_offset() < SGD_PI ){
v->inc_view_offset( -0.01 );
} else {
v->inc_view_offset( 0.01 );
@ -822,7 +822,7 @@ void fgUpdateTimeDepCalcs() {
}
}
double tmp = -(l->sun_rotation + SG_PI)
double tmp = -(l->sun_rotation + SGD_PI)
- (cur_fdm_state->get_Psi() -
globals->get_current_view()->get_view_offset() );
while ( tmp < 0.0 ) {
@ -833,7 +833,7 @@ void fgUpdateTimeDepCalcs() {
}
/* printf("Psi = %.2f, viewoffset = %.2f sunrot = %.2f rottosun = %.2f\n",
FG_Psi * RAD_TO_DEG, current_view.view_offset * RAD_TO_DEG,
-(l->sun_rotation+SG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
-(l->sun_rotation+SGD_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
l->UpdateAdjFog();
// Update solar system

View file

@ -820,9 +820,9 @@ parse_option (const string& arg)
string woffset = arg.substr( 14 );
double default_view_offset = 0.0;
if ( woffset == "LEFT" ) {
default_view_offset = SG_PI * 0.25;
default_view_offset = SGD_PI * 0.25;
} else if ( woffset == "RIGHT" ) {
default_view_offset = SG_PI * 1.75;
default_view_offset = SGD_PI * 1.75;
} else if ( woffset == "CENTER" ) {
default_view_offset = 0.00;
} else {

View file

@ -33,7 +33,7 @@ main() {
// Yaw Matrix
MAT3_SET_HVEC(vec, 0.0, -1.0, 0.0, 1.0);
MAT3rotate(R_Psi, vec, SG_PI + FG_Psi);
MAT3rotate(R_Psi, vec, SGD_PI + FG_Psi);
printf("\nYaw matrix (Psi)\n");
MAT3print(R_Psi, stdout);
@ -47,7 +47,7 @@ main() {
// Longitude
MAT3_SET_HVEC(vec, 0.0, 0.0, 1.0, 1.0);
// R_Lon = rotate about Z axis
MAT3rotate(R_Lon, vec, FG_Longitude - SG_PI_2 );
MAT3rotate(R_Lon, vec, FG_Longitude - SGD_PI_2 );
printf("\nLongitude matrix\n");
MAT3print(R_Lon, stdout);

View file

@ -200,7 +200,7 @@ void FGViewerLookAt::update() {
sgNegateVec3(world_down, world_up);
sgVectorProductVec3(surface_east, surface_south, world_down);
#else
sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
// cout << "sgMat4 TMP" << endl;
// print_sgMat4( TMP );
sgXformVec3(surface_east, surface_south, TMP);

View file

@ -326,7 +326,7 @@ void FGViewerRPH::update() {
sgNegateVec3(world_down, world_up);
sgVectorProductVec3(surface_east, surface_south, world_down);
#else
sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
// cout << "sgMat4 TMP" << endl;
// print_sgMat4( TMP );
sgXformVec3(surface_east, surface_south, TMP);

View file

@ -104,11 +104,11 @@ bool FGRAY::gen_message() {
/* Make sure the angles are reasonable onscale */
/* We use an asymmetric mapping so that the chair behaves
reasonably when upside down. Otherwise it oscillates. */
while ( ang_pos < -2*SG_PI/3 ) {
ang_pos += 2 * SG_PI;
while ( ang_pos < -2*SGD_PI/3 ) {
ang_pos += 2 * SGD_PI;
}
while ( ang_pos > 4*SG_PI/3 ) {
ang_pos -= 2 * SG_PI;
while ( ang_pos > 4*SGD_PI/3 ) {
ang_pos -= 2 * SGD_PI;
}
/* Tell interested parties what the situation is */
@ -131,11 +131,11 @@ bool FGRAY::gen_message() {
/* yaw */
/* Make sure that we walk through North cleanly */
if ( fabs ( ang_pos - chair_heading ) > SG_PI )
if ( fabs ( ang_pos - chair_heading ) > SGD_PI )
{ /* Need to swing chair by 360 degrees */
if ( ang_pos < chair_heading )
chair_heading -= 2 * SG_PI;
else chair_heading += 2 * SG_PI;
chair_heading -= 2 * SGD_PI;
else chair_heading += 2 * SGD_PI;
}
/* Remove the chair heading from the true heading */
ang_pos -= chair_heading;
@ -144,7 +144,7 @@ bool FGRAY::gen_message() {
can just about represent 30 degrees full scale. */
chair_heading += ang_pos * dt * 0.2;
/* If they turn fast, at 90 deg error subtract 30 deg */
if ( fabs(ang_pos) > SG_PI / 2 )
if ( fabs(ang_pos) > SGD_PI / 2 )
chair_heading += ang_pos / 3;
} else
@ -178,8 +178,8 @@ bool FGRAY::gen_message() {
/* Scale to the hardware's full scale range */
propose /= fullscale [ subaxis ];
/* Use a sine shaped washout on all axes */
if ( propose < -SG_PI / 2 ) *dac = 0x0000; else
if ( propose > SG_PI / 2 ) *dac = 0xFFFF; else
if ( propose < -SGD_PI / 2 ) *dac = 0x0000; else
if ( propose > SGD_PI / 2 ) *dac = 0xFFFF; else
*dac = (unsigned short) ( 32767 *
( 1.0 + sin ( propose ) ) );
}

View file

@ -71,7 +71,7 @@ bool FGMorse::init() {
// Make Low DIT
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
* ((double)i / TRANSITION_BYTES)
/ 2.0 + 0.5;
@ -82,7 +82,7 @@ bool FGMorse::init() {
for ( i = TRANSITION_BYTES;
i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
/ 2.0 + 0.5;
@ -93,7 +93,7 @@ bool FGMorse::init() {
for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DIT_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;
@ -107,7 +107,7 @@ bool FGMorse::init() {
// Make High DIT
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY)) )
* ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
@ -117,7 +117,7 @@ bool FGMorse::init() {
for ( i = TRANSITION_BYTES;
i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY) ) )
/ 2.0 + 0.5;
@ -128,7 +128,7 @@ bool FGMorse::init() {
for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DIT_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;
@ -142,7 +142,7 @@ bool FGMorse::init() {
// Make Low DAH
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
* ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
@ -153,7 +153,7 @@ bool FGMorse::init() {
for ( i = TRANSITION_BYTES;
i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
/ 2.0 + 0.5;
@ -164,7 +164,7 @@ bool FGMorse::init() {
for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DAH_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / LO_FREQUENCY) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;
@ -178,7 +178,7 @@ bool FGMorse::init() {
// Make High DAH
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY) ) )
* ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
@ -189,7 +189,7 @@ bool FGMorse::init() {
for ( i = TRANSITION_BYTES;
i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY) ) )
/ 2.0 + 0.5;
@ -200,7 +200,7 @@ bool FGMorse::init() {
for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DAH_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI
float level = ( sin( (double) i * 2.0 * SGD_PI
/ (8000.0 / HI_FREQUENCY) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;
@ -227,7 +227,7 @@ bool FGMorse::cust_init(const int freq ) {
// Make DIT
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq)) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq)) )
* ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
/* Convert to unsigned byte */
@ -236,7 +236,7 @@ bool FGMorse::cust_init(const int freq ) {
for ( i = TRANSITION_BYTES;
i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
/ 2.0 + 0.5;
/* Convert to unsigned byte */
@ -246,7 +246,7 @@ bool FGMorse::cust_init(const int freq ) {
for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DIT_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;
@ -259,7 +259,7 @@ bool FGMorse::cust_init(const int freq ) {
// Make DAH
for ( i = 0; i < TRANSITION_BYTES; ++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
* ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
/* Convert to unsigned byte */
@ -269,7 +269,7 @@ bool FGMorse::cust_init(const int freq ) {
for ( i = TRANSITION_BYTES;
i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
/ 2.0 + 0.5;
/* Convert to unsigned byte */
@ -279,7 +279,7 @@ bool FGMorse::cust_init(const int freq ) {
for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
i < DAH_SIZE - COUNT_SIZE;
++i ) {
float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
* ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
--j;

View file

@ -167,10 +167,10 @@ void fgLIGHT::UpdateAdjFog( void ) {
// first determine the difference between our view angle and local
// direction to the sun
rotation = -(sun_rotation + SG_PI)
rotation = -(sun_rotation + SGD_PI)
- (f->get_Psi() - globals->get_current_view()->get_view_offset());
if ( globals->get_current_view()->get_reverse_view_offset() ) {
rotation += SG_PI;
rotation += SGD_PI;
}
while ( rotation < 0 ) {
rotation += SG_2PI;

View file

@ -284,12 +284,12 @@ void fgMoonPosition(time_t ssue, double *lon, double *lat) {
ecliptic_to_equatorial( globals->get_ephem()->get_moon()->getLon(),
0.0, &alpha, &delta );
tmp = alpha - (SG_2PI/24)*GST(ssue);
if (tmp < -SG_PI) {
if (tmp < -SGD_PI) {
do tmp += SG_2PI;
while (tmp < -SG_PI);
} else if (tmp > SG_PI) {
while (tmp < -SGD_PI);
} else if (tmp > SGD_PI) {
do tmp -= SG_2PI;
while (tmp < -SG_PI);
while (tmp < -SGD_PI);
}
*lon = tmp;
@ -319,12 +319,12 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
// tmp = alpha - (SG_2PI/24)*GST(ssue);
tmp = alpha - (SG_2PI/24)*gst;
if (tmp < -SG_PI) {
if (tmp < -SGD_PI) {
do tmp += SG_2PI;
while (tmp < -SG_PI);
} else if (tmp > SG_PI) {
while (tmp < -SGD_PI);
} else if (tmp > SGD_PI) {
do tmp -= SG_2PI;
while (tmp < -SG_PI);
while (tmp < -SGD_PI);
}
*lon = tmp;

View file

@ -192,12 +192,12 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
ecliptic_to_equatorial( globals->get_ephem()->get_sun()->getLon(),
0.0, &alpha, &delta );
tmp = alpha - (SG_2PI/24)*GST(ssue);
if (tmp < -SG_PI) {
if (tmp < -SGD_PI) {
do tmp += SG_2PI;
while (tmp < -SG_PI);
} else if (tmp > SG_PI) {
while (tmp < -SGD_PI);
} else if (tmp > SGD_PI) {
do tmp -= SG_2PI;
while (tmp < -SG_PI);
while (tmp < -SGD_PI);
}
*lon = tmp;
@ -227,12 +227,12 @@ static void fgSunPositionGST(double gst, double *lon, double *lat) {
// tmp = alpha - (SG_2PI/24)*GST(ssue);
tmp = alpha - (SG_2PI/24)*gst;
if (tmp < -SG_PI) {
if (tmp < -SGD_PI) {
do tmp += SG_2PI;
while (tmp < -SG_PI);
} else if (tmp > SG_PI) {
while (tmp < -SGD_PI);
} else if (tmp > SGD_PI) {
do tmp -= SG_2PI;
while (tmp < -SG_PI);
while (tmp < -SGD_PI);
}
*lon = tmp;