fix path for osgloader

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

Former-commit-id: f6b2b0c8451acafb899c81f7071f3ad8b131a4e5
Former-commit-id: 47f230dc022eb4e2fc589772a0ca74b182574e55
This commit is contained in:
torcs-ng 2012-10-19 18:09:13 +00:00
parent 9266024df1
commit 22511d15c6
2 changed files with 20 additions and 2 deletions

View file

@ -1,6 +1,8 @@
#include "OsgLoader.h"
//#include "ReaderWriterACC.h"
#include <tgf.hpp>
osgLoader::osgLoader(void)
{
m_pOpt = new osgDB::ReaderWriter::Options();
@ -45,6 +47,7 @@ osg::Node *osgLoader::Load3dFile(std::string strFile)
{
pNode = osgDB::readNodeFile(strFile, m_pOpt);
}
GfOut("le test %d \n",pNode);
return pNode;
}

View file

@ -174,11 +174,12 @@ void setViewer(osg::ref_ptr<osgViewer::Viewer> msV)
bool LoadTrack(std::string strTrack)
{
GfOut("Chemin Track : %s\n", strTrack.c_str());
osgLoader loader;
loader.AddSearchPath(m_strTexturePath);
osg::Node *pTrack = loader.Load3dFile(strTrack);
//osgDB::writeNodeFile(*pTrack,"c:\\users\\gavin\\mytrack.osg");
//osgDB::writeNodeFile(*pTrack,"mytrack.osg");
if (pTrack)
{
@ -199,6 +200,19 @@ bool LoadTrack(std::string strTrack)
return true;
}
/*void grOSG::SetCamera(osg::Matrixf projMat,osg::Matrixf modelMat)
{
m_pCamera->setProjectionMatrix(projMat);
m_pCamera->setViewMatrix(modelMat);
}
void grOSG::SetCamera(osg::Vec3 center,osg::Vec3 eye,osg::Vec3 up,float fov,float aspect,float znear,float zfar)
{
m_pCamera->setProjectionMatrixAsPerspective(fov,aspect,znear,zfar);
m_pCamera->setViewMatrixAsLookAt(eye,center,up);
}*/
int
grLoadScene(tTrack *track)
{
@ -246,6 +260,7 @@ grLoadScene(tTrack *track)
std::string strPath = GetDataDir();
sprintf(buf, "tracks/%s/%s", grTrack->category, grTrack->internalname);
strPath+=buf;
//strPath+="tracks/speedway/milky-five";
strPath+="/";
strPath+=acname;