[Plib-cvs] plib/src/ssgAux ssgaCelestialBody.cxx,1.1,1.2 ssgaCloudLayer.cxx,1.1,1.2 ssgaSky.cxx,1.1,
Brought to you by:
sjbaker
From: Nick M. <nm...@us...> - 2003-08-26 21:36:09
|
Update of /cvsroot/plib/plib/src/ssgAux In directory sc8-pr-cvs1:/tmp/cvs-serv8073/src/ssgAux Modified Files: ssgaCelestialBody.cxx ssgaCloudLayer.cxx ssgaSky.cxx ssgaSky.h ssgaStars.cxx Log Message: Fixed stars visible through moon, cloud visibility calc only when cloud enabled, cloud curving based on elevation, added cloud movement direction and speed Index: ssgaCelestialBody.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaCelestialBody.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaCelestialBody.cxx 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaCelestialBody.cxx 26 Aug 2003 21:36:04 -0000 1.2 @@ -43,7 +43,7 @@ glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT ); - glDisable( GL_DEPTH_TEST ); + //glDisable( GL_DEPTH_TEST ); glDisable( GL_FOG ); glBlendFunc ( GL_SRC_ALPHA, GL_ONE ) ; Index: ssgaCloudLayer.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaCloudLayer.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaCloudLayer.cxx 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaCloudLayer.cxx 26 Aug 2003 21:36:04 -0000 1.2 @@ -48,12 +48,14 @@ ssgaCloudLayer::ssgaCloudLayer( void ) : layer_root(new ssgRoot), layer_transform(new ssgTransform), + enabled(true), layer_span(0.0), layer_asl(0.0), layer_thickness(0.0), layer_transition(0.0), scale(4000.0), - enabled(true), + speed(0.0), [...115 lines suppressed...] + } + + // calculate cloud movement + double ax = 0.0, ay = 0.0, bx = 0.0, by = 0.0; + + if (dist > 0.0) { + ax = cos(course) * dist; + ay = sin(course) * dist; + } + + if (sp_dist > 0) { + bx = cos(-direction * SGD_DEGREES_TO_RADIANS) * sp_dist; + by = sin(-direction * SGD_DEGREES_TO_RADIANS) * sp_dist; + } + + float xoff = (float)((ax + bx) / (2 * scale)); + float yoff = (float)((ay + by) / (2 * scale)); const float layer_scale = layer_span / scale; Index: ssgaSky.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaSky.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaSky.cxx 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaSky.cxx 26 Aug 2003 21:36:04 -0000 1.2 @@ -92,14 +92,20 @@ pre_transform = new ssgTransform; post_transform = new ssgTransform; + bodies_transform = new ssgTransform; + stars_transform = new ssgTransform; + dome = new ssgaSkyDome; pre_transform -> addKid( dome->build( h_radius, v_radius ) ); planets = new ssgaStars; - pre_transform -> addKid( planets->build( nplanets, planet_data, h_radius ) ); [...186 lines suppressed...] - in_puff = false; - } - } + puff_progression += time_factor; - // never let visibility drop below 25 meters - if ( effvis <= 25.0 ) { - effvis = 25.0; + if ( puff_progression > puff_length + ramp_up + ramp_down) { + in_puff = false; + } + } + + // never let visibility drop below 25 meters + if ( effvis <= 25.0 ) { + effvis = 25.0; + } } } } // for Index: ssgaSky.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaSky.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaSky.h 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaSky.h 26 Aug 2003 21:36:04 -0000 1.2 @@ -137,12 +137,14 @@ ssgVertexArray *vl[4]; ssgTexCoordArray *tl[4]; + bool enabled; float layer_span; float layer_asl; float layer_thickness; float layer_transition; float scale; - bool enabled; + float speed; + float direction; double last_lon, last_lat; double last_x, last_y; @@ -155,8 +157,8 @@ void build( const char *cloud_tex_path, float span, float elevation, float thickness, float transition ); void build( ssgSimpleState *cloud_state, float span, float elevation, float thickness, float transition ); - bool repositionFlat( sgVec3 p ); - bool reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt ); + bool repositionFlat( sgVec3 p, double dt ); + bool reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt ); bool repaint( sgVec3 fog_color ); @@ -174,6 +176,12 @@ float getTransition () { return layer_transition; } void setTransition ( float transition ) { layer_transition = transition; } + + float getSpeed () { return speed; } + void setSpeed ( float val ) { speed = val; } + + float getDirection () { return direction; } + void setDirection ( float val ) { direction = val; } }; @@ -279,6 +287,7 @@ ssgSelector *pre_selector, *post_selector; ssgTransform *pre_transform, *post_transform; + ssgTransform *bodies_transform, *stars_transform; // visibility float visibility; @@ -310,8 +319,8 @@ ssgaCloudLayer* getCloud(int i) { return clouds.get(i); } int getCloudCount() { return clouds.getNum(); } - bool repositionFlat( sgVec3 view_pos, double spin = 0 ); - bool reposition( sgVec3 view_pos, sgVec3 zero_elev, sgVec3 view_up, double lon, double lat, double alt, double spin, double gst ); + bool repositionFlat( sgVec3 view_pos, double spin, double dt ); + bool reposition( sgVec3 view_pos, sgVec3 zero_elev, sgVec3 view_up, double lon, double lat, double alt, double spin, double gst, double dt ); bool repaint( sgVec4 sky_color, sgVec4 fog_color, sgVec4 cloud_color, double sun_angle, int nplanets, sgdVec3 *planet_data, Index: ssgaStars.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssgAux/ssgaStars.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ssgaStars.cxx 26 Jul 2003 06:16:19 -0000 1.1 +++ ssgaStars.cxx 26 Aug 2003 21:36:04 -0000 1.2 @@ -41,7 +41,7 @@ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT ); - glDisable( GL_DEPTH_TEST ); + //glDisable( GL_DEPTH_TEST ); glDisable( GL_FOG ); // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ; |