update OsgDome
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5334 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 5ffd3d53be36cb26f006ad75a8aa30acba79d7e8 Former-commit-id: 245f2e3d38a3b24d749ce3f6491defdae27861e7
This commit is contained in:
parent
e54d751494
commit
279391a7b7
3 changed files with 34 additions and 32 deletions
|
@ -204,8 +204,8 @@ bool SDSkyDome::repaint( const Vec3f& sky_color,
|
||||||
osg::Vec3f middle_param, middle_diff;
|
osg::Vec3f middle_param, middle_diff;
|
||||||
|
|
||||||
// Check for sunrise/sunset condition
|
// Check for sunrise/sunset condition
|
||||||
sun_angle = osg::RadiansToDegrees(sun_angle);
|
//sun_angle = osg::RadiansToDegrees(sun_angle);
|
||||||
if (sun_angle > 80)
|
if (sun_angle > 80.0)
|
||||||
{
|
{
|
||||||
// 0.0 - 0.4
|
// 0.0 - 0.4
|
||||||
double sunAngleFactor = 10.0 - fabs(90.0 - sun_angle);
|
double sunAngleFactor = 10.0 - fabs(90.0 - sun_angle);
|
||||||
|
|
|
@ -349,7 +349,7 @@ int initTrack(tTrack *track)
|
||||||
|
|
||||||
scenery = new SDScenery;
|
scenery = new SDScenery;
|
||||||
render = new SDRender;
|
render = new SDRender;
|
||||||
osg::Group *sceneroot = new osg::Group();
|
osg::ref_ptr<osg::Group> sceneroot = new osg::Group();
|
||||||
m_sceneroot = new osg::Group();
|
m_sceneroot = new osg::Group();
|
||||||
sceneroot->addChild(scenery->LoadScene(track));
|
sceneroot->addChild(scenery->LoadScene(track));
|
||||||
|
|
||||||
|
@ -384,10 +384,11 @@ int initCars(tSituation *s)
|
||||||
|
|
||||||
void shutdownTrack(void)
|
void shutdownTrack(void)
|
||||||
{
|
{
|
||||||
|
delete scenery;
|
||||||
m_sceneroot->removeChildren(0,m_sceneroot->getNumChildren());
|
m_sceneroot->removeChildren(0,m_sceneroot->getNumChildren());
|
||||||
// Do the real track termination job.
|
// Do the real track termination job.
|
||||||
osgDB::Registry::instance()->clearObjectCache();
|
osgDB::Registry::instance()->clearObjectCache();
|
||||||
delete scenery;
|
|
||||||
//grShutdownScene();
|
//grShutdownScene();
|
||||||
|
|
||||||
if (grTrackHandle)
|
if (grTrackHandle)
|
||||||
|
|
|
@ -38,6 +38,7 @@ class SDScenery;
|
||||||
class SDBackground
|
class SDBackground
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Group> _background;
|
osg::ref_ptr<osg::Group> _background;
|
||||||
|
osg::ref_ptr<osg::Group> _scenery;
|
||||||
osg::ref_ptr<osg::MatrixTransform> _background_transform;
|
osg::ref_ptr<osg::MatrixTransform> _background_transform;
|
||||||
|
|
||||||
bool _type;
|
bool _type;
|
||||||
|
|
Loading…
Reference in a new issue