fix good orientation on background or land object

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5062 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: a030a17bc46f8336374f9f077689b2d159afb304
Former-commit-id: 68630537f453eaab720b3ffe6ff17a670a951198
This commit is contained in:
torcs-ng 2012-12-02 21:56:03 +00:00
parent 7f177bea02
commit 2415d07771

View file

@ -45,17 +45,24 @@ osg::Node *SDBackground::build(bool type, int grWrldX, int grWrldY, const std::s
pathList.push_back(TrackPath);
pathList.push_back(LocalPath+"data/objects");
pathList.push_back(LocalPath+"data/textures");
osgDB::Registry::instance()->setDataFilePathList(pathList);
osg::Node *m_background = osgDB::readNodeFile("background-sky.ac");
osgDB::Registry::instance()->setDataFilePathList(pathList);
_background_transform = new osg::MatrixTransform;
osg::Matrix mat( 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);
if (!land)
{
_background_transform = new osg::MatrixTransform;
osg::Node *m_background = osgDB::readNodeFile("background-sky.ac");
_background_transform->setMatrix(mat);
_background_transform->addChild( m_background );
}
return m_background;
else
{
osg::Node *m_background = osgDB::readNodeFile("land.ac");
_background_transform->setMatrix(mat);
_background_transform->addChild( m_background );
}
return _background_transform.get();
}