summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7aa6fd4)
The original code forced a dependency in SimGear back to something that is
defined globaly in FlightGear, not a great strategy for a library with some
"general purpose" intentions.
#include <ieeefp.h>
#endif
#include <ieeefp.h>
#endif
static list_of_culledCloud inViewClouds;
// visibility distance for clouds in meters
static list_of_culledCloud inViewClouds;
// visibility distance for clouds in meters
// because no field can have an infinite size (and we don't want to reach his border)
// we draw this field and adjacent fields.
// adjacent fields are not real, its the same field displaced by some offset
// because no field can have an infinite size (and we don't want to reach his border)
// we draw this field and adjacent fields.
// adjacent fields are not real, its the same field displaced by some offset
-void SGCloudField::Render(void) {
+void SGCloudField::Render(float *sun_color) {
+ // sun_color used to depend on an extern SGSky *thesky definition
+ // above. However, this is bad form for a library and it's much
+ // more clean to just pass in the needed value. For reference, here is
+ // the old way that sun_color was fetched ...
+ // float *sun_color = thesky->get_sun_color();
+
#if 0
sgVec3 eyePos;
double relx, rely;
#if 0
sgVec3 eyePos;
double relx, rely;
sgScaleVec3 ( SGNewCloud::ambLight, ambient , 1.1f);
// trying something else : clouds are more yellow/red at dawn/dusk
// and added a bit of blue ambient
sgScaleVec3 ( SGNewCloud::ambLight, ambient , 1.1f);
// trying something else : clouds are more yellow/red at dawn/dusk
// and added a bit of blue ambient
- float *sun_color = thesky->get_sun_color();
sgScaleVec3 ( SGNewCloud::sunlight, sun_color , 0.4f);
SGNewCloud::ambLight[2] += 0.1f;
sgScaleVec3 ( SGNewCloud::sunlight, sun_color , 0.4f);
SGNewCloud::ambLight[2] += 0.1f;
void buildTestLayer(void);
// Render a cloud field
void buildTestLayer(void);
// Render a cloud field
+ void Render( float *sun_color );
// reposition the cloud layer at the specified origin and orientation
void reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt, float direction, float speed);
// reposition the cloud layer at the specified origin and orientation
void reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt, float direction, float speed);