- update OsgGraph for sky
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6722 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: fe9e47b2314a4c52083f5c66657b894c8fcafe74 Former-commit-id: bb7ba355829a6eb23bc6625859d90f8216650e08
This commit is contained in:
parent
22f91e9216
commit
2b7215d917
5 changed files with 18 additions and 17 deletions
|
@ -227,7 +227,7 @@ int refresh(tSituation *s)
|
||||||
double Y = eye[1];
|
double Y = eye[1];
|
||||||
double Z = eye[2];
|
double Z = eye[2];
|
||||||
scenery->reposition(X, Y, Z );
|
scenery->reposition(X, Y, Z );
|
||||||
render->UpdateSky(s->currentTime, s->accelTime);
|
render->UpdateSky(s->currentTime, s->accelTime, X, Y);
|
||||||
screens->update(s, &frameInfo);
|
screens->update(s, &frameInfo);
|
||||||
|
|
||||||
//refresh the hud
|
//refresh the hud
|
||||||
|
|
|
@ -343,7 +343,7 @@ void SDRender::Init(tTrack *track)
|
||||||
double r_WrldX = scenery->getWorldX();
|
double r_WrldX = scenery->getWorldX();
|
||||||
double r_WrldY = scenery->getWorldY();
|
double r_WrldY = scenery->getWorldY();
|
||||||
//double r_WrldZ = SDScenery::getWorldZ();
|
//double r_WrldZ = SDScenery::getWorldZ();
|
||||||
osg::Vec3 viewPos(r_WrldX / 2, r_WrldY/ 2, 0.0 );
|
osg::Vec3d viewPos(r_WrldX / 2, r_WrldY/ 2, 0.0 );
|
||||||
|
|
||||||
weather();
|
weather();
|
||||||
thesky->set_visibility( SDVisibility ); // Visibility in meters
|
thesky->set_visibility( SDVisibility ); // Visibility in meters
|
||||||
|
@ -730,7 +730,7 @@ void SDRender::UpdateFogColor(double angle)
|
||||||
sd_gamma_correct_rgb( BaseFogColor._v );
|
sd_gamma_correct_rgb( BaseFogColor._v );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDRender::UpdateSky(double currentTime, double accelTime)
|
void SDRender::UpdateSky(double currentTime, double accelTime, double X, double Y)
|
||||||
{
|
{
|
||||||
// Detect first call (in order to initialize "last times").
|
// Detect first call (in order to initialize "last times").
|
||||||
static bool bInitialized = false;
|
static bool bInitialized = false;
|
||||||
|
@ -779,7 +779,8 @@ void SDRender::UpdateSky(double currentTime, double accelTime)
|
||||||
double r_WrldX = scenery->getWorldX();
|
double r_WrldX = scenery->getWorldX();
|
||||||
double r_WrldY = scenery->getWorldY();
|
double r_WrldY = scenery->getWorldY();
|
||||||
|
|
||||||
osg::Vec3 viewPos(r_WrldX / 2, r_WrldY/ 2, 0.0 );
|
//osg::Vec3 viewPos(r_WrldX / 2, r_WrldY/ 2, 0.0 );
|
||||||
|
osg::Vec3d viewPos(X, Y, 0.0 );
|
||||||
thesky->reposition(viewPos, 0, currentTime - lastTimeHighSpeed);
|
thesky->reposition(viewPos, 0, currentTime - lastTimeHighSpeed);
|
||||||
|
|
||||||
// Now, we are done for high speed objects.
|
// Now, we are done for high speed objects.
|
||||||
|
|
|
@ -107,7 +107,7 @@ public:
|
||||||
void UpdateLight(void);
|
void UpdateLight(void);
|
||||||
void addCars(osg::Node* cars);
|
void addCars(osg::Node* cars);
|
||||||
void UpdateFogColor(double angle);
|
void UpdateFogColor(double angle);
|
||||||
void UpdateSky(double currentTime, double accelTime);
|
void UpdateSky(double currentTime, double accelTime, double X, double Y);
|
||||||
void ShadowedScene(void);
|
void ShadowedScene(void);
|
||||||
void weather(void);
|
void weather(void);
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ bool SDSky::repaint( osg::Vec3f& sky_color, osg::Vec3f& fog_color, osg::Vec3f& c
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SDSky::reposition( osg::Vec3 &view_pos, double spin, /*double gst,*/
|
bool SDSky::reposition( osg::Vec3d &view_pos, double spin, /*double gst,*/
|
||||||
double dt )
|
double dt )
|
||||||
{
|
{
|
||||||
double angle;
|
double angle;
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
double moon_angle, int nplanets, osg::Vec3d *planet_data,
|
double moon_angle, int nplanets, osg::Vec3d *planet_data,
|
||||||
int nstars, osg::Vec3d *star_data);
|
int nstars, osg::Vec3d *star_data);
|
||||||
|
|
||||||
bool reposition(osg::Vec3 &view_pos, double spin, /*double gst,*/ double dt);
|
bool reposition(osg::Vec3d &view_pos, double spin, /*double gst,*/ double dt);
|
||||||
|
|
||||||
void modify_vis( float alt, float time_factor );
|
void modify_vis( float alt, float time_factor );
|
||||||
|
|
||||||
|
@ -142,33 +142,33 @@ public:
|
||||||
SDCloudLayer * get_cloud_layer (int i);
|
SDCloudLayer * get_cloud_layer (int i);
|
||||||
int get_cloud_layer_count () const;
|
int get_cloud_layer_count () const;
|
||||||
|
|
||||||
void setMA(double angle) { moon->setMoonAngle(angle); }
|
void setMA(double angle) { moon->setMoonAngle(angle); }
|
||||||
double getMA() { return moon->getMoonAngle(); }
|
double getMA() { return moon->getMoonAngle(); }
|
||||||
|
|
||||||
void setMR(double rotation) { moon->setMoonRotation( rotation); }
|
void setMR(double rotation) { moon->setMoonRotation( rotation); }
|
||||||
double getMR() { return moon->getMoonRotation(); }
|
double getMR() { return moon->getMoonRotation(); }
|
||||||
void setMRA( double ra ) { moon->setMoonRightAscension( ra ); }
|
void setMRA( double ra ) { moon->setMoonRightAscension( ra ); }
|
||||||
double getMRA() { return moon->getMoonRightAscension(); }
|
double getMRA() { return moon->getMoonRightAscension(); }
|
||||||
|
|
||||||
void setMD( double decl ) { moon->setMoonDeclination( decl ); }
|
void setMD( double decl ) { moon->setMoonDeclination( decl ); }
|
||||||
double getMD() { return moon->getMoonDeclination(); }
|
double getMD() { return moon->getMoonDeclination(); }
|
||||||
|
|
||||||
void setMDist( double dist ) { moon->setMoonDist(dist); }
|
void setMDist( double dist ) { moon->setMoonDist(dist); }
|
||||||
double getMDist() { return moon->getMoonDist(); }
|
double getMDist() { return moon->getMoonDist(); }
|
||||||
|
|
||||||
void setSA(double angle) { sun->setSunAngle(angle); }
|
void setSA(double angle) { sun->setSunAngle(angle); }
|
||||||
double getSA() { return sun->getSunAngle(); }
|
double getSA() { return sun->getSunAngle(); }
|
||||||
|
|
||||||
void setSR(double rotation) { sun->setSunRotation( rotation ); }
|
void setSR(double rotation) { sun->setSunRotation( rotation ); }
|
||||||
double getSR() { return sun->getSunRotation(); }
|
double getSR() { return sun->getSunRotation(); }
|
||||||
|
|
||||||
void setSRA(double ra) { sun->setSunRightAscension( ra ); }
|
void setSRA(double ra) { sun->setSunRightAscension( ra ); }
|
||||||
double getSRA() { return sun->getSunRightAscension(); }
|
double getSRA() { return sun->getSunRightAscension(); }
|
||||||
|
|
||||||
void setSD( double decl ) { sun->setSunDeclination( decl ); }
|
void setSD( double decl ) { sun->setSunDeclination( decl ); }
|
||||||
double getSD() { return sun->getSunDeclination(); }
|
double getSD() { return sun->getSunDeclination(); }
|
||||||
|
|
||||||
void setSDistance( double dist ) { sun->setSunDistance( dist ); }
|
void setSDistance( double dist ) { sun->setSunDistance( dist ); }
|
||||||
double getSDistance() { return sun->getSunDistance(); }
|
double getSDistance() { return sun->getSunDistance(); }
|
||||||
|
|
||||||
inline float get_visibility() const { return effective_visibility; }
|
inline float get_visibility() const { return effective_visibility; }
|
||||||
|
|
Loading…
Reference in a new issue