// Constructor
-SGStars::SGStars( void ) {
+SGStars::SGStars( void ) :
+old_phase(-1)
+{
}
// 90 degrees = sun rise/set
// 180 degrees = darkest midnight
bool SGStars::repaint( double sun_angle, int num, sgdVec3 *star_data ) {
+ // cout << "repainting stars" << endl;
// double min = 100;
// double max = -100;
double mag, nmag, alpha, factor, cutoff;
float *color;
- static int old_phase = -1;
int phase;
// determine which star structure to draw
}
if( phase != old_phase ) {
+ // cout << " phase change, repainting stars, num = " << num << endl;
old_phase = phase;
for ( int i = 0; i < num; ++i ) {
// if ( star_data[i][2] < min ) { min = star_data[i][2]; }
sgSetVec4( color, 1.0, 1.0, 1.0, alpha );
// cout << "alpha[" << i << "] = " << alpha << endl;
}
+ } else {
+ // cout << " no phase change, skipping" << endl;
}
// cout << "min = " << min << " max = " << max << " count = " << num