Let the cloud layers follow the earth's surface. If you want the clouds to touch the horizon, just increase the spaen.

This commit is contained in:
ehofman
2004-03-22 21:31:24 +00:00
parent 2089a2a956
commit 71770eb92e

View File

@@ -203,7 +203,16 @@ SGCloudLayer::rebuild()
const float layer_scale = layer_span / scale;
const float mpi = SG_PI/4;
const float alt_diff = layer_asl * 0.8;
// caclculate the difference between a flat-earth model and
// a round earth model given the span and altutude ASL of
// the cloud layer. This is the difference in altitude between
// the top of the inverted bowl and the edge of the bowl.
// const float alt_diff = layer_asl * 0.8;
const float layer_to_core = (SG_EARTH_RAD * 1000 + layer_asl);
const float layer_angle = acos( 0.5*layer_span / layer_to_core);
const float border_to_core = layer_to_core * sin(layer_angle);
const float alt_diff = layer_to_core - border_to_core;
for (int i = 0; i < 4; i++)
{