Vivian MEAZZA: add support for aircraft radar signatures
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
// Visual environment helper class
|
// Visual environment helper class
|
||||||
//
|
//
|
||||||
// Written by Harald JOHNSEN, started April 2005.
|
// Written by Harald JOHNSEN, started April 2005.
|
||||||
|
// Minor changes/additions by Vivian Meazza Apr- May 2007
|
||||||
|
//
|
||||||
|
// Ported to OSG by Tim Moore Jun 2007
|
||||||
//
|
//
|
||||||
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
|
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
|
||||||
//
|
//
|
||||||
@@ -331,9 +334,7 @@ void SGEnviro::setLight(sgVec4 adj_fog_color) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SGEnviro::callback_cloud(float heading, float alt, float radius, int family, float dist, int cloudId) {
|
void SGEnviro::callback_cloud(float bearing, float alt, float radius, int family, float dist, int cloudId) {
|
||||||
// OSGFIXME
|
|
||||||
return;
|
|
||||||
// send data to wx radar
|
// send data to wx radar
|
||||||
// compute turbulence
|
// compute turbulence
|
||||||
// draw precipitation
|
// draw precipitation
|
||||||
@@ -405,9 +406,10 @@ void SGEnviro::callback_cloud(float heading, float alt, float radius, int family
|
|||||||
LWC = 0.29*2.0;
|
LWC = 0.29*2.0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add to the list for the wxRadar instrument
|
// add to the list for the wxRadar instrument
|
||||||
if( LWC > 0.0 )
|
if( LWC > 0.0 )
|
||||||
radarEcho.push_back( SGWxRadarEcho ( heading, alt, radius, dist, LWC, false, cloudId ) );
|
radarEcho.push_back( SGWxRadarEcho ( bearing, alt, radius, dist, 0.0 , LWC, false, cloudId, false ) );
|
||||||
|
|
||||||
// NB:data valid only from cockpit view
|
// NB:data valid only from cockpit view
|
||||||
|
|
||||||
@@ -420,7 +422,7 @@ void SGEnviro::callback_cloud(float heading, float alt, float radius, int family
|
|||||||
orig.setlon(last_lon * SG_DEGREES_TO_RADIANS );
|
orig.setlon(last_lon * SG_DEGREES_TO_RADIANS );
|
||||||
orig.setelev(0.0);
|
orig.setelev(0.0);
|
||||||
dist = sgSqrt(dist);
|
dist = sgSqrt(dist);
|
||||||
dest = calc_gc_lon_lat(orig, heading, dist);
|
dest = calc_gc_lon_lat(orig, bearing, dist);
|
||||||
lon = dest.lon() * SG_RADIANS_TO_DEGREES;
|
lon = dest.lon() * SG_RADIANS_TO_DEGREES;
|
||||||
lat = dest.lat() * SG_RADIANS_TO_DEGREES;
|
lat = dest.lat() * SG_RADIANS_TO_DEGREES;
|
||||||
addLightning( lon, lat, alt );
|
addLightning( lon, lat, alt );
|
||||||
@@ -712,7 +714,7 @@ void SGLightning::lt_Render(void) {
|
|||||||
|
|
||||||
glTranslatef( ax, ay, -sgEnviro.last_alt );
|
glTranslatef( ax, ay, -sgEnviro.last_alt );
|
||||||
|
|
||||||
sgEnviro.radarEcho.push_back( SGWxRadarEcho ( course, 0.0, 0.0, dist, age, true, 0 ) );
|
sgEnviro.radarEcho.push_back( SGWxRadarEcho ( course, 0.0, 0.0, dist, 0.0, age, true, 0, false ) );
|
||||||
|
|
||||||
for( int n = 0 ; n < nb_tree ; n++ ) {
|
for( int n = 0 ; n < nb_tree ; n++ ) {
|
||||||
if( lt_tree[n].prev < 0 )
|
if( lt_tree[n].prev < 0 )
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Visual environment helper class
|
// Visual environment helper class
|
||||||
//
|
//
|
||||||
// Written by Harald JOHNSEN, started April 2005.
|
// Written by Harald JOHNSEN, started April 2005.
|
||||||
|
// Minor changes/additions by Vivian Meazza Apr- May 2007
|
||||||
|
//
|
||||||
|
// Ported to OSG by Tim Moore Jun 2007
|
||||||
//
|
//
|
||||||
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
|
// Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
|
||||||
//
|
//
|
||||||
@@ -40,23 +43,32 @@ class SGSoundMgr;
|
|||||||
*/
|
*/
|
||||||
class SGWxRadarEcho {
|
class SGWxRadarEcho {
|
||||||
public:
|
public:
|
||||||
SGWxRadarEcho(float _heading, float _alt, float _radius, float _dist, double _LWC, bool _lightning, int _cloudId) :
|
SGWxRadarEcho(float _bearing, float _alt, float _radius, float _dist, float _heading,
|
||||||
|
double _LWC, bool _lightning, int _cloudId, bool _aircraft) :
|
||||||
|
bearing (_bearing),
|
||||||
heading( _heading ),
|
heading( _heading ),
|
||||||
alt ( _alt ),
|
alt ( _alt ),
|
||||||
radius ( _radius ),
|
radius ( _radius ),
|
||||||
dist ( _dist ),
|
dist ( _dist ),
|
||||||
LWC ( _LWC ),
|
LWC ( _LWC ),
|
||||||
lightning ( _lightning ),
|
lightning ( _lightning ),
|
||||||
|
aircraft ( _aircraft ),
|
||||||
cloudId ( _cloudId )
|
cloudId ( _cloudId )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/** the heading in radian is versus north */
|
/** the heading and bearing in radian are versus north */
|
||||||
float heading;
|
float bearing, heading;
|
||||||
float alt, radius, dist;
|
float alt, radius, dist;
|
||||||
|
|
||||||
/** reflectivity converted to liquid water content. */
|
/** reflectivity converted to liquid water content. */
|
||||||
double LWC;
|
double LWC;
|
||||||
|
|
||||||
/** if true then this data is for a lightning else it is for water echo. */
|
/** if true then this data is for a lightning else it is for water echo. */
|
||||||
bool lightning;
|
bool lightning;
|
||||||
|
|
||||||
|
/** if true then this data is for an aircraft */
|
||||||
|
bool aircraft;
|
||||||
|
|
||||||
/** Unique identifier of cloud */
|
/** Unique identifier of cloud */
|
||||||
int cloudId;
|
int cloudId;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user